@ckeditor/ckeditor5-ai 47.5.0-alpha.7 → 47.5.0
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/dist/index.js +5 -5
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +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/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatballoon.js +1 -1
- package/src/aichat/aichatcontroller.js +1 -1
- 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/ui/aichatballoonview.js +1 -1
- 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/aichatcontextresourceslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatcontextresourcesview.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/aichatresourcessearchinputview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcustomelementview.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/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 +2 -2
- 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.d.ts +5 -2
- 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.d.ts +4 -2
- package/src/aicore/model/aiinteraction.js +1 -1
- package/src/aicore/model/aimodels.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/aisuggestioncontentpartheaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionloaderview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiwebsourcesview.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/aicore/utils/scrollmanager.js +1 -1
- package/src/aieditorintegration/aieditorintegration.js +1 -1
- package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +1 -1
- package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +1 -1
- 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/ui/aiquickactionsfilteredlistview.js +1 -1
- package/src/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.js +1 -1
- package/src/aiquickactions/ui/balloon/aiactionsballoontoolbarview.js +1 -1
- package/src/aiquickactions/ui/balloon/aiactionsballoonview.js +1 -1
- package/src/aiquickactions/ui/dropdownmenubuttonwithhighlightview.js +1 -1
- package/src/aireviewcore/aireviewcorecontroller.js +1 -1
- package/src/aireviewcore/aireviewcoreediting.js +1 -1
- package/src/aireviewcore/aireviewcoreui.js +1 -1
- package/src/aireviewcore/model/aireviewcheck.js +1 -1
- package/src/aireviewcore/model/aireviewchecklist.js +1 -1
- package/src/aireviewcore/model/aireviewcheckresult.js +1 -1
- package/src/aireviewcore/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewcore/model/aireviewcheckrun.js +1 -1
- package/src/aireviewcore/model/aireviewsystemcheckrun.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreballoonsuggestionview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorechecklistitemresultview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorecustomcheckview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorefinishreviewbuttonview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoregeneralerrorview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorepromptinputview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewchecklistview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewcommandlistitemview.js +1 -1
- package/src/aireviewcore/ui/aireviewcorereviewcompletedview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreuicheckresultsview.js +1 -1
- package/src/aireviewcore/ui/aireviewcoreview.js +1 -1
- package/src/aireviewcore/ui/form/aireviewcoreformdropdown.js +1 -1
- package/src/aireviewcore/ui/form/aireviewcoreformmanager.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/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewmodechecklist.js +1 -1
- package/src/aitabs/aitabs.js +1 -1
- 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/aitranslate/aitranslate.js +1 -1
- package/src/aitranslate/aitranslatecontroller.js +1 -1
- package/src/aitranslate/aitranslateui.js +1 -1
- package/src/aitranslate/model/aitranslatecheck.js +1 -1
- package/src/aitranslate/model/aitranslatechecklist.js +1 -1
- package/src/aitranslate/model/aitranslatecheckrun.js +1 -1
- package/src/aitranslate/ui/aitranslatechecklistview.js +1 -1
- package/src/aitranslate/ui/aitranslatecheckresultsview.js +1 -1
- package/src/errors.js +1 -1
- package/src/errorsmap.js +1 -1
- package/src/index.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x539ee4,Command as Qt,ContextPlugin as _0x47e329,Editor as nt}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4d5e4c,IconCheck as _0x35b8d8,IconError as _0x4768eb,IconSubmit as _0xbd2e80,IconAIHistory as vt,IconMagicWand as _0x51a368,IconRobotPencil as _0x1ef70c,IconMaximize as _0x1a201,IconMinimize as to,IconShowChangesOn as _0x386d26,IconShowChangesOff as _0x5a10c1,IconDocument as _0x3b7e7d,IconBoxWithCross as _0xb7ebb,IconBoxWithCheck as _0x35010c,IconBoxWithMarker as _0x3632ea,IconInfo as _0x4a3016,IconLoupe as _0x347d72,IconCancel as _0x2d25cb,IconStop as _0x45c531,IconAIChat as Et,IconPlus as _0x5b719b,IconPin as _0x519981,IconThreeHorizontalDots as _0x1f6141,IconChevronDown as _0x23375e,IconChevronUp as _0x4dacc1,IconOutdated as _0x16115a,IconEye as _0x232f9e,IconEyeCrossedOut as _0x12db4d,IconChevronRight as _0x2b659e,IconAIReview as _0x54fb8d,IconAITranslate as _0x47e0a1}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0xdeade1,CKEditorError as _0x32ab89,ObservableMixin as ts,global as Ot,isVisible as _0x2ebbda,Rect as bt,Collection as _0xf46d2e,FocusTracker as _0x59aa0e,KeystrokeHandler as _0x151440,first as _0x3a1e6c,toArray as _0x388a6f,EmitterMixin as Wt,logWarning as _0x2ad26e,logError as rt,scrollViewportToShowTarget as at,scrollAncestorsToShowTarget as _0xfabcf7,ResizeObserver as _0x59ca1a,_isMotionReduced as mt,getConstrainedViewportRect as _0x3c03a9,DomEmitterMixin as Lt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x2cc502,ButtonView as _0x3c2d24,View as _0x2d8061,SpinnerView as _0xe6ea79,IconView as _0x4dad4f,AutocompleteView as _0x2393c6,ListView as _0x366e5d,ListItemGroupView as _0x359562,ListItemView as _0x8f7dd0,ButtonLabelView as _0x4566cf,FocusCycler as _0x2427c3,createLabeledTextarea as _0x4fcc6d,Dialog as _0x15fff9,createDropdown as _0x59c3f3,addMenuToDropdown as _0x112092,MenuBarMenuView as _0x37d352,MenuBarMenuListItemButtonView as _0x215c67,DialogViewPosition as _0x3443fd,MenuBarMenuListView as _0x558ce9,MenuBarMenuListItemView as _0x4d6df1,BodyCollection as _0x4bb856,BalloonPanelView as _0x90b260,clickOutsideHandler as _0x579de4,addListToDropdown as _0x1c418d,UIModel as _0x491ca2,submitHandler as _0x14a95e,LabeledFieldView as _0x26be3f,createLabeledInputText as th,FormHeaderView as _0x4b4b8d,HighlightedTextView as _0x5027dd,ViewCollection as _0x215181,FileDialogButtonView as _0x1133e2,InputTextView as _0x5d3204,SearchTextView as _0x1e3f51,ListItemButtonView as _0x1c542a,ButtonLabelWithHighlightView as _0x1920d7,DropdownMenuPanelPositioningFunctions as _0x49d0ef,BalloonToolbar as _0x318f8b,FormRowView as _0x60f2e3,TextareaView as _0x5121e5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x654a17,ClipboardMarkersUtils as _0x3f9fd2}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4b2088,ViewDataTransfer as _0x579ab9,ViewUpcastWriter as _0x4df078,Matcher as _0x476ad0,_DetachOperation as _0x515526,_insertIntoModelNodeList as _0xa29121,_removeFromModelNodeList as _0x372cfd,ModelRange as _0x21f9f5,transformOperationSets as _0x471b37,ViewDowncastWriter as Dt,ModelDocumentFragment as _0x1a00f1,ModelPosition as _0x192d6b,ModelTreeWalker as Gt,MarkerOperation as Bt,InsertOperation as Ft}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x9255b7,escape as _0x3bf51a,escapeRegExp as _0x1173f5,debounce as Jt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x49581d,InvokeModelWithResponseStreamCommand as _0x73eefb,InvokeModelCommand as _0x3a19a5}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x3e6807}from'htmlparser2';import{isTag as _0x3497c5,findOne as _t,getParent as _0x1890dd,findAll as _0x1010b3,removeElement as _0x5e22d6,replaceElement as _0x4854f8,prepend as _0x1e41ac,prependChild as _0x59b5dd,appendChild as _0x5db947,append as _0xb74017,find as _0x53a8b4,isComment as _0x588a3b,getChildren as _0x11ae0d,textContent as _0x2c1e68}from'domutils';import _0x4dfa58 from'dom-serializer';import{Document as ft,Element as _0x555852,Text as _0x28d976,cloneNode as _0x296ed0,isDocument as _0x5e6b17,isText as _0x38814e,NodeWithChildren as _0x3b9f39}from'domhandler';import{MarkdownGfmMdToHtml as _0x5ee80f}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x314060,DocumentCompare as _0xac1d67,DATA_ID_MODEL_ATTRIBUTE as gt,ConfirmMixin as _0x16284c,LateFocusDropdownButtonView as _0x44802b,getAllMarkersDomElementsSorted as Mt,SuggestionsConversion as qt,DATA_ID_VIEW_ATTRIBUTE as Ut,getMarkerDomElement as zt}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x39c5ed}from'es-toolkit';import _0x3e6a65 from'morphdom';import{IconWeb as _0x3eae45,IconClose as _0x1c5b98,IconDocument as _0x39f310,IconSelection as _0x465133,IconFileUpload as _0x52603b,IconLink as _0x374880,IconBulb as _0x58c2b6,IconAI as _0x219404,IconPreviousArrow as _0x4fd96d,IconCheck as _0x2c4a04,IconDocumentOutline as _0x589ec0,IconPaperClip as _0x401aa1,IconBrowseFiles as _0xe4569a,IconDropdownArrow as _0x281211,IconAIAskAI as _0x21e5a5,IconThumbUp as _0xd29c90,IconThumbDown as _0x29cd06,IconCopy as _0x437de3,IconShowChangesOff as _0x47c031,IconShowChangesOn as _0x4cd1c0,IconAIQuickActions as _0x45cf17,IconAIChatCommands as Zt,IconAIImproveWriting as _0x33db0d,IconAIContinueWriting as te,IconAIGrammarCheck as _0x41c232,IconAIAdjustLength as Yt,IconAIChangeTone as Xt,IconAITranslate as _0x145f81,IconAIOther as _0x4b2a2e,IconRefresh as _0x31e211,IconNextArrow as _0x4ec314}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x58f5d1}from'diff';const x='_ungrouppedCommands';function o(_0x363d4c,_0x20dfa4){const _0x4649c5=(0x0,_0x20dfa4['t'])('Other');return _0x363d4c['length']?'groupId'in _0x363d4c[0x0]?_0x363d4c:[{'groupId':x,'groupLabel':_0x4649c5,'order':0x1/0x0,'commands':_0x363d4c}]:[{'groupId':x,'groupLabel':_0x4649c5,'order':0x1/0x0,'commands':[]}];}const Bn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x539ee4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c4627}=this,_0x4b7e46=['ck-fake-ai-selection'];_0x2c4627['config']['get']('ai.assistant.useTheme')&&_0x4b7e46['push']('ck-ai-assistant-ui_theme'),_0x2c4627['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4b7e46,'priority':0xc}}),_0x2c4627['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2c7a25,{writer:_0x3a897d})=>{if(!_0x2c7a25['markerRange']['isCollapsed'])return null;const _0x21f35e=_0x3a897d['createUIElement']('span');return _0x3a897d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x21f35e),_0x21f35e;}});}['afterInit'](){!async function(_0x9f7129){const _0x10ae8b=_0x11012f([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]),_0x58d42d=0x3dffc4e1,_0x574538=0x3df845b1^_0x58d42d,_0x2e40c2=window[_0x11012f([0x44,0x61,0x74,0x65])][_0x11012f([0x6e,0x6f,0x77])](),_0x28fe46=_0x9f7129[_0x11012f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x199492=new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x547b64=>{_0x28fe46[_0x11012f([0x6f,0x6e,0x63,0x65])](_0x11012f([0x72,0x65,0x61,0x64,0x79]),_0x547b64);}),_0x1a6a47={[_0x11012f([0x6b,0x74,0x79])]:_0x11012f([0x45,0x43]),[_0x11012f([0x75,0x73,0x65])]:_0x11012f([0x73,0x69,0x67]),[_0x11012f([0x63,0x72,0x76])]:_0x11012f([0x50,0x2d,0x32,0x35,0x36]),[_0x11012f([0x78])]:_0x11012f([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]),[_0x11012f([0x79])]:_0x11012f([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]),[_0x11012f([0x61,0x6c,0x67])]:_0x11012f([0x45,0x53,0x32,0x35,0x36])},_0xa8157c=_0x28fe46[_0x11012f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x11012f([0x67,0x65,0x74])](_0x11012f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xcb13d5(){let _0x8993f2,_0x119cf6=null,_0x54de4c=null;try{if(_0xa8157c==_0x11012f([0x47,0x50,0x4c]))return _0x11012f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x8993f2=_0x256e3d(),!_0x8993f2)return _0x11012f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x8993f2[_0x11012f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x54de4c=_0x54f5de(_0x8993f2[_0x11012f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x8993f2[_0x11012f([0x6a,0x74,0x69])])),await _0x6d3cbe()?_0x1c5484()?_0x4760b3()?_0x11012f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1d7534()?(_0x8993f2[_0x11012f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x11012f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x119cf6=_0x4c3879(_0x11012f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1e5c7d()):_0x11012f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x11012f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x11012f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x11012f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4760b3(){const _0x247a28=[_0x11012f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x11012f([0x74,0x72,0x69,0x61,0x6c])][_0x11012f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8993f2[_0x11012f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2e40c2/0x3e8:0xe10*_0x574538;return _0x8993f2[_0x11012f([0x65,0x78,0x70])]<_0x247a28;}function _0x1c5484(){const _0x20812d=_0x8993f2[_0x11012f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x20812d&&(!!_0x20812d[_0x11012f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x11012f([0x2a]))||!!_0x20812d[_0x11012f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x11012f([0x41,0x49])));}function _0x1d7534(){const _0x128793=_0x8993f2[_0x11012f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x128793||0x0==_0x128793[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x37505f}=new URL(window[_0x11012f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x128793[_0x11012f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x37505f))return!0x0;const _0x2297fd=_0x37505f[_0x11012f([0x73,0x70,0x6c,0x69,0x74])](_0x11012f([0x2e]));return _0x128793[_0x11012f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x9ca4db=>_0x9ca4db[_0x11012f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x11012f([0x2a])))[_0x11012f([0x6d,0x61,0x70])](_0x13e9d1=>_0x13e9d1[_0x11012f([0x73,0x70,0x6c,0x69,0x74])](_0x11012f([0x2e])))[_0x11012f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3e07ed=>_0x3e07ed[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2297fd[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x11012f([0x6d,0x61,0x70])](_0x5aefe5=>Array(_0x2297fd[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5aefe5[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x11012f([0x66,0x69,0x6c,0x6c])](_0x5aefe5[0x0]===_0x11012f([0x2a])?_0x11012f([0x2a]):'')[_0x11012f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5aefe5))[_0x11012f([0x73,0x6f,0x6d,0x65])](_0x3142f4=>_0x2297fd[_0x11012f([0x65,0x76,0x65,0x72,0x79])]((_0x2b7fae,_0x4a01cf)=>_0x3142f4[_0x4a01cf]===_0x2b7fae||_0x3142f4[_0x4a01cf]===_0x11012f([0x2a])));}function _0x1e5c7d(){return _0x119cf6&&_0x54de4c?new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5546d3,_0x57ce6b)=>{_0x119cf6[_0x11012f([0x74,0x68,0x65,0x6e])](_0x5546d3,_0x57ce6b),_0x54de4c[_0x11012f([0x74,0x68,0x65,0x6e])](_0x1b7968=>{_0x1b7968!=_0x11012f([0x56,0x61,0x6c,0x69,0x64])&&_0x5546d3(_0x1b7968);},_0x57ce6b);}):_0x119cf6||_0x54de4c||_0x11012f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x54f5de(_0x4b76c7,_0x54ff62){return new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x24c2b9=>{if(_0x93b0ce())return _0x24c2b9(_0x11012f([0x56,0x61,0x6c,0x69,0x64]));_0x53fe80(),_0x28fe46[_0x11012f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x11012f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x134e8f=!0x1;const _0x16b412=_0xdeade1();function _0x291e5a(_0x5a681e){return!!_0x5a681e&&(typeof _0x5a681e===_0x11012f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5a681e===_0x11012f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5a681e[_0x11012f([0x74,0x68,0x65,0x6e])]===_0x11012f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5a681e[_0x11012f([0x63,0x61,0x74,0x63,0x68])]===_0x11012f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x23c0de(_0xcac45f){_0x25661f(_0xcac45f)[_0x11012f([0x74,0x68,0x65,0x6e])](_0x15584c=>{if(!_0x15584c||_0x15584c[_0x11012f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x11012f([0x6f,0x6b]))return _0x11012f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x33f9e3(_0x304739(_0x16b412+_0x54ff62))!=_0x15584c[_0x11012f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x11012f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x11012f([0x56,0x61,0x6c,0x69,0x64]);})[_0x11012f([0x74,0x68,0x65,0x6e])](_0x6fdb35=>(_0x4053ef(),_0x6fdb35),()=>{const _0xea0b85=_0x3dc62c();return null==_0xea0b85?(_0x4053ef(),_0x11012f([0x56,0x61,0x6c,0x69,0x64])):_0x11012f(_0x2e40c2-_0xea0b85>(0x19f340e1^_0x58d42d)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x11012f([0x74,0x68,0x65,0x6e])](_0x24c2b9)[_0x11012f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x24c2b9(_0x11012f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x47f4db=0x3dc92a61^_0x58d42d;function _0x4053ef(){const _0x55fc0f=_0x11012f([0x6c,0x6c,0x63,0x74,0x2d])+_0x33f9e3(_0x304739(_0x4b76c7)),_0x27d84e=_0x40edc7(_0x33f9e3(window[_0x11012f([0x4d,0x61,0x74,0x68])][_0x11012f([0x63,0x65,0x69,0x6c])](_0x2e40c2/_0x47f4db)));window[_0x11012f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x11012f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x55fc0f,_0x27d84e);}function _0x3dc62c(){const _0x4f4f50=_0x11012f([0x6c,0x6c,0x63,0x74,0x2d])+_0x33f9e3(_0x304739(_0x4b76c7)),_0x25753a=window[_0x11012f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x11012f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4f4f50);return _0x25753a?window[_0x11012f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x40edc7(_0x25753a),0x10)*_0x47f4db:null;}function _0x25661f(_0x264335){return new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4781e5,_0x4a62dd)=>{_0x264335[_0x11012f([0x74,0x68,0x65,0x6e])](_0x4781e5,_0x4a62dd),window[_0x11012f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4a62dd,0x3dfe1021^_0x58d42d);});}}_0x28fe46[_0x11012f([0x6f,0x6e])](_0x11012f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x58e4f4,_0x1c7bd6)=>{if(_0x1c7bd6[0x0]!=_0x4b76c7)return _0x24c2b9(_0x11012f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1c7bd6[0x1]={..._0x1c7bd6[0x1],[_0x11012f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x16b412};},{[_0x11012f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x11012f([0x68,0x69,0x67,0x68])}),_0x28fe46[_0x11012f([0x6f,0x6e])](_0x11012f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xa20fc9=>{_0x291e5a(_0xa20fc9[_0x11012f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x134e8f=!0x0,_0x23c0de(_0xa20fc9[_0x11012f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x11012f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x11012f([0x6c,0x6f,0x77])}),_0x199492[_0x11012f([0x74,0x68,0x65,0x6e])](()=>{_0x134e8f||_0x24c2b9(_0x11012f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x93b0ce(){return _0x28fe46[_0x11012f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x11012f([0x76,0x69,0x65,0x77])][_0x11012f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x11012f([0x61,0x75,0x74,0x6f]);}function _0x53fe80(){_0x28fe46[_0x11012f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x11012f([0x76,0x69,0x65,0x77])][_0x11012f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x11012f([0x61,0x75,0x74,0x6f]);}}function _0x4c3879(_0x369bed){const _0x43cbed=[new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x172262=>setTimeout(_0x172262,0x3df6fa2d^_0x58d42d)),_0x199492[_0x11012f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x580533=>{let _0x3e2352=0x0;_0x28fe46[_0x11012f([0x6d,0x6f,0x64,0x65,0x6c])][_0x11012f([0x6f,0x6e])](_0x11012f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2d96ea,_0x5c55cd)=>{_0x5c55cd[0x0][_0x11012f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3e2352++,_0x3e2352==(0x3dffc109^_0x58d42d)&&(_0x580533(),_0x2d96ea[_0x11012f([0x6f,0x66,0x66])]());});}))];return window[_0x11012f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x11012f([0x72,0x61,0x63,0x65])](_0x43cbed)[_0x11012f([0x74,0x68,0x65,0x6e])](()=>_0x369bed);}async function _0x31da66(){await _0x199492,_0x28fe46[_0x11012f([0x6d,0x6f,0x64,0x65,0x6c])][_0x11012f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4a6438,_0x28fe46[_0x11012f([0x6d,0x6f,0x64,0x65,0x6c])][_0x11012f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4a6438,_0x28fe46[_0x11012f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x11012f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5575ac(_0x1590d3){const _0x143598=_0x200fe7();_0x28fe46[_0x143598]=_0x11012f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1590d3,_0x1590d3!=_0x11012f([0x56,0x61,0x6c,0x69,0x64])&&_0x31da66();}function _0x200fe7(){const _0x2eba57=window[_0x11012f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x11012f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x11012f([0x6e,0x6f,0x77])]())[_0x11012f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x11012f([0x2e]),'');let _0x27e563=_0x11012f([0x6e]);for(let _0x528b95=0x0;_0x528b95<_0x2eba57[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x528b95+=0x2){let _0x2b0052=window[_0x11012f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2eba57[_0x11012f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x528b95,_0x528b95+0x2));_0x2b0052>=_0x10ae8b[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2b0052-=_0x10ae8b[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x27e563+=_0x10ae8b[_0x2b0052];}return _0x27e563;}function _0x256e3d(){const _0x44c0fb=_0xa8157c[_0x11012f([0x73,0x70,0x6c,0x69,0x74])](_0x11012f([0x2e]));if(0x3!=_0x44c0fb[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2d7a5e(_0x44c0fb[0x1]);function _0x2d7a5e(_0x265738){const _0xc764ea=_0x2fe3d5(_0x265738);return _0xc764ea&&_0x3f9320()?_0xc764ea:null;function _0x3f9320(){const _0x2e362b=_0xc764ea[_0x11012f([0x6a,0x74,0x69])],_0x202f09=window[_0x11012f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2e362b[_0x11012f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2e362b[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1da2e0={..._0xc764ea,[_0x11012f([0x6a,0x74,0x69])]:_0x2e362b[_0x11012f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2e362b[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1da2e0[_0x11012f([0x76,0x63])],_0x304739(_0x1da2e0)==_0x202f09;}}}async function _0x6d3cbe(){let _0x91d259=!0x0;try{const _0x5cc2de=_0xa8157c[_0x11012f([0x73,0x70,0x6c,0x69,0x74])](_0x11012f([0x2e])),[_0x551680,_0x5750c6,_0x299598]=_0x5cc2de;return _0x4cb634(_0x551680),await _0x2efb6a(_0x551680,_0x5750c6,_0x299598),_0x91d259;}catch{return!0x1;}function _0x4cb634(_0x3b4e50){const _0x5daae0=_0x2fe3d5(_0x3b4e50);_0x5daae0&&_0x5daae0[_0x11012f([0x61,0x6c,0x67])]==_0x11012f([0x45,0x53,0x32,0x35,0x36])||(_0x91d259=!0x1);}async function _0x2efb6a(_0x2b70db,_0xca2044,_0x402194){const _0x263e8c=window[_0x11012f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x11012f([0x66,0x72,0x6f,0x6d])](_0x34f5ca(_0x402194),_0xd33ea3=>_0xd33ea3[_0x11012f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x512a4f=new window[(_0x11012f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x11012f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2b70db+_0x11012f([0x2e])+_0xca2044),_0xb2c571=window[_0x11012f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x11012f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xb2c571)return;const _0x271713=await _0xb2c571[_0x11012f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x11012f([0x6a,0x77,0x6b]),_0x1a6a47,{[_0x11012f([0x6e,0x61,0x6d,0x65])]:_0x11012f([0x45,0x43,0x44,0x53,0x41]),[_0x11012f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x11012f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x11012f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xb2c571[_0x11012f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x11012f([0x6e,0x61,0x6d,0x65])]:_0x11012f([0x45,0x43,0x44,0x53,0x41]),[_0x11012f([0x68,0x61,0x73,0x68])]:{[_0x11012f([0x6e,0x61,0x6d,0x65])]:_0x11012f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x271713,_0x263e8c,_0x512a4f)||(_0x91d259=!0x1);}}function _0x2fe3d5(_0x1a483b){return _0x1a483b[_0x11012f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x11012f([0x65,0x79]))?JSON[_0x11012f([0x70,0x61,0x72,0x73,0x65])](_0x34f5ca(_0x1a483b)):null;}function _0x34f5ca(_0x46ac5a){return window[_0x11012f([0x61,0x74,0x6f,0x62])](_0x46ac5a[_0x11012f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x11012f([0x2b]))[_0x11012f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x11012f([0x2f])));}function _0x304739(_0x2c50ed){let _0x35c1ea=0x1505;function _0x537401(_0x24ec81){for(let _0x477afb=0x0;_0x477afb<_0x24ec81[_0x11012f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x477afb++){const _0x322638=_0x24ec81[_0x11012f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x477afb);_0x35c1ea=(_0x35c1ea<<0x5)+_0x35c1ea+_0x322638,_0x35c1ea&=_0x35c1ea;}}function _0xc41ec6(_0x4eb3b5){Array[_0x11012f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4eb3b5)?_0x4eb3b5[_0x11012f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xc41ec6):_0x4eb3b5&&typeof _0x4eb3b5==_0x11012f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x11012f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4eb3b5)[_0x11012f([0x73,0x6f,0x72,0x74])]()[_0x11012f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x191205,_0x5a7a85])=>{_0x537401(_0x191205),_0xc41ec6(_0x5a7a85);}):_0x537401(window[_0x11012f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4eb3b5));}return _0xc41ec6(_0x2c50ed),_0x35c1ea>>>0x0;}function _0x33f9e3(_0x48e2d6){return _0x48e2d6[_0x11012f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x11012f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x11012f([0x30]));}function _0x40edc7(_0x23624f){return _0x23624f[_0x11012f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x11012f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x11012f([0x6a,0x6f,0x69,0x6e])]('');}function _0x4a6438(){}function _0x11012f(_0x2ffc3a){return _0x2ffc3a['map'](_0x1fb115=>String['fromCharCode'](_0x1fb115))['join']('');}_0x5575ac(await _0xcb13d5());}(this);}['showFakeVisualSelection'](){const _0x23fff0=this['editor']['model'];_0x23fff0['change'](_0x3fb8af=>{const _0x1699e5=_0x23fff0['document']['selection']['getRanges']();let _0x3b70e4=0x0;for(const _0x21ed84 of _0x1699e5){const _0x2120d1=f+':'+_0x3b70e4;if(_0x23fff0['markers']['has'](_0x2120d1))_0x3fb8af['updateMarker'](_0x2120d1,{'range':_0x21ed84});else{if(_0x21ed84['start']['isAtEnd']){const _0x47f44a=_0x21ed84['start']['getLastMatchingPosition'](({item:_0xd25596})=>!_0x23fff0['schema']['isContent'](_0xd25596),{'boundaries':_0x21ed84});_0x3fb8af['addMarker'](_0x2120d1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3fb8af['createRange'](_0x47f44a,_0x21ed84['end'])});}else _0x3fb8af['addMarker'](_0x2120d1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x21ed84});}_0x3b70e4++;}});}['hideFakeVisualSelection'](){const _0x4e6c44=this['editor']['model'],_0x557756=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x557756['length']&&_0x4e6c44['change'](_0x3bfe3c=>{_0x557756['forEach'](_0x565101=>{_0x3bfe3c['removeMarker'](_0x565101);});});}['insertContent'](_0x430a3f,_0x26546e){const _0x43944a=this['_getAISelection'](),_0x3a0bb0=_0x26546e||_0x43944a['getFirstRange']();this['editor']['model']['canEditAt'](_0x3a0bb0)&&this['editor']['model']['change'](_0x591e6d=>{this['hideFakeVisualSelection'](),_0x26546e||this['_resetContentOfSelectedTableCells'](_0x591e6d,_0x43944a),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3a0bb0,'writer':_0x591e6d,'html':_0x430a3f});});}['insertContentBelow'](_0x39f8ea){const {model:_0x58a2aa}=this['editor'],_0x38b662=this['_getAISelection']();_0x58a2aa['change'](()=>{const _0x3ee128=this['_prepareTableInsertBelowPosition'](_0x39f8ea,_0x38b662)||this['_getDefaultInsertBelowPosition'](_0x38b662);this['insertContent'](_0x39f8ea,_0x3ee128);});}['_getAISelection'](){const _0xb0c1dd=this['editor']['model'],_0x53b301=Array['from'](_0xb0c1dd['markers']['getMarkersGroup'](f))['map'](_0x47c18b=>_0x47c18b['getRange']());return _0xb0c1dd['createSelection'](_0x53b301);}['_pasteHTMLUsingClipboard']({writer:_0x4a2b5f,html:_0x1d6b69,insertAt:_0x2feacb}){const {view:_0x1ff3ae}=this['editor']['editing'],_0x493430=this['editor']['plugins']['get'](_0x654a17),_0x21fdd2=new Bn();_0x21fdd2['setData']('text/html',_0x1d6b69);const _0x4e0def=new ClipboardEvent('paste',{'clipboardData':_0x21fdd2}),_0x1db970=new _0x4b2088(_0x1ff3ae,_0x4e0def,{'dataTransfer':new _0x579ab9(_0x21fdd2)});_0x4a2b5f['setSelection'](_0x2feacb);const _0x1c1297=(_0x2ed45a,_0x3796e0)=>{_0x3796e0['resultRange']&&_0x4a2b5f['setSelection'](_0x3796e0['resultRange']);};_0x493430['once']('contentInsertion',_0x1c1297,{'priority':'lowest'}),_0x1ff3ae['document']['fire']('paste',_0x1db970),_0x493430['off']('contentInsertion',_0x1c1297);}['_getDefaultInsertBelowPosition'](_0x1b2efb){const {model:_0x564ae9}=this['editor'],_0x3d212e=Array['from'](_0x1b2efb['getSelectedBlocks']());return _0x3d212e['length']?_0x564ae9['createPositionAfter'](_0x3d212e['pop']()):_0x1b2efb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x53ec6f,_0x322b14){const {model:_0x53d616,plugins:_0x5d11f7}=this['editor'];if(_0x5d11f7['has']('TableUtils')){const _0x41bed9=_0x5d11f7['get']('TableUtils')['getSelectedTableCells'](_0x322b14);if(_0x41bed9['length']){const _0x6c14af=this['_getTableRowCountFromContent'](_0x53ec6f),_0x227978=this['_createEmptyTableRows'](_0x41bed9,_0x6c14af);return _0x53d616['createPositionAt'](_0x227978,0x0);}}return null;}['_getTableRowCountFromContent'](_0x4e2b0f){const _0x57723f=this['editor']['plugins']['get']('TableUtils'),_0x5dc5aa=this['editor']['data']['parse'](_0x4e2b0f),_0x1feca6=Array['from'](_0x5dc5aa['getChildren']())['filter'](_0x3ace54=>_0x3ace54['is']('element','table'));let _0x5dc6ff=0x0;return _0x1feca6['forEach'](_0x3c0b37=>{_0x5dc6ff+=_0x57723f['getRows'](_0x3c0b37);}),_0x5dc6ff;}['_createEmptyTableRows'](_0x38f6ce,_0xcfbe9a){const _0x304359=this['editor']['plugins']['get']('TableUtils'),_0x4eb0f0=_0x304359['getRowIndexes'](_0x38f6ce),_0x279c54=_0x304359['getColumnIndexes'](_0x38f6ce),_0x36a3ff=_0x4eb0f0['last']+0x1,_0x59dc3a=_0x279c54['first'],_0x32e827=_0x38f6ce[0x0]['findAncestor']('table');for(let _0x20a8af=0x0;_0x20a8af<_0xcfbe9a;_0x20a8af++)_0x304359['insertRows'](_0x32e827,{'at':_0x36a3ff});return _0x32e827['getChild'](_0x36a3ff)['getChild'](_0x59dc3a);}['_resetContentOfSelectedTableCells'](_0x29508,_0x39b833){const {plugins:_0x7b49db}=this['editor'],{model:_0x347e9b}=_0x29508;if(!_0x7b49db['has']('TableUtils'))return;_0x7b49db['get']('TableUtils')['getSelectedTableCells'](_0x39b833)['length']&&_0x347e9b['deleteContent'](_0x39b833);}}class K extends _0x539ee4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x32ab89('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0xd8a2eb){super(_0xd8a2eb),this['name']='AIRequestError';}}function Kn(_0x42c7f9,_0x27b343,_0x52a1e0){const t=_0x42c7f9['t'];switch(_0x27b343){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',_0x52a1e0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x52a1e0);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'},_0x52a1e0);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 _0x27b343;}}class E extends Qt{['_commandDefinitions'];constructor(_0x33dc8c,_0x49fa5e){super(_0x33dc8c),this['_commandDefinitions']=_0x49fa5e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1b24a6,_0x35aa80,_0x2188b2)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x2188b2));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x10c64b,_0x4065b7,_0xd12e47)=>{this['enabledCommandsIds']=_0xd12e47?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x509596=this['editor']['model'];this['_hasContext']=function(_0x4e7e3a){const _0x4d15fc=_0x4e7e3a['document']['selection'];return _0x4d15fc['isCollapsed']?0x0!==[..._0x4d15fc['getSelectedBlocks']()]['length']&&![..._0x4d15fc['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4e7e3a['hasContent'](_0x4d15fc['getFirstRange']());}(_0x509596);const _0x11df7a=_0x509596['document']['selection'],_0x33a1c1=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2c3694 of _0x11df7a['getRanges']())for(const _0x1fbcac of _0x2c3694['getItems']())if(_0x1fbcac['is']('element')&&_0x33a1c1['includes'](_0x1fbcac['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x47d7bd='',_0x151a7b='',_0x140ab8='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x47d7bd,_0x151a7b,_0x140ab8);}}function ns(_0x2dae35,_0x78bb36){const _0x26a2d1=new Set();for(const _0x1dfcfa of _0x2dae35['values']())(_0x78bb36||!0x1===_0x1dfcfa['requiresContent'])&&_0x26a2d1['add'](_0x1dfcfa['id']);return Array['from'](_0x26a2d1);}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(_0x6975f4,_0x23522b,_0x1bf487){super(),this['editor']=_0x6975f4,this['textAdapter']=_0x23522b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1bf487,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1b935a,_0x55e308,_0x198934)=>{this['view']['value']=this['_sanitizeHTML'](_0x198934);}),this['listenTo'](this['view'],'submitPrompt',(_0x2ca4e3,_0x19199d)=>{const _0x3fa328=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x19199d,_0x3fa328,'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:_0x1c3193,query:_0x53e036,htmlContent:_0x21f842,label:_0x52cf6f,mainActionLabel:_0x5234fa}){this['view']['prompt']=_0x52cf6f,this['view']['mainAction']=_0x5234fa,this['initialContext']=_0x21f842,_0x53e036&&(this['view']['isRendered']?this['_handleQuery'](_0x53e036,_0x21f842,_0x1c3193,_0x52cf6f):this['view']['once']('render',()=>{this['_handleQuery'](_0x53e036,_0x21f842,_0x1c3193,_0x52cf6f);}));}['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'](_0x514324,_0x11eca6,_0x4461b5,_0x385100){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x11eca6,this['previousQuery']=_0x514324,this['previousLabel']=_0x385100||_0x514324,this['previousActionId']=_0x4461b5,new Promise(_0x1a8edc=>{this['textAdapter']['makeRequest']({'query':_0x514324,'context':_0x11eca6,'onData':_0x5f5332=>{this['currentResponse']=_0x5f5332,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4461b5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3bd519=>{_0x3bd519 instanceof er?this['view']['handleError'](_0x3bd519['message']):this['view']['handleError'](),_0x1a8edc();})['finally'](()=>{this['stopProcessing'](),_0x1a8edc();});});}['_parseAndNormalizeContent'](_0x42e0b9,_0x550e76=!0x1){const _0x2716ac=hs['exec'](_0x42e0b9);_0x42e0b9=_0x2716ac?_0x42e0b9['substring'](_0x2716ac[0x1]['length']):_0x42e0b9['length']<0x64&&!_0x550e76?'':this['_stripMarkdownSyntax'](_0x42e0b9);const _0xc45b90=this['_domParser']['parseFromString'](_0x42e0b9,'text/html');if(_0x2716ac){const _0x4a93f3=Array['from'](_0xc45b90['body']['childNodes']);_0x4a93f3['reverse']();for(const _0x2f33b1 of _0x4a93f3){if(_0x2f33b1['nodeType']==Node['ELEMENT_NODE'])break;_0x2f33b1['remove']();}}const _0x434d83=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xc45b90['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x434d83);const _0xa98095=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x508874=this['editor']['data']['toModel'](_0x434d83);return _0xa98095||_0x508874['markers']['clear'](),this['editor']['data']['stringify'](_0x508874);}['_normalizeResponseHeadings'](_0x5909e1){const _0x2009bd=new _0x4df078(this['editor']['editing']['view']['document']),_0x43992e=new _0x476ad0({'name':/^h[1-5]$/}),_0x2224c2=[];let _0x5b9424=!0x1;for(const _0x4f26fa of _0x5909e1)_0x4f26fa['is']('element')&&_0x43992e['match'](_0x4f26fa)&&(_0x2224c2['push'](_0x4f26fa),'h1'==_0x4f26fa['name']&&(_0x5b9424=!0x0));if(_0x5b9424){for(const _0x400cd5 of _0x2224c2)_0x2009bd['rename']('h'+(parseInt(_0x400cd5['name'][0x1])+0x1),_0x400cd5);}}['_isH1TagSupportEnabled'](){const {data:_0x46d0fd,editing:_0x42b126}=this['editor'],_0x2dd106=_0x46d0fd['htmlProcessor']['toView']('<h1></h1>'),_0x210c26=_0x46d0fd['toView'](_0x46d0fd['toModel'](_0x2dd106));return!!_0x42b126['view']['domConverter']['viewToDom'](_0x210c26)['querySelector']('h1');}['_sanitizeHTML'](_0x40e089){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x40e089),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5eacc7){const _0x5631b5=_0x5eacc7['trim']();return _0x5631b5['startsWith']('```html')?_0x5631b5['endsWith']('```')?_0x5631b5['substring'](0x7,_0x5631b5['length']-0x3):_0x5631b5['substring'](0x7):_0x5eacc7;}}const _={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x2cc502{constructor(_0x51c435){super(_0x51c435),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1520c3=>Kn(_0x51c435,'AI_'+_0x1520c3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Kn(_0x51c435,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Kn(_0x51c435,'Try\x20again')),this['stopButton']=this['_createButton'](Kn(_0x51c435,'Stop'));const _0x49ffec=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x49ffec['if']('isVisible','ck-hidden',_0x4abf42=>!_0x4abf42)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x413e05,_0x3ba78b){const _0x2badce=new _0x3c2d24(this['locale']);return _0x2badce['set']({'label':_0x413e05,'class':_0x3ba78b||'','isVisible':!0x0,'withText':!0x0}),_0x2badce;}}class Ar extends _0x2d8061{['contentFieldView'];['copyButtonView'];constructor(_0x13833b,_0x3e55d2=''){super(_0x13833b),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x497208=this['bindTemplate'];this['contentFieldView']=new Fn(_0x13833b,_0x3e55d2),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x497208['if']('isVisible','ck-hidden',_0x5a1133=>!_0x5a1133)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x497208['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 _0x20434f=!0x1;this['on']('change:value',(_0x52d392,_0x120485,_0x6bffdf)=>{const _0x37d664=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x6bffdf),this['isProcessing']&&_0x37d664&&!_0x20434f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5a9e02,_0x5058dc,_0x4d0e72)=>{_0x20434f=!0x1,_0x4d0e72?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x20434f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x20434f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2948d3=this['locale'],_0x33170f=new _0x3c2d24(this['locale']),_0x1fcd1b='ck-ai-form__copy-button';return _0x33170f['set']({'label':Kn(_0x2948d3,'Copy'),'icon':_0x4d5e4c,'class':_0x1fcd1b,'tooltip':!0x0}),_0x33170f['bind']('isVisible')['to'](this,'value',_0x439efd=>!!_0x439efd),_0x33170f['bind']('isEnabled')['to'](this,'isProcessing',_0x4ea225=>!_0x4ea225),_0x33170f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x33170f['icon']=_0x35b8d8,_0x33170f['class']=_0x1fcd1b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x33170f['icon']=_0x4d5e4c,_0x33170f['class']=_0x1fcd1b;},0x3e8);}),_0x33170f;}['_copyHTMLToClipboard'](_0x225743){const {window:_0x3ef47b,document:_0x5a4363}=Ot;if(_0x3ef47b['ClipboardItem']){const {Blob:_0x146ee0,ClipboardItem:_0x51ed43}=_0x3ef47b,_0x522fba=[new _0x51ed43({'text/html':new _0x146ee0([_0x225743['innerHTML']],{'type':'text/html'}),'text/plain':new _0x146ee0([_0x225743['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x522fba);}else{const _0x526454=_0x5a4363['createElement']('div');_0x526454['style']['position']='absolute',_0x526454['style']['left']='-9999px',_0x526454['innerHTML']='<span>[</span>'+_0x225743['innerHTML']+'<span>]</span>',_0x5a4363['body']['appendChild'](_0x526454);const _0x513b75=_0x5a4363['createRange']();_0x513b75['setStartAfter'](_0x526454['firstElementChild']),_0x513b75['setEndBefore'](_0x526454['lastElementChild']);const _0x37e338=_0x3ef47b['getSelection']();_0x37e338['removeAllRanges'](),_0x37e338['addRange'](_0x513b75),_0x5a4363['execCommand']('copy'),_0x526454['remove']();}}}class Fn extends _0x2d8061{constructor(_0x44aa62,_0x2bc691=''){super(_0x44aa62),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2bc691,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1d632d){this['element']['innerHTML']=_0x1d632d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x24e82c=new _0x2d8061(),_0x1114e1=this['locale'],_0x1b7536=new _0xe6ea79();return _0x1b7536['isVisible']=!0x0,_0x24e82c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1b7536,{'text':Kn(_0x1114e1,'AI\x20is\x20writing...')}]}),_0x24e82c['render'](),_0x24e82c;}}class Pr extends _0x2d8061{constructor(_0x1d4d0c,_0x1adf6d=''){super(_0x1d4d0c);const _0x203586=new _0x4dad4f(),_0x31d524=this['bindTemplate'];this['set']('text',_0x1adf6d),_0x203586['content']=_0x4768eb,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x203586,{'text':_0x31d524['to']('text')}]});}}class Ir extends _0x2393c6{['submitButtonView'];['showHistoryButtonView'];constructor(_0xfa2a18,_0x3273d6){super(_0xfa2a18,_0x3273d6),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',(_0x2e1f7d,_0x13cee2)=>{_0x2e1f7d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x13cee2());});}['_createSubmitButton'](){const _0x3ae5d3=new _0x3c2d24(this['locale']),_0x1e264b=this['locale'];return _0x3ae5d3['set']({'icon':_0xbd2e80,'label':Kn(_0x1e264b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3ae5d3['on']('execute',()=>{this['submit']();}),_0x3ae5d3['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xcae72f,_0x3b50fb)=>!_0xcae72f&&_0x3b50fb),_0x3ae5d3;}['_createShowHistoryButton'](){const _0x4400f3=new _0x3c2d24(this['locale']),_0x3aee48=this['resultsView'],_0x6359c9=this['locale'];_0x4400f3['set']({'label':Kn(_0x6359c9,'History'),'withText':!0x1,'icon':vt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4400f3['bind']('isOn')['to'](_0x3aee48,'isVisible'),_0x4400f3['bind']('isEnabled')['to'](this,'isEnabled'),_0x4400f3['on']('execute',()=>{_0x3aee48['isVisible']=!_0x3aee48['isVisible'],_0x3aee48['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2702e3=()=>{Ot['window']['requestAnimationFrame'](()=>{if(_0x2ebbda(this['element'])){const _0x1a9f76=new bt(this['queryView']['fieldView']['element']),_0x34280e=_0x1a9f76['width'],_0x32836f='rtl'===_0x6359c9['uiLanguageDirection']?'left':'right';_0x1a9f76['excludeScrollbarsAndBorders'](),_0x4400f3['element']['style'][_0x32836f]=_0x34280e-_0x1a9f76['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2702e3),this['on']('render',_0x2702e3),_0x4400f3;}['submit'](){const _0x5819dd=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5819dd);}['focus'](_0x1d6c8e){-0x1===_0x1d6c8e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vr extends _0x366e5d{['historyGroupView'];['clearHistoryButton'];constructor(_0x588db5){super(_0x588db5),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x359562(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Kn(_0x588db5,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x34adb9=0x0;for(const _0x3b13f3 of this['items'])_0x34adb9+=_0x3b13f3['items']['length'];return{'resultsCount':_0x34adb9,'totalItemsCount':_0x34adb9};}['_createClearHistoryButton'](){const _0x43ea8c=this['locale'],_0x38cdb4=new _0x3c2d24(this['locale']);return _0x38cdb4['set']({'label':'('+Kn(_0x43ea8c,'Clear')+')','withText':!0x0}),_0x38cdb4['on']('execute',()=>this['fire']('clearHistory')),_0x38cdb4;}}class Hr extends _0x8f7dd0{constructor(_0x1e506a){super();const _0x214d97=new _0x4566cf(),_0x349c23=new _0x3c2d24(this['locale'],_0x214d97);this['children']['add'](_0x349c23),_0x349c23['set']({'label':_0x1e506a['prompt'],'withText':!0x0}),_0x349c23['on']('execute',()=>{this['fire']('execute',{'value':_0x9255b7(_0x1e506a['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Rr extends _0xf46d2e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5c5ea9,_0x44db54)=>{const _0x33a9d3=fo(_0x44db54['prompt']);for(const _0x522007 of this)if(_0x522007!=_0x44db54&&fo(_0x522007['prompt'])===_0x33a9d3){this['remove'](_0x522007);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x516fad=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x516fad));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x3a154a=>_0x3a154a)));}}function fo(_0xb0605f){return _0xb0605f['toLowerCase']()['trim']();}class k extends _0x2d8061{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x40558a,_0x41a699,_0x46d585=''){super(_0x40558a),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 Rr(),this['errorView']=new Pr(_0x40558a),this['contentArea']=new Ar(_0x40558a,_0x46d585),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 _0x59aa0e(),this['keystrokes']=new _0x151440(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x2427c3({'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 _0x4b2749=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x41a699],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4b2749['if']('isError','ck-hidden',_0x3ad529=>!_0x3ad529)]},'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'](_0x3b4909=0x1){-0x1===_0x3b4909?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 _0x1c1fd5=this['locale'],_0x343d48=new Ir(_0x1c1fd5,{'queryView':{'label':Kn(_0x1c1fd5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x4fcc6d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Kn(_0x1c1fd5,'Empty\x20history'),'secondary':Kn(_0x1c1fd5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x343d48['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2d3dff,_0x3dc673)=>_0x2d3dff&&!_0x3dc673),this['listenTo'](_0x343d48,'submit',(_0x5a1ef3,_0x14de15)=>{this['prompt']=_0x14de15;const _0x53b9c3=_0x3bf51a(_0x14de15);this['fire']('submitPrompt',_0x53b9c3),_0x14de15['trim']()&&this['_promptHistory']['add']({'prompt':_0x53b9c3},0x0);},{'priority':'high'}),_0x343d48;}['_createHistoryView'](){const _0x46f33d=new Vr(this['locale']);return _0x46f33d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Hr),_0x46f33d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x46f33d;}['_createToolbar'](){const _0x1c4937=new Er(this['locale']);return _0x1c4937['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xe92de8,_0x4f4705,_0x31dd8b)=>_0xe92de8&&!_0x4f4705&&!!_0x31dd8b),_0x1c4937['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1c4937['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x13837b,_0x19afb2,_0xbc10a1)=>_0x13837b&&!_0x19afb2&&!!_0xbc10a1),_0x1c4937['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1c4937['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x69b800,_0x4f786c)=>_0x69b800&&!_0x4f786c),_0x1c4937['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1c4937['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1c4937['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1c4937;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1aa0ba=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Kn(_0x1aa0ba,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x46f7a3){const _0x91d44a=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x46f7a3||Kn(_0x91d44a,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x539ee4{['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[_0x3f9fd2,a,K,_0x15fff9];}constructor(_0x4c66e0){super(_0x4c66e0),_0x4c66e0['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4c66e0['config']['define']('ai.assistant.contentAreaCssClass',''),_0x4c66e0['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4c66e0['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1cc03e}=this;this['_aiAdapter']=_0x1cc03e['plugins']['get'](K),this['_dialog']=_0x1cc03e['plugins']['get'](_0x15fff9),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b1172=new E(_0x1cc03e,Array['from'](this['_commandDefinitions']['values']()));_0x1cc03e['commands']['add']('showAIAssistant',_0x1b1172),_0x1cc03e['ui']['componentFactory']['add']('aiCommands',_0xb6114d=>{const _0x522d60=_0x59c3f3(_0xb6114d);return _0x522d60['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x522d60['buttonView']['set']({'label':Kn(_0xb6114d,'AI\x20Commands'),'icon':_0x51a368,'tooltip':!0x0}),_0x522d60['on']('execute',_0x2fe15e=>this['_onExecute'](_0x2fe15e['source']['id'])),_0x112092(_0x522d60,_0x1cc03e['ui']['view']['body'],function(_0x166afb){const _0x406972=o(_0x166afb['config']['get']('ai.assistant.commands'),_0x166afb['locale']),_0x51a3b4=B(_0x166afb,_0x406972)['filter'](_0x402995=>_0x402995['commands']['length']);if(0x1===_0x51a3b4['length'])return B(_0x166afb,_0x51a3b4[0x0]['commands'])['map'](_0x59cb43=>({'id':_0x59cb43['id'],'label':_0x59cb43['label']}));return _0x51a3b4['map'](_0x51501f=>{const {groupId:_0x1d8756,groupLabel:_0x371f31,commands:_0x27eead}=_0x51501f,_0x18a478=B(_0x166afb,_0x27eead)['map'](_0x255c9a=>({'id':_0x255c9a['id'],'label':_0x255c9a['label']}));return{'id':_0x1d8756,'menu':_0x371f31||_0x1d8756,'children':_0x18a478};});}(_0x1cc03e),{'ariaLabel':Kn(_0xb6114d,'AI\x20Commands')}),_0x522d60['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b1172['on']('change:enabledCommandsIds',_0x41909b),_0x522d60['menuView']['once']('render',_0x41909b),_0x522d60;function _0x41909b(){_0x522d60['isEnabled']=_0x1b1172['enabledCommandsIds']['length']>0x0;for(const _0xc1aa97 of _0x522d60['menuView']['buttons'])_0xc1aa97['isEnabled']=_0x1b1172['enabledCommandsIds']['includes'](_0xc1aa97['id']);}}),_0x1cc03e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4dd478=>{const _0x38803b=new _0x37d352(_0x4dd478);_0x38803b['buttonView']['set']({'label':Kn(_0x4dd478,'AI\x20Commands'),'icon':_0x51a368}),_0x38803b['bind']('isEnabled')['to'](_0x1b1172,'enabledCommandsIds',_0x6d1102=>_0x6d1102['length']>0x0);const _0x46c07e=o(_0x1cc03e['config']['get']('ai.assistant.commands'),_0x4dd478);return this['_populateMenuBarMenu'](_0x1b1172,_0x38803b,_0x46c07e,_0x4dd224=>this['_onExecute'](_0x4dd224)),_0x38803b;}),_0x1cc03e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x92de67=this['_createAIAssistantUIButton'](_0x3c2d24);return _0x92de67['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x92de67;}),_0x1cc03e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x536bc6=this['_createAIAssistantUIButton'](_0x215c67);return _0x536bc6['set']({'role':'menuitemcheckbox'}),_0x536bc6;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3061ed=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x21a9eb;for(const _0x369bba in _0x3061ed){const _0x2b970e=_0x369bba,_0x56b5ef=_0x3061ed[_0x2b970e];if('aiLicenseKeyValid'==_0x56b5ef||'aiLicenseKeyInvalid'==_0x56b5ef||'aiLicenseKeyExpired'==_0x56b5ef||'aiLicenseKeyDomainLimit'==_0x56b5ef||'aiLicenseKeyNotAllowed'==_0x56b5ef||'aiLicenseKeyEvaluationLimit'==_0x56b5ef||'aiLicenseKeyUsageLimit'==_0x56b5ef){delete _0x3061ed[_0x2b970e],_0x21a9eb=_0x56b5ef,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x21a9eb&&_0x3061ed['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x21a9eb&&_0x3061ed['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x21a9eb&&_0x3061ed['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x21a9eb&&_0x3061ed['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x21a9eb&&_0x3061ed['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x21a9eb&&_0x3061ed['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3233ce='',_0x5d2bbb='',_0x19e20e='custom'){const _0x2a86f2=this['editor'],_0x5324ec=_0x2a86f2['editing']['view'],_0x5d8fa6=_0x2a86f2['plugins']['get'](a),_0x96228e=_0x2a86f2['plugins']['get'](_0x3f9fd2);_0x5d8fa6['showFakeVisualSelection']();const _0x18bd4d=new w(),_0x2bfadd=new ClipboardEvent('copy',{'clipboardData':_0x18bd4d}),_0x236ed9=new _0x579ab9(_0x18bd4d),_0x3f8974=new _0x4b2088(_0x5324ec,_0x2bfadd,{'dataTransfer':_0x236ed9});_0x96228e['_forceMarkersCopy']('comment',()=>{_0x5324ec['document']['fire']('copy',_0x3f8974);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x2a86f2,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5a1256=_0x236ed9['getData']('text/html');const _0x243455=_0x2a86f2['model']['document']['selection'],_0x186170=Array['from'](_0x243455['getRanges']());0x1===_0x186170['length']&&_0x186170[0x0]['isFlat']&&!_0x243455['getSelectedElement']()&&''!==_0x5a1256['replace'](/ /g,'')['trim']()&&(_0x5a1256='<p>'+_0x5a1256+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x19e20e,'query':_0x3233ce,'htmlContent':_0x5a1256,'label':_0x5d2bbb,'mainActionLabel':_[_0x2a86f2['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1ef70c,'title':Kn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3443fd['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5d8fa6['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x362cfe=new Map(),_0x1f2451=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x106d20 of _0x1f2451)for(const _0x40235d of _0x106d20['commands'])_0x362cfe['set'](_0x40235d['id'],{..._0x40235d,'groupId':_0x106d20['groupId'],'groupLabel':_0x106d20['groupLabel']||_0x106d20['groupId']});return _0x362cfe;}['_createAIAssistantUIButton'](_0x131aa1){const _0x579bbd=this['editor'],_0x49881a=_0x579bbd['commands']['get']('showAIAssistant'),_0x527c41=new _0x131aa1(_0x579bbd['locale']);return _0x527c41['set']({'label':Kn(_0x579bbd['locale'],'AI\x20Assistant'),'icon':_0x1ef70c,'isToggleable':!0x0}),_0x527c41['bind']('isEnabled')['to'](_0x49881a),_0x527c41['bind']('isOn')['to'](this['_dialog'],'id',_0x13dafc=>'aiAssistant'===_0x13dafc),this['listenTo'](_0x527c41,'execute',()=>{_0x527c41['isOn']?this['hideUI']():_0x49881a['execute']();}),_0x527c41;}['_initView'](){const _0x2cbcf5=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',()=>{_0x2cbcf5['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2cbcf5['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5d5b7a,ui:{ariaLiveAnnouncer:_0xe0af08}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x58f710,_0x5142a6,_0x578628)=>{const _0x3b5584=this['_aiAssistantController']['currentContext'];_0x578628?_0xe0af08['announce'](Kn(_0x5d5b7a,'AI\x20is\x20writing')):_0x3b5584&&_0xe0af08['announce'](Kn(_0x5d5b7a,'Generated\x20content:\x20%0',_0x3b5584),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4331a6,_0xd72e26,_0x30544d)=>{if(_0x30544d){const _0x2780af=this['_formView']['errorView']['text'];_0xe0af08['announce'](Kn(_0x5d5b7a,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2780af));}});}['_onExecute'](_0x3510b6){const _0x1c107d=this['_commandDefinitions']['get'](_0x3510b6),_0x45e3e4=this['editor'],_0x3aec08=_0x45e3e4['model']['document']['selection'],_0x36f8ea=_0x45e3e4['commands']['get']('showAIAssistant'),_0x14b3b2=_0x45e3e4['plugins']['get'](a),_0x4671eb=''+(_0x1c107d['groupId']!==x?_0x1c107d['groupLabel']+':\x20':'')+_0x1c107d['label'];if(!0x1!==_0x1c107d['requiresContent']&&_0x3aec08['isCollapsed']){const _0x2a9d42=_0x3a1e6c(_0x3aec08['getSelectedBlocks']())||_0x45e3e4['model']['schema']['getLimitElement'](_0x3aec08);_0x45e3e4['model']['change'](_0x587eb4=>{_0x587eb4['setSelection'](_0x2a9d42,'in');});}_0x14b3b2['showFakeVisualSelection'](),_0x36f8ea['execute'](_0x1c107d['prompt'],_0x4671eb,'command:'+_0x3510b6);}['_populateMenuBarMenu'](_0x1bd9ff,_0x17592f,_0x218021,_0x22a779){const _0x28b124=this['editor'],_0x58f514=_0x28b124['locale'],_0x3b84b7=new _0x558ce9(_0x58f514),_0x35b421=B(_0x28b124,_0x218021)['filter'](_0x11a34a=>_0x11a34a['commands']['length']);0x1===_0x35b421['length']?this['_getMenuBarGroupButtons']({'command':_0x1bd9ff,'commands':_0x35b421[0x0]['commands'],'parentMenuView':_0x17592f,'onExecute':_0x22a779})['forEach'](_0x145595=>_0x3b84b7['items']['add'](_0x145595)):_0x35b421['forEach'](({groupId:_0x5ae7c8,groupLabel:_0x279122,commands:_0x5eeeb6})=>{const _0x44bff4=new _0x4d6df1(_0x58f514,_0x17592f),_0x35abc8=new _0x37d352(_0x58f514),_0x2ff6f9=new _0x558ce9(_0x58f514),_0x20cf67=this['_getMenuBarGroupButtons']({'command':_0x1bd9ff,'commands':_0x5eeeb6,'parentMenuView':_0x35abc8,'onExecute':_0x22a779});_0x35abc8['buttonView']['set']({'label':_0x279122||_0x5ae7c8}),_0x35abc8['delegate']('execute')['to'](_0x17592f),_0x2ff6f9['items']['addMany'](_0x20cf67),_0x35abc8['panelView']['children']['add'](_0x2ff6f9),_0x44bff4['children']['add'](_0x35abc8),_0x3b84b7['items']['add'](_0x44bff4);}),_0x17592f['panelView']['children']['add'](_0x3b84b7);}['_getMenuBarGroupButtons']({command:_0x471332,commands:_0x359a84,parentMenuView:_0x1196a7,onExecute:_0x3096fb}){const _0x24884e=this['editor'],_0x245483=_0x24884e['locale'];return B(_0x24884e,_0x359a84)['map'](_0x223e7d=>{const _0x51a168=new _0x4d6df1(_0x245483,_0x1196a7),_0x500f0b=new _0x215c67(_0x245483);return _0x500f0b['set']({'label':_0x223e7d['label']}),_0x500f0b['delegate']('execute')['to'](_0x1196a7),_0x500f0b['on']('execute',()=>_0x3096fb(_0x223e7d['id'])),_0x500f0b['bind']('isEnabled')['to'](_0x471332,'enabledCommandsIds',_0xa0146e=>_0xa0146e['includes'](_0x223e7d['id'])),_0x51a168['children']['add'](_0x500f0b),_0x51a168;});}}function U(_0x4f6904,_0x5d1748){return void 0x0!==_0x4f6904['order']&&void 0x0===_0x5d1748['order']?0x1:void 0x0===_0x4f6904['order']&&void 0x0!==_0x5d1748['order']?-0x1:void 0x0!==_0x4f6904['order']&&void 0x0!==_0x5d1748['order']?_0x4f6904['order']-_0x5d1748['order']:0x0;}function B(_0x1dbe7d,_0x2be080){_0x2be080['sort'](U);const _0x455e8b={},_0x13495c=[];for(const _0x30a3d9 of _0x2be080)if(void 0x0!==_0x30a3d9['order']){if(_0x30a3d9['order']in _0x455e8b)throw new _0x32ab89('ai-commands-config-order-collision',_0x1dbe7d,{'conflictingDefinitions':[_0x30a3d9,_0x455e8b[_0x30a3d9['order']]]});_0x455e8b[_0x30a3d9['order']]=_0x30a3d9,_0x13495c['splice'](_0x30a3d9['order'],0x0,_0x30a3d9);}else _0x13495c['push'](_0x30a3d9);return _0x13495c;}class Wn extends _0x539ee4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe5ad4f){super(_0xe5ad4f);const _0x1e850c=_0xe5ad4f['config'],_0x28e07d=_0xe5ad4f['locale'];_0x1e850c['define']('ai.assistant.preserveComments',!0x0),_0x1e850c['define']('ai.assistant.commands',Yn(_0x28e07d)),_0x1e850c['define']('ai.assistant.extraCommandGroups',[]),_0x1e850c['define']('ai.assistant.removeCommands',[]);let _0x2f09c3=o(_0x1e850c['get']('ai.assistant.commands'),_0x28e07d);const _0x3b0d18=_0x1e850c['get']('ai.assistant.extraCommandGroups'),_0x4a4985=_0x1e850c['get']('ai.assistant.removeCommands');_0x3b0d18['forEach'](_0x39fb84=>{const _0xa702a6=_0x2f09c3['find'](_0x8af0f8=>_0x8af0f8['groupId']===_0x39fb84['groupId']);_0xa702a6?_0xa702a6['commands']=_0xa702a6['commands']['concat'](_0x39fb84['commands']):_0x2f09c3['push'](_0x39fb84);}),_0x2f09c3=_0x2f09c3['filter'](_0x155c98=>!_0x4a4985['includes'](_0x155c98['groupId'])),_0x2f09c3['forEach'](_0x2303a2=>{_0x2303a2['commands']=_0x2303a2['commands']['filter'](_0x40c3ee=>!_0x4a4985['includes'](_0x40c3ee['id']));}),_0x1e850c['set']('ai.assistant.commands',_0x2f09c3);}}function Yn(_0x387029){return[{'groupId':'editOrReview','groupLabel':Kn(_0x387029,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Kn(_0x387029,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Kn(_0x387029,'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':Kn(_0x387029,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Kn(_0x387029,'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':Kn(_0x387029,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Kn(_0x387029,'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':Kn(_0x387029,'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':Kn(_0x387029,'Change\x20tone'),'commands':[{'id':'professional','label':Kn(_0x387029,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Kn(_0x387029,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Kn(_0x387029,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Kn(_0x387029,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Kn(_0x387029,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Kn(_0x387029,'Change\x20style'),'commands':[{'id':'business','label':Kn(_0x387029,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Kn(_0x387029,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Kn(_0x387029,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Kn(_0x387029,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Kn(_0x387029,'Translate'),'commands':[{'id':'translateEnglish','label':Kn(_0x387029,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Kn(_0x387029,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Kn(_0x387029,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Kn(_0x387029,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Kn(_0x387029,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Kn(_0x387029,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Kn(_0x387029,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Kn(_0x387029,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x539ee4{['abortController'];static get['requires'](){return[K];}constructor(_0x4e2582){super(_0x4e2582),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x269064){return this['sendRequest'](_0x269064)['catch'](_0x481906=>{if(_0x481906 instanceof er)return Promise['reject'](_0x481906);if('AbortError'==_0x481906['name'])return Promise['resolve']();throw console['error'](_0x481906),new _0x32ab89('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3796a7,_0x5d944d){const _0x39c551=this['editor']['locale'],_0x9b4244={'Content-Type':'application/json'};if('object'==typeof _0x3796a7)Object['assign'](_0x9b4244,_0x3796a7);else{if(_0x3796a7)try{const _0x3b5c80=await _0x3796a7(_0x5d944d);Object['assign'](_0x9b4244,_0x3b5c80);}catch{return Promise['reject'](new er(Kn(_0x39c551,'AI_ERROR_GET_HEADERS')));}}return _0x9b4244;}async['_prepareRequestParameters'](_0x44a125,_0x26f40a){const _0x4adb5d=this['editor']['locale'];if('object'==typeof _0x44a125)return _0x44a125;try{return await _0x44a125(_0x26f40a);}catch{return Promise['reject'](new er(Kn(_0x4adb5d,'AI_ERROR_GET_PARAMETERS')));}}}class $n extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3f8d0e){super(_0x3f8d0e),_0x3f8d0e['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3f8d0e['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3f8d0e['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3f8d0e['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3f8d0e['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3f8d0e['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xb57576,context:_0x4c7889,onData:_0x53dafb,actionId:_0x3f872b}){const _0x46bb07=this['editor']['locale'],_0x2b5cfc=await this['prepareMessages'](_0xb57576,_0x4c7889,_0x3f872b),_0x33641c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3f872b),_0x47911e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3f872b),_0x26091b={'messages':_0x2b5cfc,..._0x47911e},_0x4537a5={'method':'POST','headers':_0x33641c,'body':JSON['stringify'](_0x26091b),'signal':this['abortController']['signal']},_0x597885=await fetch(this['_apiUrl'],_0x4537a5);if(_0x597885['ok'])return _0x47911e['stream']?await this['_readStreamableResponse'](_0x597885,_0x53dafb):await this['_readStaticResponse'](_0x597885,_0x53dafb),Promise['resolve']();{const _0x16b9aa=await _0x597885['text']();return _0x16b9aa['includes']('context_length_exceeded')?Promise['reject'](new er(Kn(_0x46bb07,'AI_ERROR_CONTEXT_LENGTH'))):_0x16b9aa['includes']('Moderation')?Promise['reject'](new er(Kn(_0x46bb07,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x16b9aa));}}async['prepareMessages'](_0x138aaf,_0x8bbd65,_0x345b89){let _0x4474c2,_0x57f3b5;return _0x8bbd65?(_0x4474c2='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.',_0x57f3b5='Instruction:\x0a'+_0x138aaf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x8bbd65):(_0x4474c2='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.',_0x57f3b5=_0x138aaf),[{'role':'system','content':_0x4474c2},{'role':'user','content':_0x57f3b5}];}async['_readStreamableResponse'](_0x5fc75e,_0x306a7b){const _0x4c6187=_0x5fc75e['body']['getReader'](),_0x418203=new TextDecoder();let _0x3531fb='',_0x338928='',_0x360cd8='',_0x1ec230=!0x1;for(;!_0x1ec230;){const {done:_0x804261,value:_0x588ab1}=await _0x4c6187['read'](),_0x59ac40=_0x3531fb+_0x418203['decode'](_0x588ab1);let _0x58c5cd='';_0x1ec230=_0x804261;try{_0x58c5cd=this['_cleanUpData'](_0x59ac40),_0x3531fb='';}catch{_0x3531fb=_0x59ac40;continue;}_0x338928+=_0x58c5cd,!_0x1ec230&&this['_isBufferIncomplete'](_0x338928)||_0x338928&&(_0x360cd8+=_0x338928,_0x338928='',_0x306a7b(_0x360cd8));}return Promise['resolve']();}async['_readStaticResponse'](_0x56ee4f,_0x40704c){return _0x40704c((await _0x56ee4f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5e195b){const _0x4b0169=_0x5e195b['split']('<')['length']!==_0x5e195b['split']('>')['length'],_0x3a3def=_0x5e195b['length']<0x1e;return _0x4b0169&&_0x3a3def;}['_cleanUpData'](_0xeee994){return _0xeee994['split'](/\n(?![^{]*\})/g)['map'](_0x28af2f=>_0x28af2f['replace']('data:\x20',''))['filter'](_0x2b3805=>_0x2b3805&&_0x2b3805['length']>0x0&&'[DONE]'!==_0x2b3805)['map'](_0x47d193=>{const {choices:_0xbebc24}=JSON['parse'](_0x47d193);if(_0xbebc24[0x0]?.['delta']?.['content'])return _0xbebc24[0x0]['delta']['content'];})['filter'](_0x493abd=>_0x493abd)['join']('');}}class qn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2e3a5b){super(_0x2e3a5b),_0x2e3a5b['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x2e3a5b['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']=_0x2e3a5b['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x2e3a5b['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2e3a5b['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x2e3a5b['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x2cedfa,context:_0x55cf18,onData:_0x116e7e,actionId:_0x1648da}){const {model:_0x575476,stream:_0x4daaca,..._0x5a2633}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1648da),_0x5082ca={'prompt':await this['preparePrompt'](_0x2cedfa,_0x55cf18,_0x575476,_0x1648da),..._0x5a2633};this['_apiUrl']?await this['_processProxyRequest'](_0x5082ca,_0x575476,_0x4daaca,_0x116e7e,_0x1648da):await this['_processAWSRequest'](_0x5082ca,_0x575476,_0x4daaca,_0x116e7e);}async['preparePrompt'](_0x495e8,_0x27a18d,_0x31e6dc,_0x5ed5e4){let _0x206a80,_0x494184;return _0x27a18d?(_0x206a80='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.',_0x494184='Instruction:\x0a'+_0x495e8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x27a18d):(_0x206a80='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.',_0x494184=_0x495e8),'meta.llama'==this['getModelFamily'](_0x31e6dc)?'<<SYS>>\x0a'+_0x206a80+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x494184+'\x0a[/INST]':'Human:\x0a'+_0x206a80+'\x0a'+_0x494184+'\x0a\x0aAssistant:';}['getModelFamily'](_0x551633){if(/^anthropic\.claude/['test'](_0x551633))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x551633))return'ai21.j2';if(/^cohere\.command/['test'](_0x551633))return'cohere.command';if(/^meta\.llama/['test'](_0x551633))return'meta.llama';throw new er(Kn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x551633));}async['_processProxyRequest'](_0x1ca064,_0x4d2f23,_0x26b4b2,_0x33c745,_0x132f74){const _0x805081={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x132f74),'body':JSON['stringify']({..._0x1ca064,'model':_0x4d2f23,'stream':_0x26b4b2}),'signal':this['abortController']['signal']},_0x3bc5cb=await fetch(this['_apiUrl'],_0x805081);_0x26b4b2?await this['_readStreamableResponse'](_0x3bc5cb,_0x4d2f23,_0x33c745):await this['_readStaticResponse'](_0x3bc5cb,_0x4d2f23,_0x33c745);}async['_processAWSRequest'](_0x1e2000,_0x4bf713,_0x586688,_0x5caaf2){const _0xb4eadf=new _0x49581d(this['_bedrockClientConfig']),_0x50859f={'body':JSON['stringify'](_0x1e2000),'contentType':'application/json','accept':'application/json','modelId':_0x4bf713};let _0x3c39a5;if(_0x586688){const _0x46b261=new _0x73eefb(_0x50859f);_0x3c39a5=await _0xb4eadf['send'](_0x46b261,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3c39a5,_0x4bf713,_0x5caaf2);}else{const _0x3e0eac=new _0x3a19a5(_0x50859f);_0x3c39a5=await _0xb4eadf['send'](_0x3e0eac,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3c39a5,_0x4bf713,_0x5caaf2);}}async['_readAsyncIterableResponse'](_0x1fa9c1,_0x4f6fea,_0x146fef){const _0x2e84b2=_0x1fa9c1['body'],_0x53092c=new TextDecoder('utf-8');let _0x3ba5db='';for await(const _0x31aadf of _0x2e84b2)if(_0x31aadf['chunk']){const _0x5f5420=_0x53092c['decode'](_0x31aadf['chunk']['bytes']),_0x46093e=JSON['parse'](_0x5f5420);_0x3ba5db+=this['_getGeneratedText'](_0x46093e,_0x4f6fea),_0x146fef(_0x3ba5db);}return Promise['resolve']();}async['_readStreamableResponse'](_0xfca39f,_0x18d3ad,_0x308466){const _0x5f278a=_0xfca39f['body'],_0x370d80=new TextDecoder('utf-8'),_0x5d7b14=_0x5f278a['getReader']();let _0x44a306='',_0x55c1e2='',_0x597ea7=!0x1;for(;!_0x597ea7;){const {done:_0x56ffda,value:_0x4286c8}=await _0x5d7b14['read']();if(_0x597ea7=_0x56ffda,_0x597ea7)break;const _0x1ff420=(_0x44a306+_0x370d80['decode'](_0x4286c8))['split']('\x0a')['map'](_0xab3af=>{try{return _0x44a306='',JSON['parse'](_0xab3af);}catch{return _0x44a306=_0xab3af,null;}})['filter'](_0x578600=>null!==_0x578600);_0x1ff420['length']&&(_0x55c1e2+=_0x1ff420['map'](_0x340533=>this['_getGeneratedText'](_0x340533,_0x18d3ad))['join'](''),_0x308466(_0x55c1e2));}return Promise['resolve']();}async['_readStaticResponse'](_0x391aa5,_0x208f10,_0x4b1932){let _0x190d88;return _0x190d88=_0x391aa5 instanceof Response?await _0x391aa5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x391aa5['body'])),(_0x4b1932(this['_getGeneratedText'](_0x190d88,_0x208f10)),Promise['resolve']());}['_getGeneratedText'](_0x48b6a9,_0x2fe3c5){switch(this['getModelFamily'](_0x2fe3c5)){case'anthropic.claude':return _0x48b6a9['completion'];case'ai21.j2':return _0x48b6a9['completions'][0x0]['data']['text'];case'cohere.command':return _0x48b6a9['generations'][0x0]['text'];case'meta.llama':return _0x48b6a9['generation'];}}}class ia extends _0x3c2d24{constructor(_0x51941a,_0x1ac7c2={}){super(_0x51941a),this['isToggleable']=!0x0,this['set']('side',_0x1ac7c2['side']||'top');const _0x36b729=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x388a6f(_0x1ac7c2['class']||[]),_0x36b729['to']('side',_0x3fc0b7=>'ck-tab-button_'+_0x3fc0b7),_0x36b729['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x2d8061{['children'];constructor(_0x370bb5,_0x188495={}){super(_0x370bb5);const _0x4bb9e4=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x388a6f(_0x188495['class']||[]),_0x4bb9e4['to']('class'),_0x4bb9e4['if']('isVisible','ck-hidden',_0x18112d=>!_0x18112d)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x2d8061{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x3e5a77,_0x24bdcc={}){super(_0x3e5a77),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x24bdcc['side']||'top'),this['set']('isMaximized',!0x1);const _0x49823b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x388a6f(_0x24bdcc['class']||[]),_0x49823b['to']('side',_0x5110e3=>'ck-tabs_'+_0x5110e3),_0x49823b['to']('class'),_0x49823b['to']('isMaximized',_0x1ed234=>_0x1ed234?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x49823b['to']('side',_0x2bbd59=>'ck-tabs__buttons-container_'+_0x2bbd59)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x49823b['to']('side',_0x579e41=>'ck-tabs__panels-container_'+_0x579e41)]},'children':this['panelViews']},..._0x388a6f(_0x24bdcc['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x4ffde6){const _0x57b295=this['_tabs']['get'](_0x4ffde6);return _0x57b295||null;}['addTab'](_0x4f069b){const _0x499d0c=this['_setupButton']({'id':_0x4f069b['id'],'label':_0x4f069b['buttonLabel'],'icon':_0x4f069b['buttonIcon'],'order':_0x4f069b['order']}),_0x3d63be=new ea(this['locale']);return _0x3d63be['render'](),_0x4f069b['content']&&_0x3d63be['children']['add'](_0x4f069b['content']),this['panelViews']['add'](_0x3d63be),this['_tabs']['set'](_0x4f069b['id'],{'button':_0x499d0c,'panel':_0x3d63be,'order':void 0x0!==_0x4f069b['order']?_0x4f069b['order']:null}),this['fire']('addTab:'+_0x4f069b['id'],{'id':_0x4f069b['id'],'button':_0x499d0c,'panel':_0x3d63be}),null===this['activeTab']?this['activateTab'](_0x4f069b['id']):this['_hidePanel'](_0x4f069b['id']),{'button':_0x499d0c,'panel':_0x3d63be};}['activateTab'](_0x18a322){if(null!==_0x18a322&&!this['getTab'](_0x18a322))throw new _0x32ab89('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x18a322});this['activeTab']!==_0x18a322&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x18a322,_0x18a322&&this['_showPanel'](_0x18a322),this['fire']('activateTab:'+_0x18a322,_0x18a322));}['showTab'](_0x27b02b){if(!this['getTab'](_0x27b02b))throw new _0x32ab89('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x27b02b});this['_showPanel'](_0x27b02b),this['_showButton'](_0x27b02b),this['fire']('show:'+_0x27b02b,_0x27b02b);}['hideTab'](_0x4d146e){if(!this['getTab'](_0x4d146e))throw new _0x32ab89('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4d146e});const _0x1aaba4=this['activeTab'];this['_hidePanel'](_0x4d146e),this['_hideButton'](_0x4d146e);const _0x588786=this['getTabIds']();_0x1aaba4===_0x4d146e&&_0x588786['length']>0x1&&this['activateTab'](_0x588786['find'](_0x5220c9=>_0x5220c9!==_0x4d146e)),this['fire']('hide:'+_0x4d146e,_0x4d146e);}['_getPanel'](_0x43d9b6){const _0x14ca7c=this['_tabs']['get'](_0x43d9b6);return _0x14ca7c?_0x14ca7c['panel']:null;}['_showPanel'](_0x1366ac){null!==this['activeTab']&&this['activeTab']!==_0x1366ac||this['_getPanel'](_0x1366ac)['show']();}['_hidePanel'](_0x17437d){const _0xda45fa=this['_getPanel'](_0x17437d);_0xda45fa['isVisible']&&(this['activeTab']===_0x17437d&&(this['activeTab']=null),_0xda45fa['hide']());}['_getButton'](_0x2428ff){const _0x45c478=this['_tabs']['get'](_0x2428ff);return _0x45c478?_0x45c478['button']:null;}['_showButton'](_0x30fd48){this['_getButton'](_0x30fd48)['show']();}['_hideButton'](_0x104719){this['_getButton'](_0x104719)['hide']();}['_setupButton'](_0x47d4cb){const _0x2aabbd=new ia(this['locale'],{'side':this['side']}),_0xe1808f=this['buttonViews'];if(_0x2aabbd['set']({'label':_0x47d4cb['label'],'icon':_0x47d4cb['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2aabbd['bind']('isOn')['to'](this,'activeTab',_0x4e8a78=>_0x4e8a78===_0x47d4cb['id']),_0x2aabbd['bind']('side')['to'](this,'side'),_0x47d4cb['order']){const _0x32849d=[...this['_tabs']]['reduce']((_0x4fd902,_0x4bea1e)=>{const _0x5572db=_0x4bea1e[0x0],{order:_0x3ea257}=_0x4bea1e[0x1];return!_0x3ea257||_0x3ea257>_0x47d4cb['order']?_0x4fd902:_0x3ea257>=_0x4fd902['order']?{'id':_0x5572db,'order':_0x3ea257}:_0x4fd902;},{'id':'','order':0x0}),_0x5538c4=_0xe1808f['getIndex'](this['_getButton'](_0x32849d['id']));_0xe1808f['add'](_0x2aabbd,_0x5538c4+0x1);}else _0xe1808f['add'](_0x2aabbd);return _0x2aabbd['on']('execute',()=>{this['activateTab'](_0x47d4cb['id']);}),_0x2aabbd;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ss{constructor(_0x3cccc1,_0x58947d={}){super(_0x3cccc1,_0x58947d),this['set']('type',_0x58947d['type']||'sidebar'),this['set']('side',_0x58947d['side']||'right'),this['set']('isVisible',_0x58947d['visibleByDefault']??!0x0);const _0xdd698d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xdd698d['if']('type','ck-ai-tabs__overlay',_0x55b7d9=>'overlay'===_0x55b7d9),_0xdd698d['if']('type','ck-ai-tabs__sidebar',_0x23d3de=>'sidebar'===_0x23d3de),_0xdd698d['if']('isVisible','ck-hidden',_0xc21275=>!_0xc21275)]}}),this['buttonViews']['on']('add',(_0x30b3f5,_0x5f54b7)=>{_0x5f54b7['set']('withText',!0x1);});}}class ht extends _0x47e329{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x330331){super(_0x330331);const _0x244fb6=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x244fb6)throw new _0x32ab89('ai-tabs-configuration-not-found');if(void 0x0!==_0x244fb6['showResizeButton']&&(this['showResizeButton']=_0x244fb6['showResizeButton']),'sidebar'!==_0x244fb6['type']&&'overlay'!==_0x244fb6['type']||_0x244fb6['side']&&(this['side']=_0x244fb6['side']),'sidebar'===_0x244fb6['type']){if(this['container']=_0x244fb6['element'],this['set']('type','sidebar'),!this['container'])throw new _0x32ab89('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x244fb6['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x244fb6['visibleByDefault']||_0x244fb6['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof nt&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0xe053a6){if(_0xe053a6&&this['type']!==_0xe053a6){if(!pi['includes'](_0xe053a6))throw new _0x32ab89('ai-tabs-unsupported-ui-type');this['type']=_0xe053a6;}}['switchSide'](_0x353c00){if(_0x353c00&&this['side']!==_0x353c00){if(!di['includes'](_0x353c00))throw new _0x32ab89('ai-tabs-unsupported-ui-side');this['side']=_0x353c00;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class S extends _0x47e329{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2947d2){super(_0x2947d2),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 _0x107a03=this['context']['plugins']['get']('CloudServices');if(!_0x107a03['token'])throw new _0x32ab89('ai-missing-token',this);this['_token']=_0x107a03['token'];}['startConversation'](_0x4a9055,_0x58cbcf){const _0x1a2689=this['_sendApiRequest']('/conversations','POST',{'id':_0x4a9055,'group':_0x58cbcf});return{'getConversation':async()=>(await _0x1a2689['request'])['json'](),'abortController':_0x1a2689['abortController']};}['queryAssistant']({message:_0x3f3836,conversationId:_0x15221d,parts:_0x5412a2,capabilities:_0x1f0d9b,model:_0x23f7bb,attributes:_0x126e49}){const _0x5153ad={'prompt':_0x3f3836,'content':_0x5412a2,'model':_0x23f7bb,..._0x1f0d9b&&{'capabilities':_0x1f0d9b},..._0x126e49&&{'attributes':_0x126e49}},_0x6320b3=this['_sendApiRequest']('/conversations/'+_0x15221d+'/messages','POST',_0x5153ad);return{'getStream':async()=>{const _0x56a366=(await _0x6320b3['request'])['body'];return this['_getStreamReader'](_0x56a366);},'abortController':_0x6320b3['abortController']};}['executeCustomAction']({content:_0x5b0a8e,message:_0x9f69be,model:_0xf3fc14,outputFormat:_0x3e58af}){const _0x22f978={'content':[{'type':'text','content':_0x5b0a8e}],'prompt':_0x9f69be,'model':_0xf3fc14,'outputFormat':_0x3e58af},_0x16b16e=this['_sendApiRequest']('/actions/custom/calls','POST',_0x22f978);return{'getStream':async()=>{const _0x13d86d=(await _0x16b16e['request'])['body'];return this['_getStreamReader'](_0x13d86d);},'abortController':_0x16b16e['abortController']};}['executeAction']({actionName:_0x201b24,content:_0x4437fd,args:_0x41c585}){const _0x3af6d5={'content':[{'type':'text','content':_0x4437fd}],'args':_0x41c585},_0x178a46=this['_sendApiRequest']('/actions/system/'+_0x201b24+'/calls','POST',_0x3af6d5);return{'getStream':async()=>{const _0x335a41=(await _0x178a46['request'])['body'];return this['_getStreamReader'](_0x335a41);},'abortController':_0x178a46['abortController']};}['uploadFile'](_0x6479be,_0x502c00,_0x987d0d){const _0x233f38=new FormData();_0x233f38['append']('file',_0x502c00,_0x502c00['name']),_0x987d0d&&_0x233f38['append']('attributes',JSON['stringify'](_0x987d0d));const _0x138be7=this['_sendApiRequest']('/conversations/'+_0x6479be+'/files','POST',_0x233f38);return{'getId':async()=>(await _0x138be7['request'])['json'](),'abortController':_0x138be7['abortController']};}['fetchDocument'](_0xe57dc7,_0x1b6c28){const _0x3133d1=this['_sendApiRequest']('/conversations/'+_0xe57dc7+'/documents/'+_0x1b6c28,'GET');return{'getDocument':async()=>(await _0x3133d1['request'])['json'](),'abortController':_0x3133d1['abortController']};}['uploadDocument'](_0x53e00a,_0x1acade,_0x501614){const _0x4c6805={'content':_0x1acade};_0x501614&&(_0x4c6805['attributes']=_0x501614);const _0xa072f5=this['_sendApiRequest']('/conversations/'+_0x53e00a+'/documents','POST',_0x4c6805);return{'getId':async()=>(await _0xa072f5['request'])['json'](),'abortController':_0xa072f5['abortController']};}['fetchConversations'](_0x4c0e88,_0x337898={}){const _0x2902a8=new URLSearchParams();_0x2902a8['append']('group',_0x4c0e88),_0x2902a8['append']('excludeEmpty',!0x1!==_0x337898['excludeEmpty']?'true':'false'),_0x2902a8['append']('limit',_0x337898['limit']?_0x337898['limit']['toString']():'100'),_0x2902a8['append']('sortBy',_0x337898['sortBy']?_0x337898['sortBy']:'createdAt'),_0x2902a8['append']('order',_0x337898['order']?_0x337898['order']:'desc');const _0x3b538f=this['_sendApiRequest']('/conversations?'+_0x2902a8['toString'](),'GET');return{'getConversations':async()=>{const _0x50c305=await _0x3b538f['request'];return(await _0x50c305['json']())['items'];},'abortController':_0x3b538f['abortController']};}['deleteConversation'](_0x2fe04e){const _0x557e40=this['_sendApiRequest']('/conversations/'+_0x2fe04e,'DELETE');return{'execute':async()=>{await _0x557e40['request'];},'abortController':_0x557e40['abortController']};}['updateConversation'](_0x5dbc01,_0x431c04){const _0x3173d9=this['_sendApiRequest']('/conversations/'+_0x5dbc01,'PATCH',_0x431c04);return{'getResult':async()=>(await _0x3173d9['request'],_0x431c04),'abortController':_0x3173d9['abortController']};}['fetchConversation'](_0xb7fd42){const _0x361441=this['_sendApiRequest']('/conversations/'+_0xb7fd42,'GET');return{'getConversation':async()=>(await _0x361441['request'])['json'](),'abortController':_0x361441['abortController']};}['fetchConversationMessages'](_0x49e9c5){const _0x46e201=this['_sendApiRequest']('/conversations/'+_0x49e9c5+'/messages','GET');return{'getMessages':async()=>{const _0x51d96f=await _0x46e201['request'];return(await _0x51d96f['json']())['items'];},'abortController':_0x46e201['abortController']};}['uploadUrl'](_0x395d4c,_0x8b363,_0x23e51c){const _0x53817e=this['_sendApiRequest']('/conversations/'+_0x395d4c+'/web-resources','POST',{'url':_0x8b363,'attributes':_0x23e51c});return{'getId':async()=>(await _0x53817e['request'])['json'](),'abortController':_0x53817e['abortController']};}['getModels'](_0x26859d='en'){const _0xe116d9=new URLSearchParams();_0xe116d9['append']('language',_0x26859d);const _0x42ced1='/models/1?'+_0xe116d9['toString'](),_0x2025fe=this['_sendApiRequest'](_0x42ced1,'GET');return{'list':async()=>await(await _0x2025fe['request'])['json'](),'abortController':_0x2025fe['abortController']};}['deleteFile'](_0x22055c,_0x5658e4){const _0x301cfe=this['_sendApiRequest']('/conversations/'+_0x22055c+'/files/'+_0x5658e4,'DELETE');return{'execute':async()=>{await _0x301cfe['request'];},'abortController':_0x301cfe['abortController']};}['deleteDocument'](_0xaa2fca,_0xf14b1f){const _0x213f00=this['_sendApiRequest']('/conversations/'+_0xaa2fca+'/documents/'+_0xf14b1f,'DELETE');return{'execute':async()=>{await _0x213f00['request'];},'abortController':_0x213f00['abortController']};}['deleteWebResource'](_0x2e4b60,_0x38c966){const _0xf2749a=this['_sendApiRequest']('/conversations/'+_0x2e4b60+'/web-resources/'+_0x38c966,'DELETE');return{'execute':async()=>{await _0xf2749a['request'];},'abortController':_0xf2749a['abortController']};}['callSystemReview']({reviewName:_0x2fd151,content:_0x391333,args:_0x5d77b6}){const _0x135a31=this['_sendApiRequest']('/reviews/system/'+_0x2fd151+'/calls','POST',{'content':[{'type':'text','content':_0x391333}],'args':_0x5d77b6});return{'getStream':async()=>{const _0x521b97=(await _0x135a31['request'])['body'];return this['_getStreamReader'](_0x521b97);},'abortController':_0x135a31['abortController']};}['callCustomReview']({content:_0x2f52cd,prompt:_0x94683c,model:_0x2b1d1a}){const _0x3bb0ac=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2f52cd}],'prompt':_0x94683c,'model':_0x2b1d1a});return{'getStream':async()=>{const _0x3b1fef=(await _0x3bb0ac['request'])['body'];return this['_getStreamReader'](_0x3b1fef);},'abortController':_0x3bb0ac['abortController']};}['upsertAIChatRating'](_0x369d46,_0x45a461,_0x5490d9){const _0x416895=this['_sendApiRequest']('/conversations/'+_0x369d46+'/messages/'+_0x45a461+'/ratings','PUT',{'positiveCount':_0x5490d9['positiveCount'],'totalCount':_0x5490d9['totalCount'],'modificationId':_0x5490d9['modificationId']});return{'execute':async()=>{await _0x416895['request'];},'abortController':_0x416895['abortController']};}['upsertAIActionRating'](_0x521b23,_0x36109c,_0x534b56){const _0x5914b9=this['_sendApiRequest']('/actions/system/'+_0x521b23+'/calls/'+_0x36109c+'/ratings','PUT',{'positiveCount':_0x534b56['positiveCount'],'totalCount':_0x534b56['totalCount']});return{'execute':async()=>{await _0x5914b9['request'];},'abortController':_0x5914b9['abortController']};}['upsertCustomAIActionRating'](_0x4ef099,_0x20e9b4){const _0x365006=this['_sendApiRequest']('/actions/custom/calls/'+_0x4ef099+'/ratings','PUT',{'positiveCount':_0x20e9b4['positiveCount'],'totalCount':_0x20e9b4['totalCount']});return{'execute':async()=>{await _0x365006['request'];},'abortController':_0x365006['abortController']};}['upsertAIReviewRating'](_0x57c371,_0x31870e,_0x8dd0a,_0x5877fe){const _0x537d2d=this['_sendApiRequest']('/reviews/system/'+_0x57c371+'/calls/'+_0x31870e+'/ratings','PUT',{'positiveCount':_0x8dd0a['positiveCount'],'totalCount':_0x8dd0a['totalCount'],'dataId':_0x5877fe});return{'execute':async()=>{await _0x537d2d['request'];},'abortController':_0x537d2d['abortController']};}['upsertCustomAIReviewRating'](_0x1b7135,_0xbe0e98,_0x34c599){const _0x477442=this['_sendApiRequest']('/reviews/custom/calls/'+_0x1b7135+'/ratings','PUT',{'positiveCount':_0xbe0e98['positiveCount'],'totalCount':_0xbe0e98['totalCount'],'dataId':_0x34c599});return{'execute':async()=>{await _0x477442['request'];},'abortController':_0x477442['abortController']};}['_sendApiRequest'](_0x1dadea,_0x157cc2,_0x246224){const _0x3e3519=new AbortController(),_0x26da59=_0x246224 instanceof FormData,_0x288c65={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x246224&&!_0x26da59&&(_0x288c65['Content-Type']='application/json');const _0x19f3ce={'method':_0x157cc2,'headers':_0x288c65,'signal':_0x3e3519['signal']};return _0x246224&&(_0x19f3ce['body']=_0x26da59?_0x246224:JSON['stringify'](_0x246224)),{'request':fetch(''+this['_apiUrl']+_0x1dadea,_0x19f3ce)['catch'](_0x31f867=>{this['_handleError'](_0x31f867);})['then'](_0x33060d=>_0x33060d['ok']?_0x33060d:_0x33060d['json']()['then'](_0x44fb4d=>{throw{'url':this['_apiUrl'],'path':_0x1dadea,'method':_0x157cc2,'body':_0x246224,'status':(_0x33060d||{})['status'],'statusText':(_0x33060d||{})['statusText'],'code':_0x44fb4d['code'],'message':_0x44fb4d['message'],'traceId':_0x44fb4d['traceId']};})),'abortController':_0x3e3519};}async*['_getStreamReader'](_0x4ff4c7){const _0x1d1427=[],_0xcefaed=_0x4ff4c7['getReader'](),_0xea5562=$t({'onError':_0x3007f4=>{this['_handleError'](_0x3007f4);},'onEvent':_0x507cef=>{_0x507cef['data']=JSON['parse'](_0x507cef['data']),_0x1d1427['push'](_0x507cef);}});try{let _0x44bb3b=!0x1;for(;!_0x44bb3b;){const {done:_0x4ab2bd,value:_0x59438c}=await _0xcefaed['read']();_0x4ab2bd&&(_0x44bb3b=!0x0),_0xea5562['feed'](this['_decoder']['decode'](_0x59438c,{'stream':!0x0})),yield*_0x1d1427,_0x1d1427['length']=0x0;}}catch(_0x56f555){this['_handleError'](_0x56f555);}finally{_0xcefaed['releaseLock'](),_0xea5562['reset']();}}['_handleError'](_0x42d73a){if(_0x42d73a instanceof _0x32ab89)throw _0x42d73a;if(_0x42d73a instanceof Error&&'AbortError'===_0x42d73a['name'])throw new _0x32ab89('ai-request-aborted',this,{'originalError':_0x42d73a});throw new _0x32ab89('ai-request-failed',this,{'originalError':_0x42d73a});}}function i(_0x2b50c0,_0x5af8f5,_0x519b81){const t=_0x2b50c0['t'];switch(_0x5af8f5){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'},_0x519b81);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x519b81);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.'},_0x519b81);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.'},_0x519b81);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x519b81);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x519b81);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x519b81);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x519b81);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.'},_0x519b81);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.'},_0x519b81);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.'},_0x519b81);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'},_0x519b81);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x519b81);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x5af8f5;}}function As(_0x8fa493,_0x5b28ab){const _0xad1f62=new _0x3c2d24(_0x8fa493),_0x1548d6=i(_0x8fa493,'AI_TABS_LABEL_MINIMIZE'),_0x110f67=i(_0x8fa493,'AI_TABS_LABEL_MAXIMIZE');return _0xad1f62['set']({'withText':!0x1,'icon':_0x1a201,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0xad1f62['bind']('label')['to'](_0x5b28ab,'isMaximized',_0x42693c=>_0x42693c?_0x1548d6:_0x110f67),_0xad1f62['bind']('icon')['to'](_0x5b28ab,'isMaximized',_0x15cf33=>_0x15cf33?to:_0x1a201),_0xad1f62['bind']('isOn')['to'](_0x5b28ab,'isMaximized'),_0xad1f62['on']('execute',()=>{_0x5b28ab['fire']('resizeTabs');}),_0xad1f62;}function Wi(_0x123fd4){return _0x3e6807(_0x123fd4);}function It(_0xe769db){return _0x4dfa58(_0xe769db);}function Tt(_0x1b296f,_0x4115bb,_0x2149ba){const _0x487e0e=null!==_0x4115bb?_0x357d4d=>_0x357d4d['attribs'][_0x1b296f]===_0x4115bb:_0xd8ec8c=>Boolean(_0xd8ec8c['attribs'][_0x1b296f]);return _t(_0x182b6f=>_0x3497c5(_0x182b6f)&&_0x487e0e(_0x182b6f),_0x2149ba);}function Ki(_0x3e8f4e,_0xddc53b,_0x48a134){const _0x497c71=null!==_0xddc53b?_0x28570b=>_0x28570b['attribs'][_0x3e8f4e]===_0xddc53b:_0x641255=>Boolean(_0x641255['attribs'][_0x3e8f4e]);return _0x1010b3(_0x5bf00c=>_0x3497c5(_0x5bf00c)&&_0x497c71(_0x5bf00c),_0x48a134);}function Ct(_0x519b4b,_0x35bc0f){return _0x519b4b&&_0x3497c5(_0x519b4b)?_0x519b4b['attribs'][_0x35bc0f]:null;}function Ns(_0x1d042d,_0x3e9889,_0x2143dc){_0x3497c5(_0x1d042d)&&(null===_0x2143dc?delete _0x1d042d['attribs'][_0x3e9889]:_0x1d042d['attribs'][_0x3e9889]=_0x2143dc);}function Zi(_0x23b726,_0x2901ed,_0x38d774){const _0x1bd641=_0x2901ed['cloneNode'](!0x0);'beforebegin'===_0x38d774?_0x1e41ac(_0x23b726,_0x1bd641):'afterbegin'===_0x38d774?_0x59b5dd(_0x23b726,_0x1bd641):'beforeend'===_0x38d774?_0x5db947(_0x23b726,_0x1bd641):'afterend'===_0x38d774&&_0xb74017(_0x23b726,_0x1bd641);}function Ui(_0x583343){const _0x450452=[];let _0x283146=_0x583343;for(;_0x283146;)_0x283146=_0x1890dd(_0x283146),_0x283146&&_0x450452['push'](_0x283146);return _0x450452;}function Qn(_0x2b8454){return _0x2b8454['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Es(_0x36a5df){let _0x2fc3a7=0x0;for(;_0x36a5df['parentNode'];)_0x36a5df=_0x36a5df['parentNode'],_0x2fc3a7++;return _0x2fc3a7;}function Ds(_0x429700){const _0x21f208=[];let _0x197873=_0x429700['nextSibling'];for(;_0x197873;)_0x21f208['push'](_0x197873),_0x197873=_0x197873['nextSibling'];_0x21f208['forEach'](_0x1bc020=>{_0x5e22d6(_0x1bc020);});}class zi extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ts(){['_m2html'];constructor(){super(),this['_m2html']=new
|
|
26
|
-
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4192d1){super(),this['_generateUid']=_0x4192d1||_0xdeade1;}['merge'](_0x46bfc1,_0x2e6ad0,_0x24ae63){const _0x1cb9ac=_0x46bfc1['cloneNode'](!0x0);if(0x0===_0x2e6ad0['childNodes']['length']){const _0x1587d4=[];return Ki('data-id','new-element',_0x1cb9ac)['forEach'](_0x23bfe7=>{const _0x2f8149=this['_generateUid']();Ns(_0x23bfe7,'data-id',_0x2f8149),_0x1587d4['push'](_0x2f8149);}),this['_removeSpecialComments'](_0x1cb9ac),{'parsedContent':_0x1cb9ac,'newNodeIds':_0x1587d4,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x24ae63&&_0x24ae63['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1cb9ac),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ki('data-id',null,_0x2e6ad0)['map'](_0x509d11=>Ct(_0x509d11,'data-id'))['filter'](_0x444a5c=>!!_0x444a5c));let _0x208070=-0x1,_0x2222a2=!0x1;const _0x3572f2=_0x1cb9ac['childNodes'],_0xde101f=Array['from'](_0x3572f2)['filter'](_0x222d5f=>!(0x3===_0x222d5f['nodeType']&&''===It(_0x222d5f)['trim']())),_0x697d3d=_0xde101f['length'];for(let _0x5a0680=0x0;_0x5a0680<_0x697d3d;_0x5a0680++){const _0x421c30=_0xde101f[_0x5a0680],_0x1701c2=_0xde101f[_0x5a0680+0x1];if(this['_isNewNode'](_0x421c30)){if(-0x1===_0x208070&&(_0x208070=_0x5a0680),this['_markWrappedElements'](_0x421c30),!this['_isNewNode'](_0x1701c2)){const [_0x1b4f57,_0x530bfd]=this['_findReferenceNode'](_0x421c30,_0x2222a2,_0x2e6ad0);if(_0x1b4f57){const _0x523522=Array['from'](_0xde101f)['slice'](_0x208070,_0x5a0680+0x1);this['_insertNodes'](_0x1b4f57,_0x523522,_0x530bfd),_0x208070=-0x1;}}}else{if(this['_isExistingContentComment'](_0x421c30))_0x2222a2=!0x0;else{if(this['_isExistingNode'](_0x421c30)){const _0x1fc590=Ct(_0x421c30,'data-id');if(_0x1fc590&&this['_existingDataIds']['has'](_0x1fc590)){const _0x346317=Tt('data-id',_0x1fc590,_0x2e6ad0);this['_replaceNode'](_0x346317,_0x421c30);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1fc590)){const _0x5a8d45=this['_touchedNodesState']['removedIds']['indexOf'](_0x1fc590);this['_touchedNodesState']['removedIds']['splice'](_0x5a8d45,0x1);}}else{if(this['_isDelNode'](_0x421c30)){const _0x4ea497=Ct(_0x421c30,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x4ea497)||this['_storeDeletedElementIds'](_0x421c30);}}}}}for(const _0x5c9784 of this['_touchedNodesState']['removedIds']){const _0x16435c=Tt('data-id',_0x5c9784,_0x2e6ad0);if(_0x16435c){if(_0x24ae63&&_0x24ae63['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5c9784;const _0xf0fd42=_0x24ae63['replaceRemovedWith']['cloneNode'](!0x0);Ns(_0xf0fd42,'data-id',_0x5c9784),Ns(_0xf0fd42,'data-removed','true'),_0x4854f8(_0x16435c,_0xf0fd42);}else _0x5e22d6(_0x16435c);}}if(Ki('data-wrapped-id',null,_0x2e6ad0)['forEach'](_0x10a280=>{const _0x1cc429=Tt('data-id',Ct(_0x10a280,'data-wrapped-id'),_0x2e6ad0);var _0x296cb2,_0x58f65f;_0x1cc429&&(_0x58f65f=_0x10a280,_0x5e22d6(_0x296cb2=_0x1cc429),_0x4854f8(_0x58f65f,_0x296cb2));}),Ki('data-id','new-element',_0x2e6ad0)['forEach'](_0x5f78fb=>{const _0x533521=this['_getUid'](_0x5f78fb);Ns(_0x5f78fb,'data-id',_0x533521),this['_touchedNodesState']['newIds']['push'](_0x533521);}),this['_removeSpecialComments'](_0x2e6ad0),_0x24ae63&&_0x24ae63['markUnstableElements']&&this['_markUnstableElements'](_0x2e6ad0,_0x24ae63['markUnstableElementsDepth']||0x0),_0x24ae63&&_0x24ae63['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x5eec8b=Tt('data-id',this['_touchedNodesState']['lastTouchedId'],_0x2e6ad0);for(;_0x5eec8b;)Ds(_0x5eec8b),_0x5eec8b=_0x5eec8b['parentNode'];}return{'parsedContent':_0x2e6ad0,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x140577,_0x525bdb,_0x202c00){for(const _0x2b01f7 of _0x525bdb){const _0x330378=this['_getUid'](_0x2b01f7);Ns(_0x2b01f7,'data-id',_0x330378),this['_touchedNodesState']['newIds']['push'](_0x330378),this['_touchedNodesState']['lastTouchedId']=_0x330378;}const _0x5e767a='afterbegin'===_0x202c00||'afterend'===_0x202c00?_0x525bdb['reverse']():_0x525bdb;for(const _0x170f71 of _0x5e767a)Zi(_0x140577,_0x170f71,_0x202c00);}['_replaceNode'](_0x46e945,_0x12e06c){if(!_0x46e945)return;if(_0x5b7c6c=_0x12e06c,Qn(It(_0x46e945))===Qn(It(_0x5b7c6c)))return;var _0x5b7c6c;const _0xc262d8=this['_getUid'](_0x46e945);Ns(_0x12e06c,'data-id',_0xc262d8),this['_touchedNodesState']['modifiedIds']['push'](_0xc262d8),this['_touchedNodesState']['lastTouchedId']=_0xc262d8,_0x4854f8(_0x46e945,_0x12e06c['cloneNode'](!0x0));}['_findReferenceNode'](_0x2283c6,_0x151eb8,_0x4255ef){const _0x1b4bcf=this['_findPrevElementWithDataId'](_0x2283c6,!0x1);if(_0x1b4bcf){const _0xd5d7ea=this['_getNodeDataId'](_0x1b4bcf),_0x4fc991=Tt('data-id',_0xd5d7ea,_0x4255ef);if(_0x4fc991)return[_0x4fc991,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xd5d7ea);}const _0x496578=this['_findNextElementWithDataId'](_0x2283c6,!0x1);if(_0x496578){const _0x2e6b44=this['_getNodeDataId'](_0x496578),_0x185158=Tt('data-id',_0x2e6b44,_0x4255ef);if(_0x185158)return[_0x185158,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2e6b44);}return _0x151eb8?_0x2283c6['nextSibling']?this['_findFallbackReferenceNode'](_0x2283c6,_0x4255ef):[_0x4255ef['childNodes'][_0x4255ef['childNodes']['length']-0x1],'afterend']:[_0x4255ef['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x12a8e9,_0x4f2b52){const _0x4022b9=[],_0x4a143d=this['_findPrevElementWithDataId'](_0x12a8e9,!0x0);if(_0x4a143d){const _0x48ed56=Tt('data-id',this['_getNodeDataId'](_0x4a143d),_0x4f2b52);_0x48ed56&&_0x4022b9['push']([_0x48ed56,'afterend']);}const _0x1db0a6=this['_findNextElementWithDataId'](_0x12a8e9,!0x0);if(_0x1db0a6){const _0x29fb27=Tt('data-id',this['_getNodeDataId'](_0x1db0a6),_0x4f2b52);_0x29fb27&&_0x4022b9['push']([_0x29fb27,'beforebegin']);}if(_0x4022b9['length']>0x1)return Es(_0x4022b9[0x0][0x0])<=Es(_0x4022b9[0x1][0x0])?_0x4022b9[0x0]:_0x4022b9[0x1];return 0x1===_0x4022b9['length']?_0x4022b9[0x0]:[_0x4f2b52['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x40d0a0,_0x433434){let _0x386f09=_0x40d0a0['nextSibling'],_0x46ae64=null,_0x58622c=!0x1;for(;_0x386f09;){if(_0x588a3b(_0x386f09)){if(this['_isDelNode'](_0x386f09)&&(_0x46ae64=_0x386f09),this['_isExistingContentComment'](_0x386f09)&&_0x433434&&!_0x58622c){_0x58622c=!0x0,_0x386f09=_0x386f09['nextSibling'];continue;}break;}const _0x2f83e1=Ct(_0x386f09,'data-id');if(_0x2f83e1&&'new-element'!==_0x2f83e1&&this['_existingDataIds']['has'](_0x2f83e1)){_0x46ae64=_0x386f09;break;}_0x386f09=_0x386f09['nextSibling'];}return _0x46ae64;}['_findPrevElementWithDataId'](_0xfbc49f,_0xae3537){let _0xebcf47=_0xfbc49f['previousSibling'],_0x1952ac=null,_0x18e1df=!0x1;for(;_0xebcf47;){if(_0x588a3b(_0xebcf47)){if(this['_isDelNode'](_0xebcf47)&&(_0x1952ac=_0xebcf47),this['_isExistingContentComment'](_0xebcf47)&&_0xae3537&&!_0x18e1df){_0x18e1df=!0x0,_0xebcf47=_0xebcf47['previousSibling'];continue;}break;}const _0x3bbe0b=Ct(_0xebcf47,'data-id');if(_0x3bbe0b&&'new-element'!==_0x3bbe0b&&this['_existingDataIds']['has'](_0x3bbe0b)){_0x1952ac=_0xebcf47;break;}_0xebcf47=_0xebcf47['previousSibling'];}return _0x1952ac;}['_markWrappedElements'](_0x5a3a5f){_0x3497c5(_0x5a3a5f)&&Ki('data-id',null,_0x5a3a5f)['forEach'](_0x39011f=>{this['_isExistingNode'](_0x39011f)&&!this['_hasWrappedParent'](_0x39011f)&&(Ns(_0x39011f,'data-wrapped-id',Ct(_0x39011f,'data-id')),Ns(_0x39011f,'data-id',null));});}['_getNodeDataId'](_0x4b5796){if(!_0x4b5796)return null;if(_0x3497c5(_0x4b5796))return Ct(_0x4b5796,'data-id');if(_0x588a3b(_0x4b5796)){const _0x207812=It(_0x4b5796)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x207812&&_0x207812[0x1])return _0x207812[0x1];}return null;}['_storeDeletedElementIds'](_0x412346){if(_0x588a3b(_0x412346)){const _0x146d79=It(_0x412346)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x146d79&&_0x146d79[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x146d79[0x1]);}}['_getUid'](_0x15d036){return this['_isExistingNode'](_0x15d036)?Ct(_0x15d036,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3f6d07){(function(_0x3a1799){return _0x53a8b4(_0x5bb2d6=>_0x588a3b(_0x5bb2d6),_0x3a1799,!0x0,0x1/0x0);}(_0x3f6d07)['filter'](_0x3f7636=>this['_isDelNode'](_0x3f7636)||this['_isExistingContentComment'](_0x3f7636))['forEach'](_0x1fc512=>{_0x5e22d6(_0x1fc512);}));}['_markLastTagElementUnstable'](_0x34f035){const _0x546ad0=_0x34f035['childNodes'],_0x1271f8=_0x546ad0[_0x546ad0['length']-0x1];_0x1271f8&&_0x3497c5(_0x1271f8)&&Ns(_0x1271f8,'data-unstable','true');}['_markUnstableElements'](_0xe19f19,_0x4ae5fd){const _0x2646cc=Tt('data-unstable','true',_0xe19f19);if(!_0x2646cc)return;const _0x342bc0=Ui(_0x2646cc)['slice'](0x0,-0x1),_0x19c5a6=_0x342bc0['length'];let _0x5cac6b=_0x2646cc;if(_0x19c5a6>_0x4ae5fd){let _0x49d14d=_0x19c5a6,_0x4bc6d6=null;for(;_0x49d14d>_0x4ae5fd&&_0x49d14d>=0x0;)_0x49d14d--,_0x4bc6d6=_0x342bc0[_0x49d14d];_0x4bc6d6&&(_0x5cac6b=_0x4bc6d6,Ns(_0x2646cc,'data-unstable',null),Ns(_0x4bc6d6,'data-unstable','true'));}else{if(_0x19c5a6<_0x4ae5fd){let _0x3905b9=_0x19c5a6,_0x3b2999=_0x2646cc;for(;_0x3905b9<_0x4ae5fd;){const _0x5eba75=_0x3b2999['childNodes']['filter'](_0x1fe49e=>_0x3497c5(_0x1fe49e));if(0x0===_0x5eba75['length'])break;_0x3905b9++,_0x3b2999=_0x5eba75[_0x5eba75['length']-0x1];}_0x3b2999&&(_0x5cac6b=_0x3b2999,Ns(_0x2646cc,'data-unstable',null),Ns(_0x3b2999,'data-unstable','true'));}}let _0x215068=_0x5cac6b;for(;_0x215068;){for(;_0x215068['nextSibling'];)_0x215068=_0x215068['nextSibling'],_0x3497c5(_0x215068)&&Ns(_0x215068,'data-unstable','true');_0x215068=_0x215068['parentNode'];}}['_isNewNode'](_0x10b964){return Boolean('new-element'===Ct(_0x10b964,'data-id'));}['_isExistingNode'](_0x574469){return Boolean((Ct(_0x574469,'data-id')||'')['length']>0x0&&'new-element'!==Ct(_0x574469,'data-id'));}['_isDelNode'](_0x4668b9){return!!_0x4668b9&&Boolean(_0x588a3b(_0x4668b9)&&It(_0x4668b9)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x564a0b){let _0x2255ad=_0x564a0b['parentNode'];for(;_0x2255ad;){if(Ct(_0x2255ad,'data-wrapped-id'))return!0x0;_0x2255ad=_0x2255ad['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x54ccb6){return Boolean(_0x588a3b(_0x54ccb6)&&It(_0x54ccb6)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function q({editor:_0x141805,changeGroups:_0x10973b,documentContextContent:_0x980c9c,showDiff:_0x2b4acc,trimUnchanged:_0x33924d=!0x0}){return _0x10973b['map'](_0x46454f=>{const _0x1459d3=new ft([]),_0x2944e0=new ft([]);for(const _0xd5cf66 of _0x46454f['changes'])if(_0x2b4acc&&'removed'==_0xd5cf66['type']||_0x2944e0['children']['push'](_0xd5cf66['node']['cloneNode'](!0x0)),'new'!=_0xd5cf66['type']&&(_0x2b4acc||'removed'!=_0xd5cf66['type'])){const _0x2c9cd7=_t(_0x38b1cf=>Ct(_0x38b1cf,'data-id')==_0xd5cf66['id'],_0x980c9c,!0x0);_0x2c9cd7&&_0x1459d3['children']['push'](_0x2c9cd7['cloneNode'](!0x0));}const {content:_0x1a8f00,hasChanges:_0x514c8b}=function(_0x252733,_0x30854e,_0x3f9e5c,_0x5b3c4b,_0x2bee20=!0x0){const _0x2105e2=_0x252733['plugins']['get']('DocumentCompare'),_0x14d074=It(_0x30854e),_0x583031=It(_0x3f9e5c),_0x4a1dea=_0x252733['data']['parse'](_0x14d074,'$root'),_0x3f42a6=_0x252733['model']['createPositionAt'](_0x4a1dea,0x0),_0x109fa3=_0x2105e2['getDiff'](_0x14d074,_0x583031,{'anchor':_0x3f42a6,'markDeletions':_0x5b3c4b}),_0x5d4856=_0x109fa3['getOperations']();if(0x0==_0x5d4856['length'])return{'content':_0x30854e['cloneNode'](!0x0),'hasChanges':!0x1};_0x5b3c4b?function(_0x53cf1f,_0x340f6b,_0x5370fb){if(0x0==_0x53cf1f['length'])return;const _0x184a05=_0x5370fb['plugins']['get']('DocumentCompare'),_0x21499c=_0x5370fb['plugins']['get']('SuggestionsConversion');_0x5370fb['model']['change'](_0x589e25=>{const _0x2d0736=new Set();for(let _0x56b122=0x0;_0x56b122<_0x53cf1f['length'];_0x56b122++){const _0x3901e0=_0x53cf1f[_0x56b122];if(_0x3901e0['baseVersion']=null,_0x3901e0['isDocumentOperation']=!0x1,_0x184a05['isMarkedRemoveOperation'](_0x3901e0)){const _0x4dd5c6=_0x314060(_0x3901e0['newRange'],_0x5370fb['model']),_0x5d44e9='suggestion:deletion:'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x5d44e9,_0x4dd5c6);}else switch(_0x3901e0['type']){case'rename':{if(_0x3901e0['oldName']==_0x3901e0['newName'])break;_0x589e25['batch']['addOperation'](_0x3901e0),_0x5370fb['model']['applyOperation'](_0x3901e0);const _0xca40e='$elementName',_0x8bbd9b=_0x3901e0['position'],_0x4c8053=_0x5370fb['model']['createRange'](_0x8bbd9b,_0x5370fb['model']['createPositionAt'](_0x8bbd9b['nodeAfter'],'end')),_0x1086ea='suggestion:attribute:'+_0xca40e+':'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x1086ea,_0x4c8053);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3901e0['oldValue']==_0x3901e0['newValue'])break;_0x589e25['batch']['addOperation'](_0x3901e0),_0x5370fb['model']['applyOperation'](_0x3901e0);const _0x57643e=_0x3901e0['key'];if(!_0x21499c['isRegisteredAttribute'](_0x57643e))break;const _0x2e1e7a=_0x314060(_0x3901e0['range'],_0x5370fb['model']),_0x2286f1='suggestion:attribute:'+_0x57643e+':'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x2286f1,_0x2e1e7a);break;}case'insert':{_0x589e25['batch']['addOperation'](_0x3901e0),_0x5370fb['model']['applyOperation'](_0x3901e0);if(_0x53cf1f[_0x56b122+0x1]&&'move'==_0x53cf1f[_0x56b122+0x1]['type']){ro(_0x340f6b,_0x3901e0);break;}const _0x44b83b=_0x3901e0['position'],_0x3f0558=_0x3901e0['howMany'],_0x51b263=_0x314060(_0x5370fb['model']['createRange'](_0x44b83b,_0x44b83b['getShiftedBy'](_0x3f0558)),_0x5370fb['model']),_0x37a180='suggestion:insertion:'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x37a180,_0x51b263);break;}case'split':{_0x589e25['batch']['addOperation'](_0x3901e0),_0x5370fb['model']['applyOperation'](_0x3901e0);const _0x46d58a=_0x3901e0['splitPosition'],_0x49df58=_0x3901e0['moveTargetPosition'],_0x4a10a8=_0x5370fb['model']['createRange'](_0x46d58a,_0x49df58),_0x45f1b4='suggestion:insertion:'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x45f1b4,_0x4a10a8);break;}case'move':{_0x589e25['batch']['addOperation'](_0x3901e0),_0x5370fb['model']['applyOperation'](_0x3901e0),_0x53cf1f[_0x56b122-0x1]&&'insert'==_0x53cf1f[_0x56b122-0x1]['type']&&ro(_0x340f6b,_0x3901e0);const _0x405061=_0x3901e0['getMovedRangeStart'](),_0x555bf2=_0x3901e0['howMany'];for(let _0x534e7e=0x0;_0x534e7e<_0x555bf2;_0x534e7e++){const _0x1fdeab=_0x405061['getShiftedBy'](_0x534e7e)['nodeAfter'];_0x2d0736['add'](_0x1fdeab);}break;}case'remove':{const _0x39623b=_0x3901e0['sourcePosition'],_0x2f5089=_0x3901e0['howMany'],_0x462e92=new _0x515526(_0x39623b,_0x2f5089);_0x589e25['batch']['addOperation'](_0x462e92),_0x5370fb['model']['applyOperation'](_0x462e92);break;}}}for(const _0x729794 of _0x2d0736){const _0x2511be=_0x5370fb['model']['createRangeOn'](_0x729794),_0x3bc5ff='suggestion:formatBlock:$fakeWrap:'+_0xdeade1()+':$aiSuggestion';_0x340f6b['markers']['set'](_0x3bc5ff,_0x314060(_0x2511be,_0x5370fb['model']));}});}(_0x5d4856,_0x4a1dea,_0x252733):_0x252733['model']['change'](_0x57d378=>{for(const _0x187ee7 of _0x5d4856)if('remove'==_0x187ee7['type']){const _0x21cd38=_0x187ee7['sourcePosition'],_0x5eca1d=_0x187ee7['howMany'],_0xb1f673=new _0x515526(_0x21cd38,_0x5eca1d);_0x57d378['batch']['addOperation'](_0xb1f673),_0x252733['model']['applyOperation'](_0xb1f673);}else{if('marker'==_0x187ee7['type']){const _0x4990a7=_0x187ee7['name'],_0x5888e3=_0x187ee7['newRange'];null!==_0x5888e3?_0x4a1dea['markers']['set'](_0x4990a7,_0x5888e3):_0x4a1dea['markers']['delete'](_0x4990a7);}else _0x187ee7['baseVersion']=null,_0x187ee7['isDocumentOperation']=!0x1,_0x57d378['batch']['addOperation'](_0x187ee7),_0x252733['model']['applyOperation'](_0x187ee7);}});if(_0x2bee20){const _0x21315b=pt(_0x252733,_0x5d4856,_0x4a1dea);ut(_0x252733['model'],_0x21315b),function(_0x13c28b,_0x45f10f){const _0x9a5f9b=_0x45f10f['getFirstRange']()['start'];let _0x45525e=_0x45f10f['getFirstRange']()['end'];const _0x2078db=_0x9a5f9b['root'];(_0x45525e['textNode']||_0x45525e['nodeAfter']&&_0x45525e['nodeAfter']['is']('$text'))&&(_0xa29121(_0x45525e,'...'),_0x45525e=_0x45525e['getShiftedBy'](0x3)),(_0x9a5f9b['textNode']||_0x9a5f9b['nodeBefore']&&_0x9a5f9b['nodeBefore']['is']('$text'))&&(_0xa29121(_0x9a5f9b,'...'),function(_0x233a23,_0x16942e,_0x394fc2){for(let [_0x1e271a,_0x1744d2]of _0x233a23['markers']){const _0x580c76=_0x1744d2['_getTransformedByInsertion'](_0x16942e,_0x394fc2,!0x1);_0x1744d2=_0x580c76[0x0],_0x233a23['markers']['set'](_0x1e271a,_0x1744d2);}}(_0x2078db,_0x9a5f9b,0x3),_0x9a5f9b['parent']==_0x45525e['parent']&&(_0x45525e=_0x45525e['getShiftedBy'](0x3)));const _0x185e95=_0x13c28b['createRange'](_0x13c28b['createPositionAt'](_0x2078db,0x0),_0x9a5f9b),_0x51ab02=_0x13c28b['createRange'](_0x45525e,_0x13c28b['createPositionAt'](_0x2078db,'end')),_0x5bb6b0=[..._0x185e95['getMinimalFlatRanges'](),..._0x51ab02['getMinimalFlatRanges']()];_0x5bb6b0['reverse']();for(const _0x5f3481 of _0x5bb6b0)_0x372cfd(_0x5f3481),Xn(_0x2078db,_0x5f3481);}(_0x252733['model'],_0x21315b);}const _0x2d1a19=_0x252733['data']['stringify'](_0x4a1dea,{'showSuggestionHighlights':!0x0});return{'content':Wi(_0x2d1a19),'hasChanges':!0x0};}(_0x141805,_0x1459d3,_0x2944e0,_0x2b4acc,_0x33924d);return{'type':_0x46454f['changes'][0x0]['type'],'index':_0x46454f['index'],'content':_0x1a8f00,'hasChanges':_0x514c8b};});}function ro(_0x9c2adb,_0x5ab5f8){for(const [_0x506c82,_0x12d70f]of _0x9c2adb['markers']){const _0x353d77=_0x21f9f5['_createFromRanges'](_0x12d70f['getTransformedByOperation'](_0x5ab5f8));_0x9c2adb['markers']['set'](_0x506c82,_0x353d77);}}function pt(_0x384d71,_0x3adf04,_0x304c62){const _0x203ba0=_0x384d71['plugins']['get']('DocumentCompare');let _0x546856=_0x384d71['model']['createPositionAt'](_0x304c62,Number['POSITIVE_INFINITY']),_0x37c0b1=_0x384d71['model']['createPositionAt'](_0x304c62,0x0);for(const _0x266255 of _0x3adf04){let _0x4ef99e,_0x478050;if(_0x203ba0['isMarkedRemoveOperation'](_0x266255))_0x4ef99e=_0x266255['newRange']['start'],_0x478050=_0x266255['newRange']['end'];else switch(_0x546856=_0x546856['getTransformedByOperation'](_0x266255),_0x37c0b1=_0x37c0b1['getTransformedByOperation'](_0x266255),_0x266255['type']){case'rename':_0x4ef99e=_0x266255['position'],_0x478050=_0x4ef99e['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4ef99e=_0x266255['range']['start'],_0x478050=_0x266255['range']['end'];break;case'insert':_0x4ef99e=_0x266255['position'],_0x478050=_0x4ef99e['getShiftedBy'](_0x266255['howMany']);break;case'split':_0x4ef99e=_0x266255['splitPosition'],_0x478050=_0x266255['moveTargetPosition'];break;case'merge':{const _0x54313c=_0x266255['targetPosition']['path']['slice'](0x0,-0x1);_0x4ef99e=_0x384d71['model']['createPositionFromPath'](_0x304c62,_0x54313c),_0x478050=_0x4ef99e['getShiftedBy'](0x1);break;}case'remove':{const _0x553544=_0x266255['howMany'],_0x122938=_0x266255['sourcePosition']['_getTransformedByInsertion'](_0x266255['targetPosition'],_0x553544),_0x861bc9=_0x266255['getMovedRangeStart']();'remove'==_0x266255['type']?(_0x4ef99e=_0x122938,_0x478050=_0x122938):(_0x4ef99e=_0x861bc9,_0x478050=_0x861bc9['getShiftedBy'](_0x553544));break;}}_0x4ef99e&&_0x4ef99e['isBefore'](_0x546856)&&(_0x546856=_0x4ef99e['clone'](),_0x546856['stickiness']='toNone'),_0x478050&&_0x478050['isAfter'](_0x37c0b1)&&(_0x37c0b1=_0x478050['clone'](),_0x37c0b1['stickiness']='toNone');}return _0x384d71['model']['createSelection'](_0x384d71['model']['createRange'](_0x546856,_0x37c0b1));}function ut(_0x34d3c8,_0x1c9344){so(_0x34d3c8,_0x1c9344,'forward');const _0x38e3f3=_0x1c9344['getFirstRange']();_0x1c9344['setTo']([]),_0x1c9344['setTo'](_0x38e3f3,{'backward':!0x0}),so(_0x34d3c8,_0x1c9344,'backward');}function so(_0x3ac59e,_0x4537df,_0x19805c){let _0x74bbfa=0x14;for(;_0x74bbfa;){_0x3ac59e['modifySelection'](_0x4537df,{'unit':'word','direction':_0x19805c}),_0x74bbfa--;const _0x30a14f=_0x4537df['focus']['forward'==_0x19805c?'nodeBefore':'nodeAfter'];if(_0x30a14f&&_0x30a14f['is']('element')&&_0x3ac59e['schema']['isBlock'](_0x30a14f)&&_0x3ac59e['schema']['isObject'](_0x30a14f))break;}}function Xn(_0x2d252d,_0x440cfb){for(const [_0x2a5a9a,_0x45b8c4]of _0x2d252d['markers']){const _0x45a3cb=_0x45b8c4['_getTransformedByDeletion'](_0x440cfb['start'],_0x440cfb['end']['offset']-_0x440cfb['start']['offset']);null!=_0x45a3cb?_0x2d252d['markers']['set'](_0x2a5a9a,_0x45a3cb):_0x2d252d['markers']['delete'](_0x2a5a9a);}}class Ge extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new ft([]);['parsedMergedContent']=new ft([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x42053d,content:_0x2e50e7='',isDone:_0x781c1b=!0x1,interactionId:_0x543bdd,areActionsDisabled:_0x58c9a9,documentContextContent:_0x38597d,editor:_0x1609d3,id:_0x45a2dc}){super(),this['id']=_0x45a2dc||_0xdeade1(),this['interactionId']=_0x543bdd,this['type']=_0x42053d,this['areActionsDisabled']=!!_0x58c9a9,this['editor']=_0x1609d3,this['aiResponseParser']=new zi(),this['aiResponseApplier']=new Fi(),this['documentContextContent']=Wi(_0x38597d||''),this['set']('isDone',_0x781c1b),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2e50e7);}['appendContent'](_0x489b9a){this['set']('content',this['content']+_0x489b9a);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0xc878e6,_0x3f484f){this['changeGroups'][_0xc878e6]['state']=_0x3f484f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0xc878e6,'state':_0x3f484f});}['getContentParts']({showDiff:_0x1a40eb,groupIndex:_0xda043d}){if(!this['editor'])throw new _0x32ab89('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x46b131=this['_getCachedContentParts'](_0x1a40eb,_0xda043d);if(_0x46b131)return _0x46b131;let _0x3c9c04=[];if(void 0x0===_0xda043d)_0x3c9c04=this['changeGroups'];else{const _0x8401e1=this['changeGroups']['find'](({index:_0x4efb30})=>_0x4efb30===_0xda043d);if(!_0x8401e1)throw new _0x32ab89('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xda043d});_0x3c9c04=[_0x8401e1];}const _0x14ef87=q({'editor':this['editor'],'showDiff':_0x1a40eb,'changeGroups':_0x3c9c04,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1a40eb,_0x14ef87),_0x14ef87;}['_getCachedContentParts'](_0x39e352,_0x39c4e1){const _0xa4aef7=_0x39e352?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0xa4aef7]['length'])return null;const _0x2ea09a=this['cachedSuggestionContentParts'][_0xa4aef7];if(void 0x0===_0x39c4e1)return _0x2ea09a['length']>0x0&&_0x2ea09a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x39e352,null),null):_0x39c5ed(_0x2ea09a);{const _0x1f0d7c=_0x2ea09a['find'](({index:_0x1e8c57})=>_0x1e8c57===_0x39c4e1);if(_0x1f0d7c)return[_0x39c5ed(_0x1f0d7c)];}return null;}['_setCachedContentParts'](_0x2d175a,_0x38ea39){const _0x5e078d=_0x2d175a?'withDiff':'withoutDiff';_0x38ea39?_0x38ea39['forEach'](_0x538692=>{const _0x14063f=this['cachedSuggestionContentParts'][_0x5e078d],_0x2c2e76=_0x14063f['find'](({index:_0x44ff1c})=>_0x44ff1c===_0x538692['index']);if(_0x2c2e76){const _0x4525d7=_0x14063f['indexOf'](_0x2c2e76);_0x14063f['splice'](_0x4525d7,0x1,_0x538692);}else _0x14063f['push'](_0x538692);}):this['cachedSuggestionContentParts'][_0x5e078d]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x55ae18=this['changeGroups'];this['updateChangeGroups']();const _0x8e5400=this['_getDifferentChangeGroups'](_0x55ae18,this['changeGroups']);(_0x8e5400['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x8e5400),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x1f244b,_0x106093){const _0x2b939d=[];for(const _0x1c5088 of _0x106093){const _0x103b80=_0x1f244b[_0x1c5088['index']];_0x103b80?_0x103b80['changes']['length']!==_0x1c5088['changes']['length']?_0x2b939d['push'](_0x1c5088):_0x103b80['changes']['forEach']((_0x1a3173,_0x2c5b7b)=>{const _0x172bcb=_0x1c5088['changes'][_0x2c5b7b];_0x1a3173['id']!==_0x172bcb['id']&&_0x2b939d['push'](_0x1c5088);}):_0x2b939d['push'](_0x1c5088);}return _0x2b939d;}['updateChangeGroups'](){const _0x31d219=new _0x555852('p',{},[new _0x555852('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x28d976(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x4c422d=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x31d219,'cutAfterLastChange':!this['isDone']});if(!_0x4c422d['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4c422d['parsedContent'];let _0x3a4d80=[];if(_0x1010b3(_0x2792df=>{const _0x58171d=Ct(_0x2792df,'data-id');if(!_0x58171d||!_0x45cab5(_0x58171d))return!0x1;const _0x276939=[_0x2792df,...Ui(_0x2792df)]['at'](-0x2);if(_0x2792df!=_0x276939){const _0x256b8d=Ct(_0x276939,'data-id');_0x45cab5(_0x256b8d)||(_0x3a4d80['push']({'node':_0x276939,'id':_0x256b8d,'type':'modified'}),_0x4c422d['modifiedNodeIds']['push'](_0x256b8d));}else _0x4c422d['modifiedNodeIds']['includes'](_0x58171d)?_0x3a4d80['push']({'node':_0x2792df,'type':'modified','id':_0x58171d}):_0x4c422d['newNodeIds']['includes'](_0x58171d)?_0x3a4d80['push']({'node':_0x2792df,'type':'new','id':_0x58171d,'anchorId':Ct(_0x2792df['previousSibling'],'data-id')}):_0x3a4d80['push']({'node':_0x2792df,'type':'removed','id':_0x58171d});return!0x0;},this['parsedMergedContent']),_0x3a4d80=_0x3a4d80['filter'](({node:_0x56f384})=>[...Ui(_0x56f384),_0x56f384]['every'](_0x9c403e=>!Ct(_0x9c403e,'data-unstable'))),0x0==_0x3a4d80['length'])return;const _0x26e976=[[_0x3a4d80[0x0]]];for(let _0x3d618b=0x1;_0x3d618b<_0x3a4d80['length'];_0x3d618b++){const _0x5991cb=_0x26e976[_0x26e976['length']-0x1],_0x1d3941=_0x5991cb[_0x5991cb['length']-0x1];_0x3a4d80[_0x3d618b]['node']['previousSibling']==_0x1d3941['node']&&'modified'!=_0x3a4d80[_0x3d618b]['type']&&'modified'!=_0x1d3941['type']?_0x5991cb['push'](_0x3a4d80[_0x3d618b]):_0x26e976['push']([_0x3a4d80[_0x3d618b]]);}for(const _0x1b37bb of _0x26e976){const _0x18ffa2=_0x1b37bb[0x0],_0x13deae=_0x1b37bb[_0x1b37bb['length']-0x1],_0x298c35=_0x28a9c3(_0x18ffa2['node']['previousSibling']);_0x298c35&&_0x1b37bb['unshift'](_0x298c35);const _0x23822=_0x28a9c3(_0x13deae['node']['nextSibling']);_0x23822&&_0x1b37bb['push'](_0x23822);}function _0x45cab5(_0x4f8d27){return _0x4c422d['modifiedNodeIds']['includes'](_0x4f8d27)||_0x4c422d['newNodeIds']['includes'](_0x4f8d27)||_0x4c422d['removedNodeIds']['includes'](_0x4f8d27);}function _0x28a9c3(_0x3dc28c){if(_0x3dc28c&&Ct(_0x3dc28c,'data-id')&&!Ct(_0x3dc28c,'data-unstable')){const _0x10a2bb=Ct(_0x3dc28c,'data-id');if(!_0x45cab5(_0x10a2bb))return{'node':_0x3dc28c,'type':'context','id':_0x10a2bb};}return null;}this['changeGroups']=_0x26e976['map']((_0x4f8739,_0x40fd4c)=>({'changes':_0x4f8739,'state':'pending','index':_0x40fd4c}));}}const je=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class xe extends Wt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x54da0b,editor:_0x1aaa63}){super(),this['id']=_0xdeade1(),this['connector']=_0x54da0b,this['isStopped']=!0x0,this['editor']=_0x1aaa63;}async['start'](){const _0x3db2c8=[];let _0x46bce6,_0x12563a;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x3b0935=await this['currentRequest']['getStream']();for await(const _0x48f3aa of _0x3b0935){if(this['isStopped'])return;if('error'==_0x48f3aa['event'])return void this['fire']('error',{'error':new _0x32ab89('ai-chat-interaction-error',this)});switch(_0x48f3aa['event']){case'message-metadata':this['messageId']=_0x48f3aa['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x48f3aa['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x48f3aa['data']['conversationTitle'],!0x0);break;case'source':_0x3db2c8['push'](_0x48f3aa['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x46bce6='modification-delta'==_0x48f3aa['event']?'modification':'text',_0x12563a='modification-delta'==_0x48f3aa['event']?_0x48f3aa['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x46bce6&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x46bce6,'interactionId':this['id'],'id':_0x12563a}),'modification'==_0x46bce6&&(this['currentReply']['sources']=_0x3db2c8['splice'](0x0))),this['currentReply']['appendContent'](_0x48f3aa['data']['textDelta']);break;case'mcp-tool-result':this['_handleToolResultData']({'toolName':_0x48f3aa['data']['toolName'],'data':_0x48f3aa['data']['data'],'attributes':_0x48f3aa['data']['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x48f3aa['data']['toolName'],'data':_0x48f3aa['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x3db2c8['length']>0x0&&(this['currentReply']['sources']=_0x3db2c8['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x440e73){return this['replies']['find'](_0x177fc1=>_0x177fc1['id']===_0x440e73);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x53e155=>_0x53e155['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x58e1f3){const _0x668880=new Ge({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x58e1f3});return this['replies']['push'](_0x668880),_0x668880['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x668880),_0x668880;}['setConversationTitle'](_0x57d74e,_0x502c4c=!0x1){this['fire']('setConversationTitle',_0x57d74e,_0x502c4c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x240e74){this['fire']('toolDataReceived',{'type':'result','toolName':_0x240e74['toolName'],'data':structuredClone(_0x240e74['data']),'attributes':structuredClone(_0x240e74['attributes']||{})},this);}['_handleToolNotificationData'](_0x515049){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x515049['toolName'],'data':structuredClone(_0x515049['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Ne=function(_0x1830cc){return _0x1830cc['TOOL']='mcp-tool-context',_0x1830cc['FILE']='file',_0x1830cc['DOCUMENT']='document',_0x1830cc['URL']='web-resource',_0x1830cc['TEXT']='text',_0x1830cc['SELECTION']='selection',_0x1830cc;}({}),Fe=function(_0x21c66f){return _0x21c66f['TEXT']='text',_0x21c66f['MARKDOWN']='markdown',_0x21c66f['HTML']='html',_0x21c66f;}({});const Le=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Ue=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class ze extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x457ba9,config:_0x9c72c8,ownerId:_0x30851d}){super(),this['_connector']=_0x457ba9,this['_config']=_0x9c72c8,this['_ownerId']=_0x30851d;}['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'](_0x39d80f){const _0x368252=await this['_createContextItemFromContent'](_0x39d80f);return this['_addToConversationContextItem'](_0x368252),'current-document'===_0x368252['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x368252;}async['_createContextItemFromContent'](_0x3f7242){if(_0x3f7242['type']===Ne['DOCUMENT']){const _0x3601d2=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3f7242['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3f7242['type'],'content':_0x3601d2['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3601d2['attributes']?.['version'],'sessionId':_0x3601d2['attributes']?.['sessionId']};}if(_0x3f7242['type']===Ne['TOOL'])return{'id':_0x3f7242['id'],'uiId':_0x3f7242['id'],'label':_0x3f7242['data']?.['label']||_0x3f7242['id'],'type':Ne['TOOL'],'mcpServerName':_0x3f7242['mcpServerName'],'toolName':_0x3f7242['toolName'],'data':_0x3f7242['data']||{}};return{'id':_0x3f7242['id'],'uiId':_0x3f7242['id'],'label':_0x3f7242['attributes']?.['label']||_0x3f7242['name']||_0x3f7242['url']||_0x3f7242['id'],'type':_0x3f7242['type'],..._0x3f7242?.['attributes']?.['resourceId']?{'resourceId':_0x3f7242['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x523ba4){const _0x31dd96=this['_pendingContextItems']['get'](_0x523ba4);_0x31dd96?.['isReadOnly']||this['_removeContextItem'](_0x523ba4);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3427e4 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3427e4['uiId']);const _0x50e87e=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x50e87e&&this['_addContextItem']({..._0x50e87e,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x523db5){for(const _0x55138e of _0x523db5['values']())this['_addToConversationContextItem'](_0x55138e);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'](_0x3becd4){return Array['from'](_0x3becd4['values']())['map'](_0x831fc0=>this['_mapContextItemToRequestData'](_0x831fc0))['filter'](_0x30051b=>null!==_0x30051b);}async['addFilesToContext'](_0x58df5d,_0x404452,_0x9a1c11=Ne['FILE']){const _0x5b216d='files-'+_0xdeade1();this['_startUploadOperation'](_0x5b216d);try{await Promise['all'](_0x58df5d['map'](async _0x3c0fd3=>{const _0x13c5ce='file-'+_0xdeade1(),_0x4ea02a=_0x3bf51a(_0x3c0fd3['name']);try{this['_addContextItem']({'type':_0x9a1c11,'label':_0x404452?.['label']||_0x4ea02a,'uiId':_0x13c5ce,'resourceId':_0x404452?.['resourceId']},!0x0);const _0x297ace=this['_connector']['uploadFile'](this['_ownerId'],_0x3c0fd3,_0x404452);this['_ongoingUploads']['set'](_0x13c5ce,_0x297ace['abortController']);const {id:_0x3f1472}=await _0x297ace['getId']();this['_ongoingUploads']['delete'](_0x13c5ce),this['_finishContextItemLoading']({'type':_0x9a1c11,'id':_0x3f1472,'label':_0x404452?.['label']||_0x4ea02a,'uiId':_0x13c5ce,'resourceId':_0x404452?.['resourceId']},!0x1);}catch(_0x3b72ff){this['_ongoingUploads']['delete'](_0x13c5ce);if(!(_0x3b72ff instanceof _0x32ab89&&_0x3b72ff['message']['startsWith']('ai-request-aborted'))){const _0x2360ed=Le['get'](_0x3b72ff['code'])||'ai-chat-file-upload-failed',_0x108606=new _0x32ab89(_0x2360ed,null,{'fileName':_0x4ea02a,..._0x3b72ff});_0x108606['stack']=_0x3b72ff['stack'],this['fire']('error',{'error':_0x108606});}this['_removeContextItem'](_0x13c5ce);}}));}finally{this['_finishUploadOperation'](_0x5b216d);}}['addCurrentDocumentToContext'](_0x1881b9){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x16da95={'type':Ne['DOCUMENT'],'uiId':'current-document','label':_0x1881b9,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x16da95);}async['updateCurrentDocument'](_0xfd56f3,_0x244f96,_0x211422,_0x5dd4f4){const _0x4446c2=this['_pendingContextItems']['get']('current-document');if(_0x4446c2&&_0xfd56f3){_0x4446c2['selection']=_0x5dd4f4?_0x5dd4f4['map'](_0x4f7193=>({'start':_0x4f7193['start'],'end':_0x4f7193['end']})):[];try{if(_0x4446c2['version']===_0x244f96)return;const {id:_0xfca1e2}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xfd56f3,{'version':_0x244f96,'sessionId':_0x211422})['getId']();_0x4446c2['id']=_0xfca1e2,_0x4446c2['content']=_0xfd56f3,_0x4446c2['version']=_0x244f96,_0x4446c2['sessionId']=_0x211422;}catch(_0x1ecd23){const _0x2b3fd8=new _0x32ab89('ai-chat-document-upload-failed',null);_0x2b3fd8['stack']=_0x1ecd23['stack'],this['fire']('error',{'error':_0x2b3fd8});}}}['addSelectionToContext'](_0x55486e){this['_addContextItem']({'type':Ne['SELECTION'],'label':_0x55486e,'uiId':'selection','content':_0x55486e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4a80b9,_0x6a9d6){const _0x409240='url-'+_0xdeade1();this['_startUploadOperation'](_0x409240);const _0x44068='url-'+_0xdeade1();try{this['_addContextItem']({'type':Ne['URL'],'label':_0x6a9d6?.['label']||_0x4a80b9,'uiId':_0x44068,'resourceId':_0x6a9d6?.['resourceId']},!0x0);const _0x14466d=this['_connector']['uploadUrl'](this['_ownerId'],_0x4a80b9,_0x6a9d6);this['_ongoingUploads']['set'](_0x44068,_0x14466d['abortController']);const {id:_0x3273cf}=await _0x14466d['getId']();this['_ongoingUploads']['delete'](_0x44068),this['_finishContextItemLoading']({'type':Ne['URL'],'id':_0x3273cf,'label':_0x6a9d6?.['label']||_0x4a80b9,'uiId':_0x44068,'resourceId':_0x6a9d6?.['resourceId']},!0x1);}catch(_0x4a2649){this['_ongoingUploads']['delete'](_0x44068),(_0x4a2649['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x32ab89('ai-chat-url-upload-failed',this,{'url':_0x4a80b9,'originalError':_0x4a2649}),'url':_0x4a80b9}),this['_removeContextItem'](_0x44068));}finally{this['_finishUploadOperation'](_0x409240);}}['addToolItemToContext'](_0x5201c5){this['_pendingContextItems']['set'](_0x5201c5['uiId'],_0x5201c5),this['fire']('contextItemAdded',{'contextItem':_0x5201c5,'isLoading':!0x1});}async['loadSourceResources'](_0x4348d2,_0x561967,_0x247b07){const _0x362850=this['_addContextOptionsState']['sources']['find'](_0x285c00=>_0x285c00['id']===_0x4348d2);if(!_0x362850)return this['fire']('error',{'error':new _0x32ab89('ai-chat-source-not-found',this,{'sourceId':_0x4348d2}),'sourceId':_0x4348d2}),[];try{const _0x41b85f=(await _0x362850['getResources'](_0x561967))['map'](_0x566451=>{const _0x4d06be=this['_isResourceInContext'](_0x566451['id']);return{..._0x566451,'isInContext':_0x4d06be};});return _0x362850['resources']=_0x41b85f,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4348d2,'source':_0x362850,'resources':_0x41b85f,'uid':_0x247b07}),_0x41b85f;}catch(_0x4c90f6){return this['fire']('error',{'error':new _0x32ab89('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4348d2,'originalError':_0x4c90f6}),'sourceId':_0x4348d2,'sourceLabel':_0x362850['label']}),[];}}async['addResourceToContext'](_0x590f7f,_0x952574){if(this['_isResourceInContext'](_0x952574['id']))return;let _0x56b5c9=_0x952574['data'];if(!_0x56b5c9&&_0x590f7f['getData'])try{_0x56b5c9=await _0x590f7f['getData'](_0x952574['id']);}catch(_0x9e369f){return void this['fire']('error',{'error':new _0x32ab89('ai-chat-resource-load-failed',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id'],'originalError':_0x9e369f}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});}if(_0x56b5c9)switch(_0x952574['type']){case Ne['URL']:if('string'!=typeof _0x56b5c9)return void this['fire']('error',{'error':new _0x32ab89('ai-chat-context-invalid-data',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id'],'expectedType':'string','actualType':typeof _0x56b5c9}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});await this['addUrlToContext'](_0x56b5c9,{'label':_0x952574['label'],'resourceId':_0x952574['id']});break;case Ne['FILE']:if(!(_0x56b5c9 instanceof File))return void this['fire']('error',{'error':new _0x32ab89('ai-chat-context-invalid-data',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id'],'expectedType':'File','actualType':typeof _0x56b5c9}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});await this['addFilesToContext']([_0x56b5c9],{'label':_0x952574['label'],'resourceId':_0x952574['id']});break;case Ne['TEXT']:if('object'!=typeof _0x56b5c9||!('content'in _0x56b5c9)||!('type'in _0x56b5c9))return void this['fire']('error',{'error':new _0x32ab89('ai-chat-context-invalid-data',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x56b5c9}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});_0x56b5c9=ze['_convertTextResourceToFile'](_0x56b5c9,_0x952574['label']),await this['addFilesToContext']([_0x56b5c9],{'label':_0x952574['label'],'resourceId':_0x952574['id']},Ne['TEXT']);break;case Ne['TOOL']:break;default:this['fire']('error',{'error':new _0x32ab89('ai-chat-context-unsupported-type',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id'],'resourceType':_0x952574['type']}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});}else this['fire']('error',{'error':new _0x32ab89('ai-chat-resource-no-data',this,{'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']}),'resourceId':_0x952574['id'],'sourceId':_0x590f7f['id']});}static['_convertTextResourceToFile'](_0x2ef0fd,_0x261529){switch(_0x2ef0fd['type']){case Fe['MARKDOWN']:return new File([_0x2ef0fd['content']],_0x261529,{'type':'text/markdown'});case Fe['HTML']:return new File([_0x2ef0fd['content']],_0x261529,{'type':'text/html'});default:return new File([_0x2ef0fd['content']],_0x261529,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x48b79){switch(_0x48b79['type']){case Ne['FILE']:return{'type':Ne['FILE'],'id':_0x48b79['id']};case Ne['URL']:return{'type':Ne['URL'],'id':_0x48b79['id']};case Ne['DOCUMENT']:return{'type':Ne['DOCUMENT'],'id':_0x48b79['id'],..._0x48b79['selection']?.['length']&&{'selection':_0x48b79['selection']}};case Ne['TEXT']:return{'type':Ne['FILE'],'id':_0x48b79['id']};case Ne['TOOL']:{const _0x18bdcf=_0x48b79;return{'type':Ne['TOOL'],'mcpServerName':_0x18bdcf['mcpServerName'],'toolName':_0x18bdcf['toolName'],'data':_0x18bdcf['data'],'id':_0x18bdcf['id']};}default:return null;}}['_addContextItem'](_0x383792,_0x20eafd=!0x1){if(this['_pendingContextItems']['set'](_0x383792['uiId'],_0x383792),_0x383792['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x383792,'isLoading':_0x20eafd}),'current-document'===_0x383792['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x383792['resourceId']){const _0x29b0e6=this['_findSourceIdsByResourceId'](_0x383792['resourceId']);_0x29b0e6&&_0x29b0e6['forEach'](_0x52310a=>{this['_updateResourceInContextState'](_0x52310a,_0x383792['resourceId'],!0x0);});}}['_removeContextItem'](_0x5a71c5){const _0x236726=this['_pendingContextItems']['get'](_0x5a71c5),_0x30245c=this['_ongoingUploads']['get'](_0x5a71c5);if(_0x30245c&&(_0x30245c['abort'](),this['_ongoingUploads']['delete'](_0x5a71c5)),_0x236726?.['resourceId']){const _0x1023f9=this['_findSourceIdsByResourceId'](_0x236726['resourceId']);_0x1023f9&&_0x1023f9['forEach'](_0x4e4188=>{this['_updateResourceInContextState'](_0x4e4188,_0x236726['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5a71c5),this['fire']('contextItemRemoved',{'uiId':_0x5a71c5,'type':_0x236726?.['type']}),'current-document'===_0x5a71c5&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x53c226,_0x2e153d){if(this['_pendingContextItems']['has'](_0x53c226['uiId'])&&(this['_pendingContextItems']['set'](_0x53c226['uiId'],_0x53c226),this['fire']('contextItemLoadingEnded',{'contextItem':_0x53c226,'isLoading':_0x2e153d}),_0x53c226['resourceId'])){const _0x8a2a67=this['_findSourceIdsByResourceId'](_0x53c226['resourceId']);_0x8a2a67&&_0x8a2a67['forEach'](_0x5199d4=>{this['_updateResourceInContextState'](_0x5199d4,_0x53c226['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x15e09f){this['_conversationContextItems']['set'](_0x15e09f['uiId'],_0x15e09f);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x38da2e=>({..._0x38da2e,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1697c6=>({..._0x1697c6,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x4a68ca=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x4a68ca,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1dbe03){for(const _0x955345 of this['_pendingContextItems']['values']())if(_0x955345['resourceId']===_0x1dbe03)return!0x0;for(const _0x188750 of this['_conversationContextItems']['values']())if(_0x188750['resourceId']===_0x1dbe03)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5efbb4){const _0x1fe33f=[];for(const _0x56b603 of this['_addContextOptionsState']['sources']){_0x56b603['resources']['find'](_0x300a00=>_0x300a00['id']===_0x5efbb4)&&_0x1fe33f['push'](_0x56b603['id']);}return 0x0===_0x1fe33f['length']?null:_0x1fe33f;}['_updateResourceInContextState'](_0xdaedc2,_0x6b9e32,_0x199ecf){const _0x786274=this['_addContextOptionsState']['sources']['find'](_0x435b97=>_0x435b97['id']===_0xdaedc2);if(!_0x786274)return;const _0x5a2be6=_0x786274['resources']['find'](_0x137ff4=>_0x137ff4['id']===_0x6b9e32);_0x5a2be6&&(_0x5a2be6['isInContext']=_0x199ecf,this['fire']('resourceStateChanged',{'sourceId':_0xdaedc2,'resourceId':_0x6b9e32,'isInContext':_0x199ecf}));}['_startUploadOperation'](_0x5e694a){this['_ongoingUploadOperations']['set'](_0x5e694a,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x278280){this['_ongoingUploadOperations']['delete'](_0x278280),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Je=['capabilitiesUpdated'];class We extends Wt(){['_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'](_0xbabf51){const _0x28ceb9={};return _0xbabf51&&_0xbabf51['isWebSearchEnabled']&&(_0x28ceb9['webSearch']={}),_0xbabf51&&_0xbabf51['isReasoningEnabled']&&(_0x28ceb9['reasoning']={}),_0x28ceb9;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x381ab0){_0x381ab0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x381ab0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x480aa1){_0x480aa1!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x480aa1,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Be extends xe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x4701d6){super(_0x4701d6),this['conversationId']=_0x4701d6['conversationId'],this['contextItems']=_0x4701d6['contextItems'],this['capabilities']=_0x4701d6['capabilities'],this['userMessage']=_0x4701d6['userMessage'],this['model']=_0x4701d6['model'],this['attributes']=_0x4701d6['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':ze['mapContextItemsToRequestData'](this['contextItems']),'capabilities':We['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ct extends Wt(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x12399a){super(),this['options']=_0x12399a,this['connector']=_0x12399a['connector'],this['chatModels']=_0x12399a['chatModels'],this['id']=_0x12399a['conversationId'];}async['init'](_0x52e39d){try{this['chatContext']=new ze({'connector':this['connector'],'config':_0x52e39d,'ownerId':this['id']}),this['chatContext']['delegate'](...Ue)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new We(),this['chatCapabilities']['delegate'](...Je)['to'](this),this['chatCapabilities']['init']();const _0x5ef221=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5ef221});const _0x39ac75=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x39ac75&&await this['setModel'](_0x39ac75);}catch(_0x249669){const _0x19b4c4=new _0x32ab89('ai-chat-conversation-init-failed',null,{'message':_0x249669['message']||_0x249669});_0x19b4c4['stack']=_0x249669['stack'],this['fire']('error',{'error':_0x19b4c4});}}async['start'](){if(this['isStarted'])throw new _0x32ab89('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x32ab89('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3ab738}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3ab738,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x209549){const _0x4f6798=new _0x32ab89('ai-chat-conversation-start-failed',null,{'message':_0x209549['message'],'conversationId':this['id']});throw _0x4f6798['stack']=_0x209549['stack'],this['fire']('error',{'error':_0x4f6798}),_0x4f6798;}}async['load'](_0x5c9805,_0x4addcf){try{const _0x3a6c4a=await this['connector']['fetchConversation'](_0x5c9805)['getConversation'](),_0x53a37c=await this['connector']['fetchConversationMessages'](_0x5c9805)['getMessages'](),_0x5b3456=_0x53a37c[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3a6c4a['id'],'title'in _0x3a6c4a?this['fire']('setConversationTitle',_0x3a6c4a['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x19c135=(await this['chatModels']['getAll']())['find'](_0x478294=>_0x478294['id']['toLowerCase']()===_0x5b3456['toLowerCase']());return this['selectedModel']=_0x19c135,this['fire']('modelSelected',{'selectedModel':_0x19c135,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x53a37c,_0x4addcf,_0x5b3456),this['currentInteraction']=void 0x0,this;}catch(_0x13c847){const _0xac3fca=new _0x32ab89('ai-chat-conversation-init-from-id-failed',null,{'message':_0x13c847['message'],'conversationId':_0x5c9805});throw _0xac3fca['stack']=_0x13c847['stack'],this['fire']('error',{'error':_0xac3fca}),_0xac3fca;}}async['_processMessagesToInteractions'](_0x1d58ae,_0x2a051d,_0x1016b8){let _0x2108a4;for(const _0x339518 of _0x1d58ae)if('user'===_0x339518['role']){const _0x378ea4=await this['_extractContextItems'](_0x339518),_0x5ab02e={'isReasoningEnabled':Object['hasOwn'](_0x339518['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x339518['capabilities'],'webSearch')};_0x2108a4=this['createInteraction']({'userMessage':_0x339518['prompt'],'contextItems':_0x378ea4,'capabilities':_0x5ab02e,'modelId':_0x1016b8,'attributes':_0x339518['attributes']}),this['currentInteraction']=_0x2108a4,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x339518['role']&&_0x2108a4){const _0x1fb14f=[];for(const _0x58e47c of _0x339518['content'])switch(_0x58e47c['type']){case'text':case'modification':{const _0x3d3ec4=_0x2108a4['getDocumentContext']()?.['sessionId']!==_0x2a051d;_0x2108a4['currentReply']=_0x2108a4['createReply']({'type':_0x58e47c['type'],'isDone':!0x0,'interactionId':_0x2108a4['id'],'areActionsDisabled':_0x3d3ec4}),_0x2108a4['currentReply']['appendContent'](_0x58e47c['content']),_0x1fb14f['length']>0x0&&(_0x2108a4['currentReply']['sources']=_0x1fb14f['splice'](0x0));break;}case'url':_0x1fb14f['push'](_0x58e47c);break;case'mcp-tool-result':{const {data:_0x512b0b,attributes:_0x24a1f9}=JSON['parse'](_0x58e47c['content']);_0x2108a4['_handleToolResultData']({'toolName':_0x58e47c['toolName'],'data':_0x512b0b,'attributes':_0x24a1f9});break;}}}}}async['_extractContextItems'](_0x1d114a){const _0x236012=new Map();if(!_0x1d114a['content'])return _0x236012;for(const _0x1926be of _0x1d114a['content']){const _0x3fd3fc=await this['chatContext']['populateFromMessage'](_0x1926be);_0x3fd3fc&&_0x236012['set'](_0x3fd3fc['id'],_0x3fd3fc);}return _0x236012;}async['handleUserInteraction']({userMessage:_0x20a2f0,attributes:_0x4b2b3f}){if(!this['isStarted'])throw new _0x32ab89('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x32ab89('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x52ab3e=this['chatContext']['getPendingContextItems'](),_0x2932b4=this['chatCapabilities']['getCapabilitiesConfig'](),_0x20417e=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x20a2f0,'contextItems':_0x52ab3e,'capabilities':_0x2932b4,'modelId':_0x20417e,'attributes':_0x4b2b3f}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3f7080){if(_0x3f7080 instanceof _0x32ab89)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3f7080});else{const _0x21ef57=Le['get'](_0x3f7080['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x32ab89(_0x21ef57,null,{'error':_0x3f7080})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5ec6fd,contextItems:_0xd6b5ce,capabilities:_0x3203a6,modelId:_0x13fbdc,attributes:_0x3691cb}){const _0x1b4457=new Be({'userMessage':_0x5ec6fd,'contextItems':_0xd6b5ce,'capabilities':_0x3203a6,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x13fbdc,'attributes':_0x3691cb});return _0x1b4457['delegate'](...je)['to'](this),this['interactions']['push'](_0x1b4457),this['fire']('interactionCreated',_0x1b4457),_0x1b4457;}['getInteraction'](_0x29a7d1){return this['interactions']['find'](_0x2ef243=>_0x2ef243['id']===_0x29a7d1);}['removeInteraction'](_0x5d2519){const _0x152c82=this['getInteraction'](_0x5d2519);_0x152c82&&(_0x152c82['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x152c82),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x36dd7b){this['chatContext']['addCurrentDocumentToContext'](_0x36dd7b);}async['updateCurrentDocumentInContext']({content:_0x51c417,version:_0x271dd9,sessionId:_0x562861,selections:_0xa15db8}){await this['chatContext']['updateCurrentDocument'](_0x51c417,_0x271dd9,_0x562861,_0xa15db8);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x245bc4){this['chatContext']['addSelectionToContext'](_0x245bc4);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3f25ee){this['chatContext']['addFilesToContext'](_0x3f25ee);}['addUrlToContext'](_0x2cc613){this['chatContext']['addUrlToContext'](_0x2cc613);}['addToolItemToContext'](_0x154892){this['chatContext']['addToolItemToContext'](_0x154892);}['addResourceToContext'](_0x5a93d0,_0x17e3e1){this['chatContext']['addResourceToContext'](_0x5a93d0,_0x17e3e1);}['loadSourceResources'](_0x4eb87d,_0x1489fd,_0x1ae31f){return this['chatContext']['loadSourceResources'](_0x4eb87d,_0x1489fd,_0x1ae31f);}['removeFromContext'](_0x1de0cc){this['chatContext']['removeFromContext'](_0x1de0cc);}['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'](_0x1313a7){_0x1313a7?!0x1===await this['chatModels']['isAvailable'](_0x1313a7)&&(_0x2ad26e('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1313a7}),_0x1313a7=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x2ad26e('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1313a7=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1313a7['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1313a7,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1313a7}));}}class dt extends Wt(){['_connector'];['_config'];['_locale'];['_modelList']=[];constructor({connector:_0x2ba530,config:_0x349f6d,locale:_0x5af395}){super(),this['_connector']=_0x2ba530,this['_config']=_0x349f6d,this['_locale']=_0x5af395;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){if(!this['_modelList']['length'])try{const _0x36d729=this['_locale']['uiLanguage']||'en',_0x4b51d4=this['_connector']['getModels'](_0x36d729),_0x219fa1=await _0x4b51d4['list']();this['_modelList']=_0x219fa1['items']['map'](_0x58cd5f=>Bi(_0x58cd5f)?{..._0x58cd5f,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x58cd5f);}catch(_0xa47e6c){throw rt('ai-models-unable-to-retrieve',{'error':_0xa47e6c}),_0xa47e6c;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x40dbf4=await this['getAll']();let _0x328378;return _0x328378=this['_availableModels']?this['_filterModels'](_0x40dbf4,this['_availableModels']):_0x40dbf4['filter'](_0x31ae8b=>_0x31ae8b['recommended']),_0x328378;}async['getModel'](_0x50c5f3){const _0x1d7965=await this['getAll']();if(!_0x1d7965['length'])return null;if(_0x50c5f3){const _0xbcb2e4=this['_getModelById'](_0x1d7965,_0x50c5f3);if(_0xbcb2e4)return _0xbcb2e4;_0x2ad26e('ai-chat-model-id-unrecognized',{'modelId':_0x50c5f3,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x38b910=await this['getAvailableModels']();if(!_0x38b910['length'])return null;if(this['_defaultModelId']){const _0x5326ff=this['_getModelById'](_0x38b910,this['_defaultModelId']);if(_0x5326ff)return _0x5326ff;_0x2ad26e('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x38b910[0x0]['id']});}return _0x38b910[0x0];}async['isAvailable'](_0x3e8dac){return(await this['getAvailableModels']())['some'](_0x41a7d6=>_0x41a7d6['name']===_0x3e8dac['name']&&_0x41a7d6['provider']===_0x3e8dac['provider']);}['_filterModels'](_0x22b694,_0x10719c){let _0x496512;if(_0x10719c){_0x496512=[];const _0x2786f5=new Set(),_0x2abba7='string'==typeof _0x10719c?[_0x10719c['toLocaleLowerCase']()]:_0x10719c['map'](_0x27af90=>_0x27af90['toLocaleLowerCase']());for(const _0x1c0873 of _0x2abba7)for(const _0x3b1954 of _0x22b694)!_0x2786f5['has'](_0x3b1954['id'])&&this['_isMatchingFilter'](_0x3b1954,_0x1c0873)&&(_0x496512['push'](_0x3b1954),_0x2786f5['add'](_0x3b1954['id']));}else _0x496512=_0x22b694;return _0x496512;}['_isMatchingFilter'](_0x40e814,_0x1f8fef){const _0x23fa77=_0x40e814['id']['toLocaleLowerCase'](),_0x52863d=_0x40e814['name']['toLocaleLowerCase'](),_0xcf3487=_0x40e814['provider']['toLocaleLowerCase']();return _0x23fa77===_0x1f8fef||_0x52863d===_0x1f8fef||Bi(_0x40e814)&&'auto'===_0x1f8fef||_0xcf3487===_0x1f8fef||_0x23fa77['startsWith'](_0x1f8fef);}['_getModelById'](_0x3a88fe,_0x2ac876){return _0x3a88fe['find'](_0x599fa5=>Bi(_0x599fa5)&&'auto'===_0x2ac876?_0x599fa5:_0x599fa5['id']===_0x2ac876)||null;}}function Bi(_0x32cacf){return _0x32cacf['id']['startsWith']('agent');}function lt(_0x5bc527){if(_0x5bc527 instanceof nt)return _0x5bc527;if(_0x5bc527?.['editors']&&_0x5bc527['editors']['get'](0x0))return _0x5bc527['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.'),_0x5bc527['editors']['get'](0x0);throw new _0x32ab89('ai-get-editor-from-context-no-editor');}function W({editor:_0x17866b,interaction:_0x7f6b65,reply:_0x259db9,groups:_0x330e64,transform:_0x208db3,documentCompare:_0x468831,documentCompareOptions:_0x38cc95}){const _0x590d19=_0x7f6b65['getDocumentContext']();if(!_0x590d19)return[];const _0x2fbb1b=_0x590d19['content'],_0x3c00b2=_0x590d19['version'],_0x4735dc=_0x259db9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x526508}of _0x330e64){const _0x122f02=_0x526508['filter'](_0x1565ea=>'new'!=_0x1565ea['type'])['map'](_0x133428=>Tt('data-id',_0x133428['id'],_0x4735dc)),_0x1d8077=_0x526508['filter'](_0x3e77ea=>'removed'!=_0x3e77ea['type'])['map'](_0x30fb52=>_0x30fb52['node']['cloneNode'](!0x0));let _0x2e6db2=null;if(_0x122f02['length']){_0x2e6db2=_0x122f02[0x0]['previousSibling'];for(let _0x24f769=0x0;_0x24f769<_0x122f02['length'];_0x24f769++)_0x5e22d6(_0x122f02[_0x24f769]);}if(_0x1d8077['length']){_0x2e6db2||(_0x526508[0x0]['anchorId']?_0x2e6db2=Tt('data-id',_0x526508[0x0]['anchorId'],_0x4735dc):(_0x2e6db2=_0x1d8077['shift'](),_0x59b5dd(_0x4735dc,_0x2e6db2)));for(let _0x5cbfb0=0x0;_0x5cbfb0<_0x1d8077['length'];_0x5cbfb0++)_0xb74017(_0x2e6db2,_0x1d8077[_0x5cbfb0]),_0x2e6db2=_0x1d8077[_0x5cbfb0];}}const _0x3b3f1c=It(_0x4735dc),_0x28ebb7=_0x468831['getDiff'](_0x2fbb1b,_0x3b3f1c,_0x38cc95)['getOperations']();if(_0x208db3){const _0x1d9d1b=_0x17866b['model']['document']['history']['getOperations'](_0x3c00b2),_0x41343f={'document':_0x17866b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x471b37(_0x28ebb7,_0x1d9d1b,_0x41343f)['operationsA'];}return _0x28ebb7;}function V(_0x402c24,_0x49497a){if('marker'!=_0x49497a['type'])return;const _0x459560=_0x402c24['model']['markers']['get'](_0x49497a['name']);_0x459560&&(_0x49497a['oldRange']=_0x459560['getRange']());}class tt extends _0x47e329{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[S,_0xac1d67];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0x4bb856(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new dt({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x2a6a01=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3d2a96,_0x4a63c3)=>{this['_handleUIUserMessage']({'userMessage':_0x4a63c3});}),this['listenTo'](_0x2a6a01,'resizedTabs',(_0x588ab8,_0x4173c5)=>{this['_setIsMaximized'](_0x4173c5);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x2a6a01['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x4c74e3,_0x5a44ef)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x5a44ef));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4f1e87,_0x477938)=>{this['activeConversation']?.['addUrlToContext'](_0x477938);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x3db40d,_0x7d7f1e)=>{_0x7d7f1e['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x38fa81,_0xc64c2f)=>{this['activeConversation']?.['addResourceToContext'](_0xc64c2f['source'],_0xc64c2f['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x557c80,_0x243511)=>{this['_removeFromContext'](_0x243511);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3a3ba5,_0x150c35)=>{this['activeConversation']?.['loadSourceResources'](_0x150c35['sourceId'],_0x150c35['query'],_0x150c35['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3a00e6,_0xf96965)=>{this['activeConversation']?.['setModel'](_0xf96965);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5e1f0e,{replyId:_0x120186})=>{console['log']('Liked\x20response',_0x120186);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2f99d6,{replyId:_0x569260})=>{console['log']('Disliked\x20response',_0x569260);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x349c40,_0x70cfc4)=>{this['_insertSuggestion'](_0x70cfc4);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5a8009,{replyId:_0x4661f0,partIndex:_0x372f8f})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4661f0,_0x372f8f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x219195,{replyId:_0x424fd3,partIndex:_0x462fa1})=>{const _0x11d7e1=this['_getDocumentRangeForReplyChanges'](_0x424fd3,_0x462fa1);_0x11d7e1&&'$graveyard'!=_0x11d7e1['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x11d7e1['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x4b7de4,_0x290add)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x290add);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x249ef4,{replyId:_0x17ea65,showDiff:_0x4dc46a})=>{const {reply:_0x480ef4}=this['getInteractionAndReplyById'](_0x17ea65),_0x37313b=_0x480ef4['getContentParts']({'showDiff':_0x4dc46a});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x480ef4['id'],'parts':_0x37313b,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x21525b,{replyId:_0x35e9e0,partIndex:_0x464357})=>{this['_rejectSuggestion']({'replyId':_0x35e9e0,'partIndex':_0x464357}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x19d593,partIndex:_0x5d3747}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x2ce610}=this['getInteractionAndReplyById'](_0x19d593),_0x13f7e9=_0x2ce610['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x5d3747});this['_aiChatBalloon']['updateContent']({'part':_0x13f7e9[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x4e4a1e,partIndex:_0x7756c}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x4e4a1e,'partIndex':_0x7756c}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x42ea2b,partIndex:_0x210f37}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x42ea2b,'partIndex':_0x210f37}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x1d3243,partIndex:_0x3c7530}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x1d3243,'partIndex':_0x3c7530}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x55cca2,partIndex:_0x2fe656}=this['_currentPreviewedChangeGroup'],_0x25f0fb=this['_getPresentableSiblingContentPartIndex'](_0x55cca2,_0x2fe656,'next');null!==_0x25f0fb&&this['_openBalloonFor'](_0x55cca2,_0x25f0fb);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x9d547a,partIndex:_0x810142}=this['_currentPreviewedChangeGroup'],_0x49e2f0=this['_getPresentableSiblingContentPartIndex'](_0x9d547a,_0x810142,'previous');null!==_0x49e2f0&&this['_openBalloonFor'](_0x9d547a,_0x49e2f0);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x347bee,{id:_0x428a7e})=>{if('aiChatBalloon'!==_0x428a7e)return;const {replyId:_0x331e96,partIndex:_0x533c38}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x331e96,'index':_0x533c38,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof nt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2ea1dc,_0x36836b)=>{_0x36836b['on']('ready',()=>{this['_integrateEditor'](_0x36836b);});});const _0x1e7f50=this['context']['config']['get']('ai.chat.initialConversation');let _0x5f53d0=_0x1e7f50;if('lastCreated'!=_0x1e7f50||(_0x5f53d0=await this['_getLastCreatedConversationId'](),_0x5f53d0))return'new'==_0x5f53d0?this['_startConversationSafely']():this['loadConversation'](_0x5f53d0);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0x239bde){const _0x120c8d=lt(this['context']);if(!_0x120c8d['plugins']['has']('TrackChanges'))throw new _0x32ab89('ai-no-track-changes',null);const _0x3b0f4d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x156d4d,interaction:_0x5a0921}=this['getInteractionAndReplyById'](_0x239bde['replyId']),_0x247743=this['_getDocumentRangeForReplyChanges'](_0x239bde['replyId'],_0x239bde['partIndex']),_0x5d0059=void 0x0!==_0x239bde['partIndex']?[_0x156d4d['changeGroups'][_0x239bde['partIndex']]]:_0x156d4d['changeGroups']['filter'](_0x4a455e=>'pending'==_0x4a455e['state']),_0x18379a=_0x5d0059['map'](_0x556c01=>_0x156d4d['changeGroups']['indexOf'](_0x556c01));if(!_0x247743||'$graveyard'==_0x247743['range']['root']['rootName'])return void _0x18379a['forEach'](_0x24ad4f=>_0x156d4d['setChangeGroupState'](_0x24ad4f,'outdated'));_0x18379a['forEach'](_0x3afc62=>_0x156d4d['setChangeGroupState'](_0x3afc62,'accepted'));const _0x5a67e2=W({'editor':_0x120c8d,'reply':_0x156d4d,'interaction':_0x5a0921,'groups':_0x5d0059,'transform':!0x0,'documentCompare':_0x3b0f4d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x2fd4e8;_0x247743&&this['_scrollToSuggestionRange'](_0x247743['range']),_0x120c8d['model']['change'](_0x2e5b02=>{_0x2fd4e8=_0x2e5b02['batch'],_0x120c8d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5a67e2),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x2fd4e8,{'interactionId':_0x5a0921['id'],'replyId':_0x156d4d['id'],'indexes':_0x18379a['slice']()}),this['_updateRatings'](_0x156d4d);}['_applySuggestion'](_0x1968e2){const _0x3ca022=lt(this['context']),_0x15d228=this['context']['plugins']['get'](_0xac1d67),{reply:_0x418ff7,interaction:_0x173126}=this['getInteractionAndReplyById'](_0x1968e2['replyId']),_0x6f4faf=this['_getDocumentRangeForReplyChanges'](_0x1968e2['replyId'],_0x1968e2['partIndex']),_0x1559fb=void 0x0!==_0x1968e2['partIndex']?[_0x418ff7['changeGroups'][_0x1968e2['partIndex']]]:_0x418ff7['changeGroups']['filter'](_0x83c1f4=>'pending'==_0x83c1f4['state']),_0x4c2892=_0x1559fb['map'](_0x27768=>_0x418ff7['changeGroups']['indexOf'](_0x27768));if(!_0x6f4faf||'$graveyard'==_0x6f4faf['range']['root']['rootName'])return void _0x4c2892['forEach'](_0x5c6a0f=>_0x418ff7['setChangeGroupState'](_0x5c6a0f,'outdated'));_0x4c2892['forEach'](_0x46b25a=>_0x418ff7['setChangeGroupState'](_0x46b25a,'accepted'));const _0x9d918=W({'editor':_0x3ca022,'reply':_0x418ff7,'interaction':_0x173126,'groups':_0x1559fb,'transform':!0x0,'documentCompare':_0x15d228,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x93bfbf;_0x6f4faf&&this['_scrollToSuggestionRange'](_0x6f4faf['range']),_0x3ca022['model']['change'](_0x5b8570=>{_0x93bfbf=_0x5b8570['batch'];for(const _0x580a11 of _0x9d918)_0x580a11['baseVersion']=_0x3ca022['model']['document']['version'],V(_0x3ca022,_0x580a11),_0x5b8570['batch']['addOperation'](_0x580a11),_0x3ca022['model']['applyOperation'](_0x580a11);}),this['_batchToChanges']['set'](_0x93bfbf,{'interactionId':_0x173126['id'],'replyId':_0x418ff7['id'],'indexes':_0x4c2892['slice']()}),this['_updateRatings'](_0x418ff7);}['_rejectSuggestion'](_0x1bf602){const {reply:_0xd89a9}=this['getInteractionAndReplyById'](_0x1bf602['replyId']);_0xd89a9['setChangeGroupState'](_0x1bf602['partIndex'],'rejected');}['_openBalloonFor'](_0x59e500,_0xb02ae3){if(!this['_aiChatBalloon'])return;const {reply:_0x206eeb}=this['getInteractionAndReplyById'](_0x59e500),_0x273c08=_0x206eeb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x6c57df,_0x357766;if(void 0x0!==_0xb02ae3?(_0x357766=_0x273c08['find'](_0x5aed94=>_0x5aed94['index']==_0xb02ae3),_0x6c57df=_0x357766?.['index']):(_0x357766=_0x273c08[0x0],_0x6c57df=_0x357766['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x59e500&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x6c57df)return;const _0x330bc0=this['_getUserPresentableContentPartDocumentRange'](_0x59e500,_0x206eeb,_0x357766);if(!_0x330bc0)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x59e500,'partIndex':_0x6c57df},this['_scrollToSuggestionRange'](_0x330bc0,!0x0);const _0x5222d0=this['_getPresentableSiblingContentPartIndex'](_0x59e500,_0x6c57df,'next');this['_aiChatBalloon']['updateContent']({'part':_0x357766,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x6c57df,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x6c57df+0x1)['toString']()),'showRotator':null!==_0x5222d0,'ranges':[_0x330bc0],'areActionsDisabled':_0x206eeb['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x59e500,_0x6c57df),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x59e500,'index':_0x6c57df,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x194c40,_0x5d2b21,_0xd45955){const {reply:_0x22626e}=this['getInteractionAndReplyById'](_0x194c40),_0x25c2ce=_0x22626e['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x25c2ce['length'])return null;const _0x7dac45=_0x25c2ce['findIndex'](_0x461127=>_0x461127['index']==_0x5d2b21),_0x14b653='next'==_0xd45955?0x1:-0x1;let _0x4897fa=_0x25c2ce['at']((_0x7dac45+_0x14b653)%_0x25c2ce['length'])['index'],_0x544bd1=_0x25c2ce[_0x4897fa];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x194c40,_0x22626e,_0x544bd1);){if(_0x4897fa=_0x25c2ce['at']((_0x4897fa+_0x14b653)%_0x25c2ce['length'])['index'],_0x4897fa===_0x7dac45)return null;_0x544bd1=_0x25c2ce[_0x4897fa];}return _0x4897fa;}['_getUserPresentableContentPartDocumentRange'](_0x3a369f,_0x133d3b,_0x1a572a){const _0x3e6a4b=_0x133d3b['changeGroups'];if(!_0x1a572a['hasChanges'])return null;const _0x4e6c61=_0x3e6a4b['find'](_0x1fa1c7=>_0x1fa1c7['index']==_0x1a572a['index']);if('pending'!==_0x4e6c61?.['state'])return null;const _0x4c4644=this['_getDocumentRangeForReplyChanges'](_0x3a369f,_0x1a572a['index']);if(!_0x4c4644)return null;const {range:_0x5e2e10,currentIndex:_0x144a36}=_0x4c4644;return'$graveyard'==_0x5e2e10['root']['rootName']?(_0x133d3b['setChangeGroupState'](_0x144a36,'outdated'),null):_0x4c4644['range'];}['_getDocumentRangeForReplyChanges'](_0x35abf,_0x55f50c){const _0x1fa032=lt(this['context']),{reply:_0x2eb492,interaction:_0xfc2f61}=this['getInteractionAndReplyById'](_0x35abf),_0x4e85fa=_0x2eb492['changeGroups']['filter'](_0x4f6232=>'pending'==_0x4f6232['state']),_0x2919e4=_0x4e85fa['map'](_0x462482=>_0x2eb492['changeGroups']['indexOf'](_0x462482));void 0x0===_0x55f50c&&(_0x55f50c=_0x2919e4[0x0]);const _0x37f0c3=_0x2919e4['indexOf'](_0x55f50c);if(-0x1==_0x37f0c3)return null;const _0xbee429=_0x4e85fa[_0x37f0c3],_0x1fb1b0=new ft([]),_0x21337f=new ft([]);for(const _0x23b51d of _0xbee429['changes'])if('removed'!=_0x23b51d['type']&&_0x21337f['children']['push'](_0x23b51d['node']['cloneNode'](!0x0)),'new'!=_0x23b51d['type']){const _0x4548ca=_t(_0x4aef31=>Ct(_0x4aef31,'data-id')==_0x23b51d['id'],_0x2eb492['documentContextContent'],!0x0);_0x1fb1b0['children']['push'](_0x4548ca['cloneNode'](!0x0));}if(0x0==_0x1fb1b0['children']['length']){if(_0xbee429['changes'][0x0]['anchorId']){const _0x37c065=Tt('data-id',_0xbee429['changes'][0x0]['anchorId'],_0x2eb492['documentContextContent']);_0x1fb1b0['children']['unshift'](_0x37c065['cloneNode'](!0x0)),_0x21337f['children']['unshift'](_0x37c065['cloneNode'](!0x0)),_0x37c065['nextSibling']&&(_0x1fb1b0['children']['push'](_0x37c065['nextSibling']['cloneNode'](!0x0)),_0x21337f['children']['push'](_0x37c065['nextSibling']['cloneNode'](!0x0)));}else{const _0x293d93=_0x2eb492['documentContextContent']['children'][0x0];if(!_0x293d93)return null;_0x1fb1b0['children']['push'](_0x293d93['cloneNode'](!0x0)),_0x21337f['children']['push'](_0x293d93['cloneNode'](!0x0));}}const _0xd778ec=_0xfc2f61['getDocumentContext'](),_0x1b9c4d=_0x1fa032['data']['parse'](_0xd778ec['content']),_0x37aa63=It(_0x1fb1b0),_0x116c38=_0x1fa032['data']['parse'](_0x37aa63),_0x2bf916=_0x1fa032['data']['parse'](_0x37aa63),_0x2f3f01=_0x1fa032['model']['createPositionAt'](_0x116c38,0x0),_0x56288b=It(_0x21337f),_0xd01a01={'anchor':_0x2f3f01,'markDeletions':!0x1},_0x15d7e4=_0x1fa032['plugins']['get'](_0xac1d67)['getDiff'](_0x37aa63,_0x56288b,_0xd01a01)['getOperations']();if(!_0x15d7e4['length'])return null;_0x1fa032['model']['change'](_0x50c21f=>{for(const _0x171cd3 of _0x15d7e4)if('remove'==_0x171cd3['type']){const _0x178fa8=_0x171cd3['sourcePosition'],_0x15e908=_0x171cd3['howMany'],_0x42de1e=new _0x515526(_0x178fa8,_0x15e908);_0x50c21f['batch']['addOperation'](_0x42de1e),_0x1fa032['model']['applyOperation'](_0x42de1e);}else'marker'!==_0x171cd3['type']&&(_0x171cd3['baseVersion']=null,_0x171cd3['isDocumentOperation']=!0x1,_0x50c21f['batch']['addOperation'](_0x171cd3),_0x1fa032['model']['applyOperation'](_0x171cd3));});const _0x3101db=pt(_0x1fa032,_0x15d7e4,_0x116c38);ut(_0x1fa032['model'],_0x3101db);const _0x5e4d0c=_0x3101db['getFirstRange']()['start']['path']['slice'](),_0x5004b0=_0x3101db['getFirstRange']()['end']['path']['slice'](),_0x1e5aae=[];let _0x917a11=_0x116c38,_0x50e6e1=_0x2bf916;for(let _0x3b884a=0x0;_0x3b884a<_0x5004b0['length'];_0x3b884a++){const _0x552bb1=_0x917a11['maxOffset']-_0x5004b0[_0x3b884a];_0x1e5aae[_0x3b884a]=_0x50e6e1['maxOffset']-_0x552bb1,_0x917a11=_0x917a11['getChildAtOffset'](_0x5004b0[_0x3b884a]),_0x50e6e1=_0x50e6e1['getChildAtOffset'](_0x1e5aae[_0x3b884a]);}const _0x54f980=_0x1fa032['model']['createRange'](_0x1fa032['model']['createPositionFromPath'](_0x2bf916,_0x5e4d0c),_0x1fa032['model']['createPositionFromPath'](_0x2bf916,_0x1e5aae)),_0x1ca27f=_0x2bf916['getChild'](0x0)['getAttribute'](gt),_0x548ad3=Array['from'](_0x1b9c4d['getChildren']())['find'](_0x295a41=>_0x295a41['getAttribute'](gt)==_0x1ca27f)['getPath'](),_0x23efa9=_0x54f980['start']['path']['slice'](),_0x50390f=_0x54f980['end']['path']['slice']();_0x23efa9[0x0]=_0x548ad3[0x0]+_0x23efa9[0x0],_0x50390f[0x0]=_0x548ad3[0x0]+_0x50390f[0x0];let _0x270e28=_0x1fa032['model']['createRange'](_0x1fa032['model']['createPositionFromPath'](_0x1fa032['model']['document']['getRoot'](),_0x23efa9),_0x1fa032['model']['createPositionFromPath'](_0x1fa032['model']['document']['getRoot'](),_0x50390f));const _0x350e6b=_0x1fa032['model']['document']['history']['getOperations'](_0xd778ec['version']);for(const _0x351ed7 of _0x350e6b)_0x270e28=_0x21f9f5['_createFromRanges'](_0x270e28['getTransformedByOperation'](_0x351ed7));return{'range':_0x270e28,'currentIndex':_0x55f50c};}['_integrateEditor'](_0x424331){if(!_0x424331['plugins']['has']('Undo'))return;const _0x904e2f=_0x424331['commands']['get']('undo'),_0x199730=_0x424331['commands']['get']('redo');this['listenTo'](_0x904e2f,'revert',(_0x404400,_0x3b5a4b,_0x150609)=>{const _0x52bf6b=this['_batchToChanges']['get'](_0x3b5a4b);if(!_0x52bf6b)return;const _0xead6ab=this['activeConversation']['getInteraction'](_0x52bf6b['interactionId'])['getReply'](_0x52bf6b['replyId']);_0x52bf6b['indexes']['forEach'](_0x401f9d=>_0xead6ab['setChangeGroupState'](_0x401f9d,'pending')),this['_batchToChanges']['delete'](_0x3b5a4b),this['_batchToChanges']['set'](_0x150609,_0x52bf6b);}),this['listenTo'](_0x199730,'revert',(_0x248fe8,_0x1702c1,_0x3ca31e)=>{const _0xaabc97=this['_batchToChanges']['get'](_0x1702c1);if(!_0xaabc97)return;const _0x3b8a83=this['activeConversation']['getInteraction'](_0xaabc97['interactionId'])['getReply'](_0xaabc97['replyId']);_0xaabc97['indexes']['forEach'](_0x619da3=>_0x3b8a83['setChangeGroupState'](_0x619da3,'accepted')),this['_batchToChanges']['delete'](_0x1702c1),this['_batchToChanges']['set'](_0x3ca31e,_0xaabc97);});}async['loadConversation'](_0x5bf414){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](ht)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x5bf414)['getConversation'](),await this['_startConversationSafely'](_0x5bf414),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x5bf414,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x40df5b){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x5bf414}),this['_logError'](new _0x32ab89('ai-chat-conversation-not-found',this,{'error':_0x40df5b}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0x383095=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1391af=await _0x383095['getConversations']();return _0x1391af['length']?_0x1391af[0x0]['id']:'new';}catch(_0x4c50cc){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0xdeade1()}),this['_logError'](new _0x32ab89('ai-chat-conversation-init-failed',this,{'error':_0x4c50cc})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x13ce02){this['activeConversation']['id']===_0x13ce02&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x35f24e=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x35f24e),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x79ac45,attributes:_0x15f734}){await this['_handleUIUserMessage']({'userMessage':_0x79ac45,'attributes':_0x15f734});}['getGroupId'](){const _0x23e36b=this['context']['config']['get']('collaboration.channelId');if(!_0x23e36b)throw new _0x32ab89('ai-chat-missing-channel-id',this);return _0x23e36b;}async['_startConversationSafely'](_0x1c7192){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1c7192);}catch(_0x349cbb){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1c7192||_0xdeade1()}),console['error'](_0x349cbb),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x598f74){let _0xd1c513;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x598f74||!this['activeConversation']?_0xd1c513=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xd1c513=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x1d6b7f=this['getGroupId'](),_0x232e0e=_0x598f74||_0xdeade1();this['activeConversation']=new ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xd1c513,'conversationId':_0x232e0e,'group':_0x1d6b7f,'getEditor':()=>lt(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x5ee56c,_0x3ff062)=>{this['_aiChatUi']['createConversation'](_0x3ff062),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x598f74||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x336579,_0xf320fe)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xf320fe['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4374e5,_0x2c8d81)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2c8d81);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x266a3d=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x266a3d);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x202e1b=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x202e1b);}),this['activeConversation']['on']('webSearchFinished',(_0x593d89,_0x4c0da6)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x4c0da6,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x18d310,_0x858990)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x858990,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['delegate']('toolDataReceived')['to'](this),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x383aca,_0x41a0b5)=>{this['_aiChatUi']['removeFeedInteraction'](_0x41a0b5['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3db052,_0x34f98c,_0x2b48e1)=>{this['updateConversationTitle'](_0x34f98c,_0x2b48e1);}),this['activeConversation']['on']('replyCreated',(_0x171339,_0x2b2f65)=>{'text'===_0x2b2f65['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2b2f65):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2b2f65);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1ac8c0,_0x38463c)=>{await this['_updateReplyContent']({'reply':_0x38463c});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3b5544,{reply:_0x5d29b9,index:_0x5e26cc,state:_0x12efe0})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x5d29b9['id'],'index':_0x5e26cc,'state':_0x12efe0}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x5d29b9['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5e26cc&&this['_aiChatBalloon']?.['setState'](_0x12efe0);}),this['activeConversation']['on']('contextItemAdded',(_0x502b66,_0x15d0d3)=>{if(this['_aiChatUi']['addContextItem'](_0x15d0d3['contextItem'],_0x15d0d3['isLoading']),'selection'===_0x15d0d3['contextItem']['type']){const _0x551302=[...lt(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x551302,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x1712b9,_0xed5bf1)=>{this['_aiChatUi']['removeContextItem'](_0xed5bf1['uiId']),'current-document'==_0xed5bf1['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xed5bf1['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x56f602,_0x1d61cb)=>{this['_aiChatUi']['setContextItemLoading'](_0x1d61cb['contextItem']['uiId'],_0x1d61cb['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x165971,_0x2e87cd)=>{this['_aiChatUi']['setConversationContext'](_0x2e87cd['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x24e402,_0x1113bb)=>{this['_aiChatUi']['setAddContextOptions'](_0x1113bb['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x106ab0,_0x4fc9a6)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x4fc9a6['sourceId'],_0x4fc9a6['source'],_0x4fc9a6['resources'],_0x4fc9a6['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x2c2ef,_0x28df1b)=>{this['_aiChatUi']['updateResourceState'](_0x28df1b['sourceId'],_0x28df1b['resourceId'],_0x28df1b['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xca4817,_0x509f43)=>{this['_aiChatUi']['updateCapabilities'](_0x509f43);}),this['activeConversation']['on']('modelSelected',async(_0x1697aa,_0x1c21de)=>{const _0x4aa64b=(await this['_aiChatModels']['getAll']())['find'](_0x41d6f4=>_0x41d6f4['id']===_0x1c21de['selectedModel']['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x4aa64b,_0x1c21de['isDisabled']);}),this['activeConversation']['on']('error',(_0xeb012e,{error:_0x237c7d,interactionId:_0x35d313,fileName:_0xedc617,url:_0x5af6e1,sourceId:_0x5d3ab7,sourceLabel:_0x11c4b4})=>{const _0x5645b7=_0x35d313?_0x35d313+':'+_0xdeade1():_0xdeade1();_0x237c7d['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x5645b7}):_0x237c7d['message']['startsWith']('ai-chat-conversation-init-failed')||_0x237c7d['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0xedc617),'id':_0x5645b7}):_0x237c7d['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x5af6e1),'id':_0x5645b7}):_0x237c7d['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x5645b7}):_0x237c7d['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x5645b7}):_0x237c7d['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5d3ab7&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5d3ab7),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x11c4b4||'source'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):_0x237c7d['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x5645b7}),this['_logError'](_0x237c7d)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x5645b7}),this['_logError'](_0x237c7d));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x598f74||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x5c6f73,attributes:_0x4dad04}){if(!this['activeConversation'])throw new _0x32ab89('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x58281f=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x58281f);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5c6f73,'attributes':_0x4dad04});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x37b2ae){this['_aiChatUi']['setIsMaximized'](_0x37b2ae);}['_logError'](_0x1e5480){rt(_0x1e5480['message']);}['_removeFromContext'](_0x16290e){this['activeConversation']?.['removeFromContext'](_0x16290e);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x29c9e6){const [_0x2e8034,_0x4388c8]=_0x29c9e6['split'](':'),_0x28a7e9=this['activeConversation']['getInteraction'](_0x2e8034),_0xb7fb57=_0x28a7e9['getReply'](_0x4388c8);return{'interaction':_0x28a7e9,'reply':_0xb7fb57};}['_scrollToSuggestionRange'](_0x33b731,_0x458975=!0x1){const _0x3ee925=lt(this['context']),_0x36aa83={'target':_0x3ee925['editing']['view']['domConverter']['viewRangeToDom'](_0x3ee925['editing']['mapper']['toViewRange'](_0x33b731)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x458975};_0x458975&&(_0x36aa83['alignToTop']=!0x0),at(_0x36aa83);}['updateConversationTitle'](_0x6d83a2,_0x2e2266=!0x1){this['_aiChatUi']['setConversationTitle'](_0x6d83a2||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2e2266);}async['_updateReplyContent']({reply:_0x115f73,renderingStrategy:_0xed5c8e}){const {id:_0x179adc,interactionId:_0x18e163,isDone:_0x5f2f04,type:_0x2c6c8c,parsedContent:_0x98f79}=_0x115f73,_0x4f40f7=_0x18e163+':'+_0x179adc;if('modification'===_0x2c6c8c){const _0x43addd=_0x115f73['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4f40f7,'parts':_0x43addd,'renderingStrategy':_0xed5c8e,'isDone':_0x5f2f04});}else'text'===_0x2c6c8c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x4f40f7,'parsedContent':_0x98f79,'renderingStrategy':_0xed5c8e,'isDone':_0x5f2f04});_0x5f2f04&&_0x115f73['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x4f40f7,_0x115f73['sources']);}async['_stopLastInteraction'](){const _0x989f19=this['activeConversation']?.['lastInteraction'];_0x989f19&&(_0x989f19['stop'](),this['_aiChatUi']['stopInteraction'](_0x989f19));}async['_flushLastInteractionUI'](){const _0x1da4ea=this['activeConversation']?.['lastInteraction'];if(_0x1da4ea){for await(const _0x4cc7a2 of _0x1da4ea['replies'])await this['_updateReplyContent']({'reply':_0x4cc7a2,'renderingStrategy':'static'});}}['_updateRatings'](_0x529671){const _0x13453c={'positiveCount':_0x529671['changeGroups']['filter'](_0x55f5a9=>'accepted'===_0x55f5a9['state'])['length'],'totalCount':_0x529671['changeGroups']['length'],'modificationId':_0x529671['id']},_0x204f38=this['activeConversation']['getInteraction'](_0x529671['interactionId'])['messageId'];_0x204f38&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x204f38,_0x13453c);}['_registerToolDataCallback'](_0x2bb3a9){let _0x99687e=null,_0x1f3b33=null;this['on']('toolDataReceived',(_0x38d395,_0xa70974,_0x163e2b)=>{_0x163e2b['id']!==_0x99687e&&(_0x99687e=_0x163e2b['id'],_0x1f3b33=this['_getAIChatInteractionAPI'](_0x163e2b)),_0x2bb3a9(_0xa70974,_0x1f3b33);});}['_getAIChatInteractionAPI'](_0x23746d){const _0x44bab2=this['_aiChatUi'],_0x4786b1=()=>{_0x23746d['resetWebSearchState'](),_0x23746d['resetReasoningState'](),_0x44bab2['clearLoadingMessage']();},_0x1b657b=()=>{_0x23746d['currentReply']&&(_0x23746d['currentReply']['done'](),_0x23746d['currentReply']=void 0x0);};return{'insertTextReply':(_0x1f6c85,_0x1eb2c4)=>{_0x1b657b(),_0x4786b1();const _0x3f9554=_0x23746d['currentReply']=_0x23746d['createReply']({'type':'text','interactionId':_0x23746d['id'],'content':_0x1f6c85,'id':_0x1eb2c4||_0xdeade1()});return _0x1b657b(),_0x3f9554;},'insertCustomElement':async(_0x1fe3e8,_0x1783c0)=>(_0x1b657b(),_0x4786b1(),_0x44bab2['addFeedItemCustomElement'](_0x1fe3e8,_0x1783c0||_0xdeade1())),'setLoadingMessage':_0x3306ac=>{_0x44bab2['setLoadingMessage'](_0x3306ac);},'clearLoadingMessage':()=>{_0x44bab2['clearLoadingMessage']();}};}}const F='ai-selection';class D extends _0x47e329{constructor(_0x49040f){super(_0x49040f),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x3e73bb=lt(this['context']),_0x29803e=_0x3e73bb['plugins']['has']('RealTimeCollaborationClient')&&_0x3e73bb['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x29803e||_0xdeade1();}return this['_sessionId'];}async['getDocumentData'](){const _0x152c64=lt(this['context']),_0x3f6b20=_0x152c64['model'],_0x59f863=_0x152c64['data']['toView'](_0x3f6b20['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x4e00dc=new Dt(_0x152c64['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x59f863,_0x4e00dc);let _0xa12f8f=await this['_getDocumentDataStringFromView'](_0x59f863);const _0x281a7c=this['_getMarkersInDocumentOrder'](),_0x1b99e7=[];for(const _0xd54817 of _0x281a7c){const _0x3f7bbb='<'+_0xd54817['name']+':start></'+_0xd54817['name']+':start>',_0x30c000=_0xa12f8f['indexOf'](_0x3f7bbb);_0xa12f8f=_0xa12f8f['substring'](0x0,_0x30c000)+_0xa12f8f['substring'](_0x30c000+_0x3f7bbb['length']);const _0x652fe3='<'+_0xd54817['name']+':end></'+_0xd54817['name']+':end>',_0x26d1ed=_0xa12f8f['indexOf'](_0x652fe3);_0xa12f8f=_0xa12f8f['substring'](0x0,_0x26d1ed)+_0xa12f8f['substring'](_0x26d1ed+_0x652fe3['length']),_0x1b99e7['push']({'markerName':_0xd54817['name'],'start':_0x30c000,'end':_0x26d1ed,'htmlFragment':_0xa12f8f['substring'](_0x30c000,_0x26d1ed)});}return{'content':_0xa12f8f,'version':_0x152c64['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1b99e7};}async['afterInit'](){this['context']instanceof nt?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4f13f4,_0x4b2e35)=>{_0x4b2e35['on']('ready',()=>{this['_integrateEditor'](_0x4b2e35);});});}['_setOutputDataProcessor'](_0x2c50e5){this['_outputDataProcessor']=_0x2c50e5;}async['_getDocumentDataStringFromView'](_0x1b2def){let _0x1769f1;const _0x21b520=lt(this['context']);if(this['_outputDataProcessor']){const _0x4a30cf=_0x21b520['data']['processor']['domConverter']['viewToDom'](_0x1b2def),_0x5543ef=await this['_outputDataProcessor'](_0x4a30cf);_0x1769f1=_0x21b520['data']['processor']['htmlWriter']['getHtml'](_0x5543ef);}else _0x1769f1=_0x21b520['data']['processor']['toData'](_0x1b2def);return _0x1769f1;}['_integrateEditor'](_0x23d912){_0x23d912['conversion']['for']('editingDowncast')['markerToHighlight']({'model':F,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x23d912['conversion']['for']('dataDowncast')['markerToElement']({'model':F,'view':(_0x1b0e3c,{writer:_0x284779,options:_0x5bbbe1})=>_0x5bbbe1['convertAiChatSelectionMarker']?_0x284779['createUIElement'](_0x1b0e3c['markerName']+':'+(_0x1b0e3c['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0xb70162,_0x239bc3,_0x2fc91a=!0x1,_0x1b4e47=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x1b4e47)return!0x1;const _0x1e7189=lt(this['context'])['model'];return _0x1e7189['change'](_0x2be776=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x239bc3,this['_displayedFakeSelectionLocked']=_0x2fc91a;let _0x311962=0x0;for(let _0x51394a of _0xb70162){const _0x20e4bf=F+':'+_0x311962;if(_0x51394a['start']['isAtEnd']){const _0x209695=_0x51394a['start']['getLastMatchingPosition'](({item:_0x20a9f3})=>!_0x1e7189['schema']['isContent'](_0x20a9f3),{'boundaries':_0x51394a});_0x51394a=_0x2be776['createRange'](_0x209695,_0x51394a['end']);}_0x2be776['addMarker'](_0x20e4bf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x51394a}),_0x311962++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x16254e){if(this['_displayedFakeSelectionId']!=_0x16254e)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x2b8e5e=lt(this['context']),_0x4251d7=_0x2b8e5e['model']['markers']['getMarkersGroup'](F);return _0x2b8e5e['model']['change'](_0x4dcfa6=>{for(const _0x4e1385 of _0x4251d7)_0x4dcfa6['removeMarker'](_0x4e1385);}),!0x0;}async['modelToDataWithIds'](_0x3e5896){const _0x5e0733=lt(this['context']),_0x101fa1=_0x5e0733['data']['toView'](_0x3e5896),_0x3136e4=new Dt(_0x5e0733['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x101fa1,_0x3136e4),this['_getDocumentDataStringFromView'](_0x101fa1);}['_setDataIdsOnChildren'](_0x440fa7,_0x124d89){let _0x3b394f=!0x1;const _0x350812=new Set();for(const _0x49a649 of _0x440fa7['getChildren']()){const _0x277c3b=_0x49a649['is']('emptyElement')||_0x49a649['is']('containerElement');if(!_0x49a649['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x49a649,_0x124d89)||_0x277c3b)&&(_0x124d89['setAttribute']('data-id',this['_nextDataId'](_0x350812),_0x49a649),_0x3b394f=!0x0);}return _0x3b394f;}['_nextDataId'](_0x59282c){let _0x2bf3ba;do{_0x2bf3ba='';for(let _0x4f5b7d=0x0;_0x4f5b7d<0x4;_0x4f5b7d++)_0x2bf3ba+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x59282c['has'](_0x2bf3ba));return _0x59282c['add'](_0x2bf3ba),_0x2bf3ba;}['getSelectionText'](){const {model:_0x29648f}=lt(this['context']),_0x3cdf89=_0x29648f['document']['selection'],_0x4c2f75=_0x29648f['getSelectedContent'](_0x3cdf89),_0x5ab883=[],_0x2dcb72=_0x29648f['createRangeIn'](_0x4c2f75)['getWalker']();for(const {item:_0x3d7869}of _0x2dcb72)_0x3d7869['is']('$textProxy')?_0x5ab883['push'](_0x3d7869['data']):_0x3d7869['is']('element')&&_0x5ab883['length']>0x0&&'\x20'!==_0x5ab883[_0x5ab883['length']-0x1]&&_0x5ab883['push']('\x20');return'\x22'+_0x5ab883['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x8fd3fa=lt(this['context'])['model'];return Array['from'](_0x8fd3fa['markers']['getMarkersGroup'](F))['sort']((_0x5953e7,_0x1a07d4)=>_0x5953e7['getStart']()['isBefore'](_0x1a07d4['getStart']())?-0x1:_0x5953e7['getStart']()['isAfter'](_0x1a07d4['getStart']())?0x1:0x0);}}const ot=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...ot,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x195259){this['options']={'delay':_0x195259['delay']??0x14,'textNodeStyle':_0x195259['textNodeStyle'],'onStreamUpdate':_0x195259['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x375722,targetElement:_0x4a0f70,abortSignal:_0x2cc841}){this['isStreaming']&&this['stop'](),_0x2cc841?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x296ed0(_0x375722,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3f5b80=0x0;_0x3f5b80<this['currentIndex'];_0x3f5b80++)this['nodesList'][_0x3f5b80]['shouldBeStreamed']=!0x0;do{const _0x311a4b=Date['now'](),_0x27ad87=this['nodesList'][this['currentIndex']],_0x244824=_0x311a4b-this['lastUpdateTime'];if(_0x27ad87){_0x27ad87['shouldBeStreamed']=!0x0;let _0xcd2317=_0x27ad87['parent'];for(;_0xcd2317;)_0xcd2317['shouldBeStreamed']=!0x0,_0xcd2317=_0xcd2317['parent'];}if(_0x244824<this['options']['delay'])try{const {promise:_0x653992,abortController:_0x5e97f7}=Cs(this['options']['delay']-_0x244824);this['timeoutAbortController']=_0x5e97f7,await _0x653992;}catch(_0x73b684){return;}_0x3e6a65(_0x4a0f70,'<'+_0x4a0f70['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4a0f70['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x135bb8}){Array['from'](_0x135bb8['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x17f4b1=>{_0x17f4b1['replaceWith'](_0x17f4b1['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x14a1c4){let _0x531f9c='';if(function(_0x3da079){return _0x5e6b17(_0x3da079);}(_0x14a1c4)){for(const _0x4114f7 of _0x14a1c4['children'])_0x531f9c+=this['renderNode'](_0x4114f7);}else{if(Ts(_0x14a1c4)){if(!_0x14a1c4['shouldBeStreamed'])return'';const _0x25865d=_0x14a1c4,_0x32cfec=Object['entries'](_0x25865d['attribs'])['map'](([_0x3d64ff,_0x1837ad])=>_0x3d64ff+'=\x22'+_0x1837ad+'\x22')['join']('\x20');_0x531f9c+='<'+_0x25865d['tagName']+(_0x32cfec?'\x20'+_0x32cfec:'')+'>';for(const _0x454b49 of _0x11ae0d(_0x25865d))_0x531f9c+=this['renderNode'](_0x454b49);_0x531f9c+='</'+_0x25865d['tagName']+'>';}else{if(!Ss(_0x14a1c4))return'';if(!_0x14a1c4['shouldBeStreamed'])return'';!function(_0x474552){if(!_0x474552['parent']||!Ts(_0x474552['parent']))return!0x1;if(!ys['includes'](_0x474552['parent']['tagName']))return!0x1;return!_0x2c1e68(_0x474552)['match'](/^\s*[<>]\s*$/);}(_0x14a1c4)?_0x531f9c+=_0x4dfa58(_0x14a1c4):_0x531f9c+=_0x4dfa58(new _0x555852('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x14a1c4]));}}return _0x531f9c;}['getParsedDocumentNodeList'](){const _0x2e24e4=[];return function(_0x633b17,_0x4f0592){const _0x106072=_0x599c75=>{if(_0x4f0592(_0x599c75),_0x599c75 instanceof _0x3b9f39)for(let _0x4f9a2d=0x0;_0x4f9a2d<_0x599c75['children']['length'];_0x4f9a2d++){const _0x1e99b7=_0x599c75['children'][_0x4f9a2d];_0x106072(_0x1e99b7);}};for(let _0x5dd635=0x0;_0x5dd635<_0x633b17['children']['length'];_0x5dd635++)_0x106072(_0x633b17['children'][_0x5dd635]);}(this['document'],_0x58a37e=>{if(Ss(_0x58a37e)){const _0x4e35e0=this['splitTextNodeIntoWordNodes'](_0x58a37e);_0x4e35e0['length']&&_0x2e24e4['push'](..._0x4e35e0);}_0x58a37e['isWordSplitSource']||_0x58a37e['isWordSplitResult']||_0x2e24e4['push'](_0x58a37e);}),_0x2e24e4;}['splitTextNodeIntoWordNodes'](_0x47eb17){if(_0x47eb17['isWordSplitSource']||_0x47eb17['isWordSplitResult'])return[];const _0x389fd6=_0x2c1e68(_0x47eb17)['match'](/(?:\s*\S+\s*)/g),_0x1e956b=[];if(_0x389fd6&&_0x389fd6['length']>0x1){for(const _0x582109 of _0x389fd6){const _0x41e756=new _0x28d976(_0x582109);_0x41e756['isWordSplitResult']=!0x0,_0x1e41ac(_0x47eb17,_0x41e756),_0x1e956b['push'](_0x41e756);}_0x47eb17['isWordSplitSource']=!0x0,_0x5e22d6(_0x47eb17);}return _0x1e956b;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x514597){return _0x38814e(_0x514597);}function Ts(_0x497031){return _0x3497c5(_0x497031);}function Cs(_0x5bb160){const _0x3d95d8=new AbortController();return{'promise':new Promise((_0x3be9e1,_0x3fcfcf)=>{const _0x3d0342=setTimeout(_0x3be9e1,_0x5bb160);_0x3d95d8['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3d0342),_0x3fcfcf();});}),'abortController':_0x3d95d8};}class Fr extends _0x2d8061{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x50f666){super();const _0x5672fb=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x50f666,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5672fb['if']('isDone','ck-ai-chat__feed__item_done'),_0x5672fb['if']('isVisible','ck-hidden',_0x182a56=>!_0x182a56),'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'](_0xfb5c=>{_0xfb5c['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2fd844,_0x4599df,_0x69cd7d){await this['htmlStreamer']['stream']({'document':_0x2fd844,'targetElement':_0x4599df,'abortSignal':_0x69cd7d});}}class gh extends _0x2d8061{['showChangesToggleView'];constructor(_0x19f562,_0x19e0b4){super(_0x19f562),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new zn(_0x19f562),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x19f562,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x19e0b4['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x9ed268=>_0x9ed268?_0x386d26:_0x5a10c1),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x23604d=new _0x4dad4f();_0x23604d['content']=_0x3b7e7d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x19e0b4['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x23604d,{'tag':'span','children':[i(_0x19f562,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class zn extends _0x3c2d24{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const Jn={'accepted':_0x35010c,'rejected':_0xb7ebb,'outdated':_0xb7ebb};class ps extends _0x2d8061{['stateIconView'];constructor(_0x2da895){super(_0x2da895);const _0x26825b=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new Zn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x26825b['to']('state',_0x199d41=>'ck-ai-suggestion__content-part-state_'+_0x199d41),_0x26825b['if']('isVisible','ck-hidden',_0x2095cf=>!_0x2095cf)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x26825b['to']('state',_0x8a48d0=>{switch(_0x8a48d0){case'accepted':return i(_0x2da895,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x2da895,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x2da895,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x393568){this['state']=_0x393568;}}class Zn extends _0x4dad4f{constructor(){super(),this['set']('state','accepted'),this['content']=Jn[this['state']],this['on']('change:state',()=>{this['content']=Jn[this['state']];});}}class cs extends _0x2cc502{['_applyButton'];['_suggestButton'];constructor(_0x2ffcc2,_0x1fb56c,_0x40bec5){super(_0x2ffcc2);const _0x356738=Boolean(_0x40bec5);this['set']('isEnabled',!_0x356738),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x197d0c=[];if(_0x356738){const _0x3c022a=new _0x3c2d24(_0x2ffcc2);_0x3c022a['set']({'label':i(_0x2ffcc2,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4a3016}),_0x197d0c['push'](_0x3c022a);}else{_0x1fb56c['includes']('applySuggestion')&&(this['_applyButton']=new _0x3c2d24(_0x2ffcc2),this['_applyButton']['set']({'label':i(_0x2ffcc2,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x35010c}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x197d0c['push'](this['_applyButton'])),_0x1fb56c['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x3c2d24(_0x2ffcc2),this['_suggestButton']['set']({'label':i(_0x2ffcc2,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3632ea}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x197d0c['push'](this['_suggestButton']));const _0x5229cf=new _0x3c2d24(_0x2ffcc2);_0x5229cf['set']({'label':i(_0x2ffcc2,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xb7ebb}),_0x5229cf['bind']('isEnabled')['to'](this),_0x5229cf['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x197d0c['push'](_0x5229cf);}this['items']['addMany'](_0x197d0c);const _0x10bf1e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x10bf1e['if']('isVisible','ck-hidden',_0x138b10=>!_0x138b10)]}});}['setButtonsVisibility']({showApplyButton:_0xc5d0f8,showSuggestButton:_0xaca08b}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0xc5d0f8),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0xaca08b);}}class Vn extends _0x2d8061{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x35048e,{part:_0x1973e0,uiIndex:_0x43c191,availableActions:_0x42c1e8,areActionsDisabled:_0xc90d33}){super(_0x35048e),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new cs(_0x35048e,_0x42c1e8,_0xc90d33),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1973e0['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1973e0['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1973e0['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x35048e),this['titleLabelView']=new jn(_0x35048e,_0x43c191),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x1d1a94,_0x4e1146,_0x3ba77c,_0x295718)=>{'pending'===_0x295718?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x3ba77c?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x3ba77c),this['children']['add'](this['stateView']));});}}class jn extends _0x2d8061{constructor(_0x2b2a3c,_0x175548){super(_0x2b2a3c),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0x2b2a3c,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x175548['toString']())]});}}class as extends _0x2d8061{['htmlStreamer'];constructor(_0x40e722){super(_0x40e722),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x1afd75,renderingStrategy:_0x5a0f85,abortSignal:_0x1a66b3}){'streaming'===_0x5a0f85?await this['htmlStreamer']['stream']({'document':_0x1afd75['content'],'targetElement':this['element'],'abortSignal':_0x1a66b3}):this['element']['innerHTML']=It(_0x1afd75['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x2d8061{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x2f2170,{part:_0x3d0d63,uiIndex:_0x278e58,areActionsDisabled:_0x572560,availableActions:_0x2c6e73}){super(_0x2f2170);const _0x49ed26=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x1ebe48=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x572560;};this['on']('change:state',_0x1ebe48),this['on']('change:isDone',_0x1ebe48),_0x1ebe48(),this['_children']=this['createCollection'](),this['_headerView']=new Vn(_0x2f2170,{'part':_0x3d0d63,'uiIndex':_0x278e58,'availableActions':_0x2c6e73,'areActionsDisabled':_0x572560}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...ot)['to'](this),this['_streamableContentView']=new as(_0x2f2170),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x49ed26['to']('state',_0x297929=>'ck-ai-suggestion__body__content-part_'+_0x297929),_0x49ed26['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x49ed26['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x49ed26['if']('isVisible','ck-hidden',_0xd87e9d=>!_0xd87e9d)]},'children':this['_children'],'on':{'mouseenter':_0x49ed26['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3d0d63['index']});}),'mouseleave':_0x49ed26['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3d0d63['index']});}),'click':_0x49ed26['to'](_0x23fd47=>{const _0xa98453=_0x23fd47['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0xa98453)&&this['fire']('showChangeInText',{'index':_0x3d0d63['index']});})}});}async['updateContent']({part:_0x4453a1,renderingStrategy:_0x35f5e7,showUnchangedParts:_0x31faca=!0x1,abortSignal:_0x4f14b2}){this['partDefinition']=_0x4453a1,this['isVisible']=this['partDefinition']['hasChanges']||_0x31faca,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4453a1,'renderingStrategy':_0x35f5e7,'abortSignal':_0x4f14b2});}['markAsDone'](){this['isDone']=!0x0;}}class N extends Wt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x52d352){const _0xa213a5=this['createTask'](_0x52d352);return this['queue']['push'](_0xa213a5),this['_processQueue'](),_0xa213a5['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(_0x5ae1ad=>{this['once']('_queueEmpty',()=>{_0x5ae1ad();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x4dbe34=this['queue']['shift']();try{await _0x4dbe34['callback'](this['_abortController']['signal']),_0x4dbe34['resolve']();}catch(_0x506665){_0x4dbe34['reject'](_0x506665);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x20810a){let _0x59b1c0,_0x51e6b8;const _0x3abde0=new Promise((_0x114bf2,_0x3dc129)=>{_0x59b1c0=_0x114bf2,_0x51e6b8=_0x3dc129;});return{'callback':_0x20810a,'resolve':_0x59b1c0,'reject':_0x51e6b8,'completePromise':_0x3abde0};}}class gi extends Fr{constructor(_0x10f265){super(_0x10f265),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x10f265['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x682422){this['element']['innerHTML']=_0x682422;}}const X=['applySuggestion','insertSuggestion'];class ra extends _0x2d8061{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x19355d,_0xdcab85=[...X],_0x4fe677){super(_0x19355d);const _0x1fb857=this['bindTemplate'],_0x850dc2=Boolean(_0x4fe677);if(this['set']('isEnabled',!_0x850dc2),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x850dc2){const _0x494ed6=new _0x3c2d24(_0x19355d);_0x494ed6['set']({'label':i(_0x19355d,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4a3016});const _0x4ed8f0=new _0x2d8061(_0x19355d);_0x4ed8f0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x19355d,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x494ed6]}]}),this['children']['add'](_0x4ed8f0);}else this['_applyChangesButton']=new _0x3c2d24(_0x19355d),this['_applyChangesButton']['set']({'label':i(_0x19355d,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0xdcab85['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x3c2d24(_0x19355d),this['_insertSuggestionsButton']['set']({'label':i(_0x19355d,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0xdcab85['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xa63453=>{_0xa63453['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x1fb857['if']('isVisible','ck-hidden',_0x339efb=>!_0x339efb)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x36393d){this['isVisible']=_0x36393d;}['_switchButtonLabelsPlurality'](_0x4fd3a7){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4fd3a7?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x2d8061{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x3691d9,_0x95feac){super(_0x3691d9),this['bodyCollection']=_0x95feac,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',_0x51d47f=>!_0x51d47f)]},'children':this['children']});const _0x51f1ca=new _0x2d8061(this['locale']),_0x4d3133=new _0x4dad4f();_0x4d3133['content']=_0x3eae45,_0x51f1ca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x4d3133,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x51f1ca),this['_setupBalloonPanel'](_0x3691d9);}['addSource'](_0x374105){this['children']['add'](new qr(this['locale'],_0x374105,this['balloonPanelView']));}['_setupBalloonPanel'](_0x266024){this['balloonPanelView']=new _0x90b260(_0x266024),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x3c2d24{['balloonPanelView'];['source'];constructor(_0xcc3895,_0x1b8ba2,_0x5d3d83){super(_0xcc3895),this['source']=_0x1b8ba2,this['balloonPanelView']=_0x5d3d83,this['set']({'label':_0x1b8ba2['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x3933f5=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x3933f5['to'](()=>{window['open'](_0x1b8ba2['url'],'_blank');}),'mouseenter':_0x3933f5['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x3933f5['to'](()=>{this['_hideTooltip']();})}}),_0x1b8ba2['favicon']){const _0x469f9c=new _0x2d8061(_0xcc3895);_0x469f9c['setTemplate']({'tag':'img','attributes':{'src':_0x1b8ba2['favicon']||_0x3eae45,'alt':_0x1b8ba2['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x469f9c);}else this['set']('icon',_0x3eae45);}['_createTooltipContentView'](_0x8fbd18,_0x3bf18a){const _0x516526=new _0x2d8061(_0x8fbd18),_0x13419b=[];let _0x19d017;_0x3bf18a?.['favicon']?(_0x19d017=new _0x2d8061(_0x8fbd18),_0x19d017['setTemplate']({'tag':'img','attributes':{'src':_0x3bf18a['favicon'],'alt':_0x3bf18a['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x19d017=new _0x4dad4f(),_0x19d017['content']=_0x3eae45,_0x19d017['extendTemplate']({'attributes':{'alt':_0x3bf18a['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x13419b['push'](_0x19d017);const _0x1dfd8e=new _0x2d8061(_0x8fbd18);_0x1dfd8e['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3bf18a['url']},'children':[{'text':new URL(_0x3bf18a['url'])?.['hostname']}]}),_0x13419b['push'](_0x1dfd8e);const _0x250e39=new _0x2d8061(_0x8fbd18);_0x250e39['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x13419b});const _0x2dba89=new _0x2d8061(_0x8fbd18);return _0x2dba89['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3bf18a['title']['length']>0x190?_0x3bf18a['title']['substring'](0x0,0x190)+'...':_0x3bf18a['title']}]}),_0x516526['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x250e39,_0x2dba89]}),_0x516526;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x90b260['defaultPositions']['northArrowSouth'],_0x90b260['defaultPositions']['northArrowSouthWest'],_0x90b260['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x537182=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x537182);}}class dh extends _0x2d8061{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x2b6579,_0x5e36d8){super(_0x2b6579);const {areActionsDisabled:_0x4b2798,showUnchangedParts:_0x28c580,availableActions:_0x553abc}=_0x5e36d8;this['_areActionsDisabled']=_0x4b2798,this['_showUnchangedParts']=_0x28c580,this['_availableActions']=_0x553abc,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new N(),this['_emptyPartsWarningView']=new gi({'id':'empty-parts-warning','initialContent':i(_0x2b6579,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x2b6579,_0x5e36d8['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x5e36d8['bodyCollection']),_0x5e36d8['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...ot)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x5cd24b,renderingStrategy:_0x2c8b98,abortSignal:_0xb437a7}){this['_children']['length']?_0x5cd24b['forEach'](_0x34535b=>{const _0x28ae89=this['_cachedContentParts']['findIndex'](_0x1676f4=>_0x1676f4['index']==_0x34535b['index']);-0x1===_0x28ae89?this['_cachedContentParts']['push'](_0x34535b):this['_cachedContentParts'][_0x28ae89]=_0x34535b;}):this['_cachedContentParts']=_0x5cd24b;const _0x4b43c3=this['_showUnchangedParts']?_0x5cd24b:_0x5cd24b['filter'](_0x4c44c1=>_0x4c44c1['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4b43c3['length']>0x1);for(const _0x5bd1d5 of _0x4b43c3)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5b6683=>{let _0x24bed4=this['getPartView'](_0x5bd1d5['index']);_0x24bed4||(_0x24bed4=new na(this['locale'],{'part':_0x5bd1d5,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x24bed4['delegate'](...ot)['to'](this),this['_children']['add'](_0x24bed4),this['hasPendingParts']=!0x0),await _0x24bed4['updateContent']({'part':_0x5bd1d5,'renderingStrategy':_0x2c8b98,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5b6683}),_0x24bed4['markAsDone']();});return _0xb437a7?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x4d1006,_0x437a01){const _0x3bfea4=this['getPartView'](_0x4d1006);_0x3bfea4&&(_0x3bfea4['state']=_0x437a01),this['hasPendingParts']='pending'==_0x437a01||Array['from'](this['_children'])['some'](_0x15ab90=>'pending'==_0x15ab90['state']);}['setPartActive'](_0x3c65cd,_0x5710e8){if(!0x1===_0x3c65cd){for(const _0x6478a5 of this['_children'])_0x6478a5['isActive']=!0x1;}else{const _0x57f48b=this['getPartView'](_0x3c65cd);_0x57f48b&&(_0x57f48b['isActive']=_0x5710e8);}}['updateSources'](_0x42c71c){_0x42c71c['forEach'](_0x23fa7c=>this['_sourcesView']['addSource'](_0x23fa7c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1cdfd1){return this['_children']['find'](_0x26f6eb=>_0x26f6eb['partDefinition']['index']==_0x1cdfd1)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x5a4e39=!this['_cachedContentParts']['find'](({hasChanges:_0x2c6397})=>_0x2c6397),_0x4c5ac3=!!this['_cachedContentParts']['find'](({hasChanges:_0x22d15e})=>!_0x22d15e);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x4c5ac3,_0x5a4e39?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0xe348ea=>_0xe348ea['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x4fc753=>_0x4fc753['partDefinition']['hasChanges'])['length']>0x0;}}class Sn extends _0x2d8061{['bodyView'];['children'];['headerView'];constructor(_0x154133,_0x201f88,_0x2fbc64){super(_0x154133);const {showDiff:_0x4da577,areActionsDisabled:_0x24aa5f,showUnchangedParts:_0x2ebd81,availableActions:_0x3d3580}=_0x201f88;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new gh(_0x154133,{'showDiff':_0x4da577}),this['headerView']['on']('toggleShowChanges',(_0x683fca,_0x4ed498)=>{this['areChangesVisible']=_0x4ed498['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4ed498['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new dh(_0x154133,{'areActionsDisabled':_0x24aa5f,'showUnchangedParts':!!_0x2ebd81,'availableActions':_0x3d3580,'bodyCollection':_0x2fbc64}),this['bodyView']['delegate'](...ot)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x28d588){await this['bodyView']['updateContentParts'](_0x28d588);}['updateSources'](_0x42b66c){this['bodyView']['updateSources'](_0x42b66c);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Ze extends Fr{['containerView'];constructor(_0x24721f,_0x24a8b0,_0x67dbd8){super(_0x24a8b0),this['set']('isTrackChangesOn',!0x1),this['containerView']=new Sn(_0x24721f,{'showDiff':_0x24a8b0['showDiff'],'areActionsDisabled':_0x24a8b0['areActionsDisabled'],'availableActions':_0x24a8b0['availableActions']},_0x67dbd8),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3e4b3b,_0x283e21)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x283e21['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x1939db,{index:_0x9db544})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x9db544});}),this['containerView']['on']('applySuggestion',(_0x1502c3,{index:_0x2c0d42}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x2c0d42});}),this['containerView']['on']('insertSuggestion',(_0x56248c,{index:_0x3129dd}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3129dd});}),this['containerView']['on']('rejectSuggestion',(_0x11232f,{index:_0x1a62cd})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1a62cd});}),this['containerView']['on']('mouseOverSuggestion',(_0x1f2b6e,{index:_0x4a3080})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4a3080});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x372684,{index:_0x2cb049})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2cb049});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2947fb){await this['containerView']['updateContent'](_0x2947fb);}['updatePartState'](_0x2d53f0,_0x197901){this['containerView']['bodyView']['updatePartState'](_0x2d53f0,_0x197901);}['setPartActive'](_0x2f01ae,_0x479dc9){!0x1===_0x2f01ae?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x2f01ae,_0x479dc9);}['updateSources'](_0x59dfc6){this['containerView']['updateSources'](_0x59dfc6);}['getPartView'](_0x4b0de6){return this['containerView']['bodyView']['getPartView'](_0x4b0de6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class $e extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x4ba191,_0x1397bb,_0xca3282){super(_0x1397bb),this['_bodyCollection']=_0xca3282,this['locale']=_0x4ba191,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x2d8061(),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':Wi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x573bfa,renderingStrategy:_0x5b420d,abortSignal:_0x12a0b7}){'streaming'===_0x5b420d?await this['streamIntoElement'](_0x573bfa,this['replyContainer']['element'],_0x12a0b7):this['replyContainer']['element']['innerHTML']=_0x4dfa58(_0x573bfa);}['updateSources'](_0x5c10ad){const _0x468460=new Sr(this['locale'],this['_bodyCollection']);_0x468460['children']['addMany'](_0x5c10ad['map'](_0x57880b=>new qr(this['locale'],_0x57880b,_0x468460['balloonPanelView']))),_0x468460['isVisible']=!0x0,this['children']['add'](_0x468460);}}class ki extends _0xe6ea79{constructor(_0x4d678f=void 0x0){super();const _0x24d705=_0x4d678f?'ck-ai-spinner_'+_0x4d678f:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x24d705]}});}}const An={'file':_0x52603b,'document':_0x39f310,'web-resource':_0x374880,'text':_0x52603b,'selection':_0x465133,'mcp-tool-context':_0x39f310},Nr='ck-ai-chat-context-chip',Ur='ck-ai-chat-context-chip_wide',Wr='ck-ai-chat-context-chip_document',Yr='ck-ai-chat-context-chip__label',$r='ck-ai-chat-context-chip__type-icon',Qr='ck-ai-chat-context-controls__chip-tooltip',Ln='n';class To extends _0x3c2d24{constructor(_0x480052,_0x5f0fd5,_0xf3c11f,_0x1d9840,_0xa8bbc4=!0x1){super(_0x480052),this['_isAnimationOnEnterEnabled']=_0x1d9840,this['_initializeProperties'](_0x5f0fd5,_0xf3c11f,_0xa8bbc4),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'](_0x1721c3,_0x4db43c,_0x59b6dc){this['set']('label',_0x1721c3['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1721c3['type']),this['set']('id',_0x1721c3['uiId']),this['set']('readonly',_0x4db43c),this['set']('isLoading',_0x59b6dc);}['_setupTemplate'](){const _0x113446=this['_createIconView'](),_0x40580b=this['_createRemoveButton'](),_0xbe07db=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0xbe07db),'children':this['_createTemplateChildren'](_0x113446,_0x40580b,_0xbe07db)});}['_createTemplateAttributes'](_0x498963){return{'class':[Nr,_0x498963['if']('itemType',Wr,_0x3b8f52=>'document'==_0x3b8f52),_0x498963['if']('itemType',Ur,_0x574bef=>'selection'==_0x574bef)],'data-cke-tooltip-text':_0x498963['to']('label',Rn),'data-cke-tooltip-position':Ln,'data-cke-tooltip-class':Qr};}['_createTemplateChildren'](_0x4a7954,_0x38cf89,_0x845667){const _0x288983=this['_createLabelElement'](_0x845667),_0xda9282=this['_createLoaderIcon']();return this['readonly']?[_0x4a7954,_0x288983]:[_0x4a7954,_0xda9282,_0x288983,_0x38cf89];}['_createLabelElement'](_0x54047f){return{'tag':'span','attributes':{'class':Yr},'children':[{'text':_0x54047f['to']('label')}]};}['_createRemoveButton'](){const _0x35559c=new _0x3c2d24(this['locale']);return _0x35559c['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x1c5b98}),this['_setupRemoveButtonEvent'](_0x35559c),_0x35559c;}['_setupRemoveButtonEvent'](_0x4f2c77){_0x4f2c77['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x537799=this['bindTemplate'],_0x821266=new _0x4dad4f();return _0x821266['content']=An[this['itemType']],_0x821266['extendTemplate']({'attributes':{'class':[$r,_0x537799['if']('isLoading','ck-hidden',_0x3c30cb=>_0x3c30cb)]}}),_0x821266;}['_handleAnimationEndOnce'](_0x481b3d,_0x1fded2){if(!_0x481b3d)return;const _0x1da09a=()=>{_0x1fded2(),_0x481b3d['removeEventListener']('animationend',_0x1da09a),_0x481b3d['removeEventListener']('webkitAnimationEnd',_0x1da09a);};_0x481b3d['addEventListener']('animationend',_0x1da09a),_0x481b3d['addEventListener']('webkitAnimationEnd',_0x1da09a);}['_createLoaderIcon'](){const _0x15478a=new ki('small');return _0x15478a['bind']('isVisible')['to'](this,'isLoading',_0x431ad3=>_0x431ad3),_0x15478a;}}function Rn(_0x3a5cb6){if(!_0x3a5cb6)return _0x3a5cb6;if(_0x3a5cb6['length']<=0x78)return _0x3a5cb6;const _0xb9db02=_0x3a5cb6['slice'](0x0,0x78),_0x488d38=_0xb9db02['lastIndexOf']('\x20');return(_0x488d38>0x0?_0xb9db02['slice'](0x0,_0x488d38):_0xb9db02)+'…';}const bn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},fn='300px';class Eo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x2056dc,_0x2ca220,_0x51a125,_0x47a7af,_0x16e591){this['_locale']=_0x2056dc,this['_visibleChips']=_0x2ca220,this['_config']={...bn,..._0x51a125,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x51a125['cssClasses']}},this['_overflowChips']=new _0xf46d2e(),this['_bodyCollection']=_0x47a7af,this['_parentView']=_0x16e591||null;}['setContainerElement'](_0x19bc06){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x19bc06,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 _0x52c2bc=[...this['_visibleChips'],...this['_overflowChips']],_0x4b34ab=this['_createCalculationContainer'](),_0x17e341=this['_calculateOverflowInContainer'](_0x4b34ab,_0x52c2bc),_0x515372=_0x4b34ab['_ancestorsToRestore'];_0x515372&&this['_restoreAncestorVisibility'](_0x515372),_0x4b34ab['remove'](),this['_applyOverflowResults'](_0x52c2bc,_0x17e341);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x579de4({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4ad57f=new _0x3c2d24(this['_locale']);_0x4ad57f['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4a573e=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4a573e['push'](this['_config']['cssClasses']['controlsButton']),_0x4ad57f['extendTemplate']({'attributes':{'class':_0x4a573e}}),_0x4ad57f;}['_createShowMoreBalloonPanelView'](){const _0x184a22=new _0x90b260(this['_locale']);return _0x184a22['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x184a22),_0x184a22;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x54abd1=>{_0x54abd1['disableAnimationOnEnter']();});const _0x1fbe61=new _0x2d8061(this['_locale']);_0x1fbe61['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1fbe61);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x768bf8=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x768bf8?'':'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'](_0x507cc2){const _0x15e6e8=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x1454a5=this['_containerElement']?.['classList'];if(_0x1454a5){const _0xddddca=_0x1454a5[0x0]||'',_0x434e8a=_0x507cc2['querySelector']('.'+_0xddddca),_0x25e4dd=_0x507cc2['querySelector'](_0x15e6e8);return _0x434e8a||_0x25e4dd||_0x507cc2;}return _0x507cc2['querySelector'](_0x15e6e8)||_0x507cc2;}['_calculateContainerWidth'](){const _0x3933e4=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3933e4)return fn;const _0x844ed2=window['getComputedStyle'](_0x3933e4)['width'];if('auto'===_0x844ed2||'0px'===_0x844ed2||!_0x844ed2){const _0x360bbc=_0x3933e4['parentElement'];if(_0x360bbc){const _0x322967=window['getComputedStyle'](_0x360bbc);return'auto'!==_0x322967['width']?_0x322967['width']:fn;}return fn;}return _0x844ed2;}['_applyCalculationStyles'](_0x198459,_0xa764a0){this['_config']['cssClasses']['calculationContainer']&&_0x198459['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x198459['style']['width']=_0xa764a0,_0x198459['style']['position']='absolute',_0x198459['style']['top']='-9999px',_0x198459['style']['left']='-9999px',_0x198459['style']['opacity']='0',_0x198459['style']['pointerEvents']='none',_0x198459['style']['zIndex']='-1',_0x198459['style']['visibility']='visible\x20!important',_0x198459['style']['display']='block\x20!important',_0x198459['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x13a1d3){_0x13a1d3['forEach'](({element:_0x2d613f,originalDisplay:_0x5219c3,originalVisibility:_0x469e28})=>{_0x2d613f['style']['display']=_0x5219c3,_0x2d613f['style']['visibility']=_0x469e28;});}['_makeAncestorsVisible'](_0x3b1868){const _0xd9cd53=[];let _0x192ac3=_0x3b1868;for(;_0x192ac3&&_0x192ac3!==document['body'];){const _0x42a074=window['getComputedStyle'](_0x192ac3);'none'!==_0x42a074['display']&&'hidden'!==_0x42a074['visibility']||(_0xd9cd53['push']({'element':_0x192ac3,'originalDisplay':_0x192ac3['style']['display'],'originalVisibility':_0x192ac3['style']['visibility']}),_0x192ac3['style']['display']='block',_0x192ac3['style']['visibility']='visible'),_0x192ac3=_0x192ac3['parentElement'];}return _0xd9cd53;}['_createContainerElements'](){let _0x1bbed9,_0x19c717;return this['_parentView']?.['element']?(_0x1bbed9=this['_parentView']['element']['cloneNode'](!0x0),_0x19c717=this['_findTargetContainer'](_0x1bbed9)):(_0x1bbed9=document['createElement']('div'),_0x19c717=_0x1bbed9),{'calculationContainer':_0x1bbed9,'targetContainer':_0x19c717};}['_createCalculationContainer'](){const {calculationContainer:_0x72b4ab,targetContainer:_0x384e3d}=this['_createContainerElements'](),_0x56c3c4=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x72b4ab,_0x56c3c4);const _0x2bc48a=this['_parentView']?.['element']||this['_containerElement'],_0x3a1e63=_0x2bc48a?.['parentElement'];_0x3a1e63?_0x3a1e63['appendChild'](_0x72b4ab):document['body']['appendChild'](_0x72b4ab),_0x72b4ab['_targetContainer']=_0x384e3d;const _0x490a09=this['_makeAncestorsVisible'](_0x3a1e63||null);return _0x72b4ab['offsetWidth'],_0x72b4ab['_ancestorsToRestore']=_0x490a09,_0x72b4ab;}['_calculateOverflowInContainer'](_0x4d2cd5,_0x55f2b4){const _0x5b3170=_0x4d2cd5['_targetContainer']||_0x4d2cd5,_0x2c6fa5=[],{rowCount:_0x2d7526}=this['_renderChipsAndCountRows'](_0x5b3170,_0x55f2b4);if(_0x2d7526<=this['_config']['maxVisibleRows'])return _0x2c6fa5;const _0x1ce0fd=_0x55f2b4['slice']();for(;_0x1ce0fd['length']>0x0;){if(this['_testButtonFit'](_0x4d2cd5,_0x5b3170,_0x1ce0fd)){const _0x3bef99=_0x55f2b4['filter'](_0x4769b5=>!_0x1ce0fd['includes'](_0x4769b5));_0x2c6fa5['push'](..._0x3bef99);break;}if(!_0x1ce0fd['pop']())break;}return _0x2c6fa5;}['_renderChipsAndCountRows'](_0x207c9c,_0x17e56a){_0x207c9c['innerHTML']='',_0x17e56a['forEach'](_0xd1e535=>{if(_0xd1e535['element']){const _0x1309d7=_0xd1e535['element']['cloneNode'](!0x0);_0x207c9c['appendChild'](_0x1309d7);}}),_0x207c9c['offsetWidth'];const _0x56de63=_0x207c9c['children'],_0x2ea8ab=[];return Array['from'](_0x56de63)['forEach'](_0x4c36b9=>{const _0xc2b839=_0x4c36b9['getBoundingClientRect']()['top'];_0x2ea8ab['some'](_0x18a306=>Math['abs'](_0x18a306-_0xc2b839)<this['_config']['rowDetectionTolerance'])||_0x2ea8ab['push'](_0xc2b839);}),{'rowCount':_0x2ea8ab['length']};}['_createMockButton'](){const _0x248309=document['createElement']('button');return _0x248309['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x248309['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x248309['textContent']='+\x201',_0x248309;}['_testButtonFit'](_0x2553a7,_0x4122d7,_0x130119){this['_renderChipsAndCountRows'](_0x4122d7,_0x130119);const _0x32f905=this['_createMockButton']();_0x2553a7['appendChild'](_0x32f905),_0x2553a7['offsetWidth'];const _0x10711d=[..._0x4122d7['children'],_0x32f905],_0xf418c5=[];_0x10711d['forEach'](_0x1f6c79=>{const _0x2f1b86=_0x1f6c79['getBoundingClientRect']()['top'];_0xf418c5['some'](_0x35fc7d=>Math['abs'](_0x35fc7d-_0x2f1b86)<this['_config']['rowDetectionTolerance'])||_0xf418c5['push'](_0x2f1b86);});const _0x5071da=_0xf418c5['length'];return _0x32f905['remove'](),_0x5071da<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0xe1e0e1,_0x2582a8){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0xe1e0e1['forEach'](_0x620aa5=>{_0x2582a8['includes'](_0x620aa5)?this['_overflowChips']['add'](_0x620aa5):this['_visibleChips']['add'](_0x620aa5);});}['_updateOverflowUI'](_0x48a9e2){if(_0x48a9e2>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x48a9e2>0x0&&this['_showMoreButtonView']){const _0x38be33=''+this['_config']['showMoreLabelPrefix']+(_0x48a9e2<0x63?_0x48a9e2:'99');this['_showMoreButtonView']['label']=_0x38be33;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x58d889,_0x1f480f){this['_distributeChips'](_0x58d889,_0x1f480f),this['_updateOverflowUI'](_0x1f480f['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x24696d=>{_0x24696d[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 _0x5307ea=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5307ea['width']||0x0===_0x5307ea['height'])return!0x1;const _0x386127=window['innerHeight']||document['documentElement']['clientHeight'],_0x41ecc3=window['innerWidth']||document['documentElement']['clientWidth'],_0x5b99ef=0xc8;return _0x5307ea['bottom']>=-0xc8&&_0x5307ea['top']<=_0x386127+_0x5b99ef&&_0x5307ea['right']>=-0xc8&&_0x5307ea['left']<=_0x41ecc3+_0x5b99ef;}}const Xr='ck-ai-chat__feed__context-chips',Zr='ck-ai-chat-context-chips-wrapper',oa='ck-ai-chat-context-chips-wrapper-balloon',ca='ck-ai-chat-controls-button',la='ck-ai-chat-controls_context_show-more-button',ua='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x2d8061{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xb2d951,_0x427de0,_0x470aff){super(_0xb2d951),this['_bodyCollection']=_0x470aff,this['_createContextChips'](_0x427de0);const _0x2f89ba={'cssClasses':{'showMoreButton':la,'showMoreBalloon':ua,'overflowContainer':oa,'controlsButton':ca}};this['_overflowManager']=new Eo(_0xb2d951,this['_contextChips'],_0x2f89ba,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Xr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Zr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1d8610=this['element']['querySelector']('.'+Zr);_0x1d8610&&(this['_overflowManager']['setContainerElement'](_0x1d8610),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2b3602){for(const _0x382516 of _0x2b3602){const _0x4aa9ad=new To(this['locale'],_0x382516,!0x0,!0x1);this['_contextChips']['add'](_0x4aa9ad);}}}class li extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x16b204,_0x39a273,_0x2d33e){super(_0x39a273),this['_locale']=_0x16b204,this['_bodyCollection']=_0x2d33e,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'](_0xa2f0bc=>!_0xa2f0bc['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x2d8061(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 St extends Fr{['capabilities'];constructor(_0x5017b1,_0x16c766){super(_0x16c766);const {isWebSearchEnabled:_0x40885c,isReasoningEnabled:_0x9efa29}=_0x16c766['capabilities'],_0x5be1c4=[];let _0x5ef944='';_0x40885c&&_0x9efa29?(_0x5ef944=i(_0x5017b1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5be1c4['push'](aa(_0x3eae45)),_0x5be1c4['push'](aa(_0x58c2b6))):_0x40885c?(_0x5ef944=i(_0x5017b1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5be1c4['push'](aa(_0x3eae45))):_0x9efa29&&(_0x5ef944=i(_0x5017b1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5be1c4['push'](aa(_0x58c2b6))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5ef944?'':'ck-hidden']}});const _0x550442=new _0x2d8061();_0x550442['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5be1c4,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5ef944]}]}),this['children']['add'](_0x550442),this['capabilities']=_0x16c766['capabilities'];}}function aa(_0x31e4cd){const _0x10fa6d=new _0x4dad4f();return _0x10fa6d['content']=_0x31e4cd,_0x10fa6d;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class mi{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x46349d){this['element']=_0x46349d,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x158441 of Fs){const _0x1bf274='keydown'!==_0x158441;this['element']['addEventListener'](_0x158441,this['_onUserEvent']['bind'](this),{'passive':_0x1bf274,'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'](_0x134f2e){if(this['isRunning']){if('keydown'===_0x134f2e['type']){const _0x3dffbf=_0x134f2e['key'];if(!Us['includes'](_0x3dffbf))return;}_0x134f2e instanceof WheelEvent?_0x134f2e['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x59b2de,scrollHeight:_0x4805c8,clientHeight:_0x157fdd}=this['element'];return _0x4805c8-_0x59b2de-_0x157fdd<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class fi extends _0x2d8061{constructor(_0x47e089,_0x2d6574){super(_0x47e089),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2d6574)});}['_createSkeletonItems'](_0x3e91cd){const _0x6350d3=['ck','ck-ai-skeleton__item'];return _0x3e91cd['map'](_0x54d0e8=>{let _0x124603='';switch(_0x54d0e8['attributes']['align']){case'right':_0x124603='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x124603='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x124603='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x54d0e8['tag'],'attributes':{'class':[..._0x6350d3,_0x54d0e8['attributes']['class']?_0x54d0e8['attributes']['class']:''],'style':'width:\x20'+_0x54d0e8['attributes']['width']+';\x20height:\x20'+_0x54d0e8['attributes']['height']+';'+_0x124603}};});}}const wi={'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':ta(0x5,'100%','44px','right'),'aiChatResources':ta(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 ta(_0x1b9eec,_0x2b6469,_0x2494c4,_0x1bb321){return new Array(_0x1b9eec)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x2b6469,'height':_0x2494c4,'align':_0x1bb321}}));}class vi extends Fr{constructor(_0x67f727){super(_0x67f727),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class ji extends _0x2d8061{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x11c4e0,_0x9ba065){super(_0x11c4e0),this['_bodyCollection']=_0x9ba065,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new mi(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x5e9990,_0x4a4946){let _0x2e9e35;return'ai-reply'===_0x5e9990?_0x2e9e35=new $e(this['locale'],_0x4a4946,this['_bodyCollection']):'ai-suggestion-reply'===_0x5e9990?(_0x2e9e35=new Ze(this['locale'],_0x4a4946,this['_bodyCollection']),_0x2e9e35['bind']('isTrackChangesOn')['to'](this)):_0x2e9e35='user-message'===_0x5e9990?new li(this['locale'],_0x4a4946,this['_bodyCollection']):'interaction-header'===_0x5e9990?new St(this['locale'],_0x4a4946):'custom-element'===_0x5e9990?new vi(_0x4a4946):new gi(_0x4a4946),this['children']['add'](_0x2e9e35),_0x2e9e35;}async['updateReplyItem']({id:_0x16baeb,parsedContent:_0xde70a5,renderingStrategy:_0x1ffbb4,abortSignal:_0x2a4832}){const _0x44128c=this['getItemById'](_0x16baeb);if(!(_0x44128c instanceof $e))throw new _0x32ab89('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x44128c,'id':_0x16baeb,'parsedContent':_0xde70a5});await _0x44128c['updateContent']({'parsedContent':_0xde70a5,'renderingStrategy':_0x1ffbb4,'abortSignal':_0x2a4832});}async['updateWebSources'](_0x4d0ff6,_0x24e9e4){const _0x1f9e87=this['getItemById'](_0x4d0ff6);if(_0x1f9e87 instanceof Ze)_0x1f9e87['updateSources'](_0x24e9e4);else{if(!(_0x1f9e87 instanceof $e))throw new _0x32ab89('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x1f9e87,'id':_0x4d0ff6,'sources':_0x24e9e4});_0x1f9e87['updateSources'](_0x24e9e4);}}async['updateSuggestionItem']({id:_0x1395e3,parts:_0x2e970e,renderingStrategy:_0x2d1fb5,abortSignal:_0x5a05b7}){const _0x3882a4=this['getItemById'](_0x1395e3);if(!(_0x3882a4 instanceof Ze))throw new _0x32ab89('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3882a4,'id':_0x1395e3,'parts':_0x2e970e});await _0x3882a4['updateContent']({'parts':_0x2e970e,'renderingStrategy':_0x2d1fb5,'abortSignal':_0x5a05b7});}['updateSuggestionPartState']({id:_0x4bbfcd,index:_0x153362,state:_0x591f46}){const _0x427f59=this['getItemById'](_0x4bbfcd);if(!(_0x427f59 instanceof Ze))throw new _0x32ab89('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4bbfcd});_0x427f59['updatePartState'](_0x153362,_0x591f46);}['setSuggestionPartActive']({id:_0x3fc367,index:_0x2a250f,isActive:_0x252269}){const _0x596f59=this['getItemById'](_0x3fc367);if(!(_0x596f59 instanceof Ze))throw new _0x32ab89('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3fc367});this['children']['filter'](_0x4b242e=>_0x4b242e instanceof Ze)['forEach'](_0x194d3d=>{_0x194d3d['setPartActive'](!0x1);}),_0x596f59['setPartActive'](_0x2a250f,_0x252269);}['markItemAsDone'](_0x1c7cdb){this['getItemById'](_0x1c7cdb)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2de63a=>_0x2de63a['options']['id']);}['removeItem'](_0x4eb4ea){this['children']['remove'](this['getItemById'](_0x4eb4ea));}['scrollToSuggestion'](_0x2e10ca,_0x390b28){const _0x95b279=this['getItemById'](_0x2e10ca);if(!(_0x95b279 instanceof Ze))return void _0x2ad26e('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2e10ca,'partIndex':_0x390b28});const _0x1f91a4=_0x95b279['getPartView'](_0x390b28);_0x1f91a4?_0xfabcf7(_0x1f91a4['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x2ad26e('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2e10ca,'partIndex':_0x390b28});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x6848c1=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x6848c1,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x1537cc=new fi(this['locale'],wi['aiFeed']);return _0x1537cc['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2292df=>!_0x2292df)]}}),_0x1537cc;}['_createFeedItems'](){const _0x464ab0=new _0x2d8061(this['locale']);return _0x464ab0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x464ab0;}['_createFeedLoader'](){const _0x4437f7=new _0x2d8061(this['locale']);return _0x4437f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x322943=>!_0x322943)]},'children':this['_createLoaderChildren']()}),_0x4437f7;}['_createLoaderChildren'](){const _0x2ca399=new ki();return _0x2ca399['isVisible']=!0x0,[_0x2ca399,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x533861){const _0x3d6d82=this['children']['find'](_0x5a4c89=>_0x5a4c89['options']['id']['includes'](_0x533861));if(!_0x3d6d82)throw new _0x32ab89('ai-chat-feed-view-item-not-found',this,{'id':_0x533861});return _0x3d6d82;}['setLoadingMessage'](_0x19210d){this['set']('loadingMessage',_0x19210d);}['toggleLoadingSkeleton'](_0x5b8566){this['set']('isLoadingSkeletonVisible',_0x5b8566);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Or extends _0x366e5d{['filter'](){let _0x5d1d88=0x0;for(const _0x411365 of this['items'])_0x5d1d88+=_0x411365['items']['length'];return{'resultsCount':_0x5d1d88,'totalItemsCount':_0x5d1d88};}}class Pe extends _0x2393c6{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0xb52962,_0x2186b3){super(_0xb52962,{'queryView':{'label':'','creator':_0x4fcc6d,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Or(_0xb52962),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2186b3,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=Pe['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=Pe['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',(_0x29c9b2,_0x575a26)=>!_0x29c9b2&&!_0x575a26),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x14621a,_0x1ce321)=>{this['isUploadInProgress']||this['isEmpty']||_0x14621a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1ce321());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x23cb58=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x23cb58)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x6e8fc9=_0x3bf51a(_0x23cb58);this['fire']('sendUserMessage',_0x6e8fc9),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x230e1e){this['queryView']['fieldView']['set']('placeholder',_0x230e1e);}['_createSubmitButton'](){const _0x271a68=new _0x3c2d24(this['locale']);return _0x271a68['set']({'icon':_0xbd2e80,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x271a68['on']('execute',()=>{this['submit']();}),_0x271a68;}['setIsUploadInProgress'](_0x46a063){this['isUploadInProgress']=_0x46a063;}['_setUpAddContextButtonPositioning'](){const _0x280f2f=this['locale'],_0x21176d=()=>{Ot['window']['requestAnimationFrame'](()=>{if(_0x2ebbda(this['element'])){const _0x546293=new bt(this['queryView']['fieldView']['element']),_0x288110=new bt(this['_addContextButtonView']['element']),_0x51f9e6=_0x546293['width'],_0x483657='rtl'===_0x280f2f['uiLanguageDirection']?'right':'left';_0x546293['excludeScrollbarsAndBorders']();const _0x536145=_0x51f9e6-_0x546293['width']+0x1;this['_addContextButtonView']['element']['style'][_0x483657]='calc('+(_0x51f9e6-_0x288110['width']-_0x536145)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x21176d),this['on']('render',()=>{_0x21176d(),this['_queryViewResizeObserver']=new _0x59ca1a(this['queryView']['fieldView']['element'],()=>{_0x21176d();});});}}const da='ck-ai-chat__prompt-capabilities',_a='ck-ai-chat-controls-button',Aa='ck-ai-chat-controls-button--commands',ga='ck-ai-chat-controls__model-selection',Ia='ck-ai-chat-controls__model-selection__item-name',Ea='ck-ai-chat-controls__model-selection__item-description',pa='ck-ai-chat-controls__model-selection__item-capabilities',Ta='n';class He extends _0x2d8061{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4a4690){super(_0x4a4690),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5e44b5=>'selector'===_0x5e44b5),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x26323f=>_0x26323f?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x5c0d05=>_0x5c0d05),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x483d1f=>_0x483d1f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x328f06=>i(this['locale'],_0x328f06?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x18407=>_0x18407),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0xcfc724=>i(this['locale'],_0xcfc724?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[da]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0xf46d2e(),_0x1c418d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x563d0d,_0x69b056){if(_0x69b056)this['set']('modelDisplayMode','hidden');else{const _0x18dda2=0x1===_0x563d0d['length'];this['set']('modelDisplayMode',_0x18dda2?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x563d0d?.['length'])for(const _0xa7381d of _0x563d0d){const _0x4a1c05=new _0x491ca2({'label':_0xa7381d['name'],'withText':!0x0,'role':'menuitemradio','id':_0xa7381d['id'],'model':_0xa7381d});_0x4a1c05['bind']('isOn')['to'](this,'activeModelId',_0x3b352c=>_0x3b352c===_0xa7381d['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4a1c05,'labelView':new ma(this['locale'],_0xa7381d)});}}['setWebSearch'](_0x240b8f){this['set']('webSearchActive',_0x240b8f);}['setReasoning'](_0x218625){this['set']('reasoningActive',_0x218625);}['setModel'](_0x34477a){if(!_0x34477a)return;this['activeModelId']=_0x34477a['id'],this['activeModelName']=_0x34477a['name']||_0x34477a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x34477a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x34477a['name']);const _0x1e3d88=_0x34477a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1e3d88),this['_webSearchButton']['set']('isVisible',_0x1e3d88);const _0x532801=_0x34477a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x532801),this['_reasoningButton']['set']('isVisible',_0x532801);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x556a4d){this['set']('modelSelectorEnabled',!0x1),_0x556a4d&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x244eb6=new _0x3c2d24();return _0x244eb6['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3eae45,'class':_a,'isToggleable':!0x0,'tooltipPosition':Ta}),_0x244eb6['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x244eb6;}['_createReasoningButton'](){const _0x39c8b5=new _0x3c2d24();return _0x39c8b5['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x58c2b6,'class':_a,'isToggleable':!0x0,'tooltipPosition':Ta}),_0x39c8b5['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x39c8b5;}['_createCommandsButton'](){const _0x2c497d=new _0x3c2d24();return _0x2c497d['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x219404,'withText':!0x0,'class':_a,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ta}),_0x2c497d['extendTemplate']({'attributes':{'class':[Aa]}}),_0x2c497d['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2c497d;}['_createModelSelectionDropdown'](){const _0x2e39f9=_0x59c3f3(this['locale']);return _0x2e39f9['set']({'panelPosition':'ne','class':[ga]}),_0x2e39f9['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ta}),this['listenTo'](_0x2e39f9,'execute',_0x1dbe3d=>{this['fire']('selectModel',_0x1dbe3d['source']['model']);}),_0x2e39f9;}['_createModelNameView'](){const _0x1d6710=new Ca(this['locale']);return _0x1d6710['bind']('text')['to'](this,'activeModelName',_0x20af5d=>_0x20af5d??''),_0x1d6710['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4e2b17=>'name'===_0x4e2b17),_0x1d6710;}}let ma=class extends _0x4566cf{constructor(_0x5ed32d,_0x4a721b){super();const _0xd02183=this['bindTemplate'],_0x2afc14=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xd02183['to']('style'),'id':_0xd02183['to']('id')},'children':[{'tag':'div','attributes':{'class':[Ia]},'children':[{'text':_0xd02183['to']('text')}]},{'tag':'div','attributes':{'class':[Ea]},'children':[{'tag':'span','children':[{'text':_0x4a721b['description']}]}]},{'tag':'div','attributes':{'class':[pa]},'children':_0x2afc14}]}),_0x2afc14['addMany'](this['_getCapabilityParts'](_0x5ed32d,_0x3eae45,'AI_CHAT_SEARCH_WEB',_0x4a721b['capabilities']['webSearch']?.['enabled']??!0x1)),_0x2afc14['addMany'](this['_getCapabilityParts'](_0x5ed32d,_0x58c2b6,'AI_CHAT_REASONING',_0x4a721b['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x40f033,_0x565bbe,_0x222b7b,_0x51ef20){const _0x4d0b3d=new _0x4dad4f();_0x4d0b3d['content']=_0x565bbe;const _0x1a80bd=new _0x2d8061(_0x40f033);_0x1a80bd['setTemplate']({'tag':'span','children':[{'text':i(_0x40f033,_0x222b7b)+':\x20'}]});const _0xc6a5c7=new _0x2d8061(_0x40f033);return _0xc6a5c7['setTemplate']({'tag':'span','children':[{'text':i(_0x40f033,_0x51ef20?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4d0b3d,_0x1a80bd,_0xc6a5c7];}},Ca=class extends _0x2d8061{constructor(_0x28d5b8){super(_0x28d5b8),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3bd930=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3bd930['if']('isVisible','ck-hidden',_0x5169cb=>!_0x5169cb)]},'children':[{'text':_0x3bd930['to']('text')}]});}};const wa='ck-ai-chat-context-controls__url-form',fa='ck-ai-chat-context-controls__url-input-section';class ko extends _0x2d8061{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x612ec5){super(_0x612ec5),this['focusTracker']=new _0x59aa0e(),this['keystrokes']=new _0x151440(),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 _0x2427c3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5b13db=>{this['focusTracker']['add'](_0x5b13db['element']),this['keystrokes']['listenTo'](_0x5b13db['element']);}),_0x14a95e({'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'](_0x6ddd95){this['urlInputField']['errorText']=_0x6ddd95,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x23c0ff=new _0x3c2d24(this['locale']);return _0x23c0ff['set']({'icon':_0x4fd96d,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x4167ea,_0x586da9,_0x26b5e4)=>{_0x23c0ff['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x26b5e4?'':'\x20ck-hidden')]});}),_0x23c0ff;}['_createUrlInputField'](){const _0x560197=new _0x26be3f(this['locale'],th);return _0x560197['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x560197['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x560197;}['_createConfirmButton'](){const _0x31a558=new _0x3c2d24(this['locale']);return _0x31a558['set']({'icon':_0x2c4a04,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x31a558;}['_setupTemplate'](){const _0x2d0c4f=new _0x4b4b8d(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x2d0c4f['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wa,'tabindex':'-1'},'children':[_0x2d0c4f,{'tag':'div','attributes':{'class':fa},'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',_0x4a8164=>{_0x4a8164['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x12bcbf,_0x51677c)=>{this['clear'](),this['fire']('cancel'),_0x51677c();});}['_handleSubmit'](){const _0x314d25=this['getValue']()['trim']();_0x314d25?this['_isValidUrl'](_0x314d25)?(this['clearError'](),this['fire']('submitUrl',_0x314d25)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x1455b3=this['getValue']()['trim'](),_0xa9fa2a=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x1455b3['length']>0x0&&!_0xa9fa2a;}['_isValidUrl'](_0x105de8){try{return!!new URL(_0x105de8);}catch{return!0x1;}}}const Sa='ck-ai-chat-resources__item',ba='ck-ai-chat-resources__item--in-context',Ra='ck-ai-chat-resources__item-title',Oa='ck-ai-chat-resources__item__icon';class rc extends _0x8f7dd0{['resource'];['_titleView'];['_iconView'];constructor(_0x1b72cc,_0x34bfbd){super(_0x1b72cc),this['resource']=_0x34bfbd,this['set']('isInContext',!!_0x34bfbd['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x467532){if(_0x467532['isInContext'])return _0x2c4a04;switch(_0x467532['type']){case Ne['DOCUMENT']:return _0x39f310;case Ne['URL']:return _0x374880;case Ne['FILE']:case Ne['TEXT']:return _0x52603b;default:return _0x589ec0;}}['highlightText'](_0x95411c){if(!_0x95411c||''===_0x95411c['trim']())return void this['_titleView']['highlightText'](null);const _0x3165fd=new RegExp(_0x1173f5(_0x95411c),'gi');this['_titleView']['highlightText'](_0x3165fd);}['updateResourceState'](_0x72c58){this['resource']['isInContext']=_0x72c58,this['isInContext']=_0x72c58,this['_updateIcon']();}['_createTitleView'](){const _0xbca36b=new _0x5027dd();return _0xbca36b['text']=this['resource']['label'],_0xbca36b['extendTemplate']({'tag':'span','attributes':{'class':[Ra]}}),_0xbca36b;}['_createIconView'](){const _0x5f4f7f=new _0x4dad4f();return _0x5f4f7f['content']=this['getResourceIcon'](this['resource']),_0x5f4f7f;}['_setupTemplate'](){const _0xf27c98=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Sa,_0xf27c98['if']('isVisible','ck-hidden',_0xb139a3=>!_0xb139a3),_0xf27c98['if']('isInContext',ba)]},'children':[{'tag':'div','attributes':{'class':[Oa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0xf27c98['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ka='ck-ai-chat-resources__list';class Lr extends _0x366e5d{['_source'];constructor(_0x5baa55,_0x5b05fc){super(_0x5baa55),this['_source']=_0x5b05fc,this['extendTemplate']({'attributes':{'class':[ka]}});}['setResources'](_0x481a5f,_0x4ee982){this['items']['clear']();let _0x1dff5c=_0x481a5f;if(this['_source']['useDefaultFiltering']&&_0x4ee982&&''!==_0x4ee982['trim']()){const _0x1b9a40=new RegExp(_0x4ee982['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1dff5c=_0x481a5f['filter'](_0x257059=>_0x1b9a40['test'](_0x257059['label']));}for(const _0x5cfaa1 of _0x1dff5c){const _0x3e254a=new rc(this['locale'],_0x5cfaa1);_0x3e254a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5cfaa1);}),this['items']['add'](_0x3e254a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x4ee982);}['highlightText'](_0x599685){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x26ee5d=>{_0x26ee5d['highlightText'](_0x599685);});}['updateResourceState'](_0x1e7841,_0x41b0f7){for(const _0x556070 of this['items']){const _0x487eed=_0x556070;_0x487eed['resource']['id']===_0x1e7841&&_0x487eed['updateResourceState'](_0x41b0f7);}}['_handleResourceSelection'](_0x41b83c,_0x4ba780){this['fire']('addResourceToContext',{'source':_0x41b83c,'resource':_0x4ba780});}}class Tr extends _0x26be3f{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x42f0da){const t=_0x42f0da['t'],_0x2fdd8c={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x42f0da,'AI_CHAT_SEARCH_RESOURCES')};super(_0x42f0da,_0x2fdd8c['creator']),this['label']=_0x2fdd8c['label'],this['_viewConfig']=_0x2fdd8c,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x42f0da,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x911751){this['fire']('search',_0x911751);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x4dad4f(),this['iconView']['content']=_0x347d72,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x192603,t){this['resetButtonView']=new _0x3c2d24(_0x192603),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2d25cb,'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',_0x476e7e=>!_0x476e7e),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 nc extends _0x2d8061{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x46589d,_0x9b7054){super(_0x46589d),this['_source']=_0x9b7054['source'],this['_searchInputVisibleFrom']=_0x9b7054['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x215181([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x490bef=new _0x2d8061(this['locale']);return _0x490bef['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5c6251,_0x49f522)=>{this['loadResources'](_0x49f522),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x49f522);}),_0x490bef;}['_createResourcesListView'](){const _0x5721b6=new Lr(this['locale'],this['_source']);return _0x5721b6['delegate']('addResourceToContext')['to'](this),_0x5721b6['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5721b6;}['_createSkeletonView'](){const _0x25384c=new fi(this['locale'],wi['aiChatResources']);return _0x25384c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x45ea13=>!_0x45ea13)]}}),_0x25384c;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x5ca9d4){const _0x2afd1b=_0xdeade1();this['_latestLoadResourcesUid']=_0x2afd1b,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x5ca9d4,'uid':_0x2afd1b}),this['isLoading']=!0x0;}['setResources'](_0x5640c8,_0x6bb27b){if(_0x6bb27b&&_0x6bb27b!==this['_latestLoadResourcesUid'])return;const _0x267811=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5640c8,_0x267811),_0x5640c8['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1ba9b6,_0x375933){this['_resourcesListView']['updateResourceState'](_0x1ba9b6,_0x375933);}}const Na='ck-ai-chat-context-controls__source-balloon-panel',ya='ck-button-icon\x20ck-button-back',va='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class vo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x3a0faf,_0x3ea522,_0x2313b0){this['_locale']=_0x3a0faf,this['_bodyCollection']=_0x3ea522,this['_config']=_0x2313b0;}['showSourceResourcesBalloon']({source:_0x5a44bf,withBackButton:_0x5f0f63}){let _0x4a421d=this['_sourceResourceBalloons']['get'](_0x5a44bf['id']);_0x4a421d||(_0x4a421d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5a44bf['id'],_0x4a421d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x4a421d)),this['_addSourceResourceContent']({'balloonPanel':_0x4a421d,'source':_0x5a44bf,'withBackButton':_0x5f0f63}),_0x4a421d['show']();const _0x5cf53e=this['_config']['getTargetElement']();_0x5cf53e&&_0x4a421d['pin']({'target':_0x5cf53e,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5787b5,_0x437389,_0x54272a){const _0xfbc7ce=this['_sourceResourceBalloons']['get'](_0x5787b5);if(!_0xfbc7ce)return;const _0x1a73da=this['_getResourcesViewFromBalloon'](_0xfbc7ce);_0x1a73da&&(_0x1a73da['setResources'](_0x437389,_0x54272a),_0x1a73da['once']('change:isLoading',()=>{_0xfbc7ce['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x243f4a){const _0xf4301d=this['_sourceResourceBalloons']['get'](_0x243f4a);_0xf4301d&&requestAnimationFrame(()=>{_0xf4301d['hide'](),this['_sourceResourceBalloons']['delete'](_0x243f4a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1ce8c4 of this['_sourceResourceBalloons']['values']())if(_0x1ce8c4['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x280812,_0x5861a5,_0x31a841){const _0x3426c3=this['_sourceResourceBalloons']['get'](_0x280812);if(!_0x3426c3||!_0x3426c3['isVisible'])return;const _0x5c189e=this['_config']['getTargetElement']();if(!_0x5c189e)return;_0x3426c3['pin']({'target':_0x5c189e,'limiter':this['_config']['getLimiterElement']()});const _0x25baa1=this['_getResourcesViewFromBalloon'](_0x3426c3);_0x25baa1&&_0x25baa1['updateResourceState'](_0x5861a5,_0x31a841);}['destroy'](){for(const _0x4514ed of this['_sourceResourceBalloons']['values']())_0x4514ed['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5d6dd6=new _0x90b260(this['_locale']);return _0x5d6dd6['extendTemplate']({'attributes':{'class':Na}}),this['_bodyCollection']['add'](_0x5d6dd6),_0x5d6dd6;}['_addSourceResourceContent']({balloonPanel:_0x29a934,source:_0x5456da,withBackButton:_0x14656f}){_0x29a934['content']['clear']();const _0xb4d6cc=this['_createBalloonHeader']({'balloonPanel':_0x29a934,'source':_0x5456da,'withBackButton':_0x14656f});_0x29a934['content']['add'](_0xb4d6cc);const _0x1f323a=this['_createBalloonResourcesView'](_0x5456da);_0x29a934['content']['add'](_0x1f323a);}['_createBalloonHeader']({balloonPanel:_0x411c1a,source:_0x86a8cb,withBackButton:_0x306c0e}){const _0x2ac39a=new _0x4b4b8d(this['_locale'],{'label':_0x86a8cb['label'],'class':va});return _0x306c0e&&_0x2ac39a['children']['add'](this['_createBackButton'](_0x411c1a),0x0),_0x2ac39a;}['_createBackButton'](_0x11a813){const _0x49dfa8=new _0x3c2d24(this['_locale']);return _0x49dfa8['set']({'icon':_0x4fd96d,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ya}),_0x49dfa8['on']('execute',()=>{_0x11a813['hide'](),this['_config']['onBackToContext']();}),_0x49dfa8;}['_createBalloonResourcesView'](_0xcb9da){const _0x270243=new nc(this['_locale'],{'source':_0xcb9da,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x270243['on']('loadSourceResources',(_0x3c45b8,_0x5a1e5e)=>{this['_config']['onLoadSourceResources'](_0x5a1e5e);}),_0x270243['on']('addResourceToContext',(_0x38c729,_0x22e3a5)=>{this['_config']['onResourceSelected'](_0x22e3a5['source'],_0x22e3a5['resource']),this['closeSourceResourceBalloon'](_0xcb9da['id']);}),_0x270243;}['_getResourcesViewFromBalloon'](_0x34da6a){const _0x1c5c87=_0x34da6a['content']['get'](0x1);return _0x1c5c87 instanceof nc?_0x1c5c87:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4c5407){_0x579de4({'emitter':_0x4c5407,'contextElements':[_0x4c5407['element']],'callback':()=>{_0x4c5407['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4c5407['isVisible']});}}const Ke=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vo='ck-ai-chat-context-controls',Io='ck-ai-chat-context-controls__pending-contexts',Po='ck-ai-chat-context-controls__add-context-balloon-panel',Ro='ck-ai-chat-context-controls__add-context-button',Oo='ck-ai-chat-context-controls__url-balloon-panel',Uo='ck-ai-chat-context-controls__balloon-button',Lo='ck-ai-chat-context-controls__balloon-button-source',No='ck-ai-chat-controls-button',Mo='ck-ai-chat-context-chips-wrapper-balloon',Ho='ck-ai-chat-controls_context_show-more-button',jo='ck-ai-chat-context-controls__show-more-balloon-panel',Fo='ck-ai-chat',Xo=[_0x90b260['defaultPositions']['northArrowSouthWest'],_0x90b260['defaultPositions']['northArrowSouth'],_0x90b260['defaultPositions']['northArrowSouthEast'],_0x90b260['defaultPositions']['southArrowNorthWest'],_0x90b260['defaultPositions']['southArrowNorth'],_0x90b260['defaultPositions']['southArrowNorthEast']];class Xe extends _0x2d8061{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1ae4c6,_0x34a920){super(_0x1ae4c6),this['bodyCollection']=_0x34a920['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1ae4c6),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1ae4c6),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1ae4c6),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1ae4c6,_0x34a920);const _0x3c2cbc={'cssClasses':{'showMoreButton':Ho,'showMoreBalloon':jo,'overflowContainer':Mo,'controlsButton':No}};this['_overflowManager']=new Eo(_0x1ae4c6,this['_currentContextsChips'],_0x3c2cbc,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'](_0x11771d,_0x5402b7){const _0x2976e7=this['_createContextButton'](_0x11771d,'current',!0x0,_0x5402b7);this['_addContextToCollection'](_0x2976e7,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x570076){this['_removeContextFromCollection'](_0x570076,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x570076,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x5f39d0,_0x17f6f2){let _0x38ba81=this['_currentContextsChips']['find'](_0x3e939d=>_0x3e939d['id']===_0x5f39d0);_0x38ba81||(_0x38ba81=this['_overflowManager']['overflowChips']['find'](_0x3403dd=>_0x3403dd['id']===_0x5f39d0)),_0x38ba81&&(_0x38ba81['isLoading']=_0x17f6f2);}['setConversationContext'](_0x55c3b2){this['_conversationContextsChips']['clear']();for(const _0x449c47 of _0x55c3b2){const _0x169d94=this['_createContextButton'](_0x449c47,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x169d94,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x311440,_0x2ac47b,_0x544fac){this['_resourcesBalloonView']['updateResourceState'](_0x311440,_0x2ac47b,_0x544fac);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x59a390,withBackButton:_0x120d62}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x59a390,'withBackButton':_0x120d62}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x281f94,_0x13f4f7,_0x214981,_0x18d314){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x281f94,_0x214981,_0x18d314);}['closeSourceResourceBalloon'](_0x4b7373){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x4b7373),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0xa6ab0c){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0xa6ab0c),this['_setAddContextButtonEnabled'](_0xa6ab0c);}['_setAddContextButtonEnabled'](_0x230455){const _0x1f04f0=!_0x230455['document']['isHidden']&&_0x230455['document']['enabled'],_0x5bd85e=_0x230455['urls']['enabled'],_0x5bc5b2=_0x230455['files']['enabled'],_0x3a937f=_0x230455['sources']['length']>0x0,_0x2d75fd=_0x230455['customItems']&&_0x230455['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1f04f0||_0x5bd85e||_0x5bc5b2||_0x3a937f||_0x2d75fd;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Io},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x30639b){const _0xf600d4=new _0x3c2d24(_0x30639b);return _0xf600d4['set']({'label':i(_0x30639b,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':No+'\x20'+Ro,'icon':_0x401aa1,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xf600d4;}['_createAddContextBalloonPanelView'](_0x497dda){return this['_createBaseBalloonPanel'](_0x497dda,Po);}['_createUrlBalloonPanelView'](_0x1e789d){const _0x5b7326=this['_createBaseBalloonPanel'](_0x1e789d,Oo);return this['_addUrlContent'](_0x5b7326,_0x1e789d),_0x5b7326;}['_createResourcesBalloonView'](_0x14f187,_0x243096){const _0x1be42f={'searchInputVisibleFrom':_0x243096['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xo});},'onResourceSelected':(_0x333fde,_0x13e7ca)=>{this['fire']('addResourceToContext',{'source':_0x333fde,'resource':_0x13e7ca});},'onLoadSourceResources':_0x196e77=>{this['fire']('loadSourceResources',_0x196e77);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new vo(_0x14f187,_0x243096['bodyCollection'],_0x1be42f);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Fo)||document['body'];}['_createBaseBalloonPanel'](_0x497767,_0x50bc75){const _0x345b69=new _0x90b260(_0x497767);return _0x345b69['extendTemplate']({'attributes':{'class':_0x50bc75}}),this['bodyCollection']['add'](_0x345b69),_0x345b69;}['_setBalloonPanelContent'](_0x2b2507,_0x34ec1a,_0x65f576){if(_0x2b2507['content']['clear'](),!_0x65f576['document']['isHidden']&&_0x65f576['document']['enabled']){const _0xcca3d=this['_createBalloonButton'](_0x34ec1a,{'label':i(_0x34ec1a,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x39f310});_0xcca3d['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2b2507['content']['add'](_0xcca3d);}if(_0x65f576['urls']['enabled']){const _0x17e3ac=this['_createBalloonButton'](_0x34ec1a,{'label':i(_0x34ec1a,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x374880});_0x17e3ac['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xo}),this['_urlInputView']['focus']();}),_0x2b2507['content']['add'](_0x17e3ac);}if(_0x65f576['files']['enabled']){const _0x4d6167=new _0x1133e2(_0x34ec1a);_0x4d6167['set']({'label':i(_0x34ec1a,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0xe4569a,'withText':!0x0,'tooltip':!0x0,'class':Uo,'allowMultipleFiles':!0x0}),_0x4d6167['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x4d6167['on']('done',(_0x5b3bcf,_0x3fce17)=>{this['fire']('addFileToContext',_0x3fce17);}),_0x4d6167['tooltip']=!0x0,_0x2b2507['content']['add'](_0x4d6167);}for(const _0x37b46d of _0x65f576['sources']){const _0x233659=this['_createBalloonButton'](_0x34ec1a,{'label':_0x37b46d['label'],'icon':_0x37b46d['icon']||_0x589ec0,'type':'source'});_0x2b2507['content']['add'](_0x233659),_0x233659['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x37b46d,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x43274f of _0x65f576['customItems']||[]){const _0x27ce1c=this['_createBalloonButton'](_0x34ec1a,{'label':_0x43274f['label'],'icon':_0x43274f['icon']||_0x589ec0,'type':'customItem'});_0x2b2507['content']['add'](_0x27ce1c),_0x27ce1c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x43274f);});}this['_hasExactlyOneSource']=0x1===_0x2b2507['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x184b02,_0x28cc3a){this['_urlInputView']=new ko(_0x28cc3a),this['_urlInputView']['on']('submitUrl',(_0x90975e,_0x3314d8)=>{this['_handleUrlSubmit'](_0x3314d8);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xo});}),_0x184b02['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1c663e,_0x25e488){const _0x3b12d3='source'===_0x25e488['type']?new xa(_0x1c663e):new _0x3c2d24(_0x1c663e);return _0x3b12d3['set']({'label':_0x25e488['label'],'icon':_0x25e488['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Uo}),_0x3b12d3;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x579de4({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x296db0){const _0x388027=this['_addContextBalloonConfig'];_0x388027['buttonView']['isOn']=_0x296db0,_0x296db0?_0x388027['balloonView']['show']():_0x388027['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x325e54,buttonView:_0x5d1b85,hideMethod:_0x395585}=this['_addContextBalloonConfig'];_0x579de4({'emitter':_0x325e54,'contextElements':[_0x325e54['element'],_0x5d1b85['element']],'callback':()=>{_0x395585();},'activator':()=>_0x5d1b85['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x3e7935,_0x338ff8,_0x37cea2=!0x1,_0x34bf31=!0x1){const _0x379cb2='conversation'===_0x338ff8||!0x0===_0x3e7935['isReadOnly'],_0xfffc87=new To(this['locale'],_0x3e7935,_0x379cb2,_0x37cea2,_0x34bf31);return _0x379cb2||_0xfffc87['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0xfffc87['id']);}),_0xfffc87;}['_addContextToCollection'](_0x1cf628,_0xba0ba5){_0xba0ba5['add'](_0x1cf628,0x0);}['_removeContextFromCollection'](_0x3d6f04,_0x2a94a1){const _0x4cf4e1=_0x2a94a1['find'](_0x4fe0e9=>_0x4fe0e9['id']===_0x3d6f04);_0x4cf4e1&&_0x2a94a1['remove'](_0x4cf4e1);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x7a0db7){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x7a0db7);}}class xa extends _0x3c2d24{['arrowView'];constructor(_0x120f98){super(_0x120f98),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Lo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2d8619=new _0x4dad4f();return _0x2d8619['content']=_0x281211,_0x2d8619['extendTemplate']({'attributes':{'class':Lo+'__arrow'}}),_0x2d8619;}}class Qe extends _0x2d8061{['_cancelButtonView'];['_loaderView'];constructor(_0x4b618e){super(_0x4b618e),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 _0x303568=new _0x3c2d24(this['locale']);return _0x303568['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0x45c531}),_0x303568['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x303568;}['_createLoaderView'](){const _0x342b9f=new _0x2d8061(this['locale']);return _0x342b9f['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':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x342b9f;}}class bi extends _0x2d8061{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x131071,_0x48fc8d){super(_0x131071),this['_contextPanelView']=this['_createContextPanelView'](_0x131071,{'bodyCollection':_0x48fc8d['bodyCollection'],'searchInputVisibleFrom':_0x48fc8d['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x131071),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x131071),this['_loaderView']=this['_createLoaderView'](_0x131071),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x131071),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'](...Ke)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x4c8d52=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x4c8d52['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x4c8d52['if']('isLoading','ck-hidden',_0xee1580=>_0xee1580||!this['isModelAvailable']),_0x4c8d52['if']('isModelAvailable','ck-hidden',_0xb90e17=>!_0xb90e17||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4c8d52['if']('isLoading','ck-hidden',_0x487679=>!_0x487679)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x4c8d52['if']('isModelAvailable','ck-hidden',_0x5e80c2=>_0x5e80c2)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x579de4({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x5df473,_0x259282){return new Xe(_0x5df473,_0x259282);}['_createPromptInputView'](_0x49b415){return new Pe(_0x49b415,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x3efb31){return new He(_0x3efb31);}['_createLoaderView'](_0x58b357){return new Qe(_0x58b357);}['_createModelUnavailableMessageView'](_0x8216c5){const _0xe95185=new Ye(_0x8216c5);return _0xe95185['delegate']('startConversation')['to'](this),_0xe95185;}['_handlePromptInputFocus'](_0x568ce9,_0x3b0765,_0x336fbb){_0x336fbb?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x344810,_0xa9cd24){this['_contextPanelView']['addContextItem'](_0x344810,_0xa9cd24);}['removeContextItem'](_0x38dd85){this['_contextPanelView']['removeContextItem'](_0x38dd85);}['setContextItemLoading'](_0x375abf,_0x34e974){this['_contextPanelView']['setContextItemLoading'](_0x375abf,_0x34e974);}['setIsUploadInProgress'](_0x97b7d9){this['_promptInputView']['setIsUploadInProgress'](_0x97b7d9);}['setConversationContext'](_0x435fb0){this['_contextPanelView']['setConversationContext'](_0x435fb0);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x60000c,_0x21b6a1,_0xb68179){this['_contextPanelView']['updateResourceState'](_0x60000c,_0x21b6a1,_0xb68179);}['setWebSearch'](_0x5469af){this['_promptCapabilitiesView']['setWebSearch'](_0x5469af);}['setReasoning'](_0x1a3deb){this['_promptCapabilitiesView']['setReasoning'](_0x1a3deb);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x36791f){this['_contextPanelView']['setAddContextOptions'](_0x36791f);}['setInputPlaceholder'](_0x9c43d3){this['_promptInputView']['setPlaceholderText'](_0x9c43d3);}['setModelList'](_0x26ace5,_0x3793f7){this['_promptCapabilitiesView']['setModelList'](_0x26ace5,_0x3793f7);}['setModel'](_0x2eeedc){_0x2eeedc?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2eeedc)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x5dd548){this['_promptCapabilitiesView']['disableModelSelector'](_0x5dd548);}['populateSourceResourceBalloon'](_0x337a1e,_0x15b310,_0x3be38a,_0x2f93af){this['_contextPanelView']['populateSourceResourceBalloon'](_0x337a1e,_0x15b310,_0x3be38a,_0x2f93af);}['closeSourceResourceBalloon'](_0x3fe7b6){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3fe7b6);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class Ye extends _0x2d8061{constructor(_0x48070a){super(_0x48070a);const _0x5e223d=new _0x3c2d24(_0x48070a);_0x5e223d['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5e223d['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x5e223d]}]});}}class Ci extends _0x4b4b8d{['conversationStartButton'];['resizeButton'];constructor(_0x1fd4e3,_0x392b8f){super(_0x1fd4e3,{'label':i(_0x1fd4e3,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':Et}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1fd4e3),this['children']['add'](this['conversationStartButton']),_0x392b8f&&(this['resizeButton']=As(_0x1fd4e3,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x4dbf20){const _0x528936=new _0x3c2d24(_0x4dbf20);return _0x528936['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5b719b,'class':'ck-ai-chat__start-conversation'}),_0x528936['on']('execute',()=>{this['fire']('startConversation');}),_0x528936;}}class xi extends _0x2d8061{constructor(_0x430e53){super(_0x430e53),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x430e53,'AI_DISCLAIMER_TEXT')}]}]});}}class At extends _0x2d8061{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x35abf7,_0xa09ad8){super(_0x35abf7),this['_bodyCollection']=new _0x4bb856(_0x35abf7),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Ci(_0x35abf7,_0xa09ad8['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new ji(_0x35abf7,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new bi(_0x35abf7,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xa09ad8['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new xi(_0x35abf7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x35abf7['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3227e1,_0x437e5a,_0xd00ae3,_0x323900){this['chatControls']['populateSourceResourceBalloon'](_0x3227e1,_0x437e5a,_0xd00ae3,_0x323900);}['closeSourceResourceBalloon'](_0x32dc48){this['chatControls']['closeSourceResourceBalloon'](_0x32dc48);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class it extends _0x47e329{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;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x38d017){super(_0x38d017);const _0x3fc366=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new N(),this['_view']=new At(this['context']['locale'],{'showResizeButton':_0x3fc366['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x269b68,{showDiff:_0x264454})=>{this['showDiff']=_0x264454;}),_0x3fc366['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':Et,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x349c9d=>_0x349c9d),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x5a61c4=>_0x5a61c4),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x37846f){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x37846f['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x7f68d8,staticMessage:_0x2ba974}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x7f68d8,'initialContent':'<p>'+_0x2ba974+'</p>'});}['addFeedItemUserMessage'](_0x3d80ac){const _0x65e4b3=_0x3d80ac['attributes']?.['displayedPrompt']||_0x3d80ac['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x3d80ac['contextItems']['values']()),'initialContent':'<p>'+_0x65e4b3+'</p>','id':_0x3d80ac['id']});}['addFeedItemError']({errorMessage:_0x55434e,id:_0x1914f2}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x55434e+'</p>','id':_0x1914f2});}['addFeedItemAIReply'](_0x6a71c6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x6a71c6['interactionId']+':'+_0x6a71c6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x51debf){const _0x65e8e7=lt(this['context']);let _0x1273fe=_0x65e8e7['config']['get']('ai.availableReplyActions')||[...X];if(_0x65e8e7['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x10f791=_0x65e8e7['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x10f791,'value');}}else _0x1273fe=_0x1273fe['filter'](_0x3d86e8=>'insertSuggestion'!=_0x3d86e8);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x51debf['interactionId']+':'+_0x51debf['id'],'areActionsDisabled':_0x51debf['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x1273fe}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x9abf4c,_0x38440d){const _0x2db12f=this['_view']['chatFeed']['children']['last'];if(_0x2db12f instanceof St)return this['_view']['chatFeed']['children']['remove'](_0x2db12f),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x9abf4c['id'],'capabilities':{'isWebSearchEnabled':_0x2db12f['capabilities']['isWebSearchEnabled']||_0x38440d['isWebSearchEnabled'],'isReasoningEnabled':_0x2db12f['capabilities']['isReasoningEnabled']||_0x38440d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x9abf4c['id'],'capabilities':_0x38440d});}async['addFeedItemCustomElement'](_0x448b2d,_0x1defaf){let _0x129ec4;return await this['_promiseQueue']['enqueue'](async()=>{_0x129ec4=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x448b2d,'id':_0x1defaf});}),_0x129ec4;}['updateFeedInteractionHeader'](_0x37e7ee){const _0x427f47=this['_view']['chatFeed']['children']['find'](_0x48d9be=>_0x48d9be['options']['id']==_0x37e7ee['id']&&_0x48d9be instanceof St);_0x427f47&&_0x427f47['set']('isVisible',_0x37e7ee['isVisible']);}async['updateFeedItemAIReplyContent'](_0x5bc645){const _0x2fa442=_0x5bc645['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x137b5a=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x5bc645,'abortSignal':_0x137b5a,'renderingStrategy':_0x2fa442}),_0x5bc645['isDone']&&this['markFeedItemAsDone'](_0x5bc645['id']);});}['updateFeedItemAIReplySources'](_0x5124d0,_0x3b859d){this['_view']['chatFeed']['updateWebSources'](_0x5124d0,_0x3b859d);}async['updateFeedItemAIReplySuggestionContent'](_0x2ba68b){const _0xbbc84d=_0x2ba68b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x56da6f=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x2ba68b,'abortSignal':_0x56da6f,'renderingStrategy':_0xbbc84d}),_0x2ba68b['isDone']&&this['markFeedItemAsDone'](_0x2ba68b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x403d65){this['_view']['chatFeed']['updateSuggestionPartState'](_0x403d65);}['setFeedItemAIReplySuggestionPartActive'](_0x4c0223){this['_view']['chatFeed']['setSuggestionPartActive'](_0x4c0223);}['markFeedItemAsDone'](_0x4e52a6){this['_view']['chatFeed']['markItemAsDone'](_0x4e52a6);}['removeFeedInteraction'](_0x3bc8a3){this['_view']['chatFeed']['getItemIds']()['filter'](_0x599421=>_0x599421['startsWith'](_0x3bc8a3))['forEach'](_0x43d819=>this['_view']['chatFeed']['removeItem'](_0x43d819));}['startInteraction'](){const _0x357106=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x357106),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xa14dc7){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3dffa0=>_0x3dffa0['startsWith'](_0xa14dc7['id']))['forEach'](_0x182bdc=>this['markFeedItemAsDone'](_0x182bdc)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5ca3a6,_0xe80185){this['_view']['chatControls']['addContextItem'](_0x5ca3a6,_0xe80185);}['removeContextItem'](_0x96e639){this['_view']['chatControls']['removeContextItem'](_0x96e639);}['setContextItemLoading'](_0x583809,_0x276dcb){this['_view']['chatControls']['setContextItemLoading'](_0x583809,_0x276dcb);}['setIsUploadInProgress'](_0x2db0d3){this['_view']['chatControls']['setIsUploadInProgress'](_0x2db0d3);}['setConversationContext'](_0x5ae674){this['_view']['chatControls']['setConversationContext'](_0x5ae674);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x4d6e6c,_0x57c860,_0x5043e2){this['_view']['chatControls']['updateResourceState'](_0x4d6e6c,_0x57c860,_0x5043e2);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x4dcc06){this['_view']['chatControls']['setAddContextOptions'](_0x4dcc06);}['updateCapabilities'](_0x2d84da){this['_view']['chatControls']['setWebSearch'](_0x2d84da['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2d84da['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2d84da));}['setSelectedModel'](_0x1df46c,_0x297f67){this['_view']['chatControls']['setModel'](_0x1df46c),_0x297f67&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x5de7a3){this['feedItemRenderingStrategy']=_0x5de7a3;}['toggleLoadingSkeleton'](_0x21c86d){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x21c86d);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x415220,_0x4f4752=!0x1){if(_0x4f4752&&!mt()&&_0x415220['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x415220);this['_view']['chatHeader']['label']=_0x415220;}['setLoadingMessage'](_0x4ee089){this['_view']['chatFeed']['setLoadingMessage'](_0x4ee089);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x27a6b1){let _0x411c47=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x27a6b1[_0x411c47],_0x411c47++,_0x411c47===_0x27a6b1['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x5ef08a){this['_view']['chatHeader']['isMaximized']=_0x5ef08a;}['prepareLoadingMessage'](_0x1a9437){return _0x1a9437['isWebSearchEnabled']&&_0x1a9437['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x1a9437['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x1a9437['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x46de0f){return _0x46de0f?_0x46de0f['isWebSearchEnabled']&&_0x46de0f['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x46de0f['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x46de0f['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0xfa7243,_0x1bfb57,_0xd883c1,_0x1fae25){this['_view']['populateSourceResourceBalloon'](_0xfa7243,_0x1bfb57,_0xd883c1,_0x1fae25);}['closeSourceResourceBalloon'](_0x314375){this['_view']['closeSourceResourceBalloon'](_0x314375);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x3d9d12,_0x2f3e1b){this['_view']['chatFeed']['scrollToSuggestion'](_0x3d9d12,_0x2f3e1b);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Mi extends _0x366e5d{['sections'];constructor(_0xedcf38,_0x357f07){super(_0xedcf38),this['sections']=_0x357f07,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x131ad6){let _0x388a13=0x0,_0x1f4fdc=0x0;for(const _0x229e48 of this['sections']){const {resultsCount:_0x4954bf,totalItemsCount:_0x154aaf}=_0x229e48['filter'](_0x131ad6);_0x388a13+=_0x4954bf,_0x1f4fdc+=_0x154aaf;}return{'resultsCount':_0x388a13,'totalItemsCount':_0x1f4fdc};}}class Li extends _0x8f7dd0{['title'];['itemsViews'];['_itemsListView'];constructor(_0x90d941,{title:_0x3f93dd,items:_0x4cb49f}){super(_0x90d941);const _0x3f1840=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3f93dd,this['itemsViews']=_0x4cb49f;const _0x12ab50=new _0x2d8061(_0x90d941);_0x12ab50['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x366e5d(_0x90d941),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x3f1840['if']('isVisible','ck-hidden',_0x491fe2=>!_0x491fe2)]},'children':[_0x12ab50,this['_itemsListView']]});}['filter'](_0x2c1f4f){const _0x42143d=this['itemsViews']['length'];let _0x43c9ca=0x0;for(const _0x424749 of this['itemsViews']){if(_0x2c1f4f){const _0x4fb7e8=_0x424749['isMatching'](_0x2c1f4f);_0x424749['isVisible']=!!_0x4fb7e8,_0x424749['highlightText'](_0x2c1f4f);}else _0x424749['isVisible']=!0x0,_0x424749['highlightText'](null);_0x424749['isVisible']&&_0x43c9ca++;}return this['isVisible']=_0x43c9ca>0x0,{'resultsCount':_0x43c9ca,'totalItemsCount':_0x42143d};}['getItem'](_0x16e72f){return this['itemsViews']['find'](_0x5968ee=>_0x5968ee['id']===_0x16e72f);}['removeItem'](_0x48c3cb){const _0x3d8aa5=this['itemsViews']['indexOf'](_0x48c3cb);-0x1!==_0x3d8aa5&&(this['itemsViews']['splice'](_0x3d8aa5,0x1),this['_itemsListView']['items']['remove'](_0x48c3cb));}}class Yi extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x16284c(_0x8f7dd0){['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(_0x471f9c,_0x3b10f6){super(_0x471f9c);const _0x19bba3=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3b10f6['pinned']),this['set']('loadingState',null),this['id']=_0x3b10f6['id'];const {title:_0x33e388,createdAt:_0x4d81d6,active:_0x2a76c4=!0x1}=_0x3b10f6;this['_titleView']=new _0x5027dd(),this['_titleView']['text']=_0x33e388,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1ad90c=this['_createCheckView'](),_0x3de09a=this['_createPinButtonView'](_0x471f9c),_0x5070b1=this['_createMenuDropdownView'](),_0x4c0fae=this['_createEditInputView'](_0x471f9c,_0x33e388),_0x5946b3=this['_createAcceptEditButtonView'](_0x471f9c,_0x4c0fae),_0x41cfc3=this['_createCancelEditButtonView'](_0x471f9c,_0x4c0fae);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3de09a),this['actions']['add'](_0x5070b1),this['on']('change:isEdit',(_0x552ed5,_0x2bc62f,_0x2c870e)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2c870e?(this['actions']['add'](_0x5946b3),this['actions']['add'](_0x41cfc3),this['mainContent']['add'](_0x4c0fae),_0x4c0fae['element']['focus']()):(this['actions']['add'](_0x3de09a),this['actions']['add'](_0x5070b1),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2a76c4?'ck-ai-chat-history__item--active':'',_0x19bba3['if']('isVisible','ck-hidden',_0x12f13e=>!_0x12f13e),_0x19bba3['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',_0x19bba3['if']('loadingState','ck-hidden',_0x21929e=>!!_0x21929e)]},'children':_0x2a76c4?[_0x1ad90c]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x19bba3['if']('loadingState','ck-hidden',_0x1c4335=>!_0x1c4335)]},'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',_0x19bba3['if']('loadingState','ck-hidden',_0x94f20b=>!!_0x94f20b)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x19bba3['if']('loadingState','ck-hidden',_0x56ccf2=>!_0x56ccf2)]},'children':[{'text':_0x19bba3['to']('loadingState',_0x3f133e=>_0x3f133e?i(this['locale'],Yi['LOADING_LABELS'][_0x3f133e]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4d81d6]}]},{'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'](_0x7b2953){this['_titleView']['text']=_0x3bf51a(_0x7b2953);}['updateLoadingState'](_0x3013b1,_0x45b821){this['set']('loadingState',_0x45b821?_0x3013b1:null);}['_createCheckView'](){const _0x3c3030=new _0x4dad4f();return _0x3c3030['set']({'content':_0x35b8d8}),_0x3c3030;}['_createPinButtonView'](_0x5244c0){const _0x3ee338=new _0x3c2d24(_0x5244c0);return _0x3ee338['set']({'label':i(_0x5244c0,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x519981,'withText':!0x1,'tooltip':!0x0}),_0x3ee338['bind']('isOn')['to'](this,'pinned'),_0x3ee338['on']('execute',()=>{const _0x1a9de8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x1a9de8});}),_0x3ee338;}['_createMenuDropdownView'](){const _0x221f81=_0x59c3f3(this['locale'],_0x44802b),_0x568c99=_0x221f81['panelView']['children'];_0x221f81['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x1f6141}),_0x221f81['panelPosition']='sw';const _0x360b47=new _0x3c2d24(this['locale']);_0x360b47['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x360b47['withText']=!0x0,_0x360b47['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3cf241=new _0x3c2d24(this['locale']);_0x3cf241['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3cf241['withText']=!0x0,_0x3cf241['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x58711a=new _0x366e5d(this['locale']),_0x1fafec=new _0x8f7dd0(this['locale']);_0x1fafec['children']['add'](_0x360b47);const _0x20adf3=new _0x8f7dd0(this['locale']);return _0x20adf3['children']['add'](_0x3cf241),_0x58711a['items']['addMany']([_0x1fafec,_0x20adf3]),_0x568c99['add'](_0x58711a),_0x221f81;}['_createEditInputView'](_0x315435,_0xd55b1){const _0x2646e4=new _0x5d3204(_0x315435),_0x25403d=_0x2646e4['bindTemplate'];return _0x2646e4['value']=_0xd55b1,_0x2646e4['extendTemplate']({'on':{'keydown':_0x25403d['to'](_0x17aedf=>{'Enter'==_0x17aedf['key']&&this['_commitEditInputValue'](_0x2646e4);})}}),_0x2646e4;}['_createAcceptEditButtonView'](_0x58dd2c,_0x502d1c){const _0x17a848=new _0x3c2d24(_0x58dd2c);return _0x17a848['set']({'icon':_0x35b8d8,'withText':!0x1,'tooltip':i(_0x58dd2c,'AI_CHAT_HISTORY_ACCEPT')}),_0x17a848['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x17a848['on']('execute',()=>{this['_commitEditInputValue'](_0x502d1c);}),_0x17a848;}['_commitEditInputValue'](_0x549b27){const _0x460b1b=_0x549b27['element']['value']||'';this['_titleView']['text']=_0x460b1b,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x460b1b});}['_createCancelEditButtonView'](_0x37456c,_0x2ec2d8){const _0x4bb986=new _0x3c2d24(_0x37456c);return _0x4bb986['set']({'icon':_0x2d25cb,'withText':!0x1,'tooltip':i(_0x37456c,'AI_CHAT_HISTORY_CANCEL')}),_0x4bb986['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4bb986['on']('execute',()=>{this['isEdit']=!0x1,_0x2ec2d8['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4bb986;}['_createSpinnerView'](){const _0x4ef833=new ki('tiny');return _0x4ef833['isVisible']=!0x0,_0x4ef833;}['isMatching'](_0x36d0fd){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x36d0fd)?{'title':!0x0}:null;}['highlightText'](_0xa4f4d8){this['_titleView']['highlightText'](_0xa4f4d8);}}class Nt extends _0x2d8061{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1aa3a4,_0x1bc57b){super(_0x1aa3a4),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x2fe859=new _0x4b4b8d(_0x1aa3a4,{'label':i(_0x1aa3a4,'AI_CHAT_HISTORY_HEADING'),'icon':vt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x1bc57b&&(this['resizeButton']=As(_0x1aa3a4,this),_0x2fe859['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x1aa3a4,[]),this['sectionsView']['delegate'](...Di)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x4b1020=>!_0x4b1020)]}}),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':[_0x2fe859,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0xfa760d=new _0x1e3f51(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x14da16=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x14da16),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0xf98178=this['_createErrorView']();return _0xf98178['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x40d520=>!_0x40d520)]}}),_0xfa760d['on']('render',()=>{_0xfa760d['children']['add'](_0xf98178,0x1);}),_0xfa760d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x30ce6d=>!_0x30ce6d)]}}),_0xfa760d;}['_createSkeletonView'](){const _0x3c74ef=new fi(this['locale'],wi['aiHistory']);return _0x3c74ef['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x19aaaf=>!_0x19aaaf)]}}),_0x3c74ef;}['_createErrorView'](){const _0x47968c=new _0x2d8061(this['locale']),_0x49ddd0=new _0x3c2d24(this['locale']);_0x49ddd0['set']({'withText':!0x1,'icon':_0x2d25cb,'class':'ck-ai-notification_error__dismiss-button'}),_0x49ddd0['bind']('isVisible')['to'](this,'hasItems',_0x4dc57d=>!!_0x4dc57d),_0x49ddd0['on']('execute',()=>{this['errorMessage']='';});const _0x5dc9b2=this['bindTemplate'];return _0x47968c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5dc9b2['to']('errorMessage')}]},_0x49ddd0]}),_0x47968c;}['_createEmptyStateView'](){const _0x5dbe39=new _0x3c2d24(this['locale']);_0x5dbe39['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5b719b,'class':'ck-ai-chat__start-conversation'}),_0x5dbe39['on']('execute',()=>{this['fire']('openChat');});const _0x403265=new _0x2d8061(this['locale']);return _0x403265['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x217b77=>!_0x217b77)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x5dbe39]}),_0x403265;}['_createListItemViews'](_0x41596b,_0x41e6f8){const _0x9a27fe=[];for(const _0x2f27cc of _0x41596b){const _0x1aee85=new Yi(_0x41e6f8,_0x2f27cc);_0x1aee85['delegate'](...Di)['to'](this),_0x9a27fe['push'](_0x1aee85);}return _0x9a27fe;}['updateHistoryItemsWithCategories'](_0x4812b3){const _0x4da7d1=this['locale']||'en',_0xeb5b1f=[];for(const _0x532f1f of _0x4812b3){const _0x525b36=this['_createListItemViews'](_0x532f1f['items'],_0x4da7d1);_0xeb5b1f['push'](new Li(_0x4da7d1,{'title':_0x532f1f['title'],'items':_0x525b36}));}this['sectionsView']['sections']=_0xeb5b1f,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0xeb5b1f),this['hasItems']=_0x4812b3['some'](_0x2b3748=>_0x2b3748['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x11688a){for(const _0x55f2cd of this['sectionsView']['sections']){const _0x42d739=_0x55f2cd['getItem'](_0x11688a);if(_0x42d739){if(_0x55f2cd['removeItem'](_0x42d739),0x0===_0x55f2cd['itemsViews']['length']){const _0x4c82ba=this['sectionsView']['sections']['indexOf'](_0x55f2cd);-0x1!==_0x4c82ba&&(this['sectionsView']['sections']['splice'](_0x4c82ba,0x1),this['sectionsView']['items']['remove'](_0x55f2cd));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x87fade,_0x5090e9){for(const _0x3284e7 of this['sectionsView']['sections']){const _0x2daf8a=_0x3284e7['getItem'](_0x87fade);if(_0x2daf8a){_0x2daf8a['updateTitle'](_0x5090e9);break;}}}['updateItemLoadingState'](_0x58675b,_0x189599,_0x4e34c7){for(const _0xa560b2 of this['sectionsView']['sections']){const _0x7d4a3e=_0xa560b2['getItem'](_0x58675b);if(_0x7d4a3e){_0x7d4a3e['updateLoadingState'](_0x189599,_0x4e34c7);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x53d2e6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x53d2e6);}}}const Di=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x47e329{static get['requires'](){return[ht];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d0529){super(_0x4d0529);const _0x3f0354=this['context']['plugins']['get']('AITabs');this['_historyView']=new Nt(this['context']['locale'],_0x3f0354['showResizeButton']),this['_historyView']['delegate'](...Di)['to'](this),_0x3f0354['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':vt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xc5c57e){this['_historyView']['removeHistoryItem'](_0xc5c57e);}['updateItems'](_0x3d205e){this['_historyView']['updateHistoryItemsWithCategories'](_0x3d205e);}['updateItemTitle'](_0x3ddc11,_0xd590d6){this['_historyView']['updateItemTitle'](_0x3ddc11,_0xd590d6);}['updateItemLoadingState'](_0x19a94e,_0x469d11,_0x49077c){this['_historyView']['updateItemLoadingState'](_0x19a94e,_0x469d11,_0x49077c);}['setLoadingSkeleton'](_0x259601){this['_historyView']['isLoading']=_0x259601;}['showError'](_0x15f84c){this['_historyView']['errorMessage']=_0x15f84c;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x51afca){this['_historyView']['isMaximized']=_0x51afca;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x38bb28,title:_0x139bf9,createdAt:_0x15ccaf,updatedAt:_0x3849b0,pinned:_0xaae5ea}){super(),this['id']=_0x38bb28,this['createdAt']=new Date(_0x15ccaf),this['set']('title',_0x139bf9),this['set']('updatedAt',_0x3849b0?new Date(_0x3849b0):null),this['set']('pinned',_0xaae5ea||!0x1);}['updateTitle'](_0xc79254){this['set']('title',_0x3bf51a(_0xc79254)),this['updatedAt']=new Date();}['updatePinned'](_0x51abc6){this['set']('pinned',_0x51abc6),this['updatedAt']=new Date();}}class Ht extends Wt(){['items']=[];['connector'];['group'];constructor({connector:_0x22b483,group:_0x1eb421}){super(),this['connector']=_0x22b483,this['group']=_0x1eb421;}async['init'](){try{const _0x4f7859=this['connector']['fetchConversations'](this['group']),_0x580b41=await _0x4f7859['getConversations']();this['loadItems'](_0x580b41);}catch(_0x43bd5b){this['fire']('error',{'error':_0x43bd5b,'operation':'init'});}}['addItem'](_0x534f82){this['items']['push'](_0x534f82);}async['removeItem'](_0x1a7b63){const _0x32f86d=this['items']['findIndex'](_0xa35a4f=>_0xa35a4f['id']===_0x1a7b63);if(-0x1===_0x32f86d)return!0x1;try{return await this['connector']['deleteConversation'](_0x1a7b63)['execute'](),this['items']['splice'](_0x32f86d,0x1),this['fire']('itemRemoved',{'itemId':_0x1a7b63}),!0x0;}catch(_0x4d8bd1){return this['fire']('error',{'error':_0x4d8bd1,'operation':'removeItem','itemId':_0x1a7b63}),!0x1;}}['getItem'](_0x49f278){return this['items']['find'](_0x1163e4=>_0x1163e4['id']===_0x49f278);}async['updateItemTitle'](_0x50aae8,_0x1868c1){const _0x3839e1=this['getItem'](_0x50aae8);if(!_0x3839e1)return!0x1;try{return await this['connector']['updateConversation'](_0x50aae8,{'title':_0x1868c1})['getResult'](),_0x3839e1['updateTitle'](_0x1868c1),this['fire']('itemUpdated',{'itemId':_0x50aae8,'updates':{'title':_0x1868c1}}),!0x0;}catch(_0x2042a4){return this['fire']('error',{'error':_0x2042a4,'operation':'updateItemTitle','itemId':_0x50aae8}),!0x1;}}async['updateItemPinned'](_0x3a8cc2,_0xc5fa50){const _0xa4c129=this['getItem'](_0x3a8cc2);if(!_0xa4c129)return!0x1;try{return await this['connector']['updateConversation'](_0x3a8cc2,{'pinned':_0xc5fa50})['getResult'](),_0xa4c129['updatePinned'](_0xc5fa50),this['fire']('itemUpdated',{'itemId':_0x3a8cc2,'updates':{'pinned':_0xc5fa50}}),!0x0;}catch(_0x5a364b){return this['fire']('error',{'error':_0x5a364b,'operation':'updateItemPinned','itemId':_0x3a8cc2}),!0x1;}}['loadItems'](_0x41aff9){try{this['items']=[],_0x41aff9['map'](_0x934964=>{this['addItem'](new ir(_0x934964));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x19691d){this['fire']('error',{'error':_0x19691d,'operation':'loadItems'});}}['getItems'](_0x22555f={}){const _0x4a7f91=void 0x0!==_0x22555f['pinned']&&_0x22555f['pinned'],_0x15c20e=_0x22555f['from']?new Date(_0x22555f['from']['getFullYear'](),_0x22555f['from']['getMonth'](),_0x22555f['from']['getDate']()):null,_0xd83112=_0x22555f['to']?new Date(_0x22555f['to']['getFullYear'](),_0x22555f['to']['getMonth'](),_0x22555f['to']['getDate']()):null;return this['items']['filter'](_0x29d4ed=>{if(_0x29d4ed['pinned']!==_0x4a7f91)return!0x1;if(_0xd83112){const _0x1ff7c7=new Date(_0x29d4ed['createdAt']['getFullYear'](),_0x29d4ed['createdAt']['getMonth'](),_0x29d4ed['createdAt']['getDate']());return _0x15c20e?_0x15c20e['getTime']()===_0xd83112['getTime']()?_0x1ff7c7['getTime']()===_0x15c20e['getTime']():_0x1ff7c7<_0xd83112&&_0x1ff7c7>=_0x15c20e:_0x1ff7c7<_0xd83112;}return!0x0;});}}class yt extends _0x47e329{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[S,tt,jt,ht];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](S),this['_aiChatHistoryUi']=this['context']['plugins']['get'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0x3f7806=this['context']['plugins']['get'](ht);try{const _0x19a44f=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x19a44f}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3917c7,_0x48ef6b)=>{this['_setItemLoading'](_0x48ef6b['id'],'remove'),this['_handleRemove'](_0x48ef6b['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0xeadd8,_0x3abfb5)=>{this['_setItemLoading'](_0x3abfb5['id'],'rename'),this['_handleEditTitle'](_0x3abfb5['id'],_0x3abfb5['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1f53e0,_0x16591a)=>{void 0x0!==_0x16591a['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x16591a['itemId'],_0x16591a['updates']['title']),void 0x0!==_0x16591a['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x16591a['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x2f0ba3,_0x48c8f6)=>{this['_aiChatController']['handleRemovedConversation'](_0x48c8f6['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x48c8f6['itemId']),this['_clearItemLoading'](_0x48c8f6['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3a012f,_0x44391e)=>{this['_handleHistoryErrorUI'](_0x44391e['error'],_0x44391e['operation'],_0x44391e['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x1c114c,_0x2fb0cc)=>{this['_handleSelectConversation'](_0x2fb0cc['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4156e4,_0x5b025a)=>{const _0x3025f5=_0x5b025a['pinned']?'pin':'unpin';this['_setItemLoading'](_0x5b025a['id'],_0x3025f5),this['_handleTogglePin'](_0x5b025a['id'],_0x5b025a['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3f7806['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3f7806['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3f7806,'resizedTabs',(_0xc70fee,_0x3037e6)=>{this['_setIsMaximized'](_0x3037e6);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3f7806['resize']();});}catch(_0x330345){this['_handleHistoryErrorUI'](_0x330345,'init');}}async['_handleEditTitle'](_0xcada9,_0x59c0c4){await this['history']['updateItemTitle'](_0xcada9,_0x59c0c4);}async['_handleTogglePin'](_0x1693f7,_0x347097){await this['history']['updateItemPinned'](_0x1693f7,_0x347097);}async['_handleRemove'](_0x27202b){await this['history']['removeItem'](_0x27202b);}async['_handleSelectConversation'](_0x1c9844){await this['_aiChatController']['loadConversation'](_0x1c9844);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2c669c=this['_aiChatController']['activeConversation']?.['id'],_0x48676b=this['_getCategorizedItems']()['map'](_0x5baa3b=>({'title':_0x5baa3b['title'],'items':_0x5baa3b['items']['map'](_0x37646c=>({'id':_0x37646c['id'],'title':_0x37646c['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x37646c['createdAt'])['toLocaleDateString'](),'active':_0x37646c['id']===_0x2c669c,'pinned':_0x37646c['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x48676b);}['_setItemLoading'](_0x5731d6,_0x503e10){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5731d6,_0x503e10,!0x0);}['_clearItemLoading'](_0x380485){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x380485,null,!0x1);}['_handleHistoryErrorUI'](_0x3320d7,_0x1db6fa,_0x37bee5){const _0x44bbc0=this['_generateErrorMessage'](_0x1db6fa,_0x37bee5);this['_aiChatHistoryUi']['showError'](_0x44bbc0),_0x37bee5&&this['_clearItemLoading'](_0x37bee5),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x3c44d6,_0x19361b){const _0x2bc836=_0x19361b?this['history']['getItem'](_0x19361b):null,_0x3d66fa=_0x2bc836?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x3c44d6){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3d66fa);case'updateItemPinned':{const _0x4f3ca9=i(this['context']['locale'],_0x2bc836?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4f3ca9,_0x3d66fa]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3d66fa);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xc80e03=new Date(),_0x44e55e=new Date(_0xc80e03['getFullYear'](),_0xc80e03['getMonth'](),_0xc80e03['getDate']()),_0x53601f=new Date(_0x44e55e);_0x53601f['setDate'](_0x53601f['getDate']()-0x1);const _0x3b5fe8=new Date(_0x44e55e);_0x3b5fe8['setDate'](_0x3b5fe8['getDate']()-0xe);const _0x322f37=this['history']['getItems']({'pinned':!0x0}),_0x5d4c15=this['history']['getItems']({'from':_0x44e55e,'to':_0x44e55e}),_0x564aee=this['history']['getItems']({'from':_0x53601f,'to':_0x53601f}),_0x545147=this['history']['getItems']({'from':_0x3b5fe8,'to':_0x53601f}),_0x21c17e=this['history']['getItems']({'to':_0x3b5fe8}),_0x347568=[];return _0x322f37['length']>0x0&&_0x347568['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x322f37}),_0x5d4c15['length']>0x0&&_0x347568['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x5d4c15}),_0x564aee['length']>0x0&&_0x347568['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x564aee}),_0x545147['length']>0x0&&_0x347568['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x545147}),_0x21c17e['length']>0x0&&_0x347568['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x21c17e}),_0x347568;}['_setIsMaximized'](_0xf4cac7){this['_aiChatHistoryUi']['setIsMaximized'](_0xf4cac7);}}class et extends _0x47e329{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class La extends _0x47e329{static get['requires'](){return[tt,D,it,et];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5617f1){super(_0x5617f1),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0xa17cb2,attributes:_0x484b70}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0xa17cb2,'attributes':_0x484b70});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}['registerToolDataCallback'](_0x39d9f3){this['context']['plugins']['get'](tt)['_registerToolDataCallback'](_0x39d9f3);}}class co extends Qt{constructor(_0x450742){super(_0x450742);const _0x390f08=_0x450742['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x390f08,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x5d415c=this['editor']['plugins']['get']('AITabs')['view'];_0x5d415c['isVisible']=!_0x5d415c['isVisible'];}}class Pt extends _0x539ee4{static get['requires'](){return[ht];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3fa568=this['editor'];_0x3fa568['commands']['add']('toggleAi',new co(_0x3fa568)),_0x3fa568['ui']['componentFactory']['add']('toggleAi',()=>{const _0x269182=this['_createAIUIButton'](_0x3c2d24);return _0x269182['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x269182;}),_0x3fa568['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x10d508=this['_createAIUIButton'](_0x215c67);return _0x10d508['set']({'role':'menuitemcheckbox'}),_0x10d508;});}['_createAIUIButton'](_0x367159){const _0x56a05c=this['editor'],_0x192d2a=_0x56a05c['commands']['get']('toggleAi'),_0x4ca2c5=new _0x367159(_0x56a05c['locale']);return _0x4ca2c5['set']({'label':i(_0x56a05c['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x21e5a5,'isToggleable':!0x0}),_0x4ca2c5['bind']('isEnabled')['to'](_0x192d2a),_0x4ca2c5['bind']('isOn')['to'](_0x192d2a,'value',_0x2fada5=>!!_0x2fada5),this['listenTo'](_0x4ca2c5,'execute',()=>{_0x192d2a['execute']();}),_0x4ca2c5;}}const kt=['applySuggestion','insertSuggestion','showNext','showPrevious'];class ls extends _0x2d8061{['_errorView'];constructor(_0x48c833){super(_0x48c833),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0xae32ef){this['showError'](_0xae32ef);}['showError'](_0x4a0cb8){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4a0cb8,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x4675d9=new _0x2d8061(this['locale']),_0x5f0180=new _0x2d8061(this['locale']);return _0x5f0180['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4675d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2c3f90=>!_0x2c3f90)]},'children':[_0x5f0180]}),_0x4675d9;}}const wt=0xa;class P extends _0x47e329{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x143978){const {id:_0x2dd6ff}=this['_currentConfig']??{};this['_currentConfig']=_0x143978;const {id:_0x599130}=this['_currentConfig'];this['isOpen']&&_0x2dd6ff===_0x599130?this['_updateDialog']():this['_showDialog']();}['close'](){lt(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateDialog'](){const _0x48ffb0=lt(this['context'])['plugins']['get']('Dialog'),{icon:_0x3718b1,title:_0x4e345c}=this['_currentConfig'];_0x48ffb0['view']?.['headerView']&&(_0x48ffb0['view']['headerView']['label']=_0x4e345c,_0x48ffb0['view']['headerView']['iconView']&&_0x3718b1&&(_0x48ffb0['view']['headerView']['iconView']['content']=_0x3718b1)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x48ffb0['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x133b78){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x133b78);}['_showDialog'](){const _0x37df99=lt(this['context'])['plugins']['get']('Dialog'),{id:_0x5b13f9,title:_0x360262,icon:_0xe04f11,class:_0x31320a,mainView:_0x1e31b4}=this['_currentConfig'];_0x1e31b4['delegate'](...kt)['to'](this),_0x37df99['show']({'title':_0x360262,'icon':_0xe04f11,'hasCloseButton':!0x0,'id':_0x5b13f9,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x31320a||''),'content':_0x1e31b4,'onShow':_0x42723c=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x4b5880=this['_getSelectionElements']();_0x4b5880&&_0x4b5880[0x0]&&at({'target':_0x4b5880[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x42723c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x5b13f9});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x5b13f9}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x53decd,_0x3cec41){if(!_0x3cec41)return null;const _0x8fc2b5=this['_getSelectionElements']();if(!_0x8fc2b5||0x0===_0x8fc2b5['length'])return{'left':Math['round'](_0x3cec41['left']+_0x3cec41['width']/0x2-_0x53decd['width']/0x2),'top':Math['round'](_0x3cec41['top']+_0x3cec41['height']/0x2-_0x53decd['height']/0x2)};const _0x315ab5=Math['round'](_0x3cec41['left']+_0x3cec41['width']/0x2-_0x53decd['width']/0x2),_0x452194=_0x8fc2b5['map'](_0x3b49f3=>new bt(_0x3b49f3)),_0x1c25ea=_0x53decd['height'];return{'left':_0x315ab5,'top':this['_calculateOptimalTopPosition'](_0x452194,_0x1c25ea,_0x3cec41)};}['_calculateOptimalTopPosition'](_0x2e08e3,_0x160497,_0x331a1d){const _0x3d5316=new bt(Ot['window']),_0x2bf42c=_0x2e08e3['map'](_0xedf665=>_0xedf665['getVisible']())['filter'](_0x2a9037=>_0x2a9037),_0x4c4999=bt['getBoundingRect'](_0x2bf42c);if(!_0x4c4999)return Math['round'](_0x331a1d['top']+_0x331a1d['height']/0x2);const _0x382c71=_0x3d5316['getIntersection'](_0x4c4999);if(!_0x382c71)return Math['round'](_0x331a1d['top']+_0x331a1d['height']/0x2);const _0x456f64=_0x331a1d['getVisible'](),_0x2ddcc6=_0x456f64&&_0x4c4999['height']>_0x456f64['height'],_0x66e85a=_0x382c71['top'],_0x504d89=_0x382c71['bottom'];if(_0x2ddcc6){const _0x1513cd=(_0x456f64||_0x3d5316)['height']/0x2-_0x160497/0x2,_0x227c72=_0x66e85a-wt-_0x331a1d['top'],_0x4549e4=_0x331a1d['bottom']-_0x504d89-wt;return _0x227c72>=_0x160497?Math['max'](wt,_0x66e85a-_0x160497-wt):_0x4549e4>=_0x160497?_0x504d89+wt:Math['max'](wt,_0x1513cd);}const _0x445ccd=_0x66e85a-_0x160497,_0x407f63=_0x331a1d['bottom']-_0x504d89-wt,_0x1946d0=_0x66e85a-wt-_0x331a1d['top'];let _0xfa79a;if(_0x407f63>=_0x160497)_0xfa79a=_0x504d89+wt;else{if(_0x1946d0>=_0x160497)_0xfa79a=_0x445ccd-wt;else _0xfa79a=_0x66e85a+_0x4c4999['height']/0x2-_0x160497/0x2;}return _0xfa79a;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x115e59=lt(this['context']);this['listenTo'](_0x115e59['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x2ec25a,data:{newRange:_0x34c216}}of _0x115e59['model']['document']['differ']['getChangedMarkers']())if(_0x2ec25a['startsWith'](F+':')&&(_0x34c216&&(_0x34c216['start']['isEqual'](_0x34c216['end'])||'$graveyard'==_0x34c216['root']['rootName'])||null==_0x34c216)){const _0x4befa0=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4befa0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x238389=lt(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x238389['model']['document']);}['_getSelectionElements'](){const _0x518a5e=lt(this['context']);return Mt(_0x518a5e['editing'],[..._0x518a5e['model']['markers']['getMarkersGroup']('ai-selection'),..._0x518a5e['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class us extends _0x2cc502{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3d8657,_0x4ccc3a={}){super(_0x3d8657),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x4ccc3a};const _0x4ea39f=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x4ea39f?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x39f97d){this['showChangesButton']['isEnabled']=_0x39f97d;}['_setupRatingButtons'](){this['likeButton']=new _0x3c2d24(this['locale']),this['likeButton']['set']({'icon':_0xd29c90,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x3c2d24(this['locale']),this['dislikeButton']['set']({'icon':_0x29cd06,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x3c2d24(this['locale']),this['copyButton']['set']({'icon':_0x437de3,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x5e5800=new _0x4dad4f();_0x5e5800['set']({'content':_0x2c4a04}),_0x5e5800['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'](_0x5e5800);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x3c2d24(this['locale']),this['showChangesButton']['set']({'icon':_0x47c031,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges']}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x24804d=>_0x24804d?_0x4cd1c0:_0x47c031),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class st extends ls{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x519dbf,_0x3f587b){super(_0x519dbf);const _0x299fc8=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x59aa0e(),this['_keystrokes']=new _0x151440(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2427c3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x3f587b,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new as(_0x519dbf),this['_partToolbarView']=new cs(_0x519dbf,_0x3f587b['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x3f587b),this['_stateView']=new ps(_0x519dbf),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new us(_0x519dbf,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x519dbf,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x687be5,_0x16d512,_0xc923fa,_0x1f3476)=>{let _0x35cf82,_0x56d6e7;'pending'===_0x1f3476?(_0x35cf82=this['_partToolbarView'],_0x56d6e7=this['_stateView']):(_0x35cf82=this['_stateView'],_0x56d6e7=this['_partToolbarView']),this['_stateView']['setState'](_0xc923fa),_0x35cf82['isVisible']=!0x1,_0x56d6e7['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x299fc8['to']('_state',_0x1b9070=>'ck-ai-chat-balloon-main_state_'+_0x1b9070)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x3f587b);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x4c2e77){_0x4c2e77?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x4c2e77);}['setState'](_0xab8a81){this['_state']=_0xab8a81;}['showError'](_0x5b4504){super['showError'](_0x5b4504),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x422d43){super['showBlockingError'](_0x422d43),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x2d45b7){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x2d45b7;}['togglePartToolbarEnabled'](_0x1a1367){this['_partToolbarView']['isEnabled']=_0x1a1367;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x597eb3,showSuggestButton:_0x1a3b41}){_0x597eb3=_0x597eb3&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1a3b41=_0x1a3b41&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x597eb3,'showSuggestButton':_0x1a3b41});}['_createNextButtonView'](){const _0x89f6bf=new _0x3c2d24(this['locale']);return _0x89f6bf['set']({'icon':_0x23375e,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x89f6bf['on']('execute',()=>{this['fire']('showNext');}),_0x89f6bf;}['_createPreviousButtonView'](){const _0x5b81fb=new _0x3c2d24(this['locale']);return _0x5b81fb['set']({'icon':_0x4dacc1,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x5b81fb['on']('execute',()=>{this['fire']('showPrevious');}),_0x5b81fb;}}class fs extends _0x2d8061{constructor(_0x51077a,_0x18017a){super(_0x51077a),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x18017a});}}class xt extends _0x539ee4{static get['requires'](){return[_0x15fff9,P];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x5f5e0f){super(_0x5f5e0f),this['set']('showDiff',!0x1);}['open'](_0x21afa7){const _0x33c5a8=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x33c5a8['plugins']['get']('AIBalloon')['open']({..._0x21afa7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x21afa7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x21afa7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x1437c9){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x1437c9);}['setState'](_0x2b3457){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x2b3457);}['_createChatBalloonView'](){const _0x4a424a=this['editor'],_0x4a7777=_0x4a424a['plugins']['get']('AIBalloon'),_0x25907c=_0x4a424a['commands']['get']('trackChanges');let _0x14c1e1=_0x4a424a['config']['get']('ai.availableReplyActions')||[...X];_0x4a424a['plugins']['has']('TrackChanges')||(_0x14c1e1=_0x14c1e1['filter'](_0x3116bf=>'insertSuggestion'!=_0x3116bf));const _0x339ba8=new st(_0x4a424a['locale'],{'availableActions':_0x14c1e1,'showApplyButton':!0x0,'showSuggestButton':!!_0x25907c});return _0x339ba8['bind']('showDiff')['to'](this),_0x339ba8['delegate'](...ot)['to'](this),_0x339ba8['delegate']('showPrevious','showNext')['to'](this),_0x4a7777['delegate']('dialogClosed')['to'](this),_0x339ba8['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x339ba8['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x339ba8['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x25907c&&_0x339ba8['bind']('isTrackChangesOn')['to'](_0x25907c,'value'),_0x339ba8['render'](),_0x339ba8;}['_toggleRotatorButtonsInDialogHeader'](_0x3f2368){const _0x1a2462=this['editor'],_0xd16cc5=_0x1a2462['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3f2368),_0xd16cc5['has'](this['_chatBalloonView']['previousButtonView'])||(_0xd16cc5['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1a2462['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0xd16cc5['remove'](this['_chatBalloonView']['previousButtonView']),_0xd16cc5['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Da extends _0x539ee4{static get['requires'](){return[Pt,xt,qt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function re(_0x3259e5){const {editor:_0x4f334b,action:_0x537e30,withText:_0x1c3503=!0x1,withIcon:_0x57c2f0=!0x0,isInDropdown:_0x599aec=!0x0,shouldPreventFocus:_0x21113f=!0x1}=_0x3259e5;return()=>{const _0x2080fb=_0x4f334b['locale'],_0x378648=new _0x3c2d24(_0x2080fb),_0x33e798=_0x378648['bindTemplate'];_0x599aec&&_0x378648['extendTemplate']({'on':{'mouseenter':_0x33e798['to'](()=>{_0x21113f&&_0x21113f()||_0x378648['focus']();})}});const _0x55e6da=_0x537e30['icon']??_0x537e30['parent']?.['icon'];return _0x378648['set']({'label':_0x537e30['displayedPrompt'],'withText':_0x1c3503,'role':'menuitem','icon':_0x57c2f0?_0x55e6da??_0x45cf17:void 0x0,'tooltip':!_0x1c3503,'class':'ck-ai-quick-actions-button','isEnabled':_0x537e30['isEnabled']}),_0x378648['on']('execute',()=>{_0x4f334b['editing']['view']['focus'](),_0x4f334b['commands']['execute']('aiQuickAction',_0x537e30);}),_0x378648;};}class wn extends _0x1c542a{['arrowView'];constructor(_0xbb225a,_0x4eec23){super(_0xbb225a,_0x4eec23);const _0x99f1ae=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x1eaa8e=>String(_0x1eaa8e)),'data-cke-tooltip-disabled':_0x99f1ae['to']('isOn')},'on':{'mouseenter':_0x99f1ae['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x194957=new _0x4dad4f();return _0x194957['content']=_0x281211,_0x194957['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x194957;}}class kn extends _0x366e5d{['_allListItems'];['_allSearchableItems'];constructor(_0x160204,_0x274443,_0x231e26){super(_0x160204),this['_allListItems']=_0x274443,this['_allSearchableItems']=_0x231e26;}['filter'](_0x1c7342){if(!_0x1c7342)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x121b0a=_0x1c7342['source']['toLowerCase']()['trim'](),_0x10b07a=this['_allSearchableItems']['filter'](_0x9cf231=>(_0x9cf231['groupLabel']?_0x9cf231['label']+'\x20('+_0x9cf231['groupLabel']+')':_0x9cf231['label'])['toLowerCase']()['includes'](_0x121b0a));return this['items']['clear'](),this['items']['addMany'](_0x10b07a['sort']((_0x336583,_0x549fe2)=>{const _0x35be82=_0x336583['groupLabel'],_0xbae4fc=_0x549fe2['groupLabel'];return _0x35be82||_0xbae4fc?_0x35be82?0x1:-0x1:0x0;})['map'](_0x53a874=>_0x53a874['item'])),this['_highlightQuery'](_0x121b0a,_0x10b07a),{'resultsCount':_0x10b07a['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x4478f3,_0x107bba){if(!_0x4478f3)return;const _0x587972=new RegExp(_0x1173f5(_0x4478f3),'gi');_0x107bba['forEach'](_0xc0a27c=>{_0xc0a27c['highlightViews']&&_0xc0a27c['highlightViews']['forEach'](_0x16c928=>{'function'==typeof _0x16c928['highlightText']&&_0x16c928['highlightText'](_0x587972);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x54d0cd=>{_0x54d0cd['highlightViews']&&_0x54d0cd['highlightViews']['forEach'](_0x340e7a=>{'function'==typeof _0x340e7a['highlightText']&&_0x340e7a['highlightText'](null);});});}}const _n='menu',dn='menuitem';class ao extends _0x2d8061{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x481323,_0x245d29,_0x4182ac,_0x3924d3,_0x3336c7=!0x1){const _0x2b047d=_0x481323['locale'];super(_0x2b047d),this['_bodyCollection']=_0x3924d3,this['_hasSearch']=_0x3336c7;const _0x4f67b4=this['_createListItems'](_0x481323,_0x245d29,_0x4182ac);this['optionsListView']=new kn(_0x2b047d,_0x4f67b4,this['_allSearchableItems']),this['optionsListView']['role']=_n,this['optionsListView']['items']['addMany'](_0x4f67b4),this['focusTracker']=new _0x59aa0e(),this['keystrokes']=new _0x151440(),_0x3336c7&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x4f67b4,this['focusCycler']=new _0x2427c3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3336c7&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x240292=_0x3336c7&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x215181(_0x240292),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2b047d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1e3f51(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x6618ad=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x6618ad);}['_createListItems'](_0x26ecd5,_0x13a6f3,_0x1447e1){const _0x68a84=new _0x215181();return _0x13a6f3['forEach'](_0x30cad1=>{if('actions'in _0x30cad1){const {listItem:_0x20fef2}=this['_createActionGroupButton'](_0x26ecd5,_0x30cad1,_0x1447e1);_0x68a84['add'](_0x20fef2),_0x30cad1['actions']['forEach'](_0x12de28=>{this['_createActionButton'](_0x26ecd5,_0x12de28,_0x30cad1['label'],_0x30cad1['icon']);const {listItem:_0x40bbf0,highlightViews:_0x2a9427}=this['_createSearchResultActionButton'](_0x26ecd5,_0x12de28,_0x30cad1['label'],_0x30cad1['icon']);this['_allSearchableItems']['push']({'item':_0x40bbf0,'label':_0x12de28['displayedPrompt'],'groupLabel':_0x30cad1['label'],'highlightViews':_0x2a9427});});}else{const {listItem:_0x513efe}=this['_createActionButton'](_0x26ecd5,_0x30cad1);_0x68a84['add'](_0x513efe);const _0x5e1f77=_0x513efe['children']['first'];if(_0x5e1f77){const {listItem:_0x353dad,highlightViews:_0x52bda3}=this['_createSearchResultActionButton'](_0x26ecd5,_0x30cad1);this['_allSearchableItems']['push']({'item':_0x353dad,'label':_0x5e1f77['label']||'','highlightViews':_0x52bda3});}}}),_0x68a84;}['_createActionButton'](_0x3d1e53,_0x4d16bf,_0x394b97,_0x1c5bde){const _0x55cd05=new _0x8f7dd0(this['locale']);if(_0x394b97&&_0x1c5bde){const _0x14669c=new _0x3c2d24(this['locale']),_0x156bd2=_0x14669c['bindTemplate'],_0x5aa0f4=new _0x5027dd();_0x5aa0f4['text']=_0x4d16bf['displayedPrompt'];const _0x551209=new _0x5027dd();_0x551209['text']=_0x394b97;const _0x361f9f=new _0x4dad4f();_0x361f9f['content']=_0x1c5bde,_0x361f9f['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x432b96=new _0x2d8061(this['locale']);_0x432b96['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0xfadd12=new _0x2d8061(this['locale']);return _0xfadd12['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x14669c['set']({'label':_0x4d16bf['displayedPrompt']+'\x20('+_0x394b97+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x14669c['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x5aa0f4,_0x432b96,_0x361f9f,_0x551209,_0xfadd12],'on':{'mouseenter':_0x156bd2['to'](()=>{this['_isSearchFocused']()||_0x14669c['focus']();}),'click':_0x156bd2['to'](()=>{_0x14669c['fire']('execute');})}}),_0x14669c['on']('execute',()=>{_0x3d1e53['editing']['view']['focus'](),_0x3d1e53['commands']['execute']('aiQuickAction',_0x4d16bf);}),_0x55cd05['children']['add'](_0x14669c),{'listItem':_0x55cd05,'highlightViews':[_0x5aa0f4,_0x551209]};}{const _0x44564a=new _0x1920d7(),_0x4e0257=new _0x3c2d24(this['locale'],_0x44564a),_0x3b07dd=_0x4e0257['bindTemplate'],_0x5e74a2=_0x4d16bf['icon']??_0x4d16bf['parent']?.['icon'],_0x433f0e=void 0x0!==_0x4d16bf['icon'];return _0x4e0257['set']({'label':_0x4d16bf['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x433f0e?_0x5e74a2??_0x45cf17:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x4e0257['extendTemplate']({'on':{'mouseenter':_0x3b07dd['to'](()=>{this['_isSearchFocused']()||_0x4e0257['focus']();})}}),_0x4e0257['on']('execute',()=>{_0x3d1e53['editing']['view']['focus'](),_0x3d1e53['commands']['execute']('aiQuickAction',_0x4d16bf);}),_0x55cd05['children']['add'](_0x4e0257),{'listItem':_0x55cd05,'highlightViews':[_0x44564a]};}}['_createSearchResultActionButton'](_0xb717b7,_0x407271,_0x519385,_0xf0987f){return _0x519385&&_0xf0987f?this['_createSearchResultGroupedActionButton'](_0xb717b7,_0x407271,_0x519385,_0xf0987f):this['_createSearchResultIndividualActionButton'](_0xb717b7,_0x407271);}['_createSearchResultGroupedActionButton'](_0x402344,_0x295c8f,_0x16a619,_0x446b10){const _0x1e2561=new _0x8f7dd0(this['locale']),_0x567432=new _0x3c2d24(this['locale']),_0x561f1a=_0x567432['bindTemplate'],{view:_0x1028a6,highlightView:_0x45428a}=this['_createSearchResultGroupRow'](_0x16a619,_0x446b10),{view:_0x540435,highlightView:_0x1a4617}=this['_createSearchResultActionRow'](_0x295c8f['displayedPrompt']),_0x521db3=this['_createSearchResultContentView'](_0x1028a6,_0x540435);return _0x567432['set']({'label':_0x295c8f['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x567432['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x521db3],'on':{'mouseenter':_0x561f1a['to'](()=>{this['_isSearchFocused']()||_0x567432['focus']();}),'click':_0x561f1a['to'](()=>{this['_handleSearchResultButtonClick'](_0x567432);})}}),this['_setupActionButtonExecution'](_0x567432,_0x402344,_0x295c8f),_0x1e2561['children']['add'](_0x567432),{'listItem':_0x1e2561,'highlightViews':[_0x45428a,_0x1a4617]};}['_createSearchResultIndividualActionButton'](_0x1fcced,_0xd11db0){const _0x579c90=new _0x8f7dd0(this['locale']),_0x19bc7a=new _0x1920d7(),_0x276d35=new _0x3c2d24(this['locale'],_0x19bc7a),_0x120025=_0x276d35['bindTemplate'];return _0x276d35['set']({'label':_0xd11db0['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x276d35['extendTemplate']({'on':{'mouseenter':_0x120025['to'](()=>{this['_isSearchFocused']()||_0x276d35['focus']();})}}),this['_setupActionButtonExecution'](_0x276d35,_0x1fcced,_0xd11db0),_0x579c90['children']['add'](_0x276d35),{'listItem':_0x579c90,'highlightViews':[_0x19bc7a]};}['_createSearchResultGroupRow'](_0x5b2a41,_0x5f1740){const _0x3aa0ad=new _0x2d8061(this['locale']),_0x479968=new _0x4dad4f();_0x479968['content']=_0x5f1740,_0x479968['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1b5b6e=new _0x5027dd();return _0x1b5b6e['text']=_0x5b2a41,_0x3aa0ad['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x479968,_0x1b5b6e]}),{'view':_0x3aa0ad,'highlightView':_0x1b5b6e};}['_createSearchResultActionRow'](_0x1fe9f4){const _0x120a19=new _0x2d8061(this['locale']),_0x4c3c84=new _0x5027dd();return _0x4c3c84['text']=_0x1fe9f4,_0x120a19['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4c3c84]}),{'view':_0x120a19,'highlightView':_0x4c3c84};}['_createSearchResultContentView'](_0x4f8204,_0x2bc2b0){const _0x1ceeaa=new _0x2d8061(this['locale']);return _0x1ceeaa['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4f8204,_0x2bc2b0]}),_0x1ceeaa;}['_setupActionButtonExecution'](_0xf3cb7b,_0x3b9d11,_0x43bd32){_0xf3cb7b['on']('execute',()=>{_0x3b9d11['editing']['view']['focus'](),_0x3b9d11['commands']['execute']('aiQuickAction',_0x43bd32);});}['_createActionGroupButton'](_0x33bf35,_0x6a4722,_0x39ebd7){const _0x43130d=new _0x8f7dd0(this['locale']),_0x55085e=new _0x1920d7(),_0x1a82a2=new wn(this['locale'],_0x55085e),_0x58d540=_0x1a82a2['bindTemplate'],_0x5adf7a=this['_getPanelKeystroke'](_0x39ebd7),_0x42f39f=this['_createGroupActionsList'](_0x33bf35,_0x6a4722['actions'],_0x39ebd7);_0x1a82a2['set']({'label':_0x6a4722['label'],'withText':!0x0,'role':dn,'icon':_0x6a4722['icon']??_0x45cf17,'isEnabled':_0x6a4722['actions']['some'](_0x5ad554=>_0x5ad554['isEnabled'])}),_0x1a82a2['extendTemplate']({'on':{'mouseenter':_0x58d540['to'](()=>{this['_isSearchFocused']()||_0x1a82a2['focus']();})}});const _0x4a609b=new _0x90b260(this['locale']);return _0x4a609b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x58d540['to'](_0x7d7663=>{this['_handlePanelKeydown'](_0x7d7663,_0x5adf7a,_0x1a82a2,_0x4a609b);})}}),_0x1a82a2['bind']('isOn')['to'](_0x4a609b,'isVisible'),this['_bodyCollection']['add'](_0x4a609b),_0x4a609b['content']['add'](_0x42f39f),this['_setupGroupMenuBehavior'](_0x1a82a2,_0x4a609b),_0x43130d['children']['add'](_0x1a82a2),{'listItem':_0x43130d,'highlightView':_0x55085e};}['_createGroupActionsList'](_0x18050b,_0x3138e7,_0x36db26){const _0x32bff3=new _0x366e5d(this['locale']);return _0x32bff3['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x3138e7['forEach'](_0x3311d1=>{const _0x56256b=new _0x8f7dd0(this['locale']),_0x4a9e75=re({'editor':_0x18050b,'action':_0x3311d1,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x56256b['children']['add'](_0x4a9e75),_0x36db26['focusTracker']['add'](_0x4a9e75),_0x32bff3['items']['add'](_0x56256b);}),_0x32bff3;}['_setupGroupMenuBehavior'](_0x42bbfc,_0x554a0d){const _0x44442c=_0x42bbfc['bindTemplate'],_0x2f6110=this['_getButtonKeystroke'](_0x42bbfc);_0x42bbfc['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x44442c['to'](()=>{this['_showNestedPanel'](_0x554a0d,_0x42bbfc);}),'mouseleave':_0x44442c['to'](_0x233fe9=>{const _0x4448c1=_0x233fe9['relatedTarget'];this['_isMovingToNestedMenu'](_0x4448c1,_0x554a0d)||this['_hideNestedPanel'](_0x554a0d);}),'keydown':_0x44442c['to'](_0xda33c2=>{_0xda33c2['key']==_0x2f6110&&(this['_showNestedPanel'](_0x554a0d,_0x42bbfc),_0x554a0d['content']['get'](0x0)['focus']());})}}),_0x554a0d['on']('render',()=>{_0x554a0d['element']?.['addEventListener']('mouseleave',_0x29276f=>{const _0x547b66=_0x29276f['relatedTarget'];_0x42bbfc['element']?.['contains'](_0x547b66)||this['_isMovingToNestedMenu'](_0x547b66,_0x554a0d)||this['_hideNestedPanel'](_0x554a0d);});});}['_showNestedPanel'](_0x21899e,_0x21a8ec){this['_openNestedPanels']['forEach'](_0x480d01=>{_0x480d01!==_0x21899e&&_0x480d01['isVisible']&&_0x480d01['hide']();}),_0x21899e['show'](),_0x21899e['pin']({'positions':[_0x49d0ef['eastSouth']],'target':_0x21a8ec['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x21899e);}['_hideNestedPanel'](_0x59e245){_0x59e245['hide'](),this['_openNestedPanels']['delete'](_0x59e245);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5cb447=>_0x5cb447['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x9f7914,_0x49b889){if(!_0x9f7914)return!0x1;if(_0x49b889['element']?.['contains'](_0x9f7914))return!0x0;const _0x362e7e=_0x9f7914;return _0x362e7e['closest']&&(null!==_0x362e7e['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x362e7e['closest']('.ck-ai-quick-actions-group-list')||null!==_0x362e7e['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0xb4832b){return'rtl'===_0xb4832b['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x502d65){return'rtl'===_0x502d65['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x95ebe7,_0x292b95,_0x1e008f,_0x2d3b1f){_0x95ebe7['key']==_0x292b95&&(_0x1e008f['focus'](),this['_hideNestedPanel'](_0x2d3b1f));}['_handleSearchResultButtonClick'](_0x370e4c){_0x370e4c['fire']('execute');}}function se(_0x4ee7b8){const {editor:_0x464b96,content:_0x5586f4,buttonDefinition:_0x38fccb,bodyCollection:_0x526b60,hasSearch:_0x39835a=!0x1}=_0x4ee7b8;return()=>{const _0x1d514a=_0x464b96['locale'],_0x3b9a40=_0x59c3f3(_0x1d514a);_0x3b9a40['buttonView']['set']({'icon':_0x38fccb['icon']??_0x45cf17,'label':_0x38fccb['label'],'tooltip':!0x0}),_0x3b9a40['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x20406e=new ao(_0x464b96,_0x5586f4,_0x3b9a40,_0x526b60,_0x39835a);if(_0x3b9a40['panelView']['children']['add'](_0x20406e),_0x39835a){const _0x130f31='ai-quick-actions-dropdown-selection';_0x3b9a40['on']('change:isOpen',(_0x39612b,_0xfe3381,_0x3450c5)=>{if(_0x3450c5){if(_0x464b96['plugins']['has']('AIEditing')){const _0x259708=_0x464b96['plugins']['get'](D),_0x4adf91=_0x464b96['model']['document']['selection'],_0x3eb7c7=Array['from'](_0x4adf91['getRanges']());_0x3eb7c7['length']>0x0&&_0x259708['showFakeVisualSelection'](_0x3eb7c7,_0x130f31,!0x1,!0x0);}}else _0x464b96['plugins']['has']('AIEditing')&&_0x464b96['plugins']['get'](D)['hideFakeVisualSelection'](_0x130f31),_0x20406e['resetSearch']();});}return _0x3b9a40;};}const le='<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>',ue='<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>',de='<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 Vt=function(_0x40593b){return _0x40593b['CHAT']='CHAT',_0x40593b['ACTION']='ACTION',_0x40593b['REVIEW']='REVIEW',_0x40593b;}({}),Pa=function(_0x47abdc){return _0x47abdc['CHAT']='AIChat',_0x47abdc['ACTION']='AIActions',_0x47abdc['REVIEW']='AIReviewMode',_0x47abdc;}({});class ri extends _0x539ee4{static get['requires'](){return[_0x318f8b,S];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x154d96=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x154d96),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0xab1909){return function(_0x358473){const _0x10ab8f=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x358473['uiLanguage']),_0x5610ef=_0x10ab8f||'English',_0x5f0ae6=[{'id':'ask-ai','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Zt},{'id':'chat-commands','label':i(_0x358473,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Zt,'actions':[{'id':'explain','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':le['replace']('%0',_0x5610ef),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ue['replace']('%0',_0x5610ef),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':de['replace']('%0',_0x5610ef),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':_0x33db0d},{'id':'continue','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':te},{'id':'fix-grammar','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':_0x41c232},{'id':'adjust-length','label':i(_0x358473,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Yt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x358473,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Xt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x145f81,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x358473,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x358473,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4b2a2e,'actions':[]}];return _0x5f0ae6;}(_0xab1909);}async['_getDefaultAndCustomActions'](){const _0x646cc4=ri['getDefaultQuickActions'](this['editor']['locale']),_0x105560=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xe0ba66=[];try{_0xe0ba66=await new dt({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x538152){const _0x48e9d4=new _0x32ab89('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x538152});rt(_0x48e9d4['message']);}finally{const _0x6aa666=_0x105560['map'](_0xf03e89=>({..._0xf03e89,'icon':void 0x0}));_0x646cc4['find'](_0x2b4172=>'other'===_0x2b4172['id'])['actions']['push'](..._0x6aa666),_0x646cc4['forEach'](_0x5e5f00=>{if('actions'in _0x5e5f00)_0x5e5f00['actions']['forEach'](_0x13f0e4=>{if(_0x13f0e4['isEnabled']=!!_0xe0ba66['find'](_0x17e9ac=>_0x17e9ac['id']===_0x13f0e4['model'])||void 0x0===_0x13f0e4['model'],!_0x13f0e4['isEnabled']){const _0x4869d5=new _0x32ab89('ai-quick-actions-unavailable-model',this,{'actionId':_0x13f0e4['id'],'modelId':_0x13f0e4['model']});rt(_0x4869d5['message']);}});else{if(_0x5e5f00['isEnabled']=!!_0xe0ba66['find'](_0x2b2cac=>_0x2b2cac['id']===_0x5e5f00['model'])||void 0x0===_0x5e5f00['model'],!_0x5e5f00['isEnabled']){const _0x309613=new _0x32ab89('ai-quick-actions-unavailable-model',this,{'actionId':_0x5e5f00['id'],'modelId':_0x5e5f00['model']});rt(_0x309613['message']);}}});}return _0x646cc4;}['_initializeQuickActionsComponentsAndCommands'](){const _0x187c1d=new _0x4bb856(this['editor']['locale']);_0x187c1d['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x187c1d),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x187c1d);}['_initializeQuickActionsDropdown'](_0x58e28b){const _0x3c22b3=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',se({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x45cf17,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x58e28b,'hasSearch':_0x3c22b3}));}['_prepareQuickActionsDefinition'](_0x45566b){this['_quickActionsDefinition']=_0x45566b['map'](_0x4b120c=>{if('actions'in _0x4b120c){const _0x49c64c=_0x4b120c;return{..._0x49c64c,'actions':_0x49c64c['actions']['map'](_0x462d40=>{const {actions:_0x22b846,..._0x4fdc3b}=_0x49c64c;return{..._0x462d40,'parent':_0x4fdc3b};})['filter'](_0x256ee3=>this['_shouldIncludeAction'](_0x256ee3))};}return _0x4b120c;})['filter'](_0x487106=>'actions'in _0x487106?_0x487106['actions']['length']>0x0:this['_shouldIncludeAction'](_0x487106));}['_shouldIncludeAction'](_0x5e2978){const _0x1cd2c3=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Pa[_0x5e2978['type']])&&!_0x1cd2c3['includes'](_0x5e2978['id'])&&!('CHAT'===_0x5e2978['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x1f7633){this['_quickActionsDefinition']['forEach'](_0x33cbbe=>{if('actions'in _0x33cbbe){const _0x1e014d=se({'editor':this['editor'],'content':_0x33cbbe['actions'],'buttonDefinition':_0x33cbbe,'bodyCollection':_0x1f7633});this['editor']['ui']['componentFactory']['add'](_0x33cbbe['id'],_0x1e014d),_0x33cbbe['actions']['forEach'](_0x412e61=>{const _0x64bd2e=re({'editor':this['editor'],'action':_0x412e61});this['editor']['ui']['componentFactory']['add'](_0x412e61['id'],_0x64bd2e);});}else{const _0x90574=re({'editor':this['editor'],'action':_0x33cbbe,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x33cbbe['id'],_0x90574);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3e4852=>{const _0x4f874c=new _0x37d352(_0x3e4852),_0x404592=i(_0x3e4852,'AI_QUICK_ACTIONS_HEADING');_0x4f874c['buttonView']['set']({'label':_0x404592,'icon':_0x45cf17});const _0x8d2a11=new _0x558ce9(_0x3e4852);_0x8d2a11['set']({'ariaLabel':_0x404592,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x487a2c=>{if('actions'in _0x487a2c){const _0x5985e0=_0x487a2c,_0x72ae0f=new _0x4d6df1(_0x3e4852,_0x4f874c),_0x1f5b0a=new _0x37d352(_0x3e4852),_0x4e6edd=new _0x558ce9(_0x3e4852);_0x1f5b0a['buttonView']['set']({'label':_0x5985e0['label'],'icon':_0x5985e0['icon']}),_0x5985e0['actions']['forEach'](_0x30abd6=>{const _0x2fba91=new _0x4d6df1(_0x3e4852,_0x1f5b0a),_0x47ca13=new _0x215c67(_0x3e4852);_0x47ca13['set']({'label':_0x30abd6['displayedPrompt'],'icon':_0x30abd6['icon'],'role':'menuitem','isEnabled':_0x30abd6['isEnabled']}),_0x47ca13['on']('execute',()=>{this['_executeQuickAction'](_0x30abd6);}),_0x47ca13['delegate']('execute')['to'](_0x1f5b0a),_0x2fba91['children']['add'](_0x47ca13),_0x4e6edd['items']['add'](_0x2fba91);}),_0x1f5b0a['panelView']['children']['add'](_0x4e6edd),_0x72ae0f['children']['add'](_0x1f5b0a),_0x8d2a11['items']['add'](_0x72ae0f);}else{const _0x1c62e6=_0x487a2c,_0x4b7297=new _0x4d6df1(_0x3e4852,_0x4f874c),_0x51a773=new _0x215c67(_0x3e4852);_0x51a773['set']({'label':_0x1c62e6['displayedPrompt'],'icon':_0x1c62e6['icon'],'role':'menuitem','isEnabled':_0x1c62e6['isEnabled']}),_0x51a773['on']('execute',()=>{this['_executeQuickAction'](_0x1c62e6);}),_0x51a773['delegate']('execute')['to'](_0x4f874c),_0x4b7297['children']['add'](_0x51a773),_0x8d2a11['items']['add'](_0x4b7297);}});const _0xf2ddcd=Object['values'](Pa)['some'](_0xbaf74d=>this['editor']['plugins']['has'](_0xbaf74d));return _0x4f874c['set']({'isEnabled':_0xf2ddcd}),_0x4f874c['panelView']['children']['add'](_0x8d2a11),_0x4f874c;});}['_executeQuickAction'](_0x317e4a){const _0x4dd22b=this['editor'];_0x4dd22b['editing']['view']['focus'](),_0x4dd22b['commands']['execute']('aiQuickAction',_0x317e4a);const _0x71285c=_0x4dd22b['ui']['view']['menuBarView'];_0x71285c&&_0x71285c['close']&&_0x71285c['close']();}}class ni extends Qt{['execute'](_0x3631f8){switch(this['_expandSelectionIfCollapsed'](),_0x3631f8['type']){case Vt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x70b947=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x32ab89('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x70b947});}this['_handleAIChatAction'](_0x3631f8);break;case Vt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x4072e2=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x32ab89('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4072e2});}this['_handleAIActionsAction'](_0x3631f8);break;case Vt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x2bfc6f=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x32ab89('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2bfc6f});}this['_handleAIReviewAction'](_0x3631f8);}}async['_handleAIChatAction'](_0x3099a4){const _0x16f7e7=this['editor']['plugins']['get']('AIChat'),_0x39b770=this['editor']['plugins']['get']('AIChatController'),_0x59cbe3=this['editor']['plugins']['get']('AITabs')['view'];if(_0x59cbe3['isVisible']||(_0x59cbe3['isVisible']=!0x0),'chat'!==_0x59cbe3['activeTab']&&_0x59cbe3['activateTab']('chat'),'ask-ai'===_0x3099a4['id'])_0x39b770['removeSelectionFromChatContext'](),await _0x16f7e7['addSelectionToChatContext'](),_0x16f7e7['focusPromptInput']();else await _0x16f7e7['startConversation'](),_0x39b770['removeSelectionFromChatContext'](),await _0x16f7e7['addSelectionToChatContext'](),_0x16f7e7['focusPromptInput'](),await _0x16f7e7['sendMessage']({'message':_0x3099a4['prompt']||_0x3099a4['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x3099a4['id']},'displayedPrompt':_0x3099a4['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x462c55=this['editor'],_0x2dbf26=_0x462c55['model']['document']['selection'];if(!_0x2dbf26['isCollapsed'])return;const _0x3f9047=_0x3a1e6c(_0x2dbf26['getSelectedBlocks']())||_0x462c55['model']['schema']['getLimitElement'](_0x2dbf26);_0x462c55['model']['change'](_0x40c309=>{_0x40c309['setSelection'](_0x3f9047,'in');});}['_handleAIActionsActionLabel'](_0x3109c4){return _0x3109c4['parent']?.['label']&&'other'!==_0x3109c4['parent']?.['id']?_0x3109c4['parent']['label']+':\x20'+_0x3109c4['displayedPrompt']:_0x3109c4['displayedPrompt'];}async['_handleAIActionsAction'](_0x3d1265){const _0x373441=this['editor']['plugins']['get']('AIActions'),_0x13f2fd=_0x3d1265['prompt']?{'userMessage':_0x3d1265['prompt'],'model':_0x3d1265['model']}:{'actionName':_0x3d1265['actionName']||_0x3d1265['id'],'args':_0x3d1265['args']},_0x3b5a60=this['_handleAIActionsActionLabel'](_0x3d1265);await _0x373441['executeAction'](_0x13f2fd,_0x3b5a60,_0x3d1265['icon']);}async['_handleAIReviewAction'](_0x4a0b58){console['log']('handleAIReviewAction',_0x4a0b58);}}class si extends _0x539ee4{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x20021f=this['editor'],_0xb8d466=new ni(this['editor']);if(_0x20021f['commands']['add']('aiQuickAction',_0xb8d466),_0x20021f['plugins']['has']('AIChat')){const _0x3a46f9=this['editor']['plugins']['get']('AIChat');_0x20021f['model']['document']['selection']['on']('change:range',(_0x53b540,_0x187673)=>{_0x187673['directChange']&&_0x3a46f9['removeSelectionFromChatContext']();});}}}class qe extends Ge{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x1c3a7f=this['documentContextContent']['children']['map'](_0x22e5ab=>({'node':_0x22e5ab,'id':Ct(_0x22e5ab,'data-id')})),_0x3737ed=this['parsedMergedContent']['children']['map'](_0x43706c=>({'node':_0x43706c,'id':Ct(_0x43706c,'data-id')||_0xdeade1()})),_0x489be8=_0x58f5d1(_0x1c3a7f,_0x3737ed,{'comparator':(_0x40299c,_0x34e05a)=>_0x40299c['id']==_0x34e05a['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x489be8['length']&&_0x489be8[_0x489be8['length']-0x1]['removed'];)_0x489be8['pop']();}const _0x3f045b=_0x489be8['map'](_0x36acf4=>{const _0x5eae53=_0x36acf4['added']?'new':_0x36acf4['removed']?'removed':'modified';return{'node':_0x36acf4['value'][0x0]['node'],'type':_0x5eae53,'id':_0x36acf4['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3f045b,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x398e90,_0x27a5d0){return _0x27a5d0;}}class O extends xe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x5a350a){super(_0x5a350a),this['content']=_0x5a350a['content'],this['version']=_0x5a350a['version'],this['actionName']=_0x5a350a['actionName'],this['args']=_0x5a350a['args'],this['userMessage']=_0x5a350a['userMessage'],this['model']=_0x5a350a['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':Ne['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x49d6e3){const _0x21d42=new qe({'editor':this['editor'],'documentContextContent':this['content'],..._0x49d6e3});return this['replies']['push'](_0x21d42),_0x21d42['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x21d42),_0x21d42;}}class ph extends _0x2cc502{constructor(_0x549151,_0x30bbc9=!0x0,_0x54d735=!0x0){super(_0x549151),this['set']('isEnabled',!0x1),_0x30bbc9&&(this['applyButton']=this['_createButton'](i(_0x549151,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x54d735&&(this['suggestButton']=this['_createButton'](i(_0x549151,'AI_BALLOON_SUGGEST_BUTTON'),_0x30bbc9?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x30bbc9,'showSuggestButton':_0x54d735}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x36befa,showSuggestButton:_0x387572}){this['applyButton']&&(this['applyButton']['isVisible']=_0x36befa),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x387572);}['_createButton'](_0x2a36eb,_0x4a3f30){const _0x5dc18b=new _0x3c2d24(this['locale']);return _0x5dc18b['set']({'label':_0x2a36eb,'class':_0x4a3f30,'isVisible':!0x0,'withText':!0x0}),_0x5dc18b;}}class wh extends _0x2d8061{constructor(_0x372a61){super(_0x372a61),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x372a61,'AI_DISCLAIMER_TEXT')}]}]});}}class _h extends _0x2d8061{constructor(_0x591fe6){super(_0x591fe6),this['set']('isVisible',!0x0);const _0x53da8b=new ki('small');_0x53da8b['isVisible']=!0x0;const _0x559624=new _0x2d8061(this['locale']);_0x559624['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x4d345f=>!_0x4d345f)]},'children':[_0x53da8b,_0x559624]});}}class Y extends ls{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2b7f55,_0x2261d2){super(_0x2b7f55),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x2261d2,this['_focusTracker']=new _0x59aa0e(),this['_keystrokes']=new _0x151440(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x2427c3({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x215181(),this['_addContentWrapper'](_0x2261d2),this['_addDisclaimerView'](),this['_addToolbar'](_0x2261d2),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x2261d2);});}['render'](){super['render']();for(const _0x4181eb of this['_focusables'])this['_focusTracker']['add'](_0x4181eb['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x5aa045){-0x1===_0x5aa045?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x573f23){this['_isLoading']=_0x573f23;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0xd099da){super['showError'](_0xd099da),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4a4e93){super['showBlockingError'](_0x4a4e93),this['setErrorState']();}['addMiniToolbarItem'](_0x10bbab){this['_miniToolbarView']['items']['has'](_0x10bbab)||this['_miniToolbarView']['items']['add'](_0x10bbab);}['removeMiniToolbarItem'](_0x40fa4c){this['_miniToolbarView']['items']['has'](_0x40fa4c)&&this['_miniToolbarView']['items']['remove'](_0x40fa4c);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1877f7,showSuggestButton:_0x1fa58c}){_0x1877f7=_0x1877f7&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1fa58c=_0x1fa58c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1877f7,'showSuggestButton':_0x1fa58c});}async['updateContent'](_0x323849){await this['_streamableContentView']['update'](_0x323849);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x2d91b0){this['_contentWrapper']=new _0x2d8061(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView'](),this['_createMiniToolbar'](_0x2d91b0['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new wh(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x3c1d3b,showSuggestButton:_0x748181}){this['_toolbarView']=new ph(this['locale'],_0x3c1d3b,_0x748181),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x215300,_0x32c3bc,_0x5729a7)=>!(_0x215300||_0x32c3bc||_0x5729a7)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x3c1d3b,'showSuggestButton':_0x748181}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x4b56da){return this['_miniToolbarView']=new us(this['locale'],_0x4b56da),this['_miniToolbarView']['delegate'](...ot)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0xfa2c34,_0x1e34fc)=>!(_0xfa2c34||_0x1e34fc)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new _h(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new as(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3c0ad2=new _0x3c2d24(this['locale']),_0x4641d8=new _0x3c2d24(this['locale']),_0xcfa241=new fh(this['locale']),_0xc35b6f=new _0x3c2d24(this['locale']);_0x3c0ad2['set']({'icon':_0x31e211,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x4641d8['set']({'icon':_0x4fd96d,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0xc35b6f['set']({'icon':_0x4ec314,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3c0ad2['bind']('isEnabled')['to'](this,'isBusy',_0x13b959=>!_0x13b959),_0x3c0ad2['on']('execute',()=>{this['fire']('tryAgain');}),_0x4641d8['bind']('isEnabled')['to'](this,'isBusy',_0x42feb9=>!_0x42feb9),_0x4641d8['on']('execute',()=>{this['fire']('showPrevious');}),_0xc35b6f['bind']('isEnabled')['to'](this,'isBusy',_0x1c0b99=>!_0x1c0b99),_0xc35b6f['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4641d8,this['_navigationCounter']=_0xcfa241,this['_navigationNextButton']=_0xc35b6f,this['_navigationTryAgainButton']=_0x3c0ad2;}['updateMiniToolbarButtons'](_0x2c48b8,_0x5770b6){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x94f027=_0x2c48b8>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x94f027){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x28e770=_0x2c48b8-_0x5770b6;this['_navigationCounter']['setInteractionCount'](_0x28e770+'/'+_0x2c48b8),this['_navigationPreviousButton']['isEnabled']=_0x5770b6<_0x2c48b8-0x1,this['_navigationNextButton']['isEnabled']=_0x5770b6>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x52331e){this['_isLoading']=_0x52331e;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2f5433=this['_getScrollableElement']();_0x2f5433&&!this['_scrollManager']&&(this['_scrollManager']=new mi(_0x2f5433));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class fh extends _0x2d8061{constructor(_0x18c7d0){super(_0x18c7d0);const _0x26ae25=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x26ae25['to']('interactionCount')}]});}['setInteractionCount'](_0x42b27f){this['set']('interactionCount',_0x42b27f);}}class ci extends _0x539ee4{static get['requires'](){return[S,_0x15fff9,D,P,_0xac1d67];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x422aef){super(_0x422aef),this['_bodyCollection']=new _0x4bb856(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new N();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0xce59fb,_0x50df1a,_0x4daaaa){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x56311d,anchorData:_0x2762a8}=this['_getExecuteDataInTable']();return this['_executeAction'](_0xce59fb,_0x56311d,_0x2762a8,_0x50df1a,_0x4daaaa);}}const {modelFragment:_0x50b0c9,anchorData:_0x5de6bb}=this['_getExecuteDataRegular']();return this['_executeAction'](_0xce59fb,_0x50b0c9,_0x5de6bb,_0x50df1a,_0x4daaaa);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x521c6a=this['editor']['plugins']['has']('TrackChanges');let _0x45b7f1=this['editor']['config']['get']('ai.availableReplyActions')||[...X];_0x521c6a||(_0x45b7f1=_0x45b7f1['filter'](_0x18318c=>'insertSuggestion'!=_0x18318c));const _0x3f9042=this['editor']['commands']['get']('trackChanges'),_0x382b02=new Y(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x521c6a,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x45b7f1});return _0x382b02['bind']('isBusy')['to'](this),_0x3f9042&&_0x382b02['bind']('isTrackChangesOn')['to'](_0x3f9042,'value'),_0x382b02['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x382b02['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x382b02['on']('showNext',()=>{this['_navigateToNext']();}),_0x382b02;}['_getExecuteDataRegular'](){const _0x1d4e4b=this['editor']['model']['document']['selection'];if(_0x1d4e4b['isCollapsed']){const _0x2c1eca=_0x3a1e6c(_0x1d4e4b['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x1d4e4b);this['editor']['model']['change'](_0x5b7e52=>{_0x5b7e52['setSelection'](_0x2c1eca,'in');});}const _0xbb44e1=_0x1d4e4b['getFirstRange'](),_0x16ff8a=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x1d4e4b),_0xbb44e1['start'],_0xbb44e1['end']);this['_copyMarkersToFragment'](_0x16ff8a,_0x1d4e4b,{'isTableSelection':!0x1});const _0x4a1800=_0x1d4e4b['getFirstRange']()['start'],_0x270dee=new Map();let _0x195e65=_0x16ff8a;for(let _0x44b22e=0x0;_0x44b22e<_0x4a1800['path']['length'];_0x44b22e++)_0x270dee['set'](_0x195e65,_0x4a1800['path'][_0x44b22e]),_0x195e65=_0x195e65['getChild'](0x0);return{'modelFragment':_0x16ff8a,'anchorData':_0x270dee};}['_getExecuteDataInTable'](){const _0x2f5043=this['editor']['model']['document']['selection'],_0x2f98fb=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4b27bb=_0x2f5043['getFirstRange']()['start']['parent']['parent'],_0x221f33=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4b27bb),this['editor']['model']['createPositionAfter'](_0x4b27bb)),_0x184fa2=this['_wrapWithCommonAncestors'](_0x2f98fb,_0x221f33['start'],_0x221f33['end']);this['_copyMarkersToFragment'](_0x184fa2,_0x2f5043,{'isTableSelection':!0x0});const _0x1da742=_0x2f5043['getFirstRange']()['start'],_0x350fc9=new Map();let _0x1e0592=_0x184fa2;for(let _0x3f054a=0x0;_0x3f054a<_0x1da742['path']['length'];_0x3f054a++)if(_0x350fc9['set'](_0x1e0592,_0x1da742['path'][_0x3f054a]),_0x3f054a<_0x1da742['path']['length']-0x1)_0x1e0592=_0x1e0592['getChild'](0x0);else{let _0x57e629=_0x1e0592['nextSibling'];for(;_0x57e629;)_0x350fc9['set'](_0x57e629,_0x1da742['path'][_0x3f054a]),_0x57e629=_0x57e629['nextSibling'];}return{'modelFragment':_0x184fa2,'anchorData':_0x350fc9};}async['_executeAction'](_0x5a36df,_0x3e82f5,_0x1525b1,_0x406701,_0x4950b5){const _0x555a93=this['editor']['plugins']['get'](D),_0x332d4f=this['editor']['plugins']['get'](P),_0x28483f=this['editor']['model']['document']['selection'],_0x45632f=await _0x555a93['modelToDataWithIds'](_0x3e82f5),_0x4c87a2=this['editor']['model']['document']['version'],_0x15ed43=[..._0x28483f['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x332d4f['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x406701,'icon':_0x4950b5||_0x45cf17,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x15ed43,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x332d4f),this['_interactionParams']={'action':_0x5a36df,'content':_0x45632f,'version':_0x4c87a2,'aiBalloon':_0x332d4f,'modelFragment':_0x3e82f5,'anchorData':_0x1525b1},this['_setupApplyListeners'](),this['listenTo'](_0x332d4f,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x332d4f,'dialogClosed',(_0x31e7ef,{id:_0x1cc741})=>{if('aiActionsBalloon'===_0x1cc741){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x433894=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x36071f=_0x433894['changeGroups'][0x0];_0x36071f&&'pending'===_0x36071f['state']&&_0x433894['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x332d4f);}}),this['_createInteraction'](_0x45632f,_0x4c87a2,_0x332d4f,_0x5a36df);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x5438a8,anchorData:_0x3acf4e}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x5438a8,_0x3acf4e,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x5438a8,_0x3acf4e,!0x0);});}['_wrapWithCommonAncestors'](_0x5645f2,_0x58bc03,_0xca6788){const _0x2886d1=this['editor']['model']['createRange'](_0x58bc03,_0xca6788)['getCommonAncestor'](),_0x352403=_0x2886d1['is']('documentFragment')?[]:_0x2886d1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x352403['length']){const _0x29ee0a=_0x352403['map'](_0x2f51b7=>_0x2f51b7['_clone'](!0x1));for(let _0x5da8f1=0x1;_0x5da8f1<_0x29ee0a['length'];_0x5da8f1++)_0x29ee0a[_0x5da8f1-0x1]['_appendChild'](_0x29ee0a[_0x5da8f1]);return _0x29ee0a[_0x29ee0a['length']-0x1]['_appendChild'](_0x5645f2),new _0x1a00f1(_0x29ee0a[0x0]);}return _0x5645f2;}['_copyMarkersToFragment'](_0xe40c10,_0x5b0413,_0x5d9447={'isTableSelection':!0x1}){const _0x457e69=this['editor']['model'],_0x3ea2f8=Array['from'](_0x5b0413['getRanges']()),_0x3d4bd9=_0x5b0413['getFirstRange']()['start'];for(const _0x1d612c of _0x457e69['markers']){if(_0x1d612c['name']['startsWith'](F)||!_0x1d612c['affectsData'])continue;const _0x5d3312=_0x1d612c['getRange']();if(!_0x3ea2f8['some'](_0x212c06=>_0x212c06['containsRange'](_0x5d3312,!0x0)))continue;const _0xb72b22=this['_regularCalculateMarkerPath'](_0x5d3312['start'],_0x3d4bd9,_0x5d9447['isTableSelection']),_0x50655=this['_regularCalculateMarkerPath'](_0x5d3312['end'],_0x3d4bd9,_0x5d9447['isTableSelection']),_0x5cd46c=_0x457e69['createPositionFromPath'](_0xe40c10,_0xb72b22),_0x45c9fe=_0x457e69['createPositionFromPath'](_0xe40c10,_0x50655);if(!_0x5cd46c['isEqual'](_0x45c9fe)){const _0x277291=_0x457e69['createRange'](_0x5cd46c,_0x45c9fe);_0xe40c10['markers']['set'](_0x1d612c['name'],_0x277291);}}}['_regularCalculateMarkerPath'](_0x3132ce,_0x59cde1,_0xcd3b52=!0x1){const _0x2deb21=[..._0x3132ce['path']['slice']()];for(let _0x94caec=0x0;_0x94caec<Math['max'](_0x59cde1['path']['length'],_0x3132ce['path']['length']);_0x94caec++){const _0x1514f8=_0x59cde1['path'][_0x94caec]||0x0,_0x8d823e=(_0x3132ce['path'][_0x94caec]||0x0)-_0x1514f8;if(_0x2deb21[_0x94caec]=_0x8d823e,0x0!==_0x8d823e&&!_0xcd3b52)break;}return _0x2deb21;}async['_createInteraction'](_0x38a6e7,_0x4a0c98,_0x1d0002,_0xfd3978){const _0x14f059=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0xfd3978,'content':_0x38a6e7,'version':_0x4a0c98,'aiBalloon':_0x1d0002,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x4750f9=new O({'connector':this['_aiConnector'],'editor':_0x14f059,'content':_0x38a6e7,'version':_0x4a0c98,..._0xfd3978});this['_interactions']['push'](_0x4750f9);const _0x470772=(_0x6c2fb0,_0x3bc4f6=!0x1,_0xa3a91c='streaming')=>this['_promiseQueue']['enqueue'](async _0x42f283=>{try{const _0x5d25d5=q({'editor':_0x14f059,'changeGroups':_0x6c2fb0['changeGroups'],'documentContextContent':_0x6c2fb0['documentContextContent'],'showDiff':_0x3bc4f6,'trimUnchanged':!0x1});_0x5d25d5['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5d25d5[0x0],'renderingStrategy':_0xa3a91c,'abortSignal':_0x42f283});}catch(_0x2d74c2){if(this['_isAbortError'](_0x2d74c2))return;throw _0x2d74c2;}});this['_interaction']['on']('replyCreated',(_0xdf4972,_0xf509bb)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x470772(_0xf509bb)['catch'](_0x10ee79=>{this['_isAbortError'](_0x10ee79)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x10ee79),this['_setErrorState'](_0x4750f9));});}),this['_interaction']['on']('replyContentUpdated',(_0x153ca1,_0x4f1299)=>{_0x470772(_0x4f1299)['catch'](_0x211baa=>{this['_isAbortError'](_0x211baa)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x211baa),this['_setErrorState'](_0x4750f9));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x483477){this['_isAbortError'](_0x483477)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x483477),this['_setErrorState'](_0x4750f9));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1ad174,{showDiff:_0x761d5e})=>{try{this['_balloonShowDiff']=_0x761d5e;const _0x57e6f0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x57e6f0&&await _0x470772(_0x57e6f0,_0x761d5e,'static');}catch(_0xc529aa){this['_isAbortError'](_0xc529aa)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0xc529aa),this['_setErrorState'](_0x4750f9));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x2a44d7,{reply:_0x403fcd})=>{const _0x458f81={'positiveCount':_0x403fcd['changeGroups']['filter'](_0x4f545a=>'accepted'===_0x4f545a['state'])['length'],'totalCount':_0x403fcd['changeGroups']['length']},_0x522546=this['_interaction']['actionCallId'],_0x454589=this['_interaction']['actionName'];_0x454589?this['_aiConnector']['upsertAIActionRating'](_0x454589,_0x522546,_0x458f81):this['_aiConnector']['upsertCustomAIActionRating'](_0x522546,_0x458f81);}),this['_setLoadingState']();try{const _0x545aa6=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x545aa6;}catch(_0x1ff521){if(this['_isAbortError'](_0x1ff521))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x4750f9);}}['_applyChanges'](_0x12c258,_0x5f3144,_0x3a7a7e){const _0x1dd7bc=this['editor'];if(_0x3a7a7e&&!_0x1dd7bc['plugins']['has']('TrackChanges'))throw new _0x32ab89('ai-no-track-changes',null);const _0x1ef34e=this['editor']['plugins']['get'](_0xac1d67),_0x4c3f40=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4c3f40||!_0x4c3f40['replies']['length'])return;const _0x14f774=_0x4c3f40['replies'][_0x4c3f40['replies']['length']-0x1],_0x45cfbc=_0x14f774['changeGroups'];_0x14f774['setChangeGroupState'](0x0,'accepted');let _0x2cf33f=W({'editor':_0x1dd7bc,'reply':_0x14f774,'interaction':_0x4c3f40,'groups':_0x45cfbc,'transform':!0x1,'documentCompare':_0x1ef34e,'documentCompareOptions':{'anchor':_0x1dd7bc['model']['createPositionAt'](_0x12c258,0x0),'markDeletions':_0x3a7a7e}});_0x2cf33f=this['_filterOperationsOutsideRange'](_0x2cf33f,_0x5f3144);for(const _0x3c2b32 of _0x2cf33f)this['_anchorOperation'](_0x5f3144,_0x3c2b32,_0x1dd7bc['model']['document']['getRoot']());const _0x4c930d=_0x4c3f40['getDocumentContext']()['version'],_0xadf33d=_0x1dd7bc['model']['document']['history']['getOperations'](_0x4c930d),_0x11fc34={'document':_0x1dd7bc['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x41978b=_0x471b37(_0x2cf33f,_0xadf33d,_0x11fc34)['operationsA'];_0x1dd7bc['model']['change'](_0x161880=>{if(_0x161880['setSelection'](_0x1dd7bc['model']['document']['selection']['focus']),_0x3a7a7e)_0x1dd7bc['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x41978b);else{for(const _0x4b5c8f of _0x41978b)_0x4b5c8f['baseVersion']=_0x1dd7bc['model']['document']['version'],V(_0x1dd7bc,_0x4b5c8f),_0x161880['batch']['addOperation'](_0x4b5c8f),_0x1dd7bc['model']['applyOperation'](_0x4b5c8f);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x10cd27,_0x25f73e){return _0x10cd27['filter'](_0x13f51c=>{if('rename'==_0x13f51c['type']){const _0x288e5d=_0x13f51c['position']['nodeAfter'];return!_0x25f73e['has'](_0x288e5d);}if(_0x13f51c['type']['indexOf']('Attribute')>-0x1){const _0x653ff5=_0x13f51c['range']['start']['nodeAfter'];return!_0x25f73e['has'](_0x653ff5);}return!0x0;});}['_anchorOperation'](_0x18eb04,_0x3956cb,_0x10abc7){const _0x249ea2=_0x3956cb['clone']();for(const _0xb2abcd in _0x3956cb){const _0x2b3ae7=_0x3956cb[_0xb2abcd];_0x2b3ae7 instanceof _0x21f9f5?_0x3956cb[_0xb2abcd]=new _0x21f9f5(_0x2fcfe2(_0x2b3ae7['start']),_0x2fcfe2(_0x2b3ae7['end'])):_0x2b3ae7 instanceof _0x192d6b&&(_0x3956cb[_0xb2abcd]=_0x2fcfe2(_0x2b3ae7));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x249ea2['type'])){if(_0x249ea2['isDocumentOperation']=!0x1,_0x249ea2['baseVersion']=null,'remove'==_0x249ea2['type']){const _0x182f90=_0x249ea2['sourcePosition'],_0x42d4c2=_0x249ea2['howMany'];new _0x515526(_0x182f90,_0x42d4c2)['_execute']();}else _0x249ea2['_execute']();}function _0x2fcfe2(_0x431895){if('$graveyard'==_0x431895['root']['rootName'])return _0x431895;const _0x3a45cb=[];let _0x4ef981=_0x431895['root'];for(let _0x3d9426=0x0;_0x3d9426<_0x431895['path']['length'];_0x3d9426++){const _0x5a6ef7=_0x18eb04['get'](_0x4ef981)||0x0;_0x3a45cb[_0x3d9426]=_0x431895['path'][_0x3d9426]+_0x5a6ef7,_0x4ef981=_0x4ef981['getChildAtOffset'](_0x431895['path'][_0x3d9426]);}return new _0x192d6b(_0x10abc7,_0x3a45cb,_0x431895['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x157f40,content:_0x12a6f6,version:_0x5f3a17,aiBalloon:_0xcbc59b}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x12a6f6,_0x5f3a17,_0xcbc59b,_0x157f40)['catch'](_0x66876b=>{this['_isAbortError'](_0x66876b)||console['error']('Error\x20refreshing\x20interaction:',_0x66876b);});}['_isAbortError'](_0x529387){return!!_0x529387['message']&&_0x529387['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x51682d=this['_interactions']['length'];this['_currentInteractionIndex']<_0x51682d-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5bc040){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5bc040;const _0x45ac1b=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x45ac1b)return;if(_0x45ac1b['hasError'])return this['_setErrorState'](_0x45ac1b),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x45ac1b['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x3b9864=_0x45ac1b['replies'][_0x45ac1b['replies']['length']-0x1];if(_0x3b9864){const _0x279972=this['editor'];try{const _0x4f0280=q({'editor':_0x279972,'changeGroups':_0x3b9864['changeGroups'],'documentContextContent':_0x3b9864['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x972c77=>setTimeout(_0x972c77,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4f0280[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x54e89e){this['_isAbortError'](_0x54e89e)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x54e89e);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x3a18c7){const _0x539faf=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x539faf),_0x3a18c7['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class Ha extends _0x539ee4{static get['requires'](){return[ri,si,ci];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x61b889){super(_0x61b889),_0x61b889['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Os extends _0x2d8061{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x89d97,_0x5f0437){super(_0x89d97),this['id']=_0x5f0437,this['set']('status','pending'),this['set']('changeId',_0x5f0437),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x198fef,_0x33c915)=>{_0x33c915&&_0x33c915['target']&&'A'===_0x33c915['target']['tagName']&&_0x33c915['preventDefault'](),this['fire']('activateChange',{'id':_0x5f0437,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x5f0437,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x5f0437,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2ab495=new _0x2d8061(this['locale']);return _0x2ab495['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x36359a=>!_0x36359a)]}}),_0x2ab495;}['_createAcceptButtonView'](){const _0x2788c1=new _0x3c2d24(this['locale']);return _0x2788c1['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2788c1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1d0bc7=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x1d0bc7['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x107ec0=>'pending'!==_0x107ec0&&'accepted'!==_0x107ec0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x32ab7f=>'pending'===_0x32ab7f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x9d35f8=>'accepted'===_0x9d35f8)]}}),this['on']('change:status',(_0x213627,_0x32de1c,_0x26a51d)=>{_0x2788c1['isEnabled']='pending'===_0x26a51d,'accepted'===_0x26a51d&&(_0x2788c1['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2788c1['icon']=_0x35b8d8);}),_0x2788c1;}['_createDismissButtonView'](){const _0x5d0b77=new _0x3c2d24(this['locale']);return _0x5d0b77['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5d0b77['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5384b0=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x5384b0['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x4be0fe=>'pending'!==_0x4be0fe&&'rejected'!==_0x4be0fe),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x23ca7a=>'pending'===_0x23ca7a),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xd817ae=>'rejected'===_0xd817ae)]}}),this['on']('change:status',(_0x4bea4f,_0x4f68af,_0x14f2ce)=>{_0x5d0b77['isEnabled']='pending'===_0x14f2ce,'rejected'===_0x14f2ce&&(_0x5d0b77['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5d0b77['icon']=_0x2d25cb);}),_0x5d0b77;}['_createInfoButtonView'](){const _0x5839c4=new _0x3c2d24(this['locale']);return _0x5839c4['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4a3016,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x5839c4['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4e63c5=>_0x4e63c5),_0x5839c4['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x5839c4;}['_createOutdatedButtonView'](){const _0x59decd=new _0x3c2d24(this['locale']);return _0x59decd['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x16115a,'withText':!0x0,'isEnabled':!0x1}),_0x59decd['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x225b45=>'outdated'!==_0x225b45)],'disabled':'disabled'}}),_0x59decd;}}class ee extends _0x90b260{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x45648c,_0x532ded){super(_0x45648c),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x532ded['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x25e628){this['resultItemView']['changeId']=_0x25e628['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x25e628['contentDiffed'];}['showBalloon'](_0x2c8e91,_0x1c43ae,_0x5e7c83,_0x443385,_0x4484ca,_0x33702a){const _0x3d5d27=_0x1c43ae();if(!_0x3d5d27)return;this['updateContent'](_0x2c8e91),this['show']();const _0x3e55e6=Array['from'](_0x3d5d27['getClientRects']())['reverse'](),_0x5ecba5=this['_getPointedRectIndexFromEvent'](_0x5e7c83,_0x3e55e6),_0x159151=_0x3e55e6[_0x5ecba5??0x0];'click'===_0x443385?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1c43ae(),_0x5ecba5,_0x2c8e91['id'],_0x4484ca,_0x33702a)||_0x159151})):'hover'===_0x443385&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1c43ae(),_0x5ecba5,_0x2c8e91['id'])||_0x159151}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x579de4({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x54c8e6=[this['element']];return this['_pinnedTargetElement']&&_0x54c8e6['push'](this['_pinnedTargetElement']),_0x54c8e6;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x2f9103=new _0x2d8061();return this['resultItemView']=new Os(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2f9103['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x2f9103;}['_getBestRectPositionOnClick'](_0x4374d4,_0x209b63,_0x30c2f2,_0x1f597c,_0x1e9867){if(!_0x4374d4)return null;const _0xeb9620=this['position']['replace']('arrow_',''),_0x34db02=Array['from'](_0x4374d4['getClientRects']());let _0x25144c,_0x5a2cd8=_0x34db02['reverse']();return void 0x0!==_0x209b63&&this['_isPinnedRectVisible'](_0x5a2cd8[_0x209b63],_0x1f597c,_0x1e9867)?(_0x25144c=_0x5a2cd8[_0x209b63],this['_pinnedRectIndex']=_0x209b63):this['_isPinnedRectVisible'](_0x5a2cd8[0x0],_0x1f597c,_0x1e9867)&&void 0x0===_0x209b63?_0x25144c=_0x5a2cd8[0x0]:(_0x5a2cd8='s'==_0xeb9620[0x0]?[..._0x34db02]['reverse']():_0x34db02,_0x5a2cd8['forEach'](_0x4ad749=>{this['_isPinnedRectVisible'](_0x4ad749,_0x1f597c,_0x1e9867)&&(_0x25144c=_0x4ad749);})),this['_pinnedTargetChangeId']=_0x30c2f2,this['_pinnedTargetElement']=_0x4374d4,_0x25144c||_0x4374d4['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x11e8eb,_0x3524ee,_0x31e254){if(!_0x11e8eb)return null;const _0x7fd595=Array['from'](_0x11e8eb['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x3524ee&&this['_pinnedTargetChangeId']!==_0x31e254)return this['_pinnedRectIndex']=_0x3524ee,this['_pinnedTargetElement']=_0x11e8eb,this['_pinnedTargetChangeId']=_0x31e254,_0x7fd595[_0x3524ee];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x31e254){if(_0x11e8eb!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x7fd595[this['_pinnedRectIndex']];}return void 0x0!==_0x3524ee&&this['_pinnedTargetChangeId']!==_0x31e254?(this['_pinnedRectIndex']=_0x3524ee,this['_pinnedTargetElement']=_0x11e8eb,this['_pinnedTargetChangeId']=_0x31e254,_0x7fd595[_0x3524ee]):_0x11e8eb['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5e113f,_0x31ea88){if(_0x5e113f)for(let _0x5d76af=0x0;_0x5d76af<_0x31ea88['length'];_0x5d76af++){const _0x1ba873=_0x31ea88[_0x5d76af];if(_0x5e113f['clientX']>=_0x1ba873['left']-0x3&&_0x5e113f['clientX']<=_0x1ba873['right']+0x3&&_0x5e113f['clientY']>=_0x1ba873['top']-0x3&&_0x5e113f['clientY']<=_0x1ba873['bottom']+0x3)return _0x5d76af;}}['_isPinnedRectVisible'](_0x3c731d,_0x5bcab8,_0x21f4fb){const _0x405ea5=new bt(_0x3c731d),_0x1e5bc4=_0x5bcab8||document['documentElement'],_0x53e04b=_0x405ea5['getIntersection'](_0x3c03a9(_0x21f4fb)),_0x554121=new bt(_0x1e5bc4)['getIntersection'](_0x405ea5);return!!(_0x53e04b&&_0x554121&&_0x405ea5['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class _e extends _0x47e329{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[ht];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ddd08){super(_0x1ddd08),this['_bodyCollection']=new _0x4bb856(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new ee(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xa41158=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xa41158);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x140a55){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4261b6=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x140a55,_0x4261b6);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xbdad3a){_0xbdad3a&&('error-general'!==_0xbdad3a['status']?'error-chunk'!==_0xbdad3a['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x2cab45){this['_mainView']['addCheckRunResult'](_0x2cab45);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x4867ad){this['_mainView']['showGeneralReviewCoreErrorView'](_0x4867ad??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3f84a8,_0x85e66d){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3f84a8,_0x85e66d);}['setActiveStateInResults'](_0x47d3d9){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x48dd10=>{_0x48dd10['id']===_0x47d3d9&&_0x48dd10['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x507eb1=>_0x507eb1['setItemAsInactive']());}['updateChangeState'](_0x3f09f8,_0x3099da){'accepted'===_0x3099da||'rejected'===_0x3099da||'outdated'===_0x3099da?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3f09f8,_0x3099da):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3f09f8,_0x3099da);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x399fdf,_0x42db61,_0x4bd70e,_0x2060e7,_0xfa13e7,_0x20a6db){this['_balloonSuggestionView']['showBalloon'](_0x399fdf,_0x42db61,_0x4bd70e,_0x2060e7,_0xfa13e7,_0x20a6db);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x40295f){const _0x3eb6ba=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5a4619=>_0x5a4619['id']===_0x40295f);return _0x3eb6ba?_0x3eb6ba['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x2d8061{constructor(_0x107f1e){super(_0x107f1e),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5130a5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5130a5['if']('isVisible','ck-hidden',_0x10f889=>!_0x10f889)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5130a5['to']('errorMessage')}]}]});}}class ve extends _0x2d8061{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5c0725,_0x13c49c){super(_0x5c0725),this['reviewCoreHeader']=_0x13c49c['header'],this['generalErrorView']=new sh(_0x5c0725),this['reviewCheckListView']=_0x13c49c['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x13c49c['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x13c49c['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x13eab0){this['reviewCheckResultsView']['addResult'](_0x13eab0),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x5ae6ba){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5ae6ba;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class wr extends _0x3c2d24{constructor(_0x2a9bbf,_0xc5bbd9){super(_0xc5bbd9),this['set']({'label':_0x2a9bbf,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Ie extends _0x8f7dd0{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0xce6876,_0x450fdf){super(_0xce6876),this['_contents']=_0x450fdf,this['_resultViews']=new _0x215181(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new xi(_0xce6876),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x330c4e=this['_createCombinedSkeletonLoader'](),_0x2a0fe7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x2a0fe7['if']('isLoading','ck-ai_review__check-run_loading',_0x2e8fa5=>_0x2e8fa5),_0x2a0fe7['if']('isResultReady','ck-ai_review__check-run_ready',_0x13585e=>_0x13585e),_0x2a0fe7['if']('isVisible','ck-hidden',_0x2cd14a=>!_0x2cd14a)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5b38b0=>_0x5b38b0)]},'children':this['_resultViews']},_0x330c4e]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x101442){const _0x44f7a0=new Os(this['locale'],_0x101442['id']);_0x44f7a0['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x44f7a0),_0x44f7a0['resultResponseView']['element']['innerHTML']=_0x101442['contentDiffed'];}['hideResult'](_0x3aa4b0,_0x4b6b9f){if('pending'===_0x4b6b9f)return;const _0x3916d0=this['_resultViews']['find'](_0x3b14a6=>_0x3b14a6['id']===_0x3aa4b0);_0x3916d0&&(_0x3916d0['status']=_0x4b6b9f,_0x3916d0['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x859e60,_0x4b277a){if('pending'!==_0x4b277a)return;const _0x56bde6=this['_resultViews']['find'](_0x1283fe=>_0x1283fe['id']===_0x859e60);_0x56bde6&&(_0x56bde6['status']=_0x4b277a,_0x56bde6['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x1a7bf8,_0x586379){this['headerTitle']=_0x1a7bf8,this['headerSubtitle']=_0x586379||'';}['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 fi(this['locale'],wi['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x3eec73=new _0x2d8061(this['locale']),_0x5ea9c0=[];for(let _0x42a3c6=0x0;_0x42a3c6<0x10;_0x42a3c6++){const _0x201ddc=this['_createSkeletonLoader']();_0x201ddc['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5ea9c0['push'](_0x201ddc);}return _0x3eec73['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x41c3cd=>!_0x41c3cd)]},'children':_0x5ea9c0}),_0x3eec73;}['_createErrorView'](){const _0x289f21=new _0x2d8061(this['locale']),_0x5b020c=new _0x3c2d24(this['locale']),t=this['locale']['t'];return _0x289f21['delegate']('retryReview')['to'](this),_0x5b020c['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x5b020c['on']('execute',()=>{this['fire']('retryReview');}),_0x289f21['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x39423c=>!_0x39423c),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x536e4c=>'chunk'===_0x536e4c)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x59a360=>'chunk'===_0x59a360)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x364447=>'general'!==_0x364447)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3d8c76=>'chunk'!==_0x3d8c76)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x5b020c]}),_0x289f21;}['_createCancelButtonView'](){const _0x2442ee=new _0x3c2d24(this['locale']);return _0x2442ee['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0x45c531}),_0x2442ee['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x378005=>_0x378005),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x38e8c5=>_0x38e8c5)]}}),_0x2442ee['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2442ee;}['_createToggleDiffButtonView'](){const _0x569f07=new _0x3c2d24(this['locale']);_0x569f07['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x569f07['bind']('isEnabled')['to'](this,'isError',_0x330104=>!_0x330104),_0x569f07['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x78b578=>!_0x78b578),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x473a91=>_0x473a91)]}});const _0x3fb14f=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x14eb64=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x569f07['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2516ae=>_0x2516ae),_0x569f07['bind']('icon')['to'](this,'isToggleDiffOn',_0x3c2c85=>_0x3c2c85?_0x232f9e:_0x12db4d),_0x569f07['bind']('label')['to'](this,'isToggleDiffOn',_0x4e32a9=>_0x4e32a9?_0x3fb14f:_0x14eb64),_0x569f07['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x569f07;}['_createAcceptAllButtonView'](){const _0x420cbb=new _0x3c2d24(this['locale']);return _0x420cbb['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x420cbb['bind']('isEnabled')['to'](this,'isError',_0xb82713=>!_0xb82713),_0x420cbb['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x499e6a=>!_0x499e6a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xdd8baa=>_0xdd8baa)]}}),_0x420cbb['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x420cbb;}['_createExitReviewButtonView'](){const _0x202428=new _0x3c2d24(this['locale']);return _0x202428['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x202428['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x531c35=>!_0x531c35),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x40ed32=>_0x40ed32)]}}),_0x202428['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x202428;}['_createResultHeaderView'](){const _0x6401de=new _0x2d8061(this['locale']),_0x15c9a0=this['_createTitleView']();return _0x6401de['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x3fc731=>_0x3fc731)]},'children':[_0x15c9a0,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x6401de;}['_createTitleView'](){const _0x4ae7c2=new _0x2d8061(this['locale']),_0x389135=new ki();return _0x389135['bind']('isVisible')['to'](this,'isResultReady',_0xdc3ed6=>!_0xdc3ed6),_0x4ae7c2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x389135,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d3cf8=>_0x2d3cf8)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x548efa=>!_0x548efa)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x4ae7c2;}['_createFinishReviewButtonView'](){const _0x184460=new wr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x184460['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1dd63d=>!_0x1dd63d)]}}),_0x184460['delegate']('finishReview')['to'](this),_0x184460;}}class Re extends _0x8f7dd0{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0xf55eb8,_0x492306){super(_0xf55eb8),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x492306['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x492306['headerText']);const _0x155c97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x155c97['if']('isVisible','ck-hidden',_0x1d0aff=>!_0x1d0aff)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x492306['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0xc831f6){const _0x31b0ed=new wr(_0xc831f6,this['locale']);return _0x31b0ed['delegate']('finishReview')['to'](this),_0x31b0ed;}['_createResultHeaderView'](_0x228e0f){const _0x5b317b=new _0x2d8061(this['locale']);return _0x5b317b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x228e0f}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5b317b;}}class Dr extends _0x2d8061{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x4cfd2b,_0x3804e5){super(_0x4cfd2b),this['_defaultValue']=_0x3804e5['default']||(_0x3804e5['data']['length']>0x0?_0x3804e5['data'][0x0]['id']:''),this['_defaultLabel']=_0x3804e5['data']['find'](_0x532329=>_0x532329['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x59c3f3(this['locale']);const _0x4d4386=this['_prepareListOptions'](_0x3804e5['data']);_0x1c418d(this['_dropdownView'],_0x4d4386,{'role':'menu','ariaLabel':_0x3804e5['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x10f3eb=>{_0x10f3eb['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4f21c0=>{this['formValue']=_0x4f21c0['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4f21c0['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x57aff6=[]){const _0x396b99=new _0xf46d2e();this['resetToDefault']();for(const _0x582821 of _0x57aff6){const _0x19139b=new _0x491ca2({'label':_0x582821['label'],'withText':!0x0,'role':'menuitemradio','id':_0x582821['id'],'model':_0x582821});_0x19139b['bind']('isOn')['to'](this,'formValue',_0x364a0e=>_0x364a0e===_0x19139b['id']);const _0xdf00b5={'type':'button','model':_0x19139b};_0x396b99['add'](_0xdf00b5);}return _0x396b99;}}class tc extends _0x8f7dd0{['_formItem']=null;constructor(_0x34be0f,_0x331f7f,_0x5a5ec7){super(_0x34be0f),this['argsKey']=_0x331f7f?.['argsKey'];if('dropdown'===_0x331f7f['formType'])this['_formItem']=new Dr(this['locale'],_0x331f7f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x47f054=new _0x60f2e3(this['locale'],{'children':[this['_formItem']],'class':[_0x5a5ec7?'ck-form__row_with-submit':'']});_0x5a5ec7&&_0x47f054['children']['add'](_0x5a5ec7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x47f054]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Xs extends _0x5121e5{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x4efcdf){super(_0x4efcdf),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x151440(),this['minRows']=Xs['MIN_ROWS'],this['maxRows']=Xs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class sc extends _0x2d8061{['focusTracker']=new _0x59aa0e();['keystrokes']=new _0x151440();['focusCycler'];['_focusables']=new _0x215181();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3c66f8,_0x3906e0,_0x1ed0a4=!0x1){super(_0x3c66f8),this['_check']=_0x3906e0,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3906e0['defaultModel']?_0x3906e0['defaultModel']['id']:'',this['_defaultLabel']=_0x3906e0['defaultModel']?_0x3906e0['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x26be3f(this['locale'],()=>new Xs(_0x3c66f8)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0xf46d2e(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x1ed0a4),_0x1c418d(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x60f2e3(this['locale'],{'children':[this['promptInputView']]}),new _0x60f2e3(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x26762c,_0x3992aa)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x3992aa()):_0x3992aa();}),this['focusCycler']=new _0x2427c3({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x4cadb7=>{this['_focusables']['add'](_0x4cadb7),this['focusTracker']['add'](_0x4cadb7['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x159f59 of this['_getFormValidators']()){const _0x1517db=_0x159f59();if(_0x1517db)return this['promptInputView']['errorText']=_0x1517db,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x3a90f4=new _0x3c2d24(this['locale']),t=this['locale']['t'];return _0x3a90f4['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a90f4['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3a90f4;}['_createCancelButtonView'](){const _0x1748ad=new _0x3c2d24(this['locale']),t=this['locale']['t'];return _0x1748ad['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x1748ad['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5676bf=>{_0x5676bf['stopPropagation']();})}}),_0x1748ad['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x1748ad;}['_setModelList'](_0x1fb12d){this['_modelSelectionDropdownItems']['clear']();const _0x40f1eb=this['_check']['models'];if(_0x1fb12d)this['set']('modelDisplayMode','hidden');else{const _0x4a568d=0x1===_0x40f1eb['length'];this['set']('modelDisplayMode',_0x4a568d?'name':'selector');}if(this['resetToDefault'](),_0x40f1eb?.['length']){0x1===_0x40f1eb['length']&&this['set']('activeModelName',_0x40f1eb[0x0]['name']||_0x40f1eb[0x0]['id']);for(const _0x5ddcc8 of _0x40f1eb){const _0x4a6f01=new _0x491ca2({'label':_0x5ddcc8['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5ddcc8['id'],'model':_0x5ddcc8});_0x4a6f01['bind']('isOn')['to'](this,'modelId',_0xf6cca2=>_0xf6cca2===_0x5ddcc8['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4a6f01,'labelView':new ho(this['locale'],_0x5ddcc8)});}}}['_createModelSelectionDropdown'](){const _0x180556=_0x59c3f3(this['locale']);return _0x180556['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x180556['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x180556['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0xe09bc0=>'selector'===_0xe09bc0),this['listenTo'](_0x180556,'execute',_0x279d36=>{this['modelId']=_0x279d36['source']['model']['id'],_0x180556['buttonView']['label']=_0x279d36['source']['label'];}),_0x180556;}['_createModelNameView'](){const _0x743f4=new Zs(this['locale']);return _0x743f4['bind']('text')['to'](this,'activeModelName',_0x26ecf9=>_0x26ecf9??''),_0x743f4['bind']('isVisible')['to'](this,'modelDisplayMode',_0x359cae=>'name'===_0x359cae),_0x743f4;}['_createActionsFooterView'](){const _0x3ea3e5=new _0x2d8061(this['locale']);return _0x3ea3e5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x3ea3e5;}}class Zs extends _0x2d8061{constructor(_0x53fe53){super(_0x53fe53),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x41be1a=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x41be1a['if']('isVisible','ck-hidden',_0x45e47e=>!_0x45e47e)]},'children':[{'text':_0x41be1a['to']('text')}]});}}class ho extends _0x4566cf{constructor(_0x13b029,_0x2909c2){super();const _0x595fa8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x595fa8['to']('style'),'id':_0x595fa8['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x595fa8['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2909c2['description']||'']}]}]});}}class ec extends _0x8f7dd0{['_formItemsCollection']=new _0x215181();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x30aa1d,_0x5b561a,_0x52dc3a,_0x2d9e33=!0x1){super(_0x30aa1d),this['_hideModels']=_0x2d9e33,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x5b561a['isParameterized']);const _0x2eca5d=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x327293=>_0x327293),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x5d6bc3=>_0x5d6bc3)],'style':{'--ck-ai-review-check-list-item-index':_0x52dc3a}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x5b561a['title']}]},_0x2eca5d]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x5b561a['description']?[{'text':_0x5b561a['description']}]:[]}]}]},..._0x5b561a['isParameterized']?[this['_createParameterizedView'](_0x5b561a)]:[],...'custom'===_0x5b561a['id']?[this['_createCustomView'](_0x5b561a,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x5b561a['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x5b561a['id'],'args':_0x5b561a['useArgs']?_0x5b561a['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x579de4({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2a474d=>{_0x2a474d['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x89a879=new _0x4dad4f();return _0x89a879['content']=_0x2b659e,_0x89a879['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x89a879;}['_createParameterizedView'](_0x2fbc2a){const _0x2f88e1=new _0x2d8061(),_0x1b48f3=this['_createFormView'](_0x2fbc2a);return _0x2f88e1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x9b815e=>!_0x9b815e)]},'children':[_0x1b48f3]}),_0x2f88e1;}['_createFormView'](_0x3c1ebf){const _0x50b968=new _0x2d8061(),_0x22e102=Array['isArray'](_0x3c1ebf['options'])?_0x3c1ebf['options']:[],_0x4ad0dc=new _0x3c2d24(this['locale']),t=this['locale']['t'];_0x4ad0dc['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x4ad0dc['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x522694=>{_0x522694['stopPropagation']();})}}),_0x4ad0dc['on']('execute',()=>{const _0x51335c=[],_0x4e8724={};this['_formItemsCollection']['forEach'](_0xe3c97f=>{_0x51335c['push'](_0xe3c97f['value']),_0x3c1ebf['useArgs']&&_0x3c1ebf['options']&&(_0x4e8724[_0xe3c97f['argsKey']]=_0xe3c97f['value']);}),this['fire']('runReviewCheck',{'id':_0x3c1ebf['id'],'params':_0x51335c['length']?_0x51335c:void 0x0,'args':Object['keys'](_0x4e8724)['length']?_0x4e8724:void 0x0});});const _0x3c533d=_0x22e102['length'];return _0x22e102['forEach']((_0x2fbd19,_0xd5d651)=>{const _0x4db124=_0xd5d651===_0x3c533d-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x2fbd19,_0x4db124?_0x4ad0dc:null));}),_0x50b968['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x50b968;}['_createCustomView'](_0x5d25a7,_0x29b0bd=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x5d25a7,_0x29b0bd),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x254bf3=>!_0x254bf3)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x59053f,_0x42fcd4,_0x5bc2a9)=>{_0x5bc2a9||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class he extends _0x8f7dd0{['_checkViews'];constructor(_0x58e9fd){super(_0x58e9fd),this['_checkViews']=new _0x215181(),this['_setupTemplate']();}['setChecks'](_0xd2a732,_0x338420=!0x1){this['_checkViews']['clear']();for(const [_0x5080c6,_0x2f580e]of _0xd2a732['entries']()){const _0x11c43c=new ec(this['locale'],_0x2f580e,_0x5080c6,_0x338420);_0x11c43c['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x11c43c);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0xc3cd73 of this['_checkViews'])_0xc3cd73 instanceof ec&&_0xc3cd73['resetToDefault']();}['_setupTemplate'](){const _0x1e4638=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1e4638['if']('isVisible','ck-hidden',_0x2920b3=>!_0x2920b3)]},'children':this['_checkViews']});}}class me extends _e{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x17e2f9=this['context']['locale'],_0x13e6e9=new _0x4b4b8d(_0x17e2f9,{'label':i(_0x17e2f9,'AI_REVIEW_MODE'),'icon':_0x54fb8d,'class':'ck-ai-header\x20ck-ai-header_review'});return new ve(this['context']['locale'],{'header':_0x13e6e9,'list':new he(_0x17e2f9),'results':new Ie(_0x17e2f9,{'generalErrorText':i(_0x17e2f9,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x17e2f9,{'headerText':i(_0x17e2f9,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x17e2f9,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x17e2f9,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x4575a5=this['context']['plugins']['get']('AITabs');_0x4575a5['view']['on']('activateTab',(_0x812331,_0x225a67)=>{'reviewMode'===_0x225a67?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x4575a5['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x54fb8d,'order':0x0,'content':this['_mainView']});}}const Kt='review-';class ge extends _0x47e329{static get['requires'](){return[_0xac1d67,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x2ec7c6){super(_0x2ec7c6),this['_domEmitter']=new(Lt())(),this['_eventEmitter']=new(Wt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x45f4f4=lt(this['context']);_0x45f4f4['conversion']['for']('editingDowncast')['markerToElement']({'model':Kt+'insert','view':(_0x2f496d,{writer:_0x372c3f})=>{const _0x56fe16=this['_markers']['get'](_0x2f496d['markerName']),_0x4a8cd6={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x56fe16?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2f496d['markerName']};return _0x372c3f['createUIElement']('span',_0x4a8cd6,function(_0x12ca30){const _0x3e648f=this['toDomElement'](_0x12ca30);return _0x3e648f['innerHTML']=_0x56fe16?.['content']?.['asString']||'',_0x3e648f;});}}),_0x45f4f4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kt+'remove-only','view':_0x32b088=>{const _0xcf9917=this['_markers']['get'](_0x32b088['markerName']),_0x4f7e83=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xcf9917?.['id']||'')&&_0x4f7e83['push']('ck-ai_review__change_active'),{'classes':_0x4f7e83,'attributes':{'data-marker-id':_0x32b088['markerName']}};}}),_0x45f4f4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kt+'remove-context','view':_0x5ccb6c=>{const _0x332bfa=this['_markers']['get'](_0x5ccb6c['markerName']),_0x39c80b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x332bfa?.['id']||'')&&_0x39c80b['push']('ck-ai_review__change_active'),{'classes':_0x39c80b,'attributes':{'data-marker-id':_0x5ccb6c['markerName']}};}}),_0x45f4f4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kt+'remove-text','view':_0x15d9b2=>{const _0x8cf45e=this['_markers']['get'](_0x15d9b2['markerName']),_0x4a7b4a=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x8cf45e?.['id']||'')&&_0x4a7b4a['push']('ck-ai_review__change_active'),{'classes':_0x4a7b4a,'attributes':{'data-marker-id':_0x15d9b2['markerName']}};}}),_0x45f4f4['conversion']['for']('dataDowncast')['markerToElement']({'model':Kt+'suggestion-context','view':(_0x2e20e1,{writer:_0x4b130e})=>_0x4b130e['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2e20e1['isOpening']?'start':'end')})}),_0x45f4f4['conversion']['for']('downcast')['attributeToAttribute']({'model':gt,'view':Ut});const _0xd21f55=_0x45f4f4['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0xd21f55,'mouseup',(_0x4761a1,_0x2ba48d)=>{const _0x30b4cc=_0x2ba48d['target'],_0x2548c1=this['_findMarkerElement'](_0x30b4cc);if(!_0x2548c1)return;const _0x30b72a=_0x2548c1['getAttribute']('data-marker-id'),_0x48fcb9=_0x30b72a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x30b72a,'changeId':_0x48fcb9,'markerElement':()=>this['_findMarkerElementById'](_0x30b72a),'domEvent':_0x2ba48d});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0xd21f55,'mouseover',(_0x123c7e,_0x425f2f)=>{const _0x52dbca=_0x425f2f['target'],_0x2fd9e3=_0x425f2f['relatedTarget'];let _0x36adb4=this['_findMarkerElement'](_0x52dbca);if(!_0x36adb4&&_0x2fd9e3&&(_0x36adb4=this['_findMarkerElement'](_0x2fd9e3)),!_0x36adb4)return;const _0x4889a2=_0x36adb4['getAttribute']('data-marker-id'),_0x3005c6=_0x4889a2['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x3005c6,'markerElement':()=>this['_findMarkerElementById'](_0x4889a2),'domEvent':_0x425f2f});}),this['_domEmitter']['listenTo'](document,'mouseover',Jt((_0x30bd72,_0x20f4fb)=>{const _0xe661a0=_0x20f4fb['target'];if(this['_findMarkerElement'](_0xe661a0))return;_0xe661a0['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x45f4f4['model']['document']['registerPostFixer'](_0x57757e=>this['_validateMarkers'](_0x45f4f4,_0x57757e)),_0x45f4f4['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x45f4f4));}['getDocumentData'](){const _0x54b074=this['context']['plugins']['get']('AIEditing'),_0x31a1e7=lt(this['context']),_0x557aa3=_0x31a1e7['model'],_0x1723f3=new _0x1a00f1();for(const _0xdcae00 of _0x557aa3['document']['getRoot']()['getChildren']()){const _0x33bb5c=_0xdcae00['_clone'](!0x0);_0x1723f3['_appendChild'](_0x33bb5c);}for(const _0x442824 of _0x557aa3['markers'])_0x1723f3['markers']['set'](_0x442824['name'],this['_changeRangeOwnerDocument'](_0x442824['getRange']()['clone'](),_0x1723f3));const _0x517721=new Gt({'ignoreElementEnd':!0x0,'startPosition':_0x557aa3['createPositionAt'](_0x1723f3,0x0)}),_0xda9ed4=new Set(),_0x397b53=new Map();for(const {item:_0x3e2de1}of _0x517721){if(!_0x3e2de1['is']('$textProxy'))continue;const _0x11d4a1=_0x3e2de1['parent'];if(_0x11d4a1&&_0x11d4a1['is']('element')){const _0x4a6ad4=this['_upsertDataId'](_0x11d4a1,()=>_0x54b074['_nextDataId'](_0xda9ed4));_0xda9ed4['add'](_0x4a6ad4);for(const _0x4ba423 of _0x11d4a1['getChildren']())_0x4ba423['is']('element')&&_0xda9ed4['add'](this['_upsertDataId'](_0x4ba423,()=>_0x54b074['_nextDataId'](_0xda9ed4)));let _0x3737f4=_0x11d4a1;for(;_0x3737f4['parent']&&!_0x3737f4['parent']['is']('documentFragment');)_0x3737f4=_0x3737f4['parent'],_0x3737f4['hasAttribute'](gt)&&_0x3737f4['_removeAttribute'](gt);_0x397b53['set'](_0x4a6ad4,{'path':_0x11d4a1['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3737f4['_clone'](!0x0),_0x4a6ad4,_0x31a1e7['data'])}),_0x517721['jumpTo'](_0x557aa3['createPositionAfter'](_0x11d4a1));}}return{'content':_0x31a1e7['data']['processor']['toData'](_0x31a1e7['data']['toView'](_0x1723f3)),'version':_0x31a1e7['model']['document']['version'],'elements':_0x397b53};}['diffContent'](_0x4004a6,_0x7dbb,_0x2e63e5=!0x1){const _0x374f09=[],_0x1835d2=lt(this['context']),_0x141d9d=_0x1835d2['data']['parse'](_0x7dbb,'$documentFragment'),_0x92fbe4=_0x1835d2['data']['parse'](_0x4004a6,'$documentFragment'),_0x5c5d61=_0x1835d2['model']['createPositionAt'](_0x92fbe4,0x0);if(this['_haveSingleTopLevelElement'](_0x141d9d)){if(!this['_hasSameTopLevelElement'](_0x92fbe4,_0x141d9d))return _0x374f09;}else{const _0x342794=_0x1835d2['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x92fbe4,_0x342794)||!this['_haveOnlyInlineContent'](_0x141d9d,_0x342794))return _0x374f09;}const _0x548449=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4004a6,_0x7dbb,{'anchor':_0x5c5d61,'markDeletions':!0x0})['getOperations']()['filter'](_0x4f2ed3=>'insert'===_0x4f2ed3['type']||'marker'===_0x4f2ed3['type']&&_0x4f2ed3['name']['startsWith']('$markedRemove')),_0x98ddef=this['_groupAdjacentOperations'](_0x548449),_0x3fe1b5=[];if(_0x2e63e5){if(_0x98ddef['length']){const _0x25242d=_0x98ddef[0x0]['operations'][0x0],_0x996096='insert'===_0x25242d['type']?_0x25242d['position']:_0x25242d['newRange']['start'],_0x17cb82=this['_getPositionLimitingRange'](_0x996096,_0x1835d2,'inside'),_0x32a108=_0x17cb82?_0x141d9d['getChild'](0x0)['getChildren']():_0x141d9d['getChildren'](),_0xfcab81=_0x17cb82||_0x1835d2['model']['createRangeIn'](_0x92fbe4),_0x489a5d=[new Bt('$markedRemove:synthetic'+_0xdeade1(),null,_0xfcab81,_0x1835d2['model']['document']['model']['markers'],!0x0,_0x1835d2['model']['document']['version']+0x1),new Ft(_0xfcab81['end'],_0x32a108,_0x1835d2['model']['document']['version']+0x2)];_0x3fe1b5['push']({'operations':_0x489a5d,'operationsIsolated':_0x489a5d,'groupOffset':0x0});}}else _0x3fe1b5['push'](..._0x98ddef);let _0x357ba2=0x0;return _0x1835d2['model']['change'](_0x4c67aa=>{for(let _0x1d1c71=0x0;_0x1d1c71<_0x3fe1b5['length'];_0x1d1c71++){const _0x55bd65=_0x3fe1b5[_0x1d1c71],_0x313ecd=_0x4c67aa['createDocumentFragment']();for(const _0x51e9ca of _0x92fbe4['getChildren']())_0x4c67aa['append'](_0x51e9ca['_clone'](!0x0),_0x313ecd);for(const _0x4995b4 of _0x55bd65['operationsIsolated'])if('insert'===_0x4995b4['type']){const _0x5366fe=_0x4995b4;_0x5366fe['baseVersion']=null,_0x5366fe['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5366fe,_0x313ecd),_0x4c67aa['batch']['addOperation'](_0x4995b4),_0x1835d2['model']['applyOperation'](_0x4995b4);const _0x5b26f7='suggestion:insertion:id:authorId:'+_0x357ba2++,_0x2d8787=_0x1835d2['model']['createRange'](_0x5366fe['position'],_0x5366fe['position']['getShiftedBy'](_0x5366fe['howMany']));_0x313ecd['markers']['set'](_0x5b26f7,_0x2d8787);}else{if('marker'===_0x4995b4['type']&&_0x4995b4['name']['startsWith']('$markedRemove')){const _0x38b503=_0x4995b4,_0x4ffd4c='suggestion:deletion:id:authorId:'+_0x357ba2++;this['_changeOperationOwnerDocument'](_0x38b503,_0x313ecd),_0x313ecd['markers']['set'](_0x4ffd4c,_0x38b503['newRange']);}}if(_0x2e63e5)_0x374f09['push']({..._0x55bd65,'context':this['_createGetContentFn'](_0x92fbe4,_0x1835d2['data']),'content':this['_createGetContentFn'](_0x92fbe4,_0x1835d2['data'])});else{const _0x21d2c5=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x55bd65['operationsIsolated'][0x0]),_0x313ecd),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x55bd65['operationsIsolated'][_0x55bd65['operationsIsolated']['length']-0x1]),_0x313ecd));_0x313ecd['markers']['set'](Kt+'suggestion-context',new _0x21f9f5(_0x21d2c5['start'],_0x21d2c5['end'])),_0x374f09['push']({..._0x55bd65,'context':this['_createGetContextFn'](_0x313ecd,_0x1835d2['data'],{'ellipsisBefore':_0x21d2c5['hasContentBefore'],'ellipsisAfter':_0x21d2c5['hasContentAfter']}),'content':this['_createGetContentFn'](_0x313ecd,_0x1835d2['data'])});}}}),_0x374f09;}['markChangePositionInEditorContent'](_0x47e1e6,_0x5b393f){if(!_0x47e1e6['length'])return;const _0x4d6b4c=_0x47e1e6[0x0]['parent']['id'],_0xe06c56=_0x5b393f['elements']['get'](_0x4d6b4c);if(!_0xe06c56)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4d6b4c);const _0x4517ff=_0xe06c56['path'],_0xc4c070=lt(this['context']),_0x5f56ce=_0xc4c070['model']['document']['history']['getOperations'](_0x5b393f['version']),_0x1f785e=[];for(const _0x5677bf of _0x47e1e6){const _0x1e3ca6=_0x5677bf['operationsIsolated']['map'](_0x253664=>this['_translateOperationToEditorContent'](_0x253664,_0x4517ff,_0xc4c070['model']['document']['getRoots']()[0x0]));if(!_0x1e3ca6||!_0x1e3ca6['length'])continue;const _0x57a4cd=_0x1e3ca6['every'](_0x314e79=>'marker'===_0x314e79['type']&&_0x314e79['name']['startsWith']('$markedRemove')),_0x2a718d={'document':_0xc4c070['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x392b5e=_0x471b37(_0x1e3ca6,_0x5f56ce,_0x2a718d)['operationsA'];for(const _0x197879 of _0x392b5e)if('insert'===_0x197879['type']){const _0x353246=_0x197879,_0x5a35f6=_0x353246['nodes'];_0xc4c070['model']['change'](_0x325cb9=>{const _0x202575=_0x325cb9['createDocumentFragment']();for(const _0x3dd4d4 of _0x5a35f6)_0x325cb9['append'](_0x3dd4d4['_clone'](!0x0),_0x202575);_0x1f785e['push']({'start':_0x353246['position'],'end':_0x353246['position'],'type':'insert','groupId':_0x5677bf['id'],'content':{'asString':this['_createGetContentFn'](_0x202575,_0xc4c070['data'])(),'asFragment':_0x202575}});});}else{if('marker'===_0x197879['type']&&_0x197879['name']['startsWith']('$markedRemove')){const _0x30bfe3=_0x197879;let _0xa44b58='remove-text';if(_0x57a4cd){const _0x20c1f5=this['_findAdjacentContextDistance'](_0x30bfe3['newRange']['start'],'backward',_0xc4c070['model']['schema']),_0x4f9425=this['_findAdjacentContextDistance'](_0x30bfe3['newRange']['end'],'forward',_0xc4c070['model']['schema']);if(_0x20c1f5||_0x4f9425){const _0x5f2278=_0x30bfe3['newRange']['start']['getShiftedBy'](-_0x20c1f5),_0x2804b0=_0x30bfe3['newRange']['end']['getShiftedBy'](_0x4f9425);_0x1f785e['push']({'start':_0x5f2278,'end':_0x2804b0,'groupId':_0x5677bf['id'],'type':'remove-context'});}else _0xa44b58='remove-only';}_0x1f785e['push']({'start':_0x30bfe3['newRange']['start'],'end':_0x30bfe3['newRange']['end'],'groupId':_0x5677bf['id'],'type':_0xa44b58});}}}this['_insertMarkers'](_0x1f785e);}['clearAllMarkers'](){const _0x50e071=lt(this['context']);_0x50e071['model']['change'](_0x17147f=>{for(const _0x241c2f of this['_markers']['keys']())_0x50e071['model']['markers']['get'](_0x241c2f)&&_0x17147f['removeMarker'](_0x241c2f);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){lt(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){lt(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x164281){const _0x27ef61=lt(this['context']),_0x3270d6=_0x27ef61['model'],_0x327e35=_0x164281['map'](_0x1ec8cd=>this['_getMarkersDataForGroup'](_0x1ec8cd))['flat']();_0x3270d6['change'](_0x5d0a83=>{for(const _0x326d40 of _0x327e35){const _0x305358=_0x27ef61['model']['markers']['get'](_0x326d40['id']);if(_0x305358){if('insert'===_0x326d40['type']){if(!_0x326d40['content'])continue;_0x3270d6['insertContent'](_0x326d40['content']['asFragment']||null,_0x305358['getRange']()['start']);}else'remove-text'!==_0x326d40['type']&&'remove-only'!==_0x326d40['type']||_0x3270d6['deleteContent'](_0x3270d6['createSelection'](_0x305358['getRange']()));_0x5d0a83['removeMarker'](_0x326d40['id']),this['_markers']['delete'](_0x326d40['id']);}}});}['rejectChange'](_0x10cb3e){const _0x9419c4=lt(this['context']),_0x49f108=this['_getMarkersDataForGroup'](_0x10cb3e);_0x9419c4['model']['change'](_0x50679e=>{for(const _0x1e4287 of _0x49f108)_0x50679e['removeMarker'](_0x1e4287['id']),this['_markers']['delete'](_0x1e4287['id']);});}['getEditor'](){return lt(this['context']);}['getMarkerElementForChange'](_0x3e2849){const _0x5df2a0=Array['from'](this['_markers']['values']())['filter'](_0x1cbc6f=>_0x1cbc6f['groupId']===_0x3e2849);if(!_0x5df2a0['length'])return null;const _0x2e0607=0x1===_0x5df2a0['length']?_0x5df2a0[0x0]:this['_sortMarkers'](_0x5df2a0)[0x0],_0x1610e5=lt(this['context'])['model']['markers']['get'](_0x2e0607['id']);if(!_0x1610e5)return null;return{'modelRange':_0x1610e5['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2e0607['id'])};}['getContentElementForChange'](_0x502567){const _0x4fec4d=Array['from'](this['_markers']['values']())['filter'](_0x232f15=>_0x232f15['groupId']===_0x502567);if(!_0x4fec4d['length'])return null;const _0x45b498=0x1===_0x4fec4d['length']?_0x4fec4d[0x0]:this['_sortMarkers'](_0x4fec4d)[0x0],_0x47f04a=lt(this['context']),_0x5dd45d=_0x47f04a['model']['markers']['get'](_0x45b498['id']);if(!_0x5dd45d)return null;const _0x127dbe=_0x5dd45d['getRange'](),_0x269acc=_0x47f04a['editing']['view']['getDomRoot']();if(!_0x269acc||!_0x127dbe)return null;let _0xb8008b=_0x127dbe['start']['parent'];for(;_0xb8008b['parent']&&'$root'!==_0xb8008b['parent']['name'];)_0xb8008b=_0xb8008b['parent'];if(!_0xb8008b||!_0xb8008b['name'])return null;const _0x20e1a4=_0x269acc['querySelector']('[data-marker-id=\x22'+_0x45b498['id']+'\x22]');if(!_0x20e1a4)return null;let _0x1e7d48=null;_0x47f04a['model']['change'](_0x367af0=>{_0x1e7d48=_0x367af0['createDocumentFragment'](),_0x367af0['append'](_0xb8008b['_clone'](!0x0),_0x1e7d48);});const _0x47a851=_0x47f04a['data']['toView'](_0x1e7d48)['getChild'](0x0);return _0x20e1a4['closest'](_0x47a851['name']);}['reactivateMarkers'](_0x4dc30f){const _0x41e31d=this['_getMarkersDataForGroup'](_0x4dc30f);if(!_0x41e31d['length'])return;const _0x5f4fc5=Array['from'](this['_activeMarkers'])['sort'](),_0x32a308=Array['from'](new Set(_0x41e31d['map'](_0x4b58f2=>_0x4b58f2['id'])))['sort']();_0x5f4fc5['join']('|')!==_0x32a308['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4dc30f));}['setMarkersInElementAsActive'](_0x7ee703){const _0x322d5a=this['_getMarkersDataForGroup'](_0x7ee703);if(!_0x322d5a['length'])return;const _0x2daa8f=lt(this['context']),_0x4cdcd4=new Set(_0x322d5a['map'](_0x4194dd=>_0x4194dd['id'])),_0xea42f4=Array['from'](_0x4cdcd4['values']())['map'](_0x5bbdeb=>_0x2daa8f['model']['markers']['get'](_0x5bbdeb))['filter'](_0xe36b6d=>!!_0xe36b6d);_0x4cdcd4['forEach'](_0x4f9f27=>{this['_activeMarkers']['add'](_0x4f9f27);}),_0x2daa8f['model']['change'](()=>{_0xea42f4['forEach'](_0xd3ca5c=>{_0x2daa8f['editing']['reconvertMarker'](_0xd3ca5c);});});}['setAllMarkersAsInactive'](){const _0x361a95=Array['from'](this['_activeMarkers']);if(!_0x361a95['length'])return;this['_activeMarkers']['clear']();const _0x46013b=lt(this['context']),_0x17e571=_0x361a95['map'](_0x5514fa=>_0x46013b['model']['markers']['get'](_0x5514fa))['filter'](_0x2ab05f=>!!_0x2ab05f);_0x46013b['model']['change'](()=>{_0x17e571['forEach'](_0x445a36=>{_0x46013b['editing']['reconvertMarker'](_0x445a36);});});}['_getPositionLimitingRange'](_0xa4279d,_0x16b0af,_0x53c939='outside'){if(!_0xa4279d)return null;let _0x43c34a=_0xa4279d['parent'];for(;_0x43c34a&&_0x43c34a['parent']&&'$root'!==_0x43c34a['parent']['name']&&!_0x16b0af['model']['schema']['isLimit'](_0x43c34a)&&!_0x16b0af['model']['schema']['isBlock'](_0x43c34a);)_0x43c34a=_0x43c34a['parent'];if(!_0x43c34a||!_0x43c34a['name']||'$root'===_0x43c34a['name'])return null;let _0x1bea0b=null;return _0x16b0af['model']['change'](_0x573985=>{_0x1bea0b='inside'===_0x53c939?_0x573985['createRangeIn'](_0x43c34a):_0x573985['createRangeOn'](_0x43c34a);}),_0x1bea0b;}['_validateMarkers'](_0x19e617,_0x4be5b9){const _0x2f4763=Array['from'](this['_markers']['keys']()),_0x447b8d=new Map();for(const _0x46c5e3 of _0x2f4763){const _0x6a0c19=_0x19e617['model']['markers']['get'](_0x46c5e3);if(!_0x6a0c19)continue;const _0x2c9689=_0x6a0c19['getStart']()['path'][0x0];_0x447b8d['has'](_0x2c9689)||_0x447b8d['set'](_0x2c9689,[]),_0x447b8d['get'](_0x2c9689)['push'](_0x6a0c19);}const _0x5a68ef=new Set();for(const _0x4a74b2 of _0x19e617['model']['document']['differ']['getChanges']()){let _0x323707=-0x1,_0x13c569=null;if('insert'===_0x4a74b2['type'])_0x13c569=new _0x21f9f5(_0x4a74b2['position'],_0x4a74b2['position']['getShiftedBy'](_0x4a74b2['length'])),_0x323707=_0x4a74b2['position']['path'][0x0];else{if('remove'!==_0x4a74b2['type'])continue;_0x13c569=new _0x21f9f5(_0x4a74b2['position']),_0x323707=_0x4a74b2['position']['path'][0x0];}const _0x5c7324=_0x447b8d['get'](_0x323707)||[];if(_0x5c7324['length']){for(const _0xe1057f of _0x5c7324)if(_0x13c569['root']['rootName']===_0xe1057f['getRange']()['root']['rootName']&&('insert'!==_0x4a74b2['type']||!_0x13c569['containsRange'](_0xe1057f['getRange']()))&&(_0x13c569['isIntersecting'](_0xe1057f['getRange']())||_0x13c569['start']['isTouching'](_0xe1057f['getRange']()['end'])||_0x13c569['end']['isTouching'](_0xe1057f['getRange']()['start']))){const _0x4715c1=this['_parseMarkerName'](_0xe1057f['name']);Array['from'](this['_markers']['values']())['filter'](_0x2f9d35=>_0x2f9d35['groupId']===_0x4715c1['groupId'])['forEach'](_0x2d23e4=>_0x5a68ef['add'](_0x2d23e4['id']));}}}if(_0x5a68ef['size']){for(const _0x10afbf of _0x5a68ef)_0x4be5b9['removeMarker'](_0x10afbf);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x29addd){for(const {name:_0x5a15ed,data:_0x4fa419}of _0x29addd['model']['document']['differ']['getChangedMarkers']()){if(!_0x5a15ed['startsWith'](Kt))continue;const _0x2549d9=_0x4fa419['oldRange'],_0x4eefb8=_0x4fa419['newRange'],_0xdb3868=_0x2549d9&&'$graveyard'===_0x2549d9['root']['rootName'],_0x36bf8f=_0x4eefb8&&'$graveyard'===_0x4eefb8['root']['rootName'];if(_0xdb3868&&_0x36bf8f)continue;const _0x509c81=this['_parseMarkerName'](_0x5a15ed);this['_markers']['get'](_0x5a15ed)&&(_0x36bf8f||!_0x4eefb8?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5a15ed,'changeId':_0x509c81['groupId']}):_0xdb3868&&_0x4eefb8&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5a15ed,'changeId':_0x509c81['groupId']}));}}['_parseMarkerName'](_0x1e048e){const _0x366161=_0x1e048e['split'](':'),_0x58ff46=(_0x366161[0x1]||'')['split']('_');return{'prefix':_0x366161[0x0],'groupId':_0x58ff46[0x0],'suffix':_0x58ff46[0x1]};}['_translateOperationToEditorContent'](_0xa398b4,_0x4d8432,_0xfa7bc4){if('insert'===_0xa398b4['type']){const _0x4eacea=_0xa398b4;return new Ft(this['_changePosition'](_0x4d8432['concat'](_0x4eacea['position']['offset']),_0xfa7bc4),_0x4eacea['nodes'],_0x4eacea['baseVersion']);}if('marker'===_0xa398b4['type']&&_0xa398b4['name']['startsWith']('$markedRemove')){const _0x3357d8=_0xa398b4;return new Bt(_0x3357d8['name'],_0x3357d8['oldRange'],this['_changeRange'](_0x3357d8['newRange'],_0x4d8432['concat'](_0x3357d8['newRange']['start']['offset']),_0x4d8432['concat'](_0x3357d8['newRange']['end']['offset']),_0xfa7bc4),_0x3357d8['_markers'],_0x3357d8['affectsData'],_0x3357d8['baseVersion']);}return _0xa398b4;}['_groupAdjacentOperations'](_0x2ae877){if(!_0x2ae877['length'])return[];const _0x1efb54=[];let _0x58d25b=0x0,_0x452239=0x0,_0x5b6300=[];for(let _0x3b94ce=0x0;_0x3b94ce<=_0x2ae877['length'];_0x3b94ce++){const _0xf5c810=_0x2ae877[_0x3b94ce],_0x117e59=_0x2ae877[_0x3b94ce-0x1];!_0xf5c810||_0x117e59&&!this['_getOperationEnd'](_0x117e59)['isTouching'](this['_getOperationStart'](_0xf5c810))?(_0x1efb54['push']({'operations':_0x5b6300,'operationsIsolated':_0x5b6300['map'](_0x74994c=>this['_shiftOperation'](_0x74994c['clone'](),-_0x452239)),'groupOffset':_0x58d25b}),_0x5b6300=_0xf5c810?[_0xf5c810]:[],_0x452239+=_0x58d25b,_0x58d25b=0x0):_0x5b6300['push'](_0xf5c810),_0xf5c810&&'insert'===_0xf5c810['type']&&(_0x58d25b+=_0xf5c810['howMany']);}return _0x1efb54;}['_findAdjacentContextDistance'](_0x568b98,_0x3d38db,_0x15b9b1,_0x13de12=0x1){const _0x2d2903=new Gt({'startPosition':_0x568b98,'direction':_0x3d38db});let _0x4602a6=0x0;for(let _0x33d6eb=0x0;_0x33d6eb<_0x13de12;_0x33d6eb++){let _0x3ed8bf=0x0,_0x4edcaa=!0x1,_0x3878b8='forward'===_0x3d38db?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x4fbeeb}of _0x2d2903)if(_0x4fbeeb['is']('$textProxy')){const _0x3be2e5=_0x3878b8['exec'](_0x4fbeeb['data']);if(_0x3be2e5&&_0x3be2e5['length']){if(_0x3ed8bf+='forward'===_0x3d38db?_0x3be2e5['index']+_0x3be2e5[0x0]['length']:_0x4fbeeb['data']['length']-_0x3be2e5['index'],_0x3be2e5[0x0]['length']!==_0x4fbeeb['data']['length'])break;_0x4edcaa=!0x0,_0x3878b8='forward'===_0x3d38db?/^\w+/:/\w+$/;}else{if(_0x4edcaa)break;_0x3ed8bf+=_0x4fbeeb['offsetSize'];}}else{if(_0x4fbeeb['is']('element')){_0x15b9b1['isInline'](_0x4fbeeb)&&!_0x4edcaa&&(_0x3ed8bf+=0x1);break;}}_0x4602a6+=_0x3ed8bf,_0x2d2903['jumpTo'](_0x568b98['getShiftedBy']('forward'===_0x3d38db?_0x4602a6:-_0x4602a6));}return _0x4602a6;}['_getChangeContext'](_0x2d78ee,_0x16b8bb){const _0x3f3bfd=lt(this['context'])['model']['schema'],_0xa040b=this['_findAdjacentContextDistance'](_0x2d78ee,'backward',_0x3f3bfd,0x6),_0x35e310=this['_findAdjacentContextDistance'](_0x16b8bb,'forward',_0x3f3bfd,0x6),_0x3d68e2=_0x2d78ee['getShiftedBy'](-_0xa040b),_0x55a0fb=_0x16b8bb['getShiftedBy'](_0x35e310);return{'start':_0x3d68e2,'end':_0x55a0fb,'hasContentBefore':!_0x3d68e2['isAtStart'],'hasContentAfter':!_0x55a0fb['isAtEnd']};}['_insertMarkers'](_0x2cccac){const _0x4621f6=this['context']['plugins']['get']('AIEditing'),_0x2070a6=new Set();lt(this['context'])['model']['change'](_0x18a1e5=>{for(const _0x5efbe7 of _0x2cccac){const _0x55dc7f=''+Kt+_0x5efbe7['type']+':'+_0x5efbe7['groupId']+'_'+_0x4621f6['_nextDataId'](_0x2070a6);this['_markers']['set'](_0x55dc7f,{'id':_0x55dc7f,'groupId':_0x5efbe7['groupId'],'type':_0x5efbe7['type'],'content':_0x5efbe7['content']}),_0x18a1e5['addMarker'](_0x55dc7f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x18a1e5['createRange'](_0x5efbe7['start'],_0x5efbe7['end'])});}});}['_createGetContextFn'](_0x46b3fd,_0x2f706f,_0x3b4e3d){let _0x163415='';return()=>{if(!_0x163415){const _0x3604fb=_0x2f706f['toView'](_0x46b3fd,{'showSuggestionHighlights':!0x0});let _0x507a7b=_0x3604fb['getChild'](0x0);if(_0x507a7b['is']('containerElement')||(_0x507a7b=_0x3604fb),!_0x507a7b)return'';let _0xcd3b51=!0x1;const _0x13dc0c=[];for(const _0x2c10a0 of _0x507a7b['getChildren']())_0x2c10a0['is']('element','span')&&_0x2c10a0['hasClass']('ck-ai_review-marker_context-end')&&(_0xcd3b51=!0x1),_0xcd3b51&&_0x13dc0c['push'](_0x2c10a0),_0x2c10a0['is']('element','span')&&_0x2c10a0['hasClass']('ck-ai_review-marker_context-start')&&(_0xcd3b51=!0x0);_0x507a7b['_removeChildren'](0x0,_0x507a7b['childCount']),_0x3b4e3d?.['ellipsisBefore']&&_0x507a7b['_appendChild']('…'),_0x507a7b['_appendChild'](_0x13dc0c),_0x3b4e3d?.['ellipsisAfter']&&_0x507a7b['_appendChild']('…');const _0x5a7140=_0x2f706f['htmlProcessor']['domConverter']['viewToDom'](_0x3604fb),_0x2c9728=_0x2f706f['htmlProcessor']['htmlWriter']['getHtml'](_0x5a7140);_0x163415=_0x2c9728;}return _0x163415;};}['_createGetContentFn'](_0x41fa29,_0x35aa96){let _0x144d91='';return()=>(_0x144d91||(_0x144d91=_0x35aa96['stringify'](_0x41fa29,{'showSuggestionHighlights':!0x0})),_0x144d91);}['_createGetContentUsingDataIdFn'](_0x3907db,_0x48316e,_0x1845cd){let _0x586a0d='';return()=>{if(!_0x586a0d){const _0x462998=_0x1845cd['toView'](new _0x1a00f1(_0x3907db)),_0x78328e=_0x1845cd['htmlProcessor']['domConverter']['viewToDom'](_0x462998)['querySelector']('[data-id=\x22'+_0x48316e+'\x22]');_0x586a0d=_0x78328e?.['outerHTML']||'';}return _0x586a0d;};}['_findMarkerElement'](_0x1dbba3,_0x495472=0x5){let _0x3fc9e4=_0x1dbba3,_0x1d087d=null;for(let _0x1a9cfb=0x0;_0x1a9cfb<_0x495472&&_0x3fc9e4;_0x1a9cfb++){if(!_0x3fc9e4['className']){_0x3fc9e4=_0x3fc9e4['parentElement'];continue;}if(!(''+_0x3fc9e4['className'])['includes']('ck-ai_review-marker_')){_0x3fc9e4=_0x3fc9e4['parentElement'];continue;}if(!_0x3fc9e4['getAttribute']('data-marker-id'))break;_0x1d087d=_0x3fc9e4;break;}return _0x1d087d;}['_findMarkerElementById'](_0x5ba6dd){const _0x22e99a=lt(this['context']),_0x3700ce=_0x22e99a['model']['markers']['get'](_0x5ba6dd);return _0x3700ce?zt(_0x22e99a['editing'],_0x3700ce):null;}['_getMarkersDataForGroup'](_0x5162b6){return Array['from'](this['_markers']['values']())['filter'](_0x471488=>_0x471488['groupId']===_0x5162b6);}['_getOperationStart'](_0x317be4){return'insert'===_0x317be4['type']?_0x317be4['position']:_0x317be4['newRange']['start'];}['_getOperationEnd'](_0x1dd82d,_0xbb19c1=!0x1){return'insert'===_0x1dd82d['type']?_0xbb19c1?_0x1dd82d['position']:_0x1dd82d['position']['getShiftedBy'](_0x1dd82d['howMany']):_0x1dd82d['newRange']['end'];}['_shiftOperation'](_0x516103,_0x7d3f5a){return'insert'===_0x516103['type']?_0x516103['position']=_0x516103['position']['getShiftedBy'](_0x7d3f5a):'marker'===_0x516103['type']&&_0x516103['newRange']&&(_0x516103['newRange']=new _0x21f9f5(_0x516103['newRange']['start']['getShiftedBy'](_0x7d3f5a),_0x516103['newRange']['end']['getShiftedBy'](_0x7d3f5a))),_0x516103;}['_changeOperationOwnerDocument'](_0x3ad2f5,_0x2b8a87){'insert'===_0x3ad2f5['type']?_0x3ad2f5['position']=this['_changePositionOwnerDocument'](_0x3ad2f5['position'],_0x2b8a87):'marker'===_0x3ad2f5['type']&&_0x3ad2f5['newRange']&&(_0x3ad2f5['newRange']=this['_changeRangeOwnerDocument'](_0x3ad2f5['newRange'],_0x2b8a87));}['_changePositionOwnerDocument'](_0x3fc5c7,_0x1ae1be){return new _0x192d6b(_0x1ae1be,_0x3fc5c7['path']);}['_changeRangeOwnerDocument'](_0x13b697,_0x10f906){return new _0x21f9f5(this['_changePositionOwnerDocument'](_0x13b697['start'],_0x10f906),this['_changePositionOwnerDocument'](_0x13b697['end'],_0x10f906));}['_changePosition'](_0x3d524f,_0x40e424){return new _0x192d6b(_0x40e424,[..._0x3d524f]);}['_changeRange'](_0x322175,_0x394751,_0x519721,_0x1d0ac8){return new _0x21f9f5(this['_changePosition'](_0x394751,_0x1d0ac8),this['_changePosition'](_0x519721,_0x1d0ac8));}['_sortMarkers'](_0x2bf221){const _0x3d7c42=_0x447f4d=>{switch(_0x447f4d){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2bf221['sort']((_0x4e61a6,_0x3f52f8)=>_0x3d7c42(_0x4e61a6['type'])-_0x3d7c42(_0x3f52f8['type']));}['_hasSameTopLevelElement'](_0x5cb861,_0x2bf748){const _0x505b03=_0x5cb861['getChild'](0x0),_0x5a5811=_0x2bf748['getChild'](0x0);return!(!_0x505b03||!_0x5a5811)&&((!_0x505b03['is']('element')||!_0x5a5811['is']('element')||_0x505b03['name']===_0x5a5811['name'])&&!(_0x505b03['is']('element')&&!_0x5a5811['is']('element')||!_0x505b03['is']('element')&&_0x5a5811['is']('element')));}['_haveSingleTopLevelElement'](_0xaa617a){return 0x1===_0xaa617a['childCount'];}['_haveOnlyInlineContent'](_0x2d72e4,_0x5121e0){for(const _0x64b20a of _0x2d72e4['getChildren']())if(_0x64b20a['is']('element')&&!_0x5121e0['isInline'](_0x64b20a))return!0x1;return!0x0;}['_upsertDataId'](_0x47a743,_0x533467){let _0x954cde=_0x47a743['getAttribute'](gt);return _0x954cde||(_0x954cde=_0x533467(),_0x47a743['_setAttribute'](gt,_0x954cde)),_0x954cde;}}class Rs extends Wt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x413b4e,contentNew:_0xc7a871,contentInitial:_0x3557ae,documentVersion:_0xcd9319}){super(),this['id']=_0x413b4e,this['contentNew']=_0xc7a871,this['contentInitial']=_0x3557ae,this['documentVersion']=_0xcd9319;}}class qs extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4f1725,_0x4e4d57,_0x3b78f3){super(),this['id']=_0x4f1725,this['parent']=_0x3b78f3,this['_data']=_0x4e4d57,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class zs extends ts(){['id']=_0xdeade1();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x53d05e,_0x15038e,_0x34439a,_0x2c2a68,_0x29c22c){super(),this['_sourceCheck']=_0x15038e,this['_documentData']=_0x53d05e,this['_aiConnector']=_0x34439a,this['_reviewParams']=_0x2c2a68,this['_reviewArgs']=_0x29c22c,this['on']('change:status',(_0x310e92,_0x36b0ef,_0x4cdbec)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x4cdbec,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0xcd917b=>'pending'===_0xcd917b['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0xc8be1e){this['_documentData']=_0xc8be1e;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4bca48=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x12ec7a of _0x4bca48)'unmodified'!==_0x12ec7a['data']['operation']&&('error'!==_0x12ec7a['data']['operation']?'review-metadata'!==_0x12ec7a['event']?this['_addReviewCheckResult'](_0x12ec7a['data']['dataId'],_0x12ec7a['data']['textDelta']):this['callId']=_0x12ec7a['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x5c8e0d){this['_currentError']=_0x5c8e0d,_0x5c8e0d instanceof Error&&_0x5c8e0d['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'](_0x44369e,_0x2f57b3){const _0x2f7d9e=this['_results']['get'](_0x44369e);if(!_0x2f7d9e)return;if(0x0===_0x2f57b3['length'])return;const _0x10e794=[];_0x2f57b3['forEach']((_0x59eae0,_0x4fb428)=>{const _0x12fe03=new qs(_0x2f7d9e['id']+'-'+_0x4fb428,_0x59eae0,_0x2f7d9e);_0x12fe03['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x12fe03,'status':_0x12fe03['status']});}),_0x12fe03['on']('change:isActivated',()=>{_0x12fe03['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x12fe03}):this['fire']('reviewCheckResultDeactivated',{'change':_0x12fe03});}),this['_changes']['push'](_0x12fe03),_0x10e794['push'](_0x12fe03);}),this['fire']('reviewCheckResultReady',{'changes':_0x10e794,'result':_0x2f7d9e,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x483297){const _0x7a513e=this['_changes']['find'](_0x5b0a7d=>_0x5b0a7d['id']===_0x483297);return!(!_0x7a513e||'pending'!==_0x7a513e['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x1b74b4=>!0x0===_0x1b74b4['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x54b21d=>'pending'===_0x54b21d['status']);}['getChangeById'](_0x56a28c){return this['_changes']['find'](_0x85d690=>_0x85d690['id']===_0x56a28c);}['markAllChangesAsAccepted'](){for(const _0x4372b2 of this['_changes'])'pending'===_0x4372b2['status']&&(_0x4372b2['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3594e8){const _0x57ce62=this['_changes']['find'](_0x4bcd46=>_0x4bcd46['id']===_0x3594e8);_0x57ce62&&'pending'===_0x57ce62['status']&&(_0x57ce62['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x48c618){const _0x166172=this['_changes']['find'](_0x93b7b=>_0x93b7b['id']===_0x48c618);_0x166172&&'pending'===_0x166172['status']&&(_0x166172['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4fe686){const _0x5f3814=this['_changes']['find'](_0x269d68=>_0x269d68['id']===_0x4fe686);_0x5f3814&&'pending'===_0x5f3814['status']&&(_0x5f3814['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x21cce2){const _0x1e768e=this['_changes']['find'](_0x1b4d69=>_0x1b4d69['id']===_0x21cce2);_0x1e768e&&'outdated'===_0x1e768e['status']&&(_0x1e768e['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x476978){this['_changes']['filter'](_0x45adfd=>_0x45adfd['isActivated']&&_0x45adfd['id']!==_0x476978)['forEach'](_0xeb3f24=>{_0xeb3f24['isActivated']=!0x1;});const _0x2c0f26=this['_changes']['find'](_0x4c2766=>_0x4c2766['id']===_0x476978);_0x2c0f26&&'pending'===_0x2c0f26['status']&&(_0x2c0f26['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x12505c=>_0x12505c['isActivated'])['forEach'](_0x545b52=>{_0x545b52['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x2fa11e){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x278435;if(_0x2fa11e){const _0xdb158=this['_changes']['find'](_0x24803b=>_0x24803b['id']===_0x2fa11e);if(_0xdb158&&_0xdb158['isRated'])return;_0xdb158&&(_0x278435=_0xdb158['parent']['id'],_0xdb158['isRated']=!0x0);}const _0x5d34a4={'positiveCount':this['_changes']['filter'](_0x1f4e0d=>'accepted'===_0x1f4e0d['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5d34a4,this['callId'],_0x278435);}['_addReviewCheckResult'](_0x29a6d9,_0x1aacce){const _0x4b91ae=this['_documentData']['elements']['get'](_0x29a6d9);if(!_0x4b91ae)return;const _0x4334db=_0x4b91ae['getContent']();if(_0x4334db===_0x1aacce)return;const _0x42eccb=new Rs({'id':_0x29a6d9,'contentInitial':_0x4334db,'contentNew':_0x1aacce,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x42eccb['id'],_0x42eccb),this['fire']('reviewCheckResultAdded',{'result':_0x42eccb,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x471419=>'pending'===_0x471419['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x21eb15=>'pending'===_0x21eb15['status'])['length']&&(this['status']='finished'));}}class ti extends zs{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x475731=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x1351c7=0x0;_0x1351c7<this['_reviewParams']['length'];_0x1351c7++){if(!this['_reviewParams'][_0x1351c7]||!this['_sourceCheck']['options'][_0x1351c7])continue;const _0x28563c=this['_sourceCheck']['options'][_0x1351c7],_0xede4de=_0x28563c['data']?.['find'](_0x49bebf=>_0x49bebf['id']===this['_reviewParams'][_0x1351c7]);_0xede4de&&_0x475731['push'](_0xede4de['label']);}return _0x475731['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3fd2ac,_0x3b5a7d,_0x29d134){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3b5a7d,_0x3fd2ac,_0x29d134);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class ei extends _0x47e329{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[S];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x1e1e95,_0x3f97c8)=>{const _0xf6323b=this['_aiReviewCheckList']['getCheckById'](_0x3f97c8['id']);if(_0xf6323b){this['_onReviewCheckRun'](_0x3f97c8),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3f97c8,_0xf6323b),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x14ad13,_0x57e256)=>{switch(_0x57e256['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x57e256);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x32ab89('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x32ab89('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x57e256['status']&&'error-chunk'!==_0x57e256['status']&&'error-general'!==_0x57e256['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x25828d,_0x307cae)=>{if(!this['_currentReviewCheckRun'])throw new _0x32ab89('ai-review-mode-no-current-check-run',this);const _0x56e49d=this['_diffContent'](_0x307cae['result']['contentInitial'],_0x307cae['result']['contentNew']);_0x307cae['source']['addResultChanges'](_0x307cae['result']['id'],_0x56e49d);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x453e01,_0x3bbab0)=>{for(const _0x3ccb15 of _0x3bbab0['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x3ccb15);this['_markChangePositionInEditorContent'](_0x3bbab0['changes'],_0x3bbab0['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5d74c9,_0x1efbdd)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x1efbdd['change']['id'],_0x1efbdd['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0xa2cb4a,_0xc60509)=>{this['_onReviewCheckResultActivated'](_0xc60509);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x12357e){_0x12357e instanceof Error&&_0x12357e['message']['includes']('ai-request-aborted')||(_0x12357e instanceof _0x32ab89?this['_logError'](_0x12357e):this['_logError'](new _0x32ab89('ai-review-mode-check-run-failed',this,void 0x0,_0x12357e)));}}else this['_logError'](new _0x32ab89('ai-review-mode-source-check-not-found',this,{'checkId':_0x3f97c8['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x4fd1d6=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x4fd1d6['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x4fd1d6['map'](_0x1fd3cb=>_0x1fd3cb['id']));const _0x574a0e=this['_currentReviewCheckRun'];_0x574a0e['markAllChangesAsAccepted'](),_0x574a0e['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0xdacf2,_0x34d9de)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x34d9de['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x34d9de['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x34d9de['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x34d9de['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1e4bef,_0x1de507)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1de507['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1de507['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1de507['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1de507['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x5d4c36,_0x5acc0f)=>{this['_onActivateChange'](_0x5acc0f);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x400e3d,_0x24858c)=>{this['_onDeactivateChange'](_0x24858c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x2e325e,_0x1e0ec3)=>{this['_onChangeMarkerClicked'](_0x2e325e,_0x1e0ec3);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x204e1b,_0xe676ab)=>{this['_onChangeMarkerHovered'](_0x204e1b,_0xe676ab);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xc907fe,_0x3aeca5)=>{this['_onChangeMarkerRemoved'](_0xc907fe,_0x3aeca5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x104728,_0x12ddc3)=>{this['_onChangeMarkerRestored'](_0x104728,_0x12ddc3);});}['_createReviewCheckRun'](_0x2624f3,_0x55770f){return new ti(this['_aiReviewCoreEditing']['getDocumentData'](),_0x55770f,this['_aiConnector'],_0x2624f3['params'],_0x2624f3['args']);}['_onChangeMarkerRemoved'](_0x572ccb,_0x3e09c0){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3e09c0['changeId']);}['_onChangeMarkerRestored'](_0x5e53df,_0x412375){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x412375['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x1e3411=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1e3411&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x1d35e1=this['_aiReviewCoreEditing']['getEditor']();_0x1d35e1&&_0x1d35e1['editing']['view']['change'](_0x5435a9=>{const _0xa25086=_0x1d35e1['editing']['view']['document']['getRoot']();_0x5435a9['removeClass']('ck-ai_review-diff',_0xa25086),_0x5435a9['removeClass']('ck-ai_review-highlights',_0xa25086),_0x5435a9['removeClass']('ck-ai-translate-mode-content',_0xa25086);});}['_getTranslationWithDefault'](_0x2766f1,_0x56d8d8){const _0x17d684=i(this['context']['locale'],_0x2766f1);return _0x17d684===_0x2766f1?_0x56d8d8:_0x17d684;}['_logError'](_0x3d6a7e){rt(_0x3d6a7e['message']),_0x3d6a7e['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x2272fe){if('content'===this['_changeActivationSource']){const _0x54f2fa=this['_aiReviewCoreUi']['getChangeElement'](_0x2272fe);_0x54f2fa&&_0xfabcf7(_0x54f2fa['closest']('.ck-ai_review__check-run-result')||_0x54f2fa);}else{if('panel'===this['_changeActivationSource']){const _0x28823f=this['_getChangeContentElement'](_0x2272fe);if(!_0x28823f)return;at({'target':_0x28823f,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const oi=[{'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'}]}]}];class Bs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['id'];}constructor(_0x318350){this['id']=_0x318350['id'],this['title']=_0x318350['title'],this['description']=_0x318350['description'],this['isParameterized']=_0x318350['isParameterized'],this['useArgs']=_0x318350['useArgs'],this['options']=_0x318350['options'],this['args']=_0x318350['args'];}}class vr extends ts(){['_checks'];constructor(_0x150c7a){super(),this['_checks']=this['_mapCheckDefinitions'](_0x150c7a);}get['checks'](){return this['_checks'];}['getCheckById'](_0x5602f5){return this['checks']['find'](_0x522cdb=>_0x522cdb['id']===_0x5602f5);}['removeCheckById'](_0x566837){this['_checks']=this['_checks']['filter'](_0x3c9d86=>_0x3c9d86['id']!==_0x566837);}['_mapCheckDefinitions'](_0x2bd005){return _0x2bd005['map'](_0x213171=>new Bs(_0x213171));}}class jr extends Bs{['_models']=[];['_defaultModel']=null;get['models'](){return this['_models'];}set['models'](_0x2b3a76){this['_models']=_0x2b3a76;}get['defaultModel'](){return this['_defaultModel'];}set['defaultModel'](_0x331e16){this['_defaultModel']=_0x331e16;}}class hi extends vr{['_mapCheckDefinitions'](_0x217ad9){return _0x217ad9['map'](_0x283045=>{if('custom'===_0x283045['id']){const _0x490171=new jr(_0x283045);return _0x490171['models']=_0x283045['models']||[],_0x490171['defaultModel']=_0x283045['defaultModel']||null,_0x490171;}return new Bs(_0x283045);});}}class ai extends zs{['_prompt'];['_model'];constructor(_0xce9fc0,_0xf9c3fb,_0x382cab,_0x10c7c8,_0x151809){super(_0x382cab,_0x10c7c8,_0x151809),this['_prompt']=_0xce9fc0,this['_model']=_0xf9c3fb;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x64da8,_0x4f3488,_0x1f7990){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4f3488,_0x64da8,_0x1f7990);}}class fe extends ei{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x51c804,_0x2d22f1)=>{this['_isDiffOn']=_0x2d22f1['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x527522,_0x1b1c72){return _0x527522['isCustom']?new ai(_0x527522['args']['prompt'],_0x527522['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1b1c72,this['_aiConnector']):new ti(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1b1c72,this['_aiConnector'],_0x527522['params'],_0x527522['args']);}['_onReviewCheckResultActivated'](_0x82c512){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x82c512['change']['id']),this['_scrollToChange'](_0x82c512['change']['id']);const _0xba319a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x82c512['change']['id']);if(!_0xba319a)return;const _0x34a710=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x82c512['change'],()=>_0xba319a['getElement'](),void 0x0,'click',_0x34a710?.['editing']?.['view']?.['getDomRoot'](),_0x34a710?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x82c512['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0xe05f4e){this['_currentReviewCheckRun']&&'click'===_0xe05f4e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xe05f4e['id']));}['_onDeactivateChange'](_0x9fa78){this['_currentReviewCheckRun']&&'balloon'===_0x9fa78['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x8bbff0,_0x3d5c96){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3d5c96['changeId']);const _0x1cba5f=this['_currentReviewCheckRun']['getChangeById'](_0x3d5c96['changeId']);if(!_0x1cba5f)return;const _0x2f8256=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1cba5f,_0x3d5c96['markerElement'],_0x3d5c96['domEvent'],'click',_0x2f8256?.['editing']?.['view']?.['getDomRoot'](),_0x2f8256?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x5993df,_0x2919a5){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x41c453=this['_currentReviewCheckRun']['getChangeById'](_0x2919a5['changeId']);if(!_0x41c453)return;const _0xa33642=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x41c453,_0x2919a5['markerElement'],_0x2919a5['domEvent'],'hover',_0xa33642?.['editing']?.['view']?.['getDomRoot'](),_0xa33642?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x3dfe4d){const _0x16325e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x3dfe4d);return _0x16325e?_0x16325e['getElement']():null;}['_markChangePositionInEditorContent'](_0x4d988b,_0x2d55d8){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4d988b,_0x2d55d8);}['_diffContent'](_0x1f0b2c,_0xd28543){return this['_aiReviewCoreEditing']['diffContent'](_0x1f0b2c,_0xd28543);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x30277e){const _0x3ff916=this['_aiReviewCoreEditing']['getEditor']();_0x30277e?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x3ff916&&_0x3ff916['editing']['view']['change'](_0x52e75f=>{const _0x33a16a=_0x3ff916['editing']['view']['document']['getRoot']();for(const _0x5840bc of _0x33a16a['getClassNames']())_0x5840bc['startsWith']('ck-ai_review-')&&_0x52e75f['removeClass'](_0x5840bc,_0x33a16a);_0x52e75f['addClass'](_0x30277e?'ck-ai_review-diff':'ck-ai_review-highlights',_0x33a16a);});}async['_getChecksList'](){let _0x8eb930=this['_translateReviewChecks'](oi);const _0x34d142=_0x8eb930['find'](_0x260f7c=>'custom'===_0x260f7c['id']);if(_0x34d142)try{const _0x5881b6=new dt({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});_0x34d142['models']=await _0x5881b6['getAvailableModels'](),_0x34d142['defaultModel']=await _0x5881b6['getDefault']();}catch(_0x2f25b5){_0x8eb930=_0x8eb930['filter'](_0x38d0c8=>'custom'!==_0x38d0c8['id']),this['_logError'](new _0x32ab89('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x2f25b5));}return new hi(_0x8eb930);}['_translateReviewChecks'](_0x284ef2){return _0x284ef2['map'](_0x5a803a=>{const _0x35fdd0='AI_REVIEW_CHECK_'+_0x5a803a['id']['toUpperCase']()['replaceAll']('-','_'),_0x368a04={..._0x5a803a,'title':this['_getTranslationWithDefault'](_0x35fdd0+'_TITLE',_0x5a803a['title']),'description':this['_getTranslationWithDefault'](_0x35fdd0+'_DESCRIPTION',_0x5a803a['description'])};return _0x5a803a['options']&&(_0x368a04['options']=_0x5a803a['options']['map'](_0x3ea124=>({..._0x3ea124,'label':this['_getTranslationWithDefault'](_0x35fdd0+'_OPTIONS_LABEL',_0x3ea124['label']||''),'data':_0x3ea124['data']?_0x3ea124['data']['map'](_0x236072=>({..._0x236072,'label':this['_getTranslationWithDefault'](_0x35fdd0+'_OPTIONS_DATA_'+_0x236072['id']['toUpperCase'](),_0x236072['label'])})):void 0x0}))),_0x368a04;});}}class Ma extends _0x47e329{static get['requires'](){return[fe,me,ge];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Cr extends Bs{get['apiId'](){return'translate';}}class Ce extends vr{['_mapCheckDefinitions'](_0x850cd4){return _0x850cd4['map'](_0x311f56=>new Cr(_0x311f56));}}class ke extends ti{['_title'];constructor(_0x5eabe8,_0x164ca6,_0x429988,_0x57771b,_0x23fb97,_0x1d339b){super(_0x5eabe8,_0x164ca6,_0x429988,_0x23fb97,_0x1d339b),this['_title']=_0x57771b;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends ei{static get['pluginName'](){return'AITranslateController';}constructor(_0x462bb9){super(_0x462bb9),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x373d69,_0x18a57c){return new ke(this['_aiReviewCoreEditing']['getDocumentData'](),_0x18a57c,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x373d69['params'],_0x373d69['args']);}['_onReviewCheckResultActivated'](_0x218102){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x218102['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x218102['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x5c2aa8){this['_currentReviewCheckRun']&&('hover'===_0x5c2aa8['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5c2aa8['id'])),'click'===_0x5c2aa8['uiInteraction']&&this['_scrollToChange'](_0x5c2aa8['id']));}['_onDeactivateChange'](_0x3b7738){this['_currentReviewCheckRun']&&'panel'===_0x3b7738['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x25f689,_0x455a9d){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x455a9d['changeId']),this['_scrollToChange'](_0x455a9d['changeId']));}['_onChangeMarkerHovered'](_0x22db98,_0x5ca5e1){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5ca5e1['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x5ca5e1['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x3f1672){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x3f1672);}['_markChangePositionInEditorContent'](_0x3bd9ab,_0x42c3dc){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3bd9ab,_0x42c3dc);}['_diffContent'](_0x229882,_0x51c440){return this['_aiReviewCoreEditing']['diffContent'](_0x229882,_0x51c440,!0x0);}['_onReviewCheckRun'](){const _0x540c9d=this['_aiReviewCoreEditing']['getEditor']();_0x540c9d&&_0x540c9d['editing']['view']['change'](_0x532e8c=>{const _0x3ed95b=_0x540c9d['editing']['view']['document']['getRoot']();for(const _0x5f8b88 of _0x3ed95b['getClassNames']())(_0x5f8b88['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5f8b88)&&_0x532e8c['removeClass'](_0x5f8b88,_0x3ed95b);_0x532e8c['addClass']('ck-ai-translate-mode-content',_0x3ed95b);});}async['_getChecksList'](){const _0x5dac43=[],_0x3f7544=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5cec4b of _0x3f7544)_0x5dac43['push']({'title':_0x5cec4b['label'],'id':_0x5cec4b['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5cec4b['id']}});return new Ce(this['_translateChecks'](_0x5dac43));}['_translateChecks'](_0x12b106){return _0x12b106['map'](_0x4acf8e=>{const _0x334586='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4acf8e['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4acf8e,'title':this['_getTranslationWithDefault'](_0x334586,_0x4acf8e['title'])};});}}class Te extends Ie{constructor(_0x287057,_0x3e10f6){super(_0x287057,_0x3e10f6),this['on']('set:isLoading',(_0x193592,_0x13cfa7,_0x5772f4)=>{_0x5772f4&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x1e7148,_0x47e9e5,_0x291571)=>{_0x291571&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x182c9d=super['_createAcceptAllButtonView']();return _0x182c9d['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x182c9d;}['_createExitReviewButtonView'](){const _0x32c3de=super['_createExitReviewButtonView']();return _0x32c3de['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x32c3de;}}class Ae extends he{['_setupTemplate'](){const _0x3a02d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x3a02d5['if']('isVisible','ck-hidden',_0x3d43ee=>!_0x3d43ee)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x3a02d5['if']('isVisible','ck-hidden',_0x319819=>!_0x319819)]},'children':this['_checkViews']}]});}}class tr extends _e{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3ea259=this['context']['locale'],_0x67c586=new _0x4b4b8d(_0x3ea259,{'label':i(_0x3ea259,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x47e0a1,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x2873de=new ve(_0x3ea259,{'header':_0x67c586,'list':new Ae(_0x3ea259),'results':new Te(_0x3ea259,{'generalErrorText':i(_0x3ea259,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Re(_0x3ea259,{'headerText':i(_0x3ea259,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x3ea259,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x3ea259,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2873de['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2873de;}['registerTab'](){const _0x28b9f7=this['context']['plugins']['get']('AITabs');_0x28b9f7['view']['on']('activateTab',(_0x5654b6,_0x40ea3e)=>{'translate'===_0x40ea3e?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x28b9f7['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x47e0a1,'order':0x0,'content':this['_mainView']});}}class Ua extends _0x47e329{static get['requires'](){return[rr,tr,ge];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ci as AIActions,K as AIAdapter,Wn as AIAssistant,n as AIAssistantUI,P as AIBalloon,La as AIChat,tt as AIChatController,et as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,it as AIChatUI,S as AIConnector,D as AIEditing,Da as AIEditorIntegration,Vt as AIQuickActionType,Ha as AIQuickActions,ri as AIQuickActionsUI,er as AIRequestError,Bs as AIReviewCheck,Rs as AIReviewCheckResult,zs as AIReviewCheckRun,Ma as AIReviewMode,ei as AIReviewModeController,ge as AIReviewModeEditing,me as AIReviewModeUI,ht as AITabs,pe as AITextAdapter,Pt as AIToggleButtonUI,Ua as AITranslate,rr as AITranslateController,tr as AITranslateUI,qn as AWSTextAdapter,$n as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,As as createResizeButton,Yn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x15e219,Command as Ut,ContextPlugin as _0x55a427,Editor as _0x50e0a9}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x59fb0f,IconCheck as _0x17291e,IconError as _0x3e168a,IconSubmit as _0x444de6,IconAIHistory as Nt,IconMagicWand as _0xec2797,IconRobotPencil as _0x1bd65e,IconMaximize as _0x20fb95,IconMinimize as to,IconShowChangesOn as _0x550b79,IconShowChangesOff as _0xb1603a,IconDocument as _0x1cdbdb,IconBoxWithCross as _0x1b517b,IconBoxWithCheck as _0x3f2d4f,IconBoxWithMarker as _0x3d36d7,IconInfo as _0x3965f3,IconLoupe as _0x3edf36,IconCancel as _0x127a77,IconStop as _0xf8ad47,IconAIChat as At,IconPlus as _0x1672ce,IconPin as _0x2d9711,IconThreeHorizontalDots as _0x478f8f,IconChevronDown as _0xd6914d,IconChevronUp as _0x5d380f,IconOutdated as _0x42184c,IconEye as _0x291708,IconEyeCrossedOut as _0x42ab3e,IconChevronRight as _0x1c64d4,IconAIReview as _0x26ef1a,IconAITranslate as _0x26212c}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x36c3ed,CKEditorError as _0x1a859a,ObservableMixin as ts,global as _0x461dbe,isVisible as _0x1a0826,Rect as _0x7bf0be,Collection as _0x3ea87c,FocusTracker as _0x2afd45,KeystrokeHandler as _0x16d287,first as _0x340436,toArray as _0x113c36,EmitterMixin as _0x263abf,logWarning as _0x4e1011,logError as _0x42b6c9,scrollViewportToShowTarget as _0x2b7d47,scrollAncestorsToShowTarget as _0x26b0dd,ResizeObserver as _0x5f1798,_isMotionReduced as It,getConstrainedViewportRect as _0x7f0faf,DomEmitterMixin as _0x3389ea}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x191b6d,ButtonView as _0x5822be,View as _0x2f8c3b,SpinnerView as _0x3ce061,IconView as _0x32da72,AutocompleteView as _0xde303d,ListView as _0x184d2c,ListItemGroupView as _0x2b7f61,ListItemView as _0xe814a3,ButtonLabelView as _0x143c37,FocusCycler as _0x1842f7,createLabeledTextarea as _0x1915a4,Dialog as _0x724f59,createDropdown as _0x103d4b,addMenuToDropdown as _0x44d299,MenuBarMenuView as _0x7ce5c8,MenuBarMenuListItemButtonView as _0x11ed9d,DialogViewPosition as _0x280054,MenuBarMenuListView as _0xf5b9c2,MenuBarMenuListItemView as _0x5f3a6c,BodyCollection as _0xa5a63b,BalloonPanelView as _0x331ccd,clickOutsideHandler as _0x2c5270,addListToDropdown as _0x3be524,UIModel as _0x28b6c7,submitHandler as _0x43af11,LabeledFieldView as _0x917031,createLabeledInputText as th,FormHeaderView as _0x127487,HighlightedTextView as _0x30fef8,ViewCollection as _0x36b2b7,FileDialogButtonView as _0x3476b4,InputTextView as _0x4ecc01,SearchTextView as _0x4d988a,ListItemButtonView as _0x344c64,ButtonLabelWithHighlightView as _0x480fc1,DropdownMenuPanelPositioningFunctions as _0x2fea8f,BalloonToolbar as Xt,FormRowView as _0x4bab5c,TextareaView as _0x3da8aa}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x51ff1d,ClipboardMarkersUtils as _0x5bd49c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x12dc77,ViewDataTransfer as _0xbd6943,ViewUpcastWriter as _0x166a08,Matcher as _0x4d351c,_DetachOperation as lt,_insertIntoModelNodeList as _0x4a8ac5,_removeFromModelNodeList as _0x4e23f6,ModelRange as dt,transformOperationSets as kt,ViewDowncastWriter as Dt,ModelDocumentFragment as bt,ModelPosition as vt,ModelTreeWalker as _0x1baffe,MarkerOperation as _0x2d0c9e,InsertOperation as _0x5bbfdf}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xe93c3f,escape as _0xe77682,escapeRegExp as _0xfcca98,debounce as _0xb0192a}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x584235,InvokeModelWithResponseStreamCommand as _0x2efca9,InvokeModelCommand as _0x165d54}from'@aws-sdk/client-bedrock-runtime';import{createParser as $t}from'eventsource-parser';import{parseDocument as _0x30fc90}from'htmlparser2';import{isTag as _0x3f3ba2,findOne as gt,getParent as _0x3fc262,findAll as _0x2c64d2,removeElement as _0x3d9e89,replaceElement as _0xdcc4c7,prepend as _0x5998b9,prependChild as _0x211b53,appendChild as _0x43c81c,append as _0x4b23c9,find as _0x1fdc97,isComment as _0xf29723,getChildren as _0x352c42,textContent as _0x59c2b1}from'domutils';import _0x41ec78 from'dom-serializer';import{Document as _t,Element as _0xd483af,Text as _0x11c603,cloneNode as _0x133e70,isDocument as _0x2a03c,isText as _0x3406d7,NodeWithChildren as _0xd5d578}from'domhandler';import{MarkdownGfmMdToHtml as _0x55f2e4}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{fixElementSuggestionRange as _0x122c7c,DocumentCompare as ot,DATA_ID_MODEL_ATTRIBUTE as nt,ConfirmMixin as _0x18bd4a,LateFocusDropdownButtonView as _0x2d3ad3,getAllMarkersDomElementsSorted as _0x7ab312,SuggestionsConversion as zt,DATA_ID_VIEW_ATTRIBUTE as _0x33e8be,getMarkerDomElement as _0x542205}from'ckeditor5-collaboration/dist/index.js';import{cloneDeep as _0x2c607f}from'es-toolkit';import _0xf4f147 from'morphdom';import{IconWeb as _0x36ce2a,IconClose as _0x2a2d8c,IconDocument as _0x4e1fe0,IconSelection as _0x5816f7,IconFileUpload as _0x2f568d,IconLink as _0x4b76f4,IconBulb as _0x75147f,IconAI as _0x2f39f9,IconPreviousArrow as _0x1cd954,IconCheck as _0x29ef47,IconDocumentOutline as _0x22d121,IconPaperClip as _0x1023cb,IconBrowseFiles as _0x64b1f3,IconDropdownArrow as _0x518767,IconAIAskAI as _0xb2c2db,IconThumbUp as _0x28b807,IconThumbDown as _0x14a807,IconCopy as _0xc73b1c,IconShowChangesOff as _0x1d82c1,IconShowChangesOn as _0x57a2a6,IconAIQuickActions as yt,IconAIChatCommands as Lt,IconAIImproveWriting as Ft,IconAIContinueWriting as Yt,IconAIGrammarCheck as Gt,IconAIAdjustLength as Qt,IconAIChangeTone as Kt,IconAITranslate as Bt,IconAIOther as Wt,IconRefresh as _0x3fcef2,IconNextArrow as _0xd08896}from'@ckeditor/ckeditor5-icons/dist/index.js';import{diffArrays as _0x3472b0}from'diff';const x='_ungrouppedCommands';function o(_0x5042a1,_0x5a1199){const _0x35f10c=(0x0,_0x5a1199['t'])('Other');return _0x5042a1['length']?'groupId'in _0x5042a1[0x0]?_0x5042a1:[{'groupId':x,'groupLabel':_0x35f10c,'order':0x1/0x0,'commands':_0x5042a1}]:[{'groupId':x,'groupLabel':_0x35f10c,'order':0x1/0x0,'commands':[]}];}const Pn=globalThis['DataTransfer'],f='ai-ui';class a extends _0x15e219{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x26d56b}=this,_0x58610a=['ck-fake-ai-selection'];_0x26d56b['config']['get']('ai.assistant.useTheme')&&_0x58610a['push']('ck-ai-assistant-ui_theme'),_0x26d56b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x58610a,'priority':0xc}}),_0x26d56b['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x1923f8,{writer:_0x4176bd})=>{if(!_0x1923f8['markerRange']['isCollapsed'])return null;const _0x155a5f=_0x4176bd['createUIElement']('span');return _0x4176bd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x155a5f),_0x155a5f;}});}['afterInit'](){!async function(_0x4758ec){const _0x17d9b2=_0x3c3691([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]),_0x3c81d0=0x3dffc4e1,_0xd71a34=0x3df84589^_0x3c81d0,_0x4d066f=window[_0x3c3691([0x44,0x61,0x74,0x65])][_0x3c3691([0x6e,0x6f,0x77])](),_0x4026ed=_0x4758ec[_0x3c3691([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x43d975=new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1d8f3f=>{_0x4026ed[_0x3c3691([0x6f,0x6e,0x63,0x65])](_0x3c3691([0x72,0x65,0x61,0x64,0x79]),_0x1d8f3f);}),_0x3a0955={[_0x3c3691([0x6b,0x74,0x79])]:_0x3c3691([0x45,0x43]),[_0x3c3691([0x75,0x73,0x65])]:_0x3c3691([0x73,0x69,0x67]),[_0x3c3691([0x63,0x72,0x76])]:_0x3c3691([0x50,0x2d,0x32,0x35,0x36]),[_0x3c3691([0x78])]:_0x3c3691([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]),[_0x3c3691([0x79])]:_0x3c3691([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]),[_0x3c3691([0x61,0x6c,0x67])]:_0x3c3691([0x45,0x53,0x32,0x35,0x36])},_0x20513e=_0x4026ed[_0x3c3691([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c3691([0x67,0x65,0x74])](_0x3c3691([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4c68be(){let _0x4a5489,_0x5c38b5=null,_0xed8d6a=null;try{if(_0x20513e==_0x3c3691([0x47,0x50,0x4c]))return _0x3c3691([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4a5489=_0x548778(),!_0x4a5489)return _0x3c3691([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4a5489[_0x3c3691([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xed8d6a=_0xacf2ca(_0x4a5489[_0x3c3691([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4a5489[_0x3c3691([0x6a,0x74,0x69])])),await _0x58ed67()?_0x724bc5()?_0x4dbe2a()?_0x3c3691([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4088d8()?(_0x4a5489[_0x3c3691([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c3691([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5c38b5=_0x34ade9(_0x3c3691([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1c8e2a()):_0x3c3691([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c3691([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c3691([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3c3691([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4dbe2a(){const _0x2c8683=[_0x3c3691([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c3691([0x74,0x72,0x69,0x61,0x6c])][_0x3c3691([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4a5489[_0x3c3691([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4d066f/0x3e8:0xe10*_0xd71a34;return _0x4a5489[_0x3c3691([0x65,0x78,0x70])]<_0x2c8683;}function _0x724bc5(){const _0x2a5c57=_0x4a5489[_0x3c3691([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2a5c57&&(!!_0x2a5c57[_0x3c3691([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3691([0x2a]))||!!_0x2a5c57[_0x3c3691([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3691([0x41,0x49])));}function _0x4088d8(){const _0x178358=_0x4a5489[_0x3c3691([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x178358||0x0==_0x178358[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5ad5a3}=new URL(window[_0x3c3691([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x178358[_0x3c3691([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5ad5a3))return!0x0;const _0x319ba8=_0x5ad5a3[_0x3c3691([0x73,0x70,0x6c,0x69,0x74])](_0x3c3691([0x2e]));return _0x178358[_0x3c3691([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x437ba0=>_0x437ba0[_0x3c3691([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3691([0x2a])))[_0x3c3691([0x6d,0x61,0x70])](_0xf12e8b=>_0xf12e8b[_0x3c3691([0x73,0x70,0x6c,0x69,0x74])](_0x3c3691([0x2e])))[_0x3c3691([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x30c4e5=>_0x30c4e5[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x319ba8[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c3691([0x6d,0x61,0x70])](_0xde644a=>Array(_0x319ba8[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0xde644a[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c3691([0x66,0x69,0x6c,0x6c])](_0xde644a[0x0]===_0x3c3691([0x2a])?_0x3c3691([0x2a]):'')[_0x3c3691([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0xde644a))[_0x3c3691([0x73,0x6f,0x6d,0x65])](_0x387c4f=>_0x319ba8[_0x3c3691([0x65,0x76,0x65,0x72,0x79])]((_0x553dbf,_0x70cd)=>_0x387c4f[_0x70cd]===_0x553dbf||_0x387c4f[_0x70cd]===_0x3c3691([0x2a])));}function _0x1c8e2a(){return _0x5c38b5&&_0xed8d6a?new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1e2c4a,_0x528880)=>{_0x5c38b5[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x1e2c4a,_0x528880),_0xed8d6a[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x50334c=>{_0x50334c!=_0x3c3691([0x56,0x61,0x6c,0x69,0x64])&&_0x1e2c4a(_0x50334c);},_0x528880);}):_0x5c38b5||_0xed8d6a||_0x3c3691([0x56,0x61,0x6c,0x69,0x64]);}}function _0xacf2ca(_0x46eb60,_0x57d3e2){return new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2e81dc=>{if(_0x37dda1())return _0x2e81dc(_0x3c3691([0x56,0x61,0x6c,0x69,0x64]));_0x383634(),_0x4026ed[_0x3c3691([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c3691([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x569efc=!0x1;const _0x488e16=_0x36c3ed();function _0x3d22e5(_0xe96062){return!!_0xe96062&&(typeof _0xe96062===_0x3c3691([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xe96062===_0x3c3691([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xe96062[_0x3c3691([0x74,0x68,0x65,0x6e])]===_0x3c3691([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xe96062[_0x3c3691([0x63,0x61,0x74,0x63,0x68])]===_0x3c3691([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2d3811(_0x4af0c9){_0x434f8f(_0x4af0c9)[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x15dee9=>{if(!_0x15dee9||_0x15dee9[_0x3c3691([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c3691([0x6f,0x6b]))return _0x3c3691([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xa4a3d8(_0x25fa02(_0x488e16+_0x57d3e2))!=_0x15dee9[_0x3c3691([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c3691([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c3691([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x45814f=>(_0x4a2829(),_0x45814f),()=>{const _0x166012=_0x44a6b1();return null==_0x166012?(_0x4a2829(),_0x3c3691([0x56,0x61,0x6c,0x69,0x64])):_0x3c3691(_0x4d066f-_0x166012>(0x19f340e1^_0x3c81d0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x2e81dc)[_0x3c3691([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2e81dc(_0x3c3691([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x26fed1=0x3dc92a61^_0x3c81d0;function _0x4a2829(){const _0x34f5b1=_0x3c3691([0x6c,0x6c,0x63,0x74,0x2d])+_0xa4a3d8(_0x25fa02(_0x46eb60)),_0x3b3b5d=_0x1265eb(_0xa4a3d8(window[_0x3c3691([0x4d,0x61,0x74,0x68])][_0x3c3691([0x63,0x65,0x69,0x6c])](_0x4d066f/_0x26fed1)));window[_0x3c3691([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c3691([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x34f5b1,_0x3b3b5d);}function _0x44a6b1(){const _0x13c642=_0x3c3691([0x6c,0x6c,0x63,0x74,0x2d])+_0xa4a3d8(_0x25fa02(_0x46eb60)),_0x2cff3e=window[_0x3c3691([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c3691([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x13c642);return _0x2cff3e?window[_0x3c3691([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1265eb(_0x2cff3e),0x10)*_0x26fed1:null;}function _0x434f8f(_0x188217){return new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x191a6c,_0x286781)=>{_0x188217[_0x3c3691([0x74,0x68,0x65,0x6e])](_0x191a6c,_0x286781),window[_0x3c3691([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x286781,0x3dfe1021^_0x3c81d0);});}}_0x4026ed[_0x3c3691([0x6f,0x6e])](_0x3c3691([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2f717e,_0x25a96d)=>{if(_0x25a96d[0x0]!=_0x46eb60)return _0x2e81dc(_0x3c3691([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x25a96d[0x1]={..._0x25a96d[0x1],[_0x3c3691([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x488e16};},{[_0x3c3691([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c3691([0x68,0x69,0x67,0x68])}),_0x4026ed[_0x3c3691([0x6f,0x6e])](_0x3c3691([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x560375=>{_0x3d22e5(_0x560375[_0x3c3691([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x569efc=!0x0,_0x2d3811(_0x560375[_0x3c3691([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c3691([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c3691([0x6c,0x6f,0x77])}),_0x43d975[_0x3c3691([0x74,0x68,0x65,0x6e])](()=>{_0x569efc||_0x2e81dc(_0x3c3691([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x37dda1(){return _0x4026ed[_0x3c3691([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c3691([0x76,0x69,0x65,0x77])][_0x3c3691([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c3691([0x61,0x75,0x74,0x6f]);}function _0x383634(){_0x4026ed[_0x3c3691([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c3691([0x76,0x69,0x65,0x77])][_0x3c3691([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c3691([0x61,0x75,0x74,0x6f]);}}function _0x34ade9(_0x197fbb){const _0xee395b=[new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x380cfe=>setTimeout(_0x380cfe,0x3df6fa2d^_0x3c81d0)),_0x43d975[_0x3c3691([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4eaad8=>{let _0x54deca=0x0;_0x4026ed[_0x3c3691([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3691([0x6f,0x6e])](_0x3c3691([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x566137,_0x1df09a)=>{_0x1df09a[0x0][_0x3c3691([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x54deca++,_0x54deca==(0x3dffc109^_0x3c81d0)&&(_0x4eaad8(),_0x566137[_0x3c3691([0x6f,0x66,0x66])]());});}))];return window[_0x3c3691([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c3691([0x72,0x61,0x63,0x65])](_0xee395b)[_0x3c3691([0x74,0x68,0x65,0x6e])](()=>_0x197fbb);}async function _0x3a33df(){await _0x43d975,_0x4026ed[_0x3c3691([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3691([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x277983,_0x4026ed[_0x3c3691([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3691([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x277983,_0x4026ed[_0x3c3691([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c3691([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1606fd(_0x14a7ce){const _0x1a5e70=_0xe973d8();_0x4026ed[_0x1a5e70]=_0x3c3691([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x14a7ce,_0x14a7ce!=_0x3c3691([0x56,0x61,0x6c,0x69,0x64])&&_0x3a33df();}function _0xe973d8(){const _0x4f12e0=window[_0x3c3691([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c3691([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c3691([0x6e,0x6f,0x77])]())[_0x3c3691([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c3691([0x2e]),'');let _0x1d0471=_0x3c3691([0x6e]);for(let _0x43fc67=0x0;_0x43fc67<_0x4f12e0[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x43fc67+=0x2){let _0x4c1df9=window[_0x3c3691([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f12e0[_0x3c3691([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x43fc67,_0x43fc67+0x2));_0x4c1df9>=_0x17d9b2[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4c1df9-=_0x17d9b2[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1d0471+=_0x17d9b2[_0x4c1df9];}return _0x1d0471;}function _0x548778(){const _0x2a74ab=_0x20513e[_0x3c3691([0x73,0x70,0x6c,0x69,0x74])](_0x3c3691([0x2e]));if(0x3!=_0x2a74ab[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x595a29(_0x2a74ab[0x1]);function _0x595a29(_0x5174bc){const _0x16fcac=_0xcb284c(_0x5174bc);return _0x16fcac&&_0x50ed37()?_0x16fcac:null;function _0x50ed37(){const _0xa20f74=_0x16fcac[_0x3c3691([0x6a,0x74,0x69])],_0x26537b=window[_0x3c3691([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xa20f74[_0x3c3691([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xa20f74[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3bbd01={..._0x16fcac,[_0x3c3691([0x6a,0x74,0x69])]:_0xa20f74[_0x3c3691([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xa20f74[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3bbd01[_0x3c3691([0x76,0x63])],_0x25fa02(_0x3bbd01)==_0x26537b;}}}async function _0x58ed67(){let _0x3d77fa=!0x0;try{const _0x36b0b2=_0x20513e[_0x3c3691([0x73,0x70,0x6c,0x69,0x74])](_0x3c3691([0x2e])),[_0x5f08ef,_0x42a114,_0x387e65]=_0x36b0b2;return _0x42dd60(_0x5f08ef),await _0x4e5d5(_0x5f08ef,_0x42a114,_0x387e65),_0x3d77fa;}catch{return!0x1;}function _0x42dd60(_0x10d09d){const _0x9fa41e=_0xcb284c(_0x10d09d);_0x9fa41e&&_0x9fa41e[_0x3c3691([0x61,0x6c,0x67])]==_0x3c3691([0x45,0x53,0x32,0x35,0x36])||(_0x3d77fa=!0x1);}async function _0x4e5d5(_0x21d799,_0xcf5994,_0x3cb508){const _0x4ae65a=window[_0x3c3691([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c3691([0x66,0x72,0x6f,0x6d])](_0x3d354b(_0x3cb508),_0x2c7e68=>_0x2c7e68[_0x3c3691([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x21b6ba=new window[(_0x3c3691([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c3691([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x21d799+_0x3c3691([0x2e])+_0xcf5994),_0x1156f3=window[_0x3c3691([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c3691([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1156f3)return;const _0x3be36e=await _0x1156f3[_0x3c3691([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c3691([0x6a,0x77,0x6b]),_0x3a0955,{[_0x3c3691([0x6e,0x61,0x6d,0x65])]:_0x3c3691([0x45,0x43,0x44,0x53,0x41]),[_0x3c3691([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c3691([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c3691([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1156f3[_0x3c3691([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c3691([0x6e,0x61,0x6d,0x65])]:_0x3c3691([0x45,0x43,0x44,0x53,0x41]),[_0x3c3691([0x68,0x61,0x73,0x68])]:{[_0x3c3691([0x6e,0x61,0x6d,0x65])]:_0x3c3691([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3be36e,_0x4ae65a,_0x21b6ba)||(_0x3d77fa=!0x1);}}function _0xcb284c(_0x523669){return _0x523669[_0x3c3691([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c3691([0x65,0x79]))?JSON[_0x3c3691([0x70,0x61,0x72,0x73,0x65])](_0x3d354b(_0x523669)):null;}function _0x3d354b(_0x5aaba1){return window[_0x3c3691([0x61,0x74,0x6f,0x62])](_0x5aaba1[_0x3c3691([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c3691([0x2b]))[_0x3c3691([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c3691([0x2f])));}function _0x25fa02(_0x31fbf3){let _0x245a9f=0x1505;function _0x3be853(_0x4307bb){for(let _0x1a1642=0x0;_0x1a1642<_0x4307bb[_0x3c3691([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a1642++){const _0x197b40=_0x4307bb[_0x3c3691([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1a1642);_0x245a9f=(_0x245a9f<<0x5)+_0x245a9f+_0x197b40,_0x245a9f&=_0x245a9f;}}function _0x1a9356(_0x735b13){Array[_0x3c3691([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x735b13)?_0x735b13[_0x3c3691([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1a9356):_0x735b13&&typeof _0x735b13==_0x3c3691([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c3691([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x735b13)[_0x3c3691([0x73,0x6f,0x72,0x74])]()[_0x3c3691([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x279167,_0xc0f73e])=>{_0x3be853(_0x279167),_0x1a9356(_0xc0f73e);}):_0x3be853(window[_0x3c3691([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x735b13));}return _0x1a9356(_0x31fbf3),_0x245a9f>>>0x0;}function _0xa4a3d8(_0x3a6b61){return _0x3a6b61[_0x3c3691([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c3691([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c3691([0x30]));}function _0x1265eb(_0x468b09){return _0x468b09[_0x3c3691([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c3691([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c3691([0x6a,0x6f,0x69,0x6e])]('');}function _0x277983(){}function _0x3c3691(_0x5824cf){return _0x5824cf['map'](_0x3afb0d=>String['fromCharCode'](_0x3afb0d))['join']('');}_0x1606fd(await _0x4c68be());}(this);}['showFakeVisualSelection'](){const _0x115a04=this['editor']['model'];_0x115a04['change'](_0x597bdc=>{const _0x3b113f=_0x115a04['document']['selection']['getRanges']();let _0x20bee4=0x0;for(const _0x46c307 of _0x3b113f){const _0x3453c0=f+':'+_0x20bee4;if(_0x115a04['markers']['has'](_0x3453c0))_0x597bdc['updateMarker'](_0x3453c0,{'range':_0x46c307});else{if(_0x46c307['start']['isAtEnd']){const _0x708d1e=_0x46c307['start']['getLastMatchingPosition'](({item:_0x8a1445})=>!_0x115a04['schema']['isContent'](_0x8a1445),{'boundaries':_0x46c307});_0x597bdc['addMarker'](_0x3453c0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x597bdc['createRange'](_0x708d1e,_0x46c307['end'])});}else _0x597bdc['addMarker'](_0x3453c0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x46c307});}_0x20bee4++;}});}['hideFakeVisualSelection'](){const _0xbb4aeb=this['editor']['model'],_0x4b8e9c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x4b8e9c['length']&&_0xbb4aeb['change'](_0x47fd04=>{_0x4b8e9c['forEach'](_0x48ba66=>{_0x47fd04['removeMarker'](_0x48ba66);});});}['insertContent'](_0x1a76da,_0x380285){const _0x9b33f6=this['_getAISelection'](),_0x536846=_0x380285||_0x9b33f6['getFirstRange']();this['editor']['model']['canEditAt'](_0x536846)&&this['editor']['model']['change'](_0xde3ae6=>{this['hideFakeVisualSelection'](),_0x380285||this['_resetContentOfSelectedTableCells'](_0xde3ae6,_0x9b33f6),this['_pasteHTMLUsingClipboard']({'insertAt':_0x536846,'writer':_0xde3ae6,'html':_0x1a76da});});}['insertContentBelow'](_0x835e9e){const {model:_0x3fce26}=this['editor'],_0x23e082=this['_getAISelection']();_0x3fce26['change'](()=>{const _0x4d4c95=this['_prepareTableInsertBelowPosition'](_0x835e9e,_0x23e082)||this['_getDefaultInsertBelowPosition'](_0x23e082);this['insertContent'](_0x835e9e,_0x4d4c95);});}['_getAISelection'](){const _0x2421d3=this['editor']['model'],_0x4bf018=Array['from'](_0x2421d3['markers']['getMarkersGroup'](f))['map'](_0x2fbe10=>_0x2fbe10['getRange']());return _0x2421d3['createSelection'](_0x4bf018);}['_pasteHTMLUsingClipboard']({writer:_0x197844,html:_0x328b06,insertAt:_0x1c4f51}){const {view:_0x521239}=this['editor']['editing'],_0x1926d9=this['editor']['plugins']['get'](_0x51ff1d),_0x3af2de=new Pn();_0x3af2de['setData']('text/html',_0x328b06);const _0xd8a3a7=new ClipboardEvent('paste',{'clipboardData':_0x3af2de}),_0x2e5872=new _0x12dc77(_0x521239,_0xd8a3a7,{'dataTransfer':new _0xbd6943(_0x3af2de)});_0x197844['setSelection'](_0x1c4f51);const _0x82a1c3=(_0x21a196,_0x3f537d)=>{_0x3f537d['resultRange']&&_0x197844['setSelection'](_0x3f537d['resultRange']);};_0x1926d9['once']('contentInsertion',_0x82a1c3,{'priority':'lowest'}),_0x521239['document']['fire']('paste',_0x2e5872),_0x1926d9['off']('contentInsertion',_0x82a1c3);}['_getDefaultInsertBelowPosition'](_0x186868){const {model:_0x23a1d3}=this['editor'],_0x275dea=Array['from'](_0x186868['getSelectedBlocks']());return _0x275dea['length']?_0x23a1d3['createPositionAfter'](_0x275dea['pop']()):_0x186868['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x455aed,_0x514f09){const {model:_0x39cf1d,plugins:_0x1f6c4e}=this['editor'];if(_0x1f6c4e['has']('TableUtils')){const _0x46643a=_0x1f6c4e['get']('TableUtils')['getSelectedTableCells'](_0x514f09);if(_0x46643a['length']){const _0x296746=this['_getTableRowCountFromContent'](_0x455aed),_0x3fde66=this['_createEmptyTableRows'](_0x46643a,_0x296746);return _0x39cf1d['createPositionAt'](_0x3fde66,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a9d3e){const _0x10f97f=this['editor']['plugins']['get']('TableUtils'),_0x1fb93c=this['editor']['data']['parse'](_0x1a9d3e),_0x504c52=Array['from'](_0x1fb93c['getChildren']())['filter'](_0x3fcfc6=>_0x3fcfc6['is']('element','table'));let _0x4de0ce=0x0;return _0x504c52['forEach'](_0x1e7021=>{_0x4de0ce+=_0x10f97f['getRows'](_0x1e7021);}),_0x4de0ce;}['_createEmptyTableRows'](_0x21d194,_0x2b7a09){const _0x49f79e=this['editor']['plugins']['get']('TableUtils'),_0x5a2a8f=_0x49f79e['getRowIndexes'](_0x21d194),_0x5de501=_0x49f79e['getColumnIndexes'](_0x21d194),_0x502da4=_0x5a2a8f['last']+0x1,_0x342efd=_0x5de501['first'],_0x103a5b=_0x21d194[0x0]['findAncestor']('table');for(let _0x7ec7b9=0x0;_0x7ec7b9<_0x2b7a09;_0x7ec7b9++)_0x49f79e['insertRows'](_0x103a5b,{'at':_0x502da4});return _0x103a5b['getChild'](_0x502da4)['getChild'](_0x342efd);}['_resetContentOfSelectedTableCells'](_0x237039,_0x25de41){const {plugins:_0x2c463b}=this['editor'],{model:_0x2c3836}=_0x237039;if(!_0x2c463b['has']('TableUtils'))return;_0x2c463b['get']('TableUtils')['getSelectedTableCells'](_0x25de41)['length']&&_0x2c3836['deleteContent'](_0x25de41);}}class K extends _0x15e219{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1a859a('aiadapter-text-adapter-not-set',null);}}class er extends Error{constructor(_0x3a5bea){super(_0x3a5bea),this['name']='AIRequestError';}}function Hn(_0x262492,_0x4abb99,_0x40ccf0){const t=_0x262492['t'];switch(_0x4abb99){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',_0x40ccf0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x40ccf0);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'},_0x40ccf0);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 _0x4abb99;}}class E extends Ut{['_commandDefinitions'];constructor(_0x24e7f8,_0x19eae3){super(_0x24e7f8),this['_commandDefinitions']=_0x19eae3,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1116c6,_0x7a6d03,_0x275a54)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x275a54));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1c1e60,_0x5603bb,_0x314fe5)=>{this['enabledCommandsIds']=_0x314fe5?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x482073=this['editor']['model'];this['_hasContext']=function(_0x4a7e6d){const _0x3ef497=_0x4a7e6d['document']['selection'];return _0x3ef497['isCollapsed']?0x0!==[..._0x3ef497['getSelectedBlocks']()]['length']&&![..._0x3ef497['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4a7e6d['hasContent'](_0x3ef497['getFirstRange']());}(_0x482073);const _0x5e37ed=_0x482073['document']['selection'],_0x46f3c4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x180d29 of _0x5e37ed['getRanges']())for(const _0x3f381e of _0x180d29['getItems']())if(_0x3f381e['is']('element')&&_0x46f3c4['includes'](_0x3f381e['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x111a22='',_0x38069c='',_0x54a104='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x111a22,_0x38069c,_0x54a104);}}function ns(_0x57de33,_0x40d042){const _0xbdc275=new Set();for(const _0x2b14f5 of _0x57de33['values']())(_0x40d042||!0x1===_0x2b14f5['requiresContent'])&&_0xbdc275['add'](_0x2b14f5['id']);return Array['from'](_0xbdc275);}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(_0x1eda2f,_0x202567,_0x1c970b){super(),this['editor']=_0x1eda2f,this['textAdapter']=_0x202567,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x1c970b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x53136b,_0x1c0f8b,_0x2db084)=>{this['view']['value']=this['_sanitizeHTML'](_0x2db084);}),this['listenTo'](this['view'],'submitPrompt',(_0x503515,_0x22f7de)=>{const _0x4b77a6=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x22f7de,_0x4b77a6,'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:_0x499d59,query:_0x5dcd2e,htmlContent:_0x2986e8,label:_0x1c0357,mainActionLabel:_0x14acbb}){this['view']['prompt']=_0x1c0357,this['view']['mainAction']=_0x14acbb,this['initialContext']=_0x2986e8,_0x5dcd2e&&(this['view']['isRendered']?this['_handleQuery'](_0x5dcd2e,_0x2986e8,_0x499d59,_0x1c0357):this['view']['once']('render',()=>{this['_handleQuery'](_0x5dcd2e,_0x2986e8,_0x499d59,_0x1c0357);}));}['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'](_0x260da7,_0x36ceba,_0x241792,_0x3c2232){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x36ceba,this['previousQuery']=_0x260da7,this['previousLabel']=_0x3c2232||_0x260da7,this['previousActionId']=_0x241792,new Promise(_0x3f5ec9=>{this['textAdapter']['makeRequest']({'query':_0x260da7,'context':_0x36ceba,'onData':_0x308e3f=>{this['currentResponse']=_0x308e3f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x241792})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x49da2d=>{_0x49da2d instanceof er?this['view']['handleError'](_0x49da2d['message']):this['view']['handleError'](),_0x3f5ec9();})['finally'](()=>{this['stopProcessing'](),_0x3f5ec9();});});}['_parseAndNormalizeContent'](_0x57a8bf,_0x2494a2=!0x1){const _0x3d0709=hs['exec'](_0x57a8bf);_0x57a8bf=_0x3d0709?_0x57a8bf['substring'](_0x3d0709[0x1]['length']):_0x57a8bf['length']<0x64&&!_0x2494a2?'':this['_stripMarkdownSyntax'](_0x57a8bf);const _0x18c6c2=this['_domParser']['parseFromString'](_0x57a8bf,'text/html');if(_0x3d0709){const _0x5e237b=Array['from'](_0x18c6c2['body']['childNodes']);_0x5e237b['reverse']();for(const _0x287dbd of _0x5e237b){if(_0x287dbd['nodeType']==Node['ELEMENT_NODE'])break;_0x287dbd['remove']();}}const _0x5ebaa8=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x18c6c2['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5ebaa8);const _0x31208b=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x1bc473=this['editor']['data']['toModel'](_0x5ebaa8);return _0x31208b||_0x1bc473['markers']['clear'](),this['editor']['data']['stringify'](_0x1bc473);}['_normalizeResponseHeadings'](_0x386591){const _0x29be04=new _0x166a08(this['editor']['editing']['view']['document']),_0x2634e7=new _0x4d351c({'name':/^h[1-5]$/}),_0x398171=[];let _0x161b5b=!0x1;for(const _0x72c37c of _0x386591)_0x72c37c['is']('element')&&_0x2634e7['match'](_0x72c37c)&&(_0x398171['push'](_0x72c37c),'h1'==_0x72c37c['name']&&(_0x161b5b=!0x0));if(_0x161b5b){for(const _0x36c882 of _0x398171)_0x29be04['rename']('h'+(parseInt(_0x36c882['name'][0x1])+0x1),_0x36c882);}}['_isH1TagSupportEnabled'](){const {data:_0x3675ac,editing:_0xd2ba62}=this['editor'],_0x103ed9=_0x3675ac['htmlProcessor']['toView']('<h1></h1>'),_0x52b595=_0x3675ac['toView'](_0x3675ac['toModel'](_0x103ed9));return!!_0xd2ba62['view']['domConverter']['viewToDom'](_0x52b595)['querySelector']('h1');}['_sanitizeHTML'](_0x38e59e){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x38e59e),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x21a34d){const _0x520a28=_0x21a34d['trim']();return _0x520a28['startsWith']('```html')?_0x520a28['endsWith']('```')?_0x520a28['substring'](0x7,_0x520a28['length']-0x3):_0x520a28['substring'](0x7):_0x21a34d;}}const _={'REPLACE':'replace','INSERT':'insert'};class Er extends _0x191b6d{constructor(_0x356b1b){super(_0x356b1b),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5763c8=>Hn(_0x356b1b,'AI_'+_0x5763c8['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Hn(_0x356b1b,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Hn(_0x356b1b,'Try\x20again')),this['stopButton']=this['_createButton'](Hn(_0x356b1b,'Stop'));const _0x5e31aa=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5e31aa['if']('isVisible','ck-hidden',_0x11fe3a=>!_0x11fe3a)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x523a82,_0x5f1414){const _0x50178f=new _0x5822be(this['locale']);return _0x50178f['set']({'label':_0x523a82,'class':_0x5f1414||'','isVisible':!0x0,'withText':!0x0}),_0x50178f;}}class Pr extends _0x2f8c3b{['contentFieldView'];['copyButtonView'];constructor(_0x1351de,_0x191bb2=''){super(_0x1351de),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4ebd3c=this['bindTemplate'];this['contentFieldView']=new Mn(_0x1351de,_0x191bb2),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4ebd3c['if']('isVisible','ck-hidden',_0x37b1fc=>!_0x37b1fc)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4ebd3c['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 _0x38a4b6=!0x1;this['on']('change:value',(_0x22d4c2,_0xc1acf4,_0x49bbc9)=>{const _0x189526=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x49bbc9),this['isProcessing']&&_0x189526&&!_0x38a4b6&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5a4fb5,_0x414d98,_0x11fa10)=>{_0x38a4b6=!0x1,_0x11fa10?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x38a4b6=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x38a4b6=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5b6b96=this['locale'],_0x166bc7=new _0x5822be(this['locale']),_0xb94858='ck-ai-form__copy-button';return _0x166bc7['set']({'label':Hn(_0x5b6b96,'Copy'),'icon':_0x59fb0f,'class':_0xb94858,'tooltip':!0x0}),_0x166bc7['bind']('isVisible')['to'](this,'value',_0x3a7cd4=>!!_0x3a7cd4),_0x166bc7['bind']('isEnabled')['to'](this,'isProcessing',_0xb437d=>!_0xb437d),_0x166bc7['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x166bc7['icon']=_0x17291e,_0x166bc7['class']=_0xb94858+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x166bc7['icon']=_0x59fb0f,_0x166bc7['class']=_0xb94858;},0x3e8);}),_0x166bc7;}['_copyHTMLToClipboard'](_0x1ee0a1){const {window:_0xe0d335,document:_0x21762c}=_0x461dbe;if(_0xe0d335['ClipboardItem']){const {Blob:_0x2f0d4a,ClipboardItem:_0x543207}=_0xe0d335,_0x5314a3=[new _0x543207({'text/html':new _0x2f0d4a([_0x1ee0a1['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2f0d4a([_0x1ee0a1['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5314a3);}else{const _0x3e03b2=_0x21762c['createElement']('div');_0x3e03b2['style']['position']='absolute',_0x3e03b2['style']['left']='-9999px',_0x3e03b2['innerHTML']='<span>[</span>'+_0x1ee0a1['innerHTML']+'<span>]</span>',_0x21762c['body']['appendChild'](_0x3e03b2);const _0x263785=_0x21762c['createRange']();_0x263785['setStartAfter'](_0x3e03b2['firstElementChild']),_0x263785['setEndBefore'](_0x3e03b2['lastElementChild']);const _0x14d383=_0xe0d335['getSelection']();_0x14d383['removeAllRanges'](),_0x14d383['addRange'](_0x263785),_0x21762c['execCommand']('copy'),_0x3e03b2['remove']();}}}class Mn extends _0x2f8c3b{constructor(_0x3f46cf,_0x39b4ca=''){super(_0x3f46cf),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x39b4ca,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xc0f9f1){this['element']['innerHTML']=_0xc0f9f1;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x42df57=new _0x2f8c3b(),_0x1d434a=this['locale'],_0x3f295f=new _0x3ce061();return _0x3f295f['isVisible']=!0x0,_0x42df57['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3f295f,{'text':Hn(_0x1d434a,'AI\x20is\x20writing...')}]}),_0x42df57['render'](),_0x42df57;}}class Ir extends _0x2f8c3b{constructor(_0x5d71cf,_0x5a01b9=''){super(_0x5d71cf);const _0xfb37e6=new _0x32da72(),_0xf2f38f=this['bindTemplate'];this['set']('text',_0x5a01b9),_0xfb37e6['content']=_0x3e168a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xfb37e6,{'text':_0xf2f38f['to']('text')}]});}}class Vr extends _0xde303d{['submitButtonView'];['showHistoryButtonView'];constructor(_0x45130c,_0x2c70dc){super(_0x45130c,_0x2c70dc),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',(_0x44a1cc,_0xd4380b)=>{_0x44a1cc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xd4380b());});}['_createSubmitButton'](){const _0x42db9b=new _0x5822be(this['locale']),_0x31202a=this['locale'];return _0x42db9b['set']({'icon':_0x444de6,'label':Hn(_0x31202a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x42db9b['on']('execute',()=>{this['submit']();}),_0x42db9b['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x27f188,_0x328492)=>!_0x27f188&&_0x328492),_0x42db9b;}['_createShowHistoryButton'](){const _0x3160fc=new _0x5822be(this['locale']),_0x54e5f1=this['resultsView'],_0x2cdf64=this['locale'];_0x3160fc['set']({'label':Hn(_0x2cdf64,'History'),'withText':!0x1,'icon':Nt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3160fc['bind']('isOn')['to'](_0x54e5f1,'isVisible'),_0x3160fc['bind']('isEnabled')['to'](this,'isEnabled'),_0x3160fc['on']('execute',()=>{_0x54e5f1['isVisible']=!_0x54e5f1['isVisible'],_0x54e5f1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x41bd06=()=>{_0x461dbe['window']['requestAnimationFrame'](()=>{if(_0x1a0826(this['element'])){const _0x3229d6=new _0x7bf0be(this['queryView']['fieldView']['element']),_0x233ccc=_0x3229d6['width'],_0x42e729='rtl'===_0x2cdf64['uiLanguageDirection']?'left':'right';_0x3229d6['excludeScrollbarsAndBorders'](),_0x3160fc['element']['style'][_0x42e729]=_0x233ccc-_0x3229d6['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x41bd06),this['on']('render',_0x41bd06),_0x3160fc;}['submit'](){const _0x27874a=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x27874a);}['focus'](_0x5ce732){-0x1===_0x5ce732?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Hr extends _0x184d2c{['historyGroupView'];['clearHistoryButton'];constructor(_0x3dcd65){super(_0x3dcd65),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x2b7f61(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Hn(_0x3dcd65,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1024b7=0x0;for(const _0x48afdc of this['items'])_0x1024b7+=_0x48afdc['items']['length'];return{'resultsCount':_0x1024b7,'totalItemsCount':_0x1024b7};}['_createClearHistoryButton'](){const _0x38aeac=this['locale'],_0x4b3a77=new _0x5822be(this['locale']);return _0x4b3a77['set']({'label':'('+Hn(_0x38aeac,'Clear')+')','withText':!0x0}),_0x4b3a77['on']('execute',()=>this['fire']('clearHistory')),_0x4b3a77;}}class Rr extends _0xe814a3{constructor(_0x41f76f){super();const _0x3098d6=new _0x143c37(),_0x30ec6b=new _0x5822be(this['locale'],_0x3098d6);this['children']['add'](_0x30ec6b),_0x30ec6b['set']({'label':_0x41f76f['prompt'],'withText':!0x0}),_0x30ec6b['on']('execute',()=>{this['fire']('execute',{'value':_0xe93c3f(_0x41f76f['prompt'])});});}}const So='CKEditor/AIFormView/PromptHistory';class Br extends _0x3ea87c{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4f2157,_0x2f3a5c)=>{const _0x185fb1=vo(_0x2f3a5c['prompt']);for(const _0x5214b9 of this)if(_0x5214b9!=_0x2f3a5c&&vo(_0x5214b9['prompt'])===_0x185fb1){this['remove'](_0x5214b9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x33e5a6=sessionStorage['getItem'](So)||'[]';this['addMany'](JSON['parse'](_0x33e5a6));}['_saveToSessionStorage'](){sessionStorage['setItem'](So,JSON['stringify'](this['map'](_0x680eb1=>_0x680eb1)));}}function vo(_0xf405fc){return _0xf405fc['toLowerCase']()['trim']();}class k extends _0x2f8c3b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x334b34,_0x498c14,_0x28aa09=''){super(_0x334b34),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 Br(),this['errorView']=new Ir(_0x334b34),this['contentArea']=new Pr(_0x334b34,_0x28aa09),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 _0x2afd45(),this['keystrokes']=new _0x16d287(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1842f7({'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 _0x49c918=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x498c14],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x49c918['if']('isError','ck-hidden',_0x26ad1b=>!_0x26ad1b)]},'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'](_0x4ece8f=0x1){-0x1===_0x4ece8f?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 _0x11a4f5=this['locale'],_0x4326c3=new Vr(_0x11a4f5,{'queryView':{'label':Hn(_0x11a4f5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1915a4,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Hn(_0x11a4f5,'Empty\x20history'),'secondary':Hn(_0x11a4f5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4326c3['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x55f3f6,_0x468c93)=>_0x55f3f6&&!_0x468c93),this['listenTo'](_0x4326c3,'submit',(_0x48b1f8,_0x8c3434)=>{this['prompt']=_0x8c3434;const _0x42c53e=_0xe77682(_0x8c3434);this['fire']('submitPrompt',_0x42c53e),_0x8c3434['trim']()&&this['_promptHistory']['add']({'prompt':_0x42c53e},0x0);},{'priority':'high'}),_0x4326c3;}['_createHistoryView'](){const _0x1377f1=new Hr(this['locale']);return _0x1377f1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Rr),_0x1377f1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1377f1;}['_createToolbar'](){const _0x42c09d=new Er(this['locale']);return _0x42c09d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x84ffbc,_0x495b34,_0x585320)=>_0x84ffbc&&!_0x495b34&&!!_0x585320),_0x42c09d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x42c09d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x342c45,_0x25a6ea,_0x3a858b)=>_0x342c45&&!_0x25a6ea&&!!_0x3a858b),_0x42c09d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x42c09d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a11f1,_0x550522)=>_0x2a11f1&&!_0x550522),_0x42c09d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x42c09d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x42c09d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x42c09d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1059d7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Hn(_0x1059d7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x110ce4){const _0x22e5a5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x110ce4||Hn(_0x22e5a5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x15e219{['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[_0x5bd49c,a,K,_0x724f59];}constructor(_0x2f8162){super(_0x2f8162),_0x2f8162['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2f8162['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2f8162['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2f8162['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1442a9}=this;this['_aiAdapter']=_0x1442a9['plugins']['get'](K),this['_dialog']=_0x1442a9['plugins']['get'](_0x724f59),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x16304c=new E(_0x1442a9,Array['from'](this['_commandDefinitions']['values']()));_0x1442a9['commands']['add']('showAIAssistant',_0x16304c),_0x1442a9['ui']['componentFactory']['add']('aiCommands',_0x8f4dc2=>{const _0x847ed2=_0x103d4b(_0x8f4dc2);return _0x847ed2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x847ed2['buttonView']['set']({'label':Hn(_0x8f4dc2,'AI\x20Commands'),'icon':_0xec2797,'tooltip':!0x0}),_0x847ed2['on']('execute',_0xc434d2=>this['_onExecute'](_0xc434d2['source']['id'])),_0x44d299(_0x847ed2,_0x1442a9['ui']['view']['body'],function(_0x32cc11){const _0x3e0c52=o(_0x32cc11['config']['get']('ai.assistant.commands'),_0x32cc11['locale']),_0x14cd69=B(_0x32cc11,_0x3e0c52)['filter'](_0x2f5261=>_0x2f5261['commands']['length']);if(0x1===_0x14cd69['length'])return B(_0x32cc11,_0x14cd69[0x0]['commands'])['map'](_0x53d390=>({'id':_0x53d390['id'],'label':_0x53d390['label']}));return _0x14cd69['map'](_0x178fa9=>{const {groupId:_0x15d813,groupLabel:_0x1befac,commands:_0x5bd9b5}=_0x178fa9,_0x105445=B(_0x32cc11,_0x5bd9b5)['map'](_0x17ab6d=>({'id':_0x17ab6d['id'],'label':_0x17ab6d['label']}));return{'id':_0x15d813,'menu':_0x1befac||_0x15d813,'children':_0x105445};});}(_0x1442a9),{'ariaLabel':Hn(_0x8f4dc2,'AI\x20Commands')}),_0x847ed2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x16304c['on']('change:enabledCommandsIds',_0x2fffa1),_0x847ed2['menuView']['once']('render',_0x2fffa1),_0x847ed2;function _0x2fffa1(){_0x847ed2['isEnabled']=_0x16304c['enabledCommandsIds']['length']>0x0;for(const _0x4de177 of _0x847ed2['menuView']['buttons'])_0x4de177['isEnabled']=_0x16304c['enabledCommandsIds']['includes'](_0x4de177['id']);}}),_0x1442a9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x334940=>{const _0x5f6f02=new _0x7ce5c8(_0x334940);_0x5f6f02['buttonView']['set']({'label':Hn(_0x334940,'AI\x20Commands'),'icon':_0xec2797}),_0x5f6f02['bind']('isEnabled')['to'](_0x16304c,'enabledCommandsIds',_0x1e49fe=>_0x1e49fe['length']>0x0);const _0x4af184=o(_0x1442a9['config']['get']('ai.assistant.commands'),_0x334940);return this['_populateMenuBarMenu'](_0x16304c,_0x5f6f02,_0x4af184,_0x46f2f9=>this['_onExecute'](_0x46f2f9)),_0x5f6f02;}),_0x1442a9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x42a022=this['_createAIAssistantUIButton'](_0x5822be);return _0x42a022['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x42a022;}),_0x1442a9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1ff1de=this['_createAIAssistantUIButton'](_0x11ed9d);return _0x1ff1de['set']({'role':'menuitemcheckbox'}),_0x1ff1de;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2ee044=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x29a485;for(const _0x2c3ea4 in _0x2ee044){const _0x1b1152=_0x2c3ea4,_0x178bd3=_0x2ee044[_0x1b1152];if('aiLicenseKeyValid'==_0x178bd3||'aiLicenseKeyInvalid'==_0x178bd3||'aiLicenseKeyExpired'==_0x178bd3||'aiLicenseKeyDomainLimit'==_0x178bd3||'aiLicenseKeyNotAllowed'==_0x178bd3||'aiLicenseKeyEvaluationLimit'==_0x178bd3||'aiLicenseKeyUsageLimit'==_0x178bd3){delete _0x2ee044[_0x1b1152],_0x29a485=_0x178bd3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x29a485&&_0x2ee044['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x29a485&&_0x2ee044['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x29a485&&_0x2ee044['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x29a485&&_0x2ee044['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x29a485&&_0x2ee044['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x29a485&&_0x2ee044['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x45f0dd='',_0x20dd81='',_0x18ee36='custom'){const _0x52b2cd=this['editor'],_0x5a4d18=_0x52b2cd['editing']['view'],_0x45eda=_0x52b2cd['plugins']['get'](a),_0x356c08=_0x52b2cd['plugins']['get'](_0x5bd49c);_0x45eda['showFakeVisualSelection']();const _0x34c7c9=new w(),_0x281ae5=new ClipboardEvent('copy',{'clipboardData':_0x34c7c9}),_0xd3af30=new _0xbd6943(_0x34c7c9),_0x36dbae=new _0x12dc77(_0x5a4d18,_0x281ae5,{'dataTransfer':_0xd3af30});_0x356c08['_forceMarkersCopy']('comment',()=>{_0x5a4d18['document']['fire']('copy',_0x36dbae);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x52b2cd,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x9644cb=_0xd3af30['getData']('text/html');const _0x3b0947=_0x52b2cd['model']['document']['selection'],_0x561f08=Array['from'](_0x3b0947['getRanges']());0x1===_0x561f08['length']&&_0x561f08[0x0]['isFlat']&&!_0x3b0947['getSelectedElement']()&&''!==_0x9644cb['replace'](/ /g,'')['trim']()&&(_0x9644cb='<p>'+_0x9644cb+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x18ee36,'query':_0x45f0dd,'htmlContent':_0x9644cb,'label':_0x20dd81,'mainActionLabel':_[_0x52b2cd['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1bd65e,'title':Hn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x280054['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x45eda['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x97a785=new Map(),_0x3932f6=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x58a4b4 of _0x3932f6)for(const _0x4f6f0d of _0x58a4b4['commands'])_0x97a785['set'](_0x4f6f0d['id'],{..._0x4f6f0d,'groupId':_0x58a4b4['groupId'],'groupLabel':_0x58a4b4['groupLabel']||_0x58a4b4['groupId']});return _0x97a785;}['_createAIAssistantUIButton'](_0x4cc47c){const _0x540ed1=this['editor'],_0x371efe=_0x540ed1['commands']['get']('showAIAssistant'),_0x4e43f4=new _0x4cc47c(_0x540ed1['locale']);return _0x4e43f4['set']({'label':Hn(_0x540ed1['locale'],'AI\x20Assistant'),'icon':_0x1bd65e,'isToggleable':!0x0}),_0x4e43f4['bind']('isEnabled')['to'](_0x371efe),_0x4e43f4['bind']('isOn')['to'](this['_dialog'],'id',_0x292591=>'aiAssistant'===_0x292591),this['listenTo'](_0x4e43f4,'execute',()=>{_0x4e43f4['isOn']?this['hideUI']():_0x371efe['execute']();}),_0x4e43f4;}['_initView'](){const _0x3e1e6c=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',()=>{_0x3e1e6c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3e1e6c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2587dd,ui:{ariaLiveAnnouncer:_0x30833a}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2ba5ba,_0x49c91e,_0xb7899d)=>{const _0x1ac33a=this['_aiAssistantController']['currentContext'];_0xb7899d?_0x30833a['announce'](Hn(_0x2587dd,'AI\x20is\x20writing')):_0x1ac33a&&_0x30833a['announce'](Hn(_0x2587dd,'Generated\x20content:\x20%0',_0x1ac33a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x480efc,_0x52baf7,_0x5cf9ef)=>{if(_0x5cf9ef){const _0x54bdfa=this['_formView']['errorView']['text'];_0x30833a['announce'](Hn(_0x2587dd,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x54bdfa));}});}['_onExecute'](_0x3d85ba){const _0x173f9d=this['_commandDefinitions']['get'](_0x3d85ba),_0x55b94a=this['editor'],_0x50079f=_0x55b94a['model']['document']['selection'],_0x47fe7e=_0x55b94a['commands']['get']('showAIAssistant'),_0x2d6956=_0x55b94a['plugins']['get'](a),_0x1ef7bf=''+(_0x173f9d['groupId']!==x?_0x173f9d['groupLabel']+':\x20':'')+_0x173f9d['label'];if(!0x1!==_0x173f9d['requiresContent']&&_0x50079f['isCollapsed']){const _0xd42ad7=_0x340436(_0x50079f['getSelectedBlocks']())||_0x55b94a['model']['schema']['getLimitElement'](_0x50079f);_0x55b94a['model']['change'](_0x4c0881=>{_0x4c0881['setSelection'](_0xd42ad7,'in');});}_0x2d6956['showFakeVisualSelection'](),_0x47fe7e['execute'](_0x173f9d['prompt'],_0x1ef7bf,'command:'+_0x3d85ba);}['_populateMenuBarMenu'](_0x4b20c2,_0x41bdd9,_0x30b518,_0x1c904f){const _0x400fa2=this['editor'],_0x9005f5=_0x400fa2['locale'],_0x24eb27=new _0xf5b9c2(_0x9005f5),_0x357b22=B(_0x400fa2,_0x30b518)['filter'](_0x35062c=>_0x35062c['commands']['length']);0x1===_0x357b22['length']?this['_getMenuBarGroupButtons']({'command':_0x4b20c2,'commands':_0x357b22[0x0]['commands'],'parentMenuView':_0x41bdd9,'onExecute':_0x1c904f})['forEach'](_0x1d5b6a=>_0x24eb27['items']['add'](_0x1d5b6a)):_0x357b22['forEach'](({groupId:_0x102712,groupLabel:_0xac01e7,commands:_0x52a009})=>{const _0x3557e5=new _0x5f3a6c(_0x9005f5,_0x41bdd9),_0x1c64ae=new _0x7ce5c8(_0x9005f5),_0x49027c=new _0xf5b9c2(_0x9005f5),_0x30d125=this['_getMenuBarGroupButtons']({'command':_0x4b20c2,'commands':_0x52a009,'parentMenuView':_0x1c64ae,'onExecute':_0x1c904f});_0x1c64ae['buttonView']['set']({'label':_0xac01e7||_0x102712}),_0x1c64ae['delegate']('execute')['to'](_0x41bdd9),_0x49027c['items']['addMany'](_0x30d125),_0x1c64ae['panelView']['children']['add'](_0x49027c),_0x3557e5['children']['add'](_0x1c64ae),_0x24eb27['items']['add'](_0x3557e5);}),_0x41bdd9['panelView']['children']['add'](_0x24eb27);}['_getMenuBarGroupButtons']({command:_0x15fd4a,commands:_0x3fe8a9,parentMenuView:_0x4fbf42,onExecute:_0x54484a}){const _0x2b07aa=this['editor'],_0x2a2503=_0x2b07aa['locale'];return B(_0x2b07aa,_0x3fe8a9)['map'](_0x712e5f=>{const _0x4753c2=new _0x5f3a6c(_0x2a2503,_0x4fbf42),_0x4bc63f=new _0x11ed9d(_0x2a2503);return _0x4bc63f['set']({'label':_0x712e5f['label']}),_0x4bc63f['delegate']('execute')['to'](_0x4fbf42),_0x4bc63f['on']('execute',()=>_0x54484a(_0x712e5f['id'])),_0x4bc63f['bind']('isEnabled')['to'](_0x15fd4a,'enabledCommandsIds',_0x9b9a8b=>_0x9b9a8b['includes'](_0x712e5f['id'])),_0x4753c2['children']['add'](_0x4bc63f),_0x4753c2;});}}function U(_0xcfdc71,_0x557d13){return void 0x0!==_0xcfdc71['order']&&void 0x0===_0x557d13['order']?0x1:void 0x0===_0xcfdc71['order']&&void 0x0!==_0x557d13['order']?-0x1:void 0x0!==_0xcfdc71['order']&&void 0x0!==_0x557d13['order']?_0xcfdc71['order']-_0x557d13['order']:0x0;}function B(_0x520279,_0x31589e){_0x31589e['sort'](U);const _0x46ce6e={},_0x405560=[];for(const _0x4b4852 of _0x31589e)if(void 0x0!==_0x4b4852['order']){if(_0x4b4852['order']in _0x46ce6e)throw new _0x1a859a('ai-commands-config-order-collision',_0x520279,{'conflictingDefinitions':[_0x4b4852,_0x46ce6e[_0x4b4852['order']]]});_0x46ce6e[_0x4b4852['order']]=_0x4b4852,_0x405560['splice'](_0x4b4852['order'],0x0,_0x4b4852);}else _0x405560['push'](_0x4b4852);return _0x405560;}class Un extends _0x15e219{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x371cb7){super(_0x371cb7);const _0x506f25=_0x371cb7['config'],_0x4296c0=_0x371cb7['locale'];_0x506f25['define']('ai.assistant.preserveComments',!0x0),_0x506f25['define']('ai.assistant.commands',Vn(_0x4296c0)),_0x506f25['define']('ai.assistant.extraCommandGroups',[]),_0x506f25['define']('ai.assistant.removeCommands',[]);let _0x7357ec=o(_0x506f25['get']('ai.assistant.commands'),_0x4296c0);const _0x548d39=_0x506f25['get']('ai.assistant.extraCommandGroups'),_0x2df845=_0x506f25['get']('ai.assistant.removeCommands');_0x548d39['forEach'](_0x5a8599=>{const _0x206f4f=_0x7357ec['find'](_0x5c6eb6=>_0x5c6eb6['groupId']===_0x5a8599['groupId']);_0x206f4f?_0x206f4f['commands']=_0x206f4f['commands']['concat'](_0x5a8599['commands']):_0x7357ec['push'](_0x5a8599);}),_0x7357ec=_0x7357ec['filter'](_0x1e9182=>!_0x2df845['includes'](_0x1e9182['groupId'])),_0x7357ec['forEach'](_0x526267=>{_0x526267['commands']=_0x526267['commands']['filter'](_0x4ba9b3=>!_0x2df845['includes'](_0x4ba9b3['id']));}),_0x506f25['set']('ai.assistant.commands',_0x7357ec);}}function Vn(_0x4238ec){return[{'groupId':'editOrReview','groupLabel':Hn(_0x4238ec,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Hn(_0x4238ec,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Hn(_0x4238ec,'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':Hn(_0x4238ec,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Hn(_0x4238ec,'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':Hn(_0x4238ec,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Hn(_0x4238ec,'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':Hn(_0x4238ec,'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':Hn(_0x4238ec,'Change\x20tone'),'commands':[{'id':'professional','label':Hn(_0x4238ec,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Hn(_0x4238ec,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Hn(_0x4238ec,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Hn(_0x4238ec,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Hn(_0x4238ec,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Hn(_0x4238ec,'Change\x20style'),'commands':[{'id':'business','label':Hn(_0x4238ec,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Hn(_0x4238ec,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Hn(_0x4238ec,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Hn(_0x4238ec,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Hn(_0x4238ec,'Translate'),'commands':[{'id':'translateEnglish','label':Hn(_0x4238ec,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Hn(_0x4238ec,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Hn(_0x4238ec,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Hn(_0x4238ec,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Hn(_0x4238ec,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Hn(_0x4238ec,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Hn(_0x4238ec,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Hn(_0x4238ec,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class pe extends _0x15e219{['abortController'];static get['requires'](){return[K];}constructor(_0x36ad7f){super(_0x36ad7f),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x25437b){return this['sendRequest'](_0x25437b)['catch'](_0x56914b=>{if(_0x56914b instanceof er)return Promise['reject'](_0x56914b);if('AbortError'==_0x56914b['name'])return Promise['resolve']();throw console['error'](_0x56914b),new _0x1a859a('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x174604,_0x4d89c7){const _0x1f36be=this['editor']['locale'],_0x2fa2ea={'Content-Type':'application/json'};if('object'==typeof _0x174604)Object['assign'](_0x2fa2ea,_0x174604);else{if(_0x174604)try{const _0x420d10=await _0x174604(_0x4d89c7);Object['assign'](_0x2fa2ea,_0x420d10);}catch{return Promise['reject'](new er(Hn(_0x1f36be,'AI_ERROR_GET_HEADERS')));}}return _0x2fa2ea;}async['_prepareRequestParameters'](_0x5984b4,_0x4a46fc){const _0x20e294=this['editor']['locale'];if('object'==typeof _0x5984b4)return _0x5984b4;try{return await _0x5984b4(_0x4a46fc);}catch{return Promise['reject'](new er(Hn(_0x20e294,'AI_ERROR_GET_PARAMETERS')));}}}class Bn extends pe{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x110cd9){super(_0x110cd9),_0x110cd9['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x110cd9['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x110cd9['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x110cd9['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x110cd9['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x110cd9['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x4e714a,context:_0x347146,onData:_0x45a893,actionId:_0x5d5781}){const _0x30b20e=this['editor']['locale'],_0x358ef6=await this['prepareMessages'](_0x4e714a,_0x347146,_0x5d5781),_0x2ae136=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5d5781),_0x28ed29=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5d5781),_0x3d5697={'messages':_0x358ef6,..._0x28ed29},_0x5d0492={'method':'POST','headers':_0x2ae136,'body':JSON['stringify'](_0x3d5697),'signal':this['abortController']['signal']},_0x534aa3=await fetch(this['_apiUrl'],_0x5d0492);if(_0x534aa3['ok'])return _0x28ed29['stream']?await this['_readStreamableResponse'](_0x534aa3,_0x45a893):await this['_readStaticResponse'](_0x534aa3,_0x45a893),Promise['resolve']();{const _0x3db94f=await _0x534aa3['text']();return _0x3db94f['includes']('context_length_exceeded')?Promise['reject'](new er(Hn(_0x30b20e,'AI_ERROR_CONTEXT_LENGTH'))):_0x3db94f['includes']('Moderation')?Promise['reject'](new er(Hn(_0x30b20e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3db94f));}}async['prepareMessages'](_0x4c245c,_0x161fcd,_0x48db22){let _0x4008b5,_0x995006;return _0x161fcd?(_0x4008b5='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.',_0x995006='Instruction:\x0a'+_0x4c245c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x161fcd):(_0x4008b5='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.',_0x995006=_0x4c245c),[{'role':'system','content':_0x4008b5},{'role':'user','content':_0x995006}];}async['_readStreamableResponse'](_0x2076d9,_0x4c274d){const _0x17d3ef=_0x2076d9['body']['getReader'](),_0x5c3ae1=new TextDecoder();let _0x530c92='',_0x382962='',_0x3f8ca4='',_0x22afdc=!0x1;for(;!_0x22afdc;){const {done:_0x159ee7,value:_0x9e75ab}=await _0x17d3ef['read'](),_0x91f99a=_0x530c92+_0x5c3ae1['decode'](_0x9e75ab);let _0x79fc3e='';_0x22afdc=_0x159ee7;try{_0x79fc3e=this['_cleanUpData'](_0x91f99a),_0x530c92='';}catch{_0x530c92=_0x91f99a;continue;}_0x382962+=_0x79fc3e,!_0x22afdc&&this['_isBufferIncomplete'](_0x382962)||_0x382962&&(_0x3f8ca4+=_0x382962,_0x382962='',_0x4c274d(_0x3f8ca4));}return Promise['resolve']();}async['_readStaticResponse'](_0x4259ce,_0x1b1a55){return _0x1b1a55((await _0x4259ce['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xfa9024){const _0x24e85e=_0xfa9024['split']('<')['length']!==_0xfa9024['split']('>')['length'],_0x26edd9=_0xfa9024['length']<0x1e;return _0x24e85e&&_0x26edd9;}['_cleanUpData'](_0x55b70a){return _0x55b70a['split'](/\n(?![^{]*\})/g)['map'](_0x2da96c=>_0x2da96c['replace']('data:\x20',''))['filter'](_0x4f12d2=>_0x4f12d2&&_0x4f12d2['length']>0x0&&'[DONE]'!==_0x4f12d2)['map'](_0x139367=>{const {choices:_0x5e1bc8}=JSON['parse'](_0x139367);if(_0x5e1bc8[0x0]?.['delta']?.['content'])return _0x5e1bc8[0x0]['delta']['content'];})['filter'](_0x20d5f6=>_0x20d5f6)['join']('');}}class Kn extends pe{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5ca951){super(_0x5ca951),_0x5ca951['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x5ca951['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']=_0x5ca951['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x5ca951['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5ca951['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x5ca951['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x162e57,context:_0x3cf65f,onData:_0x1aed54,actionId:_0x571f61}){const {model:_0x50cb67,stream:_0x3d5927,..._0x6bb33c}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x571f61),_0xb40c2b={'prompt':await this['preparePrompt'](_0x162e57,_0x3cf65f,_0x50cb67,_0x571f61),..._0x6bb33c};this['_apiUrl']?await this['_processProxyRequest'](_0xb40c2b,_0x50cb67,_0x3d5927,_0x1aed54,_0x571f61):await this['_processAWSRequest'](_0xb40c2b,_0x50cb67,_0x3d5927,_0x1aed54);}async['preparePrompt'](_0x2c0941,_0x519a09,_0x3537a9,_0x1e3d4b){let _0x590ad6,_0x23dc96;return _0x519a09?(_0x590ad6='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.',_0x23dc96='Instruction:\x0a'+_0x2c0941+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x519a09):(_0x590ad6='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.',_0x23dc96=_0x2c0941),'meta.llama'==this['getModelFamily'](_0x3537a9)?'<<SYS>>\x0a'+_0x590ad6+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x23dc96+'\x0a[/INST]':'Human:\x0a'+_0x590ad6+'\x0a'+_0x23dc96+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3a55c1){if(/^anthropic\.claude/['test'](_0x3a55c1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3a55c1))return'ai21.j2';if(/^cohere\.command/['test'](_0x3a55c1))return'cohere.command';if(/^meta\.llama/['test'](_0x3a55c1))return'meta.llama';throw new er(Hn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3a55c1));}async['_processProxyRequest'](_0x4d149a,_0x5e80ae,_0x189599,_0xeb80f5,_0x1050a8){const _0x2eac0f={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1050a8),'body':JSON['stringify']({..._0x4d149a,'model':_0x5e80ae,'stream':_0x189599}),'signal':this['abortController']['signal']},_0x69abd2=await fetch(this['_apiUrl'],_0x2eac0f);_0x189599?await this['_readStreamableResponse'](_0x69abd2,_0x5e80ae,_0xeb80f5):await this['_readStaticResponse'](_0x69abd2,_0x5e80ae,_0xeb80f5);}async['_processAWSRequest'](_0x2e8c3c,_0x3ba235,_0x1203a5,_0xeef564){const _0x342a86=new _0x584235(this['_bedrockClientConfig']),_0x1714eb={'body':JSON['stringify'](_0x2e8c3c),'contentType':'application/json','accept':'application/json','modelId':_0x3ba235};let _0x1e3dc7;if(_0x1203a5){const _0x39912d=new _0x2efca9(_0x1714eb);_0x1e3dc7=await _0x342a86['send'](_0x39912d,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1e3dc7,_0x3ba235,_0xeef564);}else{const _0x47ec82=new _0x165d54(_0x1714eb);_0x1e3dc7=await _0x342a86['send'](_0x47ec82,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1e3dc7,_0x3ba235,_0xeef564);}}async['_readAsyncIterableResponse'](_0x1c6d23,_0x4294e7,_0xaff876){const _0x3c89b3=_0x1c6d23['body'],_0xeef6dc=new TextDecoder('utf-8');let _0x54e8b5='';for await(const _0x48814e of _0x3c89b3)if(_0x48814e['chunk']){const _0x611f4=_0xeef6dc['decode'](_0x48814e['chunk']['bytes']),_0x23a8fc=JSON['parse'](_0x611f4);_0x54e8b5+=this['_getGeneratedText'](_0x23a8fc,_0x4294e7),_0xaff876(_0x54e8b5);}return Promise['resolve']();}async['_readStreamableResponse'](_0x31f26,_0x44aeb0,_0x51f3ee){const _0x4a8803=_0x31f26['body'],_0x15cb2f=new TextDecoder('utf-8'),_0x3e60ef=_0x4a8803['getReader']();let _0x19a70e='',_0x141311='',_0x121ab4=!0x1;for(;!_0x121ab4;){const {done:_0x2c1374,value:_0x3b7c6b}=await _0x3e60ef['read']();if(_0x121ab4=_0x2c1374,_0x121ab4)break;const _0x3e407a=(_0x19a70e+_0x15cb2f['decode'](_0x3b7c6b))['split']('\x0a')['map'](_0x5387f5=>{try{return _0x19a70e='',JSON['parse'](_0x5387f5);}catch{return _0x19a70e=_0x5387f5,null;}})['filter'](_0x570ae3=>null!==_0x570ae3);_0x3e407a['length']&&(_0x141311+=_0x3e407a['map'](_0x239058=>this['_getGeneratedText'](_0x239058,_0x44aeb0))['join'](''),_0x51f3ee(_0x141311));}return Promise['resolve']();}async['_readStaticResponse'](_0x118255,_0x2c5bfb,_0x18da9f){let _0x200d7a;return _0x200d7a=_0x118255 instanceof Response?await _0x118255['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x118255['body'])),(_0x18da9f(this['_getGeneratedText'](_0x200d7a,_0x2c5bfb)),Promise['resolve']());}['_getGeneratedText'](_0x43000f,_0x2492cc){switch(this['getModelFamily'](_0x2492cc)){case'anthropic.claude':return _0x43000f['completion'];case'ai21.j2':return _0x43000f['completions'][0x0]['data']['text'];case'cohere.command':return _0x43000f['generations'][0x0]['text'];case'meta.llama':return _0x43000f['generation'];}}}class ia extends _0x5822be{constructor(_0x29eb13,_0x416031={}){super(_0x29eb13),this['isToggleable']=!0x0,this['set']('side',_0x416031['side']||'top');const _0x5bf21d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x113c36(_0x416031['class']||[]),_0x5bf21d['to']('side',_0x3180ec=>'ck-tab-button_'+_0x3180ec),_0x5bf21d['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ea extends _0x2f8c3b{['children'];constructor(_0x39b14d,_0x58b764={}){super(_0x39b14d);const _0xaa3b77=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x113c36(_0x58b764['class']||[]),_0xaa3b77['to']('class'),_0xaa3b77['if']('isVisible','ck-hidden',_0x3e8271=>!_0x3e8271)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x2f8c3b{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x170365,_0x5905bf={}){super(_0x170365),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5905bf['side']||'top'),this['set']('isMaximized',!0x1);const _0x5e148d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x113c36(_0x5905bf['class']||[]),_0x5e148d['to']('side',_0x3eed2f=>'ck-tabs_'+_0x3eed2f),_0x5e148d['to']('class'),_0x5e148d['to']('isMaximized',_0x34cc07=>_0x34cc07?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5e148d['to']('side',_0x342e14=>'ck-tabs__buttons-container_'+_0x342e14)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5e148d['to']('side',_0x57cb18=>'ck-tabs__panels-container_'+_0x57cb18)]},'children':this['panelViews']},..._0x113c36(_0x5905bf['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x9b050b){const _0x8e223f=this['_tabs']['get'](_0x9b050b);return _0x8e223f||null;}['addTab'](_0x37ab9d){const _0x450319=this['_setupButton']({'id':_0x37ab9d['id'],'label':_0x37ab9d['buttonLabel'],'icon':_0x37ab9d['buttonIcon'],'order':_0x37ab9d['order']}),_0x454487=new ea(this['locale']);return _0x454487['render'](),_0x37ab9d['content']&&_0x454487['children']['add'](_0x37ab9d['content']),this['panelViews']['add'](_0x454487),this['_tabs']['set'](_0x37ab9d['id'],{'button':_0x450319,'panel':_0x454487,'order':void 0x0!==_0x37ab9d['order']?_0x37ab9d['order']:null}),this['fire']('addTab:'+_0x37ab9d['id'],{'id':_0x37ab9d['id'],'button':_0x450319,'panel':_0x454487}),null===this['activeTab']?this['activateTab'](_0x37ab9d['id']):this['_hidePanel'](_0x37ab9d['id']),{'button':_0x450319,'panel':_0x454487};}['activateTab'](_0x1810d6){if(null!==_0x1810d6&&!this['getTab'](_0x1810d6))throw new _0x1a859a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1810d6});this['activeTab']!==_0x1810d6&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x1810d6,_0x1810d6&&this['_showPanel'](_0x1810d6),this['fire']('activateTab:'+_0x1810d6,_0x1810d6));}['showTab'](_0x3d61c3){if(!this['getTab'](_0x3d61c3))throw new _0x1a859a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3d61c3});this['_showPanel'](_0x3d61c3),this['_showButton'](_0x3d61c3),this['fire']('show:'+_0x3d61c3,_0x3d61c3);}['hideTab'](_0x4fc1bc){if(!this['getTab'](_0x4fc1bc))throw new _0x1a859a('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4fc1bc});const _0x317d81=this['activeTab'];this['_hidePanel'](_0x4fc1bc),this['_hideButton'](_0x4fc1bc);const _0x47c806=this['getTabIds']();_0x317d81===_0x4fc1bc&&_0x47c806['length']>0x1&&this['activateTab'](_0x47c806['find'](_0x2eac64=>_0x2eac64!==_0x4fc1bc)),this['fire']('hide:'+_0x4fc1bc,_0x4fc1bc);}['_getPanel'](_0x41cb33){const _0xf23c30=this['_tabs']['get'](_0x41cb33);return _0xf23c30?_0xf23c30['panel']:null;}['_showPanel'](_0x33aa43){null!==this['activeTab']&&this['activeTab']!==_0x33aa43||this['_getPanel'](_0x33aa43)['show']();}['_hidePanel'](_0xc4b650){const _0x304c32=this['_getPanel'](_0xc4b650);_0x304c32['isVisible']&&(this['activeTab']===_0xc4b650&&(this['activeTab']=null),_0x304c32['hide']());}['_getButton'](_0x505a20){const _0x1e6411=this['_tabs']['get'](_0x505a20);return _0x1e6411?_0x1e6411['button']:null;}['_showButton'](_0x301403){this['_getButton'](_0x301403)['show']();}['_hideButton'](_0x1208fc){this['_getButton'](_0x1208fc)['hide']();}['_setupButton'](_0x25e145){const _0x19221c=new ia(this['locale'],{'side':this['side']}),_0x428ac9=this['buttonViews'];if(_0x19221c['set']({'label':_0x25e145['label'],'icon':_0x25e145['icon'],'tooltip':!0x0,'withText':!0x0}),_0x19221c['bind']('isOn')['to'](this,'activeTab',_0x5c7ce2=>_0x5c7ce2===_0x25e145['id']),_0x19221c['bind']('side')['to'](this,'side'),_0x25e145['order']){const _0x639bde=[...this['_tabs']]['reduce']((_0x29f9a2,_0x7b2d60)=>{const _0x33fca6=_0x7b2d60[0x0],{order:_0x130be9}=_0x7b2d60[0x1];return!_0x130be9||_0x130be9>_0x25e145['order']?_0x29f9a2:_0x130be9>=_0x29f9a2['order']?{'id':_0x33fca6,'order':_0x130be9}:_0x29f9a2;},{'id':'','order':0x0}),_0xe8e00a=_0x428ac9['getIndex'](this['_getButton'](_0x639bde['id']));_0x428ac9['add'](_0x19221c,_0xe8e00a+0x1);}else _0x428ac9['add'](_0x19221c);return _0x19221c['on']('execute',()=>{this['activateTab'](_0x25e145['id']);}),_0x19221c;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends ss{constructor(_0x55948c,_0x3f731a={}){super(_0x55948c,_0x3f731a),this['set']('type',_0x3f731a['type']||'sidebar'),this['set']('side',_0x3f731a['side']||'right'),this['set']('isVisible',_0x3f731a['visibleByDefault']??!0x0);const _0x3ff2f2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x3ff2f2['if']('type','ck-ai-tabs__overlay',_0x329f7b=>'overlay'===_0x329f7b),_0x3ff2f2['if']('type','ck-ai-tabs__sidebar',_0x5ed988=>'sidebar'===_0x5ed988),_0x3ff2f2['if']('isVisible','ck-hidden',_0x23d8e4=>!_0x23d8e4)]}}),this['buttonViews']['on']('add',(_0x43b92a,_0xa73a74)=>{_0xa73a74['set']('withText',!0x1);});}}class it extends _0x55a427{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4a3dd2){super(_0x4a3dd2);const _0x3a12f6=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x3a12f6)throw new _0x1a859a('ai-tabs-configuration-not-found');if(void 0x0!==_0x3a12f6['showResizeButton']&&(this['showResizeButton']=_0x3a12f6['showResizeButton']),'sidebar'!==_0x3a12f6['type']&&'overlay'!==_0x3a12f6['type']||_0x3a12f6['side']&&(this['side']=_0x3a12f6['side']),'sidebar'===_0x3a12f6['type']){if(this['container']=_0x3a12f6['element'],this['set']('type','sidebar'),!this['container'])throw new _0x1a859a('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3a12f6['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ui(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x3a12f6['visibleByDefault']||_0x3a12f6['visibleByDefault']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof _0x50e0a9&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x3ce8d7){if(_0x3ce8d7&&this['type']!==_0x3ce8d7){if(!pi['includes'](_0x3ce8d7))throw new _0x1a859a('ai-tabs-unsupported-ui-type');this['type']=_0x3ce8d7;}}['switchSide'](_0x502016){if(_0x502016&&this['side']!==_0x502016){if(!di['includes'](_0x502016))throw new _0x1a859a('ai-tabs-unsupported-ui-side');this['side']=_0x502016;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class tt extends _0x55a427{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c268a){super(_0x4c268a),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 _0x337778=this['context']['plugins']['get']('CloudServices');if(!_0x337778['token'])throw new _0x1a859a('ai-missing-token',this);this['_token']=_0x337778['token'];}['startConversation'](_0x16a879,_0x5424c6){const _0x22e514=this['_sendApiRequest']('/conversations','POST',{'id':_0x16a879,'group':_0x5424c6});return{'getConversation':async()=>(await _0x22e514['request'])['json'](),'abortController':_0x22e514['abortController']};}['queryAssistant']({message:_0x5d8640,conversationId:_0x5f48a5,parts:_0x29e865,capabilities:_0x24e2e8,model:_0xf7d25c,attributes:_0x2891bf}){const _0x52ae9f={'prompt':_0x5d8640,'content':_0x29e865,'model':_0xf7d25c,..._0x24e2e8&&{'capabilities':_0x24e2e8},..._0x2891bf&&{'attributes':_0x2891bf}},_0x4dde9c=this['_sendApiRequest']('/conversations/'+_0x5f48a5+'/messages','POST',_0x52ae9f);return{'getStream':async()=>{const _0x26eb43=(await _0x4dde9c['request'])['body'];return this['_getStreamReader'](_0x26eb43);},'abortController':_0x4dde9c['abortController']};}['executeCustomAction']({content:_0x513b89,message:_0x469501,model:_0x5571f5,outputFormat:_0x2134af}){const _0x2957c7={'content':[{'type':'text','content':_0x513b89}],'prompt':_0x469501,'model':_0x5571f5,'outputFormat':_0x2134af},_0x32b0c0=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2957c7);return{'getStream':async()=>{const _0x93f23d=(await _0x32b0c0['request'])['body'];return this['_getStreamReader'](_0x93f23d);},'abortController':_0x32b0c0['abortController']};}['executeAction']({actionName:_0x2efa92,content:_0x4d8dbc,args:_0x54abe2}){const _0x552ff7={'content':[{'type':'text','content':_0x4d8dbc}],'args':_0x54abe2},_0x646db1=this['_sendApiRequest']('/actions/system/'+_0x2efa92+'/calls','POST',_0x552ff7);return{'getStream':async()=>{const _0x406398=(await _0x646db1['request'])['body'];return this['_getStreamReader'](_0x406398);},'abortController':_0x646db1['abortController']};}['uploadFile'](_0x5edbcb,_0x15a854,_0x5ed842){const _0x53db01=new FormData();_0x53db01['append']('file',_0x15a854,_0x15a854['name']),_0x5ed842&&_0x53db01['append']('attributes',JSON['stringify'](_0x5ed842));const _0x4de30d=this['_sendApiRequest']('/conversations/'+_0x5edbcb+'/files','POST',_0x53db01);return{'getId':async()=>(await _0x4de30d['request'])['json'](),'abortController':_0x4de30d['abortController']};}['fetchDocument'](_0x4e7708,_0x1b2933){const _0x3b5171=this['_sendApiRequest']('/conversations/'+_0x4e7708+'/documents/'+_0x1b2933,'GET');return{'getDocument':async()=>(await _0x3b5171['request'])['json'](),'abortController':_0x3b5171['abortController']};}['uploadDocument'](_0x2d3d0b,_0x5263db,_0x4c3d3b){const _0x130e79={'content':_0x5263db};_0x4c3d3b&&(_0x130e79['attributes']=_0x4c3d3b);const _0x4184b3=this['_sendApiRequest']('/conversations/'+_0x2d3d0b+'/documents','POST',_0x130e79);return{'getId':async()=>(await _0x4184b3['request'])['json'](),'abortController':_0x4184b3['abortController']};}['fetchConversations'](_0x2f5859,_0x375e04={}){const _0x40c4c3=new URLSearchParams();_0x40c4c3['append']('group',_0x2f5859),_0x40c4c3['append']('excludeEmpty',!0x1!==_0x375e04['excludeEmpty']?'true':'false'),_0x40c4c3['append']('limit',_0x375e04['limit']?_0x375e04['limit']['toString']():'100'),_0x40c4c3['append']('sortBy',_0x375e04['sortBy']?_0x375e04['sortBy']:'createdAt'),_0x40c4c3['append']('order',_0x375e04['order']?_0x375e04['order']:'desc');const _0xbbe48b=this['_sendApiRequest']('/conversations?'+_0x40c4c3['toString'](),'GET');return{'getConversations':async()=>{const _0x21f468=await _0xbbe48b['request'];return(await _0x21f468['json']())['items'];},'abortController':_0xbbe48b['abortController']};}['deleteConversation'](_0xa5f45b){const _0x2ae626=this['_sendApiRequest']('/conversations/'+_0xa5f45b,'DELETE');return{'execute':async()=>{await _0x2ae626['request'];},'abortController':_0x2ae626['abortController']};}['updateConversation'](_0x59860f,_0x16944b){const _0x1f77cc=this['_sendApiRequest']('/conversations/'+_0x59860f,'PATCH',_0x16944b);return{'getResult':async()=>(await _0x1f77cc['request'],_0x16944b),'abortController':_0x1f77cc['abortController']};}['fetchConversation'](_0x20af5a){const _0x178be6=this['_sendApiRequest']('/conversations/'+_0x20af5a,'GET');return{'getConversation':async()=>(await _0x178be6['request'])['json'](),'abortController':_0x178be6['abortController']};}['fetchConversationMessages'](_0x1cfcda){const _0x52d9c9=this['_sendApiRequest']('/conversations/'+_0x1cfcda+'/messages','GET');return{'getMessages':async()=>{const _0x2d4d40=await _0x52d9c9['request'];return(await _0x2d4d40['json']())['items'];},'abortController':_0x52d9c9['abortController']};}['uploadUrl'](_0x35076b,_0x458845,_0x53f013){const _0x29ce70=this['_sendApiRequest']('/conversations/'+_0x35076b+'/web-resources','POST',{'url':_0x458845,'attributes':_0x53f013});return{'getId':async()=>(await _0x29ce70['request'])['json'](),'abortController':_0x29ce70['abortController']};}['getModels'](_0x1da0d5='en'){const _0xd870b5=new URLSearchParams();_0xd870b5['append']('language',_0x1da0d5);const _0x4d4066='/models/1?'+_0xd870b5['toString'](),_0x24b16f=this['_sendApiRequest'](_0x4d4066,'GET');return{'list':async()=>await(await _0x24b16f['request'])['json'](),'abortController':_0x24b16f['abortController']};}['deleteFile'](_0x12e560,_0x578de6){const _0x5b3d78=this['_sendApiRequest']('/conversations/'+_0x12e560+'/files/'+_0x578de6,'DELETE');return{'execute':async()=>{await _0x5b3d78['request'];},'abortController':_0x5b3d78['abortController']};}['deleteDocument'](_0x21e56f,_0x16cb16){const _0x1118de=this['_sendApiRequest']('/conversations/'+_0x21e56f+'/documents/'+_0x16cb16,'DELETE');return{'execute':async()=>{await _0x1118de['request'];},'abortController':_0x1118de['abortController']};}['deleteWebResource'](_0x44dcd5,_0x49d59e){const _0x579baa=this['_sendApiRequest']('/conversations/'+_0x44dcd5+'/web-resources/'+_0x49d59e,'DELETE');return{'execute':async()=>{await _0x579baa['request'];},'abortController':_0x579baa['abortController']};}['callSystemReview']({reviewName:_0x53c7ec,content:_0x49c3e3,args:_0x538619}){const _0x3e070f=this['_sendApiRequest']('/reviews/system/'+_0x53c7ec+'/calls','POST',{'content':[{'type':'text','content':_0x49c3e3}],'args':_0x538619});return{'getStream':async()=>{const _0x113ad6=(await _0x3e070f['request'])['body'];return this['_getStreamReader'](_0x113ad6);},'abortController':_0x3e070f['abortController']};}['callCustomReview']({content:_0x1ae5f0,prompt:_0x372d06,model:_0x84d7b6}){const _0x41e08b=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1ae5f0}],'prompt':_0x372d06,'model':_0x84d7b6});return{'getStream':async()=>{const _0x12c168=(await _0x41e08b['request'])['body'];return this['_getStreamReader'](_0x12c168);},'abortController':_0x41e08b['abortController']};}['upsertAIChatRating'](_0x285671,_0x527dba,_0x1e9bc1){const _0x5df787=this['_sendApiRequest']('/conversations/'+_0x285671+'/messages/'+_0x527dba+'/ratings','PUT',{'positiveCount':_0x1e9bc1['positiveCount'],'totalCount':_0x1e9bc1['totalCount'],'modificationId':_0x1e9bc1['modificationId']});return{'execute':async()=>{await _0x5df787['request'];},'abortController':_0x5df787['abortController']};}['upsertAIActionRating'](_0x5f1300,_0x16048e,_0x5b31e0){const _0x210853=this['_sendApiRequest']('/actions/system/'+_0x5f1300+'/calls/'+_0x16048e+'/ratings','PUT',{'positiveCount':_0x5b31e0['positiveCount'],'totalCount':_0x5b31e0['totalCount']});return{'execute':async()=>{await _0x210853['request'];},'abortController':_0x210853['abortController']};}['upsertCustomAIActionRating'](_0x505e06,_0x4bf732){const _0x346c29=this['_sendApiRequest']('/actions/custom/calls/'+_0x505e06+'/ratings','PUT',{'positiveCount':_0x4bf732['positiveCount'],'totalCount':_0x4bf732['totalCount']});return{'execute':async()=>{await _0x346c29['request'];},'abortController':_0x346c29['abortController']};}['upsertAIReviewRating'](_0x2dfa89,_0x27cce2,_0x1a4b0a,_0x1ea82c){const _0x5bf2cf=this['_sendApiRequest']('/reviews/system/'+_0x2dfa89+'/calls/'+_0x27cce2+'/ratings','PUT',{'positiveCount':_0x1a4b0a['positiveCount'],'totalCount':_0x1a4b0a['totalCount'],'dataId':_0x1ea82c});return{'execute':async()=>{await _0x5bf2cf['request'];},'abortController':_0x5bf2cf['abortController']};}['upsertCustomAIReviewRating'](_0x535771,_0x14058a,_0xc725a5){const _0x468010=this['_sendApiRequest']('/reviews/custom/calls/'+_0x535771+'/ratings','PUT',{'positiveCount':_0x14058a['positiveCount'],'totalCount':_0x14058a['totalCount'],'dataId':_0xc725a5});return{'execute':async()=>{await _0x468010['request'];},'abortController':_0x468010['abortController']};}['_sendApiRequest'](_0x53d407,_0x4f519f,_0x104262){const _0x48432a=new AbortController(),_0x1b00bb=_0x104262 instanceof FormData,_0x2396cd={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x104262&&!_0x1b00bb&&(_0x2396cd['Content-Type']='application/json');const _0x5b78e6={'method':_0x4f519f,'headers':_0x2396cd,'signal':_0x48432a['signal']};return _0x104262&&(_0x5b78e6['body']=_0x1b00bb?_0x104262:JSON['stringify'](_0x104262)),{'request':fetch(''+this['_apiUrl']+_0x53d407,_0x5b78e6)['catch'](_0x703f5f=>{this['_handleError'](_0x703f5f);})['then'](_0x170d02=>_0x170d02['ok']?_0x170d02:_0x170d02['json']()['then'](_0x244eda=>{throw{'url':this['_apiUrl'],'path':_0x53d407,'method':_0x4f519f,'body':_0x104262,'status':(_0x170d02||{})['status'],'statusText':(_0x170d02||{})['statusText'],'code':_0x244eda['code'],'message':_0x244eda['message'],'traceId':_0x244eda['traceId']};})),'abortController':_0x48432a};}async*['_getStreamReader'](_0x822c34){const _0x1fd21a=[],_0x42d0e9=_0x822c34['getReader'](),_0x8e3f04=$t({'onError':_0x804afc=>{this['_handleError'](_0x804afc);},'onEvent':_0x1f3f79=>{_0x1f3f79['data']=JSON['parse'](_0x1f3f79['data']),_0x1fd21a['push'](_0x1f3f79);}});try{let _0x577ef4=!0x1;for(;!_0x577ef4;){const {done:_0x2d8e6e,value:_0x23274f}=await _0x42d0e9['read']();_0x2d8e6e&&(_0x577ef4=!0x0),_0x8e3f04['feed'](this['_decoder']['decode'](_0x23274f,{'stream':!0x0})),yield*_0x1fd21a,_0x1fd21a['length']=0x0;}}catch(_0x3299b2){this['_handleError'](_0x3299b2);}finally{_0x42d0e9['releaseLock'](),_0x8e3f04['reset']();}}['_handleError'](_0x1905a1){if(_0x1905a1 instanceof _0x1a859a)throw _0x1905a1;if(_0x1905a1 instanceof Error&&'AbortError'===_0x1905a1['name'])throw new _0x1a859a('ai-request-aborted',this,{'originalError':_0x1905a1});throw new _0x1a859a('ai-request-failed',this,{'originalError':_0x1905a1});}}function i(_0x437061,_0x5f3370,_0x1241f4){const t=_0x437061['t'];switch(_0x5f3370){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'},_0x1241f4);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\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_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x1241f4);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.'},_0x1241f4);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.'},_0x1241f4);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x1241f4);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x1241f4);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x1241f4);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x1241f4);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.'},_0x1241f4);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.'},_0x1241f4);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.'},_0x1241f4);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'},_0x1241f4);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x1241f4);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x5f3370;}}function As(_0x3658fa,_0x47cf32){const _0x5d1e29=new _0x5822be(_0x3658fa),_0x49e03c=i(_0x3658fa,'AI_TABS_LABEL_MINIMIZE'),_0x4df17d=i(_0x3658fa,'AI_TABS_LABEL_MAXIMIZE');return _0x5d1e29['set']({'withText':!0x1,'icon':_0x20fb95,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x5d1e29['bind']('label')['to'](_0x47cf32,'isMaximized',_0x333945=>_0x333945?_0x49e03c:_0x4df17d),_0x5d1e29['bind']('icon')['to'](_0x47cf32,'isMaximized',_0x102727=>_0x102727?to:_0x20fb95),_0x5d1e29['bind']('isOn')['to'](_0x47cf32,'isMaximized'),_0x5d1e29['on']('execute',()=>{_0x47cf32['fire']('resizeTabs');}),_0x5d1e29;}function Ui(_0x233799){return _0x30fc90(_0x233799);}function pt(_0x2b8319){return _0x41ec78(_0x2b8319);}function Ct(_0xfe1fff,_0x36b2ec,_0xe6d2b8){const _0x31bff2=null!==_0x36b2ec?_0xe46c9=>_0xe46c9['attribs'][_0xfe1fff]===_0x36b2ec:_0x2f75e8=>Boolean(_0x2f75e8['attribs'][_0xfe1fff]);return gt(_0x509944=>_0x3f3ba2(_0x509944)&&_0x31bff2(_0x509944),_0xe6d2b8);}function Fi(_0x4c3ea0,_0x568eb2,_0x5d460d){const _0x414ec9=null!==_0x568eb2?_0x4d41f2=>_0x4d41f2['attribs'][_0x4c3ea0]===_0x568eb2:_0x4c8afd=>Boolean(_0x4c8afd['attribs'][_0x4c3ea0]);return _0x2c64d2(_0x51ea3e=>_0x3f3ba2(_0x51ea3e)&&_0x414ec9(_0x51ea3e),_0x5d460d);}function ut(_0x21f444,_0x504de0){return _0x21f444&&_0x3f3ba2(_0x21f444)?_0x21f444['attribs'][_0x504de0]:null;}function Is(_0x2b89df,_0x34c202,_0x410195){_0x3f3ba2(_0x2b89df)&&(null===_0x410195?delete _0x2b89df['attribs'][_0x34c202]:_0x2b89df['attribs'][_0x34c202]=_0x410195);}function Qi(_0x1baa6d,_0x110091,_0x1f6a23){const _0x3fe059=_0x110091['cloneNode'](!0x0);'beforebegin'===_0x1f6a23?_0x5998b9(_0x1baa6d,_0x3fe059):'afterbegin'===_0x1f6a23?_0x211b53(_0x1baa6d,_0x3fe059):'beforeend'===_0x1f6a23?_0x43c81c(_0x1baa6d,_0x3fe059):'afterend'===_0x1f6a23&&_0x4b23c9(_0x1baa6d,_0x3fe059);}function Pi(_0x526e93){const _0x5b6967=[];let _0x3c23d8=_0x526e93;for(;_0x3c23d8;)_0x3c23d8=_0x3fc262(_0x3c23d8),_0x3c23d8&&_0x5b6967['push'](_0x3c23d8);return _0x5b6967;}function Fn(_0x51d01e){return _0x51d01e['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function vs(_0x12139d){let _0x296a5c=0x0;for(;_0x12139d['parentNode'];)_0x12139d=_0x12139d['parentNode'],_0x296a5c++;return _0x296a5c;}function xs(_0x34b68c){const _0x2e53ef=[];let _0x247973=_0x34b68c['nextSibling'];for(;_0x247973;)_0x2e53ef['push'](_0x247973),_0x247973=_0x247973['nextSibling'];_0x2e53ef['forEach'](_0xdba9c5=>{_0x3d9e89(_0xdba9c5);});}class Wi extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0x55f2e4();}['convertMarkdownToHTML'](_0x4cb1cd){const _0x4985e6=this['_m2html']['parse'](_0x4cb1cd);return this['parseAndNormalizeHTML'](_0x4985e6);}['parseAndNormalizeHTML'](_0x427e3f){return this['_parseHTML'](_0x427e3f);}['_parseHTML'](_0x2c1fe8){const _0xf4e184=Ui('<dummy>'+_0x2c1fe8['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0xf4e184['children']=_0xf4e184['children'][0x0]['children'],_0xf4e184;}}class qi extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x334828){super(),this['_generateUid']=_0x334828||_0x36c3ed;}['merge'](_0x33159e,_0x401789,_0x92e77c){const _0x47c96d=_0x33159e['cloneNode'](!0x0);if(0x0===_0x401789['childNodes']['length']){const _0x497630=[];return Fi('data-id','new-element',_0x47c96d)['forEach'](_0x3f76b3=>{const _0x48c187=this['_generateUid']();Is(_0x3f76b3,'data-id',_0x48c187),_0x497630['push'](_0x48c187);}),this['_removeSpecialComments'](_0x47c96d),{'parsedContent':_0x47c96d,'newNodeIds':_0x497630,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x92e77c&&_0x92e77c['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x47c96d),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Fi('data-id',null,_0x401789)['map'](_0x2a6ca2=>ut(_0x2a6ca2,'data-id'))['filter'](_0x426457=>!!_0x426457));let _0x212a76=-0x1,_0x1f0c88=!0x1;const _0x2390d2=_0x47c96d['childNodes'],_0x5d3b1a=Array['from'](_0x2390d2)['filter'](_0x305531=>!(0x3===_0x305531['nodeType']&&''===pt(_0x305531)['trim']())),_0x427925=_0x5d3b1a['length'];for(let _0x41edf1=0x0;_0x41edf1<_0x427925;_0x41edf1++){const _0x3edbb5=_0x5d3b1a[_0x41edf1],_0x4746fa=_0x5d3b1a[_0x41edf1+0x1];if(this['_isNewNode'](_0x3edbb5)){if(-0x1===_0x212a76&&(_0x212a76=_0x41edf1),this['_markWrappedElements'](_0x3edbb5),!this['_isNewNode'](_0x4746fa)){const [_0x33125b,_0x27fcec]=this['_findReferenceNode'](_0x3edbb5,_0x1f0c88,_0x401789);if(_0x33125b){const _0x346503=Array['from'](_0x5d3b1a)['slice'](_0x212a76,_0x41edf1+0x1);this['_insertNodes'](_0x33125b,_0x346503,_0x27fcec),_0x212a76=-0x1;}}}else{if(this['_isExistingContentComment'](_0x3edbb5))_0x1f0c88=!0x0;else{if(this['_isExistingNode'](_0x3edbb5)){const _0x3adb74=ut(_0x3edbb5,'data-id');if(_0x3adb74&&this['_existingDataIds']['has'](_0x3adb74)){const _0xa0f3cd=Ct('data-id',_0x3adb74,_0x401789);this['_replaceNode'](_0xa0f3cd,_0x3edbb5);}if(this['_touchedNodesState']['removedIds']['includes'](_0x3adb74)){const _0x50e6b3=this['_touchedNodesState']['removedIds']['indexOf'](_0x3adb74);this['_touchedNodesState']['removedIds']['splice'](_0x50e6b3,0x1);}}else{if(this['_isDelNode'](_0x3edbb5)){const _0x7d1f10=ut(_0x3edbb5,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x7d1f10)||this['_storeDeletedElementIds'](_0x3edbb5);}}}}}for(const _0x21db23 of this['_touchedNodesState']['removedIds']){const _0xb3daa1=Ct('data-id',_0x21db23,_0x401789);if(_0xb3daa1){if(_0x92e77c&&_0x92e77c['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x21db23;const _0x1d5939=_0x92e77c['replaceRemovedWith']['cloneNode'](!0x0);Is(_0x1d5939,'data-id',_0x21db23),Is(_0x1d5939,'data-removed','true'),_0xdcc4c7(_0xb3daa1,_0x1d5939);}else _0x3d9e89(_0xb3daa1);}}if(Fi('data-wrapped-id',null,_0x401789)['forEach'](_0x1b96e7=>{const _0x3d78b8=Ct('data-id',ut(_0x1b96e7,'data-wrapped-id'),_0x401789);var _0x50b091,_0x8d9aa5;_0x3d78b8&&(_0x8d9aa5=_0x1b96e7,_0x3d9e89(_0x50b091=_0x3d78b8),_0xdcc4c7(_0x8d9aa5,_0x50b091));}),Fi('data-id','new-element',_0x401789)['forEach'](_0x45bfa4=>{const _0x2fedd2=this['_getUid'](_0x45bfa4);Is(_0x45bfa4,'data-id',_0x2fedd2),this['_touchedNodesState']['newIds']['push'](_0x2fedd2);}),this['_removeSpecialComments'](_0x401789),_0x92e77c&&_0x92e77c['markUnstableElements']&&this['_markUnstableElements'](_0x401789,_0x92e77c['markUnstableElementsDepth']||0x0),_0x92e77c&&_0x92e77c['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x17ca6c=Ct('data-id',this['_touchedNodesState']['lastTouchedId'],_0x401789);for(;_0x17ca6c;)xs(_0x17ca6c),_0x17ca6c=_0x17ca6c['parentNode'];}return{'parsedContent':_0x401789,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3276fc,_0x4fd90a,_0x388899){for(const _0x876560 of _0x4fd90a){const _0x1951db=this['_getUid'](_0x876560);Is(_0x876560,'data-id',_0x1951db),this['_touchedNodesState']['newIds']['push'](_0x1951db),this['_touchedNodesState']['lastTouchedId']=_0x1951db;}const _0x33f9e1='afterbegin'===_0x388899||'afterend'===_0x388899?_0x4fd90a['reverse']():_0x4fd90a;for(const _0x394a1b of _0x33f9e1)Qi(_0x3276fc,_0x394a1b,_0x388899);}['_replaceNode'](_0x4b7909,_0x510e35){if(!_0x4b7909)return;if(_0x5aed62=_0x510e35,Fn(pt(_0x4b7909))===Fn(pt(_0x5aed62)))return;var _0x5aed62;const _0x4be959=this['_getUid'](_0x4b7909);Is(_0x510e35,'data-id',_0x4be959),this['_touchedNodesState']['modifiedIds']['push'](_0x4be959),this['_touchedNodesState']['lastTouchedId']=_0x4be959,_0xdcc4c7(_0x4b7909,_0x510e35['cloneNode'](!0x0));}['_findReferenceNode'](_0x1a0597,_0x4bfec6,_0x6d9b14){const _0x317eb4=this['_findPrevElementWithDataId'](_0x1a0597,!0x1);if(_0x317eb4){const _0x3b8183=this['_getNodeDataId'](_0x317eb4),_0x5412f2=Ct('data-id',_0x3b8183,_0x6d9b14);if(_0x5412f2)return[_0x5412f2,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x3b8183);}const _0x26ea4b=this['_findNextElementWithDataId'](_0x1a0597,!0x1);if(_0x26ea4b){const _0x4265b4=this['_getNodeDataId'](_0x26ea4b),_0x50b7d9=Ct('data-id',_0x4265b4,_0x6d9b14);if(_0x50b7d9)return[_0x50b7d9,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4265b4);}return _0x4bfec6?_0x1a0597['nextSibling']?this['_findFallbackReferenceNode'](_0x1a0597,_0x6d9b14):[_0x6d9b14['childNodes'][_0x6d9b14['childNodes']['length']-0x1],'afterend']:[_0x6d9b14['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0xfbf650,_0x11695c){const _0x1a2786=[],_0x3a3adf=this['_findPrevElementWithDataId'](_0xfbf650,!0x0);if(_0x3a3adf){const _0x4ed7b6=Ct('data-id',this['_getNodeDataId'](_0x3a3adf),_0x11695c);_0x4ed7b6&&_0x1a2786['push']([_0x4ed7b6,'afterend']);}const _0x33d82f=this['_findNextElementWithDataId'](_0xfbf650,!0x0);if(_0x33d82f){const _0x2e3a74=Ct('data-id',this['_getNodeDataId'](_0x33d82f),_0x11695c);_0x2e3a74&&_0x1a2786['push']([_0x2e3a74,'beforebegin']);}if(_0x1a2786['length']>0x1)return vs(_0x1a2786[0x0][0x0])<=vs(_0x1a2786[0x1][0x0])?_0x1a2786[0x0]:_0x1a2786[0x1];return 0x1===_0x1a2786['length']?_0x1a2786[0x0]:[_0x11695c['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x5bc61a,_0x5dc500){let _0x5ae5dd=_0x5bc61a['nextSibling'],_0x332c8f=null,_0x217e7f=!0x1;for(;_0x5ae5dd;){if(_0xf29723(_0x5ae5dd)){if(this['_isDelNode'](_0x5ae5dd)&&(_0x332c8f=_0x5ae5dd),this['_isExistingContentComment'](_0x5ae5dd)&&_0x5dc500&&!_0x217e7f){_0x217e7f=!0x0,_0x5ae5dd=_0x5ae5dd['nextSibling'];continue;}break;}const _0x491c1e=ut(_0x5ae5dd,'data-id');if(_0x491c1e&&'new-element'!==_0x491c1e&&this['_existingDataIds']['has'](_0x491c1e)){_0x332c8f=_0x5ae5dd;break;}_0x5ae5dd=_0x5ae5dd['nextSibling'];}return _0x332c8f;}['_findPrevElementWithDataId'](_0x310c1e,_0x2d3b00){let _0x1eee71=_0x310c1e['previousSibling'],_0x1d42c1=null,_0x71d9a9=!0x1;for(;_0x1eee71;){if(_0xf29723(_0x1eee71)){if(this['_isDelNode'](_0x1eee71)&&(_0x1d42c1=_0x1eee71),this['_isExistingContentComment'](_0x1eee71)&&_0x2d3b00&&!_0x71d9a9){_0x71d9a9=!0x0,_0x1eee71=_0x1eee71['previousSibling'];continue;}break;}const _0x239b00=ut(_0x1eee71,'data-id');if(_0x239b00&&'new-element'!==_0x239b00&&this['_existingDataIds']['has'](_0x239b00)){_0x1d42c1=_0x1eee71;break;}_0x1eee71=_0x1eee71['previousSibling'];}return _0x1d42c1;}['_markWrappedElements'](_0x431205){_0x3f3ba2(_0x431205)&&Fi('data-id',null,_0x431205)['forEach'](_0x5d1492=>{this['_isExistingNode'](_0x5d1492)&&!this['_hasWrappedParent'](_0x5d1492)&&(Is(_0x5d1492,'data-wrapped-id',ut(_0x5d1492,'data-id')),Is(_0x5d1492,'data-id',null));});}['_getNodeDataId'](_0x46d5c9){if(!_0x46d5c9)return null;if(_0x3f3ba2(_0x46d5c9))return ut(_0x46d5c9,'data-id');if(_0xf29723(_0x46d5c9)){const _0x3a175b=pt(_0x46d5c9)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3a175b&&_0x3a175b[0x1])return _0x3a175b[0x1];}return null;}['_storeDeletedElementIds'](_0x151692){if(_0xf29723(_0x151692)){const _0x35153a=pt(_0x151692)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x35153a&&_0x35153a[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x35153a[0x1]);}}['_getUid'](_0x40e1ff){return this['_isExistingNode'](_0x40e1ff)?ut(_0x40e1ff,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5957fc){(function(_0x2b1e82){return _0x1fdc97(_0xb76660=>_0xf29723(_0xb76660),_0x2b1e82,!0x0,0x1/0x0);}(_0x5957fc)['filter'](_0x3c55a6=>this['_isDelNode'](_0x3c55a6)||this['_isExistingContentComment'](_0x3c55a6))['forEach'](_0x2fdeb0=>{_0x3d9e89(_0x2fdeb0);}));}['_markLastTagElementUnstable'](_0x16ea3e){const _0x18e20e=_0x16ea3e['childNodes'],_0x4bf65a=_0x18e20e[_0x18e20e['length']-0x1];_0x4bf65a&&_0x3f3ba2(_0x4bf65a)&&Is(_0x4bf65a,'data-unstable','true');}['_markUnstableElements'](_0x5ec4b5,_0x5f38bb){const _0x50d33=Ct('data-unstable','true',_0x5ec4b5);if(!_0x50d33)return;const _0x2a874f=Pi(_0x50d33)['slice'](0x0,-0x1),_0xfe7c45=_0x2a874f['length'];let _0x4f7d03=_0x50d33;if(_0xfe7c45>_0x5f38bb){let _0x11926c=_0xfe7c45,_0x457888=null;for(;_0x11926c>_0x5f38bb&&_0x11926c>=0x0;)_0x11926c--,_0x457888=_0x2a874f[_0x11926c];_0x457888&&(_0x4f7d03=_0x457888,Is(_0x50d33,'data-unstable',null),Is(_0x457888,'data-unstable','true'));}else{if(_0xfe7c45<_0x5f38bb){let _0x153f97=_0xfe7c45,_0x1cb17f=_0x50d33;for(;_0x153f97<_0x5f38bb;){const _0x1b010c=_0x1cb17f['childNodes']['filter'](_0xbda11f=>_0x3f3ba2(_0xbda11f));if(0x0===_0x1b010c['length'])break;_0x153f97++,_0x1cb17f=_0x1b010c[_0x1b010c['length']-0x1];}_0x1cb17f&&(_0x4f7d03=_0x1cb17f,Is(_0x50d33,'data-unstable',null),Is(_0x1cb17f,'data-unstable','true'));}}let _0x3b762c=_0x4f7d03;for(;_0x3b762c;){for(;_0x3b762c['nextSibling'];)_0x3b762c=_0x3b762c['nextSibling'],_0x3f3ba2(_0x3b762c)&&Is(_0x3b762c,'data-unstable','true');_0x3b762c=_0x3b762c['parentNode'];}}['_isNewNode'](_0x356299){return Boolean('new-element'===ut(_0x356299,'data-id'));}['_isExistingNode'](_0x392e5b){return Boolean((ut(_0x392e5b,'data-id')||'')['length']>0x0&&'new-element'!==ut(_0x392e5b,'data-id'));}['_isDelNode'](_0x460d64){return!!_0x460d64&&Boolean(_0xf29723(_0x460d64)&&pt(_0x460d64)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x5a693b){let _0x556861=_0x5a693b['parentNode'];for(;_0x556861;){if(ut(_0x556861,'data-wrapped-id'))return!0x0;_0x556861=_0x556861['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x583296){return Boolean(_0xf29723(_0x583296)&&pt(_0x583296)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function wt({editor:_0x1ea009,changeGroups:_0x4e0514,documentContextContent:_0x4de0e1,showDiff:_0xa42b1e,trimUnchanged:_0x574085=!0x0}){return _0x4e0514['map'](_0x396821=>{const _0x1ad762=new _t([]),_0x244d88=new _t([]);for(const _0x593506 of _0x396821['changes'])if(_0xa42b1e&&'removed'==_0x593506['type']||_0x244d88['children']['push'](_0x593506['node']['cloneNode'](!0x0)),'new'!=_0x593506['type']&&(_0xa42b1e||'removed'!=_0x593506['type'])){const _0x167a74=gt(_0x1d0a82=>ut(_0x1d0a82,'data-id')==_0x593506['id'],_0x4de0e1,!0x0);_0x167a74&&_0x1ad762['children']['push'](_0x167a74['cloneNode'](!0x0));}const {content:_0x33c17a,hasChanges:_0xc0d8b5}=function(_0x15f800,_0x44a696,_0x17af52,_0x2cbdc2,_0x14df81=!0x0){const _0xa277e8=_0x15f800['plugins']['get']('DocumentCompare'),_0x49c47a=pt(_0x44a696),_0x3f649b=pt(_0x17af52),_0x5b9dc2=_0x15f800['data']['parse'](_0x49c47a,'$root'),_0x303f23=_0x15f800['model']['createPositionAt'](_0x5b9dc2,0x0),_0x5d10ec=_0xa277e8['getDiff'](_0x49c47a,_0x3f649b,{'anchor':_0x303f23,'markDeletions':_0x2cbdc2}),_0x12da94=_0x5d10ec['getOperations']();if(0x0==_0x12da94['length'])return{'content':_0x44a696['cloneNode'](!0x0),'hasChanges':!0x1};_0x2cbdc2?function(_0x5ae646,_0x2cba53,_0x51fb62){if(0x0==_0x5ae646['length'])return;const _0x4ad4bc=_0x51fb62['plugins']['get']('DocumentCompare'),_0xc7fd32=_0x51fb62['plugins']['get']('SuggestionsConversion');_0x51fb62['model']['change'](_0x5a923d=>{const _0x232960=new Set();for(let _0x2ea67a=0x0;_0x2ea67a<_0x5ae646['length'];_0x2ea67a++){const _0x14dab7=_0x5ae646[_0x2ea67a];if(_0x14dab7['baseVersion']=null,_0x14dab7['isDocumentOperation']=!0x1,_0x4ad4bc['isMarkedRemoveOperation'](_0x14dab7)){const _0x158c25=_0x122c7c(_0x14dab7['newRange'],_0x51fb62['model']),_0x537036='suggestion:deletion:'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0x537036,_0x158c25);}else switch(_0x14dab7['type']){case'rename':{if(_0x14dab7['oldName']==_0x14dab7['newName'])break;_0x5a923d['batch']['addOperation'](_0x14dab7),_0x51fb62['model']['applyOperation'](_0x14dab7);const _0x1eba40='$elementName',_0x2a05b9=_0x14dab7['position'],_0x4dcfcc=_0x51fb62['model']['createRange'](_0x2a05b9,_0x51fb62['model']['createPositionAt'](_0x2a05b9['nodeAfter'],'end')),_0x1cbb02='suggestion:attribute:'+_0x1eba40+':'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0x1cbb02,_0x4dcfcc);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x14dab7['oldValue']==_0x14dab7['newValue'])break;_0x5a923d['batch']['addOperation'](_0x14dab7),_0x51fb62['model']['applyOperation'](_0x14dab7);const _0x31dec5=_0x14dab7['key'];if(!_0xc7fd32['isRegisteredAttribute'](_0x31dec5))break;const _0xb55f7=_0x122c7c(_0x14dab7['range'],_0x51fb62['model']),_0x57afa5='suggestion:attribute:'+_0x31dec5+':'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0x57afa5,_0xb55f7);break;}case'insert':{_0x5a923d['batch']['addOperation'](_0x14dab7),_0x51fb62['model']['applyOperation'](_0x14dab7);if(_0x5ae646[_0x2ea67a+0x1]&&'move'==_0x5ae646[_0x2ea67a+0x1]['type']){ro(_0x2cba53,_0x14dab7);break;}const _0x20dc87=_0x14dab7['position'],_0x3298ac=_0x14dab7['howMany'],_0x2cd499=_0x122c7c(_0x51fb62['model']['createRange'](_0x20dc87,_0x20dc87['getShiftedBy'](_0x3298ac)),_0x51fb62['model']),_0xbe63a='suggestion:insertion:'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0xbe63a,_0x2cd499);break;}case'split':{_0x5a923d['batch']['addOperation'](_0x14dab7),_0x51fb62['model']['applyOperation'](_0x14dab7);const _0x44baf0=_0x14dab7['splitPosition'],_0x40324b=_0x14dab7['moveTargetPosition'],_0x2ed1ed=_0x51fb62['model']['createRange'](_0x44baf0,_0x40324b),_0x344b86='suggestion:insertion:'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0x344b86,_0x2ed1ed);break;}case'move':{_0x5a923d['batch']['addOperation'](_0x14dab7),_0x51fb62['model']['applyOperation'](_0x14dab7),_0x5ae646[_0x2ea67a-0x1]&&'insert'==_0x5ae646[_0x2ea67a-0x1]['type']&&ro(_0x2cba53,_0x14dab7);const _0x452969=_0x14dab7['getMovedRangeStart'](),_0x5decf6=_0x14dab7['howMany'];for(let _0x25328d=0x0;_0x25328d<_0x5decf6;_0x25328d++){const _0x37ae10=_0x452969['getShiftedBy'](_0x25328d)['nodeAfter'];_0x232960['add'](_0x37ae10);}break;}case'remove':{const _0x2260ce=_0x14dab7['sourcePosition'],_0x2db7c5=_0x14dab7['howMany'],_0x2799e3=new lt(_0x2260ce,_0x2db7c5);_0x5a923d['batch']['addOperation'](_0x2799e3),_0x51fb62['model']['applyOperation'](_0x2799e3);break;}}}for(const _0x1e7b4a of _0x232960){const _0x8954e4=_0x51fb62['model']['createRangeOn'](_0x1e7b4a),_0x4c2ee9='suggestion:formatBlock:$fakeWrap:'+_0x36c3ed()+':$aiSuggestion';_0x2cba53['markers']['set'](_0x4c2ee9,_0x122c7c(_0x8954e4,_0x51fb62['model']));}});}(_0x12da94,_0x5b9dc2,_0x15f800):_0x15f800['model']['change'](_0x424f84=>{for(const _0x493ea3 of _0x12da94)if('remove'==_0x493ea3['type']){const _0x4aa977=_0x493ea3['sourcePosition'],_0x238905=_0x493ea3['howMany'],_0x43421e=new lt(_0x4aa977,_0x238905);_0x424f84['batch']['addOperation'](_0x43421e),_0x15f800['model']['applyOperation'](_0x43421e);}else{if('marker'==_0x493ea3['type']){const _0xedce54=_0x493ea3['name'],_0x3d3fbb=_0x493ea3['newRange'];null!==_0x3d3fbb?_0x5b9dc2['markers']['set'](_0xedce54,_0x3d3fbb):_0x5b9dc2['markers']['delete'](_0xedce54);}else _0x493ea3['baseVersion']=null,_0x493ea3['isDocumentOperation']=!0x1,_0x424f84['batch']['addOperation'](_0x493ea3),_0x15f800['model']['applyOperation'](_0x493ea3);}});if(_0x14df81){const _0x1125f2=ct(_0x15f800,_0x12da94,_0x5b9dc2);ht(_0x15f800['model'],_0x1125f2),function(_0x1bbd8a,_0x53c0e9){const _0x33ad6a=_0x53c0e9['getFirstRange']()['start'];let _0x52be89=_0x53c0e9['getFirstRange']()['end'];const _0x9b28b3=_0x33ad6a['root'];(_0x52be89['textNode']||_0x52be89['nodeAfter']&&_0x52be89['nodeAfter']['is']('$text'))&&(_0x4a8ac5(_0x52be89,'...'),_0x52be89=_0x52be89['getShiftedBy'](0x3)),(_0x33ad6a['textNode']||_0x33ad6a['nodeBefore']&&_0x33ad6a['nodeBefore']['is']('$text'))&&(_0x4a8ac5(_0x33ad6a,'...'),function(_0x11dec6,_0x53c1af,_0xb95230){for(let [_0x21935a,_0x4f869e]of _0x11dec6['markers']){const _0xb4075c=_0x4f869e['_getTransformedByInsertion'](_0x53c1af,_0xb95230,!0x1);_0x4f869e=_0xb4075c[0x0],_0x11dec6['markers']['set'](_0x21935a,_0x4f869e);}}(_0x9b28b3,_0x33ad6a,0x3),_0x33ad6a['parent']==_0x52be89['parent']&&(_0x52be89=_0x52be89['getShiftedBy'](0x3)));const _0x24a37f=_0x1bbd8a['createRange'](_0x1bbd8a['createPositionAt'](_0x9b28b3,0x0),_0x33ad6a),_0x5700a3=_0x1bbd8a['createRange'](_0x52be89,_0x1bbd8a['createPositionAt'](_0x9b28b3,'end')),_0x4b6c16=[..._0x24a37f['getMinimalFlatRanges'](),..._0x5700a3['getMinimalFlatRanges']()];_0x4b6c16['reverse']();for(const _0x55a5a5 of _0x4b6c16)_0x4e23f6(_0x55a5a5),Wn(_0x9b28b3,_0x55a5a5);}(_0x15f800['model'],_0x1125f2);}const _0x264f4=_0x15f800['data']['stringify'](_0x5b9dc2,{'showSuggestionHighlights':!0x0});return{'content':Ui(_0x264f4),'hasChanges':!0x0};}(_0x1ea009,_0x1ad762,_0x244d88,_0xa42b1e,_0x574085);return{'type':_0x396821['changes'][0x0]['type'],'index':_0x396821['index'],'content':_0x33c17a,'hasChanges':_0xc0d8b5};});}function ro(_0x55a35c,_0x30aa60){for(const [_0x817b57,_0x479291]of _0x55a35c['markers']){const _0x2d96d0=dt['_createFromRanges'](_0x479291['getTransformedByOperation'](_0x30aa60));_0x55a35c['markers']['set'](_0x817b57,_0x2d96d0);}}function ct(_0x2c5135,_0x3c3eb4,_0x172bca){const _0x28f3d1=_0x2c5135['plugins']['get']('DocumentCompare');let _0x46c44f=_0x2c5135['model']['createPositionAt'](_0x172bca,Number['POSITIVE_INFINITY']),_0x3cdc0b=_0x2c5135['model']['createPositionAt'](_0x172bca,0x0);for(const _0x34af15 of _0x3c3eb4){let _0x5e637e,_0x3b7d90;if(_0x28f3d1['isMarkedRemoveOperation'](_0x34af15))_0x5e637e=_0x34af15['newRange']['start'],_0x3b7d90=_0x34af15['newRange']['end'];else switch(_0x46c44f=_0x46c44f['getTransformedByOperation'](_0x34af15),_0x3cdc0b=_0x3cdc0b['getTransformedByOperation'](_0x34af15),_0x34af15['type']){case'rename':_0x5e637e=_0x34af15['position'],_0x3b7d90=_0x5e637e['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x5e637e=_0x34af15['range']['start'],_0x3b7d90=_0x34af15['range']['end'];break;case'insert':_0x5e637e=_0x34af15['position'],_0x3b7d90=_0x5e637e['getShiftedBy'](_0x34af15['howMany']);break;case'split':_0x5e637e=_0x34af15['splitPosition'],_0x3b7d90=_0x34af15['moveTargetPosition'];break;case'merge':{const _0xf5e091=_0x34af15['targetPosition']['path']['slice'](0x0,-0x1);_0x5e637e=_0x2c5135['model']['createPositionFromPath'](_0x172bca,_0xf5e091),_0x3b7d90=_0x5e637e['getShiftedBy'](0x1);break;}case'remove':{const _0x37b95e=_0x34af15['howMany'],_0xfeff26=_0x34af15['sourcePosition']['_getTransformedByInsertion'](_0x34af15['targetPosition'],_0x37b95e),_0x1c6fed=_0x34af15['getMovedRangeStart']();'remove'==_0x34af15['type']?(_0x5e637e=_0xfeff26,_0x3b7d90=_0xfeff26):(_0x5e637e=_0x1c6fed,_0x3b7d90=_0x1c6fed['getShiftedBy'](_0x37b95e));break;}}_0x5e637e&&_0x5e637e['isBefore'](_0x46c44f)&&(_0x46c44f=_0x5e637e['clone'](),_0x46c44f['stickiness']='toNone'),_0x3b7d90&&_0x3b7d90['isAfter'](_0x3cdc0b)&&(_0x3cdc0b=_0x3b7d90['clone'](),_0x3cdc0b['stickiness']='toNone');}return _0x2c5135['model']['createSelection'](_0x2c5135['model']['createRange'](_0x46c44f,_0x3cdc0b));}function ht(_0x1440a7,_0xfd35c){so(_0x1440a7,_0xfd35c,'forward');const _0x4ab3f5=_0xfd35c['getFirstRange']();_0xfd35c['setTo']([]),_0xfd35c['setTo'](_0x4ab3f5,{'backward':!0x0}),so(_0x1440a7,_0xfd35c,'backward');}function so(_0x5bd3e4,_0x4407ae,_0x367f99){let _0x426148=0x14;for(;_0x426148;){_0x5bd3e4['modifySelection'](_0x4407ae,{'unit':'word','direction':_0x367f99}),_0x426148--;const _0x372ade=_0x4407ae['focus']['forward'==_0x367f99?'nodeBefore':'nodeAfter'];if(_0x372ade&&_0x372ade['is']('element')&&_0x5bd3e4['schema']['isBlock'](_0x372ade)&&_0x5bd3e4['schema']['isObject'](_0x372ade))break;}}function Wn(_0x38b99e,_0x2422d7){for(const [_0x106cef,_0x4cc46f]of _0x38b99e['markers']){const _0x278f13=_0x4cc46f['_getTransformedByDeletion'](_0x2422d7['start'],_0x2422d7['end']['offset']-_0x2422d7['start']['offset']);null!=_0x278f13?_0x38b99e['markers']['set'](_0x106cef,_0x278f13):_0x38b99e['markers']['delete'](_0x106cef);}}class xi extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x222349,content:_0x25749b='',isDone:_0x43fcc1=!0x1,interactionId:_0x29278b,areActionsDisabled:_0xf5198f,documentContextContent:_0x43754d,editor:_0xc77857,id:_0xbcd19c}){super(),this['id']=_0xbcd19c||_0x36c3ed(),this['interactionId']=_0x29278b,this['type']=_0x222349,this['areActionsDisabled']=!!_0xf5198f,this['editor']=_0xc77857,this['aiResponseParser']=new Wi(),this['aiResponseApplier']=new qi(),this['documentContextContent']=Ui(_0x43754d||''),this['set']('isDone',_0x43fcc1),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x25749b);}['appendContent'](_0x5248cf){this['set']('content',this['content']+_0x5248cf);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1657b1,_0x34754c){this['changeGroups'][_0x1657b1]['state']=_0x34754c,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1657b1,'state':_0x34754c});}['getContentParts']({showDiff:_0x177419,groupIndex:_0x5d1207}){if(!this['editor'])throw new _0x1a859a('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x249851=this['_getCachedContentParts'](_0x177419,_0x5d1207);if(_0x249851)return _0x249851;let _0x4b7165=[];if(void 0x0===_0x5d1207)_0x4b7165=this['changeGroups'];else{const _0x29f625=this['changeGroups']['find'](({index:_0x5d0d61})=>_0x5d0d61===_0x5d1207);if(!_0x29f625)throw new _0x1a859a('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x5d1207});_0x4b7165=[_0x29f625];}const _0x41919b=wt({'editor':this['editor'],'showDiff':_0x177419,'changeGroups':_0x4b7165,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x177419,_0x41919b),_0x41919b;}['_getCachedContentParts'](_0x2e2719,_0x35e4ec){const _0x3903ce=_0x2e2719?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3903ce]['length'])return null;const _0x395f17=this['cachedSuggestionContentParts'][_0x3903ce];if(void 0x0===_0x35e4ec)return _0x395f17['length']>0x0&&_0x395f17['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2e2719,null),null):_0x2c607f(_0x395f17);{const _0x50ba76=_0x395f17['find'](({index:_0x46c1ac})=>_0x46c1ac===_0x35e4ec);if(_0x50ba76)return[_0x2c607f(_0x50ba76)];}return null;}['_setCachedContentParts'](_0x1cfa34,_0x1d822b){const _0x339bea=_0x1cfa34?'withDiff':'withoutDiff';_0x1d822b?_0x1d822b['forEach'](_0x444de9=>{const _0x29eb20=this['cachedSuggestionContentParts'][_0x339bea],_0x50c01b=_0x29eb20['find'](({index:_0x5c4cd3})=>_0x5c4cd3===_0x444de9['index']);if(_0x50c01b){const _0x736eb0=_0x29eb20['indexOf'](_0x50c01b);_0x29eb20['splice'](_0x736eb0,0x1,_0x444de9);}else _0x29eb20['push'](_0x444de9);}):this['cachedSuggestionContentParts'][_0x339bea]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x234757=this['changeGroups'];this['updateChangeGroups']();const _0x2bdeee=this['_getDifferentChangeGroups'](_0x234757,this['changeGroups']);(_0x2bdeee['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x2bdeee),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x8a0f2e,_0x55b2e1){const _0x37bacf=[];for(const _0x10a213 of _0x55b2e1){const _0x59992f=_0x8a0f2e[_0x10a213['index']];_0x59992f?_0x59992f['changes']['length']!==_0x10a213['changes']['length']?_0x37bacf['push'](_0x10a213):_0x59992f['changes']['forEach']((_0x441fa9,_0x306cfc)=>{const _0x22523f=_0x10a213['changes'][_0x306cfc];_0x441fa9['id']!==_0x22523f['id']&&_0x37bacf['push'](_0x10a213);}):_0x37bacf['push'](_0x10a213);}return _0x37bacf;}['updateChangeGroups'](){const _0x343250=new _0xd483af('p',{},[new _0xd483af('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x11c603(i(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x2595ce=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x343250,'cutAfterLastChange':!this['isDone']});if(!_0x2595ce['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x2595ce['parsedContent'];let _0x41dd64=[];if(_0x2c64d2(_0x4c729d=>{const _0xb268be=ut(_0x4c729d,'data-id');if(!_0xb268be||!_0x1c7f38(_0xb268be))return!0x1;const _0x1235e2=[_0x4c729d,...Pi(_0x4c729d)]['at'](-0x2);if(_0x4c729d!=_0x1235e2){const _0x476127=ut(_0x1235e2,'data-id');_0x1c7f38(_0x476127)||(_0x41dd64['push']({'node':_0x1235e2,'id':_0x476127,'type':'modified'}),_0x2595ce['modifiedNodeIds']['push'](_0x476127));}else _0x2595ce['modifiedNodeIds']['includes'](_0xb268be)?_0x41dd64['push']({'node':_0x4c729d,'type':'modified','id':_0xb268be}):_0x2595ce['newNodeIds']['includes'](_0xb268be)?_0x41dd64['push']({'node':_0x4c729d,'type':'new','id':_0xb268be,'anchorId':ut(_0x4c729d['previousSibling'],'data-id')}):_0x41dd64['push']({'node':_0x4c729d,'type':'removed','id':_0xb268be});return!0x0;},this['parsedMergedContent']),_0x41dd64=_0x41dd64['filter'](({node:_0x6e3434})=>[...Pi(_0x6e3434),_0x6e3434]['every'](_0x312b5c=>!ut(_0x312b5c,'data-unstable'))),0x0==_0x41dd64['length'])return;const _0x39484e=[[_0x41dd64[0x0]]];for(let _0x57c236=0x1;_0x57c236<_0x41dd64['length'];_0x57c236++){const _0x4749eb=_0x39484e[_0x39484e['length']-0x1],_0x8b6a6d=_0x4749eb[_0x4749eb['length']-0x1];_0x41dd64[_0x57c236]['node']['previousSibling']==_0x8b6a6d['node']&&'modified'!=_0x41dd64[_0x57c236]['type']&&'modified'!=_0x8b6a6d['type']?_0x4749eb['push'](_0x41dd64[_0x57c236]):_0x39484e['push']([_0x41dd64[_0x57c236]]);}for(const _0xc04e63 of _0x39484e){const _0x347ebb=_0xc04e63[0x0],_0x3ba773=_0xc04e63[_0xc04e63['length']-0x1],_0x4ef641=_0x5eef3d(_0x347ebb['node']['previousSibling']);_0x4ef641&&_0xc04e63['unshift'](_0x4ef641);const _0x1b8dc8=_0x5eef3d(_0x3ba773['node']['nextSibling']);_0x1b8dc8&&_0xc04e63['push'](_0x1b8dc8);}function _0x1c7f38(_0x5353d1){return _0x2595ce['modifiedNodeIds']['includes'](_0x5353d1)||_0x2595ce['newNodeIds']['includes'](_0x5353d1)||_0x2595ce['removedNodeIds']['includes'](_0x5353d1);}function _0x5eef3d(_0x2c4bc5){if(_0x2c4bc5&&ut(_0x2c4bc5,'data-id')&&!ut(_0x2c4bc5,'data-unstable')){const _0x41c482=ut(_0x2c4bc5,'data-id');if(!_0x1c7f38(_0x41c482))return{'node':_0x2c4bc5,'type':'context','id':_0x41c482};}return null;}this['changeGroups']=_0x39484e['map']((_0x1580ab,_0xf5e1ec)=>({'changes':_0x1580ab,'state':'pending','index':_0xf5e1ec}));}}const je=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class os extends _0x263abf(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4342f6,editor:_0x58ae0b}){super(),this['id']=_0x36c3ed(),this['connector']=_0x4342f6,this['isStopped']=!0x0,this['editor']=_0x58ae0b;}async['start'](){const _0x77cafa=[];let _0x276fcc,_0xf32dfd,_0x26e3f3;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x47ba6f=await this['currentRequest']['getStream']();for await(const _0x384ec5 of _0x47ba6f){if(this['isStopped'])return;if('error'==_0x384ec5['event'])return void this['fire']('error',{'error':new _0x1a859a('ai-chat-interaction-error',this)});switch(_0x384ec5['event']){case'message-metadata':this['messageId']=_0x384ec5['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x384ec5['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x384ec5['data']['conversationTitle'],!0x0);break;case'source':_0x77cafa['push'](_0x384ec5['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x276fcc='modification-delta'==_0x384ec5['event']?'modification':'text',_0xf32dfd='modification-delta'==_0x384ec5['event']?_0x384ec5['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x276fcc&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x276fcc,'interactionId':this['id'],'id':_0xf32dfd}),'modification'==_0x276fcc&&(this['currentReply']['sources']=_0x77cafa['splice'](0x0))),this['currentReply']['appendContent'](_0x384ec5['data']['textDelta']);break;case'mcp-tool-result':_0x26e3f3=JSON['parse'](_0x384ec5['data']['result']),this['_handleToolResultData']({'toolName':_0x384ec5['data']['toolName'],'data':_0x26e3f3['data'],'attributes':_0x26e3f3['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x384ec5['data']['toolName'],'data':_0x384ec5['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x77cafa['length']>0x0&&(this['currentReply']['sources']=_0x77cafa['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0xced5b){return this['replies']['find'](_0x142dc6=>_0x142dc6['id']===_0xced5b);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x232a49=>_0x232a49['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1c8014){const _0x5d71aa=new xi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x1c8014});return this['replies']['push'](_0x5d71aa),_0x5d71aa['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x5d71aa),_0x5d71aa;}['setConversationTitle'](_0x4d99b6,_0xf97647=!0x1){this['fire']('setConversationTitle',_0x4d99b6,_0xf97647);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x2b1a79){this['fire']('toolDataReceived',{'type':'result','toolName':_0x2b1a79['toolName'],'data':structuredClone(_0x2b1a79['data']||{}),'attributes':structuredClone(_0x2b1a79['attributes']||{})},this);}['_handleToolNotificationData'](_0x1fbbdf){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1fbbdf['toolName'],'data':structuredClone(_0x1fbbdf['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x39e985){return _0x39e985['TOOL']='mcp-tool-context',_0x39e985['FILE']='file',_0x39e985['DOCUMENT']='document',_0x39e985['URL']='web-resource',_0x39e985['TEXT']='text',_0x39e985['SELECTION']='selection',_0x39e985;}({}),be=function(_0x5b51d5){return _0x5b51d5['TEXT']='text',_0x5b51d5['MARKDOWN']='markdown',_0x5b51d5['HTML']='html',_0x5b51d5;}({});const Oe=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),ze=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class De extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x4442b7,config:_0x3ae657,ownerId:_0x1f8c95}){super(),this['_connector']=_0x4442b7,this['_config']=_0x3ae657,this['_ownerId']=_0x1f8c95;}['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'](_0x29f144){const _0x449233=await this['_createContextItemFromContent'](_0x29f144);return this['_addToConversationContextItem'](_0x449233),'current-document'===_0x449233['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x449233;}async['_createContextItemFromContent'](_0x3b77ec){if(_0x3b77ec['type']===xe['DOCUMENT']){const _0x1f6710=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3b77ec['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3b77ec['type'],'content':_0x1f6710['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x1f6710['attributes']?.['version'],'sessionId':_0x1f6710['attributes']?.['sessionId']};}if(_0x3b77ec['type']===xe['TOOL'])return{'id':_0x3b77ec['id'],'uiId':_0x3b77ec['id'],'label':_0x3b77ec['data']?.['label']||_0x3b77ec['id'],'type':xe['TOOL'],'mcpServerName':_0x3b77ec['mcpServerName'],'toolName':_0x3b77ec['toolName'],'data':_0x3b77ec['data']||{}};return{'id':_0x3b77ec['id'],'uiId':_0x3b77ec['id'],'label':_0x3b77ec['attributes']?.['label']||_0x3b77ec['name']||_0x3b77ec['url']||_0x3b77ec['id'],'type':_0x3b77ec['type'],..._0x3b77ec?.['attributes']?.['resourceId']?{'resourceId':_0x3b77ec['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x34cadd){const _0x119811=this['_pendingContextItems']['get'](_0x34cadd);_0x119811?.['isReadOnly']||this['_removeContextItem'](_0x34cadd);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2d17d7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2d17d7['uiId']);const _0x103519=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x103519&&this['_addContextItem']({..._0x103519,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x21603b){for(const _0x63ad98 of _0x21603b['values']())this['_addToConversationContextItem'](_0x63ad98);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'](_0x2df1b8){return Array['from'](_0x2df1b8['values']())['map'](_0x426786=>this['_mapContextItemToRequestData'](_0x426786))['filter'](_0x186eb7=>null!==_0x186eb7);}async['addFilesToContext'](_0x5e6dff,_0x5706c7,_0x49be00=xe['FILE']){const _0x2bf503='files-'+_0x36c3ed();this['_startUploadOperation'](_0x2bf503);try{await Promise['all'](_0x5e6dff['map'](async _0x4a83a0=>{const _0x56d6bd='file-'+_0x36c3ed(),_0xf0dc7c=_0xe77682(_0x4a83a0['name']);try{this['_addContextItem']({'type':_0x49be00,'label':_0x5706c7?.['label']||_0xf0dc7c,'uiId':_0x56d6bd,'resourceId':_0x5706c7?.['resourceId']},!0x0);const _0x19c1bf=this['_connector']['uploadFile'](this['_ownerId'],_0x4a83a0,_0x5706c7);this['_ongoingUploads']['set'](_0x56d6bd,_0x19c1bf['abortController']);const {id:_0x40958a}=await _0x19c1bf['getId']();this['_ongoingUploads']['delete'](_0x56d6bd),this['_finishContextItemLoading']({'type':_0x49be00,'id':_0x40958a,'label':_0x5706c7?.['label']||_0xf0dc7c,'uiId':_0x56d6bd,'resourceId':_0x5706c7?.['resourceId']},!0x1);}catch(_0x12e638){this['_ongoingUploads']['delete'](_0x56d6bd);if(!(_0x12e638 instanceof _0x1a859a&&_0x12e638['message']['startsWith']('ai-request-aborted'))){const _0x2293e9=Oe['get'](_0x12e638['code'])||'ai-chat-file-upload-failed',_0x3f77e2=new _0x1a859a(_0x2293e9,null,{'fileName':_0xf0dc7c,..._0x12e638});_0x3f77e2['stack']=_0x12e638['stack'],this['fire']('error',{'error':_0x3f77e2});}this['_removeContextItem'](_0x56d6bd);}}));}finally{this['_finishUploadOperation'](_0x2bf503);}}['addCurrentDocumentToContext'](_0x50e279){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x1ca67b={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x50e279,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x1ca67b);}async['updateCurrentDocument'](_0x1aed14,_0x119a76,_0x417a6c,_0x385864){const _0x126eec=this['_pendingContextItems']['get']('current-document');if(_0x126eec&&_0x1aed14){_0x126eec['selection']=_0x385864?_0x385864['map'](_0x443b4b=>({'start':_0x443b4b['start'],'end':_0x443b4b['end']})):[];try{if(_0x126eec['version']===_0x119a76)return;const {id:_0x398719}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1aed14,{'version':_0x119a76,'sessionId':_0x417a6c})['getId']();_0x126eec['id']=_0x398719,_0x126eec['content']=_0x1aed14,_0x126eec['version']=_0x119a76,_0x126eec['sessionId']=_0x417a6c;}catch(_0xdf0e52){const _0x29848d=new _0x1a859a('ai-chat-document-upload-failed',null);_0x29848d['stack']=_0xdf0e52['stack'],this['fire']('error',{'error':_0x29848d});}}}['addSelectionToContext'](_0x27dfd5){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x27dfd5,'uiId':'selection','content':_0x27dfd5});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x21dfcf,_0x9413d5){const _0x1b66e7='url-'+_0x36c3ed();this['_startUploadOperation'](_0x1b66e7);const _0x186f5e='url-'+_0x36c3ed();try{this['_addContextItem']({'type':xe['URL'],'label':_0x9413d5?.['label']||_0x21dfcf,'uiId':_0x186f5e,'resourceId':_0x9413d5?.['resourceId']},!0x0);const _0x2e6842=this['_connector']['uploadUrl'](this['_ownerId'],_0x21dfcf,_0x9413d5);this['_ongoingUploads']['set'](_0x186f5e,_0x2e6842['abortController']);const {id:_0x457c51}=await _0x2e6842['getId']();this['_ongoingUploads']['delete'](_0x186f5e),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x457c51,'label':_0x9413d5?.['label']||_0x21dfcf,'uiId':_0x186f5e,'resourceId':_0x9413d5?.['resourceId']},!0x1);}catch(_0x2826c4){this['_ongoingUploads']['delete'](_0x186f5e),(_0x2826c4['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x1a859a('ai-chat-url-upload-failed',this,{'url':_0x21dfcf,'originalError':_0x2826c4}),'url':_0x21dfcf}),this['_removeContextItem'](_0x186f5e));}finally{this['_finishUploadOperation'](_0x1b66e7);}}['addToolItemToContext'](_0x574f53){this['_pendingContextItems']['set'](_0x574f53['uiId'],_0x574f53),this['fire']('contextItemAdded',{'contextItem':_0x574f53,'isLoading':!0x1});}async['loadSourceResources'](_0x32c2b0,_0x11b427,_0x26340a){const _0x2b72d7=this['_addContextOptionsState']['sources']['find'](_0x24a971=>_0x24a971['id']===_0x32c2b0);if(!_0x2b72d7)return this['fire']('error',{'error':new _0x1a859a('ai-chat-source-not-found',this,{'sourceId':_0x32c2b0}),'sourceId':_0x32c2b0}),[];try{const _0x59cef5=(await _0x2b72d7['getResources'](_0x11b427))['map'](_0x3b12df=>{const _0x146579=this['_isResourceInContext'](_0x3b12df['id']);return{..._0x3b12df,'isInContext':_0x146579};});return _0x2b72d7['resources']=_0x59cef5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x32c2b0,'source':_0x2b72d7,'resources':_0x59cef5,'uid':_0x26340a}),_0x59cef5;}catch(_0x207bd2){return this['fire']('error',{'error':new _0x1a859a('ai-chat-source-resources-load-failed',this,{'sourceId':_0x32c2b0,'originalError':_0x207bd2}),'sourceId':_0x32c2b0,'sourceLabel':_0x2b72d7['label']}),[];}}async['addResourceToContext'](_0x140f37,_0x5886fe){if(this['_isResourceInContext'](_0x5886fe['id']))return;let _0xff023=_0x5886fe['data'];if(!_0xff023&&_0x140f37['getData'])try{_0xff023=await _0x140f37['getData'](_0x5886fe['id']);}catch(_0x51199a){return void this['fire']('error',{'error':new _0x1a859a('ai-chat-resource-load-failed',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id'],'originalError':_0x51199a}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});}if(_0xff023)switch(_0x5886fe['type']){case xe['URL']:if('string'!=typeof _0xff023)return void this['fire']('error',{'error':new _0x1a859a('ai-chat-context-invalid-data',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id'],'expectedType':'string','actualType':typeof _0xff023}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});await this['addUrlToContext'](_0xff023,{'label':_0x5886fe['label'],'resourceId':_0x5886fe['id']});break;case xe['FILE']:if(!(_0xff023 instanceof File))return void this['fire']('error',{'error':new _0x1a859a('ai-chat-context-invalid-data',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id'],'expectedType':'File','actualType':typeof _0xff023}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});await this['addFilesToContext']([_0xff023],{'label':_0x5886fe['label'],'resourceId':_0x5886fe['id']});break;case xe['TEXT']:if('object'!=typeof _0xff023||!('content'in _0xff023)||!('type'in _0xff023))return void this['fire']('error',{'error':new _0x1a859a('ai-chat-context-invalid-data',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0xff023}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});_0xff023=De['_convertTextResourceToFile'](_0xff023,_0x5886fe['label']),await this['addFilesToContext']([_0xff023],{'label':_0x5886fe['label'],'resourceId':_0x5886fe['id']},xe['TEXT']);break;case xe['TOOL']:break;default:this['fire']('error',{'error':new _0x1a859a('ai-chat-context-unsupported-type',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id'],'resourceType':_0x5886fe['type']}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});}else this['fire']('error',{'error':new _0x1a859a('ai-chat-resource-no-data',this,{'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']}),'resourceId':_0x5886fe['id'],'sourceId':_0x140f37['id']});}static['_convertTextResourceToFile'](_0x4a245d,_0x1e57ed){switch(_0x4a245d['type']){case be['MARKDOWN']:return new File([_0x4a245d['content']],_0x1e57ed,{'type':'text/markdown'});case be['HTML']:return new File([_0x4a245d['content']],_0x1e57ed,{'type':'text/html'});default:return new File([_0x4a245d['content']],_0x1e57ed,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2646bd){switch(_0x2646bd['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x2646bd['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x2646bd['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x2646bd['id'],..._0x2646bd['selection']?.['length']&&{'selection':_0x2646bd['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x2646bd['id']};case xe['TOOL']:{const _0x42c34c=_0x2646bd;return{'type':xe['TOOL'],'mcpServerName':_0x42c34c['mcpServerName'],'toolName':_0x42c34c['toolName'],'data':_0x42c34c['data'],'id':_0x42c34c['id']};}default:return null;}}['_addContextItem'](_0x263b7f,_0x134027=!0x1){if(this['_pendingContextItems']['set'](_0x263b7f['uiId'],_0x263b7f),_0x263b7f['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x263b7f,'isLoading':_0x134027}),'current-document'===_0x263b7f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x263b7f['resourceId']){const _0xc2fdf0=this['_findSourceIdsByResourceId'](_0x263b7f['resourceId']);_0xc2fdf0&&_0xc2fdf0['forEach'](_0x3fdd71=>{this['_updateResourceInContextState'](_0x3fdd71,_0x263b7f['resourceId'],!0x0);});}}['_removeContextItem'](_0xbc068){const _0x5d7f53=this['_pendingContextItems']['get'](_0xbc068),_0x468270=this['_ongoingUploads']['get'](_0xbc068);if(_0x468270&&(_0x468270['abort'](),this['_ongoingUploads']['delete'](_0xbc068)),_0x5d7f53?.['resourceId']){const _0x3e1972=this['_findSourceIdsByResourceId'](_0x5d7f53['resourceId']);_0x3e1972&&_0x3e1972['forEach'](_0x5eea54=>{this['_updateResourceInContextState'](_0x5eea54,_0x5d7f53['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0xbc068),this['fire']('contextItemRemoved',{'uiId':_0xbc068,'type':_0x5d7f53?.['type']}),'current-document'===_0xbc068&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x247958,_0x58e16f){if(this['_pendingContextItems']['has'](_0x247958['uiId'])&&(this['_pendingContextItems']['set'](_0x247958['uiId'],_0x247958),this['fire']('contextItemLoadingEnded',{'contextItem':_0x247958,'isLoading':_0x58e16f}),_0x247958['resourceId'])){const _0xb67a98=this['_findSourceIdsByResourceId'](_0x247958['resourceId']);_0xb67a98&&_0xb67a98['forEach'](_0x4b259b=>{this['_updateResourceInContextState'](_0x4b259b,_0x247958['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x49e6a5){this['_conversationContextItems']['set'](_0x49e6a5['uiId'],_0x49e6a5);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x348399=>({..._0x348399,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3c47e4=>({..._0x3c47e4,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0xe1fb50=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0xe1fb50,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x325725){for(const _0x1f235b of this['_pendingContextItems']['values']())if(_0x1f235b['resourceId']===_0x325725)return!0x0;for(const _0x2aeeee of this['_conversationContextItems']['values']())if(_0x2aeeee['resourceId']===_0x325725)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x7d56fe){const _0x1dbea0=[];for(const _0x490212 of this['_addContextOptionsState']['sources']){_0x490212['resources']['find'](_0x427675=>_0x427675['id']===_0x7d56fe)&&_0x1dbea0['push'](_0x490212['id']);}return 0x0===_0x1dbea0['length']?null:_0x1dbea0;}['_updateResourceInContextState'](_0x4fd1d4,_0x39e482,_0x4a2ea2){const _0x30dfad=this['_addContextOptionsState']['sources']['find'](_0x2ac362=>_0x2ac362['id']===_0x4fd1d4);if(!_0x30dfad)return;const _0x3627d1=_0x30dfad['resources']['find'](_0x4599ba=>_0x4599ba['id']===_0x39e482);_0x3627d1&&(_0x3627d1['isInContext']=_0x4a2ea2,this['fire']('resourceStateChanged',{'sourceId':_0x4fd1d4,'resourceId':_0x39e482,'isInContext':_0x4a2ea2}));}['_startUploadOperation'](_0x3063a1){this['_ongoingUploadOperations']['set'](_0x3063a1,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1dea5b){this['_ongoingUploadOperations']['delete'](_0x1dea5b),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ue=['capabilitiesUpdated'];class Ne extends _0x263abf(){['_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'](_0x4c5f86){const _0x10572f={};return _0x4c5f86&&_0x4c5f86['isWebSearchEnabled']&&(_0x10572f['webSearch']={}),_0x4c5f86&&_0x4c5f86['isReasoningEnabled']&&(_0x10572f['reasoning']={}),_0x10572f;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x1f42f7){_0x1f42f7!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x1f42f7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x267353){_0x267353!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x267353,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class We extends os{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['attributes'];constructor(_0x5d7c40){super(_0x5d7c40),this['conversationId']=_0x5d7c40['conversationId'],this['contextItems']=_0x5d7c40['contextItems'],this['capabilities']=_0x5d7c40['capabilities'],this['userMessage']=_0x5d7c40['userMessage'],this['model']=_0x5d7c40['model'],this['attributes']=_0x5d7c40['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':De['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ne['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class st extends _0x263abf(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1c1427){super(),this['options']=_0x1c1427,this['connector']=_0x1c1427['connector'],this['chatModels']=_0x1c1427['chatModels'],this['id']=_0x1c1427['conversationId'];}async['init'](_0x1e725a){try{this['chatContext']=new De({'connector':this['connector'],'config':_0x1e725a,'ownerId':this['id']}),this['chatContext']['delegate'](...ze)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ne(),this['chatCapabilities']['delegate'](...Ue)['to'](this),this['chatCapabilities']['init']();const _0x5eff90=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5eff90});const _0x20efe1=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x20efe1&&await this['setModel'](_0x20efe1);}catch(_0x2e0177){const _0x1dae42=new _0x1a859a('ai-chat-conversation-init-failed',null,{'message':_0x2e0177['message']||_0x2e0177});_0x1dae42['stack']=_0x2e0177['stack'],this['fire']('error',{'error':_0x1dae42});}}async['start'](){if(this['isStarted'])throw new _0x1a859a('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x1a859a('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xaed956}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xaed956,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x397571){const _0x4b71a6=new _0x1a859a('ai-chat-conversation-start-failed',null,{'message':_0x397571['message'],'conversationId':this['id']});throw _0x4b71a6['stack']=_0x397571['stack'],this['fire']('error',{'error':_0x4b71a6}),_0x4b71a6;}}async['load'](_0x31a1ce,_0x2ba094){try{const _0x655c7c=await this['connector']['fetchConversation'](_0x31a1ce)['getConversation'](),_0x94c4c7=await this['connector']['fetchConversationMessages'](_0x31a1ce)['getMessages'](),_0xb009be=_0x94c4c7[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x655c7c['id'],'title'in _0x655c7c?this['fire']('setConversationTitle',_0x655c7c['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x56823d=(await this['chatModels']['getAll']())['find'](_0x34da98=>_0x34da98['id']['toLowerCase']()===_0xb009be['toLowerCase']());return this['selectedModel']=_0x56823d,this['fire']('modelSelected',{'selectedModel':_0x56823d,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x94c4c7,_0x2ba094,_0xb009be),this['currentInteraction']=void 0x0,this;}catch(_0x5b99cc){const _0x5137c6=new _0x1a859a('ai-chat-conversation-init-from-id-failed',null,{'message':_0x5b99cc['message'],'conversationId':_0x31a1ce});throw _0x5137c6['stack']=_0x5b99cc['stack'],this['fire']('error',{'error':_0x5137c6}),_0x5137c6;}}async['_processMessagesToInteractions'](_0x25eb4b,_0x33e4f3,_0x210697){let _0x510df3;for(const _0x243e62 of _0x25eb4b)if('user'===_0x243e62['role']){const _0x265118=await this['_extractContextItems'](_0x243e62),_0x25cb59={'isReasoningEnabled':Object['hasOwn'](_0x243e62['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x243e62['capabilities'],'webSearch')};_0x510df3=this['createInteraction']({'userMessage':_0x243e62['prompt'],'contextItems':_0x265118,'capabilities':_0x25cb59,'modelId':_0x210697,'attributes':_0x243e62['attributes']}),this['currentInteraction']=_0x510df3,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x243e62['role']&&_0x510df3){const _0x42f87b=[];for(const _0x2ee47c of _0x243e62['content'])switch(_0x2ee47c['type']){case'text':case'modification':{const _0x28a39e=_0x510df3['getDocumentContext']()?.['sessionId']!==_0x33e4f3;_0x510df3['currentReply']=_0x510df3['createReply']({'type':_0x2ee47c['type'],'isDone':!0x0,'interactionId':_0x510df3['id'],'areActionsDisabled':_0x28a39e}),_0x510df3['currentReply']['appendContent'](_0x2ee47c['content']),_0x42f87b['length']>0x0&&(_0x510df3['currentReply']['sources']=_0x42f87b['splice'](0x0));break;}case'url':_0x42f87b['push'](_0x2ee47c);break;case'mcp-tool-result':{const {data:_0x384a4a,attributes:_0x5e94b7}=JSON['parse'](_0x2ee47c['content']);_0x510df3['_handleToolResultData']({'toolName':_0x2ee47c['toolName'],'data':_0x384a4a,'attributes':_0x5e94b7});break;}}}}}async['_extractContextItems'](_0x45ea0d){const _0x1849e6=new Map();if(!_0x45ea0d['content'])return _0x1849e6;for(const _0x299c16 of _0x45ea0d['content']){const _0x313b64=await this['chatContext']['populateFromMessage'](_0x299c16);_0x313b64&&_0x1849e6['set'](_0x313b64['id'],_0x313b64);}return _0x1849e6;}async['handleUserInteraction']({userMessage:_0x3d7a54,attributes:_0x27d5a0}){if(!this['isStarted'])throw new _0x1a859a('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x1a859a('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x20b64d=this['chatContext']['getPendingContextItems'](),_0x364fa1=this['chatCapabilities']['getCapabilitiesConfig'](),_0x67070d=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3d7a54,'contextItems':_0x20b64d,'capabilities':_0x364fa1,'modelId':_0x67070d,'attributes':_0x27d5a0}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x571651){if(_0x571651 instanceof _0x1a859a)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x571651});else{const _0x521600=Oe['get'](_0x571651['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new _0x1a859a(_0x521600,null,{'error':_0x571651})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x36741a,contextItems:_0x2da2d8,capabilities:_0x2573bd,modelId:_0x501a2a,attributes:_0x47f9a2}){const _0x724e28=new We({'userMessage':_0x36741a,'contextItems':_0x2da2d8,'capabilities':_0x2573bd,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x501a2a,'attributes':_0x47f9a2});return _0x724e28['delegate'](...je)['to'](this),this['interactions']['push'](_0x724e28),this['fire']('interactionCreated',_0x724e28),_0x724e28;}['getInteraction'](_0x4b60ec){return this['interactions']['find'](_0x3f324f=>_0x3f324f['id']===_0x4b60ec);}['removeInteraction'](_0x1ec937){const _0x2869e5=this['getInteraction'](_0x1ec937);_0x2869e5&&(_0x2869e5['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x2869e5),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x730afc){this['chatContext']['addCurrentDocumentToContext'](_0x730afc);}async['updateCurrentDocumentInContext']({content:_0x58d63f,version:_0x5ace3d,sessionId:_0x385b52,selections:_0x1d353c}){await this['chatContext']['updateCurrentDocument'](_0x58d63f,_0x5ace3d,_0x385b52,_0x1d353c);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x373271){this['chatContext']['addSelectionToContext'](_0x373271);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x217f8a){this['chatContext']['addFilesToContext'](_0x217f8a);}['addUrlToContext'](_0x2ff2ab){this['chatContext']['addUrlToContext'](_0x2ff2ab);}['addToolItemToContext'](_0x5580ff){this['chatContext']['addToolItemToContext'](_0x5580ff);}['addResourceToContext'](_0x5e107d,_0x2f9a37){this['chatContext']['addResourceToContext'](_0x5e107d,_0x2f9a37);}['loadSourceResources'](_0x123fb0,_0xf2549d,_0x41b553){return this['chatContext']['loadSourceResources'](_0x123fb0,_0xf2549d,_0x41b553);}['removeFromContext'](_0x36d1d0){this['chatContext']['removeFromContext'](_0x36d1d0);}['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'](_0x4fe068){_0x4fe068?!0x1===await this['chatModels']['isAvailable'](_0x4fe068)&&(_0x4e1011('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4fe068}),_0x4fe068=(await this['chatModels']['getAvailableModels']())[0x0]):(_0x4e1011('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4fe068=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4fe068['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4fe068,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4fe068}));}}class et extends _0x263abf(){['_connector'];['_config'];['_locale'];['_modelList']=[];constructor({connector:_0x52cd1f,config:_0x36b3ec,locale:_0x1cae0b}){super(),this['_connector']=_0x52cd1f,this['_config']=_0x36b3ec,this['_locale']=_0x1cae0b;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){if(!this['_modelList']['length'])try{const _0x35afc4=this['_locale']['uiLanguage']||'en',_0x19592f=this['_connector']['getModels'](_0x35afc4),_0x5b05ac=await _0x19592f['list']();this['_modelList']=_0x5b05ac['items']['map'](_0x37d065=>Bi(_0x37d065)?{..._0x37d065,'name':i(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x37d065);}catch(_0x3c049d){throw _0x42b6c9('ai-models-unable-to-retrieve',{'error':_0x3c049d}),_0x3c049d;}return[...this['_modelList']];}async['getAvailableModels'](){const _0x2aec68=await this['getAll']();let _0x318aea;return _0x318aea=this['_availableModels']?this['_filterModels'](_0x2aec68,this['_availableModels']):_0x2aec68['filter'](_0x3450cf=>_0x3450cf['recommended']),_0x318aea;}async['getModel'](_0x5aabbd){const _0x340779=await this['getAll']();if(!_0x340779['length'])return null;if(_0x5aabbd){const _0xbbeded=this['_getModelById'](_0x340779,_0x5aabbd);if(_0xbbeded)return _0xbbeded;_0x4e1011('ai-chat-model-id-unrecognized',{'modelId':_0x5aabbd,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x343ecf=await this['getAvailableModels']();if(!_0x343ecf['length'])return null;if(this['_defaultModelId']){const _0x494ffa=this['_getModelById'](_0x343ecf,this['_defaultModelId']);if(_0x494ffa)return _0x494ffa;_0x4e1011('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x343ecf[0x0]['id']});}return _0x343ecf[0x0];}async['isAvailable'](_0x3dccaa){return(await this['getAvailableModels']())['some'](_0x38b105=>_0x38b105['name']===_0x3dccaa['name']&&_0x38b105['provider']===_0x3dccaa['provider']);}['_filterModels'](_0x408bc9,_0x3624a1){let _0x44b86f;if(_0x3624a1){_0x44b86f=[];const _0x56716b=new Set(),_0x1db8c1='string'==typeof _0x3624a1?[_0x3624a1['toLocaleLowerCase']()]:_0x3624a1['map'](_0xe8bf57=>_0xe8bf57['toLocaleLowerCase']());for(const _0x3d1693 of _0x1db8c1)for(const _0x47ab57 of _0x408bc9)!_0x56716b['has'](_0x47ab57['id'])&&this['_isMatchingFilter'](_0x47ab57,_0x3d1693)&&(_0x44b86f['push'](_0x47ab57),_0x56716b['add'](_0x47ab57['id']));}else _0x44b86f=_0x408bc9;return _0x44b86f;}['_isMatchingFilter'](_0x4e7530,_0x2a8176){const _0x4318b2=_0x4e7530['id']['toLocaleLowerCase'](),_0x5b01c5=_0x4e7530['name']['toLocaleLowerCase'](),_0x45333e=_0x4e7530['provider']['toLocaleLowerCase']();return _0x4318b2===_0x2a8176||_0x5b01c5===_0x2a8176||Bi(_0x4e7530)&&'auto'===_0x2a8176||_0x45333e===_0x2a8176||_0x4318b2['startsWith'](_0x2a8176);}['_getModelById'](_0x4c7f8d,_0x5d7145){return _0x4c7f8d['find'](_0x4fcd53=>Bi(_0x4fcd53)&&'auto'===_0x5d7145?_0x4fcd53:_0x4fcd53['id']===_0x5d7145)||null;}}function Bi(_0x3e1676){return _0x3e1676['id']['startsWith']('agent');}function T(_0x1b9a4c){if(_0x1b9a4c instanceof _0x50e0a9)return _0x1b9a4c;if(_0x1b9a4c?.['editors']&&_0x1b9a4c['editors']['get'](0x0))return _0x1b9a4c['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.'),_0x1b9a4c['editors']['get'](0x0);throw new _0x1a859a('ai-get-editor-from-context-no-editor');}function at({editor:_0x3e0800,interaction:_0x44f2ba,reply:_0xc266c9,groups:_0x5c4ddc,transform:_0x5c7b4a,documentCompare:_0x2f42d1,documentCompareOptions:_0x2891cf}){const _0x32163a=_0x44f2ba['getDocumentContext']();if(!_0x32163a)return[];const _0x203b5=_0x32163a['content'],_0xfeb1cd=_0x32163a['version'],_0x43cf02=_0xc266c9['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x5d7698}of _0x5c4ddc){const _0x329b3e=_0x5d7698['filter'](_0x61ee2e=>'new'!=_0x61ee2e['type'])['map'](_0x605fc3=>Ct('data-id',_0x605fc3['id'],_0x43cf02)),_0x5d5ae2=_0x5d7698['filter'](_0x3fd5eb=>'removed'!=_0x3fd5eb['type'])['map'](_0x370a6e=>_0x370a6e['node']['cloneNode'](!0x0));let _0x18f56d=null;if(_0x329b3e['length']){_0x18f56d=_0x329b3e[0x0]['previousSibling'];for(let _0x5c1268=0x0;_0x5c1268<_0x329b3e['length'];_0x5c1268++)_0x3d9e89(_0x329b3e[_0x5c1268]);}if(_0x5d5ae2['length']){_0x18f56d||(_0x5d7698[0x0]['anchorId']?_0x18f56d=Ct('data-id',_0x5d7698[0x0]['anchorId'],_0x43cf02):(_0x18f56d=_0x5d5ae2['shift'](),_0x211b53(_0x43cf02,_0x18f56d)));for(let _0x24f10b=0x0;_0x24f10b<_0x5d5ae2['length'];_0x24f10b++)_0x4b23c9(_0x18f56d,_0x5d5ae2[_0x24f10b]),_0x18f56d=_0x5d5ae2[_0x24f10b];}}const _0x2a8965=pt(_0x43cf02),_0x2f9eef=_0x2f42d1['getDiff'](_0x203b5,_0x2a8965,_0x2891cf)['getOperations']();if(_0x5c7b4a){const _0x538002=_0x3e0800['model']['document']['history']['getOperations'](_0xfeb1cd),_0xcdc972={'document':_0x3e0800['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return kt(_0x2f9eef,_0x538002,_0xcdc972)['operationsA'];}return _0x2f9eef;}function rt(_0x5ab322,_0x55af1c){if('marker'!=_0x55af1c['type'])return;const _0x4fc4e8=_0x5ab322['model']['markers']['get'](_0x55af1c['name']);_0x4fc4e8&&(_0x55af1c['oldRange']=_0x4fc4e8['getRange']());}class q extends _0x55a427{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[tt,ot];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new _0xa5a63b(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x42c400=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x39152a,_0x64255f)=>{this['_handleUIUserMessage']({'userMessage':_0x64255f});}),this['listenTo'](_0x42c400,'resizedTabs',(_0x55671e,_0x5f1e55)=>{this['_setIsMaximized'](_0x5f1e55);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x42c400['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x536f2a,_0x4df3c1)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x4df3c1));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x11b3e0,_0x5d0099)=>{this['activeConversation']?.['addUrlToContext'](_0x5d0099);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0xe60590,_0x49ebd4)=>{_0x49ebd4['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4866fa,_0xec4ae8)=>{this['activeConversation']?.['addResourceToContext'](_0xec4ae8['source'],_0xec4ae8['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x416a2d,_0x350cea)=>{this['_removeFromContext'](_0x350cea);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x157ced,_0x2a0b54)=>{this['activeConversation']?.['loadSourceResources'](_0x2a0b54['sourceId'],_0x2a0b54['query'],_0x2a0b54['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x55c0b6,_0x2a0638)=>{this['activeConversation']?.['setModel'](_0x2a0638);}),this['listenTo'](this['_aiChatUi'],'like',(_0xff277a,{replyId:_0x19ab5b})=>{console['log']('Liked\x20response',_0x19ab5b);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2390ae,{replyId:_0x40068b})=>{console['log']('Disliked\x20response',_0x40068b);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x556760,_0x10bb5f)=>{this['_insertSuggestion'](_0x10bb5f);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x50d695,{replyId:_0x891c21,partIndex:_0x2937d2})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x891c21,_0x2937d2);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x347bd3,{replyId:_0x12c398,partIndex:_0x40fa39})=>{const _0x3648d1=this['_getDocumentRangeForReplyChanges'](_0x12c398,_0x40fa39);_0x3648d1&&'$graveyard'!=_0x3648d1['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x3648d1['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x404822,_0x25f244)=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over'),this['_applySuggestion'](_0x25f244);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x37de1f,{replyId:_0x56cdaf,showDiff:_0x588163})=>{const {reply:_0x29c117}=this['getInteractionAndReplyById'](_0x56cdaf),_0x5064c3=_0x29c117['getContentParts']({'showDiff':_0x588163});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x29c117['id'],'parts':_0x5064c3,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x2e307b,{replyId:_0x18ad88,partIndex:_0x3e30f0})=>{this['_rejectSuggestion']({'replyId':_0x18ad88,'partIndex':_0x3e30f0}),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x55cac8,partIndex:_0x18eaa0}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5ad613}=this['getInteractionAndReplyById'](_0x55cac8),_0x61a92f=_0x5ad613['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x18eaa0});this['_aiChatBalloon']['updateContent']({'part':_0x61a92f[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x58ba6e,partIndex:_0x22c819}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x58ba6e,'partIndex':_0x22c819}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x52095c,partIndex:_0x436c73}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x52095c,'partIndex':_0x436c73}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x25c086,partIndex:_0x16b853}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x25c086,'partIndex':_0x16b853}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x4a70fa,partIndex:_0x215612}=this['_currentPreviewedChangeGroup'],_0xcbdecb=this['_getPresentableSiblingContentPartIndex'](_0x4a70fa,_0x215612,'next');null!==_0xcbdecb&&this['_openBalloonFor'](_0x4a70fa,_0xcbdecb);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x380102,partIndex:_0x7e7ccc}=this['_currentPreviewedChangeGroup'],_0x5bf510=this['_getPresentableSiblingContentPartIndex'](_0x380102,_0x7e7ccc,'previous');null!==_0x5bf510&&this['_openBalloonFor'](_0x380102,_0x5bf510);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x2763db,{id:_0x2c712b})=>{if('aiChatBalloon'!==_0x2c712b)return;const {replyId:_0x1b8e93,partIndex:_0x46a514}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1b8e93,'index':_0x46a514,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x50e0a9?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x289c9f,_0x5f3a63)=>{_0x5f3a63['on']('ready',()=>{this['_integrateEditor'](_0x5f3a63);});});const _0x471fc4=this['context']['config']['get']('ai.chat.initialConversation');let _0xda3ea8=_0x471fc4;if('lastCreated'!=_0x471fc4||(_0xda3ea8=await this['_getLastCreatedConversationId'](),_0xda3ea8))return'new'==_0xda3ea8?this['_startConversationSafely']():this['loadConversation'](_0xda3ea8);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_insertSuggestion'](_0xf4bfd6){const _0x44d2a8=T(this['context']);if(!_0x44d2a8['plugins']['has']('TrackChanges'))throw new _0x1a859a('ai-no-track-changes',null);const _0xb74e35=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x49faca,interaction:_0x171d25}=this['getInteractionAndReplyById'](_0xf4bfd6['replyId']),_0x354bee=this['_getDocumentRangeForReplyChanges'](_0xf4bfd6['replyId'],_0xf4bfd6['partIndex']),_0x427135=void 0x0!==_0xf4bfd6['partIndex']?[_0x49faca['changeGroups'][_0xf4bfd6['partIndex']]]:_0x49faca['changeGroups']['filter'](_0x34abf0=>'pending'==_0x34abf0['state']),_0x22ed82=_0x427135['map'](_0x528cfd=>_0x49faca['changeGroups']['indexOf'](_0x528cfd));if(!_0x354bee||'$graveyard'==_0x354bee['range']['root']['rootName'])return void _0x22ed82['forEach'](_0x28111c=>_0x49faca['setChangeGroupState'](_0x28111c,'outdated'));_0x22ed82['forEach'](_0x41c088=>_0x49faca['setChangeGroupState'](_0x41c088,'accepted'));const _0x479281=at({'editor':_0x44d2a8,'reply':_0x49faca,'interaction':_0x171d25,'groups':_0x427135,'transform':!0x0,'documentCompare':_0xb74e35,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x2f1f36;_0x354bee&&this['_scrollToSuggestionRange'](_0x354bee['range']),_0x44d2a8['model']['change'](_0x400de1=>{_0x2f1f36=_0x400de1['batch'],_0x44d2a8['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x479281),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x2f1f36,{'interactionId':_0x171d25['id'],'replyId':_0x49faca['id'],'indexes':_0x22ed82['slice']()}),this['_updateRatings'](_0x49faca);}['_applySuggestion'](_0xce8435){const _0x1e8c25=T(this['context']),_0x3ff4a9=this['context']['plugins']['get'](ot),{reply:_0x356af4,interaction:_0x1b464c}=this['getInteractionAndReplyById'](_0xce8435['replyId']),_0x34dd48=this['_getDocumentRangeForReplyChanges'](_0xce8435['replyId'],_0xce8435['partIndex']),_0x5dd36c=void 0x0!==_0xce8435['partIndex']?[_0x356af4['changeGroups'][_0xce8435['partIndex']]]:_0x356af4['changeGroups']['filter'](_0x17220b=>'pending'==_0x17220b['state']),_0x1c02bd=_0x5dd36c['map'](_0xc9c4cd=>_0x356af4['changeGroups']['indexOf'](_0xc9c4cd));if(!_0x34dd48||'$graveyard'==_0x34dd48['range']['root']['rootName'])return void _0x1c02bd['forEach'](_0xeb60b2=>_0x356af4['setChangeGroupState'](_0xeb60b2,'outdated'));_0x1c02bd['forEach'](_0x55d4cf=>_0x356af4['setChangeGroupState'](_0x55d4cf,'accepted'));const _0x3857da=at({'editor':_0x1e8c25,'reply':_0x356af4,'interaction':_0x1b464c,'groups':_0x5dd36c,'transform':!0x0,'documentCompare':_0x3ff4a9,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x128909;_0x34dd48&&this['_scrollToSuggestionRange'](_0x34dd48['range']),_0x1e8c25['model']['change'](_0x70f96e=>{_0x128909=_0x70f96e['batch'];for(const _0x5b5a15 of _0x3857da)_0x5b5a15['baseVersion']=_0x1e8c25['model']['document']['version'],rt(_0x1e8c25,_0x5b5a15),_0x70f96e['batch']['addOperation'](_0x5b5a15),_0x1e8c25['model']['applyOperation'](_0x5b5a15);}),this['_batchToChanges']['set'](_0x128909,{'interactionId':_0x1b464c['id'],'replyId':_0x356af4['id'],'indexes':_0x1c02bd['slice']()}),this['_updateRatings'](_0x356af4);}['_rejectSuggestion'](_0x112769){const {reply:_0x5c6d97}=this['getInteractionAndReplyById'](_0x112769['replyId']);_0x5c6d97['setChangeGroupState'](_0x112769['partIndex'],'rejected');}['_openBalloonFor'](_0x54d14f,_0x338753){if(!this['_aiChatBalloon'])return;const {reply:_0x301daa}=this['getInteractionAndReplyById'](_0x54d14f),_0x6a882a=_0x301daa['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x4dd354,_0x1fd4dd;if(void 0x0!==_0x338753?(_0x1fd4dd=_0x6a882a['find'](_0x171b0d=>_0x171b0d['index']==_0x338753),_0x4dd354=_0x1fd4dd?.['index']):(_0x1fd4dd=_0x6a882a[0x0],_0x4dd354=_0x1fd4dd['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x54d14f&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4dd354)return;const _0x21c31a=this['_getUserPresentableContentPartDocumentRange'](_0x54d14f,_0x301daa,_0x1fd4dd);if(!_0x21c31a)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x54d14f,'partIndex':_0x4dd354},this['_scrollToSuggestionRange'](_0x21c31a,!0x0);const _0x3aada0=this['_getPresentableSiblingContentPartIndex'](_0x54d14f,_0x4dd354,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1fd4dd,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x4dd354,'title':i(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x4dd354+0x1)['toString']()),'showRotator':null!==_0x3aada0,'ranges':[_0x21c31a],'areActionsDisabled':_0x301daa['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x54d14f,_0x4dd354),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x54d14f,'index':_0x4dd354,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x49bae3,_0x384d2a,_0x198533){const {reply:_0x21ecfa}=this['getInteractionAndReplyById'](_0x49bae3),_0x1de278=_0x21ecfa['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x1de278['length'])return null;const _0x49c4e5=_0x1de278['findIndex'](_0x39e1da=>_0x39e1da['index']==_0x384d2a),_0xba27f9='next'==_0x198533?0x1:-0x1;let _0x337575=_0x1de278['at']((_0x49c4e5+_0xba27f9)%_0x1de278['length'])['index'],_0x15bfa2=_0x1de278[_0x337575];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x49bae3,_0x21ecfa,_0x15bfa2);){if(_0x337575=_0x1de278['at']((_0x337575+_0xba27f9)%_0x1de278['length'])['index'],_0x337575===_0x49c4e5)return null;_0x15bfa2=_0x1de278[_0x337575];}return _0x337575;}['_getUserPresentableContentPartDocumentRange'](_0x273a7f,_0x2993cf,_0x4ae5fb){const _0x530a3d=_0x2993cf['changeGroups'];if(!_0x4ae5fb['hasChanges'])return null;const _0x3818e6=_0x530a3d['find'](_0x5758e9=>_0x5758e9['index']==_0x4ae5fb['index']);if('pending'!==_0x3818e6?.['state'])return null;const _0x1cb7c3=this['_getDocumentRangeForReplyChanges'](_0x273a7f,_0x4ae5fb['index']);if(!_0x1cb7c3)return null;const {range:_0x282a7c,currentIndex:_0x57585d}=_0x1cb7c3;return'$graveyard'==_0x282a7c['root']['rootName']?(_0x2993cf['setChangeGroupState'](_0x57585d,'outdated'),null):_0x1cb7c3['range'];}['_getDocumentRangeForReplyChanges'](_0x12189c,_0x3ce689){const _0x25af34=T(this['context']),{reply:_0x48fe5b,interaction:_0x222174}=this['getInteractionAndReplyById'](_0x12189c),_0xf96499=_0x48fe5b['changeGroups']['filter'](_0x213e86=>'pending'==_0x213e86['state']),_0x5afc0e=_0xf96499['map'](_0x2c4528=>_0x48fe5b['changeGroups']['indexOf'](_0x2c4528));void 0x0===_0x3ce689&&(_0x3ce689=_0x5afc0e[0x0]);const _0x2dabab=_0x5afc0e['indexOf'](_0x3ce689);if(-0x1==_0x2dabab)return null;const _0x4079db=_0xf96499[_0x2dabab],_0x122ea2=new _t([]),_0x1a5ce9=new _t([]);for(const _0x53f1b2 of _0x4079db['changes'])if('removed'!=_0x53f1b2['type']&&_0x1a5ce9['children']['push'](_0x53f1b2['node']['cloneNode'](!0x0)),'new'!=_0x53f1b2['type']){const _0x52c63c=gt(_0x1f6895=>ut(_0x1f6895,'data-id')==_0x53f1b2['id'],_0x48fe5b['documentContextContent'],!0x0);_0x122ea2['children']['push'](_0x52c63c['cloneNode'](!0x0));}if(0x0==_0x122ea2['children']['length']){if(_0x4079db['changes'][0x0]['anchorId']){const _0x255a4b=Ct('data-id',_0x4079db['changes'][0x0]['anchorId'],_0x48fe5b['documentContextContent']);_0x122ea2['children']['unshift'](_0x255a4b['cloneNode'](!0x0)),_0x1a5ce9['children']['unshift'](_0x255a4b['cloneNode'](!0x0)),_0x255a4b['nextSibling']&&(_0x122ea2['children']['push'](_0x255a4b['nextSibling']['cloneNode'](!0x0)),_0x1a5ce9['children']['push'](_0x255a4b['nextSibling']['cloneNode'](!0x0)));}else{const _0x12211a=_0x48fe5b['documentContextContent']['children'][0x0];if(!_0x12211a)return null;_0x122ea2['children']['push'](_0x12211a['cloneNode'](!0x0)),_0x1a5ce9['children']['push'](_0x12211a['cloneNode'](!0x0));}}const _0x260c76=_0x222174['getDocumentContext'](),_0x4d2e96=_0x25af34['data']['parse'](_0x260c76['content']),_0x3a62d9=pt(_0x122ea2),_0x3b0d18=_0x25af34['data']['parse'](_0x3a62d9),_0x2ea77d=_0x25af34['data']['parse'](_0x3a62d9),_0x395377=_0x25af34['model']['createPositionAt'](_0x3b0d18,0x0),_0x31127=pt(_0x1a5ce9),_0x2fca90={'anchor':_0x395377,'markDeletions':!0x1},_0x5247cd=_0x25af34['plugins']['get'](ot)['getDiff'](_0x3a62d9,_0x31127,_0x2fca90)['getOperations']();if(!_0x5247cd['length'])return null;_0x25af34['model']['change'](_0x29477c=>{for(const _0x44ffb4 of _0x5247cd)if('remove'==_0x44ffb4['type']){const _0x29963f=_0x44ffb4['sourcePosition'],_0x53b0ac=_0x44ffb4['howMany'],_0x55f777=new lt(_0x29963f,_0x53b0ac);_0x29477c['batch']['addOperation'](_0x55f777),_0x25af34['model']['applyOperation'](_0x55f777);}else'marker'!==_0x44ffb4['type']&&(_0x44ffb4['baseVersion']=null,_0x44ffb4['isDocumentOperation']=!0x1,_0x29477c['batch']['addOperation'](_0x44ffb4),_0x25af34['model']['applyOperation'](_0x44ffb4));});const _0x1bc2c5=ct(_0x25af34,_0x5247cd,_0x3b0d18);ht(_0x25af34['model'],_0x1bc2c5);const _0x4de027=_0x1bc2c5['getFirstRange']()['start']['path']['slice'](),_0x1c50c5=_0x1bc2c5['getFirstRange']()['end']['path']['slice'](),_0x2a1db9=[];let _0x1dc22c=_0x3b0d18,_0x168fbb=_0x2ea77d;for(let _0x393049=0x0;_0x393049<_0x1c50c5['length'];_0x393049++){const _0x48cb9a=_0x1dc22c['maxOffset']-_0x1c50c5[_0x393049];_0x2a1db9[_0x393049]=_0x168fbb['maxOffset']-_0x48cb9a,_0x1dc22c=_0x1dc22c['getChildAtOffset'](_0x1c50c5[_0x393049]),_0x168fbb=_0x168fbb['getChildAtOffset'](_0x2a1db9[_0x393049]);}const _0x31a25c=_0x25af34['model']['createRange'](_0x25af34['model']['createPositionFromPath'](_0x2ea77d,_0x4de027),_0x25af34['model']['createPositionFromPath'](_0x2ea77d,_0x2a1db9)),_0x2c1c63=_0x2ea77d['getChild'](0x0)['getAttribute'](nt),_0x11ea9a=Array['from'](_0x4d2e96['getChildren']())['find'](_0x1574fc=>_0x1574fc['getAttribute'](nt)==_0x2c1c63)['getPath'](),_0x55cbc1=_0x31a25c['start']['path']['slice'](),_0x3c475=_0x31a25c['end']['path']['slice']();_0x55cbc1[0x0]=_0x11ea9a[0x0]+_0x55cbc1[0x0],_0x3c475[0x0]=_0x11ea9a[0x0]+_0x3c475[0x0];let _0x98ffaf=_0x25af34['model']['createRange'](_0x25af34['model']['createPositionFromPath'](_0x25af34['model']['document']['getRoot'](),_0x55cbc1),_0x25af34['model']['createPositionFromPath'](_0x25af34['model']['document']['getRoot'](),_0x3c475));const _0x5457f1=_0x25af34['model']['document']['history']['getOperations'](_0x260c76['version']);for(const _0x2024c7 of _0x5457f1)_0x98ffaf=dt['_createFromRanges'](_0x98ffaf['getTransformedByOperation'](_0x2024c7));return{'range':_0x98ffaf,'currentIndex':_0x3ce689};}['_integrateEditor'](_0x12d176){if(!_0x12d176['plugins']['has']('Undo'))return;const _0x151293=_0x12d176['commands']['get']('undo'),_0x598c04=_0x12d176['commands']['get']('redo');this['listenTo'](_0x151293,'revert',(_0x44afb0,_0x287c65,_0x3ac762)=>{const _0x1dea72=this['_batchToChanges']['get'](_0x287c65);if(!_0x1dea72)return;const _0x300d32=this['activeConversation']['getInteraction'](_0x1dea72['interactionId'])['getReply'](_0x1dea72['replyId']);_0x1dea72['indexes']['forEach'](_0x106252=>_0x300d32['setChangeGroupState'](_0x106252,'pending')),this['_batchToChanges']['delete'](_0x287c65),this['_batchToChanges']['set'](_0x3ac762,_0x1dea72);}),this['listenTo'](_0x598c04,'revert',(_0x5e2fd2,_0x482dce,_0x4c711f)=>{const _0x5d9ac1=this['_batchToChanges']['get'](_0x482dce);if(!_0x5d9ac1)return;const _0x11dbd8=this['activeConversation']['getInteraction'](_0x5d9ac1['interactionId'])['getReply'](_0x5d9ac1['replyId']);_0x5d9ac1['indexes']['forEach'](_0x562e87=>_0x11dbd8['setChangeGroupState'](_0x562e87,'accepted')),this['_batchToChanges']['delete'](_0x482dce),this['_batchToChanges']['set'](_0x4c711f,_0x5d9ac1);});}async['loadConversation'](_0x31f29a){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](it)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x31f29a)['getConversation'](),await this['_startConversationSafely'](_0x31f29a),this['updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x31f29a,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x388cb3){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x31f29a}),this['_logError'](new _0x1a859a('ai-chat-conversation-not-found',this,{'error':_0x388cb3}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}async['_getLastCreatedConversationId'](){const _0xa96cb=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5461b1=await _0xa96cb['getConversations']();return _0x5461b1['length']?_0x5461b1[0x0]['id']:'new';}catch(_0x3de3a7){return this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x36c3ed()}),this['_logError'](new _0x1a859a('ai-chat-conversation-init-failed',this,{'error':_0x3de3a7})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}['handleRemovedConversation'](_0x12877c){this['activeConversation']['id']===_0x12877c&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x429b33=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x429b33),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x503d89,attributes:_0x1fa524}){await this['_handleUIUserMessage']({'userMessage':_0x503d89,'attributes':_0x1fa524});}['getGroupId'](){const _0x4a1144=this['context']['config']['get']('collaboration.channelId');if(!_0x4a1144)throw new _0x1a859a('ai-chat-missing-channel-id',this);return _0x4a1144;}async['_startConversationSafely'](_0x46a331){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x46a331);}catch(_0x34ad0f){this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x46a331||_0x36c3ed()}),console['error'](_0x34ad0f),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x260089){let _0x32633b;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x260089||!this['activeConversation']?_0x32633b=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x32633b=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x4c2703=this['getGroupId'](),_0x37f7c8=_0x260089||_0x36c3ed();this['activeConversation']=new st({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x32633b,'conversationId':_0x37f7c8,'group':_0x4c2703,'getEditor':()=>T(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x6bbda1,_0x2d4b5c)=>{this['_aiChatUi']['createConversation'](_0x2d4b5c),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x260089||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](i(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x444174,_0x10cb90)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x10cb90['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x51238e,_0xb408e5)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0xb408e5);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2023cf=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2023cf);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x441b7a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x441b7a);}),this['activeConversation']['on']('webSearchFinished',(_0x2c58d0,_0x493596)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x493596,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x5d6029,_0x360d63)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x360d63,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['delegate']('toolDataReceived')['to'](this),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1f311e,_0x119eb7)=>{this['_aiChatUi']['removeFeedInteraction'](_0x119eb7['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x5b0120,_0xf0ef61,_0x5d68fb)=>{this['updateConversationTitle'](_0xf0ef61,_0x5d68fb);}),this['activeConversation']['on']('replyCreated',(_0x111f3d,_0x5aa3ec)=>{'text'===_0x5aa3ec['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5aa3ec):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5aa3ec);}),this['activeConversation']['on']('replyContentUpdated',async(_0x8ebea9,_0x56d9f4)=>{await this['_updateReplyContent']({'reply':_0x56d9f4});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x5a7d79,{reply:_0x45b9bd,index:_0x3f2990,state:_0x26cf72})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x45b9bd['id'],'index':_0x3f2990,'state':_0x26cf72}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x45b9bd['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3f2990&&this['_aiChatBalloon']?.['setState'](_0x26cf72);}),this['activeConversation']['on']('contextItemAdded',(_0x7fc3b3,_0x1495fb)=>{if(this['_aiChatUi']['addContextItem'](_0x1495fb['contextItem'],_0x1495fb['isLoading']),'selection'===_0x1495fb['contextItem']['type']){const _0x2dd9ce=[...T(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2dd9ce,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x52c2bc,_0x23e815)=>{this['_aiChatUi']['removeContextItem'](_0x23e815['uiId']),'current-document'==_0x23e815['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x23e815['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3ddd39,_0x329269)=>{this['_aiChatUi']['setContextItemLoading'](_0x329269['contextItem']['uiId'],_0x329269['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x3a7ce3,_0x1d2b64)=>{this['_aiChatUi']['setConversationContext'](_0x1d2b64['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x49ea21,_0x5c3c01)=>{this['_aiChatUi']['setAddContextOptions'](_0x5c3c01['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x123f9,_0x5b8534)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5b8534['sourceId'],_0x5b8534['source'],_0x5b8534['resources'],_0x5b8534['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x29ea6e,_0x18b09d)=>{this['_aiChatUi']['updateResourceState'](_0x18b09d['sourceId'],_0x18b09d['resourceId'],_0x18b09d['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x4ed314,_0xe6d5a0)=>{this['_aiChatUi']['updateCapabilities'](_0xe6d5a0);}),this['activeConversation']['on']('modelSelected',async(_0x547c8e,_0x372379)=>{const _0x3b8e68=(await this['_aiChatModels']['getAll']())['find'](_0x196fa3=>_0x196fa3['id']===_0x372379['selectedModel']['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3b8e68,_0x372379['isDisabled']);}),this['activeConversation']['on']('error',(_0x45691f,{error:_0xd4885c,interactionId:_0xca95a,fileName:_0xff0917,url:_0x2d130b,sourceId:_0x59db86,sourceLabel:_0x414f7a})=>{const _0x4bab06=_0xca95a?_0xca95a+':'+_0x36c3ed():_0x36c3ed();_0xd4885c['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':i(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4bab06}):_0xd4885c['message']['startsWith']('ai-chat-conversation-init-failed')||_0xd4885c['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0xff0917),'id':_0x4bab06}):_0xd4885c['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x2d130b),'id':_0x4bab06}):_0xd4885c['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4bab06}):_0xd4885c['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4bab06}):_0xd4885c['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x59db86&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x59db86),this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x414f7a||'source'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):_0xd4885c['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x4bab06}),this['_logError'](_0xd4885c)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':i(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4bab06}),this['_logError'](_0xd4885c));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x260089||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2e0040,attributes:_0x2d8c47}){if(!this['activeConversation'])throw new _0x1a859a('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x4ddcea=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x4ddcea);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2e0040,'attributes':_0x2d8c47});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0xd1188b){this['_aiChatUi']['setIsMaximized'](_0xd1188b);}['_logError'](_0x4235be){_0x42b6c9(_0x4235be['message']);}['_removeFromContext'](_0x153c4e){this['activeConversation']?.['removeFromContext'](_0x153c4e);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5c41c3){const [_0x5d895e,_0x7ad3cf]=_0x5c41c3['split'](':'),_0x2fabed=this['activeConversation']['getInteraction'](_0x5d895e),_0x5eef94=_0x2fabed['getReply'](_0x7ad3cf);return{'interaction':_0x2fabed,'reply':_0x5eef94};}['_scrollToSuggestionRange'](_0x9e052a,_0x4ccccc=!0x1){const _0x43e593=T(this['context']),_0x2727eb={'target':_0x43e593['editing']['view']['domConverter']['viewRangeToDom'](_0x43e593['editing']['mapper']['toViewRange'](_0x9e052a)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x4ccccc};_0x4ccccc&&(_0x2727eb['alignToTop']=!0x0),_0x2b7d47(_0x2727eb);}['updateConversationTitle'](_0x4bf6dd,_0x5b5c08=!0x1){this['_aiChatUi']['setConversationTitle'](_0x4bf6dd||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5b5c08);}async['_updateReplyContent']({reply:_0x46533c,renderingStrategy:_0xb98a4e}){const {id:_0x43bcbf,interactionId:_0xaef0e0,isDone:_0x4b24a1,type:_0x43889d,parsedContent:_0x1763d5}=_0x46533c,_0x5f324b=_0xaef0e0+':'+_0x43bcbf;if('modification'===_0x43889d){const _0x22551b=_0x46533c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5f324b,'parts':_0x22551b,'renderingStrategy':_0xb98a4e,'isDone':_0x4b24a1});}else'text'===_0x43889d&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5f324b,'parsedContent':_0x1763d5,'renderingStrategy':_0xb98a4e,'isDone':_0x4b24a1});_0x4b24a1&&_0x46533c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5f324b,_0x46533c['sources']);}async['_stopLastInteraction'](){const _0x5ae058=this['activeConversation']?.['lastInteraction'];_0x5ae058&&(_0x5ae058['stop'](),this['_aiChatUi']['stopInteraction'](_0x5ae058));}async['_flushLastInteractionUI'](){const _0x449a94=this['activeConversation']?.['lastInteraction'];if(_0x449a94){for await(const _0x4d7a99 of _0x449a94['replies'])await this['_updateReplyContent']({'reply':_0x4d7a99,'renderingStrategy':'static'});}}['_updateRatings'](_0x247319){const _0x421726={'positiveCount':_0x247319['changeGroups']['filter'](_0x2e85a8=>'accepted'===_0x2e85a8['state'])['length'],'totalCount':_0x247319['changeGroups']['length'],'modificationId':_0x247319['id']},_0x5e2cf1=this['activeConversation']['getInteraction'](_0x247319['interactionId'])['messageId'];_0x5e2cf1&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5e2cf1,_0x421726);}['_registerToolDataCallback'](_0x8d5276){let _0x51da5e=null,_0x3e44e8=null;this['on']('toolDataReceived',(_0x2a713b,_0x3df76f,_0x58b679)=>{_0x58b679['id']!==_0x51da5e&&(_0x51da5e=_0x58b679['id'],_0x3e44e8=this['_getAIChatInteractionAPI'](_0x58b679)),_0x8d5276(_0x3df76f,_0x3e44e8);});}['_getAIChatInteractionAPI'](_0x48bc66){const _0x11420c=this['_aiChatUi'],_0x3270ee=()=>{_0x48bc66['resetWebSearchState'](),_0x48bc66['resetReasoningState'](),_0x11420c['clearLoadingMessage']();},_0x2a3575=()=>{_0x48bc66['currentReply']&&(_0x48bc66['currentReply']['done'](),_0x48bc66['currentReply']=void 0x0);};return{'insertTextReply':(_0x3e9314,_0x47e798)=>{_0x2a3575(),_0x3270ee();const _0x272236=_0x48bc66['currentReply']=_0x48bc66['createReply']({'type':'text','interactionId':_0x48bc66['id'],'content':_0x3e9314,'id':_0x47e798||_0x36c3ed()});return _0x2a3575(),_0x272236;},'insertCustomElement':async(_0x56f099,_0x1e75dc)=>(_0x2a3575(),_0x3270ee(),_0x11420c['addFeedItemCustomElement'](_0x56f099,_0x1e75dc||_0x36c3ed())),'setLoadingMessage':_0x44185e=>{_0x11420c['setLoadingMessage'](_0x44185e);},'clearLoadingMessage':()=>{_0x11420c['clearLoadingMessage']();}};}}const R='ai-selection';class D extends _0x55a427{constructor(_0x34066c){super(_0x34066c),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_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 _0x4c1965=T(this['context']),_0x4b82b1=_0x4c1965['plugins']['has']('RealTimeCollaborationClient')&&_0x4c1965['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4b82b1||_0x36c3ed();}return this['_sessionId'];}async['getDocumentData'](){const _0x5e2041=T(this['context']),_0x5b874c=_0x5e2041['model'],_0x3cbe54=_0x5e2041['data']['toView'](_0x5b874c['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x4e065e=new Dt(_0x5e2041['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3cbe54,_0x4e065e);let _0x15fc70=await this['_getDocumentDataStringFromView'](_0x3cbe54);const _0x10382a=this['_getMarkersInDocumentOrder'](),_0x41b820=[];for(const _0x472d92 of _0x10382a){const _0x576889='<'+_0x472d92['name']+':start></'+_0x472d92['name']+':start>',_0x5d4117=_0x15fc70['indexOf'](_0x576889);_0x15fc70=_0x15fc70['substring'](0x0,_0x5d4117)+_0x15fc70['substring'](_0x5d4117+_0x576889['length']);const _0x3507d8='<'+_0x472d92['name']+':end></'+_0x472d92['name']+':end>',_0x1a7301=_0x15fc70['indexOf'](_0x3507d8);_0x15fc70=_0x15fc70['substring'](0x0,_0x1a7301)+_0x15fc70['substring'](_0x1a7301+_0x3507d8['length']),_0x41b820['push']({'markerName':_0x472d92['name'],'start':_0x5d4117,'end':_0x1a7301,'htmlFragment':_0x15fc70['substring'](_0x5d4117,_0x1a7301)});}return{'content':_0x15fc70,'version':_0x5e2041['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x41b820};}async['afterInit'](){this['context']instanceof _0x50e0a9?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x47e57e,_0x5f1b96)=>{_0x5f1b96['on']('ready',()=>{this['_integrateEditor'](_0x5f1b96);});});}['_setOutputDataProcessor'](_0x2916fd){this['_outputDataProcessor']=_0x2916fd;}async['_getDocumentDataStringFromView'](_0x3de8f7){let _0x473608;const _0xd8c80d=T(this['context']);if(this['_outputDataProcessor']){const _0x115bb9=_0xd8c80d['data']['processor']['domConverter']['viewToDom'](_0x3de8f7),_0x475230=await this['_outputDataProcessor'](_0x115bb9);_0x473608=_0xd8c80d['data']['processor']['htmlWriter']['getHtml'](_0x475230);}else _0x473608=_0xd8c80d['data']['processor']['toData'](_0x3de8f7);return _0x473608;}['_integrateEditor'](_0x298706){_0x298706['conversion']['for']('editingDowncast')['markerToHighlight']({'model':R,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x298706['conversion']['for']('dataDowncast')['markerToElement']({'model':R,'view':(_0x5488a7,{writer:_0x1f481e,options:_0x56d0d9})=>_0x56d0d9['convertAiChatSelectionMarker']?_0x1f481e['createUIElement'](_0x5488a7['markerName']+':'+(_0x5488a7['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x156509,_0x1f342c,_0x4290f3=!0x1,_0x47b37c=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x47b37c)return!0x1;const _0x2f9d59=T(this['context'])['model'];return _0x2f9d59['change'](_0x526680=>{this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x1f342c,this['_displayedFakeSelectionLocked']=_0x4290f3;let _0x2ec26c=0x0;for(let _0x15842e of _0x156509){const _0x4745c3=R+':'+_0x2ec26c;if(_0x15842e['start']['isAtEnd']){const _0x2002ab=_0x15842e['start']['getLastMatchingPosition'](({item:_0x353aed})=>!_0x2f9d59['schema']['isContent'](_0x353aed),{'boundaries':_0x15842e});_0x15842e=_0x526680['createRange'](_0x2002ab,_0x15842e['end']);}_0x526680['addMarker'](_0x4745c3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x15842e}),_0x2ec26c++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3000f1){if(this['_displayedFakeSelectionId']!=_0x3000f1)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x2097c7=T(this['context']),_0x25550e=_0x2097c7['model']['markers']['getMarkersGroup'](R);return _0x2097c7['model']['change'](_0x22005f=>{for(const _0x2bcc93 of _0x25550e)_0x22005f['removeMarker'](_0x2bcc93);}),!0x0;}async['modelToDataWithIds'](_0x3ba2e6){const _0xf66e6d=T(this['context']),_0xe28108=_0xf66e6d['data']['toView'](_0x3ba2e6),_0x29c31e=new Dt(_0xf66e6d['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0xe28108,_0x29c31e),this['_getDocumentDataStringFromView'](_0xe28108);}['_setDataIdsOnChildren'](_0xeae7e3,_0x419dbd){let _0x2560c7=!0x1;const _0x50b884=new Set();for(const _0x433e97 of _0xeae7e3['getChildren']()){const _0x5e424a=_0x433e97['is']('emptyElement')||_0x433e97['is']('containerElement');if(!_0x433e97['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x433e97,_0x419dbd)||_0x5e424a)&&(_0x419dbd['setAttribute']('data-id',this['_nextDataId'](_0x50b884),_0x433e97),_0x2560c7=!0x0);}return _0x2560c7;}['_nextDataId'](_0xe1c3ab){let _0x1d6e22;do{_0x1d6e22='';for(let _0xcccb74=0x0;_0xcccb74<0x4;_0xcccb74++)_0x1d6e22+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xe1c3ab['has'](_0x1d6e22));return _0xe1c3ab['add'](_0x1d6e22),_0x1d6e22;}['getSelectionText'](){const {model:_0x3c6831}=T(this['context']),_0x29e168=_0x3c6831['document']['selection'],_0x21fceb=_0x3c6831['getSelectedContent'](_0x29e168),_0x34fd32=[],_0x30d410=_0x3c6831['createRangeIn'](_0x21fceb)['getWalker']();for(const {item:_0x27b990}of _0x30d410)_0x27b990['is']('$textProxy')?_0x34fd32['push'](_0x27b990['data']):_0x27b990['is']('element')&&_0x34fd32['length']>0x0&&'\x20'!==_0x34fd32[_0x34fd32['length']-0x1]&&_0x34fd32['push']('\x20');return'\x22'+_0x34fd32['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x30946e=T(this['context'])['model'];return Array['from'](_0x30946e['markers']['getMarkersGroup'](R))['sort']((_0x28e041,_0x3668d3)=>_0x28e041['getStart']()['isBefore'](_0x3668d3['getStart']())?-0x1:_0x28e041['getStart']()['isAfter'](_0x3668d3['getStart']())?0x1:0x0);}}const W=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Rt=[...W,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class ha{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x19e419){this['options']={'delay':_0x19e419['delay']??0x14,'textNodeStyle':_0x19e419['textNodeStyle'],'onStreamUpdate':_0x19e419['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2a79f9,targetElement:_0x11dbd7,abortSignal:_0x5929bc}){this['isStreaming']&&this['stop'](),_0x5929bc?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x133e70(_0x2a79f9,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x164c2e=0x0;_0x164c2e<this['currentIndex'];_0x164c2e++)this['nodesList'][_0x164c2e]['shouldBeStreamed']=!0x0;do{const _0x46c6a9=Date['now'](),_0x482010=this['nodesList'][this['currentIndex']],_0x333c4b=_0x46c6a9-this['lastUpdateTime'];if(_0x482010){_0x482010['shouldBeStreamed']=!0x0;let _0x9cef1a=_0x482010['parent'];for(;_0x9cef1a;)_0x9cef1a['shouldBeStreamed']=!0x0,_0x9cef1a=_0x9cef1a['parent'];}if(_0x333c4b<this['options']['delay'])try{const {promise:_0x71a08e,abortController:_0x1534b8}=Cs(this['options']['delay']-_0x333c4b);this['timeoutAbortController']=_0x1534b8,await _0x71a08e;}catch(_0x140324){return;}_0xf4f147(_0x11dbd7,'<'+_0x11dbd7['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x11dbd7['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x2caa42}){Array['from'](_0x2caa42['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4b5194=>{_0x4b5194['replaceWith'](_0x4b5194['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x59653b){let _0x294f5a='';if(function(_0x5437b){return _0x2a03c(_0x5437b);}(_0x59653b)){for(const _0x97ac6f of _0x59653b['children'])_0x294f5a+=this['renderNode'](_0x97ac6f);}else{if(Ts(_0x59653b)){if(!_0x59653b['shouldBeStreamed'])return'';const _0x1a4d04=_0x59653b,_0x316396=Object['entries'](_0x1a4d04['attribs'])['map'](([_0x14c1e2,_0x483521])=>_0x14c1e2+'=\x22'+_0x483521+'\x22')['join']('\x20');_0x294f5a+='<'+_0x1a4d04['tagName']+(_0x316396?'\x20'+_0x316396:'')+'>';for(const _0x1e8171 of _0x352c42(_0x1a4d04))_0x294f5a+=this['renderNode'](_0x1e8171);_0x294f5a+='</'+_0x1a4d04['tagName']+'>';}else{if(!Ss(_0x59653b))return'';if(!_0x59653b['shouldBeStreamed'])return'';!function(_0x173daf){if(!_0x173daf['parent']||!Ts(_0x173daf['parent']))return!0x1;if(!ys['includes'](_0x173daf['parent']['tagName']))return!0x1;return!_0x59c2b1(_0x173daf)['match'](/^\s*[<>]\s*$/);}(_0x59653b)?_0x294f5a+=_0x41ec78(_0x59653b):_0x294f5a+=_0x41ec78(new _0xd483af('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x59653b]));}}return _0x294f5a;}['getParsedDocumentNodeList'](){const _0x4e9667=[];return function(_0x130ddb,_0x56d060){const _0x395e8a=_0x5411ff=>{if(_0x56d060(_0x5411ff),_0x5411ff instanceof _0xd5d578)for(let _0x2e885c=0x0;_0x2e885c<_0x5411ff['children']['length'];_0x2e885c++){const _0x25c9fd=_0x5411ff['children'][_0x2e885c];_0x395e8a(_0x25c9fd);}};for(let _0x396045=0x0;_0x396045<_0x130ddb['children']['length'];_0x396045++)_0x395e8a(_0x130ddb['children'][_0x396045]);}(this['document'],_0x55ede6=>{if(Ss(_0x55ede6)){const _0x52a104=this['splitTextNodeIntoWordNodes'](_0x55ede6);_0x52a104['length']&&_0x4e9667['push'](..._0x52a104);}_0x55ede6['isWordSplitSource']||_0x55ede6['isWordSplitResult']||_0x4e9667['push'](_0x55ede6);}),_0x4e9667;}['splitTextNodeIntoWordNodes'](_0x393611){if(_0x393611['isWordSplitSource']||_0x393611['isWordSplitResult'])return[];const _0xb08b38=_0x59c2b1(_0x393611)['match'](/(?:\s*\S+\s*)/g),_0xacea73=[];if(_0xb08b38&&_0xb08b38['length']>0x1){for(const _0x406af1 of _0xb08b38){const _0x5ca394=new _0x11c603(_0x406af1);_0x5ca394['isWordSplitResult']=!0x0,_0x5998b9(_0x393611,_0x5ca394),_0xacea73['push'](_0x5ca394);}_0x393611['isWordSplitSource']=!0x0,_0x3d9e89(_0x393611);}return _0xacea73;}}const ys=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function Ss(_0x5f1857){return _0x3406d7(_0x5f1857);}function Ts(_0x203724){return _0x3f3ba2(_0x203724);}function Cs(_0x4e0bcb){const _0x36054c=new AbortController();return{'promise':new Promise((_0x2625ce,_0x5a3f28)=>{const _0x30819c=setTimeout(_0x2625ce,_0x4e0bcb);_0x36054c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x30819c),_0x5a3f28();});}),'abortController':_0x36054c};}class Fr extends _0x2f8c3b{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x176ce5){super();const _0x26fde8=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x176ce5,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x26fde8['if']('isDone','ck-ai-chat__feed__item_done'),_0x26fde8['if']('isVisible','ck-hidden',_0x54b7ce=>!_0x54b7ce),'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'](_0x532774=>{_0x532774['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x1ceb55,_0x5b65b2,_0x11e389){await this['htmlStreamer']['stream']({'document':_0x1ceb55,'targetElement':_0x5b65b2,'abortSignal':_0x11e389});}}class gh extends _0x2f8c3b{['showChangesToggleView'];constructor(_0x313d50,_0x5a3ef8){super(_0x313d50),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Yn(_0x313d50),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button','label':i(_0x313d50,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5a3ef8['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x18b176=>_0x18b176?_0x550b79:_0xb1603a),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x38cfc3=new _0x32da72();_0x38cfc3['content']=_0x1cdbdb,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5a3ef8['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x38cfc3,{'tag':'span','children':[i(_0x313d50,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Yn extends _0x5822be{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const $n={'accepted':_0x3f2d4f,'rejected':_0x1b517b,'outdated':_0x1b517b};class ps extends _0x2f8c3b{['stateIconView'];constructor(_0x569c86){super(_0x569c86);const _0x8ebeed=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new qn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x8ebeed['to']('state',_0x4e2008=>'ck-ai-suggestion__content-part-state_'+_0x4e2008),_0x8ebeed['if']('isVisible','ck-hidden',_0x285847=>!_0x285847)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x8ebeed['to']('state',_0x385b6a=>{switch(_0x385b6a){case'accepted':return i(_0x569c86,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return i(_0x569c86,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return i(_0x569c86,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0xfe4cc9){this['state']=_0xfe4cc9;}}class qn extends _0x32da72{constructor(){super(),this['set']('state','accepted'),this['content']=$n[this['state']],this['on']('change:state',()=>{this['content']=$n[this['state']];});}}class us extends _0x191b6d{['_applyButton'];['_suggestButton'];constructor(_0x2995de,_0x3ae0d0,_0x3d47f0){super(_0x2995de);const _0x4abc6d=Boolean(_0x3d47f0);this['set']('isEnabled',!_0x4abc6d),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4d300d=[];if(_0x4abc6d){const _0x234292=new _0x5822be(_0x2995de);_0x234292['set']({'label':i(_0x2995de,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3965f3}),_0x4d300d['push'](_0x234292);}else{_0x3ae0d0['includes']('applySuggestion')&&(this['_applyButton']=new _0x5822be(_0x2995de),this['_applyButton']['set']({'label':i(_0x2995de,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3f2d4f}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4d300d['push'](this['_applyButton'])),_0x3ae0d0['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x5822be(_0x2995de),this['_suggestButton']['set']({'label':i(_0x2995de,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3d36d7}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4d300d['push'](this['_suggestButton']));const _0x22d8be=new _0x5822be(_0x2995de);_0x22d8be['set']({'label':i(_0x2995de,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1b517b}),_0x22d8be['bind']('isEnabled')['to'](this),_0x22d8be['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4d300d['push'](_0x22d8be);}this['items']['addMany'](_0x4d300d);const _0x3812d9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x3812d9['if']('isVisible','ck-hidden',_0x531a0a=>!_0x531a0a)]}});}['setButtonsVisibility']({showApplyButton:_0x450c03,showSuggestButton:_0x79ec2e}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x450c03),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x79ec2e);}}class vn extends _0x2f8c3b{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3eb735,{part:_0x575693,uiIndex:_0x1a6f20,availableActions:_0x19b7a6,areActionsDisabled:_0x231fe7}){super(_0x3eb735),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new us(_0x3eb735,_0x19b7a6,_0x231fe7),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x575693['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x575693['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x575693['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new ps(_0x3eb735),this['titleLabelView']=new Sn(_0x3eb735,_0x1a6f20),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x4b3f51,_0x4836d2,_0xb99937,_0x2a8551)=>{'pending'===_0x2a8551?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xb99937?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xb99937),this['children']['add'](this['stateView']));});}}class Sn extends _0x2f8c3b{constructor(_0xec31d3,_0x1bab1d){super(_0xec31d3),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[i(_0xec31d3,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x1bab1d['toString']())]});}}class cs extends _0x2f8c3b{['htmlStreamer'];constructor(_0x2c2c73){super(_0x2c2c73),this['htmlStreamer']=new ha({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x2d456a,renderingStrategy:_0x5b51ec,abortSignal:_0x1fa10e}){'streaming'===_0x5b51ec?await this['htmlStreamer']['stream']({'document':_0x2d456a['content'],'targetElement':this['element'],'abortSignal':_0x1fa10e}):this['element']['innerHTML']=pt(_0x2d456a['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class na extends _0x2f8c3b{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x290e08,{part:_0xa9c85e,uiIndex:_0x5d21d2,areActionsDisabled:_0x88d8ec,availableActions:_0x3e7d86}){super(_0x290e08);const _0xc42c39=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x59ed87=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x88d8ec;};this['on']('change:state',_0x59ed87),this['on']('change:isDone',_0x59ed87),_0x59ed87(),this['_children']=this['createCollection'](),this['_headerView']=new vn(_0x290e08,{'part':_0xa9c85e,'uiIndex':_0x5d21d2,'availableActions':_0x3e7d86,'areActionsDisabled':_0x88d8ec}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...W)['to'](this),this['_streamableContentView']=new cs(_0x290e08),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0xc42c39['to']('state',_0x55cbc6=>'ck-ai-suggestion__body__content-part_'+_0x55cbc6),_0xc42c39['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0xc42c39['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0xc42c39['if']('isVisible','ck-hidden',_0x3dd28a=>!_0x3dd28a)]},'children':this['_children'],'on':{'mouseenter':_0xc42c39['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0xa9c85e['index']});}),'mouseleave':_0xc42c39['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0xa9c85e['index']});}),'click':_0xc42c39['to'](_0x3c84e3=>{const _0x3a9472=_0x3c84e3['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3a9472)&&this['fire']('showChangeInText',{'index':_0xa9c85e['index']});})}});}async['updateContent']({part:_0x32a495,renderingStrategy:_0x446322,showUnchangedParts:_0x5e2302=!0x1,abortSignal:_0x620833}){this['partDefinition']=_0x32a495,this['isVisible']=this['partDefinition']['hasChanges']||_0x5e2302,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x32a495,'renderingStrategy':_0x446322,'abortSignal':_0x620833});}['markAsDone'](){this['isDone']=!0x0;}}class St extends _0x263abf(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x46bf01){const _0x149048=this['createTask'](_0x46bf01);return this['queue']['push'](_0x149048),this['_processQueue'](),_0x149048['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(_0x17bd55=>{this['once']('_queueEmpty',()=>{_0x17bd55();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x348a05=this['queue']['shift']();try{await _0x348a05['callback'](this['_abortController']['signal']),_0x348a05['resolve']();}catch(_0x377eb7){_0x348a05['reject'](_0x377eb7);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3428c9){let _0x204acd,_0x1bb78c;const _0x5a26de=new Promise((_0x50a0fa,_0x1bd7f7)=>{_0x204acd=_0x50a0fa,_0x1bb78c=_0x1bd7f7;});return{'callback':_0x3428c9,'resolve':_0x204acd,'reject':_0x1bb78c,'completePromise':_0x5a26de};}}class Ye extends Fr{constructor(_0x3a4e23){super(_0x3a4e23),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3a4e23['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x19cc26){this['element']['innerHTML']=_0x19cc26;}}const J=['applySuggestion','insertSuggestion'];class ra extends _0x2f8c3b{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3f9df8,_0x2a0787=[...J],_0x1e8a1d){super(_0x3f9df8);const _0x1c0450=this['bindTemplate'],_0x1589ae=Boolean(_0x1e8a1d);if(this['set']('isEnabled',!_0x1589ae),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1589ae){const _0x154872=new _0x5822be(_0x3f9df8);_0x154872['set']({'label':i(_0x3f9df8,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3965f3});const _0x31d7f9=new _0x2f8c3b(_0x3f9df8);_0x31d7f9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[i(_0x3f9df8,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x154872]}]}),this['children']['add'](_0x31d7f9);}else this['_applyChangesButton']=new _0x5822be(_0x3f9df8),this['_applyChangesButton']['set']({'label':i(_0x3f9df8,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2a0787['includes']('applySuggestion'),'class':'ck-ai-button-primary'}),this['_insertSuggestionsButton']=new _0x5822be(_0x3f9df8),this['_insertSuggestionsButton']['set']({'label':i(_0x3f9df8,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2a0787['includes']('insertSuggestion'),'class':'ck-ai-button-secondary'}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3dafa3=>{_0x3dafa3['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x1c0450['if']('isVisible','ck-hidden',_0x2f377b=>!_0x2f377b)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5001d8){this['isVisible']=_0x5001d8;}['_switchButtonLabelsPlurality'](_0xfdcd){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xfdcd?(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=i(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sr extends _0x2f8c3b{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x1de115,_0x2b13b0){super(_0x1de115),this['bodyCollection']=_0x2b13b0,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',_0x197b62=>!_0x197b62)]},'children':this['children']});const _0x56ce94=new _0x2f8c3b(this['locale']),_0x42d80d=new _0x32da72();_0x42d80d['content']=_0x36ce2a,_0x56ce94['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x42d80d,{'tag':'span','children':[{'text':i(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x56ce94),this['_setupBalloonPanel'](_0x1de115);}['addSource'](_0xef6d0){this['children']['add'](new qr(this['locale'],_0xef6d0,this['balloonPanelView']));}['_setupBalloonPanel'](_0x2919c5){this['balloonPanelView']=new _0x331ccd(_0x2919c5),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class qr extends _0x5822be{['balloonPanelView'];['source'];constructor(_0x337a18,_0x2241ab,_0x341574){super(_0x337a18),this['source']=_0x2241ab,this['balloonPanelView']=_0x341574,this['set']({'label':_0x2241ab['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x40d9f3=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x40d9f3['to'](()=>{window['open'](_0x2241ab['url'],'_blank');}),'mouseenter':_0x40d9f3['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x40d9f3['to'](()=>{this['_hideTooltip']();})}}),_0x2241ab['favicon']){const _0x184a89=new _0x2f8c3b(_0x337a18);_0x184a89['setTemplate']({'tag':'img','attributes':{'src':_0x2241ab['favicon']||_0x36ce2a,'alt':_0x2241ab['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x184a89);}else this['set']('icon',_0x36ce2a);}['_createTooltipContentView'](_0x4c68f6,_0x10039f){const _0x465af8=new _0x2f8c3b(_0x4c68f6),_0x4d0227=[];let _0x5e8076;_0x10039f?.['favicon']?(_0x5e8076=new _0x2f8c3b(_0x4c68f6),_0x5e8076['setTemplate']({'tag':'img','attributes':{'src':_0x10039f['favicon'],'alt':_0x10039f['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x5e8076=new _0x32da72(),_0x5e8076['content']=_0x36ce2a,_0x5e8076['extendTemplate']({'attributes':{'alt':_0x10039f['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4d0227['push'](_0x5e8076);const _0x514bfd=new _0x2f8c3b(_0x4c68f6);_0x514bfd['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x10039f['url']},'children':[{'text':new URL(_0x10039f['url'])?.['hostname']}]}),_0x4d0227['push'](_0x514bfd);const _0x5c9eed=new _0x2f8c3b(_0x4c68f6);_0x5c9eed['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4d0227});const _0x2565dd=new _0x2f8c3b(_0x4c68f6);return _0x2565dd['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x10039f['title']['length']>0x190?_0x10039f['title']['substring'](0x0,0x190)+'...':_0x10039f['title']}]}),_0x465af8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x5c9eed,_0x2565dd]}),_0x465af8;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[_0x331ccd['defaultPositions']['northArrowSouth'],_0x331ccd['defaultPositions']['northArrowSouthWest'],_0x331ccd['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x2e4b3a=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x2e4b3a);}}class dh extends _0x2f8c3b{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3af762,_0x93b6d9){super(_0x3af762);const {areActionsDisabled:_0xb99cbf,showUnchangedParts:_0x353778,availableActions:_0x5b4062}=_0x93b6d9;this['_areActionsDisabled']=_0xb99cbf,this['_showUnchangedParts']=_0x353778,this['_availableActions']=_0x5b4062,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new St(),this['_emptyPartsWarningView']=new Ye({'id':'empty-parts-warning','initialContent':i(_0x3af762,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new ra(_0x3af762,_0x93b6d9['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sr(this['locale'],_0x93b6d9['bodyCollection']),_0x93b6d9['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...W)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x12d5f3,renderingStrategy:_0x27cb13,abortSignal:_0x3e295b}){this['_children']['length']?_0x12d5f3['forEach'](_0x455641=>{const _0x3a0087=this['_cachedContentParts']['findIndex'](_0x1b2b5a=>_0x1b2b5a['index']==_0x455641['index']);-0x1===_0x3a0087?this['_cachedContentParts']['push'](_0x455641):this['_cachedContentParts'][_0x3a0087]=_0x455641;}):this['_cachedContentParts']=_0x12d5f3;const _0x4771ad=this['_showUnchangedParts']?_0x12d5f3:_0x12d5f3['filter'](_0x1d3f81=>_0x1d3f81['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4771ad['length']>0x1);for(const _0x5598b0 of _0x4771ad)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1da83c=>{let _0x3e2f3e=this['getPartView'](_0x5598b0['index']);_0x3e2f3e||(_0x3e2f3e=new na(this['locale'],{'part':_0x5598b0,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3e2f3e['delegate'](...W)['to'](this),this['_children']['add'](_0x3e2f3e),this['hasPendingParts']=!0x0),await _0x3e2f3e['updateContent']({'part':_0x5598b0,'renderingStrategy':_0x27cb13,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1da83c}),_0x3e2f3e['markAsDone']();});return _0x3e295b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x137485,_0xfb379e){const _0x34deee=this['getPartView'](_0x137485);_0x34deee&&(_0x34deee['state']=_0xfb379e),this['hasPendingParts']='pending'==_0xfb379e||Array['from'](this['_children'])['some'](_0x1ddfee=>'pending'==_0x1ddfee['state']);}['setPartActive'](_0x1964b4,_0x5874e5){if(!0x1===_0x1964b4){for(const _0x3913cf of this['_children'])_0x3913cf['isActive']=!0x1;}else{const _0x5202bc=this['getPartView'](_0x1964b4);_0x5202bc&&(_0x5202bc['isActive']=_0x5874e5);}}['updateSources'](_0x11b0c6){_0x11b0c6['forEach'](_0x39f063=>this['_sourcesView']['addSource'](_0x39f063)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x2f9a47){return this['_children']['find'](_0x5d4704=>_0x5d4704['partDefinition']['index']==_0x2f9a47)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x114133=!this['_cachedContentParts']['find'](({hasChanges:_0x89fd70})=>_0x89fd70),_0x36e9e7=!!this['_cachedContentParts']['find'](({hasChanges:_0x574776})=>!_0x574776);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x36e9e7,_0x114133?this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](i(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x37eabd=>_0x37eabd['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x5aa60d=>_0x5aa60d['partDefinition']['hasChanges'])['length']>0x0;}}class gn extends _0x2f8c3b{['bodyView'];['children'];['headerView'];constructor(_0x169c2e,_0x3eddd4,_0x28b9cc){super(_0x169c2e);const {showDiff:_0x157e61,areActionsDisabled:_0x3e9e2a,showUnchangedParts:_0x4fa4cf,availableActions:_0x4ba1e8}=_0x3eddd4;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new gh(_0x169c2e,{'showDiff':_0x157e61}),this['headerView']['on']('toggleShowChanges',(_0x353406,_0x5cf9f1)=>{this['areChangesVisible']=_0x5cf9f1['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5cf9f1['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new dh(_0x169c2e,{'areActionsDisabled':_0x3e9e2a,'showUnchangedParts':!!_0x4fa4cf,'availableActions':_0x4ba1e8,'bodyCollection':_0x28b9cc}),this['bodyView']['delegate'](...W)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x1541f6){await this['bodyView']['updateContentParts'](_0x1541f6);}['updateSources'](_0x15e6e5){this['bodyView']['updateSources'](_0x15e6e5);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Je extends Fr{['containerView'];constructor(_0x4d04d4,_0x2e0520,_0x54fca8){super(_0x2e0520),this['set']('isTrackChangesOn',!0x1),this['containerView']=new gn(_0x4d04d4,{'showDiff':_0x2e0520['showDiff'],'areActionsDisabled':_0x2e0520['areActionsDisabled'],'availableActions':_0x2e0520['availableActions']},_0x54fca8),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x119eb6,_0x725e00)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x725e00['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x3d7a30,{index:_0x3d0549})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x3d0549});}),this['containerView']['on']('applySuggestion',(_0xbdf531,{index:_0x51c200}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x51c200});}),this['containerView']['on']('insertSuggestion',(_0x55705d,{index:_0x248142}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x248142});}),this['containerView']['on']('rejectSuggestion',(_0x5154e4,{index:_0x2885b})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2885b});}),this['containerView']['on']('mouseOverSuggestion',(_0x2084c0,{index:_0x149a3e})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x149a3e});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x3556a8,{index:_0x418ca4})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x418ca4});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x125228){await this['containerView']['updateContent'](_0x125228);}['updatePartState'](_0x4a87fa,_0x420476){this['containerView']['bodyView']['updatePartState'](_0x4a87fa,_0x420476);}['setPartActive'](_0x5ae714,_0x3cf99){!0x1===_0x5ae714?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x5ae714,_0x3cf99);}['updateSources'](_0x1f07cb){this['containerView']['updateSources'](_0x1f07cb);}['getPartView'](_0x18edd0){return this['containerView']['bodyView']['getPartView'](_0x18edd0);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Ke extends Fr{['replyContainer'];['_bodyCollection'];constructor(_0x3ddbe6,_0x30bacb,_0x465bd7){super(_0x30bacb),this['_bodyCollection']=_0x465bd7,this['locale']=_0x3ddbe6,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x2f8c3b(),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':Ui(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x5947b6,renderingStrategy:_0x22104d,abortSignal:_0x5a6b25}){'streaming'===_0x22104d?await this['streamIntoElement'](_0x5947b6,this['replyContainer']['element'],_0x5a6b25):this['replyContainer']['element']['innerHTML']=_0x41ec78(_0x5947b6);}['updateSources'](_0x557af6){const _0x47e2fb=new Sr(this['locale'],this['_bodyCollection']);_0x47e2fb['children']['addMany'](_0x557af6['map'](_0x5391f4=>new qr(this['locale'],_0x5391f4,_0x47e2fb['balloonPanelView']))),_0x47e2fb['isVisible']=!0x0,this['children']['add'](_0x47e2fb);}}class gi extends _0x3ce061{constructor(_0x1e7d5f=void 0x0){super();const _0x299f46=_0x1e7d5f?'ck-ai-spinner_'+_0x1e7d5f:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x299f46]}});}}const xn={'file':_0x2f568d,'document':_0x4e1fe0,'web-resource':_0x4b76f4,'text':_0x2f568d,'selection':_0x5816f7,'mcp-tool-context':_0x4e1fe0},Qn='ck-ai-chat-context-chip',Xn='ck-ai-chat-context-chip_wide',zn='ck-ai-chat-context-chip_document',jn='ck-ai-chat-context-chip__label',Jn='ck-ai-chat-context-chip__type-icon',Zn='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class Vo extends _0x5822be{constructor(_0xfe60a3,_0x48e38e,_0x54a473,_0x3be162,_0x5c17ac=!0x1){super(_0xfe60a3),this['_isAnimationOnEnterEnabled']=_0x3be162,this['_initializeProperties'](_0x48e38e,_0x54a473,_0x5c17ac),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'](_0x2410f9,_0x26c134,_0x391d1c){this['set']('label',_0x2410f9['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2410f9['type']),this['set']('id',_0x2410f9['uiId']),this['set']('readonly',_0x26c134),this['set']('isLoading',_0x391d1c);}['_setupTemplate'](){const _0x320d9d=this['_createIconView'](),_0x43b2a9=this['_createRemoveButton'](),_0x1ea185=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1ea185),'children':this['_createTemplateChildren'](_0x320d9d,_0x43b2a9,_0x1ea185)});}['_createTemplateAttributes'](_0x689949){return{'class':[Qn,_0x689949['if']('itemType',zn,_0x55e011=>'document'==_0x55e011),_0x689949['if']('itemType',Xn,_0x2246bb=>'selection'==_0x2246bb)],'data-cke-tooltip-text':_0x689949['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Zn};}['_createTemplateChildren'](_0x2faf6b,_0xbd292c,_0x35f9b6){const _0xcee1b=this['_createLabelElement'](_0x35f9b6),_0x4968c4=this['_createLoaderIcon']();return this['readonly']?[_0x2faf6b,_0xcee1b]:[_0x2faf6b,_0x4968c4,_0xcee1b,_0xbd292c];}['_createLabelElement'](_0xcba03a){return{'tag':'span','attributes':{'class':jn},'children':[{'text':_0xcba03a['to']('label')}]};}['_createRemoveButton'](){const _0x42e174=new _0x5822be(this['locale']);return _0x42e174['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x2a2d8c}),this['_setupRemoveButtonEvent'](_0x42e174),_0x42e174;}['_setupRemoveButtonEvent'](_0x31d013){_0x31d013['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0xbcf20e=this['bindTemplate'],_0x27993c=new _0x32da72();return _0x27993c['content']=xn[this['itemType']],_0x27993c['extendTemplate']({'attributes':{'class':[Jn,_0xbcf20e['if']('isLoading','ck-hidden',_0x87a827=>_0x87a827)]}}),_0x27993c;}['_handleAnimationEndOnce'](_0x13cbbf,_0x70b3e7){if(!_0x13cbbf)return;const _0x3c2953=()=>{_0x70b3e7(),_0x13cbbf['removeEventListener']('animationend',_0x3c2953),_0x13cbbf['removeEventListener']('webkitAnimationEnd',_0x3c2953);};_0x13cbbf['addEventListener']('animationend',_0x3c2953),_0x13cbbf['addEventListener']('webkitAnimationEnd',_0x3c2953);}['_createLoaderIcon'](){const _0x331248=new gi('small');return _0x331248['bind']('isVisible')['to'](this,'isLoading',_0x59bfec=>_0x59bfec),_0x331248;}}function In(_0x2584bd){if(!_0x2584bd)return _0x2584bd;if(_0x2584bd['length']<=0x78)return _0x2584bd;const _0x661620=_0x2584bd['slice'](0x0,0x78),_0x11f5e5=_0x661620['lastIndexOf']('\x20');return(_0x11f5e5>0x0?_0x661620['slice'](0x0,_0x11f5e5):_0x661620)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},an='300px';class Ro{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xdaf3b6,_0x4a6a25,_0x1c39d2,_0x3e9813,_0x3e67a5){this['_locale']=_0xdaf3b6,this['_visibleChips']=_0x4a6a25,this['_config']={...hn,..._0x1c39d2,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1c39d2['cssClasses']}},this['_overflowChips']=new _0x3ea87c(),this['_bodyCollection']=_0x3e9813,this['_parentView']=_0x3e67a5||null;}['setContainerElement'](_0x13337e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x13337e,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 _0x1e725e=[...this['_visibleChips'],...this['_overflowChips']],_0x11f7b7=this['_createCalculationContainer'](),_0x30ef43=this['_calculateOverflowInContainer'](_0x11f7b7,_0x1e725e),_0x27d21c=_0x11f7b7['_ancestorsToRestore'];_0x27d21c&&this['_restoreAncestorVisibility'](_0x27d21c),_0x11f7b7['remove'](),this['_applyOverflowResults'](_0x1e725e,_0x30ef43);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x2c5270({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x14654d=new _0x5822be(this['_locale']);_0x14654d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3db673=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3db673['push'](this['_config']['cssClasses']['controlsButton']),_0x14654d['extendTemplate']({'attributes':{'class':_0x3db673}}),_0x14654d;}['_createShowMoreBalloonPanelView'](){const _0xfdcb02=new _0x331ccd(this['_locale']);return _0xfdcb02['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0xfdcb02),_0xfdcb02;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x359a59=>{_0x359a59['disableAnimationOnEnter']();});const _0x314eac=new _0x2f8c3b(this['_locale']);_0x314eac['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x314eac);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x192228=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x192228?'':'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'](_0x350ef5){const _0xc284c2=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x18a792=this['_containerElement']?.['classList'];if(_0x18a792){const _0x51c21e=_0x18a792[0x0]||'',_0x2951e3=_0x350ef5['querySelector']('.'+_0x51c21e),_0x5b1e3a=_0x350ef5['querySelector'](_0xc284c2);return _0x2951e3||_0x5b1e3a||_0x350ef5;}return _0x350ef5['querySelector'](_0xc284c2)||_0x350ef5;}['_calculateContainerWidth'](){const _0x1c474b=this['_parentView']?.['element']||this['_containerElement'];if(!_0x1c474b)return an;const _0x10f162=window['getComputedStyle'](_0x1c474b)['width'];if('auto'===_0x10f162||'0px'===_0x10f162||!_0x10f162){const _0x34e2a0=_0x1c474b['parentElement'];if(_0x34e2a0){const _0x4ce33f=window['getComputedStyle'](_0x34e2a0);return'auto'!==_0x4ce33f['width']?_0x4ce33f['width']:an;}return an;}return _0x10f162;}['_applyCalculationStyles'](_0x3f1431,_0x4e0c34){this['_config']['cssClasses']['calculationContainer']&&_0x3f1431['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3f1431['style']['width']=_0x4e0c34,_0x3f1431['style']['position']='absolute',_0x3f1431['style']['top']='-9999px',_0x3f1431['style']['left']='-9999px',_0x3f1431['style']['opacity']='0',_0x3f1431['style']['pointerEvents']='none',_0x3f1431['style']['zIndex']='-1',_0x3f1431['style']['visibility']='visible\x20!important',_0x3f1431['style']['display']='block\x20!important',_0x3f1431['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x440a46){_0x440a46['forEach'](({element:_0x1f1907,originalDisplay:_0x22b065,originalVisibility:_0x31e257})=>{_0x1f1907['style']['display']=_0x22b065,_0x1f1907['style']['visibility']=_0x31e257;});}['_makeAncestorsVisible'](_0x16f3b9){const _0x15cc83=[];let _0x2055f8=_0x16f3b9;for(;_0x2055f8&&_0x2055f8!==document['body'];){const _0x23eaa8=window['getComputedStyle'](_0x2055f8);'none'!==_0x23eaa8['display']&&'hidden'!==_0x23eaa8['visibility']||(_0x15cc83['push']({'element':_0x2055f8,'originalDisplay':_0x2055f8['style']['display'],'originalVisibility':_0x2055f8['style']['visibility']}),_0x2055f8['style']['display']='block',_0x2055f8['style']['visibility']='visible'),_0x2055f8=_0x2055f8['parentElement'];}return _0x15cc83;}['_createContainerElements'](){let _0x1a90c0,_0xb7c5dd;return this['_parentView']?.['element']?(_0x1a90c0=this['_parentView']['element']['cloneNode'](!0x0),_0xb7c5dd=this['_findTargetContainer'](_0x1a90c0)):(_0x1a90c0=document['createElement']('div'),_0xb7c5dd=_0x1a90c0),{'calculationContainer':_0x1a90c0,'targetContainer':_0xb7c5dd};}['_createCalculationContainer'](){const {calculationContainer:_0x1bf58d,targetContainer:_0x1466e1}=this['_createContainerElements'](),_0x4d9ef8=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x1bf58d,_0x4d9ef8);const _0x31e250=this['_parentView']?.['element']||this['_containerElement'],_0xc885d4=_0x31e250?.['parentElement'];_0xc885d4?_0xc885d4['appendChild'](_0x1bf58d):document['body']['appendChild'](_0x1bf58d),_0x1bf58d['_targetContainer']=_0x1466e1;const _0x950035=this['_makeAncestorsVisible'](_0xc885d4||null);return _0x1bf58d['offsetWidth'],_0x1bf58d['_ancestorsToRestore']=_0x950035,_0x1bf58d;}['_calculateOverflowInContainer'](_0x114457,_0x23aa02){const _0x428e34=_0x114457['_targetContainer']||_0x114457,_0x1b9657=[],{rowCount:_0x19ac1a}=this['_renderChipsAndCountRows'](_0x428e34,_0x23aa02);if(_0x19ac1a<=this['_config']['maxVisibleRows'])return _0x1b9657;const _0x5595ba=_0x23aa02['slice']();for(;_0x5595ba['length']>0x0;){if(this['_testButtonFit'](_0x114457,_0x428e34,_0x5595ba)){const _0x3fdf2f=_0x23aa02['filter'](_0x3e3346=>!_0x5595ba['includes'](_0x3e3346));_0x1b9657['push'](..._0x3fdf2f);break;}if(!_0x5595ba['pop']())break;}return _0x1b9657;}['_renderChipsAndCountRows'](_0x110531,_0x15ca02){_0x110531['innerHTML']='',_0x15ca02['forEach'](_0x196c99=>{if(_0x196c99['element']){const _0xb680a7=_0x196c99['element']['cloneNode'](!0x0);_0x110531['appendChild'](_0xb680a7);}}),_0x110531['offsetWidth'];const _0x46b232=_0x110531['children'],_0x5778ce=[];return Array['from'](_0x46b232)['forEach'](_0x323138=>{const _0x32a9f5=_0x323138['getBoundingClientRect']()['top'];_0x5778ce['some'](_0x3f77af=>Math['abs'](_0x3f77af-_0x32a9f5)<this['_config']['rowDetectionTolerance'])||_0x5778ce['push'](_0x32a9f5);}),{'rowCount':_0x5778ce['length']};}['_createMockButton'](){const _0x1ff2db=document['createElement']('button');return _0x1ff2db['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1ff2db['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1ff2db['textContent']='+\x201',_0x1ff2db;}['_testButtonFit'](_0x289112,_0x34c39e,_0x4cb56a){this['_renderChipsAndCountRows'](_0x34c39e,_0x4cb56a);const _0x9306ff=this['_createMockButton']();_0x289112['appendChild'](_0x9306ff),_0x289112['offsetWidth'];const _0x3a0aef=[..._0x34c39e['children'],_0x9306ff],_0x38d697=[];_0x3a0aef['forEach'](_0x195082=>{const _0x46f30a=_0x195082['getBoundingClientRect']()['top'];_0x38d697['some'](_0x134d28=>Math['abs'](_0x134d28-_0x46f30a)<this['_config']['rowDetectionTolerance'])||_0x38d697['push'](_0x46f30a);});const _0x585d2a=_0x38d697['length'];return _0x9306ff['remove'](),_0x585d2a<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x24cc4e,_0x5abb3e){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x24cc4e['forEach'](_0x2a6c4=>{_0x5abb3e['includes'](_0x2a6c4)?this['_overflowChips']['add'](_0x2a6c4):this['_visibleChips']['add'](_0x2a6c4);});}['_updateOverflowUI'](_0x5bed9b){if(_0x5bed9b>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5bed9b>0x0&&this['_showMoreButtonView']){const _0x536ae3=''+this['_config']['showMoreLabelPrefix']+(_0x5bed9b<0x63?_0x5bed9b:'99');this['_showMoreButtonView']['label']=_0x536ae3;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x5d7606,_0x5d8f2e){this['_distributeChips'](_0x5d7606,_0x5d8f2e),this['_updateOverflowUI'](_0x5d8f2e['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x11ce4d=>{_0x11ce4d[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 _0x29aeb1=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x29aeb1['width']||0x0===_0x29aeb1['height'])return!0x1;const _0x149210=window['innerHeight']||document['documentElement']['clientHeight'],_0x168a3c=window['innerWidth']||document['documentElement']['clientWidth'],_0x2fc0d8=0xc8;return _0x29aeb1['bottom']>=-0xc8&&_0x29aeb1['top']<=_0x149210+_0x2fc0d8&&_0x29aeb1['right']>=-0xc8&&_0x29aeb1['left']<=_0x168a3c+_0x2fc0d8;}}const Ur='ck-ai-chat__feed__context-chips',Wr='ck-ai-chat-context-chips-wrapper',Yr='ck-ai-chat-context-chips-wrapper-balloon',$r='ck-ai-chat-controls-button',Qr='ck-ai-chat-controls_context_show-more-button',Xr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x2f8c3b{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x134236,_0x5e1af9,_0x2fa7eb){super(_0x134236),this['_bodyCollection']=_0x2fa7eb,this['_createContextChips'](_0x5e1af9);const _0x3ee74b={'cssClasses':{'showMoreButton':Qr,'showMoreBalloon':Xr,'overflowContainer':Yr,'controlsButton':$r}};this['_overflowManager']=new Ro(_0x134236,this['_contextChips'],_0x3ee74b,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ur,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Wr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x195b0a=this['element']['querySelector']('.'+Wr);_0x195b0a&&(this['_overflowManager']['setContainerElement'](_0x195b0a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x1d9a70){for(const _0x3e258b of _0x1d9a70){const _0x63a6c=new Vo(this['locale'],_0x3e258b,!0x0,!0x1);this['_contextChips']['add'](_0x63a6c);}}}class Qe extends Fr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3caeae,_0x581478,_0x1e5655){super(_0x581478),this['_locale']=_0x3caeae,this['_bodyCollection']=_0x1e5655,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'](_0x52b763=>!_0x52b763['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x2f8c3b(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 Et extends Fr{['capabilities'];constructor(_0x360955,_0x16a131){super(_0x16a131);const {isWebSearchEnabled:_0x440c65,isReasoningEnabled:_0x4c707d}=_0x16a131['capabilities'],_0xfbf349=[];let _0x23cba6='';_0x440c65&&_0x4c707d?(_0x23cba6=i(_0x360955,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0xfbf349['push'](aa(_0x36ce2a)),_0xfbf349['push'](aa(_0x75147f))):_0x440c65?(_0x23cba6=i(_0x360955,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0xfbf349['push'](aa(_0x36ce2a))):_0x4c707d&&(_0x23cba6=i(_0x360955,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0xfbf349['push'](aa(_0x75147f))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x23cba6?'':'ck-hidden']}});const _0xe79bd7=new _0x2f8c3b();_0xe79bd7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0xfbf349,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x23cba6]}]}),this['children']['add'](_0xe79bd7),this['capabilities']=_0x16a131['capabilities'];}}function aa(_0x5e5b3b){const _0x19c910=new _0x32da72();return _0x19c910['content']=_0x5e5b3b,_0x19c910;}const Fs=['wheel','touchstart','pointerdown','keydown'],Us=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Ze{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x51a909){this['element']=_0x51a909,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x1731c7 of Fs){const _0x3e2739='keydown'!==_0x1731c7;this['element']['addEventListener'](_0x1731c7,this['_onUserEvent']['bind'](this),{'passive':_0x3e2739,'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'](_0x2c4e2d){if(this['isRunning']){if('keydown'===_0x2c4e2d['type']){const _0x525f8c=_0x2c4e2d['key'];if(!Us['includes'](_0x525f8c))return;}_0x2c4e2d instanceof WheelEvent?_0x2c4e2d['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1fa003,scrollHeight:_0x19bb5d,clientHeight:_0x21e3ff}=this['element'];return _0x19bb5d-_0x1fa003-_0x21e3ff<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class $e extends _0x2f8c3b{constructor(_0x8459fe,_0x2b8ddb){super(_0x8459fe),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2b8ddb)});}['_createSkeletonItems'](_0x3304a3){const _0x5ed1af=['ck','ck-ai-skeleton__item'];return _0x3304a3['map'](_0x3a3c4e=>{let _0x3ac1a9='';switch(_0x3a3c4e['attributes']['align']){case'right':_0x3ac1a9='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x3ac1a9='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x3ac1a9='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x3a3c4e['tag'],'attributes':{'class':[..._0x5ed1af,_0x3a3c4e['attributes']['class']?_0x3a3c4e['attributes']['class']:''],'style':'width:\x20'+_0x3a3c4e['attributes']['width']+';\x20height:\x20'+_0x3a3c4e['attributes']['height']+';'+_0x3ac1a9}};});}}const li={'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':ta(0x5,'100%','44px','right'),'aiChatResources':ta(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 ta(_0x46badf,_0x51449c,_0x24df78,_0x529686){return new Array(_0x46badf)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x51449c,'height':_0x24df78,'align':_0x529686}}));}class mi extends Fr{constructor(_0x24bd82){super(_0x24bd82),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class wi extends _0x2f8c3b{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x1c252b,_0x75c354){super(_0x1c252b),this['_bodyCollection']=_0x75c354,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Rt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Ze(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x486fcf,_0x42b56c){let _0x28d671;return'ai-reply'===_0x486fcf?_0x28d671=new Ke(this['locale'],_0x42b56c,this['_bodyCollection']):'ai-suggestion-reply'===_0x486fcf?(_0x28d671=new Je(this['locale'],_0x42b56c,this['_bodyCollection']),_0x28d671['bind']('isTrackChangesOn')['to'](this)):_0x28d671='user-message'===_0x486fcf?new Qe(this['locale'],_0x42b56c,this['_bodyCollection']):'interaction-header'===_0x486fcf?new Et(this['locale'],_0x42b56c):'custom-element'===_0x486fcf?new mi(_0x42b56c):new Ye(_0x42b56c),this['children']['add'](_0x28d671),_0x28d671;}async['updateReplyItem']({id:_0x3a9774,parsedContent:_0x9bfbe1,renderingStrategy:_0xdde666,abortSignal:_0x20f49b}){const _0x4931ac=this['getItemById'](_0x3a9774);if(!(_0x4931ac instanceof Ke))throw new _0x1a859a('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4931ac,'id':_0x3a9774,'parsedContent':_0x9bfbe1});await _0x4931ac['updateContent']({'parsedContent':_0x9bfbe1,'renderingStrategy':_0xdde666,'abortSignal':_0x20f49b});}async['updateWebSources'](_0x4bf977,_0x40235e){const _0x24c045=this['getItemById'](_0x4bf977);if(_0x24c045 instanceof Je)_0x24c045['updateSources'](_0x40235e);else{if(!(_0x24c045 instanceof Ke))throw new _0x1a859a('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x24c045,'id':_0x4bf977,'sources':_0x40235e});_0x24c045['updateSources'](_0x40235e);}}async['updateSuggestionItem']({id:_0x11b2e7,parts:_0x87b8ef,renderingStrategy:_0x52721b,abortSignal:_0x50a0cf}){const _0x1392ef=this['getItemById'](_0x11b2e7);if(!(_0x1392ef instanceof Je))throw new _0x1a859a('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1392ef,'id':_0x11b2e7,'parts':_0x87b8ef});await _0x1392ef['updateContent']({'parts':_0x87b8ef,'renderingStrategy':_0x52721b,'abortSignal':_0x50a0cf});}['updateSuggestionPartState']({id:_0x4aa7a7,index:_0x577263,state:_0x5b3657}){const _0x468455=this['getItemById'](_0x4aa7a7);if(!(_0x468455 instanceof Je))throw new _0x1a859a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4aa7a7});_0x468455['updatePartState'](_0x577263,_0x5b3657);}['setSuggestionPartActive']({id:_0x1a61fc,index:_0x573541,isActive:_0x5874dc}){const _0x38543b=this['getItemById'](_0x1a61fc);if(!(_0x38543b instanceof Je))throw new _0x1a859a('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1a61fc});this['children']['filter'](_0x31cc8c=>_0x31cc8c instanceof Je)['forEach'](_0x5778e5=>{_0x5778e5['setPartActive'](!0x1);}),_0x38543b['setPartActive'](_0x573541,_0x5874dc);}['markItemAsDone'](_0x3a533c){this['getItemById'](_0x3a533c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2ce67a=>_0x2ce67a['options']['id']);}['removeItem'](_0x3ec614){this['children']['remove'](this['getItemById'](_0x3ec614));}['scrollToSuggestion'](_0x321184,_0x36e05c){const _0x4306a1=this['getItemById'](_0x321184);if(!(_0x4306a1 instanceof Je))return void _0x4e1011('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x321184,'partIndex':_0x36e05c});const _0x113aa8=_0x4306a1['getPartView'](_0x36e05c);_0x113aa8?_0x26b0dd(_0x113aa8['element'],0x14,this['element']['parentElement'],!0x0,!0x0):_0x4e1011('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x321184,'partIndex':_0x36e05c});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x528c8a=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x528c8a,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x5b16b6=new $e(this['locale'],li['aiFeed']);return _0x5b16b6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1164b5=>!_0x1164b5)]}}),_0x5b16b6;}['_createFeedItems'](){const _0x4e1f00=new _0x2f8c3b(this['locale']);return _0x4e1f00['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4e1f00;}['_createFeedLoader'](){const _0xc57478=new _0x2f8c3b(this['locale']);return _0xc57478['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x2e7b28=>!_0x2e7b28)]},'children':this['_createLoaderChildren']()}),_0xc57478;}['_createLoaderChildren'](){const _0x465ede=new gi();return _0x465ede['isVisible']=!0x0,[_0x465ede,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x3abbf3){const _0x2180ed=this['children']['find'](_0x38bc7f=>_0x38bc7f['options']['id']['includes'](_0x3abbf3));if(!_0x2180ed)throw new _0x1a859a('ai-chat-feed-view-item-not-found',this,{'id':_0x3abbf3});return _0x2180ed;}['setLoadingMessage'](_0x2bd8e5){this['set']('loadingMessage',_0x2bd8e5);}['toggleLoadingSkeleton'](_0x239272){this['set']('isLoadingSkeletonVisible',_0x239272);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Or extends _0x184d2c{['filter'](){let _0x2a0209=0x0;for(const _0x5bd9c5 of this['items'])_0x2a0209+=_0x5bd9c5['items']['length'];return{'resultsCount':_0x2a0209,'totalItemsCount':_0x2a0209};}}class Pe extends _0xde303d{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4572fe,_0x5ad2d0){super(_0x4572fe,{'queryView':{'label':'','creator':_0x1915a4,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Or(_0x4572fe),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5ad2d0,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=Pe['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=Pe['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',(_0x4a33e7,_0xa8ce6a)=>!_0x4a33e7&&!_0xa8ce6a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2049db,_0x23f9bc)=>{this['isUploadInProgress']||this['isEmpty']||_0x2049db['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x23f9bc());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2bfd70=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2bfd70)return this['queryView']['errorText']=i(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x4ea985=_0xe77682(_0x2bfd70);this['fire']('sendUserMessage',_0x4ea985),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2539ac){this['queryView']['fieldView']['set']('placeholder',_0x2539ac);}['_createSubmitButton'](){const _0x5b2316=new _0x5822be(this['locale']);return _0x5b2316['set']({'icon':_0x444de6,'label':i(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x5b2316['on']('execute',()=>{this['submit']();}),_0x5b2316;}['setIsUploadInProgress'](_0x2ec224){this['isUploadInProgress']=_0x2ec224;}['_setUpAddContextButtonPositioning'](){const _0x3311d0=this['locale'],_0x24fcb7=()=>{_0x461dbe['window']['requestAnimationFrame'](()=>{if(_0x1a0826(this['element'])){const _0x2416a7=new _0x7bf0be(this['queryView']['fieldView']['element']),_0x185c58=new _0x7bf0be(this['_addContextButtonView']['element']),_0x529102=_0x2416a7['width'],_0x4a4587='rtl'===_0x3311d0['uiLanguageDirection']?'right':'left';_0x2416a7['excludeScrollbarsAndBorders']();const _0x50bf4a=_0x529102-_0x2416a7['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4a4587]='calc('+(_0x529102-_0x185c58['width']-_0x50bf4a)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x24fcb7),this['on']('render',()=>{_0x24fcb7(),this['_queryViewResizeObserver']=new _0x5f1798(this['queryView']['fieldView']['element'],()=>{_0x24fcb7();});});}}const Zr='ck-ai-chat__prompt-capabilities',oa='ck-ai-chat-controls-button',ca='ck-ai-chat-controls-button--commands',la='ck-ai-chat-controls__model-selection',ua='ck-ai-chat-controls__model-selection__item-name',da='ck-ai-chat-controls__model-selection__item-description',_a='ck-ai-chat-controls__model-selection__item-capabilities',Aa='n';class Be extends _0x2f8c3b{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x3943a0){super(_0x3943a0),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3391a3=>'selector'===_0x3391a3),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xb0dfba=>_0xb0dfba?this['_modelSelectionDropdown']['buttonView']['label']:i(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2ac3b1=>_0x2ac3b1),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x24ef3a=>_0x24ef3a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4d65f0=>i(this['locale'],_0x4d65f0?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x18088b=>_0x18088b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x3987fc=>i(this['locale'],_0x3987fc?'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 _0x3ea87c(),_0x3be524(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x57aca0,_0x12457d){if(_0x12457d)this['set']('modelDisplayMode','hidden');else{const _0x3923bb=0x1===_0x57aca0['length'];this['set']('modelDisplayMode',_0x3923bb?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x57aca0?.['length'])for(const _0xb55f11 of _0x57aca0){const _0x4387b5=new _0x28b6c7({'label':_0xb55f11['name'],'withText':!0x0,'role':'menuitemradio','id':_0xb55f11['id'],'model':_0xb55f11});_0x4387b5['bind']('isOn')['to'](this,'activeModelId',_0x1d7533=>_0x1d7533===_0xb55f11['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4387b5,'labelView':new ga(this['locale'],_0xb55f11)});}}['setWebSearch'](_0x48811d){this['set']('webSearchActive',_0x48811d);}['setReasoning'](_0x566e59){this['set']('reasoningActive',_0x566e59);}['setModel'](_0x13b836){if(!_0x13b836)return;this['activeModelId']=_0x13b836['id'],this['activeModelName']=_0x13b836['name']||_0x13b836['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x13b836['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x13b836['name']);const _0x341d7f=_0x13b836['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x341d7f),this['_webSearchButton']['set']('isVisible',_0x341d7f);const _0x376797=_0x13b836['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x376797),this['_reasoningButton']['set']('isVisible',_0x376797);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x3d5128){this['set']('modelSelectorEnabled',!0x1),_0x3d5128&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x1b9b2f=new _0x5822be();return _0x1b9b2f['set']({'label':i(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x36ce2a,'class':oa,'isToggleable':!0x0,'tooltipPosition':Aa}),_0x1b9b2f['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x1b9b2f;}['_createReasoningButton'](){const _0x2b9266=new _0x5822be();return _0x2b9266['set']({'label':i(this['locale'],'AI_CHAT_REASONING'),'icon':_0x75147f,'class':oa,'isToggleable':!0x0,'tooltipPosition':Aa}),_0x2b9266['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x2b9266;}['_createCommandsButton'](){const _0x14571d=new _0x5822be();return _0x14571d['set']({'label':i(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2f39f9,'withText':!0x0,'class':oa,'isToggleable':!0x0,'tooltip':i(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Aa}),_0x14571d['extendTemplate']({'attributes':{'class':[ca]}}),_0x14571d['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x14571d;}['_createModelSelectionDropdown'](){const _0x48bc97=_0x103d4b(this['locale']);return _0x48bc97['set']({'panelPosition':'ne','class':[la]}),_0x48bc97['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Aa}),this['listenTo'](_0x48bc97,'execute',_0x2add7c=>{this['fire']('selectModel',_0x2add7c['source']['model']);}),_0x48bc97;}['_createModelNameView'](){const _0x335bbb=new Ia(this['locale']);return _0x335bbb['bind']('text')['to'](this,'activeModelName',_0xd1650=>_0xd1650??''),_0x335bbb['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4235b6=>'name'===_0x4235b6),_0x335bbb;}}let ga=class extends _0x143c37{constructor(_0x14cd49,_0x8b0f87){super();const _0x2ba5ec=this['bindTemplate'],_0x36c72c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2ba5ec['to']('style'),'id':_0x2ba5ec['to']('id')},'children':[{'tag':'div','attributes':{'class':[ua]},'children':[{'text':_0x2ba5ec['to']('text')}]},{'tag':'div','attributes':{'class':[da]},'children':[{'tag':'span','children':[{'text':_0x8b0f87['description']}]}]},{'tag':'div','attributes':{'class':[_a]},'children':_0x36c72c}]}),_0x36c72c['addMany'](this['_getCapabilityParts'](_0x14cd49,_0x36ce2a,'AI_CHAT_SEARCH_WEB',_0x8b0f87['capabilities']['webSearch']?.['enabled']??!0x1)),_0x36c72c['addMany'](this['_getCapabilityParts'](_0x14cd49,_0x75147f,'AI_CHAT_REASONING',_0x8b0f87['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x44de1f,_0x217b76,_0x34e5f0,_0x3316e6){const _0x352485=new _0x32da72();_0x352485['content']=_0x217b76;const _0x5cc210=new _0x2f8c3b(_0x44de1f);_0x5cc210['setTemplate']({'tag':'span','children':[{'text':i(_0x44de1f,_0x34e5f0)+':\x20'}]});const _0x5638bf=new _0x2f8c3b(_0x44de1f);return _0x5638bf['setTemplate']({'tag':'span','children':[{'text':i(_0x44de1f,_0x3316e6?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x352485,_0x5cc210,_0x5638bf];}},Ia=class extends _0x2f8c3b{constructor(_0x5ab93e){super(_0x5ab93e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5e7f58=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5e7f58['if']('isVisible','ck-hidden',_0xe929d5=>!_0xe929d5)]},'children':[{'text':_0x5e7f58['to']('text')}]});}};const Ea='ck-ai-chat-context-controls__url-form',pa='ck-ai-chat-context-controls__url-input-section';class Po extends _0x2f8c3b{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1d054c){super(_0x1d054c),this['focusTracker']=new _0x2afd45(),this['keystrokes']=new _0x16d287(),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 _0x1842f7({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x2564b4=>{this['focusTracker']['add'](_0x2564b4['element']),this['keystrokes']['listenTo'](_0x2564b4['element']);}),_0x43af11({'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'](_0x22ab26){this['urlInputField']['errorText']=_0x22ab26,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x5e30a7=new _0x5822be(this['locale']);return _0x5e30a7['set']({'icon':_0x1cd954,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x45ab58,_0x496752,_0x183041)=>{_0x5e30a7['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x183041?'':'\x20ck-hidden')]});}),_0x5e30a7;}['_createUrlInputField'](){const _0x37745b=new _0x917031(this['locale'],th);return _0x37745b['set']({'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x37745b['fieldView']['set']({'placeholder':i(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x37745b;}['_createConfirmButton'](){const _0x416402=new _0x5822be(this['locale']);return _0x416402['set']({'icon':_0x29ef47,'tooltip':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x416402;}['_setupTemplate'](){const _0xbda3db=new _0x127487(this['locale'],{'label':i(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0xbda3db['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Ea,'tabindex':'-1'},'children':[_0xbda3db,{'tag':'div','attributes':{'class':pa},'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',_0x361c0b=>{_0x361c0b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0xc3a278,_0x45d4b2)=>{this['clear'](),this['fire']('cancel'),_0x45d4b2();});}['_handleSubmit'](){const _0x1d7a64=this['getValue']()['trim']();_0x1d7a64?this['_isValidUrl'](_0x1d7a64)?(this['clearError'](),this['fire']('submitUrl',_0x1d7a64)):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](i(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4e0e0b=this['getValue']()['trim'](),_0x5831f3=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4e0e0b['length']>0x0&&!_0x5831f3;}['_isValidUrl'](_0x5a1ea7){try{return!!new URL(_0x5a1ea7);}catch{return!0x1;}}}const Ta='ck-ai-chat-resources__item',ma='ck-ai-chat-resources__item--in-context',Ca='ck-ai-chat-resources__item-title',wa='ck-ai-chat-resources__item__icon';class hc extends _0xe814a3{['resource'];['_titleView'];['_iconView'];constructor(_0x32b1a9,_0x42d779){super(_0x32b1a9),this['resource']=_0x42d779,this['set']('isInContext',!!_0x42d779['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x1eaa10){if(_0x1eaa10['isInContext'])return _0x29ef47;switch(_0x1eaa10['type']){case xe['DOCUMENT']:return _0x4e1fe0;case xe['URL']:return _0x4b76f4;case xe['FILE']:case xe['TEXT']:return _0x2f568d;default:return _0x22d121;}}['highlightText'](_0xc94f93){if(!_0xc94f93||''===_0xc94f93['trim']())return void this['_titleView']['highlightText'](null);const _0x33f99a=new RegExp(_0xfcca98(_0xc94f93),'gi');this['_titleView']['highlightText'](_0x33f99a);}['updateResourceState'](_0xd86d8b){this['resource']['isInContext']=_0xd86d8b,this['isInContext']=_0xd86d8b,this['_updateIcon']();}['_createTitleView'](){const _0x5b3fdd=new _0x30fef8();return _0x5b3fdd['text']=this['resource']['label'],_0x5b3fdd['extendTemplate']({'tag':'span','attributes':{'class':[Ca]}}),_0x5b3fdd;}['_createIconView'](){const _0x25a72a=new _0x32da72();return _0x25a72a['content']=this['getResourceIcon'](this['resource']),_0x25a72a;}['_setupTemplate'](){const _0x5c182d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Ta,_0x5c182d['if']('isVisible','ck-hidden',_0x260646=>!_0x260646),_0x5c182d['if']('isInContext',ma)]},'children':[{'tag':'div','attributes':{'class':[wa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5c182d['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const fa='ck-ai-chat-resources__list';class Lr extends _0x184d2c{['_source'];constructor(_0x1db316,_0x4099ad){super(_0x1db316),this['_source']=_0x4099ad,this['extendTemplate']({'attributes':{'class':[fa]}});}['setResources'](_0x46f650,_0x2d5370){this['items']['clear']();let _0x2e7c2e=_0x46f650;if(this['_source']['useDefaultFiltering']&&_0x2d5370&&''!==_0x2d5370['trim']()){const _0x3aec69=new RegExp(_0x2d5370['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2e7c2e=_0x46f650['filter'](_0x2e446b=>_0x3aec69['test'](_0x2e446b['label']));}for(const _0xa96bff of _0x2e7c2e){const _0x4344aa=new hc(this['locale'],_0xa96bff);_0x4344aa['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xa96bff);}),this['items']['add'](_0x4344aa);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2d5370);}['highlightText'](_0x3dc76a){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x28d6c6=>{_0x28d6c6['highlightText'](_0x3dc76a);});}['updateResourceState'](_0x1ef991,_0x4af7fb){for(const _0x25a68d of this['items']){const _0x595349=_0x25a68d;_0x595349['resource']['id']===_0x1ef991&&_0x595349['updateResourceState'](_0x4af7fb);}}['_handleResourceSelection'](_0x3ebfd8,_0x39de93){this['fire']('addResourceToContext',{'source':_0x3ebfd8,'resource':_0x39de93});}}class Tr extends _0x917031{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x4ba389){const t=_0x4ba389['t'],_0x2bfe7c={'showResetButton':!0x0,'showIcon':!0x0,'creator':th,'label':i(_0x4ba389,'AI_CHAT_SEARCH_RESOURCES')};super(_0x4ba389,_0x2bfe7c['creator']),this['label']=_0x2bfe7c['label'],this['_viewConfig']=_0x2bfe7c,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x4ba389,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1badb6){this['fire']('search',_0x1badb6);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x32da72(),this['iconView']['content']=_0x3edf36,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x1c51ec,t){this['resetButtonView']=new _0x5822be(_0x1c51ec),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x127a77,'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',_0x1d9e0e=>!_0x1d9e0e),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 lc extends _0x2f8c3b{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x5af0e5,_0x3e5dd8){super(_0x5af0e5),this['_source']=_0x3e5dd8['source'],this['_searchInputVisibleFrom']=_0x3e5dd8['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x36b2b7([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Tr(this['locale']);}['_createSearchSection'](){const _0x1b2329=new _0x2f8c3b(this['locale']);return _0x1b2329['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1f5bbb,_0x3f4c52)=>{this['loadResources'](_0x3f4c52),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3f4c52);}),_0x1b2329;}['_createResourcesListView'](){const _0xd01460=new Lr(this['locale'],this['_source']);return _0xd01460['delegate']('addResourceToContext')['to'](this),_0xd01460['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xd01460;}['_createSkeletonView'](){const _0x31c32a=new $e(this['locale'],li['aiChatResources']);return _0x31c32a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3434d5=>!_0x3434d5)]}}),_0x31c32a;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x39fc75){const _0x53f57b=_0x36c3ed();this['_latestLoadResourcesUid']=_0x53f57b,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x39fc75,'uid':_0x53f57b}),this['isLoading']=!0x0;}['setResources'](_0x17a050,_0x367eb1){if(_0x367eb1&&_0x367eb1!==this['_latestLoadResourcesUid'])return;const _0x547741=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x17a050,_0x547741),_0x17a050['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x5bd0ca,_0x22ef42){this['_resourcesListView']['updateResourceState'](_0x5bd0ca,_0x22ef42);}}const Sa='ck-ai-chat-context-controls__source-balloon-panel',ba='ck-button-icon\x20ck-button-back',Ra='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Oo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x43ac85,_0xc5869c,_0x21a19f){this['_locale']=_0x43ac85,this['_bodyCollection']=_0xc5869c,this['_config']=_0x21a19f;}['showSourceResourcesBalloon']({source:_0xc1f6ce,withBackButton:_0xa8eea5}){let _0x2a77c6=this['_sourceResourceBalloons']['get'](_0xc1f6ce['id']);_0x2a77c6||(_0x2a77c6=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xc1f6ce['id'],_0x2a77c6),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2a77c6)),this['_addSourceResourceContent']({'balloonPanel':_0x2a77c6,'source':_0xc1f6ce,'withBackButton':_0xa8eea5}),_0x2a77c6['show']();const _0x3f9630=this['_config']['getTargetElement']();_0x3f9630&&_0x2a77c6['pin']({'target':_0x3f9630,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x43d9ca,_0xe6aadc,_0x424a4a){const _0x7be71=this['_sourceResourceBalloons']['get'](_0x43d9ca);if(!_0x7be71)return;const _0x8dff5=this['_getResourcesViewFromBalloon'](_0x7be71);_0x8dff5&&(_0x8dff5['setResources'](_0xe6aadc,_0x424a4a),_0x8dff5['once']('change:isLoading',()=>{_0x7be71['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x93e293){const _0x3dd1b1=this['_sourceResourceBalloons']['get'](_0x93e293);_0x3dd1b1&&requestAnimationFrame(()=>{_0x3dd1b1['hide'](),this['_sourceResourceBalloons']['delete'](_0x93e293),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0xa95244 of this['_sourceResourceBalloons']['values']())if(_0xa95244['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x20750d,_0x386ccd,_0x495cf2){const _0x3e6bf1=this['_sourceResourceBalloons']['get'](_0x20750d);if(!_0x3e6bf1||!_0x3e6bf1['isVisible'])return;const _0x594c01=this['_config']['getTargetElement']();if(!_0x594c01)return;_0x3e6bf1['pin']({'target':_0x594c01,'limiter':this['_config']['getLimiterElement']()});const _0x2475eb=this['_getResourcesViewFromBalloon'](_0x3e6bf1);_0x2475eb&&_0x2475eb['updateResourceState'](_0x386ccd,_0x495cf2);}['destroy'](){for(const _0x3a9203 of this['_sourceResourceBalloons']['values']())_0x3a9203['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x57f70a=new _0x331ccd(this['_locale']);return _0x57f70a['extendTemplate']({'attributes':{'class':Sa}}),this['_bodyCollection']['add'](_0x57f70a),_0x57f70a;}['_addSourceResourceContent']({balloonPanel:_0x302f5a,source:_0x4f590f,withBackButton:_0x11c9c5}){_0x302f5a['content']['clear']();const _0x53f96e=this['_createBalloonHeader']({'balloonPanel':_0x302f5a,'source':_0x4f590f,'withBackButton':_0x11c9c5});_0x302f5a['content']['add'](_0x53f96e);const _0x3bdf7c=this['_createBalloonResourcesView'](_0x4f590f);_0x302f5a['content']['add'](_0x3bdf7c);}['_createBalloonHeader']({balloonPanel:_0x34205e,source:_0x3b4aef,withBackButton:_0x53600e}){const _0x12aca2=new _0x127487(this['_locale'],{'label':_0x3b4aef['label'],'class':Ra});return _0x53600e&&_0x12aca2['children']['add'](this['_createBackButton'](_0x34205e),0x0),_0x12aca2;}['_createBackButton'](_0x5ee5e4){const _0x52537f=new _0x5822be(this['_locale']);return _0x52537f['set']({'icon':_0x1cd954,'tooltip':i(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ba}),_0x52537f['on']('execute',()=>{_0x5ee5e4['hide'](),this['_config']['onBackToContext']();}),_0x52537f;}['_createBalloonResourcesView'](_0x1fd1f5){const _0x442b7c=new lc(this['_locale'],{'source':_0x1fd1f5,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x442b7c['on']('loadSourceResources',(_0x5cb998,_0x297ca2)=>{this['_config']['onLoadSourceResources'](_0x297ca2);}),_0x442b7c['on']('addResourceToContext',(_0x51fbfb,_0x44026a)=>{this['_config']['onResourceSelected'](_0x44026a['source'],_0x44026a['resource']),this['closeSourceResourceBalloon'](_0x1fd1f5['id']);}),_0x442b7c;}['_getResourcesViewFromBalloon'](_0x149798){const _0x495490=_0x149798['content']['get'](0x1);return _0x495490 instanceof lc?_0x495490:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x104bdb){_0x2c5270({'emitter':_0x104bdb,'contextElements':[_0x104bdb['element']],'callback':()=>{_0x104bdb['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x104bdb['isVisible']});}}const He=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Uo='ck-ai-chat-context-controls',Lo='ck-ai-chat-context-controls__pending-contexts',No='ck-ai-chat-context-controls__add-context-balloon-panel',Mo='ck-ai-chat-context-controls__add-context-button',Ho='ck-ai-chat-context-controls__url-balloon-panel',jo='ck-ai-chat-context-controls__balloon-button',Fo='ck-ai-chat-context-controls__balloon-button-source',Xo='ck-ai-chat-controls-button',yo='ck-ai-chat-context-chips-wrapper-balloon',Do='ck-ai-chat-controls_context_show-more-button',$o='ck-ai-chat-context-controls__show-more-balloon-panel',Wo='ck-ai-chat',qo=[_0x331ccd['defaultPositions']['northArrowSouthWest'],_0x331ccd['defaultPositions']['northArrowSouth'],_0x331ccd['defaultPositions']['northArrowSouthEast'],_0x331ccd['defaultPositions']['southArrowNorthWest'],_0x331ccd['defaultPositions']['southArrowNorth'],_0x331ccd['defaultPositions']['southArrowNorthEast']];class Ge extends _0x2f8c3b{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x324d49,_0x18c713){super(_0x324d49),this['bodyCollection']=_0x18c713['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x324d49),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x324d49),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x324d49),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x324d49,_0x18c713);const _0x336384={'cssClasses':{'showMoreButton':Do,'showMoreBalloon':$o,'overflowContainer':yo,'controlsButton':Xo}};this['_overflowManager']=new Ro(_0x324d49,this['_currentContextsChips'],_0x336384,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'](_0x3bf74c,_0x580642){const _0x433090=this['_createContextButton'](_0x3bf74c,'current',!0x0,_0x580642);this['_addContextToCollection'](_0x433090,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0xb5e3){this['_removeContextFromCollection'](_0xb5e3,this['_currentContextsChips']),this['_removeContextFromCollection'](_0xb5e3,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x6c2c42,_0x21ca85){let _0xe327dc=this['_currentContextsChips']['find'](_0x4e25fa=>_0x4e25fa['id']===_0x6c2c42);_0xe327dc||(_0xe327dc=this['_overflowManager']['overflowChips']['find'](_0x28bc68=>_0x28bc68['id']===_0x6c2c42)),_0xe327dc&&(_0xe327dc['isLoading']=_0x21ca85);}['setConversationContext'](_0x1636fe){this['_conversationContextsChips']['clear']();for(const _0x5aaa09 of _0x1636fe){const _0x1856a9=this['_createContextButton'](_0x5aaa09,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1856a9,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x2ab088,_0x2cdc98,_0x2fca59){this['_resourcesBalloonView']['updateResourceState'](_0x2ab088,_0x2cdc98,_0x2fca59);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x13f67a,withBackButton:_0x52d2bb}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x13f67a,'withBackButton':_0x52d2bb}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2ac8f1,_0xcda043,_0x28f83e,_0x1a46a8){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2ac8f1,_0x28f83e,_0x1a46a8);}['closeSourceResourceBalloon'](_0x5d2354){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x5d2354),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x237eab){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x237eab),this['_setAddContextButtonEnabled'](_0x237eab);}['_setAddContextButtonEnabled'](_0x449c23){const _0x1d40ad=!_0x449c23['document']['isHidden']&&_0x449c23['document']['enabled'],_0x334368=_0x449c23['urls']['enabled'],_0x51d70c=_0x449c23['files']['enabled'],_0x408bec=_0x449c23['sources']['length']>0x0,_0x29a7ea=_0x449c23['customItems']&&_0x449c23['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x1d40ad||_0x334368||_0x51d70c||_0x408bec||_0x29a7ea;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Uo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Lo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2d24a4){const _0x8a5070=new _0x5822be(_0x2d24a4);return _0x8a5070['set']({'label':i(_0x2d24a4,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Xo+'\x20'+Mo,'icon':_0x1023cb,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x8a5070;}['_createAddContextBalloonPanelView'](_0xf67987){return this['_createBaseBalloonPanel'](_0xf67987,No);}['_createUrlBalloonPanelView'](_0x2928d4){const _0x2a9de5=this['_createBaseBalloonPanel'](_0x2928d4,Ho);return this['_addUrlContent'](_0x2a9de5,_0x2928d4),_0x2a9de5;}['_createResourcesBalloonView'](_0x10e285,_0x429003){const _0x5b6eed={'searchInputVisibleFrom':_0x429003['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qo});},'onResourceSelected':(_0x43c780,_0x1ab95e)=>{this['fire']('addResourceToContext',{'source':_0x43c780,'resource':_0x1ab95e});},'onLoadSourceResources':_0x26e6c7=>{this['fire']('loadSourceResources',_0x26e6c7);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Oo(_0x10e285,_0x429003['bodyCollection'],_0x5b6eed);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Wo)||document['body'];}['_createBaseBalloonPanel'](_0x30bf93,_0x4d5698){const _0x5a927e=new _0x331ccd(_0x30bf93);return _0x5a927e['extendTemplate']({'attributes':{'class':_0x4d5698}}),this['bodyCollection']['add'](_0x5a927e),_0x5a927e;}['_setBalloonPanelContent'](_0x4bb269,_0x4266d8,_0x240aa0){if(_0x4bb269['content']['clear'](),!_0x240aa0['document']['isHidden']&&_0x240aa0['document']['enabled']){const _0x30d20f=this['_createBalloonButton'](_0x4266d8,{'label':i(_0x4266d8,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4e1fe0});_0x30d20f['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x4bb269['content']['add'](_0x30d20f);}if(_0x240aa0['urls']['enabled']){const _0x49df40=this['_createBalloonButton'](_0x4266d8,{'label':i(_0x4266d8,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4b76f4});_0x49df40['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qo}),this['_urlInputView']['focus']();}),_0x4bb269['content']['add'](_0x49df40);}if(_0x240aa0['files']['enabled']){const _0x955042=new _0x3476b4(_0x4266d8);_0x955042['set']({'label':i(_0x4266d8,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x64b1f3,'withText':!0x0,'tooltip':!0x0,'class':jo,'allowMultipleFiles':!0x0}),_0x955042['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x955042['on']('done',(_0x1b676b,_0x16cd26)=>{this['fire']('addFileToContext',_0x16cd26);}),_0x955042['tooltip']=!0x0,_0x4bb269['content']['add'](_0x955042);}for(const _0x22a9ee of _0x240aa0['sources']){const _0x370a37=this['_createBalloonButton'](_0x4266d8,{'label':_0x22a9ee['label'],'icon':_0x22a9ee['icon']||_0x22d121,'type':'source'});_0x4bb269['content']['add'](_0x370a37),_0x370a37['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x22a9ee,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x20e7c4 of _0x240aa0['customItems']||[]){const _0x4348c0=this['_createBalloonButton'](_0x4266d8,{'label':_0x20e7c4['label'],'icon':_0x20e7c4['icon']||_0x22d121,'type':'customItem'});_0x4bb269['content']['add'](_0x4348c0),_0x4348c0['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x20e7c4);});}this['_hasExactlyOneSource']=0x1===_0x4bb269['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x200379,_0x53ff51){this['_urlInputView']=new Po(_0x53ff51),this['_urlInputView']['on']('submitUrl',(_0x29ccc0,_0x533840)=>{this['_handleUrlSubmit'](_0x533840);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qo}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qo});}),_0x200379['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x586ade,_0x52e100){const _0x11b8c0='source'===_0x52e100['type']?new Oa(_0x586ade):new _0x5822be(_0x586ade);return _0x11b8c0['set']({'label':_0x52e100['label'],'icon':_0x52e100['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':jo}),_0x11b8c0;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x2c5270({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x17d246){const _0x3cb741=this['_addContextBalloonConfig'];_0x3cb741['buttonView']['isOn']=_0x17d246,_0x17d246?_0x3cb741['balloonView']['show']():_0x3cb741['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x537eec,buttonView:_0x22be0c,hideMethod:_0x41662f}=this['_addContextBalloonConfig'];_0x2c5270({'emitter':_0x537eec,'contextElements':[_0x537eec['element'],_0x22be0c['element']],'callback':()=>{_0x41662f();},'activator':()=>_0x22be0c['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0xfef88,_0x3695ae,_0x221ade=!0x1,_0x38f39d=!0x1){const _0x574e2d='conversation'===_0x3695ae||!0x0===_0xfef88['isReadOnly'],_0x5f2861=new Vo(this['locale'],_0xfef88,_0x574e2d,_0x221ade,_0x38f39d);return _0x574e2d||_0x5f2861['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x5f2861['id']);}),_0x5f2861;}['_addContextToCollection'](_0x1f25bd,_0x20bbe3){_0x20bbe3['add'](_0x1f25bd,0x0);}['_removeContextFromCollection'](_0x5417d1,_0x4b9a58){const _0x518626=_0x4b9a58['find'](_0x2b9150=>_0x2b9150['id']===_0x5417d1);_0x518626&&_0x4b9a58['remove'](_0x518626);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qo}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x151a72){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x151a72);}}class Oa extends _0x5822be{['arrowView'];constructor(_0x1038ec){super(_0x1038ec),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Fo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x312768=new _0x32da72();return _0x312768['content']=_0x518767,_0x312768['extendTemplate']({'attributes':{'class':Fo+'__arrow'}}),_0x312768;}}class Xe extends _0x2f8c3b{['_cancelButtonView'];['_loaderView'];constructor(_0x5c9e03){super(_0x5c9e03),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 _0x275e8c=new _0x5822be(this['locale']);return _0x275e8c['set']({'label':i(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-button-stop-generating','icon':_0xf8ad47}),_0x275e8c['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x275e8c;}['_createLoaderView'](){const _0x430483=new _0x2f8c3b(this['locale']);return _0x430483['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':i(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x430483;}}class fi extends _0x2f8c3b{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x1c675d,_0x4baf4f){super(_0x1c675d),this['_contextPanelView']=this['_createContextPanelView'](_0x1c675d,{'bodyCollection':_0x4baf4f['bodyCollection'],'searchInputVisibleFrom':_0x4baf4f['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x1c675d),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x1c675d),this['_loaderView']=this['_createLoaderView'](_0x1c675d),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x1c675d),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'](...He)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x41ad44=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x41ad44['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x41ad44['if']('isLoading','ck-hidden',_0x18d019=>_0x18d019||!this['isModelAvailable']),_0x41ad44['if']('isModelAvailable','ck-hidden',_0x57d677=>!_0x57d677||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x41ad44['if']('isLoading','ck-hidden',_0x30e2f4=>!_0x30e2f4)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x41ad44['if']('isModelAvailable','ck-hidden',_0xcb97b2=>_0xcb97b2)]},'children':[this['_modelUnavailableMessageView']]}]}),_0x2c5270({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x3da1c4,_0x18f7d4){return new Ge(_0x3da1c4,_0x18f7d4);}['_createPromptInputView'](_0x65ad8b){return new Pe(_0x65ad8b,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x48728f){return new Be(_0x48728f);}['_createLoaderView'](_0x1ab982){return new Xe(_0x1ab982);}['_createModelUnavailableMessageView'](_0xd36cbf){const _0x1de39a=new qe(_0xd36cbf);return _0x1de39a['delegate']('startConversation')['to'](this),_0x1de39a;}['_handlePromptInputFocus'](_0xe5e22d,_0x5ebd61,_0x396dac){_0x396dac?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x1034de,_0x42e13c){this['_contextPanelView']['addContextItem'](_0x1034de,_0x42e13c);}['removeContextItem'](_0x5e4584){this['_contextPanelView']['removeContextItem'](_0x5e4584);}['setContextItemLoading'](_0x4d89fa,_0x1beaa3){this['_contextPanelView']['setContextItemLoading'](_0x4d89fa,_0x1beaa3);}['setIsUploadInProgress'](_0x113153){this['_promptInputView']['setIsUploadInProgress'](_0x113153);}['setConversationContext'](_0x1f1783){this['_contextPanelView']['setConversationContext'](_0x1f1783);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x1e6700,_0x16d3a5,_0x4323df){this['_contextPanelView']['updateResourceState'](_0x1e6700,_0x16d3a5,_0x4323df);}['setWebSearch'](_0x3f2d09){this['_promptCapabilitiesView']['setWebSearch'](_0x3f2d09);}['setReasoning'](_0x763300){this['_promptCapabilitiesView']['setReasoning'](_0x763300);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x5af11e){this['_contextPanelView']['setAddContextOptions'](_0x5af11e);}['setInputPlaceholder'](_0x438014){this['_promptInputView']['setPlaceholderText'](_0x438014);}['setModelList'](_0x461732,_0xa7189c){this['_promptCapabilitiesView']['setModelList'](_0x461732,_0xa7189c);}['setModel'](_0x3f1c87){_0x3f1c87?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3f1c87)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x45e4e){this['_promptCapabilitiesView']['disableModelSelector'](_0x45e4e);}['populateSourceResourceBalloon'](_0x2d03ab,_0x2d4946,_0x3c7609,_0x712711){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2d03ab,_0x2d4946,_0x3c7609,_0x712711);}['closeSourceResourceBalloon'](_0x3c65bc){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3c65bc);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class qe extends _0x2f8c3b{constructor(_0xddd9f3){super(_0xddd9f3);const _0x521794=new _0x5822be(_0xddd9f3);_0x521794['set']({'label':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x521794['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':i(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x521794]}]});}}class ji extends _0x127487{['conversationStartButton'];['resizeButton'];constructor(_0x3f8c24,_0x7375dc){super(_0x3f8c24,{'label':i(_0x3f8c24,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':At}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3f8c24),this['children']['add'](this['conversationStartButton']),_0x7375dc&&(this['resizeButton']=As(_0x3f8c24,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x69df){const _0xe2c113=new _0x5822be(_0x69df);return _0xe2c113['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1672ce,'class':'ck-ai-chat__start-conversation'}),_0xe2c113['on']('execute',()=>{this['fire']('startConversation');}),_0xe2c113;}}class vi extends _0x2f8c3b{constructor(_0x318f7e){super(_0x318f7e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':i(_0x318f7e,'AI_DISCLAIMER_TEXT')}]}]});}}class mt extends _0x2f8c3b{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1ea2e6,_0x2b5d16){super(_0x1ea2e6),this['_bodyCollection']=new _0xa5a63b(_0x1ea2e6),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ji(_0x1ea2e6,_0x2b5d16['showResizeButton']),this['chatHeader']['delegate'](...Rt)['to'](this),this['chatFeed']=new wi(_0x1ea2e6,this['_bodyCollection']),this['chatFeed']['delegate'](...Rt)['to'](this),this['chatControls']=new fi(_0x1ea2e6,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2b5d16['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Rt)['to'](this),this['chatDisclaimer']=new vi(_0x1ea2e6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1ea2e6['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3ba2d7,_0x3072bf,_0x422019,_0x1c82b2){this['chatControls']['populateSourceResourceBalloon'](_0x3ba2d7,_0x3072bf,_0x422019,_0x1c82b2);}['closeSourceResourceBalloon'](_0x26edc8){this['chatControls']['closeSourceResourceBalloon'](_0x26edc8);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class z extends _0x55a427{static get['requires'](){return[it];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x12f54b){super(_0x12f54b);const _0x490f99=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new St(),this['_view']=new mt(this['context']['locale'],{'showResizeButton':_0x490f99['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Rt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xb08475,{showDiff:_0x233c6e})=>{this['showDiff']=_0x233c6e;}),_0x490f99['view']['addTab']({'id':'chat','buttonLabel':i(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':At,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x49050c=>_0x49050c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x24796e=>_0x24796e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x294bb3){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x294bb3['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':i(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x506fc6,staticMessage:_0x5d2959}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x506fc6,'initialContent':'<p>'+_0x5d2959+'</p>'});}['addFeedItemUserMessage'](_0x557e4a){const _0x451a89=_0x557e4a['attributes']?.['displayedPrompt']||_0x557e4a['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x557e4a['contextItems']['values']()),'initialContent':'<p>'+_0x451a89+'</p>','id':_0x557e4a['id']});}['addFeedItemError']({errorMessage:_0x320f4d,id:_0x2e7c9b}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x320f4d+'</p>','id':_0x2e7c9b});}['addFeedItemAIReply'](_0x4f811e){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4f811e['interactionId']+':'+_0x4f811e['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x272a35){const _0x2190cf=T(this['context']);let _0xb899e=_0x2190cf['config']['get']('ai.availableReplyActions')||[...J];if(_0x2190cf['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x4fc5f6=_0x2190cf['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x4fc5f6,'value');}}else _0xb899e=_0xb899e['filter'](_0x1892ec=>'insertSuggestion'!=_0x1892ec);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x272a35['interactionId']+':'+_0x272a35['id'],'areActionsDisabled':_0x272a35['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0xb899e}),this['clearLoadingMessage']();});}['addFeedInteractionHeader'](_0x211885,_0x3f9229){const _0x5845af=this['_view']['chatFeed']['children']['last'];if(_0x5845af instanceof Et)return this['_view']['chatFeed']['children']['remove'](_0x5845af),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x211885['id'],'capabilities':{'isWebSearchEnabled':_0x5845af['capabilities']['isWebSearchEnabled']||_0x3f9229['isWebSearchEnabled'],'isReasoningEnabled':_0x5845af['capabilities']['isReasoningEnabled']||_0x3f9229['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x211885['id'],'capabilities':_0x3f9229});}async['addFeedItemCustomElement'](_0x25a960,_0x3ad909){let _0x8e3b4e;return await this['_promiseQueue']['enqueue'](async()=>{_0x8e3b4e=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x25a960,'id':_0x3ad909});}),_0x8e3b4e;}['updateFeedInteractionHeader'](_0x4d16e6){const _0x4ee6ec=this['_view']['chatFeed']['children']['find'](_0x18c589=>_0x18c589['options']['id']==_0x4d16e6['id']&&_0x18c589 instanceof Et);_0x4ee6ec&&_0x4ee6ec['set']('isVisible',_0x4d16e6['isVisible']);}async['updateFeedItemAIReplyContent'](_0x33285a){const _0x1a268f=_0x33285a['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x3c6c42=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x33285a,'abortSignal':_0x3c6c42,'renderingStrategy':_0x1a268f}),_0x33285a['isDone']&&this['markFeedItemAsDone'](_0x33285a['id']);});}['updateFeedItemAIReplySources'](_0x13700b,_0x4a49b4){this['_view']['chatFeed']['updateWebSources'](_0x13700b,_0x4a49b4);}async['updateFeedItemAIReplySuggestionContent'](_0x1cb342){const _0x189685=_0x1cb342['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1d32cd=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1cb342,'abortSignal':_0x1d32cd,'renderingStrategy':_0x189685}),_0x1cb342['isDone']&&this['markFeedItemAsDone'](_0x1cb342['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xf3e658){this['_view']['chatFeed']['updateSuggestionPartState'](_0xf3e658);}['setFeedItemAIReplySuggestionPartActive'](_0x22781a){this['_view']['chatFeed']['setSuggestionPartActive'](_0x22781a);}['markFeedItemAsDone'](_0x5db89f){this['_view']['chatFeed']['markItemAsDone'](_0x5db89f);}['removeFeedInteraction'](_0x463c19){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4cba45=>_0x4cba45['startsWith'](_0x463c19))['forEach'](_0x5e7622=>this['_view']['chatFeed']['removeItem'](_0x5e7622));}['startInteraction'](){const _0xfb2716=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0xfb2716),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1b6b60){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5c4611=>_0x5c4611['startsWith'](_0x1b6b60['id']))['forEach'](_0x2ce1da=>this['markFeedItemAsDone'](_0x2ce1da)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x53e4ec,_0x3fbdba){this['_view']['chatControls']['addContextItem'](_0x53e4ec,_0x3fbdba);}['removeContextItem'](_0x1c9929){this['_view']['chatControls']['removeContextItem'](_0x1c9929);}['setContextItemLoading'](_0x4ea7fd,_0x25844e){this['_view']['chatControls']['setContextItemLoading'](_0x4ea7fd,_0x25844e);}['setIsUploadInProgress'](_0xc32190){this['_view']['chatControls']['setIsUploadInProgress'](_0xc32190);}['setConversationContext'](_0x1c1f92){this['_view']['chatControls']['setConversationContext'](_0x1c1f92);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1668a3,_0x3007c7,_0x5076bd){this['_view']['chatControls']['updateResourceState'](_0x1668a3,_0x3007c7,_0x5076bd);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1bfa87){this['_view']['chatControls']['setAddContextOptions'](_0x1bfa87);}['updateCapabilities'](_0x2f5392){this['_view']['chatControls']['setWebSearch'](_0x2f5392['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2f5392['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2f5392));}['setSelectedModel'](_0x28bc78,_0x20c930){this['_view']['chatControls']['setModel'](_0x28bc78),_0x20c930&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2a4730){this['feedItemRenderingStrategy']=_0x2a4730;}['toggleLoadingSkeleton'](_0x3cb15c){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3cb15c);}['resetConversationTitle'](){this['setConversationTitle'](i(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x547fda,_0x21306a=!0x1){if(_0x21306a&&!It()&&_0x547fda['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x547fda);this['_view']['chatHeader']['label']=_0x547fda;}['setLoadingMessage'](_0x15d3a2){this['_view']['chatFeed']['setLoadingMessage'](_0x15d3a2);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x498682){let _0x4ca551=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x498682[_0x4ca551],_0x4ca551++,_0x4ca551===_0x498682['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x1b9263){this['_view']['chatHeader']['isMaximized']=_0x1b9263;}['prepareLoadingMessage'](_0x1622b8){return _0x1622b8['isWebSearchEnabled']&&_0x1622b8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x1622b8['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x1622b8['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):i(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x36e1b5){return _0x36e1b5?_0x36e1b5['isWebSearchEnabled']&&_0x36e1b5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x36e1b5['isWebSearchEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x36e1b5['isReasoningEnabled']?i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):i(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x4a5a61,_0x33bb1b,_0x43d14f,_0x10ddd6){this['_view']['populateSourceResourceBalloon'](_0x4a5a61,_0x33bb1b,_0x43d14f,_0x10ddd6);}['closeSourceResourceBalloon'](_0x301ba5){this['_view']['closeSourceResourceBalloon'](_0x301ba5);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x1a1cdb,_0x5f3d50){this['_view']['chatFeed']['scrollToSuggestion'](_0x1a1cdb,_0x5f3d50);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class Ri extends _0x184d2c{['sections'];constructor(_0x3fb8ac,_0x14b477){super(_0x3fb8ac),this['sections']=_0x14b477,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x50ee8d){let _0x5e7afa=0x0,_0x37a457=0x0;for(const _0x2ac51a of this['sections']){const {resultsCount:_0x5762e9,totalItemsCount:_0x3f1d94}=_0x2ac51a['filter'](_0x50ee8d);_0x5e7afa+=_0x5762e9,_0x37a457+=_0x3f1d94;}return{'resultsCount':_0x5e7afa,'totalItemsCount':_0x37a457};}}class Mi extends _0xe814a3{['title'];['itemsViews'];['_itemsListView'];constructor(_0x270f2f,{title:_0x230bbc,items:_0x247345}){super(_0x270f2f);const _0x1f5e9d=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x230bbc,this['itemsViews']=_0x247345;const _0x571ac7=new _0x2f8c3b(_0x270f2f);_0x571ac7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x184d2c(_0x270f2f),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x1f5e9d['if']('isVisible','ck-hidden',_0x17cd74=>!_0x17cd74)]},'children':[_0x571ac7,this['_itemsListView']]});}['filter'](_0xc9b8ba){const _0x3c0903=this['itemsViews']['length'];let _0x4ee336=0x0;for(const _0x118da7 of this['itemsViews']){if(_0xc9b8ba){const _0x24f440=_0x118da7['isMatching'](_0xc9b8ba);_0x118da7['isVisible']=!!_0x24f440,_0x118da7['highlightText'](_0xc9b8ba);}else _0x118da7['isVisible']=!0x0,_0x118da7['highlightText'](null);_0x118da7['isVisible']&&_0x4ee336++;}return this['isVisible']=_0x4ee336>0x0,{'resultsCount':_0x4ee336,'totalItemsCount':_0x3c0903};}['getItem'](_0x4cc153){return this['itemsViews']['find'](_0xe2a42f=>_0xe2a42f['id']===_0x4cc153);}['removeItem'](_0x5de27c){const _0x213a2a=this['itemsViews']['indexOf'](_0x5de27c);-0x1!==_0x213a2a&&(this['itemsViews']['splice'](_0x213a2a,0x1),this['_itemsListView']['items']['remove'](_0x5de27c));}}class Li extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x18bd4a(_0xe814a3){['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(_0x48cf21,_0x57028c){super(_0x48cf21);const _0x1f165b=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x57028c['pinned']),this['set']('loadingState',null),this['id']=_0x57028c['id'];const {title:_0x5e51ed,createdAt:_0x53c235,active:_0x2f37cd=!0x1}=_0x57028c;this['_titleView']=new _0x30fef8(),this['_titleView']['text']=_0x5e51ed,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x58d144=this['_createCheckView'](),_0x36a8ba=this['_createPinButtonView'](_0x48cf21),_0x24fa86=this['_createMenuDropdownView'](),_0x1fd19a=this['_createEditInputView'](_0x48cf21,_0x5e51ed),_0x133f90=this['_createAcceptEditButtonView'](_0x48cf21,_0x1fd19a),_0x14300b=this['_createCancelEditButtonView'](_0x48cf21,_0x1fd19a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x36a8ba),this['actions']['add'](_0x24fa86),this['on']('change:isEdit',(_0x53587e,_0x994b07,_0x453e68)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x453e68?(this['actions']['add'](_0x133f90),this['actions']['add'](_0x14300b),this['mainContent']['add'](_0x1fd19a),_0x1fd19a['element']['focus']()):(this['actions']['add'](_0x36a8ba),this['actions']['add'](_0x24fa86),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2f37cd?'ck-ai-chat-history__item--active':'',_0x1f165b['if']('isVisible','ck-hidden',_0x79a791=>!_0x79a791),_0x1f165b['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',_0x1f165b['if']('loadingState','ck-hidden',_0x29a7b8=>!!_0x29a7b8)]},'children':_0x2f37cd?[_0x58d144]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1f165b['if']('loadingState','ck-hidden',_0x1a7153=>!_0x1a7153)]},'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',_0x1f165b['if']('loadingState','ck-hidden',_0xd754dc=>!!_0xd754dc)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1f165b['if']('loadingState','ck-hidden',_0x1f2940=>!_0x1f2940)]},'children':[{'text':_0x1f165b['to']('loadingState',_0x1eeb72=>_0x1eeb72?i(this['locale'],Li['LOADING_LABELS'][_0x1eeb72]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x53c235]}]},{'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'](_0x4dd3fb){this['_titleView']['text']=_0xe77682(_0x4dd3fb);}['updateLoadingState'](_0x3a4dfb,_0xb5bddd){this['set']('loadingState',_0xb5bddd?_0x3a4dfb:null);}['_createCheckView'](){const _0x33b019=new _0x32da72();return _0x33b019['set']({'content':_0x17291e}),_0x33b019;}['_createPinButtonView'](_0x4a378c){const _0x1fae07=new _0x5822be(_0x4a378c);return _0x1fae07['set']({'label':i(_0x4a378c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2d9711,'withText':!0x1,'tooltip':!0x0}),_0x1fae07['bind']('isOn')['to'](this,'pinned'),_0x1fae07['on']('execute',()=>{const _0x48b4f2=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x48b4f2});}),_0x1fae07;}['_createMenuDropdownView'](){const _0x1c95f1=_0x103d4b(this['locale'],_0x2d3ad3),_0x4551c3=_0x1c95f1['panelView']['children'];_0x1c95f1['buttonView']['set']({'label':i(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x478f8f}),_0x1c95f1['panelPosition']='sw';const _0x3aa1d4=new _0x5822be(this['locale']);_0x3aa1d4['label']=i(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x3aa1d4['withText']=!0x0,_0x3aa1d4['on']('execute',()=>{this['isEdit']=!0x0;});const _0x4128a9=new _0x5822be(this['locale']);_0x4128a9['label']=i(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x4128a9['withText']=!0x0,_0x4128a9['on']('execute',()=>{this['showConfirm'](i(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3789b3=new _0x184d2c(this['locale']),_0x162e34=new _0xe814a3(this['locale']);_0x162e34['children']['add'](_0x3aa1d4);const _0x1fb926=new _0xe814a3(this['locale']);return _0x1fb926['children']['add'](_0x4128a9),_0x3789b3['items']['addMany']([_0x162e34,_0x1fb926]),_0x4551c3['add'](_0x3789b3),_0x1c95f1;}['_createEditInputView'](_0x407b84,_0x22d5fc){const _0x5c020e=new _0x4ecc01(_0x407b84),_0x320f05=_0x5c020e['bindTemplate'];return _0x5c020e['value']=_0x22d5fc,_0x5c020e['extendTemplate']({'on':{'keydown':_0x320f05['to'](_0x271e64=>{'Enter'==_0x271e64['key']&&this['_commitEditInputValue'](_0x5c020e);})}}),_0x5c020e;}['_createAcceptEditButtonView'](_0x128b1a,_0x2a2deb){const _0x120e2f=new _0x5822be(_0x128b1a);return _0x120e2f['set']({'icon':_0x17291e,'withText':!0x1,'tooltip':i(_0x128b1a,'AI_CHAT_HISTORY_ACCEPT')}),_0x120e2f['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x120e2f['on']('execute',()=>{this['_commitEditInputValue'](_0x2a2deb);}),_0x120e2f;}['_commitEditInputValue'](_0x128d4c){const _0x19f9bb=_0x128d4c['element']['value']||'';this['_titleView']['text']=_0x19f9bb,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x19f9bb});}['_createCancelEditButtonView'](_0x38bed9,_0x23f1ab){const _0x10b7ea=new _0x5822be(_0x38bed9);return _0x10b7ea['set']({'icon':_0x127a77,'withText':!0x1,'tooltip':i(_0x38bed9,'AI_CHAT_HISTORY_CANCEL')}),_0x10b7ea['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x10b7ea['on']('execute',()=>{this['isEdit']=!0x1,_0x23f1ab['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x10b7ea;}['_createSpinnerView'](){const _0x3f284a=new gi('tiny');return _0x3f284a['isVisible']=!0x0,_0x3f284a;}['isMatching'](_0x36277e){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x36277e)?{'title':!0x0}:null;}['highlightText'](_0x1a12a0){this['_titleView']['highlightText'](_0x1a12a0);}}class Ot extends _0x2f8c3b{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x59cb39,_0x50ba6b){super(_0x59cb39),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x4e0f8f=new _0x127487(_0x59cb39,{'label':i(_0x59cb39,'AI_CHAT_HISTORY_HEADING'),'icon':Nt,'class':'ck-ai-header\x20ck-ai-header_history'});_0x50ba6b&&(this['resizeButton']=As(_0x59cb39,this),_0x4e0f8f['children']['add'](this['resizeButton'])),this['sectionsView']=new Ri(_0x59cb39,[]),this['sectionsView']['delegate'](...Yi)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x2b03cf=>!_0x2b03cf)]}}),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':[_0x4e0f8f,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x351750=new _0x4d988a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x53b47b=>i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x53b47b),'secondary':i(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x53e4c2=this['_createErrorView']();return _0x53e4c2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x1bdf72=>!_0x1bdf72)]}}),_0x351750['on']('render',()=>{_0x351750['children']['add'](_0x53e4c2,0x1);}),_0x351750['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x8ac91a=>!_0x8ac91a)]}}),_0x351750;}['_createSkeletonView'](){const _0x36af44=new $e(this['locale'],li['aiHistory']);return _0x36af44['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x52c50e=>!_0x52c50e)]}}),_0x36af44;}['_createErrorView'](){const _0x37fb5e=new _0x2f8c3b(this['locale']),_0x2e89bc=new _0x5822be(this['locale']);_0x2e89bc['set']({'withText':!0x1,'icon':_0x127a77,'class':'ck-ai-notification_error__dismiss-button'}),_0x2e89bc['bind']('isVisible')['to'](this,'hasItems',_0x5c7e51=>!!_0x5c7e51),_0x2e89bc['on']('execute',()=>{this['errorMessage']='';});const _0x4876a5=this['bindTemplate'];return _0x37fb5e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x4876a5['to']('errorMessage')}]},_0x2e89bc]}),_0x37fb5e;}['_createEmptyStateView'](){const _0x305e1a=new _0x5822be(this['locale']);_0x305e1a['set']({'label':i(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x1672ce,'class':'ck-ai-chat__start-conversation'}),_0x305e1a['on']('execute',()=>{this['fire']('openChat');});const _0xf506f4=new _0x2f8c3b(this['locale']);return _0xf506f4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x52e347=>!_0x52e347)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[i(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x305e1a]}),_0xf506f4;}['_createListItemViews'](_0x45f833,_0x1a4dee){const _0x53ad58=[];for(const _0x182ec7 of _0x45f833){const _0x1980b8=new Li(_0x1a4dee,_0x182ec7);_0x1980b8['delegate'](...Yi)['to'](this),_0x53ad58['push'](_0x1980b8);}return _0x53ad58;}['updateHistoryItemsWithCategories'](_0x48347c){const _0x2033c6=this['locale']||'en',_0x14d805=[];for(const _0x149c6c of _0x48347c){const _0x4b6381=this['_createListItemViews'](_0x149c6c['items'],_0x2033c6);_0x14d805['push'](new Mi(_0x2033c6,{'title':_0x149c6c['title'],'items':_0x4b6381}));}this['sectionsView']['sections']=_0x14d805,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x14d805),this['hasItems']=_0x48347c['some'](_0x2ab639=>_0x2ab639['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2ccfe9){for(const _0x203f59 of this['sectionsView']['sections']){const _0x5e42cd=_0x203f59['getItem'](_0x2ccfe9);if(_0x5e42cd){if(_0x203f59['removeItem'](_0x5e42cd),0x0===_0x203f59['itemsViews']['length']){const _0x365933=this['sectionsView']['sections']['indexOf'](_0x203f59);-0x1!==_0x365933&&(this['sectionsView']['sections']['splice'](_0x365933,0x1),this['sectionsView']['items']['remove'](_0x203f59));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x13592e,_0x141582){for(const _0x596be2 of this['sectionsView']['sections']){const _0x532872=_0x596be2['getItem'](_0x13592e);if(_0x532872){_0x532872['updateTitle'](_0x141582);break;}}}['updateItemLoadingState'](_0x518c01,_0x4d7613,_0x3122c1){for(const _0x337f3c of this['sectionsView']['sections']){const _0x11cd9b=_0x337f3c['getItem'](_0x518c01);if(_0x11cd9b){_0x11cd9b['updateLoadingState'](_0x4d7613,_0x3122c1);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x40fa38=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x40fa38);}}}const Yi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x55a427{static get['requires'](){return[it];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5a60d0){super(_0x5a60d0);const _0x19d3e0=this['context']['plugins']['get']('AITabs');this['_historyView']=new Ot(this['context']['locale'],_0x19d3e0['showResizeButton']),this['_historyView']['delegate'](...Yi)['to'](this),_0x19d3e0['view']['addTab']({'id':'history','buttonLabel':i(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Nt,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x50b03d){this['_historyView']['removeHistoryItem'](_0x50b03d);}['updateItems'](_0x5790fc){this['_historyView']['updateHistoryItemsWithCategories'](_0x5790fc);}['updateItemTitle'](_0x449a1e,_0xd53a35){this['_historyView']['updateItemTitle'](_0x449a1e,_0xd53a35);}['updateItemLoadingState'](_0x2ba8a7,_0x4639be,_0x3c1d17){this['_historyView']['updateItemLoadingState'](_0x2ba8a7,_0x4639be,_0x3c1d17);}['setLoadingSkeleton'](_0x33017d){this['_historyView']['isLoading']=_0x33017d;}['showError'](_0x435d8b){this['_historyView']['errorMessage']=_0x435d8b;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x125f5e){this['_historyView']['isMaximized']=_0x125f5e;}}class ir extends ts(){['id'];['createdAt'];constructor({id:_0x5da027,title:_0x364488,createdAt:_0xe7a967,updatedAt:_0x3d9a95,pinned:_0x12b6bf}){super(),this['id']=_0x5da027,this['createdAt']=new Date(_0xe7a967),this['set']('title',_0x364488),this['set']('updatedAt',_0x3d9a95?new Date(_0x3d9a95):null),this['set']('pinned',_0x12b6bf||!0x1);}['updateTitle'](_0x2b5bea){this['set']('title',_0xe77682(_0x2b5bea)),this['updatedAt']=new Date();}['updatePinned'](_0xecef51){this['set']('pinned',_0xecef51),this['updatedAt']=new Date();}}class Ht extends _0x263abf(){['items']=[];['connector'];['group'];constructor({connector:_0x4ec7f0,group:_0x43de1c}){super(),this['connector']=_0x4ec7f0,this['group']=_0x43de1c;}async['init'](){try{const _0x3f8997=this['connector']['fetchConversations'](this['group']),_0x4d3358=await _0x3f8997['getConversations']();this['loadItems'](_0x4d3358);}catch(_0x50067){this['fire']('error',{'error':_0x50067,'operation':'init'});}}['addItem'](_0x12885a){this['items']['push'](_0x12885a);}async['removeItem'](_0x13cb0c){const _0x2ffa7f=this['items']['findIndex'](_0x58e32d=>_0x58e32d['id']===_0x13cb0c);if(-0x1===_0x2ffa7f)return!0x1;try{return await this['connector']['deleteConversation'](_0x13cb0c)['execute'](),this['items']['splice'](_0x2ffa7f,0x1),this['fire']('itemRemoved',{'itemId':_0x13cb0c}),!0x0;}catch(_0x46881c){return this['fire']('error',{'error':_0x46881c,'operation':'removeItem','itemId':_0x13cb0c}),!0x1;}}['getItem'](_0x3776b3){return this['items']['find'](_0xd3b62a=>_0xd3b62a['id']===_0x3776b3);}async['updateItemTitle'](_0x27c7d7,_0x385da2){const _0x185f9d=this['getItem'](_0x27c7d7);if(!_0x185f9d)return!0x1;try{return await this['connector']['updateConversation'](_0x27c7d7,{'title':_0x385da2})['getResult'](),_0x185f9d['updateTitle'](_0x385da2),this['fire']('itemUpdated',{'itemId':_0x27c7d7,'updates':{'title':_0x385da2}}),!0x0;}catch(_0xf4851d){return this['fire']('error',{'error':_0xf4851d,'operation':'updateItemTitle','itemId':_0x27c7d7}),!0x1;}}async['updateItemPinned'](_0xe8f0c6,_0x1fb2bc){const _0x11f3a8=this['getItem'](_0xe8f0c6);if(!_0x11f3a8)return!0x1;try{return await this['connector']['updateConversation'](_0xe8f0c6,{'pinned':_0x1fb2bc})['getResult'](),_0x11f3a8['updatePinned'](_0x1fb2bc),this['fire']('itemUpdated',{'itemId':_0xe8f0c6,'updates':{'pinned':_0x1fb2bc}}),!0x0;}catch(_0x389634){return this['fire']('error',{'error':_0x389634,'operation':'updateItemPinned','itemId':_0xe8f0c6}),!0x1;}}['loadItems'](_0x4082bc){try{this['items']=[],_0x4082bc['map'](_0x258893=>{this['addItem'](new ir(_0x258893));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x41d33c){this['fire']('error',{'error':_0x41d33c,'operation':'loadItems'});}}['getItems'](_0x119c2f={}){const _0x98e843=void 0x0!==_0x119c2f['pinned']&&_0x119c2f['pinned'],_0x4f6498=_0x119c2f['from']?new Date(_0x119c2f['from']['getFullYear'](),_0x119c2f['from']['getMonth'](),_0x119c2f['from']['getDate']()):null,_0x1624bb=_0x119c2f['to']?new Date(_0x119c2f['to']['getFullYear'](),_0x119c2f['to']['getMonth'](),_0x119c2f['to']['getDate']()):null;return this['items']['filter'](_0x3474c5=>{if(_0x3474c5['pinned']!==_0x98e843)return!0x1;if(_0x1624bb){const _0x26fadb=new Date(_0x3474c5['createdAt']['getFullYear'](),_0x3474c5['createdAt']['getMonth'](),_0x3474c5['createdAt']['getDate']());return _0x4f6498?_0x4f6498['getTime']()===_0x1624bb['getTime']()?_0x26fadb['getTime']()===_0x4f6498['getTime']():_0x26fadb<_0x1624bb&&_0x26fadb>=_0x4f6498:_0x26fadb<_0x1624bb;}return!0x0;});}}class jt extends _0x55a427{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[tt,q,xt,it];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](tt),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](q);const _0x58b017=this['context']['plugins']['get'](it);try{const _0x4f1a83=this['_aiChatController']['getGroupId']();this['history']=new Ht({'connector':this['_aiConnector'],'group':_0x4f1a83}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x53903b,_0x24e933)=>{this['_setItemLoading'](_0x24e933['id'],'remove'),this['_handleRemove'](_0x24e933['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x198ad5,_0x5924ab)=>{this['_setItemLoading'](_0x5924ab['id'],'rename'),this['_handleEditTitle'](_0x5924ab['id'],_0x5924ab['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1877de,_0x4677c6)=>{void 0x0!==_0x4677c6['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4677c6['itemId'],_0x4677c6['updates']['title']),void 0x0!==_0x4677c6['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4677c6['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x483719,_0x3a11d3)=>{this['_aiChatController']['handleRemovedConversation'](_0x3a11d3['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3a11d3['itemId']),this['_clearItemLoading'](_0x3a11d3['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x22206e,_0x433ac3)=>{this['_handleHistoryErrorUI'](_0x433ac3['error'],_0x433ac3['operation'],_0x433ac3['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x258a9b,_0x1dd539)=>{this['_handleSelectConversation'](_0x1dd539['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x39ae48,_0xc89669)=>{const _0x4ef86b=_0xc89669['pinned']?'pin':'unpin';this['_setItemLoading'](_0xc89669['id'],_0x4ef86b),this['_handleTogglePin'](_0xc89669['id'],_0xc89669['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x58b017['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x58b017['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x58b017,'resizedTabs',(_0x593cc9,_0x139078)=>{this['_setIsMaximized'](_0x139078);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x58b017['resize']();});}catch(_0x27fe72){this['_handleHistoryErrorUI'](_0x27fe72,'init');}}async['_handleEditTitle'](_0x52a1c4,_0x211db5){await this['history']['updateItemTitle'](_0x52a1c4,_0x211db5);}async['_handleTogglePin'](_0x366f3e,_0xa95a1a){await this['history']['updateItemPinned'](_0x366f3e,_0xa95a1a);}async['_handleRemove'](_0x3303f5){await this['history']['removeItem'](_0x3303f5);}async['_handleSelectConversation'](_0xd5b3a3){await this['_aiChatController']['loadConversation'](_0xd5b3a3);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x257883=this['_aiChatController']['activeConversation']?.['id'],_0x320ac6=this['_getCategorizedItems']()['map'](_0x102afa=>({'title':_0x102afa['title'],'items':_0x102afa['items']['map'](_0x348d1a=>({'id':_0x348d1a['id'],'title':_0x348d1a['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x348d1a['createdAt'])['toLocaleDateString'](),'active':_0x348d1a['id']===_0x257883,'pinned':_0x348d1a['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x320ac6);}['_setItemLoading'](_0xf507f8,_0x14002){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xf507f8,_0x14002,!0x0);}['_clearItemLoading'](_0x5e06e6){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5e06e6,null,!0x1);}['_handleHistoryErrorUI'](_0x2eafd2,_0x118aa2,_0x410f7e){const _0x51520e=this['_generateErrorMessage'](_0x118aa2,_0x410f7e);this['_aiChatHistoryUi']['showError'](_0x51520e),_0x410f7e&&this['_clearItemLoading'](_0x410f7e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x59f3eb,_0x16d6d4){const _0x5e81a5=_0x16d6d4?this['history']['getItem'](_0x16d6d4):null,_0x119e25=_0x5e81a5?.['title']||i(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x59f3eb){case'updateItemTitle':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x119e25);case'updateItemPinned':{const _0x4d3d24=i(this['context']['locale'],_0x5e81a5?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4d3d24,_0x119e25]);}case'removeItem':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x119e25);case'init':case'loadItems':return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return i(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x13be1c=new Date(),_0x5618c2=new Date(_0x13be1c['getFullYear'](),_0x13be1c['getMonth'](),_0x13be1c['getDate']()),_0x4930a6=new Date(_0x5618c2);_0x4930a6['setDate'](_0x4930a6['getDate']()-0x1);const _0x3d9fca=new Date(_0x5618c2);_0x3d9fca['setDate'](_0x3d9fca['getDate']()-0xe);const _0x2e9fd4=this['history']['getItems']({'pinned':!0x0}),_0x4d7d70=this['history']['getItems']({'from':_0x5618c2,'to':_0x5618c2}),_0x2b8feb=this['history']['getItems']({'from':_0x4930a6,'to':_0x4930a6}),_0x1da2eb=this['history']['getItems']({'from':_0x3d9fca,'to':_0x4930a6}),_0x571f0b=this['history']['getItems']({'to':_0x3d9fca}),_0x591ba4=[];return _0x2e9fd4['length']>0x0&&_0x591ba4['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2e9fd4}),_0x4d7d70['length']>0x0&&_0x591ba4['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4d7d70}),_0x2b8feb['length']>0x0&&_0x591ba4['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x2b8feb}),_0x1da2eb['length']>0x0&&_0x591ba4['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1da2eb}),_0x571f0b['length']>0x0&&_0x591ba4['push']({'title':i(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x571f0b}),_0x591ba4;}['_setIsMaximized'](_0x518b63){this['_aiChatHistoryUi']['setIsMaximized'](_0x518b63);}}class G extends _0x55a427{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ka extends _0x55a427{static get['requires'](){return[q,D,z,G];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x240fe1){super(_0x240fe1),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),this['context']['config']['define']('ai.chat.initialConversation','new');}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](q)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](q)['startConversation']();}async['sendMessage']({message:_0x190823,attributes:_0x257604}){await this['context']['plugins']['get'](q)['sendMessage']({'message':_0x190823,'attributes':_0x257604});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](q)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](q)['focusPromptInput']();}['registerToolDataCallback'](_0x571704){this['context']['plugins']['get'](q)['_registerToolDataCallback'](_0x571704);}}class co extends Ut{constructor(_0x314f8c){super(_0x314f8c);const _0x52b5c7=_0x314f8c['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x52b5c7,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x16b7cb=this['editor']['plugins']['get']('AITabs')['view'];_0x16b7cb['isVisible']=!_0x16b7cb['isVisible'];}}class Pt extends _0x15e219{static get['requires'](){return[it];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5ebc0d=this['editor'];_0x5ebc0d['commands']['add']('toggleAi',new co(_0x5ebc0d)),_0x5ebc0d['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3b5614=this['_createAIUIButton'](_0x5822be);return _0x3b5614['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3b5614;}),_0x5ebc0d['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x213524=this['_createAIUIButton'](_0x11ed9d);return _0x213524['set']({'role':'menuitemcheckbox'}),_0x213524;});}['_createAIUIButton'](_0x4da404){const _0x238efc=this['editor'],_0xf6ddd4=_0x238efc['commands']['get']('toggleAi'),_0x3ddd58=new _0x4da404(_0x238efc['locale']);return _0x3ddd58['set']({'label':i(_0x238efc['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0xb2c2db,'isToggleable':!0x0}),_0x3ddd58['bind']('isEnabled')['to'](_0xf6ddd4),_0x3ddd58['bind']('isOn')['to'](_0xf6ddd4,'value',_0x321072=>!!_0x321072),this['listenTo'](_0x3ddd58,'execute',()=>{_0xf6ddd4['execute']();}),_0x3ddd58;}}const F=['applySuggestion','insertSuggestion','showNext','showPrevious'];class gs extends _0x2f8c3b{['_errorView'];constructor(_0x5b501f){super(_0x5b501f),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x4ead0b){this['showError'](_0x4ead0b);}['showError'](_0xf0aa5){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xf0aa5,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x22ff01=new _0x2f8c3b(this['locale']),_0x408ede=new _0x2f8c3b(this['locale']);return _0x408ede['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x22ff01['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x5a970a=>!_0x5a970a)]},'children':[_0x408ede]}),_0x22ff01;}}const $=0xa;class H extends _0x55a427{static get['requires'](){return[D];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x132842){const {id:_0x14f1aa}=this['_currentConfig']??{};this['_currentConfig']=_0x132842;const {id:_0x46236a}=this['_currentConfig'];this['isOpen']&&_0x14f1aa===_0x46236a?this['_updateDialog']():this['_showDialog']();}['close'](){T(this['context'])['plugins']['get']('Dialog')['hide']();}['_updateDialog'](){const _0x3470f5=T(this['context'])['plugins']['get']('Dialog'),{icon:_0x1956fc,title:_0x231d04}=this['_currentConfig'];_0x3470f5['view']?.['headerView']&&(_0x3470f5['view']['headerView']['label']=_0x231d04,_0x3470f5['view']['headerView']['iconView']&&_0x1956fc&&(_0x3470f5['view']['headerView']['iconView']['content']=_0x1956fc)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x3470f5['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](D)['showFakeVisualSelection'](this['_currentConfig']['ranges'],'ai-balloon-'+this['_currentConfig']['index'],!0x0,!0x0);}['_hideFakeVisualSelection'](_0x53c50a){this['context']['plugins']['get'](D)['hideFakeVisualSelection']('ai-balloon-'+_0x53c50a);}['_showDialog'](){const _0x27bc66=T(this['context'])['plugins']['get']('Dialog'),{id:_0x1ad8d3,title:_0x15d0da,icon:_0x3cccec,class:_0x1b8a4f,mainView:_0x152f21}=this['_currentConfig'];_0x152f21['delegate'](...F)['to'](this),_0x27bc66['show']({'title':_0x15d0da,'icon':_0x3cccec,'hasCloseButton':!0x0,'id':_0x1ad8d3,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x1b8a4f||''),'content':_0x152f21,'onShow':_0x1bc9c8=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x4be556=this['_getSelectionElements']();_0x4be556&&_0x4be556[0x0]&&_0x2b7d47({'target':_0x4be556[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x1bc9c8['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x1ad8d3});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](this['_currentConfig']['index']),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x1ad8d3}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2a592d,_0xeec889){if(!_0xeec889)return null;const _0x287aa2=this['_getSelectionElements']();if(!_0x287aa2||0x0===_0x287aa2['length'])return{'left':Math['round'](_0xeec889['left']+_0xeec889['width']/0x2-_0x2a592d['width']/0x2),'top':Math['round'](_0xeec889['top']+_0xeec889['height']/0x2-_0x2a592d['height']/0x2)};const _0xf2022b=Math['round'](_0xeec889['left']+_0xeec889['width']/0x2-_0x2a592d['width']/0x2),_0x27c753=_0x287aa2['map'](_0x29b81a=>new _0x7bf0be(_0x29b81a)),_0x11469a=_0x2a592d['height'];return{'left':_0xf2022b,'top':this['_calculateOptimalTopPosition'](_0x27c753,_0x11469a,_0xeec889)};}['_calculateOptimalTopPosition'](_0x2f02c1,_0x4b994b,_0x56dee8){const _0x456269=new _0x7bf0be(_0x461dbe['window']),_0x1b2118=_0x2f02c1['map'](_0x2c539d=>_0x2c539d['getVisible']())['filter'](_0xa6c47c=>_0xa6c47c),_0x9f283d=_0x7bf0be['getBoundingRect'](_0x1b2118);if(!_0x9f283d)return Math['round'](_0x56dee8['top']+_0x56dee8['height']/0x2);const _0x4d6f1f=_0x456269['getIntersection'](_0x9f283d);if(!_0x4d6f1f)return Math['round'](_0x56dee8['top']+_0x56dee8['height']/0x2);const _0x438b91=_0x56dee8['getVisible'](),_0xbde47d=_0x438b91&&_0x9f283d['height']>_0x438b91['height'],_0x3c0218=_0x4d6f1f['top'],_0x13f931=_0x4d6f1f['bottom'];if(_0xbde47d){const _0x5c5a4e=(_0x438b91||_0x456269)['height']/0x2-_0x4b994b/0x2,_0x565f4c=_0x3c0218-$-_0x56dee8['top'],_0x266845=_0x56dee8['bottom']-_0x13f931-$;return _0x565f4c>=_0x4b994b?Math['max']($,_0x3c0218-_0x4b994b-$):_0x266845>=_0x4b994b?_0x13f931+$:Math['max']($,_0x5c5a4e);}const _0x5ee0ff=_0x3c0218-_0x4b994b,_0xeb65ca=_0x56dee8['bottom']-_0x13f931-$,_0x452e6b=_0x3c0218-$-_0x56dee8['top'];let _0xfe37d0;if(_0xeb65ca>=_0x4b994b)_0xfe37d0=_0x13f931+$;else{if(_0x452e6b>=_0x4b994b)_0xfe37d0=_0x5ee0ff-$;else _0xfe37d0=_0x3c0218+_0x9f283d['height']/0x2-_0x4b994b/0x2;}return _0xfe37d0;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x203a8e=T(this['context']);this['listenTo'](_0x203a8e['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x4471a1,data:{newRange:_0x1bfdcc}}of _0x203a8e['model']['document']['differ']['getChangedMarkers']())if(_0x4471a1['startsWith'](R+':')&&(_0x1bfdcc&&(_0x1bfdcc['start']['isEqual'](_0x1bfdcc['end'])||'$graveyard'==_0x1bfdcc['root']['rootName'])||null==_0x1bfdcc)){const _0xe7ccb0=i(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xe7ccb0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x5a88bb=T(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x5a88bb['model']['document']);}['_getSelectionElements'](){const _0x3db9e0=T(this['context']);return _0x7ab312(_0x3db9e0['editing'],[..._0x3db9e0['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3db9e0['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class ls extends _0x191b6d{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x24e3f4,_0x1996d3={}){super(_0x24e3f4),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1996d3};const _0x5eb045=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x5eb045?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x5654c8){this['showChangesButton']['isEnabled']=_0x5654c8;}['_setupRatingButtons'](){this['likeButton']=new _0x5822be(this['locale']),this['likeButton']['set']({'icon':_0x28b807,'label':i(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x5822be(this['locale']),this['dislikeButton']['set']({'icon':_0x14a807,'label':i(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x5822be(this['locale']),this['copyButton']['set']({'icon':_0xc73b1c,'label':i(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x27109f=new _0x32da72();_0x27109f['set']({'content':_0x29ef47}),_0x27109f['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'](_0x27109f);}['_setupShowChangesButton'](){this['showChangesButton']=new _0x5822be(this['locale']),this['showChangesButton']['set']({'icon':_0x1d82c1,'label':i(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges']}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x158285=>_0x158285?_0x57a2a6:_0x1d82c1),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class Q extends gs{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x4416de,_0x2cf8bf){super(_0x4416de);const _0x520823=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _0x2afd45(),this['_keystrokes']=new _0x16d287(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1842f7({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x2cf8bf,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new cs(_0x4416de),this['_partToolbarView']=new us(_0x4416de,_0x2cf8bf['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x2cf8bf),this['_stateView']=new ps(_0x4416de),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ls(_0x4416de,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new fs(_0x4416de,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x367982,_0x50b0e8,_0x41f93b,_0x41e9ad)=>{let _0x28f54c,_0x257c88;'pending'===_0x41e9ad?(_0x28f54c=this['_partToolbarView'],_0x257c88=this['_stateView']):(_0x28f54c=this['_stateView'],_0x257c88=this['_partToolbarView']),this['_stateView']['setState'](_0x41f93b),_0x28f54c['isVisible']=!0x1,_0x257c88['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x520823['to']('_state',_0x318401=>'ck-ai-chat-balloon-main_state_'+_0x318401)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2cf8bf);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0x367060){_0x367060?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x367060);}['setState'](_0x1643ca){this['_state']=_0x1643ca;}['showError'](_0x30b02f){super['showError'](_0x30b02f),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x4f54d6){super['showBlockingError'](_0x4f54d6),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x570400){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x570400;}['togglePartToolbarEnabled'](_0x24bedb){this['_partToolbarView']['isEnabled']=_0x24bedb;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1ea0ab,showSuggestButton:_0x488bc8}){_0x1ea0ab=_0x1ea0ab&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x488bc8=_0x488bc8&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1ea0ab,'showSuggestButton':_0x488bc8});}['_createNextButtonView'](){const _0x441562=new _0x5822be(this['locale']);return _0x441562['set']({'icon':_0xd6914d,'label':i(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x441562['on']('execute',()=>{this['fire']('showNext');}),_0x441562;}['_createPreviousButtonView'](){const _0x42091d=new _0x5822be(this['locale']);return _0x42091d['set']({'icon':_0x5d380f,'label':i(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x42091d['on']('execute',()=>{this['fire']('showPrevious');}),_0x42091d;}}class fs extends _0x2f8c3b{constructor(_0x44bf07,_0x522a89){super(_0x44bf07),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x522a89});}}class qt extends _0x15e219{static get['requires'](){return[_0x724f59,H];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x5a0db1){super(_0x5a0db1),this['set']('showDiff',!0x1);}['open'](_0x589ec6){const _0x69583c=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x69583c['plugins']['get']('AIBalloon')['open']({..._0x589ec6,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x589ec6['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x589ec6['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x340225){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x340225);}['setState'](_0x5be098){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x5be098);}['_createChatBalloonView'](){const _0x578382=this['editor'],_0x7fd52b=_0x578382['plugins']['get']('AIBalloon'),_0x406fa0=_0x578382['commands']['get']('trackChanges');let _0x421972=_0x578382['config']['get']('ai.availableReplyActions')||[...J];_0x578382['plugins']['has']('TrackChanges')||(_0x421972=_0x421972['filter'](_0x1b3fb8=>'insertSuggestion'!=_0x1b3fb8));const _0x5cb558=new Q(_0x578382['locale'],{'availableActions':_0x421972,'showApplyButton':!0x0,'showSuggestButton':!!_0x406fa0});return _0x5cb558['bind']('showDiff')['to'](this),_0x5cb558['delegate'](...W)['to'](this),_0x5cb558['delegate']('showPrevious','showNext')['to'](this),_0x7fd52b['delegate']('dialogClosed')['to'](this),_0x5cb558['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5cb558['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5cb558['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x406fa0&&_0x5cb558['bind']('isTrackChangesOn')['to'](_0x406fa0,'value'),_0x5cb558['render'](),_0x5cb558;}['_toggleRotatorButtonsInDialogHeader'](_0x18e872){const _0x26a168=this['editor'],_0x37fa1f=_0x26a168['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x18e872),_0x37fa1f['has'](this['_chatBalloonView']['previousButtonView'])||(_0x37fa1f['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x26a168['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x37fa1f['remove'](this['_chatBalloonView']['previousButtonView']),_0x37fa1f['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class Na extends _0x15e219{static get['requires'](){return[Pt,qt,zt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Vt(_0x2aa9ae){const {editor:_0x6d5cfd,action:_0x434df2,withText:_0x8ecd11=!0x1,withIcon:_0x134bfa=!0x0,isInDropdown:_0x22d173=!0x0,shouldPreventFocus:_0x456ba3=!0x1}=_0x2aa9ae;return()=>{const _0x5d2728=_0x6d5cfd['locale'],_0x13a612=new _0x5822be(_0x5d2728),_0xa68634=_0x13a612['bindTemplate'];_0x22d173&&_0x13a612['extendTemplate']({'on':{'mouseenter':_0xa68634['to'](()=>{_0x456ba3&&_0x456ba3()||_0x13a612['focus']();})}});const _0x38b067=_0x434df2['icon']??_0x434df2['parent']?.['icon'];return _0x13a612['set']({'label':_0x434df2['displayedPrompt'],'withText':_0x8ecd11,'role':'menuitem','icon':_0x134bfa?_0x38b067??yt:void 0x0,'tooltip':!_0x8ecd11,'class':'ck-ai-quick-actions-button','isEnabled':_0x434df2['isEnabled']}),_0x13a612['on']('execute',()=>{_0x6d5cfd['editing']['view']['focus'](),_0x6d5cfd['commands']['execute']('aiQuickAction',_0x434df2);}),_0x13a612;};}class Ps extends _0x344c64{['arrowView'];constructor(_0x1ef687,_0x5f0f9d){super(_0x1ef687,_0x5f0f9d);const _0x217c2f=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x3374bf=>String(_0x3374bf)),'data-cke-tooltip-disabled':_0x217c2f['to']('isOn')},'on':{'mouseenter':_0x217c2f['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x15d220=new _0x32da72();return _0x15d220['content']=_0x518767,_0x15d220['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x15d220;}}class Ls extends _0x184d2c{['_allListItems'];['_allSearchableItems'];constructor(_0x1fbef3,_0x93a2e6,_0x564f95){super(_0x1fbef3),this['_allListItems']=_0x93a2e6,this['_allSearchableItems']=_0x564f95;}['filter'](_0x3724ae){if(!_0x3724ae)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5a3feb=_0x3724ae['source']['toLowerCase']()['trim'](),_0x53a541=this['_allSearchableItems']['filter'](_0x5af0b8=>(_0x5af0b8['groupLabel']?_0x5af0b8['label']+'\x20('+_0x5af0b8['groupLabel']+')':_0x5af0b8['label'])['toLowerCase']()['includes'](_0x5a3feb));return this['items']['clear'](),this['items']['addMany'](_0x53a541['sort']((_0x44a5d,_0x323310)=>{const _0x2d9498=_0x44a5d['groupLabel'],_0x36cbc6=_0x323310['groupLabel'];return _0x2d9498||_0x36cbc6?_0x2d9498?0x1:-0x1:0x0;})['map'](_0x4d5832=>_0x4d5832['item'])),this['_highlightQuery'](_0x5a3feb,_0x53a541),{'resultsCount':_0x53a541['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x59c637,_0x4e2804){if(!_0x59c637)return;const _0x5c7878=new RegExp(_0xfcca98(_0x59c637),'gi');_0x4e2804['forEach'](_0x4b0cd9=>{_0x4b0cd9['highlightViews']&&_0x4b0cd9['highlightViews']['forEach'](_0x488b76=>{'function'==typeof _0x488b76['highlightText']&&_0x488b76['highlightText'](_0x5c7878);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x312c76=>{_0x312c76['highlightViews']&&_0x312c76['highlightViews']['forEach'](_0x10fdfa=>{'function'==typeof _0x10fdfa['highlightText']&&_0x10fdfa['highlightText'](null);});});}}const Qs='menu',Gs='menuitem';class ao extends _0x2f8c3b{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3d4f02,_0x532f4a,_0x28d017,_0x21afde,_0x488d1d=!0x1){const _0x4236c8=_0x3d4f02['locale'];super(_0x4236c8),this['_bodyCollection']=_0x21afde,this['_hasSearch']=_0x488d1d;const _0x33ec56=this['_createListItems'](_0x3d4f02,_0x532f4a,_0x28d017);this['optionsListView']=new Ls(_0x4236c8,_0x33ec56,this['_allSearchableItems']),this['optionsListView']['role']=Qs,this['optionsListView']['items']['addMany'](_0x33ec56),this['focusTracker']=new _0x2afd45(),this['keystrokes']=new _0x16d287(),_0x488d1d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x33ec56,this['focusCycler']=new _0x1842f7({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x488d1d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1f3f57=_0x488d1d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x36b2b7(_0x1f3f57),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x4236c8['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x4d988a(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':i(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x57cf90=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x57cf90);}['_createListItems'](_0x47cf97,_0x19a49c,_0x1757fb){const _0x14f0d1=new _0x36b2b7();return _0x19a49c['forEach'](_0x3c2ad0=>{if('actions'in _0x3c2ad0){const {listItem:_0x8e041f}=this['_createActionGroupButton'](_0x47cf97,_0x3c2ad0,_0x1757fb);_0x14f0d1['add'](_0x8e041f),_0x3c2ad0['actions']['forEach'](_0x136098=>{this['_createActionButton'](_0x47cf97,_0x136098,_0x3c2ad0['label'],_0x3c2ad0['icon']);const {listItem:_0x5567f6,highlightViews:_0x4c7b77}=this['_createSearchResultActionButton'](_0x47cf97,_0x136098,_0x3c2ad0['label'],_0x3c2ad0['icon']);this['_allSearchableItems']['push']({'item':_0x5567f6,'label':_0x136098['displayedPrompt'],'groupLabel':_0x3c2ad0['label'],'highlightViews':_0x4c7b77});});}else{const {listItem:_0x4e732d}=this['_createActionButton'](_0x47cf97,_0x3c2ad0);_0x14f0d1['add'](_0x4e732d);const _0xb912a8=_0x4e732d['children']['first'];if(_0xb912a8){const {listItem:_0x14f85e,highlightViews:_0x4c9720}=this['_createSearchResultActionButton'](_0x47cf97,_0x3c2ad0);this['_allSearchableItems']['push']({'item':_0x14f85e,'label':_0xb912a8['label']||'','highlightViews':_0x4c9720});}}}),_0x14f0d1;}['_createActionButton'](_0x15ca6f,_0x471ee0,_0x5670bd,_0x4b3e85){const _0x54b70b=new _0xe814a3(this['locale']);if(_0x5670bd&&_0x4b3e85){const _0x1c23c3=new _0x5822be(this['locale']),_0x2a5b4e=_0x1c23c3['bindTemplate'],_0x7b8e52=new _0x30fef8();_0x7b8e52['text']=_0x471ee0['displayedPrompt'];const _0x353c09=new _0x30fef8();_0x353c09['text']=_0x5670bd;const _0x30dbaf=new _0x32da72();_0x30dbaf['content']=_0x4b3e85,_0x30dbaf['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x87c893=new _0x2f8c3b(this['locale']);_0x87c893['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x2974a4=new _0x2f8c3b(this['locale']);return _0x2974a4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1c23c3['set']({'label':_0x471ee0['displayedPrompt']+'\x20('+_0x5670bd+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1c23c3['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x7b8e52,_0x87c893,_0x30dbaf,_0x353c09,_0x2974a4],'on':{'mouseenter':_0x2a5b4e['to'](()=>{this['_isSearchFocused']()||_0x1c23c3['focus']();}),'click':_0x2a5b4e['to'](()=>{_0x1c23c3['fire']('execute');})}}),_0x1c23c3['on']('execute',()=>{_0x15ca6f['editing']['view']['focus'](),_0x15ca6f['commands']['execute']('aiQuickAction',_0x471ee0);}),_0x54b70b['children']['add'](_0x1c23c3),{'listItem':_0x54b70b,'highlightViews':[_0x7b8e52,_0x353c09]};}{const _0xffc064=new _0x480fc1(),_0x247fdb=new _0x5822be(this['locale'],_0xffc064),_0x3b03bc=_0x247fdb['bindTemplate'],_0x135c6f=_0x471ee0['icon']??_0x471ee0['parent']?.['icon'],_0x3bdb9f=void 0x0!==_0x471ee0['icon'];return _0x247fdb['set']({'label':_0x471ee0['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':_0x3bdb9f?_0x135c6f??yt:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x247fdb['extendTemplate']({'on':{'mouseenter':_0x3b03bc['to'](()=>{this['_isSearchFocused']()||_0x247fdb['focus']();})}}),_0x247fdb['on']('execute',()=>{_0x15ca6f['editing']['view']['focus'](),_0x15ca6f['commands']['execute']('aiQuickAction',_0x471ee0);}),_0x54b70b['children']['add'](_0x247fdb),{'listItem':_0x54b70b,'highlightViews':[_0xffc064]};}}['_createSearchResultActionButton'](_0x1a62fa,_0x15b1d3,_0x1e69a1,_0x2eb7cf){return _0x1e69a1&&_0x2eb7cf?this['_createSearchResultGroupedActionButton'](_0x1a62fa,_0x15b1d3,_0x1e69a1,_0x2eb7cf):this['_createSearchResultIndividualActionButton'](_0x1a62fa,_0x15b1d3);}['_createSearchResultGroupedActionButton'](_0xf71241,_0x42aad8,_0x16cb5e,_0x1930df){const _0x294ba0=new _0xe814a3(this['locale']),_0x53ea91=new _0x5822be(this['locale']),_0x56621a=_0x53ea91['bindTemplate'],{view:_0x127b76,highlightView:_0x182bd3}=this['_createSearchResultGroupRow'](_0x16cb5e,_0x1930df),{view:_0x362b9e,highlightView:_0x24faad}=this['_createSearchResultActionRow'](_0x42aad8['displayedPrompt']),_0x48d968=this['_createSearchResultContentView'](_0x127b76,_0x362b9e);return _0x53ea91['set']({'label':_0x42aad8['displayedPrompt'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x53ea91['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x48d968],'on':{'mouseenter':_0x56621a['to'](()=>{this['_isSearchFocused']()||_0x53ea91['focus']();}),'click':_0x56621a['to'](()=>{this['_handleSearchResultButtonClick'](_0x53ea91);})}}),this['_setupActionButtonExecution'](_0x53ea91,_0xf71241,_0x42aad8),_0x294ba0['children']['add'](_0x53ea91),{'listItem':_0x294ba0,'highlightViews':[_0x182bd3,_0x24faad]};}['_createSearchResultIndividualActionButton'](_0x5128d8,_0x25d45e){const _0x41e997=new _0xe814a3(this['locale']),_0x2d9b0b=new _0x480fc1(),_0x27d845=new _0x5822be(this['locale'],_0x2d9b0b),_0x1ceb64=_0x27d845['bindTemplate'];return _0x27d845['set']({'label':_0x25d45e['displayedPrompt'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x27d845['extendTemplate']({'on':{'mouseenter':_0x1ceb64['to'](()=>{this['_isSearchFocused']()||_0x27d845['focus']();})}}),this['_setupActionButtonExecution'](_0x27d845,_0x5128d8,_0x25d45e),_0x41e997['children']['add'](_0x27d845),{'listItem':_0x41e997,'highlightViews':[_0x2d9b0b]};}['_createSearchResultGroupRow'](_0x160711,_0xf41053){const _0xcf4f31=new _0x2f8c3b(this['locale']),_0x4509f2=new _0x32da72();_0x4509f2['content']=_0xf41053,_0x4509f2['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x28c991=new _0x30fef8();return _0x28c991['text']=_0x160711,_0xcf4f31['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4509f2,_0x28c991]}),{'view':_0xcf4f31,'highlightView':_0x28c991};}['_createSearchResultActionRow'](_0x5cfd40){const _0x4fe02e=new _0x2f8c3b(this['locale']),_0x22615d=new _0x30fef8();return _0x22615d['text']=_0x5cfd40,_0x4fe02e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x22615d]}),{'view':_0x4fe02e,'highlightView':_0x22615d};}['_createSearchResultContentView'](_0x1070c2,_0x212c16){const _0x3af7b1=new _0x2f8c3b(this['locale']);return _0x3af7b1['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x1070c2,_0x212c16]}),_0x3af7b1;}['_setupActionButtonExecution'](_0x47af22,_0x1bed06,_0x55198f){_0x47af22['on']('execute',()=>{_0x1bed06['editing']['view']['focus'](),_0x1bed06['commands']['execute']('aiQuickAction',_0x55198f);});}['_createActionGroupButton'](_0x467fe2,_0x545e04,_0x8882bb){const _0x53439b=new _0xe814a3(this['locale']),_0x585cce=new _0x480fc1(),_0x3a5bc4=new Ps(this['locale'],_0x585cce),_0x2fe5a1=_0x3a5bc4['bindTemplate'],_0x118c9c=this['_getPanelKeystroke'](_0x8882bb),_0x1a1c7d=this['_createGroupActionsList'](_0x467fe2,_0x545e04['actions'],_0x8882bb);_0x3a5bc4['set']({'label':_0x545e04['label'],'withText':!0x0,'role':Gs,'icon':_0x545e04['icon']??yt,'isEnabled':_0x545e04['actions']['some'](_0x440e00=>_0x440e00['isEnabled'])}),_0x3a5bc4['extendTemplate']({'on':{'mouseenter':_0x2fe5a1['to'](()=>{this['_isSearchFocused']()||_0x3a5bc4['focus']();})}});const _0x433b8b=new _0x331ccd(this['locale']);return _0x433b8b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2fe5a1['to'](_0x122c1b=>{this['_handlePanelKeydown'](_0x122c1b,_0x118c9c,_0x3a5bc4,_0x433b8b);})}}),_0x3a5bc4['bind']('isOn')['to'](_0x433b8b,'isVisible'),this['_bodyCollection']['add'](_0x433b8b),_0x433b8b['content']['add'](_0x1a1c7d),this['_setupGroupMenuBehavior'](_0x3a5bc4,_0x433b8b),_0x53439b['children']['add'](_0x3a5bc4),{'listItem':_0x53439b,'highlightView':_0x585cce};}['_createGroupActionsList'](_0x172dce,_0x17adf9,_0x5466f6){const _0x544c82=new _0x184d2c(this['locale']);return _0x544c82['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x17adf9['forEach'](_0x375a32=>{const _0x241bdc=new _0xe814a3(this['locale']),_0x363200=Vt({'editor':_0x172dce,'action':_0x375a32,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x241bdc['children']['add'](_0x363200),_0x5466f6['focusTracker']['add'](_0x363200),_0x544c82['items']['add'](_0x241bdc);}),_0x544c82;}['_setupGroupMenuBehavior'](_0x36334f,_0x349e0a){const _0xdb5395=_0x36334f['bindTemplate'],_0x1cbf63=this['_getButtonKeystroke'](_0x36334f);_0x36334f['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0xdb5395['to'](()=>{this['_showNestedPanel'](_0x349e0a,_0x36334f);}),'mouseleave':_0xdb5395['to'](_0x3277d6=>{const _0x1958c1=_0x3277d6['relatedTarget'];this['_isMovingToNestedMenu'](_0x1958c1,_0x349e0a)||this['_hideNestedPanel'](_0x349e0a);}),'keydown':_0xdb5395['to'](_0x2627f7=>{_0x2627f7['key']==_0x1cbf63&&(this['_showNestedPanel'](_0x349e0a,_0x36334f),_0x349e0a['content']['get'](0x0)['focus']());})}}),_0x349e0a['on']('render',()=>{_0x349e0a['element']?.['addEventListener']('mouseleave',_0xce3542=>{const _0x1bef3a=_0xce3542['relatedTarget'];_0x36334f['element']?.['contains'](_0x1bef3a)||this['_isMovingToNestedMenu'](_0x1bef3a,_0x349e0a)||this['_hideNestedPanel'](_0x349e0a);});});}['_showNestedPanel'](_0x1b7382,_0x5ce0c9){this['_openNestedPanels']['forEach'](_0x26b253=>{_0x26b253!==_0x1b7382&&_0x26b253['isVisible']&&_0x26b253['hide']();}),_0x1b7382['show'](),_0x1b7382['pin']({'positions':[_0x2fea8f['eastSouth']],'target':_0x5ce0c9['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x1b7382);}['_hideNestedPanel'](_0x192b63){_0x192b63['hide'](),this['_openNestedPanels']['delete'](_0x192b63);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x396312=>_0x396312['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5bcfa1,_0x257384){if(!_0x5bcfa1)return!0x1;if(_0x257384['element']?.['contains'](_0x5bcfa1))return!0x0;const _0x17dab0=_0x5bcfa1;return _0x17dab0['closest']&&(null!==_0x17dab0['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x17dab0['closest']('.ck-ai-quick-actions-group-list')||null!==_0x17dab0['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x3d4adc){return'rtl'===_0x3d4adc['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0xbc75e2){return'rtl'===_0xbc75e2['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x34c6cf,_0x478a86,_0x240c2e,_0x573499){_0x34c6cf['key']==_0x478a86&&(_0x240c2e['focus'](),this['_hideNestedPanel'](_0x573499));}['_handleSearchResultButtonClick'](_0xc4d147){_0xc4d147['fire']('execute');}}function Jt(_0x405058){const {editor:_0x2e36d2,content:_0x9b7b2a,buttonDefinition:_0x4a541a,bodyCollection:_0x10b446,hasSearch:_0x2d84da=!0x1}=_0x405058;return()=>{const _0x302111=_0x2e36d2['locale'],_0xe15472=_0x103d4b(_0x302111);_0xe15472['buttonView']['set']({'icon':_0x4a541a['icon']??yt,'label':_0x4a541a['label'],'tooltip':!0x0}),_0xe15472['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x587f97=new ao(_0x2e36d2,_0x9b7b2a,_0xe15472,_0x10b446,_0x2d84da);if(_0xe15472['panelView']['children']['add'](_0x587f97),_0x2d84da){const _0x146864='ai-quick-actions-dropdown-selection';_0xe15472['on']('change:isOpen',(_0x41e566,_0x6e1b81,_0x52d894)=>{if(_0x52d894){if(_0x2e36d2['plugins']['has']('AIEditing')){const _0x1ac424=_0x2e36d2['plugins']['get'](D),_0x5e6e6b=_0x2e36d2['model']['document']['selection'],_0x541f38=Array['from'](_0x5e6e6b['getRanges']());_0x541f38['length']>0x0&&_0x1ac424['showFakeVisualSelection'](_0x541f38,_0x146864,!0x1,!0x0);}}else _0x2e36d2['plugins']['has']('AIEditing')&&_0x2e36d2['plugins']['get'](D)['hideFakeVisualSelection'](_0x146864),_0x587f97['resetSearch']();});}return _0xe15472;};}const Zt='<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>',te='<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>',ee='<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 Mt=function(_0x2ab5c9){return _0x2ab5c9['CHAT']='CHAT',_0x2ab5c9['ACTION']='ACTION',_0x2ab5c9['REVIEW']='REVIEW',_0x2ab5c9;}({}),ya=function(_0x549153){return _0x549153['CHAT']='AIChat',_0x549153['ACTION']='AIActions',_0x549153['REVIEW']='AIReviewMode',_0x549153;}({});class ii extends _0x15e219{static get['requires'](){return[Xt,tt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x1d0a12=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x1d0a12),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x10d06f){return function(_0x31636f){const _0x2110be=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x31636f['uiLanguage']),_0x31e0be=_0x2110be||'English',_0x3070a6=[{'id':'ask-ai','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Lt},{'id':'chat-commands','label':i(_0x31636f,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Lt,'actions':[{'id':'explain','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Zt['replace']('%0',_0x31e0be),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':te['replace']('%0',_0x31e0be),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ee['replace']('%0',_0x31e0be),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Ft},{'id':'continue','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Yt},{'id':'fix-grammar','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Gt},{'id':'adjust-length','label':i(_0x31636f,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x31636f,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Kt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Bt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'ACTION','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'ACTION','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x31636f,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x31636f,'AI_QUICK_ACTIONS_OTHER'),'icon':Wt,'actions':[]}];return _0x3070a6;}(_0x10d06f);}async['_getDefaultAndCustomActions'](){const _0x30f230=ii['getDefaultQuickActions'](this['editor']['locale']),_0x283ac5=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x4c69ee=[];try{_0x4c69ee=await new et({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x497720){const _0x186d9a=new _0x1a859a('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x497720});_0x42b6c9(_0x186d9a['message']);}finally{const _0x562c89=_0x283ac5['map'](_0x43c145=>({..._0x43c145,'icon':void 0x0}));_0x30f230['find'](_0x546f7c=>'other'===_0x546f7c['id'])['actions']['push'](..._0x562c89),_0x30f230['forEach'](_0x5adc18=>{if('actions'in _0x5adc18)_0x5adc18['actions']['forEach'](_0x375a84=>{if(_0x375a84['isEnabled']=!!_0x4c69ee['find'](_0x31abce=>_0x31abce['id']===_0x375a84['model'])||void 0x0===_0x375a84['model'],!_0x375a84['isEnabled']){const _0x280bf7=new _0x1a859a('ai-quick-actions-unavailable-model',this,{'actionId':_0x375a84['id'],'modelId':_0x375a84['model']});_0x42b6c9(_0x280bf7['message']);}});else{if(_0x5adc18['isEnabled']=!!_0x4c69ee['find'](_0x30946c=>_0x30946c['id']===_0x5adc18['model'])||void 0x0===_0x5adc18['model'],!_0x5adc18['isEnabled']){const _0x276611=new _0x1a859a('ai-quick-actions-unavailable-model',this,{'actionId':_0x5adc18['id'],'modelId':_0x5adc18['model']});_0x42b6c9(_0x276611['message']);}}});}return _0x30f230;}['_initializeQuickActionsComponentsAndCommands'](){const _0x3080f9=new _0xa5a63b(this['editor']['locale']);_0x3080f9['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x3080f9),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3080f9);}['_initializeQuickActionsDropdown'](_0x552d38){const _0x1734cc=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Jt({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':yt,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x552d38,'hasSearch':_0x1734cc}));}['_prepareQuickActionsDefinition'](_0x20c0c7){this['_quickActionsDefinition']=_0x20c0c7['map'](_0x491386=>{if('actions'in _0x491386){const _0x3557d8=_0x491386;return{..._0x3557d8,'actions':_0x3557d8['actions']['map'](_0x45b579=>{const {actions:_0x8b9248,..._0x1885aa}=_0x3557d8;return{..._0x45b579,'parent':_0x1885aa};})['filter'](_0x57c862=>this['_shouldIncludeAction'](_0x57c862))};}return _0x491386;})['filter'](_0xda17a4=>'actions'in _0xda17a4?_0xda17a4['actions']['length']>0x0:this['_shouldIncludeAction'](_0xda17a4));}['_shouldIncludeAction'](_0xafbf52){const _0x545c0b=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](ya[_0xafbf52['type']])&&!_0x545c0b['includes'](_0xafbf52['id'])&&!('CHAT'===_0xafbf52['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x21f7c5){this['_quickActionsDefinition']['forEach'](_0x429db4=>{if('actions'in _0x429db4){const _0x2777e6=Jt({'editor':this['editor'],'content':_0x429db4['actions'],'buttonDefinition':_0x429db4,'bodyCollection':_0x21f7c5});this['editor']['ui']['componentFactory']['add'](_0x429db4['id'],_0x2777e6),_0x429db4['actions']['forEach'](_0xaf1333=>{const _0x200a79=Vt({'editor':this['editor'],'action':_0xaf1333});this['editor']['ui']['componentFactory']['add'](_0xaf1333['id'],_0x200a79);});}else{const _0x5f16fb=Vt({'editor':this['editor'],'action':_0x429db4,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x429db4['id'],_0x5f16fb);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3bdc14=>{const _0x5e5987=new _0x7ce5c8(_0x3bdc14),_0x1bed7a=i(_0x3bdc14,'AI_QUICK_ACTIONS_HEADING');_0x5e5987['buttonView']['set']({'label':_0x1bed7a,'icon':yt});const _0x3f9a4a=new _0xf5b9c2(_0x3bdc14);_0x3f9a4a['set']({'ariaLabel':_0x1bed7a,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x1e6ba4=>{if('actions'in _0x1e6ba4){const _0x485252=_0x1e6ba4,_0x22b31d=new _0x5f3a6c(_0x3bdc14,_0x5e5987),_0x286b62=new _0x7ce5c8(_0x3bdc14),_0x4b69f5=new _0xf5b9c2(_0x3bdc14);_0x286b62['buttonView']['set']({'label':_0x485252['label'],'icon':_0x485252['icon']}),_0x485252['actions']['forEach'](_0x463df8=>{const _0x237ba9=new _0x5f3a6c(_0x3bdc14,_0x286b62),_0x29191b=new _0x11ed9d(_0x3bdc14);_0x29191b['set']({'label':_0x463df8['displayedPrompt'],'icon':_0x463df8['icon'],'role':'menuitem','isEnabled':_0x463df8['isEnabled']}),_0x29191b['on']('execute',()=>{this['_executeQuickAction'](_0x463df8);}),_0x29191b['delegate']('execute')['to'](_0x286b62),_0x237ba9['children']['add'](_0x29191b),_0x4b69f5['items']['add'](_0x237ba9);}),_0x286b62['panelView']['children']['add'](_0x4b69f5),_0x22b31d['children']['add'](_0x286b62),_0x3f9a4a['items']['add'](_0x22b31d);}else{const _0x2b6099=_0x1e6ba4,_0x379403=new _0x5f3a6c(_0x3bdc14,_0x5e5987),_0x3158f0=new _0x11ed9d(_0x3bdc14);_0x3158f0['set']({'label':_0x2b6099['displayedPrompt'],'icon':_0x2b6099['icon'],'role':'menuitem','isEnabled':_0x2b6099['isEnabled']}),_0x3158f0['on']('execute',()=>{this['_executeQuickAction'](_0x2b6099);}),_0x3158f0['delegate']('execute')['to'](_0x5e5987),_0x379403['children']['add'](_0x3158f0),_0x3f9a4a['items']['add'](_0x379403);}});const _0x1cddf7=Object['values'](ya)['some'](_0x3e2862=>this['editor']['plugins']['has'](_0x3e2862));return _0x5e5987['set']({'isEnabled':_0x1cddf7}),_0x5e5987['panelView']['children']['add'](_0x3f9a4a),_0x5e5987;});}['_executeQuickAction'](_0x18ba8f){const _0x57a572=this['editor'];_0x57a572['editing']['view']['focus'](),_0x57a572['commands']['execute']('aiQuickAction',_0x18ba8f);const _0x24f1dc=_0x57a572['ui']['view']['menuBarView'];_0x24f1dc&&_0x24f1dc['close']&&_0x24f1dc['close']();}}class ci extends Ut{['execute'](_0x52473a){switch(this['_expandSelectionIfCollapsed'](),_0x52473a['type']){case Mt['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x1e0cb6=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x1a859a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1e0cb6});}this['_handleAIChatAction'](_0x52473a);break;case Mt['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x1e7bce=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x1a859a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1e7bce});}this['_handleAIActionsAction'](_0x52473a);break;case Mt['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0xb66112=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x1a859a('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xb66112});}this['_handleAIReviewAction'](_0x52473a);}}async['_handleAIChatAction'](_0x38295d){const _0x57c48a=this['editor']['plugins']['get']('AIChat'),_0x826db5=this['editor']['plugins']['get']('AIChatController'),_0x285110=this['editor']['plugins']['get']('AITabs')['view'];if(_0x285110['isVisible']||(_0x285110['isVisible']=!0x0),'chat'!==_0x285110['activeTab']&&_0x285110['activateTab']('chat'),'ask-ai'===_0x38295d['id'])_0x826db5['removeSelectionFromChatContext'](),await _0x57c48a['addSelectionToChatContext'](),_0x57c48a['focusPromptInput']();else await _0x57c48a['startConversation'](),_0x826db5['removeSelectionFromChatContext'](),await _0x57c48a['addSelectionToChatContext'](),_0x57c48a['focusPromptInput'](),await _0x57c48a['sendMessage']({'message':_0x38295d['prompt']||_0x38295d['displayedPrompt'],'attributes':{'quickActionData':{'id':_0x38295d['id']},'displayedPrompt':_0x38295d['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x15b5b5=this['editor'],_0x941538=_0x15b5b5['model']['document']['selection'];if(!_0x941538['isCollapsed'])return;const _0x5c4c67=_0x340436(_0x941538['getSelectedBlocks']())||_0x15b5b5['model']['schema']['getLimitElement'](_0x941538);_0x15b5b5['model']['change'](_0x44f7c0=>{_0x44f7c0['setSelection'](_0x5c4c67,'in');});}['_handleAIActionsActionLabel'](_0x7d97db){return _0x7d97db['parent']?.['label']&&'other'!==_0x7d97db['parent']?.['id']?_0x7d97db['parent']['label']+':\x20'+_0x7d97db['displayedPrompt']:_0x7d97db['displayedPrompt'];}async['_handleAIActionsAction'](_0x2fb8a8){const _0x860d3e=this['editor']['plugins']['get']('AIActions'),_0x9ab0b9=_0x2fb8a8['prompt']?{'userMessage':_0x2fb8a8['prompt'],'model':_0x2fb8a8['model']}:{'actionName':_0x2fb8a8['actionName']||_0x2fb8a8['id'],'args':_0x2fb8a8['args']},_0x3a80eb=this['_handleAIActionsActionLabel'](_0x2fb8a8);await _0x860d3e['executeAction'](_0x9ab0b9,_0x3a80eb,_0x2fb8a8['icon']);}async['_handleAIReviewAction'](_0x1f4f16){console['log']('handleAIReviewAction',_0x1f4f16);}}class ti extends _0x15e219{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x513499=this['editor'],_0xf692f6=new ci(this['editor']);if(_0x513499['commands']['add']('aiQuickAction',_0xf692f6),_0x513499['plugins']['has']('AIChat')){const _0x16134c=this['editor']['plugins']['get']('AIChat');_0x513499['model']['document']['selection']['on']('change:range',(_0x239d63,_0xc44a99)=>{_0xc44a99['directChange']&&_0x16134c['removeSelectionFromChatContext']();});}}}class ds extends xi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x582b33=this['documentContextContent']['children']['map'](_0x584b74=>({'node':_0x584b74,'id':ut(_0x584b74,'data-id')})),_0x338544=this['parsedMergedContent']['children']['map'](_0x209c49=>({'node':_0x209c49,'id':ut(_0x209c49,'data-id')||_0x36c3ed()})),_0x42001c=_0x3472b0(_0x582b33,_0x338544,{'comparator':(_0x2e0ce4,_0x2c96c2)=>_0x2e0ce4['id']==_0x2c96c2['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x42001c['length']&&_0x42001c[_0x42001c['length']-0x1]['removed'];)_0x42001c['pop']();}const _0x232a84=_0x42001c['map'](_0x33b7b2=>{const _0x2d9d92=_0x33b7b2['added']?'new':_0x33b7b2['removed']?'removed':'modified';return{'node':_0x33b7b2['value'][0x0]['node'],'type':_0x2d9d92,'id':_0x33b7b2['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x232a84,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4e5275,_0x38528a){return _0x38528a;}}class ft extends os{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x26a499){super(_0x26a499),this['content']=_0x26a499['content'],this['version']=_0x26a499['version'],this['actionName']=_0x26a499['actionName'],this['args']=_0x26a499['args'],this['userMessage']=_0x26a499['userMessage'],this['model']=_0x26a499['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':xe['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x4fdde7){const _0x44a578=new ds({'editor':this['editor'],'documentContextContent':this['content'],..._0x4fdde7});return this['replies']['push'](_0x44a578),_0x44a578['delegate'](...je)['to'](this),this['fire']('replyCreated',_0x44a578),_0x44a578;}}class ph extends _0x191b6d{constructor(_0x3c9639,_0x916aad=!0x0,_0x107137=!0x0){super(_0x3c9639),this['set']('isEnabled',!0x1),_0x916aad&&(this['applyButton']=this['_createButton'](i(_0x3c9639,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x107137&&(this['suggestButton']=this['_createButton'](i(_0x3c9639,'AI_BALLOON_SUGGEST_BUTTON'),_0x916aad?'ck-ai-button-secondary':'ck-ai-button-primary'),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x916aad,'showSuggestButton':_0x107137}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x14a4e8,showSuggestButton:_0x3a6420}){this['applyButton']&&(this['applyButton']['isVisible']=_0x14a4e8),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x3a6420);}['_createButton'](_0x5574d4,_0x5b61c6){const _0x3fa869=new _0x5822be(this['locale']);return _0x3fa869['set']({'label':_0x5574d4,'class':_0x5b61c6,'isVisible':!0x0,'withText':!0x0}),_0x3fa869;}}class wh extends _0x2f8c3b{constructor(_0x1a4a9b){super(_0x1a4a9b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':i(_0x1a4a9b,'AI_DISCLAIMER_TEXT')}]}]});}}class _h extends _0x2f8c3b{constructor(_0x247c06){super(_0x247c06),this['set']('isVisible',!0x0);const _0x8bd22c=new gi('small');_0x8bd22c['isVisible']=!0x0;const _0x709e8e=new _0x2f8c3b(this['locale']);_0x709e8e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[i(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3a8c9c=>!_0x3a8c9c)]},'children':[_0x8bd22c,_0x709e8e]});}}class Tt extends gs{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x214b65,_0x3ba2b5){super(_0x214b65),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3ba2b5,this['_focusTracker']=new _0x2afd45(),this['_keystrokes']=new _0x16d287(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x1842f7({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x36b2b7(),this['_addContentWrapper'](_0x3ba2b5),this['_addDisclaimerView'](),this['_addToolbar'](_0x3ba2b5),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x3ba2b5);});}['render'](){super['render']();for(const _0x2f6b32 of this['_focusables'])this['_focusTracker']['add'](_0x2f6b32['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4ad94a){-0x1===_0x4ad94a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0xf18767){this['_isLoading']=_0xf18767;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x3b3e53){super['showError'](_0x3b3e53),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x921de7){super['showBlockingError'](_0x921de7),this['setErrorState']();}['addMiniToolbarItem'](_0x174478){this['_miniToolbarView']['items']['has'](_0x174478)||this['_miniToolbarView']['items']['add'](_0x174478);}['removeMiniToolbarItem'](_0x4f9b6a){this['_miniToolbarView']['items']['has'](_0x4f9b6a)&&this['_miniToolbarView']['items']['remove'](_0x4f9b6a);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x307ce1,showSuggestButton:_0x3fe098}){_0x307ce1=_0x307ce1&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x3fe098=_0x3fe098&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x307ce1,'showSuggestButton':_0x3fe098});}async['updateContent'](_0x6d5d2b){await this['_streamableContentView']['update'](_0x6d5d2b);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x2af632){this['_contentWrapper']=new _0x2f8c3b(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView'](),this['_createMiniToolbar'](_0x2af632['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new wh(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x35fdb7,showSuggestButton:_0x3a27d1}){this['_toolbarView']=new ph(this['locale'],_0x35fdb7,_0x3a27d1),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x5e4e46,_0x21aee2,_0x1a34cf)=>!(_0x5e4e46||_0x21aee2||_0x1a34cf)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x35fdb7,'showSuggestButton':_0x3a27d1}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x275b2f){return this['_miniToolbarView']=new ls(this['locale'],_0x275b2f),this['_miniToolbarView']['delegate'](...W)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x142ba4,_0x485c78)=>!(_0x142ba4||_0x485c78)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new _h(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new cs(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3ffed6=new _0x5822be(this['locale']),_0x165fc2=new _0x5822be(this['locale']),_0x159ac6=new fh(this['locale']),_0x55eeac=new _0x5822be(this['locale']);_0x3ffed6['set']({'icon':_0x3fcef2,'label':i(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x165fc2['set']({'icon':_0x1cd954,'tooltip':i(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button'}),_0x55eeac['set']({'icon':_0xd08896,'tooltip':i(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button'}),_0x3ffed6['bind']('isEnabled')['to'](this,'isBusy',_0x181a41=>!_0x181a41),_0x3ffed6['on']('execute',()=>{this['fire']('tryAgain');}),_0x165fc2['bind']('isEnabled')['to'](this,'isBusy',_0x1af7ea=>!_0x1af7ea),_0x165fc2['on']('execute',()=>{this['fire']('showPrevious');}),_0x55eeac['bind']('isEnabled')['to'](this,'isBusy',_0x1b76af=>!_0x1b76af),_0x55eeac['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x165fc2,this['_navigationCounter']=_0x159ac6,this['_navigationNextButton']=_0x55eeac,this['_navigationTryAgainButton']=_0x3ffed6;}['updateMiniToolbarButtons'](_0x16a3f8,_0x351dc9){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x78cf0e=_0x16a3f8>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x78cf0e){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x55f44c=_0x16a3f8-_0x351dc9;this['_navigationCounter']['setInteractionCount'](_0x55f44c+'/'+_0x16a3f8),this['_navigationPreviousButton']['isEnabled']=_0x351dc9<_0x16a3f8-0x1,this['_navigationNextButton']['isEnabled']=_0x351dc9>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x5a9901){this['_isLoading']=_0x5a9901;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x3aac17=this['_getScrollableElement']();_0x3aac17&&!this['_scrollManager']&&(this['_scrollManager']=new Ze(_0x3aac17));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class fh extends _0x2f8c3b{constructor(_0x5ed040){super(_0x5ed040);const _0x103544=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x103544['to']('interactionCount')}]});}['setInteractionCount'](_0x2de87e){this['set']('interactionCount',_0x2de87e);}}class ri extends _0x15e219{static get['requires'](){return[tt,_0x724f59,D,H,ot];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x182a7f){super(_0x182a7f),this['_bodyCollection']=new _0xa5a63b(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new St();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x445d97,_0x37f40b,_0x23b384){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4bfbd8,anchorData:_0x360af6}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x445d97,_0x4bfbd8,_0x360af6,_0x37f40b,_0x23b384);}}const {modelFragment:_0xb37782,anchorData:_0x1b5c26}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x445d97,_0xb37782,_0x1b5c26,_0x37f40b,_0x23b384);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0xf7aa51=this['editor']['plugins']['has']('TrackChanges');let _0xe45fcd=this['editor']['config']['get']('ai.availableReplyActions')||[...J];_0xf7aa51||(_0xe45fcd=_0xe45fcd['filter'](_0x5e1a2c=>'insertSuggestion'!=_0x5e1a2c));const _0x346043=this['editor']['commands']['get']('trackChanges'),_0x1149ef=new Tt(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0xf7aa51,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xe45fcd});return _0x1149ef['bind']('isBusy')['to'](this),_0x346043&&_0x1149ef['bind']('isTrackChangesOn')['to'](_0x346043,'value'),_0x1149ef['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1149ef['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1149ef['on']('showNext',()=>{this['_navigateToNext']();}),_0x1149ef;}['_getExecuteDataRegular'](){const _0x44ee0e=this['editor']['model']['document']['selection'];if(_0x44ee0e['isCollapsed']){const _0x36f251=_0x340436(_0x44ee0e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x44ee0e);this['editor']['model']['change'](_0x26ecf7=>{_0x26ecf7['setSelection'](_0x36f251,'in');});}const _0x451373=_0x44ee0e['getFirstRange'](),_0x3b61d1=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x44ee0e),_0x451373['start'],_0x451373['end']);this['_copyMarkersToFragment'](_0x3b61d1,_0x44ee0e,{'isTableSelection':!0x1});const _0xa7b942=_0x44ee0e['getFirstRange']()['start'],_0x24db39=new Map();let _0x31424d=_0x3b61d1;for(let _0x3698c=0x0;_0x3698c<_0xa7b942['path']['length'];_0x3698c++)_0x24db39['set'](_0x31424d,_0xa7b942['path'][_0x3698c]),_0x31424d=_0x31424d['getChild'](0x0);return{'modelFragment':_0x3b61d1,'anchorData':_0x24db39};}['_getExecuteDataInTable'](){const _0x186962=this['editor']['model']['document']['selection'],_0xfe573=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x1a7cd8=_0x186962['getFirstRange']()['start']['parent']['parent'],_0x4b84aa=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x1a7cd8),this['editor']['model']['createPositionAfter'](_0x1a7cd8)),_0x572089=this['_wrapWithCommonAncestors'](_0xfe573,_0x4b84aa['start'],_0x4b84aa['end']);this['_copyMarkersToFragment'](_0x572089,_0x186962,{'isTableSelection':!0x0});const _0x11c290=_0x186962['getFirstRange']()['start'],_0x25e088=new Map();let _0x369233=_0x572089;for(let _0x1dea24=0x0;_0x1dea24<_0x11c290['path']['length'];_0x1dea24++)if(_0x25e088['set'](_0x369233,_0x11c290['path'][_0x1dea24]),_0x1dea24<_0x11c290['path']['length']-0x1)_0x369233=_0x369233['getChild'](0x0);else{let _0x4eef70=_0x369233['nextSibling'];for(;_0x4eef70;)_0x25e088['set'](_0x4eef70,_0x11c290['path'][_0x1dea24]),_0x4eef70=_0x4eef70['nextSibling'];}return{'modelFragment':_0x572089,'anchorData':_0x25e088};}async['_executeAction'](_0x4e44aa,_0x39cc7b,_0x8c284c,_0x3fb176,_0x3545c1){const _0x590559=this['editor']['plugins']['get'](D),_0x1ee49b=this['editor']['plugins']['get'](H),_0x3796e3=this['editor']['model']['document']['selection'],_0xed3b3a=await _0x590559['modelToDataWithIds'](_0x39cc7b),_0x39ef35=this['editor']['model']['document']['version'],_0x3cf10f=[..._0x3796e3['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0x1ee49b['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3fb176,'icon':_0x3545c1||yt,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x3cf10f,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ee49b),this['_interactionParams']={'action':_0x4e44aa,'content':_0xed3b3a,'version':_0x39ef35,'aiBalloon':_0x1ee49b,'modelFragment':_0x39cc7b,'anchorData':_0x8c284c},this['_setupApplyListeners'](),this['listenTo'](_0x1ee49b,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1ee49b,'dialogClosed',(_0x4aa09b,{id:_0x3694d9})=>{if('aiActionsBalloon'===_0x3694d9){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x72073d=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x4f3763=_0x72073d['changeGroups'][0x0];_0x4f3763&&'pending'===_0x4f3763['state']&&_0x72073d['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ee49b);}}),this['_createInteraction'](_0xed3b3a,_0x39ef35,_0x1ee49b,_0x4e44aa);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x4a3523,anchorData:_0x4150ed}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x4a3523,_0x4150ed,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x4a3523,_0x4150ed,!0x0);});}['_wrapWithCommonAncestors'](_0x23ac15,_0x35bd8b,_0x164673){const _0x41ce52=this['editor']['model']['createRange'](_0x35bd8b,_0x164673)['getCommonAncestor'](),_0x1f47a3=_0x41ce52['is']('documentFragment')?[]:_0x41ce52['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1f47a3['length']){const _0x15c64d=_0x1f47a3['map'](_0x2044e3=>_0x2044e3['_clone'](!0x1));for(let _0x50d71f=0x1;_0x50d71f<_0x15c64d['length'];_0x50d71f++)_0x15c64d[_0x50d71f-0x1]['_appendChild'](_0x15c64d[_0x50d71f]);return _0x15c64d[_0x15c64d['length']-0x1]['_appendChild'](_0x23ac15),new bt(_0x15c64d[0x0]);}return _0x23ac15;}['_copyMarkersToFragment'](_0x35d649,_0x5b5116,_0x242914={'isTableSelection':!0x1}){const _0x22634e=this['editor']['model'],_0x6d8719=Array['from'](_0x5b5116['getRanges']()),_0x113e06=_0x5b5116['getFirstRange']()['start'];for(const _0x1f96fb of _0x22634e['markers']){if(_0x1f96fb['name']['startsWith'](R)||!_0x1f96fb['affectsData'])continue;const _0xc2b646=_0x1f96fb['getRange']();if(!_0x6d8719['some'](_0x1d448f=>_0x1d448f['containsRange'](_0xc2b646,!0x0)))continue;const _0x5c6f20=this['_regularCalculateMarkerPath'](_0xc2b646['start'],_0x113e06,_0x242914['isTableSelection']),_0x69972c=this['_regularCalculateMarkerPath'](_0xc2b646['end'],_0x113e06,_0x242914['isTableSelection']),_0x1885f2=_0x22634e['createPositionFromPath'](_0x35d649,_0x5c6f20),_0x33e73c=_0x22634e['createPositionFromPath'](_0x35d649,_0x69972c);if(!_0x1885f2['isEqual'](_0x33e73c)){const _0x12e2f8=_0x22634e['createRange'](_0x1885f2,_0x33e73c);_0x35d649['markers']['set'](_0x1f96fb['name'],_0x12e2f8);}}}['_regularCalculateMarkerPath'](_0x120bf7,_0x8152c,_0x2fa0c8=!0x1){const _0x3008de=[..._0x120bf7['path']['slice']()];for(let _0x1a9e97=0x0;_0x1a9e97<Math['max'](_0x8152c['path']['length'],_0x120bf7['path']['length']);_0x1a9e97++){const _0x34848d=_0x8152c['path'][_0x1a9e97]||0x0,_0x54f78c=(_0x120bf7['path'][_0x1a9e97]||0x0)-_0x34848d;if(_0x3008de[_0x1a9e97]=_0x54f78c,0x0!==_0x54f78c&&!_0x2fa0c8)break;}return _0x3008de;}async['_createInteraction'](_0x220f44,_0x21d4af,_0x43cabe,_0x1cd046){const _0x16ac10=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x1cd046,'content':_0x220f44,'version':_0x21d4af,'aiBalloon':_0x43cabe,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5b5dd2=new ft({'connector':this['_aiConnector'],'editor':_0x16ac10,'content':_0x220f44,'version':_0x21d4af,..._0x1cd046});this['_interactions']['push'](_0x5b5dd2);const _0x2d6ae5=(_0x34f27e,_0xdceae4=!0x1,_0x2cb051='streaming')=>this['_promiseQueue']['enqueue'](async _0x4c7abe=>{try{const _0x353ba9=wt({'editor':_0x16ac10,'changeGroups':_0x34f27e['changeGroups'],'documentContextContent':_0x34f27e['documentContextContent'],'showDiff':_0xdceae4,'trimUnchanged':!0x1});_0x353ba9['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x353ba9[0x0],'renderingStrategy':_0x2cb051,'abortSignal':_0x4c7abe});}catch(_0x412a8c){if(this['_isAbortError'](_0x412a8c))return;throw _0x412a8c;}});this['_interaction']['on']('replyCreated',(_0x44781e,_0x496c56)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2d6ae5(_0x496c56)['catch'](_0x35de2a=>{this['_isAbortError'](_0x35de2a)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x35de2a),this['_setErrorState'](_0x5b5dd2));});}),this['_interaction']['on']('replyContentUpdated',(_0x3e60f7,_0x5ed23e)=>{_0x2d6ae5(_0x5ed23e)['catch'](_0x4daa26=>{this['_isAbortError'](_0x4daa26)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4daa26),this['_setErrorState'](_0x5b5dd2));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x925dc3){this['_isAbortError'](_0x925dc3)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x925dc3),this['_setErrorState'](_0x5b5dd2));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x5bc98a,{showDiff:_0x50be9b})=>{try{this['_balloonShowDiff']=_0x50be9b;const _0xffd832=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xffd832&&await _0x2d6ae5(_0xffd832,_0x50be9b,'static');}catch(_0x8a557a){this['_isAbortError'](_0x8a557a)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x8a557a),this['_setErrorState'](_0x5b5dd2));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x193c3e,{reply:_0x20123f})=>{const _0xf73a98={'positiveCount':_0x20123f['changeGroups']['filter'](_0x4a714e=>'accepted'===_0x4a714e['state'])['length'],'totalCount':_0x20123f['changeGroups']['length']},_0x12cc3b=this['_interaction']['actionCallId'],_0x4c3a7a=this['_interaction']['actionName'];_0x4c3a7a?this['_aiConnector']['upsertAIActionRating'](_0x4c3a7a,_0x12cc3b,_0xf73a98):this['_aiConnector']['upsertCustomAIActionRating'](_0x12cc3b,_0xf73a98);}),this['_setLoadingState']();try{const _0x2568e0=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2568e0;}catch(_0xcae7e1){if(this['_isAbortError'](_0xcae7e1))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5b5dd2);}}['_applyChanges'](_0x1bbf24,_0x51223a,_0x2d8077){const _0xbbc1d1=this['editor'];if(_0x2d8077&&!_0xbbc1d1['plugins']['has']('TrackChanges'))throw new _0x1a859a('ai-no-track-changes',null);const _0x4a7b6d=this['editor']['plugins']['get'](ot),_0x1b6aa1=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1b6aa1||!_0x1b6aa1['replies']['length'])return;const _0x1d14b1=_0x1b6aa1['replies'][_0x1b6aa1['replies']['length']-0x1],_0x30ebf4=_0x1d14b1['changeGroups'];_0x1d14b1['setChangeGroupState'](0x0,'accepted');let _0x2cc327=at({'editor':_0xbbc1d1,'reply':_0x1d14b1,'interaction':_0x1b6aa1,'groups':_0x30ebf4,'transform':!0x1,'documentCompare':_0x4a7b6d,'documentCompareOptions':{'anchor':_0xbbc1d1['model']['createPositionAt'](_0x1bbf24,0x0),'markDeletions':_0x2d8077}});_0x2cc327=this['_filterOperationsOutsideRange'](_0x2cc327,_0x51223a);for(const _0x4b65a5 of _0x2cc327)this['_anchorOperation'](_0x51223a,_0x4b65a5,_0xbbc1d1['model']['document']['getRoot']());const _0x5efcd5=_0x1b6aa1['getDocumentContext']()['version'],_0x5add5c=_0xbbc1d1['model']['document']['history']['getOperations'](_0x5efcd5),_0x57ab4f={'document':_0xbbc1d1['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3482dd=kt(_0x2cc327,_0x5add5c,_0x57ab4f)['operationsA'];_0xbbc1d1['model']['change'](_0x40f527=>{if(_0x40f527['setSelection'](_0xbbc1d1['model']['document']['selection']['focus']),_0x2d8077)_0xbbc1d1['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3482dd);else{for(const _0x4eaeec of _0x3482dd)_0x4eaeec['baseVersion']=_0xbbc1d1['model']['document']['version'],rt(_0xbbc1d1,_0x4eaeec),_0x40f527['batch']['addOperation'](_0x4eaeec),_0xbbc1d1['model']['applyOperation'](_0x4eaeec);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x74569b,_0x9c9911){return _0x74569b['filter'](_0xc682d8=>{if('rename'==_0xc682d8['type']){const _0xbb0ca6=_0xc682d8['position']['nodeAfter'];return!_0x9c9911['has'](_0xbb0ca6);}if(_0xc682d8['type']['indexOf']('Attribute')>-0x1){const _0x578082=_0xc682d8['range']['start']['nodeAfter'];return!_0x9c9911['has'](_0x578082);}return!0x0;});}['_anchorOperation'](_0x22462e,_0x10ade5,_0x2bef1c){const _0x514d5e=_0x10ade5['clone']();for(const _0x35c9f5 in _0x10ade5){const _0xf0742a=_0x10ade5[_0x35c9f5];_0xf0742a instanceof dt?_0x10ade5[_0x35c9f5]=new dt(_0x3a88cc(_0xf0742a['start']),_0x3a88cc(_0xf0742a['end'])):_0xf0742a instanceof vt&&(_0x10ade5[_0x35c9f5]=_0x3a88cc(_0xf0742a));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x514d5e['type'])){if(_0x514d5e['isDocumentOperation']=!0x1,_0x514d5e['baseVersion']=null,'remove'==_0x514d5e['type']){const _0x3891a7=_0x514d5e['sourcePosition'],_0x501048=_0x514d5e['howMany'];new lt(_0x3891a7,_0x501048)['_execute']();}else _0x514d5e['_execute']();}function _0x3a88cc(_0x18c309){if('$graveyard'==_0x18c309['root']['rootName'])return _0x18c309;const _0x4cfd46=[];let _0xce5e=_0x18c309['root'];for(let _0x213c9f=0x0;_0x213c9f<_0x18c309['path']['length'];_0x213c9f++){const _0x46c253=_0x22462e['get'](_0xce5e)||0x0;_0x4cfd46[_0x213c9f]=_0x18c309['path'][_0x213c9f]+_0x46c253,_0xce5e=_0xce5e['getChildAtOffset'](_0x18c309['path'][_0x213c9f]);}return new vt(_0x2bef1c,_0x4cfd46,_0x18c309['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0xb28663,content:_0x3a7bc5,version:_0x396970,aiBalloon:_0xedfcd5}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x3a7bc5,_0x396970,_0xedfcd5,_0xb28663)['catch'](_0xdb992=>{this['_isAbortError'](_0xdb992)||console['error']('Error\x20refreshing\x20interaction:',_0xdb992);});}['_isAbortError'](_0x531eeb){return!!_0x531eeb['message']&&_0x531eeb['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x10a702=this['_interactions']['length'];this['_currentInteractionIndex']<_0x10a702-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x284d87){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x284d87;const _0x39691e=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x39691e)return;if(_0x39691e['hasError'])return this['_setErrorState'](_0x39691e),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x39691e['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x10a429=_0x39691e['replies'][_0x39691e['replies']['length']-0x1];if(_0x10a429){const _0x529883=this['editor'];try{const _0x40d642=wt({'editor':_0x529883,'changeGroups':_0x10a429['changeGroups'],'documentContextContent':_0x10a429['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2ed6ae=>setTimeout(_0x2ed6ae,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x40d642[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5ca0ec){this['_isAbortError'](_0x5ca0ec)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5ca0ec);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x24308f){const _0x154cb4=i(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x154cb4),_0x24308f['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class va extends _0x15e219{static get['requires'](){return[ii,ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x448feb){super(_0x448feb),_0x448feb['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ks extends _0x2f8c3b{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x266a66,_0x5ac9ff){super(_0x266a66),this['id']=_0x5ac9ff,this['set']('status','pending'),this['set']('changeId',_0x5ac9ff),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x2e4e25,_0x3240c9)=>{_0x3240c9&&_0x3240c9['target']&&'A'===_0x3240c9['target']['tagName']&&_0x3240c9['preventDefault'](),this['fire']('activateChange',{'id':_0x5ac9ff,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x5ac9ff,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x5ac9ff,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2418b6=new _0x2f8c3b(this['locale']);return _0x2418b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x5e11ff=>!_0x5e11ff)]}}),_0x2418b6;}['_createAcceptButtonView'](){const _0x38c014=new _0x5822be(this['locale']);return _0x38c014['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x38c014['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x46a91b=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x46a91b['stopPropagation']();})},'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x3b9cb7=>'pending'!==_0x3b9cb7&&'accepted'!==_0x3b9cb7),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x354eec=>'pending'===_0x354eec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x8f6260=>'accepted'===_0x8f6260)]}}),this['on']('change:status',(_0x20cd16,_0x4dee22,_0x4da451)=>{_0x38c014['isEnabled']='pending'===_0x4da451,'accepted'===_0x4da451&&(_0x38c014['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x38c014['icon']=_0x17291e);}),_0x38c014;}['_createDismissButtonView'](){const _0x95a875=new _0x5822be(this['locale']);return _0x95a875['set']({'label':i(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x95a875['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xefde64=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xefde64['stopPropagation']();})},'attributes':{'class':['ck-ai-button-tertiary-filled',this['bindTemplate']['if']('status','ck-hidden',_0x1e15ee=>'pending'!==_0x1e15ee&&'rejected'!==_0x1e15ee),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x21fc64=>'pending'===_0x21fc64),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x973d7b=>'rejected'===_0x973d7b)]}}),this['on']('change:status',(_0x336836,_0x2e3f16,_0x38b21b)=>{_0x95a875['isEnabled']='pending'===_0x38b21b,'rejected'===_0x38b21b&&(_0x95a875['label']=i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x95a875['icon']=_0x127a77);}),_0x95a875;}['_createInfoButtonView'](){const _0x47728c=new _0x5822be(this['locale']);return _0x47728c['set']({'label':i(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x3965f3,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x47728c['bind']('isOn')['to'](this,'isInfoToggleOn',_0x2d6b2b=>_0x2d6b2b),_0x47728c['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x47728c;}['_createOutdatedButtonView'](){const _0x3d0af6=new _0x5822be(this['locale']);return _0x3d0af6['set']({'label':i(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x42184c,'withText':!0x0,'isEnabled':!0x1}),_0x3d0af6['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x4e7b09=>'outdated'!==_0x4e7b09)],'disabled':'disabled'}}),_0x3d0af6;}}class we extends _0x331ccd{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x9d37ad,_0x39f100){super(_0x9d37ad),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x39f100['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x39bf47){this['resultItemView']['changeId']=_0x39bf47['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x39bf47['contentDiffed'];}['showBalloon'](_0x39dd2b,_0x291e06,_0x515201,_0x322202,_0x3f4baa,_0x2f6592){const _0x2081f1=_0x291e06();if(!_0x2081f1)return;this['updateContent'](_0x39dd2b),this['show']();const _0x3cf736=Array['from'](_0x2081f1['getClientRects']())['reverse'](),_0x7edc72=this['_getPointedRectIndexFromEvent'](_0x515201,_0x3cf736),_0x883452=_0x3cf736[_0x7edc72??0x0];'click'===_0x322202?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x291e06(),_0x7edc72,_0x39dd2b['id'],_0x3f4baa,_0x2f6592)||_0x883452})):'hover'===_0x322202&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x291e06(),_0x7edc72,_0x39dd2b['id'])||_0x883452}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){_0x2c5270({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x4d5f5e=[this['element']];return this['_pinnedTargetElement']&&_0x4d5f5e['push'](this['_pinnedTargetElement']),_0x4d5f5e;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x2e489a=new _0x2f8c3b();return this['resultItemView']=new Ks(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2e489a['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x2e489a;}['_getBestRectPositionOnClick'](_0x27a6e9,_0x28c69a,_0x384515,_0x3e4e33,_0xcc1b74){if(!_0x27a6e9)return null;const _0x42879e=this['position']['replace']('arrow_',''),_0x52f056=Array['from'](_0x27a6e9['getClientRects']());let _0x31679e,_0x39cbd2=_0x52f056['reverse']();return void 0x0!==_0x28c69a&&this['_isPinnedRectVisible'](_0x39cbd2[_0x28c69a],_0x3e4e33,_0xcc1b74)?(_0x31679e=_0x39cbd2[_0x28c69a],this['_pinnedRectIndex']=_0x28c69a):this['_isPinnedRectVisible'](_0x39cbd2[0x0],_0x3e4e33,_0xcc1b74)&&void 0x0===_0x28c69a?_0x31679e=_0x39cbd2[0x0]:(_0x39cbd2='s'==_0x42879e[0x0]?[..._0x52f056]['reverse']():_0x52f056,_0x39cbd2['forEach'](_0xca4990=>{this['_isPinnedRectVisible'](_0xca4990,_0x3e4e33,_0xcc1b74)&&(_0x31679e=_0xca4990);})),this['_pinnedTargetChangeId']=_0x384515,this['_pinnedTargetElement']=_0x27a6e9,_0x31679e||_0x27a6e9['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x1b6ee3,_0x128201,_0x578cd2){if(!_0x1b6ee3)return null;const _0x1e87e9=Array['from'](_0x1b6ee3['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x128201&&this['_pinnedTargetChangeId']!==_0x578cd2)return this['_pinnedRectIndex']=_0x128201,this['_pinnedTargetElement']=_0x1b6ee3,this['_pinnedTargetChangeId']=_0x578cd2,_0x1e87e9[_0x128201];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x578cd2){if(_0x1b6ee3!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1e87e9[this['_pinnedRectIndex']];}return void 0x0!==_0x128201&&this['_pinnedTargetChangeId']!==_0x578cd2?(this['_pinnedRectIndex']=_0x128201,this['_pinnedTargetElement']=_0x1b6ee3,this['_pinnedTargetChangeId']=_0x578cd2,_0x1e87e9[_0x128201]):_0x1b6ee3['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x20ce06,_0x4b80af){if(_0x20ce06)for(let _0x55a635=0x0;_0x55a635<_0x4b80af['length'];_0x55a635++){const _0x3613e=_0x4b80af[_0x55a635];if(_0x20ce06['clientX']>=_0x3613e['left']-0x3&&_0x20ce06['clientX']<=_0x3613e['right']+0x3&&_0x20ce06['clientY']>=_0x3613e['top']-0x3&&_0x20ce06['clientY']<=_0x3613e['bottom']+0x3)return _0x55a635;}}['_isPinnedRectVisible'](_0x173096,_0x4c2b7b,_0x10f9b8){const _0x35309d=new _0x7bf0be(_0x173096),_0xfcd886=_0x4c2b7b||document['documentElement'],_0x39b361=_0x35309d['getIntersection'](_0x7f0faf(_0x10f9b8)),_0x5157a3=new _0x7bf0be(_0xfcd886)['getIntersection'](_0x35309d);return!!(_0x39b361&&_0x5157a3&&_0x35309d['width']>0x0);}}const ih=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class Ie extends _0x55a427{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[it];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x516101){super(_0x516101),this['_bodyCollection']=new _0xa5a63b(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...ih)['to'](this),this['_balloonSuggestionView']=new we(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x11004e=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x11004e);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x418e72){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x1f66df=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x418e72,_0x1f66df);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xd62615){_0xd62615&&('error-general'!==_0xd62615['status']?'error-chunk'!==_0xd62615['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x25e45f){this['_mainView']['addCheckRunResult'](_0x25e45f);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x5b9f3c){this['_mainView']['showGeneralReviewCoreErrorView'](_0x5b9f3c??i(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x226f37,_0x5ddbc3){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x226f37,_0x5ddbc3);}['setActiveStateInResults'](_0x8e73dc){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x35b8de=>{_0x35b8de['id']===_0x8e73dc&&_0x35b8de['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x9703da=>_0x9703da['setItemAsInactive']());}['updateChangeState'](_0x318090,_0x303d25){'accepted'===_0x303d25||'rejected'===_0x303d25||'outdated'===_0x303d25?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x318090,_0x303d25):this['_mainView']['reviewCheckResultsView']['showResult'](_0x318090,_0x303d25);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x456f93,_0x13bfa0,_0x41f526,_0x4efd79,_0x531531,_0x32cde0){this['_balloonSuggestionView']['showBalloon'](_0x456f93,_0x13bfa0,_0x41f526,_0x4efd79,_0x531531,_0x32cde0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x93868b){const _0x1f1a2f=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x2b05b9=>_0x2b05b9['id']===_0x93868b);return _0x1f1a2f?_0x1f1a2f['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class sh extends _0x2f8c3b{constructor(_0x4a3b4c){super(_0x4a3b4c),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x172753=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x172753['if']('isVisible','ck-hidden',_0x4a35ee=>!_0x4a35ee)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x172753['to']('errorMessage')}]}]});}}class _e extends _0x2f8c3b{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x86b68f,_0x2d3fae){super(_0x86b68f),this['reviewCoreHeader']=_0x2d3fae['header'],this['generalErrorView']=new sh(_0x86b68f),this['reviewCheckListView']=_0x2d3fae['list'],this['reviewCheckListView']['delegate'](...ih)['to'](this),this['reviewCheckResultsView']=_0x2d3fae['results'],this['reviewCheckResultsView']['delegate'](...ih)['to'](this),this['reviewCompletedView']=_0x2d3fae['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x177976){this['reviewCheckResultsView']['addResult'](_0x177976),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x325084){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x325084;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class vr extends _0x5822be{constructor(_0x3ac8a2,_0x1aeab4){super(_0x1aeab4),this['set']({'label':_0x3ac8a2,'withText':!0x0,'class':'ck-ai-button-primary'}),this['on']('execute',()=>{this['fire']('finishReview');});}}class Re extends _0xe814a3{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x1cf62a,_0x421487){super(_0x1cf62a),this['_contents']=_0x421487,this['_resultViews']=new _0x36b2b7(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new vi(_0x1cf62a),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x48291f=this['_createCombinedSkeletonLoader'](),_0x4ee0d9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x4ee0d9['if']('isLoading','ck-ai_review__check-run_loading',_0x200734=>_0x200734),_0x4ee0d9['if']('isResultReady','ck-ai_review__check-run_ready',_0xba67ca=>_0xba67ca),_0x4ee0d9['if']('isVisible','ck-hidden',_0x288d78=>!_0x288d78)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3777e6=>_0x3777e6)]},'children':this['_resultViews']},_0x48291f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x48f71b){const _0x12ed4b=new Ks(this['locale'],_0x48f71b['id']);_0x12ed4b['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x12ed4b),_0x12ed4b['resultResponseView']['element']['innerHTML']=_0x48f71b['contentDiffed'];}['hideResult'](_0x393d8b,_0x4ccd9c){if('pending'===_0x4ccd9c)return;const _0x45d83e=this['_resultViews']['find'](_0x348ff9=>_0x348ff9['id']===_0x393d8b);_0x45d83e&&(_0x45d83e['status']=_0x4ccd9c,_0x45d83e['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x10574a,_0x4cedc6){if('pending'!==_0x4cedc6)return;const _0x3ce04a=this['_resultViews']['find'](_0xb5f97d=>_0xb5f97d['id']===_0x10574a);_0x3ce04a&&(_0x3ce04a['status']=_0x4cedc6,_0x3ce04a['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x3fb73b,_0x5d1a91){this['headerTitle']=_0x3fb73b,this['headerSubtitle']=_0x5d1a91||'';}['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 $e(this['locale'],li['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x249fac=new _0x2f8c3b(this['locale']),_0x130080=[];for(let _0x26a9d9=0x0;_0x26a9d9<0x10;_0x26a9d9++){const _0x311b8a=this['_createSkeletonLoader']();_0x311b8a['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x130080['push'](_0x311b8a);}return _0x249fac['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5cdd76=>!_0x5cdd76)]},'children':_0x130080}),_0x249fac;}['_createErrorView'](){const _0x6e3844=new _0x2f8c3b(this['locale']),_0x46f921=new _0x5822be(this['locale']),t=this['locale']['t'];return _0x6e3844['delegate']('retryReview')['to'](this),_0x46f921['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai_review__check-run-error-retry-button'}),_0x46f921['on']('execute',()=>{this['fire']('retryReview');}),_0x6e3844['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0xa6417d=>!_0xa6417d),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x19d6fe=>'chunk'===_0x19d6fe)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x27591e=>'chunk'===_0x27591e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x25cb6f=>'general'!==_0x25cb6f)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x43aa62=>'chunk'!==_0x43aa62)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x46f921]}),_0x6e3844;}['_createCancelButtonView'](){const _0x36a390=new _0x5822be(this['locale']);return _0x36a390['set']({'label':i(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ck-ai-button-secondary\x20ck-ai-button-stop-generating'],'icon':_0xf8ad47}),_0x36a390['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x40d802=>_0x40d802),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x154e5a=>_0x154e5a)]}}),_0x36a390['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x36a390;}['_createToggleDiffButtonView'](){const _0x370ed5=new _0x5822be(this['locale']);_0x370ed5['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x370ed5['bind']('isEnabled')['to'](this,'isError',_0x202a6d=>!_0x202a6d),_0x370ed5['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x16cb33=>!_0x16cb33),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x9f9ad0=>_0x9f9ad0)]}});const _0x68482=i(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x65b3ac=i(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x370ed5['bind']('isOn')['to'](this,'isToggleDiffOn',_0x32edeb=>_0x32edeb),_0x370ed5['bind']('icon')['to'](this,'isToggleDiffOn',_0x30d3fd=>_0x30d3fd?_0x291708:_0x42ab3e),_0x370ed5['bind']('label')['to'](this,'isToggleDiffOn',_0x5488f5=>_0x5488f5?_0x68482:_0x65b3ac),_0x370ed5['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x370ed5;}['_createAcceptAllButtonView'](){const _0x22ac16=new _0x5822be(this['locale']);return _0x22ac16['set']({'label':i(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x22ac16['bind']('isEnabled')['to'](this,'isError',_0x544d3a=>!_0x544d3a),_0x22ac16['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x879f8b=>!_0x879f8b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x182a69=>_0x182a69)]}}),_0x22ac16['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x22ac16;}['_createExitReviewButtonView'](){const _0x52b57d=new _0x5822be(this['locale']);return _0x52b57d['set']({'label':i(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x52b57d['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x446621=>!_0x446621),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x405c47=>_0x405c47)]}}),_0x52b57d['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x52b57d;}['_createResultHeaderView'](){const _0x572b89=new _0x2f8c3b(this['locale']),_0x373423=this['_createTitleView']();return _0x572b89['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4772e4=>_0x4772e4)]},'children':[_0x373423,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x572b89;}['_createTitleView'](){const _0x1d8abd=new _0x2f8c3b(this['locale']),_0x3194ea=new gi();return _0x3194ea['bind']('isVisible')['to'](this,'isResultReady',_0x4ea16f=>!_0x4ea16f),_0x1d8abd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x3194ea,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x46c736=>_0x46c736)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2ffc71=>!_0x2ffc71)]},'children':[{'text':i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x1d8abd;}['_createFinishReviewButtonView'](){const _0x544885=new vr(i(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x544885['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x308cba=>!_0x308cba)]}}),_0x544885['delegate']('finishReview')['to'](this),_0x544885;}}class de extends _0xe814a3{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x58e3d5,_0x58e453){super(_0x58e3d5),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x58e453['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x58e453['headerText']);const _0x710228=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x710228['if']('isVisible','ck-hidden',_0x5b0bf7=>!_0x5b0bf7)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x58e453['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x291c26){const _0x361127=new vr(_0x291c26,this['locale']);return _0x361127['delegate']('finishReview')['to'](this),_0x361127;}['_createResultHeaderView'](_0x2479e3){const _0x13d889=new _0x2f8c3b(this['locale']);return _0x13d889['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x2479e3}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x13d889;}}class Dr extends _0x2f8c3b{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x51b13d,_0x5465f5){super(_0x51b13d),this['_defaultValue']=_0x5465f5['default']||(_0x5465f5['data']['length']>0x0?_0x5465f5['data'][0x0]['id']:''),this['_defaultLabel']=_0x5465f5['data']['find'](_0x3676a9=>_0x3676a9['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x103d4b(this['locale']);const _0x2203b9=this['_prepareListOptions'](_0x5465f5['data']);_0x3be524(this['_dropdownView'],_0x2203b9,{'role':'menu','ariaLabel':_0x5465f5['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x49df5f=>{_0x49df5f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x3fc75b=>{this['formValue']=_0x3fc75b['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x3fc75b['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x4f2942=[]){const _0x57491e=new _0x3ea87c();this['resetToDefault']();for(const _0x3aabd6 of _0x4f2942){const _0x361a8a=new _0x28b6c7({'label':_0x3aabd6['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3aabd6['id'],'model':_0x3aabd6});_0x361a8a['bind']('isOn')['to'](this,'formValue',_0x49c6ae=>_0x49c6ae===_0x361a8a['id']);const _0x2a9692={'type':'button','model':_0x361a8a};_0x57491e['add'](_0x2a9692);}return _0x57491e;}}class tc extends _0xe814a3{['_formItem']=null;constructor(_0x3efb2b,_0x1f522f,_0x43528d){super(_0x3efb2b),this['argsKey']=_0x1f522f?.['argsKey'];if('dropdown'===_0x1f522f['formType'])this['_formItem']=new Dr(this['locale'],_0x1f522f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x19f3b7=new _0x4bab5c(this['locale'],{'children':[this['_formItem']],'class':[_0x43528d?'ck-form__row_with-submit':'']});_0x43528d&&_0x19f3b7['children']['add'](_0x43528d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x19f3b7]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class wo extends _0x3da8aa{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xe5e0d7){super(_0xe5e0d7),this['set']('isEmpty',!0x0),this['keystrokes']=new _0x16d287(),this['minRows']=wo['MIN_ROWS'],this['maxRows']=wo['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class sc extends _0x2f8c3b{['focusTracker']=new _0x2afd45();['keystrokes']=new _0x16d287();['focusCycler'];['_focusables']=new _0x36b2b7();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x23fdc1,_0x27c877,_0x2b021b=!0x1){super(_0x23fdc1),this['_check']=_0x27c877,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x27c877['defaultModel']?_0x27c877['defaultModel']['id']:'',this['_defaultLabel']=_0x27c877['defaultModel']?_0x27c877['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x917031(this['locale'],()=>new wo(_0x23fdc1)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x3ea87c(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x2b021b),_0x3be524(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x4bab5c(this['locale'],{'children':[this['promptInputView']]}),new _0x4bab5c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x21b320,_0x54c52c)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x54c52c()):_0x54c52c();}),this['focusCycler']=new _0x1842f7({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x1d6cab=>{this['_focusables']['add'](_0x1d6cab),this['focusTracker']['add'](_0x1d6cab['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x2062f3 of this['_getFormValidators']()){const _0x523ecf=_0x2062f3();if(_0x523ecf)return this['promptInputView']['errorText']=_0x523ecf,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return i(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x16cf4f=new _0x5822be(this['locale']),t=this['locale']['t'];return _0x16cf4f['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x16cf4f['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x16cf4f;}['_createCancelButtonView'](){const _0x24a933=new _0x5822be(this['locale']),t=this['locale']['t'];return _0x24a933['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x24a933['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3c6799=>{_0x3c6799['stopPropagation']();})}}),_0x24a933['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x24a933;}['_setModelList'](_0xde06d6){this['_modelSelectionDropdownItems']['clear']();const _0x31659f=this['_check']['models'];if(_0xde06d6)this['set']('modelDisplayMode','hidden');else{const _0xd960cb=0x1===_0x31659f['length'];this['set']('modelDisplayMode',_0xd960cb?'name':'selector');}if(this['resetToDefault'](),_0x31659f?.['length']){0x1===_0x31659f['length']&&this['set']('activeModelName',_0x31659f[0x0]['name']||_0x31659f[0x0]['id']);for(const _0x1cc66f of _0x31659f){const _0x4eb12e=new _0x28b6c7({'label':_0x1cc66f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1cc66f['id'],'model':_0x1cc66f});_0x4eb12e['bind']('isOn')['to'](this,'modelId',_0x2cd57e=>_0x2cd57e===_0x1cc66f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4eb12e,'labelView':new _o(this['locale'],_0x1cc66f)});}}}['_createModelSelectionDropdown'](){const _0x430549=_0x103d4b(this['locale']);return _0x430549['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x430549['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),_0x430549['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2e75ff=>'selector'===_0x2e75ff),this['listenTo'](_0x430549,'execute',_0x431d3d=>{this['modelId']=_0x431d3d['source']['model']['id'],_0x430549['buttonView']['label']=_0x431d3d['source']['label'];}),_0x430549;}['_createModelNameView'](){const _0x56d84a=new po(this['locale']);return _0x56d84a['bind']('text')['to'](this,'activeModelName',_0x701e7f=>_0x701e7f??''),_0x56d84a['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1c4963=>'name'===_0x1c4963),_0x56d84a;}['_createActionsFooterView'](){const _0x39211a=new _0x2f8c3b(this['locale']);return _0x39211a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x39211a;}}class po extends _0x2f8c3b{constructor(_0x1fbe63){super(_0x1fbe63),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x4b4edc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x4b4edc['if']('isVisible','ck-hidden',_0x2a6f51=>!_0x2a6f51)]},'children':[{'text':_0x4b4edc['to']('text')}]});}}class _o extends _0x143c37{constructor(_0x51ca49,_0x2a124d){super();const _0x54a233=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x54a233['to']('style'),'id':_0x54a233['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x54a233['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2a124d['description']||'']}]}]});}}class ec extends _0xe814a3{['_formItemsCollection']=new _0x36b2b7();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x2975d1,_0x2e1a05,_0x4086b2,_0x2db6c0=!0x1){super(_0x2975d1),this['_hideModels']=_0x2db6c0,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2e1a05['isParameterized']);const _0x2d9a70=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0xbd84e3=>_0xbd84e3),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2ee7a2=>_0x2ee7a2)],'style':{'--ck-ai-review-check-list-item-index':_0x4086b2}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x2e1a05['title']}]},_0x2d9a70]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2e1a05['description']?[{'text':_0x2e1a05['description']}]:[]}]}]},..._0x2e1a05['isParameterized']?[this['_createParameterizedView'](_0x2e1a05)]:[],...'custom'===_0x2e1a05['id']?[this['_createCustomView'](_0x2e1a05,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2e1a05['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2e1a05['id'],'args':_0x2e1a05['useArgs']?_0x2e1a05['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x2c5270({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x54e0d4=>{_0x54e0d4['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x589e6c=new _0x32da72();return _0x589e6c['content']=_0x1c64d4,_0x589e6c['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x589e6c;}['_createParameterizedView'](_0x5b56fa){const _0x39e08e=new _0x2f8c3b(),_0x34771b=this['_createFormView'](_0x5b56fa);return _0x39e08e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3dfebf=>!_0x3dfebf)]},'children':[_0x34771b]}),_0x39e08e;}['_createFormView'](_0xc95cf6){const _0x1c9b60=new _0x2f8c3b(),_0x4c01e3=Array['isArray'](_0xc95cf6['options'])?_0xc95cf6['options']:[],_0x239d4d=new _0x5822be(this['locale']),t=this['locale']['t'];_0x239d4d['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x239d4d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f001f=>{_0x4f001f['stopPropagation']();})}}),_0x239d4d['on']('execute',()=>{const _0x37b8e7=[],_0x4573dc={};this['_formItemsCollection']['forEach'](_0x425f59=>{_0x37b8e7['push'](_0x425f59['value']),_0xc95cf6['useArgs']&&_0xc95cf6['options']&&(_0x4573dc[_0x425f59['argsKey']]=_0x425f59['value']);}),this['fire']('runReviewCheck',{'id':_0xc95cf6['id'],'params':_0x37b8e7['length']?_0x37b8e7:void 0x0,'args':Object['keys'](_0x4573dc)['length']?_0x4573dc:void 0x0});});const _0x309ffa=_0x4c01e3['length'];return _0x4c01e3['forEach']((_0x50b1a6,_0x5d60a5)=>{const _0x193ead=_0x5d60a5===_0x309ffa-0x1;this['_formItemsCollection']['add'](new tc(this['locale'],_0x50b1a6,_0x193ead?_0x239d4d:null));}),_0x1c9b60['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1c9b60;}['_createCustomView'](_0x16fec2,_0x321a98=!0x1){return this['_customCheckView']=new sc(this['locale'],_0x16fec2,_0x321a98),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x505e09=>!_0x505e09)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1badf1,_0x2cd601,_0xb2fd20)=>{_0xb2fd20||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class Te extends _0xe814a3{['_checkViews'];constructor(_0x24d206){super(_0x24d206),this['_checkViews']=new _0x36b2b7(),this['_setupTemplate']();}['setChecks'](_0x1fd039,_0xff02d=!0x1){this['_checkViews']['clear']();for(const [_0x236b4b,_0x183651]of _0x1fd039['entries']()){const _0x7b7f7a=new ec(this['locale'],_0x183651,_0x236b4b,_0xff02d);_0x7b7f7a['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x7b7f7a);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0xd3da55 of this['_checkViews'])_0xd3da55 instanceof ec&&_0xd3da55['resetToDefault']();}['_setupTemplate'](){const _0x1d0602=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1d0602['if']('isVisible','ck-hidden',_0x23866a=>!_0x23866a)]},'children':this['_checkViews']});}}class me extends Ie{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x58985a=this['context']['locale'],_0x3883b9=new _0x127487(_0x58985a,{'label':i(_0x58985a,'AI_REVIEW_MODE'),'icon':_0x26ef1a,'class':'ck-ai-header\x20ck-ai-header_review'});return new _e(this['context']['locale'],{'header':_0x3883b9,'list':new Te(_0x58985a),'results':new Re(_0x58985a,{'generalErrorText':i(_0x58985a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new de(_0x58985a,{'headerText':i(_0x58985a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':i(_0x58985a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x58985a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x38ca94=this['context']['plugins']['get']('AITabs');_0x38ca94['view']['on']('activateTab',(_0x45750e,_0xf5f3bf)=>{'reviewMode'===_0xf5f3bf?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x38ca94['view']['addTab']({'id':'reviewMode','buttonLabel':i(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x26ef1a,'order':0x0,'content':this['_mainView']});}}const le='review-';class ue extends _0x55a427{static get['requires'](){return[ot,D];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x4ace4b){super(_0x4ace4b),this['_domEmitter']=new(_0x3389ea())(),this['_eventEmitter']=new(_0x263abf())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x405a68=T(this['context']);_0x405a68['conversion']['for']('editingDowncast')['markerToElement']({'model':le+'insert','view':(_0x289bbb,{writer:_0x1778af})=>{const _0x4e50d2=this['_markers']['get'](_0x289bbb['markerName']),_0x3708e3={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4e50d2?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x289bbb['markerName']};return _0x1778af['createUIElement']('span',_0x3708e3,function(_0xef13c6){const _0x6c3a3e=this['toDomElement'](_0xef13c6);return _0x6c3a3e['innerHTML']=_0x4e50d2?.['content']?.['asString']||'',_0x6c3a3e;});}}),_0x405a68['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-only','view':_0x422156=>{const _0x91dfb6=this['_markers']['get'](_0x422156['markerName']),_0x5c11e2=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x91dfb6?.['id']||'')&&_0x5c11e2['push']('ck-ai_review__change_active'),{'classes':_0x5c11e2,'attributes':{'data-marker-id':_0x422156['markerName']}};}}),_0x405a68['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-context','view':_0x4af251=>{const _0x2be803=this['_markers']['get'](_0x4af251['markerName']),_0x1d4248=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x2be803?.['id']||'')&&_0x1d4248['push']('ck-ai_review__change_active'),{'classes':_0x1d4248,'attributes':{'data-marker-id':_0x4af251['markerName']}};}}),_0x405a68['conversion']['for']('editingDowncast')['markerToHighlight']({'model':le+'remove-text','view':_0x72ad42=>{const _0x2078c3=this['_markers']['get'](_0x72ad42['markerName']),_0xb372fe=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2078c3?.['id']||'')&&_0xb372fe['push']('ck-ai_review__change_active'),{'classes':_0xb372fe,'attributes':{'data-marker-id':_0x72ad42['markerName']}};}}),_0x405a68['conversion']['for']('dataDowncast')['markerToElement']({'model':le+'suggestion-context','view':(_0x2692d5,{writer:_0x24e9cb})=>_0x24e9cb['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2692d5['isOpening']?'start':'end')})}),_0x405a68['conversion']['for']('downcast')['attributeToAttribute']({'model':nt,'view':_0x33e8be});const _0x57a307=_0x405a68['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x57a307,'mouseup',(_0xcd1abb,_0x4d665a)=>{const _0x2aa137=_0x4d665a['target'],_0x513c4c=this['_findMarkerElement'](_0x2aa137);if(!_0x513c4c)return;const _0x5649c1=_0x513c4c['getAttribute']('data-marker-id'),_0x532c05=_0x5649c1['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5649c1,'changeId':_0x532c05,'markerElement':()=>this['_findMarkerElementById'](_0x5649c1),'domEvent':_0x4d665a});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x57a307,'mouseover',(_0x4f6b06,_0x250221)=>{const _0x3ada4c=_0x250221['target'],_0x11394b=_0x250221['relatedTarget'];let _0x2644c0=this['_findMarkerElement'](_0x3ada4c);if(!_0x2644c0&&_0x11394b&&(_0x2644c0=this['_findMarkerElement'](_0x11394b)),!_0x2644c0)return;const _0x4f5064=_0x2644c0['getAttribute']('data-marker-id'),_0x4c6619=_0x4f5064['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x4c6619,'markerElement':()=>this['_findMarkerElementById'](_0x4f5064),'domEvent':_0x250221});}),this['_domEmitter']['listenTo'](document,'mouseover',_0xb0192a((_0x30dd37,_0x49f00d)=>{const _0x340598=_0x49f00d['target'];if(this['_findMarkerElement'](_0x340598))return;_0x340598['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x405a68['model']['document']['registerPostFixer'](_0x404f7b=>this['_validateMarkers'](_0x405a68,_0x404f7b)),_0x405a68['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x405a68));}['getDocumentData'](){const _0x2fa795=this['context']['plugins']['get']('AIEditing'),_0x50b7df=T(this['context']),_0x518ff9=_0x50b7df['model'],_0x577918=new bt();for(const _0x5a647b of _0x518ff9['document']['getRoot']()['getChildren']()){const _0x247847=_0x5a647b['_clone'](!0x0);_0x577918['_appendChild'](_0x247847);}for(const _0x1aff0f of _0x518ff9['markers'])_0x577918['markers']['set'](_0x1aff0f['name'],this['_changeRangeOwnerDocument'](_0x1aff0f['getRange']()['clone'](),_0x577918));const _0x483cd0=new _0x1baffe({'ignoreElementEnd':!0x0,'startPosition':_0x518ff9['createPositionAt'](_0x577918,0x0)}),_0x52e7af=new Set(),_0x244901=new Map();for(const {item:_0x34f5b5}of _0x483cd0){if(!_0x34f5b5['is']('$textProxy'))continue;const _0x2dec58=_0x34f5b5['parent'];if(_0x2dec58&&_0x2dec58['is']('element')){const _0x24762c=this['_upsertDataId'](_0x2dec58,()=>_0x2fa795['_nextDataId'](_0x52e7af));_0x52e7af['add'](_0x24762c);for(const _0x2155fc of _0x2dec58['getChildren']())_0x2155fc['is']('element')&&_0x52e7af['add'](this['_upsertDataId'](_0x2155fc,()=>_0x2fa795['_nextDataId'](_0x52e7af)));let _0x39b2e9=_0x2dec58;for(;_0x39b2e9['parent']&&!_0x39b2e9['parent']['is']('documentFragment');)_0x39b2e9=_0x39b2e9['parent'],_0x39b2e9['hasAttribute'](nt)&&_0x39b2e9['_removeAttribute'](nt);_0x244901['set'](_0x24762c,{'path':_0x2dec58['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x39b2e9['_clone'](!0x0),_0x24762c,_0x50b7df['data'])}),_0x483cd0['jumpTo'](_0x518ff9['createPositionAfter'](_0x2dec58));}}return{'content':_0x50b7df['data']['processor']['toData'](_0x50b7df['data']['toView'](_0x577918)),'version':_0x50b7df['model']['document']['version'],'elements':_0x244901};}['diffContent'](_0x63c78f,_0x518ee1,_0x2c3139=!0x1){const _0x2b475f=[],_0x1cac86=T(this['context']),_0x1c4a4c=_0x1cac86['data']['parse'](_0x518ee1,'$documentFragment'),_0x22adaf=_0x1cac86['data']['parse'](_0x63c78f,'$documentFragment'),_0x15e1a0=_0x1cac86['model']['createPositionAt'](_0x22adaf,0x0);if(this['_haveSingleTopLevelElement'](_0x1c4a4c)){if(!this['_hasSameTopLevelElement'](_0x22adaf,_0x1c4a4c))return _0x2b475f;}else{const _0x309d36=_0x1cac86['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x22adaf,_0x309d36)||!this['_haveOnlyInlineContent'](_0x1c4a4c,_0x309d36))return _0x2b475f;}const _0x35b138=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x63c78f,_0x518ee1,{'anchor':_0x15e1a0,'markDeletions':!0x0})['getOperations']()['filter'](_0x4acfc1=>'insert'===_0x4acfc1['type']||'marker'===_0x4acfc1['type']&&_0x4acfc1['name']['startsWith']('$markedRemove')),_0x170882=this['_groupAdjacentOperations'](_0x35b138),_0x46e942=[];if(_0x2c3139){if(_0x170882['length']){const _0x77a773=_0x170882[0x0]['operations'][0x0],_0x3b4b1d='insert'===_0x77a773['type']?_0x77a773['position']:_0x77a773['newRange']['start'],_0x4c6996=this['_getPositionLimitingRange'](_0x3b4b1d,_0x1cac86,'inside'),_0x28983b=_0x4c6996?_0x1c4a4c['getChild'](0x0)['getChildren']():_0x1c4a4c['getChildren'](),_0x3675d2=_0x4c6996||_0x1cac86['model']['createRangeIn'](_0x22adaf),_0xa3cbf9=[new _0x2d0c9e('$markedRemove:synthetic'+_0x36c3ed(),null,_0x3675d2,_0x1cac86['model']['document']['model']['markers'],!0x0,_0x1cac86['model']['document']['version']+0x1),new _0x5bbfdf(_0x3675d2['end'],_0x28983b,_0x1cac86['model']['document']['version']+0x2)];_0x46e942['push']({'operations':_0xa3cbf9,'operationsIsolated':_0xa3cbf9,'groupOffset':0x0});}}else _0x46e942['push'](..._0x170882);let _0x3c83a2=0x0;return _0x1cac86['model']['change'](_0x52ba25=>{for(let _0x47ce22=0x0;_0x47ce22<_0x46e942['length'];_0x47ce22++){const _0xc3ac8a=_0x46e942[_0x47ce22],_0x21429e=_0x52ba25['createDocumentFragment']();for(const _0x427eb8 of _0x22adaf['getChildren']())_0x52ba25['append'](_0x427eb8['_clone'](!0x0),_0x21429e);for(const _0x1ff911 of _0xc3ac8a['operationsIsolated'])if('insert'===_0x1ff911['type']){const _0x109dc8=_0x1ff911;_0x109dc8['baseVersion']=null,_0x109dc8['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x109dc8,_0x21429e),_0x52ba25['batch']['addOperation'](_0x1ff911),_0x1cac86['model']['applyOperation'](_0x1ff911);const _0x16e8f4='suggestion:insertion:id:authorId:'+_0x3c83a2++,_0x4c8cfd=_0x1cac86['model']['createRange'](_0x109dc8['position'],_0x109dc8['position']['getShiftedBy'](_0x109dc8['howMany']));_0x21429e['markers']['set'](_0x16e8f4,_0x4c8cfd);}else{if('marker'===_0x1ff911['type']&&_0x1ff911['name']['startsWith']('$markedRemove')){const _0x5386b3=_0x1ff911,_0x587b74='suggestion:deletion:id:authorId:'+_0x3c83a2++;this['_changeOperationOwnerDocument'](_0x5386b3,_0x21429e),_0x21429e['markers']['set'](_0x587b74,_0x5386b3['newRange']);}}if(_0x2c3139)_0x2b475f['push']({..._0xc3ac8a,'context':this['_createGetContentFn'](_0x22adaf,_0x1cac86['data']),'content':this['_createGetContentFn'](_0x22adaf,_0x1cac86['data'])});else{const _0x1e86b4=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0xc3ac8a['operationsIsolated'][0x0]),_0x21429e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0xc3ac8a['operationsIsolated'][_0xc3ac8a['operationsIsolated']['length']-0x1]),_0x21429e));_0x21429e['markers']['set'](le+'suggestion-context',new dt(_0x1e86b4['start'],_0x1e86b4['end'])),_0x2b475f['push']({..._0xc3ac8a,'context':this['_createGetContextFn'](_0x21429e,_0x1cac86['data'],{'ellipsisBefore':_0x1e86b4['hasContentBefore'],'ellipsisAfter':_0x1e86b4['hasContentAfter']}),'content':this['_createGetContentFn'](_0x21429e,_0x1cac86['data'])});}}}),_0x2b475f;}['markChangePositionInEditorContent'](_0x4d287b,_0x31bdaa){if(!_0x4d287b['length'])return;const _0x425593=_0x4d287b[0x0]['parent']['id'],_0x568d6a=_0x31bdaa['elements']['get'](_0x425593);if(!_0x568d6a)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x425593);const _0x35df42=_0x568d6a['path'],_0x290680=T(this['context']),_0x44322f=_0x290680['model']['document']['history']['getOperations'](_0x31bdaa['version']),_0x4c22a9=[];for(const _0x293a59 of _0x4d287b){const _0x3fceda=_0x293a59['operationsIsolated']['map'](_0x4326c1=>this['_translateOperationToEditorContent'](_0x4326c1,_0x35df42,_0x290680['model']['document']['getRoots']()[0x0]));if(!_0x3fceda||!_0x3fceda['length'])continue;const _0x4b4fbf=_0x3fceda['every'](_0x4b0c24=>'marker'===_0x4b0c24['type']&&_0x4b0c24['name']['startsWith']('$markedRemove')),_0x21d622={'document':_0x290680['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x56c365=kt(_0x3fceda,_0x44322f,_0x21d622)['operationsA'];for(const _0x4b4699 of _0x56c365)if('insert'===_0x4b4699['type']){const _0x30a812=_0x4b4699,_0x152716=_0x30a812['nodes'];_0x290680['model']['change'](_0x53dcf1=>{const _0x2241c5=_0x53dcf1['createDocumentFragment']();for(const _0x11be76 of _0x152716)_0x53dcf1['append'](_0x11be76['_clone'](!0x0),_0x2241c5);_0x4c22a9['push']({'start':_0x30a812['position'],'end':_0x30a812['position'],'type':'insert','groupId':_0x293a59['id'],'content':{'asString':this['_createGetContentFn'](_0x2241c5,_0x290680['data'])(),'asFragment':_0x2241c5}});});}else{if('marker'===_0x4b4699['type']&&_0x4b4699['name']['startsWith']('$markedRemove')){const _0x424a7c=_0x4b4699;let _0x5d85e3='remove-text';if(_0x4b4fbf){const _0xce767e=this['_findAdjacentContextDistance'](_0x424a7c['newRange']['start'],'backward',_0x290680['model']['schema']),_0x2b3436=this['_findAdjacentContextDistance'](_0x424a7c['newRange']['end'],'forward',_0x290680['model']['schema']);if(_0xce767e||_0x2b3436){const _0x5d86aa=_0x424a7c['newRange']['start']['getShiftedBy'](-_0xce767e),_0x2a1e6f=_0x424a7c['newRange']['end']['getShiftedBy'](_0x2b3436);_0x4c22a9['push']({'start':_0x5d86aa,'end':_0x2a1e6f,'groupId':_0x293a59['id'],'type':'remove-context'});}else _0x5d85e3='remove-only';}_0x4c22a9['push']({'start':_0x424a7c['newRange']['start'],'end':_0x424a7c['newRange']['end'],'groupId':_0x293a59['id'],'type':_0x5d85e3});}}}this['_insertMarkers'](_0x4c22a9);}['clearAllMarkers'](){const _0x47f668=T(this['context']);_0x47f668['model']['change'](_0x414f10=>{for(const _0x434fc0 of this['_markers']['keys']())_0x47f668['model']['markers']['get'](_0x434fc0)&&_0x414f10['removeMarker'](_0x434fc0);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){T(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){T(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5c4eab){const _0x4b158f=T(this['context']),_0x58ad05=_0x4b158f['model'],_0x549867=_0x5c4eab['map'](_0x43b804=>this['_getMarkersDataForGroup'](_0x43b804))['flat']();_0x58ad05['change'](_0x164c41=>{for(const _0x328f8a of _0x549867){const _0x427977=_0x4b158f['model']['markers']['get'](_0x328f8a['id']);if(_0x427977){if('insert'===_0x328f8a['type']){if(!_0x328f8a['content'])continue;_0x58ad05['insertContent'](_0x328f8a['content']['asFragment']||null,_0x427977['getRange']()['start']);}else'remove-text'!==_0x328f8a['type']&&'remove-only'!==_0x328f8a['type']||_0x58ad05['deleteContent'](_0x58ad05['createSelection'](_0x427977['getRange']()));_0x164c41['removeMarker'](_0x328f8a['id']),this['_markers']['delete'](_0x328f8a['id']);}}});}['rejectChange'](_0x3833b6){const _0x241d74=T(this['context']),_0xd47edd=this['_getMarkersDataForGroup'](_0x3833b6);_0x241d74['model']['change'](_0x20a3f9=>{for(const _0x36abc9 of _0xd47edd)_0x20a3f9['removeMarker'](_0x36abc9['id']),this['_markers']['delete'](_0x36abc9['id']);});}['getEditor'](){return T(this['context']);}['getMarkerElementForChange'](_0x48f48d){const _0x3ccd33=Array['from'](this['_markers']['values']())['filter'](_0x23256c=>_0x23256c['groupId']===_0x48f48d);if(!_0x3ccd33['length'])return null;const _0x4d0abb=0x1===_0x3ccd33['length']?_0x3ccd33[0x0]:this['_sortMarkers'](_0x3ccd33)[0x0],_0x3d6aad=T(this['context'])['model']['markers']['get'](_0x4d0abb['id']);if(!_0x3d6aad)return null;return{'modelRange':_0x3d6aad['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x4d0abb['id'])};}['getContentElementForChange'](_0xa13a27){const _0x1a9603=Array['from'](this['_markers']['values']())['filter'](_0x3c26a7=>_0x3c26a7['groupId']===_0xa13a27);if(!_0x1a9603['length'])return null;const _0x357088=0x1===_0x1a9603['length']?_0x1a9603[0x0]:this['_sortMarkers'](_0x1a9603)[0x0],_0x15a131=T(this['context']),_0x105b04=_0x15a131['model']['markers']['get'](_0x357088['id']);if(!_0x105b04)return null;const _0x54e0ab=_0x105b04['getRange'](),_0x212196=_0x15a131['editing']['view']['getDomRoot']();if(!_0x212196||!_0x54e0ab)return null;let _0x2b1339=_0x54e0ab['start']['parent'];for(;_0x2b1339['parent']&&'$root'!==_0x2b1339['parent']['name'];)_0x2b1339=_0x2b1339['parent'];if(!_0x2b1339||!_0x2b1339['name'])return null;const _0x59b0a8=_0x212196['querySelector']('[data-marker-id=\x22'+_0x357088['id']+'\x22]');if(!_0x59b0a8)return null;let _0x4ddfed=null;_0x15a131['model']['change'](_0x5926a3=>{_0x4ddfed=_0x5926a3['createDocumentFragment'](),_0x5926a3['append'](_0x2b1339['_clone'](!0x0),_0x4ddfed);});const _0x444401=_0x15a131['data']['toView'](_0x4ddfed)['getChild'](0x0);return _0x59b0a8['closest'](_0x444401['name']);}['reactivateMarkers'](_0x463386){const _0x175ae2=this['_getMarkersDataForGroup'](_0x463386);if(!_0x175ae2['length'])return;const _0x3c60a5=Array['from'](this['_activeMarkers'])['sort'](),_0x1ab93c=Array['from'](new Set(_0x175ae2['map'](_0x261676=>_0x261676['id'])))['sort']();_0x3c60a5['join']('|')!==_0x1ab93c['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x463386));}['setMarkersInElementAsActive'](_0x2b8e94){const _0x25a397=this['_getMarkersDataForGroup'](_0x2b8e94);if(!_0x25a397['length'])return;const _0x37fe3f=T(this['context']),_0x139ebc=new Set(_0x25a397['map'](_0x3c6a2e=>_0x3c6a2e['id'])),_0x1c51f9=Array['from'](_0x139ebc['values']())['map'](_0x2321cb=>_0x37fe3f['model']['markers']['get'](_0x2321cb))['filter'](_0xe977=>!!_0xe977);_0x139ebc['forEach'](_0x4f9965=>{this['_activeMarkers']['add'](_0x4f9965);}),_0x37fe3f['model']['change'](()=>{_0x1c51f9['forEach'](_0xfa52e6=>{_0x37fe3f['editing']['reconvertMarker'](_0xfa52e6);});});}['setAllMarkersAsInactive'](){const _0x21c419=Array['from'](this['_activeMarkers']);if(!_0x21c419['length'])return;this['_activeMarkers']['clear']();const _0x2d5f55=T(this['context']),_0x279aad=_0x21c419['map'](_0x5845d8=>_0x2d5f55['model']['markers']['get'](_0x5845d8))['filter'](_0x4c5d37=>!!_0x4c5d37);_0x2d5f55['model']['change'](()=>{_0x279aad['forEach'](_0x12713a=>{_0x2d5f55['editing']['reconvertMarker'](_0x12713a);});});}['_getPositionLimitingRange'](_0x2f10f3,_0x3d5a1a,_0x33387a='outside'){if(!_0x2f10f3)return null;let _0x201ff9=_0x2f10f3['parent'];for(;_0x201ff9&&_0x201ff9['parent']&&'$root'!==_0x201ff9['parent']['name']&&!_0x3d5a1a['model']['schema']['isLimit'](_0x201ff9)&&!_0x3d5a1a['model']['schema']['isBlock'](_0x201ff9);)_0x201ff9=_0x201ff9['parent'];if(!_0x201ff9||!_0x201ff9['name']||'$root'===_0x201ff9['name'])return null;let _0x46e819=null;return _0x3d5a1a['model']['change'](_0x3e61c7=>{_0x46e819='inside'===_0x33387a?_0x3e61c7['createRangeIn'](_0x201ff9):_0x3e61c7['createRangeOn'](_0x201ff9);}),_0x46e819;}['_validateMarkers'](_0x32cd9f,_0x4b3e07){const _0x3729bd=Array['from'](this['_markers']['keys']()),_0x3375d5=new Map();for(const _0x4d7f3c of _0x3729bd){const _0x38e45c=_0x32cd9f['model']['markers']['get'](_0x4d7f3c);if(!_0x38e45c)continue;const _0x105180=_0x38e45c['getStart']()['path'][0x0];_0x3375d5['has'](_0x105180)||_0x3375d5['set'](_0x105180,[]),_0x3375d5['get'](_0x105180)['push'](_0x38e45c);}const _0x10fd93=new Set();for(const _0x887f5a of _0x32cd9f['model']['document']['differ']['getChanges']()){let _0x21edef=-0x1,_0x272849=null;if('insert'===_0x887f5a['type'])_0x272849=new dt(_0x887f5a['position'],_0x887f5a['position']['getShiftedBy'](_0x887f5a['length'])),_0x21edef=_0x887f5a['position']['path'][0x0];else{if('remove'!==_0x887f5a['type'])continue;_0x272849=new dt(_0x887f5a['position']),_0x21edef=_0x887f5a['position']['path'][0x0];}const _0x11f985=_0x3375d5['get'](_0x21edef)||[];if(_0x11f985['length']){for(const _0x4d7e7a of _0x11f985)if(_0x272849['root']['rootName']===_0x4d7e7a['getRange']()['root']['rootName']&&('insert'!==_0x887f5a['type']||!_0x272849['containsRange'](_0x4d7e7a['getRange']()))&&(_0x272849['isIntersecting'](_0x4d7e7a['getRange']())||_0x272849['start']['isTouching'](_0x4d7e7a['getRange']()['end'])||_0x272849['end']['isTouching'](_0x4d7e7a['getRange']()['start']))){const _0x2f1bc8=this['_parseMarkerName'](_0x4d7e7a['name']);Array['from'](this['_markers']['values']())['filter'](_0xdef99=>_0xdef99['groupId']===_0x2f1bc8['groupId'])['forEach'](_0x5d8466=>_0x10fd93['add'](_0x5d8466['id']));}}}if(_0x10fd93['size']){for(const _0x48a011 of _0x10fd93)_0x4b3e07['removeMarker'](_0x48a011);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x46ed32){for(const {name:_0x455b3a,data:_0x3e6cb9}of _0x46ed32['model']['document']['differ']['getChangedMarkers']()){if(!_0x455b3a['startsWith'](le))continue;const _0x36b65a=_0x3e6cb9['oldRange'],_0x23f788=_0x3e6cb9['newRange'],_0x699222=_0x36b65a&&'$graveyard'===_0x36b65a['root']['rootName'],_0x493766=_0x23f788&&'$graveyard'===_0x23f788['root']['rootName'];if(_0x699222&&_0x493766)continue;const _0x1e613a=this['_parseMarkerName'](_0x455b3a);this['_markers']['get'](_0x455b3a)&&(_0x493766||!_0x23f788?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x455b3a,'changeId':_0x1e613a['groupId']}):_0x699222&&_0x23f788&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x455b3a,'changeId':_0x1e613a['groupId']}));}}['_parseMarkerName'](_0x5c5460){const _0x5314cf=_0x5c5460['split'](':'),_0x645fad=(_0x5314cf[0x1]||'')['split']('_');return{'prefix':_0x5314cf[0x0],'groupId':_0x645fad[0x0],'suffix':_0x645fad[0x1]};}['_translateOperationToEditorContent'](_0x2d3b2b,_0x5ada34,_0x45e4bb){if('insert'===_0x2d3b2b['type']){const _0x2b5bf8=_0x2d3b2b;return new _0x5bbfdf(this['_changePosition'](_0x5ada34['concat'](_0x2b5bf8['position']['offset']),_0x45e4bb),_0x2b5bf8['nodes'],_0x2b5bf8['baseVersion']);}if('marker'===_0x2d3b2b['type']&&_0x2d3b2b['name']['startsWith']('$markedRemove')){const _0xd0ae77=_0x2d3b2b;return new _0x2d0c9e(_0xd0ae77['name'],_0xd0ae77['oldRange'],this['_changeRange'](_0xd0ae77['newRange'],_0x5ada34['concat'](_0xd0ae77['newRange']['start']['offset']),_0x5ada34['concat'](_0xd0ae77['newRange']['end']['offset']),_0x45e4bb),_0xd0ae77['_markers'],_0xd0ae77['affectsData'],_0xd0ae77['baseVersion']);}return _0x2d3b2b;}['_groupAdjacentOperations'](_0xf4464){if(!_0xf4464['length'])return[];const _0x38145f=[];let _0x3bb451=0x0,_0x48231f=0x0,_0x4c6cf4=[];for(let _0x4adf7b=0x0;_0x4adf7b<=_0xf4464['length'];_0x4adf7b++){const _0x15bc5f=_0xf4464[_0x4adf7b],_0x57cac0=_0xf4464[_0x4adf7b-0x1];!_0x15bc5f||_0x57cac0&&!this['_getOperationEnd'](_0x57cac0)['isTouching'](this['_getOperationStart'](_0x15bc5f))?(_0x38145f['push']({'operations':_0x4c6cf4,'operationsIsolated':_0x4c6cf4['map'](_0x118d60=>this['_shiftOperation'](_0x118d60['clone'](),-_0x48231f)),'groupOffset':_0x3bb451}),_0x4c6cf4=_0x15bc5f?[_0x15bc5f]:[],_0x48231f+=_0x3bb451,_0x3bb451=0x0):_0x4c6cf4['push'](_0x15bc5f),_0x15bc5f&&'insert'===_0x15bc5f['type']&&(_0x3bb451+=_0x15bc5f['howMany']);}return _0x38145f;}['_findAdjacentContextDistance'](_0x27cf1a,_0x1852a4,_0x26d98e,_0xb687c=0x1){const _0x11ad4c=new _0x1baffe({'startPosition':_0x27cf1a,'direction':_0x1852a4});let _0x4f7e76=0x0;for(let _0x5e0e05=0x0;_0x5e0e05<_0xb687c;_0x5e0e05++){let _0x407c72=0x0,_0x55e5e9=!0x1,_0x53fd3c='forward'===_0x1852a4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5a67c7}of _0x11ad4c)if(_0x5a67c7['is']('$textProxy')){const _0x3a2a06=_0x53fd3c['exec'](_0x5a67c7['data']);if(_0x3a2a06&&_0x3a2a06['length']){if(_0x407c72+='forward'===_0x1852a4?_0x3a2a06['index']+_0x3a2a06[0x0]['length']:_0x5a67c7['data']['length']-_0x3a2a06['index'],_0x3a2a06[0x0]['length']!==_0x5a67c7['data']['length'])break;_0x55e5e9=!0x0,_0x53fd3c='forward'===_0x1852a4?/^\w+/:/\w+$/;}else{if(_0x55e5e9)break;_0x407c72+=_0x5a67c7['offsetSize'];}}else{if(_0x5a67c7['is']('element')){_0x26d98e['isInline'](_0x5a67c7)&&!_0x55e5e9&&(_0x407c72+=0x1);break;}}_0x4f7e76+=_0x407c72,_0x11ad4c['jumpTo'](_0x27cf1a['getShiftedBy']('forward'===_0x1852a4?_0x4f7e76:-_0x4f7e76));}return _0x4f7e76;}['_getChangeContext'](_0x290d0a,_0x16c672){const _0x1fb36a=T(this['context'])['model']['schema'],_0x5adb69=this['_findAdjacentContextDistance'](_0x290d0a,'backward',_0x1fb36a,0x6),_0x9e0d59=this['_findAdjacentContextDistance'](_0x16c672,'forward',_0x1fb36a,0x6),_0x439771=_0x290d0a['getShiftedBy'](-_0x5adb69),_0x3e2a6c=_0x16c672['getShiftedBy'](_0x9e0d59);return{'start':_0x439771,'end':_0x3e2a6c,'hasContentBefore':!_0x439771['isAtStart'],'hasContentAfter':!_0x3e2a6c['isAtEnd']};}['_insertMarkers'](_0x7722f8){const _0xa170be=this['context']['plugins']['get']('AIEditing'),_0x3a8673=new Set();T(this['context'])['model']['change'](_0x286a6b=>{for(const _0x48e924 of _0x7722f8){const _0x2041ba=''+le+_0x48e924['type']+':'+_0x48e924['groupId']+'_'+_0xa170be['_nextDataId'](_0x3a8673);this['_markers']['set'](_0x2041ba,{'id':_0x2041ba,'groupId':_0x48e924['groupId'],'type':_0x48e924['type'],'content':_0x48e924['content']}),_0x286a6b['addMarker'](_0x2041ba,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x286a6b['createRange'](_0x48e924['start'],_0x48e924['end'])});}});}['_createGetContextFn'](_0x27814b,_0x5f14f9,_0x467015){let _0x22598b='';return()=>{if(!_0x22598b){const _0x2b9517=_0x5f14f9['toView'](_0x27814b,{'showSuggestionHighlights':!0x0});let _0x388a59=_0x2b9517['getChild'](0x0);if(_0x388a59['is']('containerElement')||(_0x388a59=_0x2b9517),!_0x388a59)return'';let _0x30e9bc=!0x1;const _0x230139=[];for(const _0x246316 of _0x388a59['getChildren']())_0x246316['is']('element','span')&&_0x246316['hasClass']('ck-ai_review-marker_context-end')&&(_0x30e9bc=!0x1),_0x30e9bc&&_0x230139['push'](_0x246316),_0x246316['is']('element','span')&&_0x246316['hasClass']('ck-ai_review-marker_context-start')&&(_0x30e9bc=!0x0);_0x388a59['_removeChildren'](0x0,_0x388a59['childCount']),_0x467015?.['ellipsisBefore']&&_0x388a59['_appendChild']('…'),_0x388a59['_appendChild'](_0x230139),_0x467015?.['ellipsisAfter']&&_0x388a59['_appendChild']('…');const _0x9daa06=_0x5f14f9['htmlProcessor']['domConverter']['viewToDom'](_0x2b9517),_0xc666d=_0x5f14f9['htmlProcessor']['htmlWriter']['getHtml'](_0x9daa06);_0x22598b=_0xc666d;}return _0x22598b;};}['_createGetContentFn'](_0x1f9c9d,_0x1f8539){let _0x2225ce='';return()=>(_0x2225ce||(_0x2225ce=_0x1f8539['stringify'](_0x1f9c9d,{'showSuggestionHighlights':!0x0})),_0x2225ce);}['_createGetContentUsingDataIdFn'](_0x49aca0,_0x57200e,_0x140760){let _0x2d394a='';return()=>{if(!_0x2d394a){const _0x434e0f=_0x140760['toView'](new bt(_0x49aca0)),_0x5c8ede=_0x140760['htmlProcessor']['domConverter']['viewToDom'](_0x434e0f)['querySelector']('[data-id=\x22'+_0x57200e+'\x22]');_0x2d394a=_0x5c8ede?.['outerHTML']||'';}return _0x2d394a;};}['_findMarkerElement'](_0x2016ee,_0x478727=0x5){let _0x5c1e57=_0x2016ee,_0x3fa7ac=null;for(let _0x460d30=0x0;_0x460d30<_0x478727&&_0x5c1e57;_0x460d30++){if(!_0x5c1e57['className']){_0x5c1e57=_0x5c1e57['parentElement'];continue;}if(!(''+_0x5c1e57['className'])['includes']('ck-ai_review-marker_')){_0x5c1e57=_0x5c1e57['parentElement'];continue;}if(!_0x5c1e57['getAttribute']('data-marker-id'))break;_0x3fa7ac=_0x5c1e57;break;}return _0x3fa7ac;}['_findMarkerElementById'](_0x6ce77e){const _0x4cdff1=T(this['context']),_0x258232=_0x4cdff1['model']['markers']['get'](_0x6ce77e);return _0x258232?_0x542205(_0x4cdff1['editing'],_0x258232):null;}['_getMarkersDataForGroup'](_0x4c3e24){return Array['from'](this['_markers']['values']())['filter'](_0x270fcb=>_0x270fcb['groupId']===_0x4c3e24);}['_getOperationStart'](_0x2d1fc5){return'insert'===_0x2d1fc5['type']?_0x2d1fc5['position']:_0x2d1fc5['newRange']['start'];}['_getOperationEnd'](_0x198a23,_0x309754=!0x1){return'insert'===_0x198a23['type']?_0x309754?_0x198a23['position']:_0x198a23['position']['getShiftedBy'](_0x198a23['howMany']):_0x198a23['newRange']['end'];}['_shiftOperation'](_0x4fe6ea,_0x26b28a){return'insert'===_0x4fe6ea['type']?_0x4fe6ea['position']=_0x4fe6ea['position']['getShiftedBy'](_0x26b28a):'marker'===_0x4fe6ea['type']&&_0x4fe6ea['newRange']&&(_0x4fe6ea['newRange']=new dt(_0x4fe6ea['newRange']['start']['getShiftedBy'](_0x26b28a),_0x4fe6ea['newRange']['end']['getShiftedBy'](_0x26b28a))),_0x4fe6ea;}['_changeOperationOwnerDocument'](_0x4471d5,_0x5a800a){'insert'===_0x4471d5['type']?_0x4471d5['position']=this['_changePositionOwnerDocument'](_0x4471d5['position'],_0x5a800a):'marker'===_0x4471d5['type']&&_0x4471d5['newRange']&&(_0x4471d5['newRange']=this['_changeRangeOwnerDocument'](_0x4471d5['newRange'],_0x5a800a));}['_changePositionOwnerDocument'](_0x212b30,_0x4c26ca){return new vt(_0x4c26ca,_0x212b30['path']);}['_changeRangeOwnerDocument'](_0x17ecb0,_0x1d2b63){return new dt(this['_changePositionOwnerDocument'](_0x17ecb0['start'],_0x1d2b63),this['_changePositionOwnerDocument'](_0x17ecb0['end'],_0x1d2b63));}['_changePosition'](_0x4880d1,_0x54b2f0){return new vt(_0x54b2f0,[..._0x4880d1]);}['_changeRange'](_0x9f11c6,_0x27e569,_0x3e57d6,_0x3e37cf){return new dt(this['_changePosition'](_0x27e569,_0x3e37cf),this['_changePosition'](_0x3e57d6,_0x3e37cf));}['_sortMarkers'](_0x3d85e2){const _0x3ab7d0=_0x36d4ba=>{switch(_0x36d4ba){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x3d85e2['sort']((_0x1bcbd0,_0x228b45)=>_0x3ab7d0(_0x1bcbd0['type'])-_0x3ab7d0(_0x228b45['type']));}['_hasSameTopLevelElement'](_0xc7c653,_0x4f51ca){const _0x374634=_0xc7c653['getChild'](0x0),_0x1e831c=_0x4f51ca['getChild'](0x0);return!(!_0x374634||!_0x1e831c)&&((!_0x374634['is']('element')||!_0x1e831c['is']('element')||_0x374634['name']===_0x1e831c['name'])&&!(_0x374634['is']('element')&&!_0x1e831c['is']('element')||!_0x374634['is']('element')&&_0x1e831c['is']('element')));}['_haveSingleTopLevelElement'](_0x40271c){return 0x1===_0x40271c['childCount'];}['_haveOnlyInlineContent'](_0x2420e0,_0xd52642){for(const _0x21e633 of _0x2420e0['getChildren']())if(_0x21e633['is']('element')&&!_0xd52642['isInline'](_0x21e633))return!0x1;return!0x0;}['_upsertDataId'](_0x297692,_0x5033bd){let _0x2a0543=_0x297692['getAttribute'](nt);return _0x2a0543||(_0x2a0543=_0x5033bd(),_0x297692['_setAttribute'](nt,_0x2a0543)),_0x2a0543;}}class zs extends _0x263abf(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1deda3,contentNew:_0x36a430,contentInitial:_0x1ab06e,documentVersion:_0x312876}){super(),this['id']=_0x1deda3,this['contentNew']=_0x36a430,this['contentInitial']=_0x1ab06e,this['documentVersion']=_0x312876;}}class Ms extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x220e0c,_0x1bc440,_0x36dc11){super(),this['id']=_0x220e0c,this['parent']=_0x36dc11,this['_data']=_0x1bc440,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Js extends ts(){['id']=_0x36c3ed();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x552663,_0x18415b,_0x351ee5,_0xdd8c42,_0x21803e){super(),this['_sourceCheck']=_0x18415b,this['_documentData']=_0x552663,this['_aiConnector']=_0x351ee5,this['_reviewParams']=_0xdd8c42,this['_reviewArgs']=_0x21803e,this['on']('change:status',(_0x4683ea,_0x58d3c0,_0x3062b7)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x3062b7,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x489374=>'pending'===_0x489374['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3bb9d9){this['_documentData']=_0x3bb9d9;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x2fd754=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4f1bd7 of _0x2fd754)'unmodified'!==_0x4f1bd7['data']['operation']&&('error'!==_0x4f1bd7['data']['operation']?'review-metadata'!==_0x4f1bd7['event']?this['_addReviewCheckResult'](_0x4f1bd7['data']['dataId'],_0x4f1bd7['data']['textDelta']):this['callId']=_0x4f1bd7['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x2b7c1f){this['_currentError']=_0x2b7c1f,_0x2b7c1f instanceof Error&&_0x2b7c1f['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'](_0x67482b,_0x16404a){const _0x39dfde=this['_results']['get'](_0x67482b);if(!_0x39dfde)return;if(0x0===_0x16404a['length'])return;const _0x24ee07=[];_0x16404a['forEach']((_0x44c6eb,_0x259083)=>{const _0x563486=new Ms(_0x39dfde['id']+'-'+_0x259083,_0x44c6eb,_0x39dfde);_0x563486['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x563486,'status':_0x563486['status']});}),_0x563486['on']('change:isActivated',()=>{_0x563486['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x563486}):this['fire']('reviewCheckResultDeactivated',{'change':_0x563486});}),this['_changes']['push'](_0x563486),_0x24ee07['push'](_0x563486);}),this['fire']('reviewCheckResultReady',{'changes':_0x24ee07,'result':_0x39dfde,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4af6c9){const _0x539276=this['_changes']['find'](_0x796094=>_0x796094['id']===_0x4af6c9);return!(!_0x539276||'pending'!==_0x539276['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xdc45c7=>!0x0===_0xdc45c7['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x3e7cab=>'pending'===_0x3e7cab['status']);}['getChangeById'](_0xd9551e){return this['_changes']['find'](_0x3b3190=>_0x3b3190['id']===_0xd9551e);}['markAllChangesAsAccepted'](){for(const _0x39f80a of this['_changes'])'pending'===_0x39f80a['status']&&(_0x39f80a['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x376e20){const _0x34930f=this['_changes']['find'](_0x481302=>_0x481302['id']===_0x376e20);_0x34930f&&'pending'===_0x34930f['status']&&(_0x34930f['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x317944){const _0x4a3a7e=this['_changes']['find'](_0x71c271=>_0x71c271['id']===_0x317944);_0x4a3a7e&&'pending'===_0x4a3a7e['status']&&(_0x4a3a7e['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1ce876){const _0x413d85=this['_changes']['find'](_0x5eae43=>_0x5eae43['id']===_0x1ce876);_0x413d85&&'pending'===_0x413d85['status']&&(_0x413d85['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x35b658){const _0x198093=this['_changes']['find'](_0x614b11=>_0x614b11['id']===_0x35b658);_0x198093&&'outdated'===_0x198093['status']&&(_0x198093['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0xbf50d3){this['_changes']['filter'](_0x5caa04=>_0x5caa04['isActivated']&&_0x5caa04['id']!==_0xbf50d3)['forEach'](_0x1c6169=>{_0x1c6169['isActivated']=!0x1;});const _0x356f49=this['_changes']['find'](_0x396b0f=>_0x396b0f['id']===_0xbf50d3);_0x356f49&&'pending'===_0x356f49['status']&&(_0x356f49['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3c04e5=>_0x3c04e5['isActivated'])['forEach'](_0x58af25=>{_0x58af25['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xe7e004){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x42d4c8;if(_0xe7e004){const _0xaf8990=this['_changes']['find'](_0x25cffb=>_0x25cffb['id']===_0xe7e004);if(_0xaf8990&&_0xaf8990['isRated'])return;_0xaf8990&&(_0x42d4c8=_0xaf8990['parent']['id'],_0xaf8990['isRated']=!0x0);}const _0x28c420={'positiveCount':this['_changes']['filter'](_0x5c7a86=>'accepted'===_0x5c7a86['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x28c420,this['callId'],_0x42d4c8);}['_addReviewCheckResult'](_0x39c9d1,_0x201c0f){const _0x369e7c=this['_documentData']['elements']['get'](_0x39c9d1);if(!_0x369e7c)return;const _0x3c646e=_0x369e7c['getContent']();if(_0x3c646e===_0x201c0f)return;const _0x59658c=new zs({'id':_0x39c9d1,'contentInitial':_0x3c646e,'contentNew':_0x201c0f,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x59658c['id'],_0x59658c),this['fire']('reviewCheckResultAdded',{'result':_0x59658c,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x3c1d84=>'pending'===_0x3c1d84['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0xc21402=>'pending'===_0xc21402['status'])['length']&&(this['status']='finished'));}}class si extends Js{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x46a34f=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x37c41b=0x0;_0x37c41b<this['_reviewParams']['length'];_0x37c41b++){if(!this['_reviewParams'][_0x37c41b]||!this['_sourceCheck']['options'][_0x37c41b])continue;const _0x58fb29=this['_sourceCheck']['options'][_0x37c41b],_0x38d295=_0x58fb29['data']?.['find'](_0x3527a8=>_0x3527a8['id']===this['_reviewParams'][_0x37c41b]);_0x38d295&&_0x46a34f['push'](_0x38d295['label']);}return _0x46a34f['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x20652b,_0x235dfb,_0x5112a1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x235dfb,_0x20652b,_0x5112a1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class oi extends _0x55a427{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[tt];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x5c6847,_0x2cf437)=>{const _0x3e7a31=this['_aiReviewCheckList']['getCheckById'](_0x2cf437['id']);if(_0x3e7a31){this['_onReviewCheckRun'](_0x2cf437),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2cf437,_0x3e7a31),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3d7251,_0x4308fa)=>{switch(_0x4308fa['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4308fa);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new _0x1a859a('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new _0x1a859a('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x4308fa['status']&&'error-chunk'!==_0x4308fa['status']&&'error-general'!==_0x4308fa['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4db2e0,_0x15052a)=>{if(!this['_currentReviewCheckRun'])throw new _0x1a859a('ai-review-mode-no-current-check-run',this);const _0xcafecf=this['_diffContent'](_0x15052a['result']['contentInitial'],_0x15052a['result']['contentNew']);_0x15052a['source']['addResultChanges'](_0x15052a['result']['id'],_0xcafecf);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x1eb13a,_0x25c5f5)=>{for(const _0x5c11e6 of _0x25c5f5['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x5c11e6);this['_markChangePositionInEditorContent'](_0x25c5f5['changes'],_0x25c5f5['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x440357,_0x13986d)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x13986d['change']['id'],_0x13986d['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x35bd88,_0x417e5f)=>{this['_onReviewCheckResultActivated'](_0x417e5f);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x18e7d5){_0x18e7d5 instanceof Error&&_0x18e7d5['message']['includes']('ai-request-aborted')||(_0x18e7d5 instanceof _0x1a859a?this['_logError'](_0x18e7d5):this['_logError'](new _0x1a859a('ai-review-mode-check-run-failed',this,void 0x0,_0x18e7d5)));}}else this['_logError'](new _0x1a859a('ai-review-mode-source-check-not-found',this,{'checkId':_0x2cf437['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3c55e8=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3c55e8['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x3c55e8['map'](_0x470db4=>_0x470db4['id']));const _0x3d7c8f=this['_currentReviewCheckRun'];_0x3d7c8f['markAllChangesAsAccepted'](),_0x3d7c8f['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x48b777,_0x45036e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x45036e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x45036e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x45036e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x45036e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1ecfc8,_0xad6691)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xad6691['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0xad6691['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0xad6691['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xad6691['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x58a53d,_0x45b763)=>{this['_onActivateChange'](_0x45b763);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x23aec4,_0x3017e2)=>{this['_onDeactivateChange'](_0x3017e2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x425e35,_0x4b0339)=>{this['_onChangeMarkerClicked'](_0x425e35,_0x4b0339);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x210ae6,_0x571af0)=>{this['_onChangeMarkerHovered'](_0x210ae6,_0x571af0);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x451de4,_0x6dfd55)=>{this['_onChangeMarkerRemoved'](_0x451de4,_0x6dfd55);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x37db9a,_0x3f0344)=>{this['_onChangeMarkerRestored'](_0x37db9a,_0x3f0344);});}['_createReviewCheckRun'](_0x504c27,_0xb4bf6e){return new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0xb4bf6e,this['_aiConnector'],_0x504c27['params'],_0x504c27['args']);}['_onChangeMarkerRemoved'](_0x251e16,_0x4852ae){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4852ae['changeId']);}['_onChangeMarkerRestored'](_0x3c9784,_0x3faf5b){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3faf5b['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x1b19c4=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1b19c4&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x37a398=this['_aiReviewCoreEditing']['getEditor']();_0x37a398&&_0x37a398['editing']['view']['change'](_0x5aa418=>{const _0x5e83cb=_0x37a398['editing']['view']['document']['getRoot']();_0x5aa418['removeClass']('ck-ai_review-diff',_0x5e83cb),_0x5aa418['removeClass']('ck-ai_review-highlights',_0x5e83cb),_0x5aa418['removeClass']('ck-ai-translate-mode-content',_0x5e83cb);});}['_getTranslationWithDefault'](_0x5d456b,_0x51066b){const _0x4f7b3d=i(this['context']['locale'],_0x5d456b);return _0x4f7b3d===_0x5d456b?_0x51066b:_0x4f7b3d;}['_logError'](_0x4b4c48){_0x42b6c9(_0x4b4c48['message']),_0x4b4c48['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x2dbee5){if('content'===this['_changeActivationSource']){const _0x15c555=this['_aiReviewCoreUi']['getChangeElement'](_0x2dbee5);_0x15c555&&_0x26b0dd(_0x15c555['closest']('.ck-ai_review__check-run-result')||_0x15c555);}else{if('panel'===this['_changeActivationSource']){const _0x7bcca0=this['_getChangeContentElement'](_0x2dbee5);if(!_0x7bcca0)return;_0x2b7d47({'target':_0x7bcca0,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}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'}]}]}];class Ds{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['id'];}constructor(_0x2a6669){this['id']=_0x2a6669['id'],this['title']=_0x2a6669['title'],this['description']=_0x2a6669['description'],this['isParameterized']=_0x2a6669['isParameterized'],this['useArgs']=_0x2a6669['useArgs'],this['options']=_0x2a6669['options'],this['args']=_0x2a6669['args'];}}class jr extends ts(){['_checks'];constructor(_0xf87c){super(),this['_checks']=this['_mapCheckDefinitions'](_0xf87c);}get['checks'](){return this['_checks'];}['getCheckById'](_0x303e57){return this['checks']['find'](_0x348478=>_0x348478['id']===_0x303e57);}['removeCheckById'](_0x934b38){this['_checks']=this['_checks']['filter'](_0x3e01e3=>_0x3e01e3['id']!==_0x934b38);}['_mapCheckDefinitions'](_0x29645a){return _0x29645a['map'](_0x1c67f6=>new Ds(_0x1c67f6));}}class Cr extends Ds{['_models']=[];['_defaultModel']=null;get['models'](){return this['_models'];}set['models'](_0xbd3ef3){this['_models']=_0xbd3ef3;}get['defaultModel'](){return this['_defaultModel'];}set['defaultModel'](_0x406c54){this['_defaultModel']=_0x406c54;}}class hi extends jr{['_mapCheckDefinitions'](_0x42d794){return _0x42d794['map'](_0x1b1635=>{if('custom'===_0x1b1635['id']){const _0x4bde65=new Cr(_0x1b1635);return _0x4bde65['models']=_0x1b1635['models']||[],_0x4bde65['defaultModel']=_0x1b1635['defaultModel']||null,_0x4bde65;}return new Ds(_0x1b1635);});}}class ai extends Js{['_prompt'];['_model'];constructor(_0xd17518,_0x5badaf,_0x17673f,_0xf3c5e5,_0x3656bb){super(_0x17673f,_0xf3c5e5,_0x3656bb),this['_prompt']=_0xd17518,this['_model']=_0x5badaf;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x1fcf9b,_0x5d67ce,_0x254b91){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x5d67ce,_0x1fcf9b,_0x254b91);}}class ge extends oi{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3abfb3,_0x2cc6d2)=>{this['_isDiffOn']=_0x2cc6d2['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0xaed918,_0x5351fb){return _0xaed918['isCustom']?new ai(_0xaed918['args']['prompt'],_0xaed918['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x5351fb,this['_aiConnector']):new si(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5351fb,this['_aiConnector'],_0xaed918['params'],_0xaed918['args']);}['_onReviewCheckResultActivated'](_0x29a9b2){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x29a9b2['change']['id']),this['_scrollToChange'](_0x29a9b2['change']['id']);const _0x1bd975=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x29a9b2['change']['id']);if(!_0x1bd975)return;const _0x5ee6fb=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x29a9b2['change'],()=>_0x1bd975['getElement'](),void 0x0,'click',_0x5ee6fb?.['editing']?.['view']?.['getDomRoot'](),_0x5ee6fb?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x29a9b2['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x7c3e24){this['_currentReviewCheckRun']&&'click'===_0x7c3e24['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x7c3e24['id']));}['_onDeactivateChange'](_0x2fea3f){this['_currentReviewCheckRun']&&'balloon'===_0x2fea3f['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x54f2f8,_0x3609e8){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3609e8['changeId']);const _0x2974a9=this['_currentReviewCheckRun']['getChangeById'](_0x3609e8['changeId']);if(!_0x2974a9)return;const _0x2eaa5f=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2974a9,_0x3609e8['markerElement'],_0x3609e8['domEvent'],'click',_0x2eaa5f?.['editing']?.['view']?.['getDomRoot'](),_0x2eaa5f?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x17c58f,_0x1322ee){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4938b5=this['_currentReviewCheckRun']['getChangeById'](_0x1322ee['changeId']);if(!_0x4938b5)return;const _0x31b8ea=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4938b5,_0x1322ee['markerElement'],_0x1322ee['domEvent'],'hover',_0x31b8ea?.['editing']?.['view']?.['getDomRoot'](),_0x31b8ea?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x26660d){const _0x29badc=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x26660d);return _0x29badc?_0x29badc['getElement']():null;}['_markChangePositionInEditorContent'](_0x2b2dd3,_0x5630e7){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2b2dd3,_0x5630e7);}['_diffContent'](_0x2fdbaa,_0x3d23a0){return this['_aiReviewCoreEditing']['diffContent'](_0x2fdbaa,_0x3d23a0);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x12b60f){const _0x435ba8=this['_aiReviewCoreEditing']['getEditor']();_0x12b60f?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x435ba8&&_0x435ba8['editing']['view']['change'](_0x490187=>{const _0x4a9c4a=_0x435ba8['editing']['view']['document']['getRoot']();for(const _0x3fcc0e of _0x4a9c4a['getClassNames']())_0x3fcc0e['startsWith']('ck-ai_review-')&&_0x490187['removeClass'](_0x3fcc0e,_0x4a9c4a);_0x490187['addClass'](_0x12b60f?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4a9c4a);});}async['_getChecksList'](){let _0x8255d=this['_translateReviewChecks'](ni);const _0x4fa0a=_0x8255d['find'](_0x732a=>'custom'===_0x732a['id']);if(_0x4fa0a)try{const _0x66bcda=new et({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});_0x4fa0a['models']=await _0x66bcda['getAvailableModels'](),_0x4fa0a['defaultModel']=await _0x66bcda['getDefault']();}catch(_0x205e46){_0x8255d=_0x8255d['filter'](_0x23a85f=>'custom'!==_0x23a85f['id']),this['_logError'](new _0x1a859a('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x205e46));}return new hi(_0x8255d);}['_translateReviewChecks'](_0x52297a){return _0x52297a['map'](_0x3f1a3e=>{const _0x20e208='AI_REVIEW_CHECK_'+_0x3f1a3e['id']['toUpperCase']()['replaceAll']('-','_'),_0x324441={..._0x3f1a3e,'title':this['_getTranslationWithDefault'](_0x20e208+'_TITLE',_0x3f1a3e['title']),'description':this['_getTranslationWithDefault'](_0x20e208+'_DESCRIPTION',_0x3f1a3e['description'])};return _0x3f1a3e['options']&&(_0x324441['options']=_0x3f1a3e['options']['map'](_0x145a69=>({..._0x145a69,'label':this['_getTranslationWithDefault'](_0x20e208+'_OPTIONS_LABEL',_0x145a69['label']||''),'data':_0x145a69['data']?_0x145a69['data']['map'](_0xe125f4=>({..._0xe125f4,'label':this['_getTranslationWithDefault'](_0x20e208+'_OPTIONS_DATA_'+_0xe125f4['id']['toUpperCase'](),_0xe125f4['label'])})):void 0x0}))),_0x324441;});}}class xa extends _0x55a427{static get['requires'](){return[ge,me,ue];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ar extends Ds{get['apiId'](){return'translate';}}class Ce extends jr{['_mapCheckDefinitions'](_0x40f8da){return _0x40f8da['map'](_0x432927=>new Ar(_0x432927));}}class ke extends si{['_title'];constructor(_0x30e2f7,_0x8f36b6,_0x27635c,_0x543f8d,_0x44b42e,_0x58077e){super(_0x30e2f7,_0x8f36b6,_0x27635c,_0x44b42e,_0x58077e),this['_title']=_0x543f8d;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class rr extends oi{static get['pluginName'](){return'AITranslateController';}constructor(_0x42aa2f){super(_0x42aa2f),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x460335,_0x121f2d){return new ke(this['_aiReviewCoreEditing']['getDocumentData'](),_0x121f2d,this['_aiConnector'],i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x460335['params'],_0x460335['args']);}['_onReviewCheckResultActivated'](_0x1f736d){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1f736d['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x1f736d['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x128349){this['_currentReviewCheckRun']&&('hover'===_0x128349['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x128349['id'])),'click'===_0x128349['uiInteraction']&&this['_scrollToChange'](_0x128349['id']));}['_onDeactivateChange'](_0x41d596){this['_currentReviewCheckRun']&&'panel'===_0x41d596['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1f2a71,_0x36902a){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x36902a['changeId']),this['_scrollToChange'](_0x36902a['changeId']));}['_onChangeMarkerHovered'](_0x48212b,_0x115de5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x115de5['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x115de5['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x586eb3){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x586eb3);}['_markChangePositionInEditorContent'](_0x2a0c18,_0x395dbc){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2a0c18,_0x395dbc);}['_diffContent'](_0x402b17,_0x51d0a9){return this['_aiReviewCoreEditing']['diffContent'](_0x402b17,_0x51d0a9,!0x0);}['_onReviewCheckRun'](){const _0xb7c667=this['_aiReviewCoreEditing']['getEditor']();_0xb7c667&&_0xb7c667['editing']['view']['change'](_0x269be8=>{const _0x275821=_0xb7c667['editing']['view']['document']['getRoot']();for(const _0x45b631 of _0x275821['getClassNames']())(_0x45b631['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x45b631)&&_0x269be8['removeClass'](_0x45b631,_0x275821);_0x269be8['addClass']('ck-ai-translate-mode-content',_0x275821);});}async['_getChecksList'](){const _0xaab7bc=[],_0x56f3eb=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x8e4894 of _0x56f3eb)_0xaab7bc['push']({'title':_0x8e4894['label'],'id':_0x8e4894['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x8e4894['id']}});return new Ce(this['_translateChecks'](_0xaab7bc));}['_translateChecks'](_0x40569e){return _0x40569e['map'](_0x375268=>{const _0x3692b1='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x375268['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x375268,'title':this['_getTranslationWithDefault'](_0x3692b1,_0x375268['title'])};});}}class Ae extends Re{constructor(_0x201b20,_0x584a22){super(_0x201b20,_0x584a22),this['on']('set:isLoading',(_0x1bc498,_0x3e0cf1,_0x3f48b2)=>{_0x3f48b2&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4e7d3a,_0x3f1419,_0x19ee9a)=>{_0x19ee9a&&(this['headerTitle']=i(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x5022eb=super['_createAcceptAllButtonView']();return _0x5022eb['set']('label',i(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x5022eb;}['_createExitReviewButtonView'](){const _0x4d7519=super['_createExitReviewButtonView']();return _0x4d7519['set']('label',i(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x4d7519;}}class Le extends Te{['_setupTemplate'](){const _0x1f5236=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x1f5236['if']('isVisible','ck-hidden',_0x1ebe4d=>!_0x1ebe4d)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':i(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1f5236['if']('isVisible','ck-hidden',_0x3558bc=>!_0x3558bc)]},'children':this['_checkViews']}]});}}class tr extends Ie{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x42caaf=this['context']['locale'],_0x32dacb=new _0x127487(_0x42caaf,{'label':i(_0x42caaf,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x26212c,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x1a98c7=new _e(_0x42caaf,{'header':_0x32dacb,'list':new Le(_0x42caaf),'results':new Ae(_0x42caaf,{'generalErrorText':i(_0x42caaf,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new de(_0x42caaf,{'headerText':i(_0x42caaf,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':i(_0x42caaf,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':i(_0x42caaf,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1a98c7['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1a98c7;}['registerTab'](){const _0x2f27db=this['context']['plugins']['get']('AITabs');_0x2f27db['view']['on']('activateTab',(_0x57d1ee,_0x2ad35b)=>{'translate'===_0x2ad35b?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x2f27db['view']['addTab']({'id':'translate','buttonLabel':i(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x26212c,'order':0x0,'content':this['_mainView']});}}class La extends _0x55a427{static get['requires'](){return[rr,tr,ue];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ri as AIActions,K as AIAdapter,Un as AIAssistant,n as AIAssistantUI,H as AIBalloon,ka as AIChat,q as AIChatController,G as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,z as AIChatUI,tt as AIConnector,D as AIEditing,Na as AIEditorIntegration,Mt as AIQuickActionType,va as AIQuickActions,ii as AIQuickActionsUI,er as AIRequestError,Ds as AIReviewCheck,zs as AIReviewCheckResult,Js as AIReviewCheckRun,xa as AIReviewMode,oi as AIReviewModeController,ue as AIReviewModeEditing,me as AIReviewModeUI,it as AITabs,pe as AITextAdapter,Pt as AIToggleButtonUI,La as AITranslate,rr as AITranslateController,tr as AITranslateUI,Kn as AWSTextAdapter,Bn as OpenAITextAdapter,E as ShowAIAssistantCommand,co as ToggleAICommand,As as createResizeButton,Vn as getDefaultAICommands};
|