@ckeditor/ckeditor5-ai 47.0.0-alpha.1 → 47.0.0-alpha.3
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/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/dist/index-editor.css +59 -38
- package/dist/index.css +77 -39
- package/dist/index.js +4 -4
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +40 -1
- package/lang/translations/ar.po +171 -171
- package/lang/translations/bg.po +155 -155
- package/lang/translations/bn.po +155 -155
- package/lang/translations/ca.po +155 -155
- package/lang/translations/cs.po +159 -159
- package/lang/translations/da.po +155 -155
- package/lang/translations/de.po +155 -155
- package/lang/translations/el.po +155 -155
- package/lang/translations/es.po +155 -155
- package/lang/translations/et.po +155 -155
- package/lang/translations/fi.po +155 -155
- package/lang/translations/fr.po +155 -155
- package/lang/translations/he.po +155 -155
- package/lang/translations/hi.po +155 -155
- package/lang/translations/hu.po +155 -155
- package/lang/translations/id.po +151 -151
- package/lang/translations/it.po +155 -155
- package/lang/translations/ja.po +151 -151
- package/lang/translations/ko.po +151 -151
- package/lang/translations/lt.po +159 -159
- package/lang/translations/lv.po +159 -159
- package/lang/translations/ms.po +151 -151
- package/lang/translations/nl.po +155 -155
- package/lang/translations/no.po +155 -155
- package/lang/translations/pl.po +159 -159
- package/lang/translations/pt-br.po +155 -155
- package/lang/translations/pt.po +155 -155
- package/lang/translations/ro.po +159 -159
- package/lang/translations/ru.po +159 -159
- package/lang/translations/sk.po +159 -159
- package/lang/translations/sr.po +159 -159
- package/lang/translations/sv.po +155 -155
- package/lang/translations/th.po +151 -151
- package/lang/translations/tr.po +155 -155
- package/lang/translations/uk.po +159 -159
- package/lang/translations/vi.po +151 -151
- package/lang/translations/zh-cn.po +151 -151
- package/lang/translations/zh.po +151 -151
- package/package.json +16 -15
- package/src/aiactions/aiactions.js +1 -1
- package/src/aiactions/model/aiactionsinteraction.js +1 -1
- package/src/aiactions/model/aiactionsreply.d.ts +2 -1
- package/src/aiactions/model/aiactionsreply.js +1 -1
- package/src/aiassistant/adapters/aiadapter.js +1 -1
- package/src/aiassistant/adapters/aitextadapter.js +1 -1
- package/src/aiassistant/adapters/awstextadapter.js +1 -1
- package/src/aiassistant/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant/aiassistant.js +1 -1
- package/src/aiassistant/aiassistantediting.js +1 -1
- package/src/aiassistant/aiassistantui.js +1 -1
- package/src/aiassistant/legacyerrors.js +1 -1
- package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
- package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
- package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
- package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
- package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
- package/src/aiassistant/ui/form/aiformview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
- package/src/aiassistant/ui/form/prompthistory.js +1 -1
- package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
- package/src/aiassistant/utils/common-translations.js +1 -1
- package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
- package/src/aiballoon/aiballoon.js +1 -1
- package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
- package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
- package/src/aiballoon/ui/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatcontroller.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/model/aichatmodels.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/aichatresourcelistitemview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourceslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
- package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedreplyitemview.d.ts +2 -1
- package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
- package/src/aichat/utils/eventnames.js +1 -1
- package/src/aichat/utils/promisequeue.js +1 -1
- package/src/aichat/utils/scrollmanager.js +1 -1
- package/src/aichathistory/aichathistory.js +1 -1
- package/src/aichathistory/aichathistorycontroller.js +1 -1
- package/src/aichathistory/aichathistoryui.js +1 -1
- package/src/aichathistory/model/aichathistoryconversations.js +1 -1
- package/src/aichathistory/model/aichathistoryitem.js +1 -1
- package/src/aichathistory/ui/aichathistorylistitemview.js +1 -1
- package/src/aichathistory/ui/aichathistorylistview.js +1 -1
- package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
- package/src/aichathistory/ui/aichathistoryview.js +1 -1
- package/src/aiconfig.d.ts +5 -0
- package/src/aicore/aiconnector.js +1 -1
- package/src/aicore/aiediting.js +1 -1
- package/src/aicore/model/aicapabilities.js +1 -1
- package/src/aicore/model/aicontext.js +1 -1
- package/src/aicore/model/aiinteraction.js +1 -1
- package/src/aicore/model/aireply.js +1 -1
- package/src/aicore/pipeline/airesponseapplier.js +2 -2
- package/src/aicore/pipeline/airesponseparser.js +2 -2
- package/src/aicore/ui/aidisclaimerview.js +1 -1
- package/src/aicore/ui/aiskeleton.js +1 -1
- package/src/aicore/ui/aispinner.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +2 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +2 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +2 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/utils/common-translations.js +1 -1
- package/src/aicore/utils/createresizebutton.js +1 -1
- package/src/aicore/utils/documentposition.js +1 -1
- package/src/aicore/utils/documentrange.js +1 -1
- package/src/aicore/utils/eventnames.js +1 -1
- package/src/aicore/utils/geteditorfromcontext.js +1 -1
- package/src/aicore/utils/getoperationsfromreply.js +1 -1
- package/src/aicore/utils/getsuggestionpartsfromreply.d.ts +2 -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/aiquickactions/aiquickactions.js +1 -1
- package/src/aiquickactions/aiquickactionscommand.js +1 -1
- package/src/aiquickactions/aiquickactionsediting.js +1 -1
- package/src/aiquickactions/aiquickactionsui.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
- package/src/aiquickactions/utils/common-translations.js +1 -1
- package/src/aireviewmode/aireviewcheckdefinitions.d.ts +31 -0
- package/src/aireviewmode/aireviewcheckdefinitions.js +23 -0
- package/src/aireviewmode/aireviewmode.d.ts +37 -0
- package/src/aireviewmode/aireviewmode.js +1 -1
- package/src/aireviewmode/aireviewmodecontroller.d.ts +1 -1
- package/src/aireviewmode/aireviewmodecontroller.js +1 -1
- package/src/aireviewmode/aireviewmodeediting.d.ts +24 -8
- package/src/aireviewmode/aireviewmodeediting.js +1 -1
- package/src/aireviewmode/aireviewmodeui.d.ts +12 -1
- package/src/aireviewmode/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheck.d.ts +2 -19
- package/src/aireviewmode/model/aireviewcheck.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewchecklist.d.ts +2 -5
- package/src/aireviewmode/model/aireviewchecklist.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresultchange.d.ts +6 -0
- package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewmode/model/aireviewcheckrun.d.ts +24 -2
- package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewcustomcheckrun.d.ts +4 -0
- package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewmodels.js +1 -1
- package/src/aireviewmode/model/aireviewsystemcheckrun.d.ts +4 -0
- package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
- package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.d.ts +30 -0
- package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +23 -0
- package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.d.ts +12 -2
- package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.d.ts +1 -0
- package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.d.ts +1 -0
- package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcompletedview.d.ts +4 -0
- package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeview.d.ts +1 -0
- package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformamanager.d.ts +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformamanager.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformdropdown.d.ts +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformmanager.d.ts +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformmanager.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/index.d.ts +3 -2
- package/src/index.js +1 -1
- package/theme/aichat/aichat-controls/aichat-controls-loader.css +1 -1
- package/theme/aichat/aichat-controls.css +4 -0
- package/theme/aichat/aichatfeed.css +10 -2
- package/theme/aireviewmode/aireviewmode-balloon-panel-suggestion.css +19 -0
- package/theme/aireviewmode/aireviewmode-check-run-result.css +45 -0
- package/theme/aireviewmode/aireviewmode-check-run.css +0 -35
- package/theme/aitabs/tabs/tabbuttonview.css +1 -0
- package/src/aireviewmode/utils/common-translations.d.ts +0 -9
- package/src/aireviewmode/utils/common-translations.js +0 -23
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x2c78e0,Command as _0x2ae2c4,ContextPlugin as _0x150b32,Editor as st}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5834f1,IconCheck as _0xe9aaa5,IconError as _0x3128e4,IconSubmit as _0xbe2b8c,IconAIHistory as Ht,IconMagicWand as _0x1e931d,IconRobotPencil as _0x22b0ff,IconMaximize as _0x271b92,IconMinimize as _0x51140d,IconShowChangesOn as _0x166162,IconShowChangesOff as _0x50b920,IconDocument as _0x96c2b3,IconThreeStars as _0x47ec67,IconDocumentWithLoupe as _0x73a439,IconAddComment as _0x1cfda4,IconRemove as _0x3c48a6,IconDocumentWithCheckmark as _0x4d5b37,IconDocumentWithCross as _0x528ba9,IconLoupe as _0x33055c,IconCancel as _0x1c9538,IconStop as _0x53dded,IconAIChat as St,IconPlus as _0x225485,IconPin as _0x5ed191,IconThreeHorizontalDots as _0x321948,IconChevronRight as _0x1800e1,IconInfo as _0xd3405,IconEye as _0x12d50a,IconEyeCrossedOut as _0x199ee6,IconAIReview as te}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x215bb4,CKEditorError as _0x516722,ObservableMixin as _0x3a17ed,global as _0x136098,isVisible as _0x30a94f,Rect as _0x209e41,Collection as _0x3febd7,FocusTracker as _0x54be86,KeystrokeHandler as _0x46e306,first as _0x478af3,toArray as _0x256e93,EmitterMixin as _0x1f835a,logWarning as _0x170b6a,logError as ot,scrollViewportToShowTarget as nt,ResizeObserver as _0x23e0d2,_isMotionReduced as At}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x47fea8,ButtonView as _0x3678e7,View as _0x179f2b,SpinnerView as _0x3fce23,IconView as _0x30b390,AutocompleteView as _0x352dbb,ListView as _0x56c802,ListItemGroupView as _0x466af8,ListItemView as _0xfd7405,ButtonLabelView as _0x5a6277,FocusCycler as ts,createLabeledTextarea as _0x5432a7,Dialog as _0x1abae0,createDropdown as _0x3e7f7b,addMenuToDropdown as _0x415487,MenuBarMenuView as _0x5a62aa,MenuBarMenuListItemButtonView as _0x1651cb,DialogViewPosition as _0x58513a,MenuBarMenuListView as _0x2b1ca6,MenuBarMenuListItemView as _0x167fbe,ViewCollection as _0x476d2b,UIModel as _0x25cf5d,SplitButtonView as _0x38de22,BalloonPanelView as _0x4f7937,BodyCollection as qt,clickOutsideHandler as _0x23c9f6,ListItemButtonView as _0x4e5418,addListToDropdown as _0x245f97,submitHandler as _0x2e022f,LabeledFieldView as th,createLabeledInputText as _0x2aae5d,FormHeaderView as _0x4b2793,HighlightedTextView as _0x5ca561,FileDialogButtonView as _0x5753d1,InputTextView as _0x4df4e3,SearchTextView as _0x1e3c39,DropdownMenuButtonView as _0x4ebc14,DropdownMenuPanelPositioningFunctions as _0x58671d,BalloonToolbar as Gt,FormRowView as _0x3bbf23,TextareaView as _0x3728ef}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x3a17f3,ClipboardMarkersUtils as _0x2520a8}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x369d30,ViewDataTransfer as _0x24d72b,ViewUpcastWriter as _0x5ba070,Matcher as _0x473502,ViewDowncastWriter as kt,transformOperationSets as _0x3b6950,_DetachOperation as pt,_insertIntoModelNodeList as _0x689ebb,_removeFromModelNodeList as _0x551ca0,ModelRange as _0xf5c05f,ModelDocumentFragment as _0x59e9ed,ModelPosition as _0x34be7e,ModelTreeWalker as Jt,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x13f2ee,escape as _0x14ded9,escapeRegExp as _0x4fd9bb}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x36fb8e,InvokeModelWithResponseStreamCommand as _0x4ad069,InvokeModelCommand as _0x4dfa45}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x188e5f}from'htmlparser2';import{isTag as _0x40109d,findOne as ut,getParent as _0x70b7d4,findAll as _0x427efa,removeElement as _0x975f,replaceElement as _0x50e8e9,prepend as _0x8a3d6b,prependChild as to,appendChild as _0x1c446e,append as _0x422718,find as _0x274df0,isComment as _0x3880e8,getChildren as _0x5d9ffb,textContent as _0x1d4589}from'domutils';import _0x2d3ed1 from'dom-serializer';import{Document as Ct,Element as _0x2ccea4,Text as _0x3419c5,cloneNode as _0xac1c48,isDocument as tn,isText as _0x80b4b7,NodeWithChildren as _0x18d794}from'domhandler';import{MarkdownGfmMdToHtml as _0x523e3b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0x5f2efd,DocumentCompare as _0x122df6,DATA_ID_MODEL_ATTRIBUTE as dt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x2fe68d,IconThumbDown as _0x1e72ea,IconCopy as _0x243bf9,IconCheck as _0x465b02,IconShowChangesOff as _0x5d3306,IconShowChangesOn as _0x4db985,IconWeb as _0x3732ee,IconNextArrow as _0x5210bf,IconPreviousArrow as _0x5ef96b,IconAI as It,IconClose as _0x3be0ad,IconSelection as _0x1a306c,IconFileUpload as _0x2545bc,IconLink as _0x5987a4,IconDocument as _0x4dc2d9,IconBulb as _0x11c39e,IconDocumentOutline as _0x35aa9f,IconPaperClip as _0x2347cb,IconBrowseFiles as _0x4d2436,IconDropdownArrow as _0x51ff1f,IconAIQuickActions as _0x37a60c,IconAIAskAI as Qt,IconAIChatCommands as Ot,IconAIImproveWriting as Kt,IconAIContinueWriting as Ut,IconAIGrammarCheck as bt,IconAIAdjustLength as Nt,IconAIChangeTone as xt,IconAITranslate as Lt,IconAIOther as Mt,IconRefresh as _0x43d481}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x2c1590 from'morphdom';import{ConfirmMixin as _0x3891e7,LateFocusDropdownButtonView as _0x10c42a,DocumentCompare as _0x49e07c,DATA_ID_VIEW_ATTRIBUTE as Vt,DATA_ID_MODEL_ATTRIBUTE as _0x81414a}from'ckeditor5-collaboration/dist/index.js';const R='_ungrouppedCommands';function x(_0x1bd3f9,_0x4f2e62){const _0x3938cf=(0x0,_0x4f2e62['t'])('Other');return _0x1bd3f9['length']?'groupId'in _0x1bd3f9[0x0]?_0x1bd3f9:[{'groupId':R,'groupLabel':_0x3938cf,'order':0x1/0x0,'commands':_0x1bd3f9}]:[{'groupId':R,'groupLabel':_0x3938cf,'order':0x1/0x0,'commands':[]}];}const Ln=globalThis['DataTransfer'],P='ai-ui';class I extends _0x2c78e0{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x138688}=this,_0x20ec32=['ck-fake-ai-selection'];_0x138688['config']['get']('ai.assistant.useTheme')&&_0x20ec32['push']('ck-ai-assistant-ui_theme'),_0x138688['conversion']['for']('editingDowncast')['markerToHighlight']({'model':P,'view':{'classes':_0x20ec32,'priority':0xc}}),_0x138688['conversion']['for']('editingDowncast')['markerToElement']({'model':P,'view':(_0xaea33b,{writer:_0x306ade})=>{if(!_0xaea33b['markerRange']['isCollapsed'])return null;const _0x477773=_0x306ade['createUIElement']('span');return _0x306ade['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x477773),_0x477773;}});}['afterInit'](){!async function(_0x3785fd){const _0x2df03e=_0x56e6b8([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]),_0x414c61=0x3dffc4e1,_0x7d724e=0x3df8b081^_0x414c61,_0x58ff4b=window[_0x56e6b8([0x44,0x61,0x74,0x65])][_0x56e6b8([0x6e,0x6f,0x77])](),_0x28929b=_0x3785fd[_0x56e6b8([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x3fc4bb=new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x41ced4=>{_0x28929b[_0x56e6b8([0x6f,0x6e,0x63,0x65])](_0x56e6b8([0x72,0x65,0x61,0x64,0x79]),_0x41ced4);}),_0xc7d8ab={[_0x56e6b8([0x6b,0x74,0x79])]:_0x56e6b8([0x45,0x43]),[_0x56e6b8([0x75,0x73,0x65])]:_0x56e6b8([0x73,0x69,0x67]),[_0x56e6b8([0x63,0x72,0x76])]:_0x56e6b8([0x50,0x2d,0x32,0x35,0x36]),[_0x56e6b8([0x78])]:_0x56e6b8([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]),[_0x56e6b8([0x79])]:_0x56e6b8([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]),[_0x56e6b8([0x61,0x6c,0x67])]:_0x56e6b8([0x45,0x53,0x32,0x35,0x36])},_0x44ff7f=_0x28929b[_0x56e6b8([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x56e6b8([0x67,0x65,0x74])](_0x56e6b8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x328c64(){let _0x20ffb6,_0x2ca0cf=null,_0x4d832c=null;try{if(_0x44ff7f==_0x56e6b8([0x47,0x50,0x4c]))return _0x56e6b8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x20ffb6=_0x4659dc(),!_0x20ffb6)return _0x56e6b8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x20ffb6[_0x56e6b8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4d832c=_0x36f88b(_0x20ffb6[_0x56e6b8([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x20ffb6[_0x56e6b8([0x6a,0x74,0x69])])),await _0x311be0()?_0x591304()?_0x1e5890()?_0x56e6b8([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x419c6b()?(_0x20ffb6[_0x56e6b8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x56e6b8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2ca0cf=_0xe221ba(_0x56e6b8([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x20ffb6[_0x56e6b8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x56e6b8([0x74,0x72,0x69,0x61,0x6c])&&(_0x2ca0cf=_0xe221ba(_0x56e6b8([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x560dab()):_0x56e6b8([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x56e6b8([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x56e6b8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x56e6b8([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1e5890(){const _0x5948f0=[_0x56e6b8([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x56e6b8([0x74,0x72,0x69,0x61,0x6c])][_0x56e6b8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20ffb6[_0x56e6b8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x58ff4b/0x3e8:0xe10*_0x7d724e;return _0x20ffb6[_0x56e6b8([0x65,0x78,0x70])]<_0x5948f0;}function _0x591304(){const _0x9703e4=_0x20ffb6[_0x56e6b8([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x9703e4&&(!!_0x9703e4[_0x56e6b8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56e6b8([0x2a]))||!!_0x9703e4[_0x56e6b8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56e6b8([0x41,0x49])));}function _0x419c6b(){const _0x7254ab=_0x20ffb6[_0x56e6b8([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x7254ab||0x0==_0x7254ab[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2471d5}=new URL(window[_0x56e6b8([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x7254ab[_0x56e6b8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2471d5))return!0x0;const _0x1d9de8=_0x2471d5[_0x56e6b8([0x73,0x70,0x6c,0x69,0x74])](_0x56e6b8([0x2e]));return _0x7254ab[_0x56e6b8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x66bee0=>_0x66bee0[_0x56e6b8([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56e6b8([0x2a])))[_0x56e6b8([0x6d,0x61,0x70])](_0x4cab89=>_0x4cab89[_0x56e6b8([0x73,0x70,0x6c,0x69,0x74])](_0x56e6b8([0x2e])))[_0x56e6b8([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x29e9df=>_0x29e9df[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1d9de8[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x56e6b8([0x6d,0x61,0x70])](_0x2e02b3=>Array(_0x1d9de8[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2e02b3[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x56e6b8([0x66,0x69,0x6c,0x6c])](_0x2e02b3[0x0]===_0x56e6b8([0x2a])?_0x56e6b8([0x2a]):'')[_0x56e6b8([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2e02b3))[_0x56e6b8([0x73,0x6f,0x6d,0x65])](_0x477c9f=>_0x1d9de8[_0x56e6b8([0x65,0x76,0x65,0x72,0x79])]((_0x28f7fb,_0x235c73)=>_0x477c9f[_0x235c73]===_0x28f7fb||_0x477c9f[_0x235c73]===_0x56e6b8([0x2a])));}function _0x560dab(){return _0x2ca0cf&&_0x4d832c?new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1fda79,_0x4e8cc2)=>{_0x2ca0cf[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x1fda79,_0x4e8cc2),_0x4d832c[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x3d6075=>{_0x3d6075!=_0x56e6b8([0x56,0x61,0x6c,0x69,0x64])&&_0x1fda79(_0x3d6075);},_0x4e8cc2);}):_0x2ca0cf||_0x4d832c||_0x56e6b8([0x56,0x61,0x6c,0x69,0x64]);}}function _0x36f88b(_0x59f562,_0x2f6c19){return new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x532232=>{if(_0x31707f())return _0x532232(_0x56e6b8([0x56,0x61,0x6c,0x69,0x64]));_0x445783(),_0x28929b[_0x56e6b8([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x56e6b8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x182ab0=!0x1;const _0x16ee32=_0x215bb4();function _0x42eafe(_0x283ba0){return!!_0x283ba0&&(typeof _0x283ba0===_0x56e6b8([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x283ba0===_0x56e6b8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x283ba0[_0x56e6b8([0x74,0x68,0x65,0x6e])]===_0x56e6b8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x283ba0[_0x56e6b8([0x63,0x61,0x74,0x63,0x68])]===_0x56e6b8([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x535476(_0x3f5cec){_0x178d0a(_0x3f5cec)[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x139662=>{if(!_0x139662||_0x139662[_0x56e6b8([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x56e6b8([0x6f,0x6b]))return _0x56e6b8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x56bd40(_0x3b7669(_0x16ee32+_0x2f6c19))!=_0x139662[_0x56e6b8([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x56e6b8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x56e6b8([0x56,0x61,0x6c,0x69,0x64]);})[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x3db33c=>(_0x1e616f(),_0x3db33c),()=>{const _0xbf662d=_0x8f6f83();return null==_0xbf662d?(_0x1e616f(),_0x56e6b8([0x56,0x61,0x6c,0x69,0x64])):_0x56e6b8(_0x58ff4b-_0xbf662d>(0x19f340e1^_0x414c61)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x532232)[_0x56e6b8([0x63,0x61,0x74,0x63,0x68])](()=>{_0x532232(_0x56e6b8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x392aa5=0x3dc92a61^_0x414c61;function _0x1e616f(){const _0x22e847=_0x56e6b8([0x6c,0x6c,0x63,0x74,0x2d])+_0x56bd40(_0x3b7669(_0x59f562)),_0x5ed827=_0xf122a5(_0x56bd40(window[_0x56e6b8([0x4d,0x61,0x74,0x68])][_0x56e6b8([0x63,0x65,0x69,0x6c])](_0x58ff4b/_0x392aa5)));window[_0x56e6b8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x56e6b8([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x22e847,_0x5ed827);}function _0x8f6f83(){const _0x47784e=_0x56e6b8([0x6c,0x6c,0x63,0x74,0x2d])+_0x56bd40(_0x3b7669(_0x59f562)),_0xdfeef5=window[_0x56e6b8([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x56e6b8([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x47784e);return _0xdfeef5?window[_0x56e6b8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf122a5(_0xdfeef5),0x10)*_0x392aa5:null;}function _0x178d0a(_0x1baa46){return new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5bda44,_0x24e35b)=>{_0x1baa46[_0x56e6b8([0x74,0x68,0x65,0x6e])](_0x5bda44,_0x24e35b),window[_0x56e6b8([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x24e35b,0x3dfe1021^_0x414c61);});}}_0x28929b[_0x56e6b8([0x6f,0x6e])](_0x56e6b8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x182d96,_0x4a66f6)=>{if(_0x4a66f6[0x0]!=_0x59f562)return _0x532232(_0x56e6b8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4a66f6[0x1]={..._0x4a66f6[0x1],[_0x56e6b8([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x16ee32};},{[_0x56e6b8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x56e6b8([0x68,0x69,0x67,0x68])}),_0x28929b[_0x56e6b8([0x6f,0x6e])](_0x56e6b8([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x374620=>{_0x42eafe(_0x374620[_0x56e6b8([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x182ab0=!0x0,_0x535476(_0x374620[_0x56e6b8([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x56e6b8([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x56e6b8([0x6c,0x6f,0x77])}),_0x3fc4bb[_0x56e6b8([0x74,0x68,0x65,0x6e])](()=>{_0x182ab0||_0x532232(_0x56e6b8([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x31707f(){return _0x28929b[_0x56e6b8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x56e6b8([0x76,0x69,0x65,0x77])][_0x56e6b8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x56e6b8([0x61,0x75,0x74,0x6f]);}function _0x445783(){_0x28929b[_0x56e6b8([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x56e6b8([0x76,0x69,0x65,0x77])][_0x56e6b8([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x56e6b8([0x61,0x75,0x74,0x6f]);}}function _0xe221ba(_0x1639f9){const _0x33407d=[new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2f09b9=>setTimeout(_0x2f09b9,0x3df6fa2d^_0x414c61)),_0x3fc4bb[_0x56e6b8([0x74,0x68,0x65,0x6e])](()=>new window[(_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x249e73=>{let _0x185a94=0x0;_0x28929b[_0x56e6b8([0x6d,0x6f,0x64,0x65,0x6c])][_0x56e6b8([0x6f,0x6e])](_0x56e6b8([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x373125,_0x197238)=>{_0x197238[0x0][_0x56e6b8([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x185a94++,_0x185a94==(0x3dffc519^_0x414c61)&&(_0x249e73(),_0x373125[_0x56e6b8([0x6f,0x66,0x66])]());});}))];return window[_0x56e6b8([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x56e6b8([0x72,0x61,0x63,0x65])](_0x33407d)[_0x56e6b8([0x74,0x68,0x65,0x6e])](()=>_0x1639f9);}async function _0x1f48fa(){await _0x3fc4bb,_0x28929b[_0x56e6b8([0x6d,0x6f,0x64,0x65,0x6c])][_0x56e6b8([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x277999,_0x28929b[_0x56e6b8([0x6d,0x6f,0x64,0x65,0x6c])][_0x56e6b8([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x277999,_0x28929b[_0x56e6b8([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x56e6b8([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x58b8c2(_0x350d72){const _0x5f27df=_0x3e55d5();_0x28929b[_0x5f27df]=_0x56e6b8([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x350d72,_0x350d72!=_0x56e6b8([0x56,0x61,0x6c,0x69,0x64])&&_0x1f48fa();}function _0x3e55d5(){const _0x4eec82=window[_0x56e6b8([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x56e6b8([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x56e6b8([0x6e,0x6f,0x77])]())[_0x56e6b8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x56e6b8([0x2e]),'');let _0x14b553=_0x56e6b8([0x6e]);for(let _0xabcd94=0x0;_0xabcd94<_0x4eec82[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xabcd94+=0x2){let _0x1c4f9a=window[_0x56e6b8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4eec82[_0x56e6b8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xabcd94,_0xabcd94+0x2));_0x1c4f9a>=_0x2df03e[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1c4f9a-=_0x2df03e[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x14b553+=_0x2df03e[_0x1c4f9a];}return _0x14b553;}function _0x4659dc(){const _0x26445d=_0x44ff7f[_0x56e6b8([0x73,0x70,0x6c,0x69,0x74])](_0x56e6b8([0x2e]));if(0x3!=_0x26445d[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1df08e(_0x26445d[0x1]);function _0x1df08e(_0x1fe24f){const _0x4b4f08=_0xcfe8b5(_0x1fe24f);return _0x4b4f08&&_0x1c145()?_0x4b4f08:null;function _0x1c145(){const _0x52c821=_0x4b4f08[_0x56e6b8([0x6a,0x74,0x69])],_0x24f646=window[_0x56e6b8([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x52c821[_0x56e6b8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x52c821[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2ce7f2={..._0x4b4f08,[_0x56e6b8([0x6a,0x74,0x69])]:_0x52c821[_0x56e6b8([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x52c821[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2ce7f2[_0x56e6b8([0x76,0x63])],_0x3b7669(_0x2ce7f2)==_0x24f646;}}}async function _0x311be0(){let _0x4a3ac8=!0x0;try{const _0x186e93=_0x44ff7f[_0x56e6b8([0x73,0x70,0x6c,0x69,0x74])](_0x56e6b8([0x2e])),[_0x4cbe61,_0x390f2f,_0x84c634]=_0x186e93;return _0x568ce8(_0x4cbe61),await _0x460f4e(_0x4cbe61,_0x390f2f,_0x84c634),_0x4a3ac8;}catch{return!0x1;}function _0x568ce8(_0x1f32b4){const _0x5b973b=_0xcfe8b5(_0x1f32b4);_0x5b973b&&_0x5b973b[_0x56e6b8([0x61,0x6c,0x67])]==_0x56e6b8([0x45,0x53,0x32,0x35,0x36])||(_0x4a3ac8=!0x1);}async function _0x460f4e(_0x396f14,_0x39fb96,_0x4db4ea){const _0x1e9a3c=window[_0x56e6b8([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x56e6b8([0x66,0x72,0x6f,0x6d])](_0x3a9888(_0x4db4ea),_0x132a5f=>_0x132a5f[_0x56e6b8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1fb12f=new window[(_0x56e6b8([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x56e6b8([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x396f14+_0x56e6b8([0x2e])+_0x39fb96),_0x4ab4d0=window[_0x56e6b8([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x56e6b8([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4ab4d0)return;const _0x50516f=await _0x4ab4d0[_0x56e6b8([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x56e6b8([0x6a,0x77,0x6b]),_0xc7d8ab,{[_0x56e6b8([0x6e,0x61,0x6d,0x65])]:_0x56e6b8([0x45,0x43,0x44,0x53,0x41]),[_0x56e6b8([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x56e6b8([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x56e6b8([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4ab4d0[_0x56e6b8([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x56e6b8([0x6e,0x61,0x6d,0x65])]:_0x56e6b8([0x45,0x43,0x44,0x53,0x41]),[_0x56e6b8([0x68,0x61,0x73,0x68])]:{[_0x56e6b8([0x6e,0x61,0x6d,0x65])]:_0x56e6b8([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x50516f,_0x1e9a3c,_0x1fb12f)||(_0x4a3ac8=!0x1);}}function _0xcfe8b5(_0x24c3c2){return _0x24c3c2[_0x56e6b8([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x56e6b8([0x65,0x79]))?JSON[_0x56e6b8([0x70,0x61,0x72,0x73,0x65])](_0x3a9888(_0x24c3c2)):null;}function _0x3a9888(_0x1901c7){return window[_0x56e6b8([0x61,0x74,0x6f,0x62])](_0x1901c7[_0x56e6b8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x56e6b8([0x2b]))[_0x56e6b8([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x56e6b8([0x2f])));}function _0x3b7669(_0x4fddf6){let _0x4d2476=0x1505;function _0x47172c(_0x3fceed){for(let _0x54899=0x0;_0x54899<_0x3fceed[_0x56e6b8([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x54899++){const _0x3ed7de=_0x3fceed[_0x56e6b8([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x54899);_0x4d2476=(_0x4d2476<<0x5)+_0x4d2476+_0x3ed7de,_0x4d2476&=_0x4d2476;}}function _0x1ba2f4(_0x380966){Array[_0x56e6b8([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x380966)?_0x380966[_0x56e6b8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1ba2f4):_0x380966&&typeof _0x380966==_0x56e6b8([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x56e6b8([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x380966)[_0x56e6b8([0x73,0x6f,0x72,0x74])]()[_0x56e6b8([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x295a5,_0xbccb0e])=>{_0x47172c(_0x295a5),_0x1ba2f4(_0xbccb0e);}):_0x47172c(window[_0x56e6b8([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x380966));}return _0x1ba2f4(_0x4fddf6),_0x4d2476>>>0x0;}function _0x56bd40(_0x40895a){return _0x40895a[_0x56e6b8([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x56e6b8([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x56e6b8([0x30]));}function _0xf122a5(_0x243aee){return _0x243aee[_0x56e6b8([0x73,0x70,0x6c,0x69,0x74])]('')[_0x56e6b8([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x56e6b8([0x6a,0x6f,0x69,0x6e])]('');}function _0x277999(){}function _0x56e6b8(_0x53b1f0){return _0x53b1f0['map'](_0x5339ec=>String['fromCharCode'](_0x5339ec))['join']('');}_0x58b8c2(await _0x328c64());}(this);}['showFakeVisualSelection'](){const _0x304615=this['editor']['model'];_0x304615['change'](_0x51a045=>{const _0x570daf=_0x304615['document']['selection']['getRanges']();let _0xcb3abb=0x0;for(const _0x1e39d2 of _0x570daf){const _0x4b284d=P+':'+_0xcb3abb;if(_0x304615['markers']['has'](_0x4b284d))_0x51a045['updateMarker'](_0x4b284d,{'range':_0x1e39d2});else{if(_0x1e39d2['start']['isAtEnd']){const _0x32c554=_0x1e39d2['start']['getLastMatchingPosition'](({item:_0x215841})=>!_0x304615['schema']['isContent'](_0x215841),{'boundaries':_0x1e39d2});_0x51a045['addMarker'](_0x4b284d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x51a045['createRange'](_0x32c554,_0x1e39d2['end'])});}else _0x51a045['addMarker'](_0x4b284d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1e39d2});}_0xcb3abb++;}});}['hideFakeVisualSelection'](){const _0x5934ea=this['editor']['model'],_0x4bd9f1=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](P));_0x4bd9f1['length']&&_0x5934ea['change'](_0x27168a=>{_0x4bd9f1['forEach'](_0x479707=>{_0x27168a['removeMarker'](_0x479707);});});}['insertContent'](_0x4cee7d,_0x24659e){const _0x957429=this['_getAISelection'](),_0x5ed499=_0x24659e||_0x957429['getFirstRange']();this['editor']['model']['canEditAt'](_0x5ed499)&&this['editor']['model']['change'](_0x342cba=>{this['hideFakeVisualSelection'](),_0x24659e||this['_resetContentOfSelectedTableCells'](_0x342cba,_0x957429),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5ed499,'writer':_0x342cba,'html':_0x4cee7d});});}['insertContentBelow'](_0x1081ed){const {model:_0x3b4d19}=this['editor'],_0x52b8a8=this['_getAISelection']();_0x3b4d19['change'](()=>{const _0x33d4f6=this['_prepareTableInsertBelowPosition'](_0x1081ed,_0x52b8a8)||this['_getDefaultInsertBelowPosition'](_0x52b8a8);this['insertContent'](_0x1081ed,_0x33d4f6);});}['_getAISelection'](){const _0x24449e=this['editor']['model'],_0x2b632f=Array['from'](_0x24449e['markers']['getMarkersGroup'](P))['map'](_0x46457f=>_0x46457f['getRange']());return _0x24449e['createSelection'](_0x2b632f);}['_pasteHTMLUsingClipboard']({writer:_0x5a7605,html:_0x42b352,insertAt:_0x44aff9}){const {view:_0x3c85b3}=this['editor']['editing'],_0xea1626=this['editor']['plugins']['get'](_0x3a17f3),_0x9318fe=new Ln();_0x9318fe['setData']('text/html',_0x42b352);const _0x1b9dd6=new ClipboardEvent('paste',{'clipboardData':_0x9318fe}),_0x39b2ef=new _0x369d30(_0x3c85b3,_0x1b9dd6,{'dataTransfer':new _0x24d72b(_0x9318fe)});_0x5a7605['setSelection'](_0x44aff9);const _0x50d8da=(_0x426ae5,_0x53f5a3)=>{_0x53f5a3['resultRange']&&_0x5a7605['setSelection'](_0x53f5a3['resultRange']);};_0xea1626['once']('contentInsertion',_0x50d8da,{'priority':'lowest'}),_0x3c85b3['document']['fire']('paste',_0x39b2ef),_0xea1626['off']('contentInsertion',_0x50d8da);}['_getDefaultInsertBelowPosition'](_0x2431d5){const {model:_0x28c50c}=this['editor'],_0x59fa18=Array['from'](_0x2431d5['getSelectedBlocks']());return _0x59fa18['length']?_0x28c50c['createPositionAfter'](_0x59fa18['pop']()):_0x2431d5['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x20aaf7,_0xdeb3b2){const {model:_0x2f48d6,plugins:_0x46390d}=this['editor'];if(_0x46390d['has']('TableUtils')){const _0x22f0ca=_0x46390d['get']('TableUtils')['getSelectedTableCells'](_0xdeb3b2);if(_0x22f0ca['length']){const _0x54d921=this['_getTableRowCountFromContent'](_0x20aaf7),_0x15d28f=this['_createEmptyTableRows'](_0x22f0ca,_0x54d921);return _0x2f48d6['createPositionAt'](_0x15d28f,0x0);}}return null;}['_getTableRowCountFromContent'](_0x16eeee){const _0x4f532f=this['editor']['plugins']['get']('TableUtils'),_0x20ce91=this['editor']['data']['parse'](_0x16eeee),_0x3e8b83=Array['from'](_0x20ce91['getChildren']())['filter'](_0x42819a=>_0x42819a['is']('element','table'));let _0x3662c6=0x0;return _0x3e8b83['forEach'](_0x25d52c=>{_0x3662c6+=_0x4f532f['getRows'](_0x25d52c);}),_0x3662c6;}['_createEmptyTableRows'](_0x3690ba,_0x1eff65){const _0x2fb1b0=this['editor']['plugins']['get']('TableUtils'),_0x219ccd=_0x2fb1b0['getRowIndexes'](_0x3690ba),_0x305964=_0x2fb1b0['getColumnIndexes'](_0x3690ba),_0x272c6d=_0x219ccd['last']+0x1,_0x457f3a=_0x305964['first'],_0x135184=_0x3690ba[0x0]['findAncestor']('table');for(let _0x534acb=0x0;_0x534acb<_0x1eff65;_0x534acb++)_0x2fb1b0['insertRows'](_0x135184,{'at':_0x272c6d});return _0x135184['getChild'](_0x272c6d)['getChild'](_0x457f3a);}['_resetContentOfSelectedTableCells'](_0x39676c,_0x217db4){const {plugins:_0x3e7176}=this['editor'],{model:_0x372aea}=_0x39676c;if(!_0x3e7176['has']('TableUtils'))return;_0x3e7176['get']('TableUtils')['getSelectedTableCells'](_0x217db4)['length']&&_0x372aea['deleteContent'](_0x217db4);}}class F extends _0x2c78e0{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x516722('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x580f3e){super(_0x580f3e),this['name']='AIRequestError';}}function Pn(_0x5d3e7e,_0x33feaa,_0x3e73fb){const t=_0x5d3e7e['t'];switch(_0x33feaa){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',_0x3e73fb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3e73fb);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'},_0x3e73fb);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 _0x33feaa;}}class J extends _0x2ae2c4{['_commandDefinitions'];constructor(_0x444e2a,_0x20c7e6){super(_0x444e2a),this['_commandDefinitions']=_0x20c7e6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xa8c5b3,_0x469f0d,_0x1ccf10)=>{this['isEnabled']&&(this['enabledCommandsIds']=fs(this['_commandDefinitions'],_0x1ccf10));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x15a6d2,_0x305273,_0x385bb2)=>{this['enabledCommandsIds']=_0x385bb2?fs(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5cfab4=this['editor']['model'];this['_hasContext']=function(_0x405ab4){const _0x56e14c=_0x405ab4['document']['selection'];return _0x56e14c['isCollapsed']?0x0!==[..._0x56e14c['getSelectedBlocks']()]['length']&&![..._0x56e14c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x405ab4['hasContent'](_0x56e14c['getFirstRange']());}(_0x5cfab4);const _0x191002=_0x5cfab4['document']['selection'],_0x1f6ea5=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x442949 of _0x191002['getRanges']())for(const _0x5f48c2 of _0x442949['getItems']())if(_0x5f48c2['is']('element')&&_0x1f6ea5['includes'](_0x5f48c2['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x246d5f='',_0x2703a2='',_0x41d06e='custom'){this['editor']['plugins']['get'](v)['showUI'](_0x246d5f,_0x2703a2,_0x41d06e);}}function fs(_0x31b878,_0x321988){const _0x4a453b=new Set();for(const _0x19021c of _0x31b878['values']())(_0x321988||!0x1===_0x19021c['requiresContent'])&&_0x4a453b['add'](_0x19021c['id']);return Array['from'](_0x4a453b);}const ds=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Q extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x3a17ed(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x37ac0a,_0x331707,_0x2a36ad){super(),this['editor']=_0x37ac0a,this['textAdapter']=_0x331707,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2a36ad,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5cd11c,_0x370907,_0x24b514)=>{this['view']['value']=this['_sanitizeHTML'](_0x24b514);}),this['listenTo'](this['view'],'submitPrompt',(_0x5127f8,_0x2e7005)=>{const _0x45cadc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2e7005,_0x45cadc,'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:_0x584b1e,query:_0x1c9d1b,htmlContent:_0x5e208a,label:_0x2c7196,mainActionLabel:_0xe60223}){this['view']['prompt']=_0x2c7196,this['view']['mainAction']=_0xe60223,this['initialContext']=_0x5e208a,_0x1c9d1b&&(this['view']['isRendered']?this['_handleQuery'](_0x1c9d1b,_0x5e208a,_0x584b1e,_0x2c7196):this['view']['once']('render',()=>{this['_handleQuery'](_0x1c9d1b,_0x5e208a,_0x584b1e,_0x2c7196);}));}['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'](_0x708b3f,_0x5da3a7,_0x3dd327,_0x355e2f){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5da3a7,this['previousQuery']=_0x708b3f,this['previousLabel']=_0x355e2f||_0x708b3f,this['previousActionId']=_0x3dd327,new Promise(_0x16dafb=>{this['textAdapter']['makeRequest']({'query':_0x708b3f,'context':_0x5da3a7,'onData':_0xaf59a0=>{this['currentResponse']=_0xaf59a0,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3dd327})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x54f762=>{_0x54f762 instanceof tr?this['view']['handleError'](_0x54f762['message']):this['view']['handleError'](),_0x16dafb();})['finally'](()=>{this['stopProcessing'](),_0x16dafb();});});}['_parseAndNormalizeContent'](_0x35166b,_0x575a4f=!0x1){const _0x51ce0d=ds['exec'](_0x35166b);_0x35166b=_0x51ce0d?_0x35166b['substring'](_0x51ce0d[0x1]['length']):_0x35166b['length']<0x64&&!_0x575a4f?'':this['_stripMarkdownSyntax'](_0x35166b);const _0x579e75=this['_domParser']['parseFromString'](_0x35166b,'text/html');if(_0x51ce0d){const _0x399c38=Array['from'](_0x579e75['body']['childNodes']);_0x399c38['reverse']();for(const _0x42e7a8 of _0x399c38){if(_0x42e7a8['nodeType']==Node['ELEMENT_NODE'])break;_0x42e7a8['remove']();}}const _0x24506b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x579e75['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x24506b);const _0x92d3ad=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5b4049=this['editor']['data']['toModel'](_0x24506b);return _0x92d3ad||_0x5b4049['markers']['clear'](),this['editor']['data']['stringify'](_0x5b4049);}['_normalizeResponseHeadings'](_0x17c7ce){const _0x1eb151=new _0x5ba070(this['editor']['editing']['view']['document']),_0x5ee355=new _0x473502({'name':/^h[1-5]$/}),_0x5e1cd9=[];let _0xd62d26=!0x1;for(const _0x144da1 of _0x17c7ce)_0x144da1['is']('element')&&_0x5ee355['match'](_0x144da1)&&(_0x5e1cd9['push'](_0x144da1),'h1'==_0x144da1['name']&&(_0xd62d26=!0x0));if(_0xd62d26){for(const _0xf8e6af of _0x5e1cd9)_0x1eb151['rename']('h'+(parseInt(_0xf8e6af['name'][0x1])+0x1),_0xf8e6af);}}['_isH1TagSupportEnabled'](){const {data:_0x436e76,editing:_0x590a69}=this['editor'],_0x2ac65a=_0x436e76['htmlProcessor']['toView']('<h1></h1>'),_0xbf38eb=_0x436e76['toView'](_0x436e76['toModel'](_0x2ac65a));return!!_0x590a69['view']['domConverter']['viewToDom'](_0xbf38eb)['querySelector']('h1');}['_sanitizeHTML'](_0x838759){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x838759),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1495f3){const _0x52e59f=_0x1495f3['trim']();return _0x52e59f['startsWith']('```html')?_0x52e59f['endsWith']('```')?_0x52e59f['substring'](0x7,_0x52e59f['length']-0x3):_0x52e59f['substring'](0x7):_0x1495f3;}}const X={'REPLACE':'replace','INSERT':'insert'};class br extends _0x47fea8{constructor(_0x211e1b){super(_0x211e1b),this['set']('isVisible',!0x1),this['set']('mainAction',X['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x41bb8c=>Pn(_0x211e1b,'AI_'+_0x41bb8c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Pn(_0x211e1b,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Pn(_0x211e1b,'Try\x20again')),this['stopButton']=this['_createButton'](Pn(_0x211e1b,'Stop'));const _0x3161ea=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3161ea['if']('isVisible','ck-hidden',_0x470107=>!_0x470107)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x387726,_0x47e0d9){const _0x2ef7e3=new _0x3678e7(this['locale']);return _0x2ef7e3['set']({'label':_0x387726,'class':_0x47e0d9||'','isVisible':!0x0,'withText':!0x0}),_0x2ef7e3;}}class wr extends _0x179f2b{['contentFieldView'];['copyButtonView'];constructor(_0x577519,_0x4823c9=''){super(_0x577519),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x25996f=this['bindTemplate'];this['contentFieldView']=new Hn(_0x577519,_0x4823c9),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x25996f['if']('isVisible','ck-hidden',_0x52ca16=>!_0x52ca16)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x25996f['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 _0x5c6099=!0x1;this['on']('change:value',(_0x2f8a24,_0x386533,_0x387696)=>{const _0x31719d=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x387696),this['isProcessing']&&_0x31719d&&!_0x5c6099&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x586e99,_0xe29d52,_0xb4c623)=>{_0x5c6099=!0x1,_0xb4c623?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5c6099=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5c6099=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x516790=this['locale'],_0x4a7d51=new _0x3678e7(this['locale']),_0x464625='ck-ai-form__copy-button';return _0x4a7d51['set']({'label':Pn(_0x516790,'Copy'),'icon':_0x5834f1,'class':_0x464625,'tooltip':!0x0}),_0x4a7d51['bind']('isVisible')['to'](this,'value',_0x254e5e=>!!_0x254e5e),_0x4a7d51['bind']('isEnabled')['to'](this,'isProcessing',_0x4290f3=>!_0x4290f3),_0x4a7d51['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4a7d51['icon']=_0xe9aaa5,_0x4a7d51['class']=_0x464625+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4a7d51['icon']=_0x5834f1,_0x4a7d51['class']=_0x464625;},0x3e8);}),_0x4a7d51;}['_copyHTMLToClipboard'](_0x2d6957){const {window:_0x1b6fa9,document:_0x36cf98}=_0x136098;if(_0x1b6fa9['ClipboardItem']){const {Blob:_0x208998,ClipboardItem:_0x558bae}=_0x1b6fa9,_0x510f0e=[new _0x558bae({'text/html':new _0x208998([_0x2d6957['innerHTML']],{'type':'text/html'}),'text/plain':new _0x208998([_0x2d6957['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x510f0e);}else{const _0x4160bc=_0x36cf98['createElement']('div');_0x4160bc['style']['position']='absolute',_0x4160bc['style']['left']='-9999px',_0x4160bc['innerHTML']='<span>[</span>'+_0x2d6957['innerHTML']+'<span>]</span>',_0x36cf98['body']['appendChild'](_0x4160bc);const _0x3a542b=_0x36cf98['createRange']();_0x3a542b['setStartAfter'](_0x4160bc['firstElementChild']),_0x3a542b['setEndBefore'](_0x4160bc['lastElementChild']);const _0x292655=_0x1b6fa9['getSelection']();_0x292655['removeAllRanges'](),_0x292655['addRange'](_0x3a542b),_0x36cf98['execCommand']('copy'),_0x4160bc['remove']();}}}class Hn extends _0x179f2b{constructor(_0x45a768,_0x1a49ae=''){super(_0x45a768),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1a49ae,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xcbcaa){this['element']['innerHTML']=_0xcbcaa;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x7ca127=new _0x179f2b(),_0x321bfe=this['locale'],_0x416497=new _0x3fce23();return _0x416497['isVisible']=!0x0,_0x7ca127['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x416497,{'text':Pn(_0x321bfe,'AI\x20is\x20writing...')}]}),_0x7ca127['render'](),_0x7ca127;}}class yr extends _0x179f2b{constructor(_0x4ba607,_0x1dcd8b=''){super(_0x4ba607);const _0x16b42a=new _0x30b390(),_0x89d6e4=this['bindTemplate'];this['set']('text',_0x1dcd8b),_0x16b42a['content']=_0x3128e4,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x16b42a,{'text':_0x89d6e4['to']('text')}]});}}class gr extends _0x352dbb{['submitButtonView'];['showHistoryButtonView'];constructor(_0x5624f1,_0x59614b){super(_0x5624f1,_0x59614b),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',(_0x47684a,_0x699e8e)=>{_0x47684a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x699e8e());});}['_createSubmitButton'](){const _0x71f79a=new _0x3678e7(this['locale']),_0x305c75=this['locale'];return _0x71f79a['set']({'icon':_0xbe2b8c,'label':Pn(_0x305c75,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x71f79a['on']('execute',()=>{this['submit']();}),_0x71f79a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x405ca4,_0x8dc357)=>!_0x405ca4&&_0x8dc357),_0x71f79a;}['_createShowHistoryButton'](){const _0xd8b00=new _0x3678e7(this['locale']),_0x951b93=this['resultsView'],_0x2a416a=this['locale'];_0xd8b00['set']({'label':Pn(_0x2a416a,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xd8b00['bind']('isOn')['to'](_0x951b93,'isVisible'),_0xd8b00['bind']('isEnabled')['to'](this,'isEnabled'),_0xd8b00['on']('execute',()=>{_0x951b93['isVisible']=!_0x951b93['isVisible'],_0x951b93['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x22cc9f=()=>{_0x136098['window']['requestAnimationFrame'](()=>{if(_0x30a94f(this['element'])){const _0x27d8f2=new _0x209e41(this['queryView']['fieldView']['element']),_0x164b13=_0x27d8f2['width'],_0xa5d932='rtl'===_0x2a416a['uiLanguageDirection']?'left':'right';_0x27d8f2['excludeScrollbarsAndBorders'](),_0xd8b00['element']['style'][_0xa5d932]=_0x164b13-_0x27d8f2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x22cc9f),this['on']('render',_0x22cc9f),_0xd8b00;}['submit'](){const _0x4efc88=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4efc88);}['focus'](_0x1d240c){-0x1===_0x1d240c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class kr extends _0x56c802{['historyGroupView'];['clearHistoryButton'];constructor(_0x300d8d){super(_0x300d8d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x466af8(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Pn(_0x300d8d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xa26166=0x0;for(const _0x3ef9cc of this['items'])_0xa26166+=_0x3ef9cc['items']['length'];return{'resultsCount':_0xa26166,'totalItemsCount':_0xa26166};}['_createClearHistoryButton'](){const _0x5f0a60=this['locale'],_0x4cbd65=new _0x3678e7(this['locale']);return _0x4cbd65['set']({'label':'('+Pn(_0x5f0a60,'Clear')+')','withText':!0x0}),_0x4cbd65['on']('execute',()=>this['fire']('clearHistory')),_0x4cbd65;}}class Er extends _0xfd7405{constructor(_0x4d060c){super();const _0x28340b=new _0x5a6277(),_0x466b78=new _0x3678e7(this['locale'],_0x28340b);this['children']['add'](_0x466b78),_0x466b78['set']({'label':_0x4d060c['prompt'],'withText':!0x0}),_0x466b78['on']('execute',()=>{this['fire']('execute',{'value':_0x13f2ee(_0x4d060c['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class vr extends _0x3febd7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x57d3b8,_0x302697)=>{const _0x1a90cb=ao(_0x302697['prompt']);for(const _0x47f743 of this)if(_0x47f743!=_0x302697&&ao(_0x47f743['prompt'])===_0x1a90cb){this['remove'](_0x47f743);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4bd8b2=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0x4bd8b2));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0x487c35=>_0x487c35)));}}function ao(_0x49e4a4){return _0x49e4a4['toLowerCase']()['trim']();}class W extends _0x179f2b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4aa0c6,_0x58625c,_0x1e94ef=''){super(_0x4aa0c6),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',X['REPLACE']),this['_promptHistory']=new vr(),this['errorView']=new yr(_0x4aa0c6),this['contentArea']=new wr(_0x4aa0c6,_0x1e94ef),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 _0x54be86(),this['keystrokes']=new _0x46e306(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ts({'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 _0x12a6ab=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x58625c],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x12a6ab['if']('isError','ck-hidden',_0x1335c1=>!_0x1335c1)]},'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'](_0xafd39b=0x1){-0x1===_0xafd39b?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 _0x5da5a4=this['locale'],_0x48b788=new gr(_0x5da5a4,{'queryView':{'label':Pn(_0x5da5a4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5432a7,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Pn(_0x5da5a4,'Empty\x20history'),'secondary':Pn(_0x5da5a4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x48b788['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5da0b0,_0x80f55e)=>_0x5da0b0&&!_0x80f55e),this['listenTo'](_0x48b788,'submit',(_0x715ae,_0xdbdcb9)=>{this['prompt']=_0xdbdcb9;const _0x470686=_0x14ded9(_0xdbdcb9);this['fire']('submitPrompt',_0x470686),_0xdbdcb9['trim']()&&this['_promptHistory']['add']({'prompt':_0x470686},0x0);},{'priority':'high'}),_0x48b788;}['_createHistoryView'](){const _0x45841a=new kr(this['locale']);return _0x45841a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Er),_0x45841a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x45841a;}['_createToolbar'](){const _0x294809=new br(this['locale']);return _0x294809['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x520d37,_0x4e8d66,_0x2903f2)=>_0x520d37&&!_0x4e8d66&&!!_0x2903f2),_0x294809['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x294809['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x27d27b,_0x3e7aeb,_0x3ab80c)=>_0x27d27b&&!_0x3e7aeb&&!!_0x3ab80c),_0x294809['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x294809['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x56958d,_0x4a50a4)=>_0x56958d&&!_0x4a50a4),_0x294809['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x294809['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x294809['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x294809;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2598ec=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Pn(_0x2598ec,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x156a56){const _0x57145e=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x156a56||Pn(_0x57145e,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const O=globalThis['DataTransfer'];class v extends _0x2c78e0{['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[_0x2520a8,I,F,_0x1abae0];}constructor(_0x42187c){super(_0x42187c),_0x42187c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x42187c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x42187c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x42187c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x16d644}=this;this['_aiAdapter']=_0x16d644['plugins']['get'](F),this['_dialog']=_0x16d644['plugins']['get'](_0x1abae0),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4a972c=new J(_0x16d644,Array['from'](this['_commandDefinitions']['values']()));_0x16d644['commands']['add']('showAIAssistant',_0x4a972c),_0x16d644['ui']['componentFactory']['add']('aiCommands',_0x1741be=>{const _0x3388e1=_0x3e7f7b(_0x1741be);return _0x3388e1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3388e1['buttonView']['set']({'label':Pn(_0x1741be,'AI\x20Commands'),'icon':_0x1e931d,'tooltip':!0x0}),_0x3388e1['on']('execute',_0x16e4fa=>this['_onExecute'](_0x16e4fa['source']['id'])),_0x415487(_0x3388e1,_0x16d644['ui']['view']['body'],function(_0x4f0a35){const _0x412e3a=x(_0x4f0a35['config']['get']('ai.assistant.commands'),_0x4f0a35['locale']),_0x11094c=ii(_0x4f0a35,_0x412e3a)['filter'](_0x2fd12a=>_0x2fd12a['commands']['length']);if(0x1===_0x11094c['length'])return ii(_0x4f0a35,_0x11094c[0x0]['commands'])['map'](_0x20b622=>({'id':_0x20b622['id'],'label':_0x20b622['label']}));return _0x11094c['map'](_0x3a1fbf=>{const {groupId:_0x294913,groupLabel:_0x2cdd4a,commands:_0x3e49d8}=_0x3a1fbf,_0x1ce32d=ii(_0x4f0a35,_0x3e49d8)['map'](_0xf9790d=>({'id':_0xf9790d['id'],'label':_0xf9790d['label']}));return{'id':_0x294913,'menu':_0x2cdd4a||_0x294913,'children':_0x1ce32d};});}(_0x16d644),{'ariaLabel':Pn(_0x1741be,'AI\x20Commands')}),_0x3388e1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4a972c['on']('change:enabledCommandsIds',_0x1dc6fe),_0x3388e1['menuView']['once']('render',_0x1dc6fe),_0x3388e1;function _0x1dc6fe(){_0x3388e1['isEnabled']=_0x4a972c['enabledCommandsIds']['length']>0x0;for(const _0x51b264 of _0x3388e1['menuView']['buttons'])_0x51b264['isEnabled']=_0x4a972c['enabledCommandsIds']['includes'](_0x51b264['id']);}}),_0x16d644['ui']['componentFactory']['add']('menuBar:aiCommands',_0x970c29=>{const _0x524209=new _0x5a62aa(_0x970c29);_0x524209['buttonView']['set']({'label':Pn(_0x970c29,'AI\x20Commands'),'icon':_0x1e931d}),_0x524209['bind']('isEnabled')['to'](_0x4a972c,'enabledCommandsIds',_0x695fff=>_0x695fff['length']>0x0);const _0x5f2ae5=x(_0x16d644['config']['get']('ai.assistant.commands'),_0x970c29);return this['_populateMenuBarMenu'](_0x4a972c,_0x524209,_0x5f2ae5,_0x371e0a=>this['_onExecute'](_0x371e0a)),_0x524209;}),_0x16d644['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3aba15=this['_createAIAssistantUIButton'](_0x3678e7);return _0x3aba15['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3aba15;}),_0x16d644['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x235586=this['_createAIAssistantUIButton'](_0x1651cb);return _0x235586['set']({'role':'menuitemcheckbox'}),_0x235586;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4e51c5=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4306f5;for(const _0x26219f in _0x4e51c5){const _0x44ffb3=_0x26219f,_0x29e639=_0x4e51c5[_0x44ffb3];if('aiLicenseKeyValid'==_0x29e639||'aiLicenseKeyInvalid'==_0x29e639||'aiLicenseKeyExpired'==_0x29e639||'aiLicenseKeyDomainLimit'==_0x29e639||'aiLicenseKeyNotAllowed'==_0x29e639||'aiLicenseKeyEvaluationLimit'==_0x29e639||'aiLicenseKeyTrialLimit'==_0x29e639||'aiLicenseKeyUsageLimit'==_0x29e639){delete _0x4e51c5[_0x44ffb3],_0x4306f5=_0x29e639,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4306f5&&_0x4e51c5['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4306f5&&_0x4e51c5['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4306f5&&_0x4e51c5['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4306f5&&_0x4e51c5['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4306f5&&_0x4e51c5['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4306f5&&_0x4e51c5['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4306f5&&_0x4e51c5['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x380d69='',_0x245367='',_0x100836='custom'){const _0x28ea68=this['editor'],_0x5035f1=_0x28ea68['editing']['view'],_0x14ac93=_0x28ea68['plugins']['get'](I),_0x294e91=_0x28ea68['plugins']['get'](_0x2520a8);_0x14ac93['showFakeVisualSelection']();const _0x5debd4=new O(),_0x505811=new ClipboardEvent('copy',{'clipboardData':_0x5debd4}),_0x493edf=new _0x24d72b(_0x5debd4),_0x5e095b=new _0x369d30(_0x5035f1,_0x505811,{'dataTransfer':_0x493edf});_0x294e91['_forceMarkersCopy']('comment',()=>{_0x5035f1['document']['fire']('copy',_0x5e095b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Q(_0x28ea68,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x41fb8b=_0x493edf['getData']('text/html');const _0x485b3e=_0x28ea68['model']['document']['selection'],_0xb57839=Array['from'](_0x485b3e['getRanges']());0x1===_0xb57839['length']&&_0xb57839[0x0]['isFlat']&&!_0x485b3e['getSelectedElement']()&&''!==_0x41fb8b['replace'](/ /g,'')['trim']()&&(_0x41fb8b='<p>'+_0x41fb8b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x100836,'query':_0x380d69,'htmlContent':_0x41fb8b,'label':_0x245367,'mainActionLabel':X[_0x28ea68['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x22b0ff,'title':Pn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x58513a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x14ac93['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2dd0a9=new Map(),_0x49d6a9=x(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x194403 of _0x49d6a9)for(const _0x58b68d of _0x194403['commands'])_0x2dd0a9['set'](_0x58b68d['id'],{..._0x58b68d,'groupId':_0x194403['groupId'],'groupLabel':_0x194403['groupLabel']||_0x194403['groupId']});return _0x2dd0a9;}['_createAIAssistantUIButton'](_0x3f6127){const _0x227ef8=this['editor'],_0x14b565=_0x227ef8['commands']['get']('showAIAssistant'),_0xf9e57e=new _0x3f6127(_0x227ef8['locale']);return _0xf9e57e['set']({'label':Pn(_0x227ef8['locale'],'AI\x20Assistant'),'icon':_0x22b0ff,'isToggleable':!0x0}),_0xf9e57e['bind']('isEnabled')['to'](_0x14b565),_0xf9e57e['bind']('isOn')['to'](this['_dialog'],'id',_0x55614f=>'aiAssistant'===_0x55614f),this['listenTo'](_0xf9e57e,'execute',()=>{_0xf9e57e['isOn']?this['hideUI']():_0x14b565['execute']();}),_0xf9e57e;}['_initView'](){const _0x55d83f=this['editor']['plugins']['get'](I);this['_formView']=new W(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',()=>{_0x55d83f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x55d83f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x19c7a1,ui:{ariaLiveAnnouncer:_0x4afe98}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1dea72,_0x5cd65b,_0x1cbf20)=>{const _0x58a676=this['_aiAssistantController']['currentContext'];_0x1cbf20?_0x4afe98['announce'](Pn(_0x19c7a1,'AI\x20is\x20writing')):_0x58a676&&_0x4afe98['announce'](Pn(_0x19c7a1,'Generated\x20content:\x20%0',_0x58a676),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x7e0b13,_0x2187b0,_0x5c01ab)=>{if(_0x5c01ab){const _0x5b4bd5=this['_formView']['errorView']['text'];_0x4afe98['announce'](Pn(_0x19c7a1,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5b4bd5));}});}['_onExecute'](_0xa980e8){const _0x3510a9=this['_commandDefinitions']['get'](_0xa980e8),_0x42334f=this['editor'],_0x258272=_0x42334f['model']['document']['selection'],_0x36a82a=_0x42334f['commands']['get']('showAIAssistant'),_0x522218=_0x42334f['plugins']['get'](I),_0x2a76e7=''+(_0x3510a9['groupId']!==R?_0x3510a9['groupLabel']+':\x20':'')+_0x3510a9['label'];if(!0x1!==_0x3510a9['requiresContent']&&_0x258272['isCollapsed']){const _0x49b423=_0x478af3(_0x258272['getSelectedBlocks']())||_0x42334f['model']['schema']['getLimitElement'](_0x258272);_0x42334f['model']['change'](_0x38c9ff=>{_0x38c9ff['setSelection'](_0x49b423,'in');});}_0x522218['showFakeVisualSelection'](),_0x36a82a['execute'](_0x3510a9['prompt'],_0x2a76e7,'command:'+_0xa980e8);}['_populateMenuBarMenu'](_0x5e34e7,_0x124ee2,_0x49753c,_0x2add39){const _0x37265f=this['editor'],_0x533f1b=_0x37265f['locale'],_0x5d2fc8=new _0x2b1ca6(_0x533f1b),_0x27ed96=ii(_0x37265f,_0x49753c)['filter'](_0x5c4efd=>_0x5c4efd['commands']['length']);0x1===_0x27ed96['length']?this['_getMenuBarGroupButtons']({'command':_0x5e34e7,'commands':_0x27ed96[0x0]['commands'],'parentMenuView':_0x124ee2,'onExecute':_0x2add39})['forEach'](_0x37fe5c=>_0x5d2fc8['items']['add'](_0x37fe5c)):_0x27ed96['forEach'](({groupId:_0x18a722,groupLabel:_0x50e05c,commands:_0xca8280})=>{const _0x562e82=new _0x167fbe(_0x533f1b,_0x124ee2),_0x48052d=new _0x5a62aa(_0x533f1b),_0x7afcd8=new _0x2b1ca6(_0x533f1b),_0x56a19f=this['_getMenuBarGroupButtons']({'command':_0x5e34e7,'commands':_0xca8280,'parentMenuView':_0x48052d,'onExecute':_0x2add39});_0x48052d['buttonView']['set']({'label':_0x50e05c||_0x18a722}),_0x48052d['delegate']('execute')['to'](_0x124ee2),_0x7afcd8['items']['addMany'](_0x56a19f),_0x48052d['panelView']['children']['add'](_0x7afcd8),_0x562e82['children']['add'](_0x48052d),_0x5d2fc8['items']['add'](_0x562e82);}),_0x124ee2['panelView']['children']['add'](_0x5d2fc8);}['_getMenuBarGroupButtons']({command:_0x53a264,commands:_0x1b4527,parentMenuView:_0x1a06bc,onExecute:_0xed3a2a}){const _0x303d5b=this['editor'],_0x285164=_0x303d5b['locale'];return ii(_0x303d5b,_0x1b4527)['map'](_0x32efda=>{const _0xb693c1=new _0x167fbe(_0x285164,_0x1a06bc),_0x2b6a3d=new _0x1651cb(_0x285164);return _0x2b6a3d['set']({'label':_0x32efda['label']}),_0x2b6a3d['delegate']('execute')['to'](_0x1a06bc),_0x2b6a3d['on']('execute',()=>_0xed3a2a(_0x32efda['id'])),_0x2b6a3d['bind']('isEnabled')['to'](_0x53a264,'enabledCommandsIds',_0xc1b1a1=>_0xc1b1a1['includes'](_0x32efda['id'])),_0xb693c1['children']['add'](_0x2b6a3d),_0xb693c1;});}}function Z(_0x244cbd,_0x3c46d2){return void 0x0!==_0x244cbd['order']&&void 0x0===_0x3c46d2['order']?0x1:void 0x0===_0x244cbd['order']&&void 0x0!==_0x3c46d2['order']?-0x1:void 0x0!==_0x244cbd['order']&&void 0x0!==_0x3c46d2['order']?_0x244cbd['order']-_0x3c46d2['order']:0x0;}function ii(_0x31afc2,_0x2382f8){_0x2382f8['sort'](Z);const _0x3b5c2c={},_0x5de23a=[];for(const _0x11bb26 of _0x2382f8)if(void 0x0!==_0x11bb26['order']){if(_0x11bb26['order']in _0x3b5c2c)throw new _0x516722('ai-commands-config-order-collision',_0x31afc2,{'conflictingDefinitions':[_0x11bb26,_0x3b5c2c[_0x11bb26['order']]]});_0x3b5c2c[_0x11bb26['order']]=_0x11bb26,_0x5de23a['splice'](_0x11bb26['order'],0x0,_0x11bb26);}else _0x5de23a['push'](_0x11bb26);return _0x5de23a;}class Dn extends _0x2c78e0{static get['requires'](){return[v,I];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x338b66){super(_0x338b66);const _0x3e88d6=_0x338b66['config'],_0x313dea=_0x338b66['locale'];_0x3e88d6['define']('ai.assistant.preserveComments',!0x0),_0x3e88d6['define']('ai.assistant.commands',Mn(_0x313dea)),_0x3e88d6['define']('ai.assistant.extraCommandGroups',[]),_0x3e88d6['define']('ai.assistant.removeCommands',[]);let _0x544549=x(_0x3e88d6['get']('ai.assistant.commands'),_0x313dea);const _0x4494d5=_0x3e88d6['get']('ai.assistant.extraCommandGroups'),_0x58a768=_0x3e88d6['get']('ai.assistant.removeCommands');_0x4494d5['forEach'](_0x743973=>{const _0xbd36c5=_0x544549['find'](_0x31213c=>_0x31213c['groupId']===_0x743973['groupId']);_0xbd36c5?_0xbd36c5['commands']=_0xbd36c5['commands']['concat'](_0x743973['commands']):_0x544549['push'](_0x743973);}),_0x544549=_0x544549['filter'](_0x5f4c9a=>!_0x58a768['includes'](_0x5f4c9a['groupId'])),_0x544549['forEach'](_0x47a534=>{_0x47a534['commands']=_0x47a534['commands']['filter'](_0x248427=>!_0x58a768['includes'](_0x248427['id']));}),_0x3e88d6['set']('ai.assistant.commands',_0x544549);}}function Mn(_0x15dd3d){return[{'groupId':'editOrReview','groupLabel':Pn(_0x15dd3d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Pn(_0x15dd3d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Pn(_0x15dd3d,'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':Pn(_0x15dd3d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Pn(_0x15dd3d,'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':Pn(_0x15dd3d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Pn(_0x15dd3d,'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':Pn(_0x15dd3d,'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':Pn(_0x15dd3d,'Change\x20tone'),'commands':[{'id':'professional','label':Pn(_0x15dd3d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Pn(_0x15dd3d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Pn(_0x15dd3d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Pn(_0x15dd3d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Pn(_0x15dd3d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Pn(_0x15dd3d,'Change\x20style'),'commands':[{'id':'business','label':Pn(_0x15dd3d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Pn(_0x15dd3d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Pn(_0x15dd3d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Pn(_0x15dd3d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Pn(_0x15dd3d,'Translate'),'commands':[{'id':'translateEnglish','label':Pn(_0x15dd3d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Pn(_0x15dd3d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Pn(_0x15dd3d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Pn(_0x15dd3d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Pn(_0x15dd3d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Pn(_0x15dd3d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Pn(_0x15dd3d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Pn(_0x15dd3d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ae extends _0x2c78e0{['abortController'];static get['requires'](){return[F];}constructor(_0xfc0401){super(_0xfc0401),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](F)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4b7eb9){return this['sendRequest'](_0x4b7eb9)['catch'](_0x212423=>{if(_0x212423 instanceof tr)return Promise['reject'](_0x212423);if('AbortError'==_0x212423['name'])return Promise['resolve']();throw console['error'](_0x212423),new _0x516722('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x7cb6d3,_0x4ca141){const _0x24efac=this['editor']['locale'],_0x525673={'Content-Type':'application/json'};if('object'==typeof _0x7cb6d3)Object['assign'](_0x525673,_0x7cb6d3);else{if(_0x7cb6d3)try{const _0x5970f5=await _0x7cb6d3(_0x4ca141);Object['assign'](_0x525673,_0x5970f5);}catch{return Promise['reject'](new tr(Pn(_0x24efac,'AI_ERROR_GET_HEADERS')));}}return _0x525673;}async['_prepareRequestParameters'](_0x11b1f2,_0x43c50a){const _0xd974b6=this['editor']['locale'];if('object'==typeof _0x11b1f2)return _0x11b1f2;try{return await _0x11b1f2(_0x43c50a);}catch{return Promise['reject'](new tr(Pn(_0xd974b6,'AI_ERROR_GET_PARAMETERS')));}}}class Un extends ae{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3727a4){super(_0x3727a4),_0x3727a4['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3727a4['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3727a4['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3727a4['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3727a4['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3727a4['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x516f04,context:_0x11f2db,onData:_0x4e8c1f,actionId:_0x2a3902}){const _0x2e8492=this['editor']['locale'],_0x29baf8=await this['prepareMessages'](_0x516f04,_0x11f2db,_0x2a3902),_0x454c96=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2a3902),_0xc1f712=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2a3902),_0x4bc6a4={'messages':_0x29baf8,..._0xc1f712},_0x12b937={'method':'POST','headers':_0x454c96,'body':JSON['stringify'](_0x4bc6a4),'signal':this['abortController']['signal']},_0xd2cfa8=await fetch(this['_apiUrl'],_0x12b937);if(_0xd2cfa8['ok'])return _0xc1f712['stream']?await this['_readStreamableResponse'](_0xd2cfa8,_0x4e8c1f):await this['_readStaticResponse'](_0xd2cfa8,_0x4e8c1f),Promise['resolve']();{const _0x44a3e4=await _0xd2cfa8['text']();return _0x44a3e4['includes']('context_length_exceeded')?Promise['reject'](new tr(Pn(_0x2e8492,'AI_ERROR_CONTEXT_LENGTH'))):_0x44a3e4['includes']('Moderation')?Promise['reject'](new tr(Pn(_0x2e8492,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x44a3e4));}}async['prepareMessages'](_0x5576c8,_0x43aa05,_0xb0801e){let _0x2b90dd,_0x4520f5;return _0x43aa05?(_0x2b90dd='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.',_0x4520f5='Instruction:\x0a'+_0x5576c8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x43aa05):(_0x2b90dd='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.',_0x4520f5=_0x5576c8),[{'role':'system','content':_0x2b90dd},{'role':'user','content':_0x4520f5}];}async['_readStreamableResponse'](_0x45969c,_0x4b739f){const _0x357c2d=_0x45969c['body']['getReader'](),_0x38c08d=new TextDecoder();let _0x5453c1='',_0x2f7d92='',_0x2e5a74='',_0x333740=!0x1;for(;!_0x333740;){const {done:_0x266dfd,value:_0x8bf90b}=await _0x357c2d['read'](),_0x3615e2=_0x5453c1+_0x38c08d['decode'](_0x8bf90b);let _0x5c7d2b='';_0x333740=_0x266dfd;try{_0x5c7d2b=this['_cleanUpData'](_0x3615e2),_0x5453c1='';}catch{_0x5453c1=_0x3615e2;continue;}_0x2f7d92+=_0x5c7d2b,!_0x333740&&this['_isBufferIncomplete'](_0x2f7d92)||_0x2f7d92&&(_0x2e5a74+=_0x2f7d92,_0x2f7d92='',_0x4b739f(_0x2e5a74));}return Promise['resolve']();}async['_readStaticResponse'](_0x428d6b,_0x20cc15){return _0x20cc15((await _0x428d6b['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x8aa568){const _0x464a37=_0x8aa568['split']('<')['length']!==_0x8aa568['split']('>')['length'],_0x231e0e=_0x8aa568['length']<0x1e;return _0x464a37&&_0x231e0e;}['_cleanUpData'](_0x2be040){return _0x2be040['split'](/\n(?![^{]*\})/g)['map'](_0x11a4b4=>_0x11a4b4['replace']('data:\x20',''))['filter'](_0x44f315=>_0x44f315&&_0x44f315['length']>0x0&&'[DONE]'!==_0x44f315)['map'](_0x5197dd=>{const {choices:_0x1f17d3}=JSON['parse'](_0x5197dd);if(_0x1f17d3[0x0]?.['delta']?.['content'])return _0x1f17d3[0x0]['delta']['content'];})['filter'](_0x44747f=>_0x44747f)['join']('');}}class Gn extends ae{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xe2259c){super(_0xe2259c),_0xe2259c['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0xe2259c['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']=_0xe2259c['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0xe2259c['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0xe2259c['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0xe2259c['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x337778,context:_0x3155fe,onData:_0x4d6333,actionId:_0x158eb3}){const {model:_0x4d4cd3,stream:_0x364662,..._0x78018e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x158eb3),_0x5c5c3e={'prompt':await this['preparePrompt'](_0x337778,_0x3155fe,_0x4d4cd3,_0x158eb3),..._0x78018e};this['_apiUrl']?await this['_processProxyRequest'](_0x5c5c3e,_0x4d4cd3,_0x364662,_0x4d6333,_0x158eb3):await this['_processAWSRequest'](_0x5c5c3e,_0x4d4cd3,_0x364662,_0x4d6333);}async['preparePrompt'](_0x59a022,_0x1d0385,_0x2bfc50,_0x483880){let _0xf429da,_0x31c94f;return _0x1d0385?(_0xf429da='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.',_0x31c94f='Instruction:\x0a'+_0x59a022+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1d0385):(_0xf429da='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.',_0x31c94f=_0x59a022),'meta.llama'==this['getModelFamily'](_0x2bfc50)?'<<SYS>>\x0a'+_0xf429da+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x31c94f+'\x0a[/INST]':'Human:\x0a'+_0xf429da+'\x0a'+_0x31c94f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x162ad4){if(/^anthropic\.claude/['test'](_0x162ad4))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x162ad4))return'ai21.j2';if(/^cohere\.command/['test'](_0x162ad4))return'cohere.command';if(/^meta\.llama/['test'](_0x162ad4))return'meta.llama';throw new tr(Pn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x162ad4));}async['_processProxyRequest'](_0x4dddf4,_0x4fe5eb,_0x4ada73,_0x43306c,_0x5eedee){const _0x28bd98={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5eedee),'body':JSON['stringify']({..._0x4dddf4,'model':_0x4fe5eb,'stream':_0x4ada73}),'signal':this['abortController']['signal']},_0x1bbf7=await fetch(this['_apiUrl'],_0x28bd98);_0x4ada73?await this['_readStreamableResponse'](_0x1bbf7,_0x4fe5eb,_0x43306c):await this['_readStaticResponse'](_0x1bbf7,_0x4fe5eb,_0x43306c);}async['_processAWSRequest'](_0x330989,_0x2d1114,_0x4f2f31,_0x3ed585){const _0x3d992f=new _0x36fb8e(this['_bedrockClientConfig']),_0x6bddb={'body':JSON['stringify'](_0x330989),'contentType':'application/json','accept':'application/json','modelId':_0x2d1114};let _0x3c7f92;if(_0x4f2f31){const _0x5d4a8d=new _0x4ad069(_0x6bddb);_0x3c7f92=await _0x3d992f['send'](_0x5d4a8d,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3c7f92,_0x2d1114,_0x3ed585);}else{const _0x2dbcc3=new _0x4dfa45(_0x6bddb);_0x3c7f92=await _0x3d992f['send'](_0x2dbcc3,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3c7f92,_0x2d1114,_0x3ed585);}}async['_readAsyncIterableResponse'](_0x4b2195,_0x425ac2,_0x1f9f8a){const _0x504edb=_0x4b2195['body'],_0x2cd8ba=new TextDecoder('utf-8');let _0x3b9ebe='';for await(const _0x371af4 of _0x504edb)if(_0x371af4['chunk']){const _0xba5e1b=_0x2cd8ba['decode'](_0x371af4['chunk']['bytes']),_0x2fff6c=JSON['parse'](_0xba5e1b);_0x3b9ebe+=this['_getGeneratedText'](_0x2fff6c,_0x425ac2),_0x1f9f8a(_0x3b9ebe);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5c9e3b,_0x390c5a,_0x2448f3){const _0x49cf11=_0x5c9e3b['body'],_0x47e0d1=new TextDecoder('utf-8'),_0x1ead38=_0x49cf11['getReader']();let _0x527a5a='',_0x124953='',_0x4df289=!0x1;for(;!_0x4df289;){const {done:_0x34864c,value:_0x317247}=await _0x1ead38['read']();if(_0x4df289=_0x34864c,_0x4df289)break;const _0xc42f11=(_0x527a5a+_0x47e0d1['decode'](_0x317247))['split']('\x0a')['map'](_0x3d6ca1=>{try{return _0x527a5a='',JSON['parse'](_0x3d6ca1);}catch{return _0x527a5a=_0x3d6ca1,null;}})['filter'](_0x4e0dbb=>null!==_0x4e0dbb);_0xc42f11['length']&&(_0x124953+=_0xc42f11['map'](_0x499f8c=>this['_getGeneratedText'](_0x499f8c,_0x390c5a))['join'](''),_0x2448f3(_0x124953));}return Promise['resolve']();}async['_readStaticResponse'](_0x229475,_0x3604e3,_0x349d9b){let _0x4c2e5f;return _0x4c2e5f=_0x229475 instanceof Response?await _0x229475['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x229475['body'])),(_0x349d9b(this['_getGeneratedText'](_0x4c2e5f,_0x3604e3)),Promise['resolve']());}['_getGeneratedText'](_0x14881e,_0x1f5dd5){switch(this['getModelFamily'](_0x1f5dd5)){case'anthropic.claude':return _0x14881e['completion'];case'ai21.j2':return _0x14881e['completions'][0x0]['data']['text'];case'cohere.command':return _0x14881e['generations'][0x0]['text'];case'meta.llama':return _0x14881e['generation'];}}}class Qs extends _0x3678e7{constructor(_0x57cede,_0x94779e={}){super(_0x57cede),this['isToggleable']=!0x0,this['set']('side',_0x94779e['side']||'top');const _0x3ae7f6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x256e93(_0x94779e['class']||[]),_0x3ae7f6['to']('side',_0x284a95=>'ck-tab-button_'+_0x284a95),_0x3ae7f6['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Us extends _0x179f2b{['children'];constructor(_0x448f48,_0x303283={}){super(_0x448f48);const _0x5d6ed7=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x256e93(_0x303283['class']||[]),_0x5d6ed7['to']('class'),_0x5d6ed7['if']('isVisible','ck-hidden',_0x3bb717=>!_0x3bb717)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Zt extends _0x179f2b{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x597762,_0x4e7049={}){super(_0x597762),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x4e7049['side']||'top'),this['set']('isMaximized',!0x1);const _0x3e646d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x256e93(_0x4e7049['class']||[]),_0x3e646d['to']('side',_0x4c884c=>'ck-tabs_'+_0x4c884c),_0x3e646d['to']('class'),_0x3e646d['to']('isMaximized',_0x1f8a07=>_0x1f8a07?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3e646d['to']('side',_0x5a76b1=>'ck-tabs__buttons-container_'+_0x5a76b1)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3e646d['to']('side',_0x11f913=>'ck-tabs__panels-container_'+_0x11f913)]},'children':this['panelViews']},..._0x256e93(_0x4e7049['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x3f4627){const _0x3f512c=this['_tabs']['get'](_0x3f4627);return _0x3f512c||null;}['addTab'](_0x49d2a6){const _0x2bc4ab=this['_setupButton']({'id':_0x49d2a6['id'],'label':_0x49d2a6['buttonLabel'],'icon':_0x49d2a6['buttonIcon'],'order':_0x49d2a6['order']}),_0xfa7101=new Us(this['locale']);return _0xfa7101['render'](),_0x49d2a6['content']&&_0xfa7101['children']['add'](_0x49d2a6['content']),this['panelViews']['add'](_0xfa7101),this['_tabs']['set'](_0x49d2a6['id'],{'button':_0x2bc4ab,'panel':_0xfa7101,'order':void 0x0!==_0x49d2a6['order']?_0x49d2a6['order']:null}),this['fire']('addTab:'+_0x49d2a6['id'],{'id':_0x49d2a6['id'],'button':_0x2bc4ab,'panel':_0xfa7101}),null===this['activeTab']?this['activateTab'](_0x49d2a6['id']):this['_hidePanel'](_0x49d2a6['id']),{'button':_0x2bc4ab,'panel':_0xfa7101};}['activateTab'](_0x561933){if(null!==_0x561933&&!this['getTab'](_0x561933))throw new _0x516722('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x561933});this['activeTab']!==_0x561933&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x561933,_0x561933&&this['_showPanel'](_0x561933),this['fire']('activateTab:'+_0x561933,_0x561933));}['showTab'](_0x232423){if(!this['getTab'](_0x232423))throw new _0x516722('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x232423});this['_showPanel'](_0x232423),this['_showButton'](_0x232423),this['fire']('show:'+_0x232423,_0x232423);}['hideTab'](_0x3050d4){if(!this['getTab'](_0x3050d4))throw new _0x516722('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3050d4});const _0x54af73=this['activeTab'];this['_hidePanel'](_0x3050d4),this['_hideButton'](_0x3050d4);const _0x556bf3=this['getTabIds']();_0x54af73===_0x3050d4&&_0x556bf3['length']>0x1&&this['activateTab'](_0x556bf3['find'](_0x38d6ca=>_0x38d6ca!==_0x3050d4)),this['fire']('hide:'+_0x3050d4,_0x3050d4);}['_getPanel'](_0x57aa96){const _0x468bb5=this['_tabs']['get'](_0x57aa96);return _0x468bb5?_0x468bb5['panel']:null;}['_showPanel'](_0x3d1a7e){null!==this['activeTab']&&this['activeTab']!==_0x3d1a7e||this['_getPanel'](_0x3d1a7e)['show']();}['_hidePanel'](_0x31ae62){const _0x69fa12=this['_getPanel'](_0x31ae62);_0x69fa12['isVisible']&&(this['activeTab']===_0x31ae62&&(this['activeTab']=null),_0x69fa12['hide']());}['_getButton'](_0x33cb28){const _0x3702a4=this['_tabs']['get'](_0x33cb28);return _0x3702a4?_0x3702a4['button']:null;}['_showButton'](_0x1e78a7){this['_getButton'](_0x1e78a7)['show']();}['_hideButton'](_0x3d2608){this['_getButton'](_0x3d2608)['hide']();}['_setupButton'](_0x5bad14){const _0x3c158a=new Qs(this['locale'],{'side':this['side']}),_0x2c6cac=this['buttonViews'];if(_0x3c158a['set']({'label':_0x5bad14['label'],'icon':_0x5bad14['icon'],'tooltip':!0x0,'withText':!0x0}),_0x3c158a['bind']('isOn')['to'](this,'activeTab',_0x43513d=>_0x43513d===_0x5bad14['id']),_0x3c158a['bind']('side')['to'](this,'side'),_0x5bad14['order']){const _0x58a7e5=[...this['_tabs']]['reduce']((_0x25dae8,_0xa3779d)=>{const _0x2e064a=_0xa3779d[0x0],{order:_0x645547}=_0xa3779d[0x1];return!_0x645547||_0x645547>_0x5bad14['order']?_0x25dae8:_0x645547>=_0x25dae8['order']?{'id':_0x2e064a,'order':_0x645547}:_0x25dae8;},{'id':'','order':0x0}),_0x1406fb=_0x2c6cac['getIndex'](this['_getButton'](_0x58a7e5['id']));_0x2c6cac['add'](_0x3c158a,_0x1406fb+0x1);}else _0x2c6cac['add'](_0x3c158a);return _0x3c158a['on']('execute',()=>{this['activateTab'](_0x5bad14['id']);}),_0x3c158a;}}const pi=['overlay','sidebar','custom'],di=['left','right'];class ui extends Zt{constructor(_0x1e32f9,_0x17c587={}){super(_0x1e32f9,_0x17c587),this['set']('type',_0x17c587['type']||'sidebar'),this['set']('side',_0x17c587['side']||'right');const _0x40dd12=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x40dd12['if']('type','ck-ai-tabs__overlay',_0x141553=>'overlay'===_0x141553),_0x40dd12['if']('type','ck-ai-tabs__sidebar',_0x3dee6e=>'sidebar'===_0x3dee6e)]}}),this['buttonViews']['on']('add',(_0x511415,_0x52817e)=>{_0x52817e['set']('withText',!0x1);});}}class rt extends _0x150b32{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b6910){super(_0x2b6910);const _0x11103b=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x11103b)throw new _0x516722('ai-tabs-configuration-not-found');if(void 0x0!==_0x11103b['showResizeButton']&&(this['showResizeButton']=_0x11103b['showResizeButton']),'sidebar'!==_0x11103b['type']&&'overlay'!==_0x11103b['type']||_0x11103b['side']&&(this['side']=_0x11103b['side']),'sidebar'===_0x11103b['type']){if(this['container']=_0x11103b['element'],this['set']('type','sidebar'),!this['container'])throw new _0x516722('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x11103b['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']}),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 st&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x1bbaed){if(_0x1bbaed&&this['type']!==_0x1bbaed){if(!pi['includes'](_0x1bbaed))throw new _0x516722('ai-tabs-unsupported-ui-type');this['type']=_0x1bbaed;}}['switchSide'](_0x2969e2){if(_0x2969e2&&this['side']!==_0x2969e2){if(!di['includes'](_0x2969e2))throw new _0x516722('ai-tabs-unsupported-ui-side');this['side']=_0x2969e2;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}function Vn(_0x278374,_0x515d8a,_0x23832f){const t=_0x278374['t'];switch(_0x515d8a){case'AI_SUGGESTION_HEADER_TITLE':return t({'id':'AI_SUGGESTION_HEADER_TITLE','string':'Suggested\x20content'});case'AI_SUGGESTION_BUTTON_SHOW_CHANGES':return t({'id':'AI_SUGGESTION_BUTTON_SHOW_CHANGES','string':'Show\x20changes'});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':'Suggestion\x20%0'},_0x23832f);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Show\x20in\x20the\x20text'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Delete'});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':'AI\x20Chat'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x23832f);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.'},_0x23832f);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.'},_0x23832f);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20performing\x20deep\x20research\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\x20performing\x20deep\x20research\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':'Thought\x20for\x20a\x20few\x20minutes'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'Took\x20a\x20moment\x20to\x20think\x20and\x20search\x20the\x20web'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Show\x20change\x20in\x20text','plural':'Show\x20changes\x20in\x20text'},_0x23832f);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Insert\x20suggestion','plural':'Insert\x20suggestions'},_0x23832f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x23832f);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20suggestion','plural':'Apply\x20all\x20suggestions'},_0x23832f);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x23832f);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\x20a\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x23832f);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\x20is\x20currently\x20empty.\x20After\x20you\x20create\x20some\x20conversations,\x20you\x20will\x20be\x20able\x20to\x20revisit\x20them\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':'Sorry,\x20we\x20couldn\x27t\x20change\x20the\x20\x22%0\x22\x20chat\x20name.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x23832f);case'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED':return t({'id':'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','string':'Sorry,\x20we\x20couldn\x27t\x20%0\x20the\x20\x22%1\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x23832f);case'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM':return t({'id':'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','string':'Sorry,\x20we\x20couldn\x27t\x20delete\x20the\x20\x22%0\x22\x20chat.\x20Please\x20try\x20again\x20in\x20a\x20moment.'},_0x23832f);case'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS':return t({'id':'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20chat\x20history.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_CHAT_HISTORY_ERROR_GENERIC':return t({'id':'AI_CHAT_HISTORY_ERROR_GENERIC','string':'Something\x20went\x20wrong.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});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_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'The\x20suggestion\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20it\x20correctly..'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20suggestions\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20them\x20correctly.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Try\x20again'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20the\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20for\x20faster,\x20more\x20cost-efficient\x20responses'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});default:return _0x515d8a;}}class o extends _0x150b32{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3939f0){super(_0x3939f0),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 _0x4ec3dd=this['context']['plugins']['get']('CloudServices');if(!_0x4ec3dd['token'])throw new _0x516722('ai-missing-token',this);this['_token']=_0x4ec3dd['token'];}['startConversation'](_0x439eca,_0x49838d){const _0x444413=this['_sendApiRequest']('/conversations','POST',{'id':_0x439eca,'group':_0x49838d});return{'getConversation':async()=>(await _0x444413['request'])['json'](),'abortController':_0x444413['abortController']};}['queryAssistant']({message:_0x1f8f08,conversationId:_0x2c12a6,parts:_0x279baa,capabilities:_0x40f356,model:_0x3f87f8,quickActionData:_0x9e3ddc}){const _0x173850={..._0x9e3ddc&&{'quickActionData':_0x9e3ddc}},_0x52d365={'prompt':_0x1f8f08,'content':_0x279baa,'model':_0x3f87f8,..._0x40f356&&{'capabilities':_0x40f356},...Object['keys'](_0x173850)['length']>0x0&&{'attributes':_0x173850}},_0x534e79=this['_sendApiRequest']('/conversations/'+_0x2c12a6+'/messages','POST',_0x52d365);return{'getStream':async()=>{const _0x34fc7b=(await _0x534e79['request'])['body'];return this['_getStreamReader'](_0x34fc7b);},'abortController':_0x534e79['abortController']};}['executeCustomAction']({content:_0x38fe56,message:_0x2013dc,model:_0x5a1671,outputFormat:_0x1558c8}){const _0x2da833={'content':[{'type':'text','content':_0x38fe56}],'prompt':_0x2013dc,'model':_0x5a1671,'outputFormat':_0x1558c8},_0x42674b=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2da833);return{'getStream':async()=>{const _0x2604cb=(await _0x42674b['request'])['body'];return this['_getStreamReader'](_0x2604cb);},'abortController':_0x42674b['abortController']};}['executeAction']({actionName:_0x26f1c2,content:_0x5b750d,args:_0x4b157e}){const _0x4dd4af={'content':[{'type':'text','content':_0x5b750d}],'args':_0x4b157e},_0x4ef4e4=this['_sendApiRequest']('/actions/system/'+_0x26f1c2+'/calls','POST',_0x4dd4af);return{'getStream':async()=>{const _0x2d444e=(await _0x4ef4e4['request'])['body'];return this['_getStreamReader'](_0x2d444e);},'abortController':_0x4ef4e4['abortController']};}['uploadFile'](_0x5ba733,_0x5a7c87,_0x41b6c6){const _0x14ade6=new FormData();_0x14ade6['append']('file',_0x5a7c87,_0x5a7c87['name']),_0x41b6c6&&_0x14ade6['append']('attributes',JSON['stringify'](_0x41b6c6));const _0x2a5a73=this['_sendApiRequest']('/conversations/'+_0x5ba733+'/files','POST',_0x14ade6);return{'getId':async()=>(await _0x2a5a73['request'])['json'](),'abortController':_0x2a5a73['abortController']};}['fetchDocument'](_0x254e7d,_0x36c57a){const _0x41bc76=this['_sendApiRequest']('/conversations/'+_0x254e7d+'/documents/'+_0x36c57a,'GET');return{'getDocument':async()=>(await _0x41bc76['request'])['json'](),'abortController':_0x41bc76['abortController']};}['uploadDocument'](_0x231045,_0x377635,_0xfdbfee){const _0x20aca6={'content':_0x377635};_0xfdbfee&&(_0x20aca6['attributes']=_0xfdbfee);const _0x5c5174=this['_sendApiRequest']('/conversations/'+_0x231045+'/documents','POST',_0x20aca6);return{'getId':async()=>(await _0x5c5174['request'])['json'](),'abortController':_0x5c5174['abortController']};}['fetchConversations'](_0x4fba95,_0x23fb50){const _0x16d72d=new URLSearchParams();_0x16d72d['append']('excludeEmpty','true'),_0x16d72d['append']('limit','100'),_0x16d72d['append']('group',_0x4fba95),_0x23fb50&&_0x16d72d['append']('search',_0x23fb50);const _0x3b3adb=this['_sendApiRequest']('/conversations?'+_0x16d72d['toString'](),'GET');return{'getConversations':async()=>{const _0x594ef2=await _0x3b3adb['request'];return(await _0x594ef2['json']())['items'];},'abortController':_0x3b3adb['abortController']};}['deleteConversation'](_0x2460d5){const _0x3481a6=this['_sendApiRequest']('/conversations/'+_0x2460d5,'DELETE');return{'execute':async()=>{await _0x3481a6['request'];},'abortController':_0x3481a6['abortController']};}['updateConversation'](_0x5d82c7,_0x2bcc01){const _0x417198=this['_sendApiRequest']('/conversations/'+_0x5d82c7,'PATCH',_0x2bcc01);return{'getResult':async()=>(await _0x417198['request'],_0x2bcc01),'abortController':_0x417198['abortController']};}['fetchConversation'](_0x27b840){const _0x5a1caa=this['_sendApiRequest']('/conversations/'+_0x27b840,'GET');return{'getConversation':async()=>(await _0x5a1caa['request'])['json'](),'abortController':_0x5a1caa['abortController']};}['fetchConversationMessages'](_0x38f68b){const _0x20b8d5=this['_sendApiRequest']('/conversations/'+_0x38f68b+'/messages','GET');return{'getMessages':async()=>{const _0x2664f0=await _0x20b8d5['request'];return(await _0x2664f0['json']())['items'];},'abortController':_0x20b8d5['abortController']};}['uploadUrl'](_0x25b7c8,_0x33ee81,_0x1d8eb2){const _0x41c238=this['_sendApiRequest']('/conversations/'+_0x25b7c8+'/web-resources','POST',{'url':_0x33ee81,'attributes':_0x1d8eb2});return{'getId':async()=>(await _0x41c238['request'])['json'](),'abortController':_0x41c238['abortController']};}['getModels'](){const _0x5494b6=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x12a51e=await(await _0x5494b6['request'])['json'](),_0x212bf4=_0x12a51e['items']['map'](_0x184ec9=>({..._0x184ec9,'description':Vn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x184ec9['id']['toUpperCase']())}));return{..._0x12a51e,'items':_0x212bf4};},'abortController':_0x5494b6['abortController']};}['deleteFile'](_0x36db4b,_0x452492){const _0x5a671c=this['_sendApiRequest']('/conversations/'+_0x36db4b+'/files/'+_0x452492,'DELETE');return{'execute':async()=>{await _0x5a671c['request'];},'abortController':_0x5a671c['abortController']};}['deleteDocument'](_0x2d50e2,_0x593ed3){const _0x4ae8da=this['_sendApiRequest']('/conversations/'+_0x2d50e2+'/documents/'+_0x593ed3,'DELETE');return{'execute':async()=>{await _0x4ae8da['request'];},'abortController':_0x4ae8da['abortController']};}['deleteWebResource'](_0xe860fb,_0x4ca957){const _0x475f09=this['_sendApiRequest']('/conversations/'+_0xe860fb+'/web-resources/'+_0x4ca957,'DELETE');return{'execute':async()=>{await _0x475f09['request'];},'abortController':_0x475f09['abortController']};}['callSystemReview']({reviewName:_0x53465c,content:_0x1d8c71,args:_0x19a614}){const _0x2fcc1e=this['_sendApiRequest']('/reviews/system/'+_0x53465c+'/calls','POST',{'content':[{'type':'text','content':_0x1d8c71}],'args':_0x19a614});return{'getStream':async()=>{const _0x405980=(await _0x2fcc1e['request'])['body'];return this['_getStreamReader'](_0x405980);},'abortController':_0x2fcc1e['abortController']};}['callCustomReview']({content:_0x1b668e,prompt:_0x18d7a0,model:_0x1c93a6}){const _0x59f921=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1b668e}],'prompt':_0x18d7a0,'model':_0x1c93a6});return{'getStream':async()=>{const _0xad1e60=(await _0x59f921['request'])['body'];return this['_getStreamReader'](_0xad1e60);},'abortController':_0x59f921['abortController']};}['_sendApiRequest'](_0x6a30cd,_0x350c1b,_0x483df7){const _0x4c1fb0=new AbortController(),_0x3b1e5f=_0x483df7 instanceof FormData,_0x2b6e13={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x483df7&&!_0x3b1e5f&&(_0x2b6e13['Content-Type']='application/json');const _0x2499d9={'method':_0x350c1b,'headers':_0x2b6e13,'signal':_0x4c1fb0['signal']};return _0x483df7&&(_0x2499d9['body']=_0x3b1e5f?_0x483df7:JSON['stringify'](_0x483df7)),{'request':fetch(''+this['_apiUrl']+_0x6a30cd,_0x2499d9)['catch'](_0x412542=>{this['_handleError'](_0x412542);})['then'](_0x4abbe4=>{if(!_0x4abbe4['ok'])throw new _0x516722('ai-request-failed',this);return _0x4abbe4;}),'abortController':_0x4c1fb0};}async*['_getStreamReader'](_0x220ff5){const _0x4b3e74=[],_0x477894=_0x220ff5['getReader'](),_0x22168d=wt({'onError':_0xc15258=>{this['_handleError'](_0xc15258);},'onEvent':_0x4ab02f=>{_0x4ab02f['data']=JSON['parse'](_0x4ab02f['data']),_0x4b3e74['push'](_0x4ab02f);}});try{let _0x134c00=!0x1;for(;!_0x134c00;){const {done:_0x4b762c,value:_0x59eca7}=await _0x477894['read']();_0x4b762c&&(_0x134c00=!0x0),_0x22168d['feed'](this['_decoder']['decode'](_0x59eca7,{'stream':!0x0})),yield*_0x4b3e74,_0x4b3e74['length']=0x0;}}catch(_0x4be42a){this['_handleError'](_0x4be42a);}finally{_0x477894['releaseLock'](),_0x22168d['reset']();}}['_handleError'](_0x160ff4){if(_0x160ff4 instanceof _0x516722)throw _0x160ff4;if(_0x160ff4 instanceof Error&&'AbortError'===_0x160ff4['name'])throw new _0x516722('ai-request-aborted',this,{'originalError':_0x160ff4});throw new _0x516722('ai-request-failed',this,{'originalError':_0x160ff4});}}function As(_0x2e58ce,_0x21c183){const _0x3f83dc=new _0x3678e7(_0x2e58ce),_0x3290f1=Vn(_0x2e58ce,'AI_TABS_LABEL_MINIMIZE'),_0x5b19a4=Vn(_0x2e58ce,'AI_TABS_LABEL_MAXIMIZE');return _0x3f83dc['set']({'withText':!0x1,'icon':_0x271b92,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x3f83dc['bind']('label')['to'](_0x21c183,'isMaximized',_0x5cb8a4=>_0x5cb8a4?_0x3290f1:_0x5b19a4),_0x3f83dc['bind']('icon')['to'](_0x21c183,'isMaximized',_0x12003b=>_0x12003b?_0x51140d:_0x271b92),_0x3f83dc['bind']('isOn')['to'](_0x21c183,'isMaximized'),_0x3f83dc['on']('execute',()=>{_0x21c183['fire']('resizeTabs');}),_0x3f83dc;}function Ye(_0x9cef8d){return _0x188e5f(_0x9cef8d);}function ft(_0x497d51){return _0x2d3ed1(_0x497d51);}function _t(_0x1a842e,_0x3cd6b4,_0x14491e){const _0x22acd4=null!==_0x3cd6b4?_0x4326d3=>_0x4326d3['attribs'][_0x1a842e]===_0x3cd6b4:_0x5ad146=>Boolean(_0x5ad146['attribs'][_0x1a842e]);return ut(_0x26c6af=>_0x40109d(_0x26c6af)&&_0x22acd4(_0x26c6af),_0x14491e);}function Ne(_0x1b53e1,_0xa53653,_0x217f12){const _0x97d826=null!==_0xa53653?_0xc9eabd=>_0xc9eabd['attribs'][_0x1b53e1]===_0xa53653:_0xcbcef2=>Boolean(_0xcbcef2['attribs'][_0x1b53e1]);return _0x427efa(_0x370617=>_0x40109d(_0x370617)&&_0x97d826(_0x370617),_0x217f12);}function mt(_0x4e61b9,_0x4741a8){return _0x4e61b9&&_0x40109d(_0x4e61b9)?_0x4e61b9['attribs'][_0x4741a8]:null;}function He(_0xe88c,_0x31330a,_0x3258d6){_0x40109d(_0xe88c)&&(null===_0x3258d6?delete _0xe88c['attribs'][_0x31330a]:_0xe88c['attribs'][_0x31330a]=_0x3258d6);}function We(_0x4b6e2c,_0x19b1f5,_0x1dbd30){const _0x17a964=_0x19b1f5['cloneNode'](!0x0);'beforebegin'===_0x1dbd30?_0x8a3d6b(_0x4b6e2c,_0x17a964):'afterbegin'===_0x1dbd30?to(_0x4b6e2c,_0x17a964):'beforeend'===_0x1dbd30?_0x1c446e(_0x4b6e2c,_0x17a964):'afterend'===_0x1dbd30&&_0x422718(_0x4b6e2c,_0x17a964);}function Te(_0x18e37c){const _0x2405e6=[];let _0x593233=_0x18e37c;for(;_0x593233;)_0x593233=_0x70b7d4(_0x593233),_0x593233&&_0x2405e6['push'](_0x593233);return _0x2405e6;}function Bn(_0x4ecf25){return _0x4ecf25['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Me(_0x4a688d){let _0x15faad=0x0;for(;_0x4a688d['parentNode'];)_0x4a688d=_0x4a688d['parentNode'],_0x15faad++;return _0x15faad;}function Qe(_0x5a1846){const _0x17ed71=[];let _0x1ae028=_0x5a1846['nextSibling'];for(;_0x1ae028;)_0x17ed71['push'](_0x1ae028),_0x1ae028=_0x1ae028['nextSibling'];_0x17ed71['forEach'](_0x2faa67=>{_0x975f(_0x2faa67);});}class Ge extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
_0x3a17ed(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x163ed8){super(),this['_generateUid']=_0x163ed8||_0x215bb4;}['merge'](_0x298325,_0x323f0e,_0x455f40){const _0x2ead45=_0x298325['cloneNode'](!0x0);if(0x0===_0x323f0e['childNodes']['length']){const _0x24ef18=[];return Ne('data-id','new-element',_0x2ead45)['forEach'](_0x1e1073=>{const _0x41fcb9=this['_generateUid']();He(_0x1e1073,'data-id',_0x41fcb9),_0x24ef18['push'](_0x41fcb9);}),this['_removeSpecialComments'](_0x2ead45),{'parsedContent':_0x2ead45,'newNodeIds':_0x24ef18,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x455f40&&_0x455f40['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2ead45),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ne('data-id',null,_0x323f0e)['map'](_0x3edc76=>mt(_0x3edc76,'data-id'))['filter'](_0x3a33c8=>!!_0x3a33c8));let _0x378490=-0x1,_0x5c84e3=!0x1;const _0x1a1225=_0x2ead45['childNodes'],_0x10becf=Array['from'](_0x1a1225)['filter'](_0x618fee=>!(0x3===_0x618fee['nodeType']&&''===ft(_0x618fee)['trim']())),_0x47ce08=_0x10becf['length'];for(let _0x52f122=0x0;_0x52f122<_0x47ce08;_0x52f122++){const _0x20956a=_0x10becf[_0x52f122],_0x3f519c=_0x10becf[_0x52f122+0x1];if(this['_isNewNode'](_0x20956a)){if(-0x1===_0x378490&&(_0x378490=_0x52f122),this['_markWrappedElements'](_0x20956a),!this['_isNewNode'](_0x3f519c)){const [_0x3d20b8,_0x7745e9]=this['_findReferenceNode'](_0x20956a,_0x5c84e3,_0x323f0e);if(_0x3d20b8){const _0x56bc03=Array['from'](_0x10becf)['slice'](_0x378490,_0x52f122+0x1);this['_insertNodes'](_0x3d20b8,_0x56bc03,_0x7745e9),_0x378490=-0x1;}}}else{if(this['_isExistingContentComment'](_0x20956a))_0x5c84e3=!0x0;else{if(this['_isExistingNode'](_0x20956a)){const _0x30a4f3=mt(_0x20956a,'data-id');if(_0x30a4f3&&this['_existingDataIds']['has'](_0x30a4f3)){const _0x4acfd5=_t('data-id',_0x30a4f3,_0x323f0e);this['_replaceNode'](_0x4acfd5,_0x20956a);}if(this['_touchedNodesState']['removedIds']['includes'](_0x30a4f3)){const _0x7b89d3=this['_touchedNodesState']['removedIds']['indexOf'](_0x30a4f3);this['_touchedNodesState']['removedIds']['splice'](_0x7b89d3,0x1);}}else{if(this['_isDelNode'](_0x20956a)){const _0x5d72f6=mt(_0x20956a,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x5d72f6)||this['_storeDeletedElementIds'](_0x20956a);}}}}}for(const _0x50db41 of this['_touchedNodesState']['removedIds']){const _0x43d8c4=_t('data-id',_0x50db41,_0x323f0e);if(_0x43d8c4){if(_0x455f40&&_0x455f40['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x50db41;const _0x599f20=_0x455f40['replaceRemovedWith']['cloneNode'](!0x0);He(_0x599f20,'data-id',_0x50db41),He(_0x599f20,'data-removed','true'),_0x50e8e9(_0x43d8c4,_0x599f20);}else _0x975f(_0x43d8c4);}}if(Ne('data-wrapped-id',null,_0x323f0e)['forEach'](_0x2e669f=>{const _0x507d80=_t('data-id',mt(_0x2e669f,'data-wrapped-id'),_0x323f0e);var _0x978347,_0x4c2cd;_0x507d80&&(_0x4c2cd=_0x2e669f,_0x975f(_0x978347=_0x507d80),_0x50e8e9(_0x4c2cd,_0x978347));}),Ne('data-id','new-element',_0x323f0e)['forEach'](_0xd5c0d6=>{const _0x125601=this['_getUid'](_0xd5c0d6);He(_0xd5c0d6,'data-id',_0x125601),this['_touchedNodesState']['newIds']['push'](_0x125601);}),this['_removeSpecialComments'](_0x323f0e),_0x455f40&&_0x455f40['markUnstableElements']&&this['_markUnstableElements'](_0x323f0e,_0x455f40['markUnstableElementsDepth']||0x0),_0x455f40&&_0x455f40['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x3dc635=_t('data-id',this['_touchedNodesState']['lastTouchedId'],_0x323f0e);for(;_0x3dc635;)Qe(_0x3dc635),_0x3dc635=_0x3dc635['parentNode'];}return{'parsedContent':_0x323f0e,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x20ca4f,_0xc8407d,_0x14a21a){for(const _0x26a945 of _0xc8407d){const _0x15683b=this['_getUid'](_0x26a945);He(_0x26a945,'data-id',_0x15683b),this['_touchedNodesState']['newIds']['push'](_0x15683b),this['_touchedNodesState']['lastTouchedId']=_0x15683b;}const _0xa1f038='afterbegin'===_0x14a21a||'afterend'===_0x14a21a?_0xc8407d['reverse']():_0xc8407d;for(const _0x3f1f99 of _0xa1f038)We(_0x20ca4f,_0x3f1f99,_0x14a21a);}['_replaceNode'](_0x281cfb,_0x4c0cfb){if(!_0x281cfb)return;if(_0x444109=_0x4c0cfb,Bn(ft(_0x281cfb))===Bn(ft(_0x444109)))return;var _0x444109;const _0x33ccd5=this['_getUid'](_0x281cfb);He(_0x4c0cfb,'data-id',_0x33ccd5),this['_touchedNodesState']['modifiedIds']['push'](_0x33ccd5),this['_touchedNodesState']['lastTouchedId']=_0x33ccd5,_0x50e8e9(_0x281cfb,_0x4c0cfb['cloneNode'](!0x0));}['_findReferenceNode'](_0x22c0cf,_0x510fb0,_0x51184a){const _0x18c397=this['_findPrevElementWithDataId'](_0x22c0cf,!0x1);if(_0x18c397){const _0x23458e=this['_getNodeDataId'](_0x18c397),_0x386145=_t('data-id',_0x23458e,_0x51184a);if(_0x386145)return[_0x386145,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x23458e);}const _0x47f3b3=this['_findNextElementWithDataId'](_0x22c0cf,!0x1);if(_0x47f3b3){const _0x450eaf=this['_getNodeDataId'](_0x47f3b3),_0x55a78f=_t('data-id',_0x450eaf,_0x51184a);if(_0x55a78f)return[_0x55a78f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x450eaf);}return _0x510fb0?_0x22c0cf['nextSibling']?this['_findFallbackReferenceNode'](_0x22c0cf,_0x51184a):[_0x51184a['childNodes'][_0x51184a['childNodes']['length']-0x1],'afterend']:[_0x51184a['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x250fd3,_0xf3cb50){const _0x23b126=[],_0x18b887=this['_findPrevElementWithDataId'](_0x250fd3,!0x0);if(_0x18b887){const _0x273e2b=_t('data-id',this['_getNodeDataId'](_0x18b887),_0xf3cb50);_0x273e2b&&_0x23b126['push']([_0x273e2b,'afterend']);}const _0xecd1e1=this['_findNextElementWithDataId'](_0x250fd3,!0x0);if(_0xecd1e1){const _0x2f3411=_t('data-id',this['_getNodeDataId'](_0xecd1e1),_0xf3cb50);_0x2f3411&&_0x23b126['push']([_0x2f3411,'beforebegin']);}if(_0x23b126['length']>0x1)return Me(_0x23b126[0x0][0x0])<=Me(_0x23b126[0x1][0x0])?_0x23b126[0x0]:_0x23b126[0x1];return 0x1===_0x23b126['length']?_0x23b126[0x0]:[_0xf3cb50['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x28638c,_0x39286a){let _0x2c9036=_0x28638c['nextSibling'],_0x2ed9d8=null,_0x44d9d8=!0x1;for(;_0x2c9036;){if(_0x3880e8(_0x2c9036)){if(this['_isDelNode'](_0x2c9036)&&(_0x2ed9d8=_0x2c9036),this['_isExistingContentComment'](_0x2c9036)&&_0x39286a&&!_0x44d9d8){_0x44d9d8=!0x0,_0x2c9036=_0x2c9036['nextSibling'];continue;}break;}const _0x23043c=mt(_0x2c9036,'data-id');if(_0x23043c&&'new-element'!==_0x23043c&&this['_existingDataIds']['has'](_0x23043c)){_0x2ed9d8=_0x2c9036;break;}_0x2c9036=_0x2c9036['nextSibling'];}return _0x2ed9d8;}['_findPrevElementWithDataId'](_0x24c05d,_0x575688){let _0x379a71=_0x24c05d['previousSibling'],_0x3b0b2a=null,_0x125cad=!0x1;for(;_0x379a71;){if(_0x3880e8(_0x379a71)){if(this['_isDelNode'](_0x379a71)&&(_0x3b0b2a=_0x379a71),this['_isExistingContentComment'](_0x379a71)&&_0x575688&&!_0x125cad){_0x125cad=!0x0,_0x379a71=_0x379a71['previousSibling'];continue;}break;}const _0x34aa1f=mt(_0x379a71,'data-id');if(_0x34aa1f&&'new-element'!==_0x34aa1f&&this['_existingDataIds']['has'](_0x34aa1f)){_0x3b0b2a=_0x379a71;break;}_0x379a71=_0x379a71['previousSibling'];}return _0x3b0b2a;}['_markWrappedElements'](_0x4e547a){_0x40109d(_0x4e547a)&&Ne('data-id',null,_0x4e547a)['forEach'](_0x1d317a=>{this['_isExistingNode'](_0x1d317a)&&!this['_hasWrappedParent'](_0x1d317a)&&(He(_0x1d317a,'data-wrapped-id',mt(_0x1d317a,'data-id')),He(_0x1d317a,'data-id',null));});}['_getNodeDataId'](_0x2190dd){if(!_0x2190dd)return null;if(_0x40109d(_0x2190dd))return mt(_0x2190dd,'data-id');if(_0x3880e8(_0x2190dd)){const _0xfef8a=ft(_0x2190dd)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0xfef8a&&_0xfef8a[0x1])return _0xfef8a[0x1];}return null;}['_storeDeletedElementIds'](_0xeef685){if(_0x3880e8(_0xeef685)){const _0x2af5b7=ft(_0xeef685)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x2af5b7&&_0x2af5b7[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x2af5b7[0x1]);}}['_getUid'](_0x2e1ba6){return this['_isExistingNode'](_0x2e1ba6)?mt(_0x2e1ba6,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x1573a3){(function(_0x4d298a){return _0x274df0(_0x2e506a=>_0x3880e8(_0x2e506a),_0x4d298a,!0x0,0x1/0x0);}(_0x1573a3)['filter'](_0x44edbd=>this['_isDelNode'](_0x44edbd)||this['_isExistingContentComment'](_0x44edbd))['forEach'](_0x3a7593=>{_0x975f(_0x3a7593);}));}['_markLastTagElementUnstable'](_0x402cc9){const _0xd7dce9=_0x402cc9['childNodes'],_0x1073d4=_0xd7dce9[_0xd7dce9['length']-0x1];_0x1073d4&&_0x40109d(_0x1073d4)&&He(_0x1073d4,'data-unstable','true');}['_markUnstableElements'](_0x202812,_0x158559){const _0x6a3405=_t('data-unstable','true',_0x202812);if(!_0x6a3405)return;const _0x1d1b65=Te(_0x6a3405)['slice'](0x0,-0x1),_0x663564=_0x1d1b65['length'];let _0x190811=_0x6a3405;if(_0x663564>_0x158559){let _0x2bec1b=_0x663564,_0x2b6abd=null;for(;_0x2bec1b>_0x158559&&_0x2bec1b>=0x0;)_0x2bec1b--,_0x2b6abd=_0x1d1b65[_0x2bec1b];_0x2b6abd&&(_0x190811=_0x2b6abd,He(_0x6a3405,'data-unstable',null),He(_0x2b6abd,'data-unstable','true'));}else{if(_0x663564<_0x158559){let _0x5d028c=_0x663564,_0x31a56d=_0x6a3405;for(;_0x5d028c<_0x158559;){const _0x3f4e4f=_0x31a56d['childNodes']['filter'](_0x1fb1dc=>_0x40109d(_0x1fb1dc));if(0x0===_0x3f4e4f['length'])break;_0x5d028c++,_0x31a56d=_0x3f4e4f[_0x3f4e4f['length']-0x1];}_0x31a56d&&(_0x190811=_0x31a56d,He(_0x6a3405,'data-unstable',null),He(_0x31a56d,'data-unstable','true'));}}let _0x2c2c1c=_0x190811;for(;_0x2c2c1c;){for(;_0x2c2c1c['nextSibling'];)_0x2c2c1c=_0x2c2c1c['nextSibling'],_0x40109d(_0x2c2c1c)&&He(_0x2c2c1c,'data-unstable','true');_0x2c2c1c=_0x2c2c1c['parentNode'];}}['_isNewNode'](_0xeffd77){return Boolean('new-element'===mt(_0xeffd77,'data-id'));}['_isExistingNode'](_0xbf4f57){return Boolean((mt(_0xbf4f57,'data-id')||'')['length']>0x0&&'new-element'!==mt(_0xbf4f57,'data-id'));}['_isDelNode'](_0x4908a1){return!!_0x4908a1&&Boolean(_0x3880e8(_0x4908a1)&&ft(_0x4908a1)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x4bb474){let _0x14a593=_0x4bb474['parentNode'];for(;_0x14a593;){if(mt(_0x14a593,'data-wrapped-id'))return!0x0;_0x14a593=_0x14a593['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x17d3d0){return Boolean(_0x3880e8(_0x17d3d0)&&ft(_0x17d3d0)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Yn=['modification-delta','text-delta'],Fn=['reasoning'];class fi extends _0x3a17ed(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new Ct([]);['parsedMergedContent']=new Ct([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x20fe35,content:_0x12e184='',isDone:_0x113e17=!0x1,interactionId:_0x3445e1,areActionsDisabled:_0x38c558,documentContextContent:_0x50dc5c,editor:_0x355209}){super(),this['id']=_0x215bb4(),this['interactionId']=_0x3445e1,this['type']=_0x20fe35,this['areActionsDisabled']=!!_0x38c558,this['editor']=_0x355209,this['aiResponseParser']=new Ge(),this['aiResponseApplier']=new Ue(),this['documentContextContent']=Ye(_0x50dc5c||''),this['set']('isDone',_0x113e17),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x12e184);}['appendContent'](_0x251559){this['set']('content',this['content']+_0x251559);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x50446d,_0x4edd46){this['changeGroups'][_0x50446d]['state']=_0x4edd46,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x50446d,'state':_0x4edd46});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4451a9=this['changeGroups'];this['updateChangeGroups']();const _0x498c06=function(_0x314ff3,_0x33fe00){const _0x39d0bc=[];for(const _0x100335 of _0x33fe00){const _0x4771a8=_0x314ff3[_0x100335['index']];_0x4771a8?_0x4771a8['changes']['length']!==_0x100335['changes']['length']?_0x39d0bc['push'](_0x100335):_0x4771a8['changes']['forEach']((_0xfd6c50,_0x3088ca)=>{const _0x4fd06e=_0x100335['changes'][_0x3088ca];_0xfd6c50['id']!==_0x4fd06e['id']&&_0x39d0bc['push'](_0x100335);}):_0x39d0bc['push'](_0x100335);}return _0x39d0bc;}(_0x4451a9,this['changeGroups']);(_0x498c06['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x498c06);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['updateChangeGroups'](){const _0x9601cd=new _0x2ccea4('p',{},[new _0x2ccea4('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3419c5('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x56ae9b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x9601cd,'cutAfterLastChange':!this['isDone']});if(!_0x56ae9b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x56ae9b['parsedContent'];let _0x151a77=[];if(_0x427efa(_0x2f9cd0=>{const _0x23b5f3=mt(_0x2f9cd0,'data-id');if(!_0x23b5f3||!_0x2b98cb(_0x23b5f3))return!0x1;const _0x4a3e40=[_0x2f9cd0,...Te(_0x2f9cd0)]['at'](-0x2);if(_0x2f9cd0!=_0x4a3e40){const _0x3df3a2=mt(_0x4a3e40,'data-id');_0x2b98cb(_0x3df3a2)||(_0x151a77['push']({'node':_0x4a3e40,'id':_0x3df3a2,'type':'modified'}),_0x56ae9b['modifiedNodeIds']['push'](_0x3df3a2));}else _0x56ae9b['modifiedNodeIds']['includes'](_0x23b5f3)?_0x151a77['push']({'node':_0x2f9cd0,'type':'modified','id':_0x23b5f3}):_0x56ae9b['newNodeIds']['includes'](_0x23b5f3)?_0x151a77['push']({'node':_0x2f9cd0,'type':'new','id':_0x23b5f3,'anchorId':mt(_0x2f9cd0['previousSibling'],'data-id')}):_0x151a77['push']({'node':_0x2f9cd0,'type':'removed','id':_0x23b5f3});return!0x0;},this['parsedMergedContent']),_0x151a77=_0x151a77['filter'](({node:_0x4741ca})=>[...Te(_0x4741ca),_0x4741ca]['every'](_0xa915a4=>!mt(_0xa915a4,'data-unstable'))),0x0==_0x151a77['length'])return;const _0x3b8be0=[[_0x151a77[0x0]]];for(let _0xa87bfe=0x1;_0xa87bfe<_0x151a77['length'];_0xa87bfe++){const _0x42d250=_0x3b8be0[_0x3b8be0['length']-0x1],_0x25f149=_0x42d250[_0x42d250['length']-0x1];_0x151a77[_0xa87bfe]['node']['previousSibling']==_0x25f149['node']&&'modified'!=_0x151a77[_0xa87bfe]['type']&&'modified'!=_0x25f149['type']?_0x42d250['push'](_0x151a77[_0xa87bfe]):_0x3b8be0['push']([_0x151a77[_0xa87bfe]]);}for(const _0x1dbdd4 of _0x3b8be0){const _0x59bd23=_0x1dbdd4[0x0],_0x11d8bc=_0x1dbdd4[_0x1dbdd4['length']-0x1],_0x407830=_0x5a515(_0x59bd23['node']['previousSibling']);_0x407830&&_0x1dbdd4['unshift'](_0x407830);const _0x2b7d11=_0x5a515(_0x11d8bc['node']['nextSibling']);_0x2b7d11&&_0x1dbdd4['push'](_0x2b7d11);}function _0x2b98cb(_0x2169db){return _0x56ae9b['modifiedNodeIds']['includes'](_0x2169db)||_0x56ae9b['newNodeIds']['includes'](_0x2169db)||_0x56ae9b['removedNodeIds']['includes'](_0x2169db);}function _0x5a515(_0x259cb3){if(_0x259cb3&&mt(_0x259cb3,'data-id')&&!mt(_0x259cb3,'data-unstable')){const _0xf1f891=mt(_0x259cb3,'data-id');if(!_0x2b98cb(_0xf1f891))return{'node':_0x259cb3,'type':'context','id':_0xf1f891};}return null;}this['changeGroups']=_0x3b8be0['map']((_0x56c234,_0x4cc5b9)=>({'changes':_0x56c234,'state':'pending','index':_0x4cc5b9}));}}function qi(_0x15838a){return Object['values'](Yn)['includes'](_0x15838a);}function Ui(_0xfe9bd4){return Fn['includes'](_0xfe9bd4);}function Gi(_0x4f9fa5){return'conversation-title'===_0x4f9fa5;}function Ji(_0x44c1a8){return'source'===_0x44c1a8;}const ne=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class oe extends _0x1f835a(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x149ee8,editor:_0x1b9296}){super(),this['id']=_0x215bb4(),this['connector']=_0x149ee8,this['isStopped']=!0x0,this['editor']=_0x1b9296;}async['start'](){let _0x593ee8;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x7299e5=await this['currentRequest']['getStream'](),_0x1a3135=[];for await(const _0x1427d7 of _0x7299e5){if(this['isStopped'])return;if('error'===_0x1427d7['event'])return void this['fire']('error',{'error':new _0x516722('ai-chat-interaction-error',this)});Gi(_0x1427d7['event'])&&this['setConversationTitle'](_0x1427d7['data']['conversationTitle'],!0x0),Ji(_0x1427d7['event'])?_0x1a3135['push'](_0x1427d7['data']['source']):qi(_0x1427d7['event'])?(_0x1427d7['event']!==_0x593ee8&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x1427d7['event'],'interactionId':this['id']}),_0x1a3135['length']>0x0&&(this['currentReply']['sources']=_0x1a3135['splice'](0x0)),_0x593ee8=_0x1427d7['event']),this['currentReply']['appendContent'](_0x1427d7['data']['textDelta'])):Ui(_0x1427d7['event'])||_0x170b6a('ai-interaction-invalid-event-type',{'chunk':_0x1427d7});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x404f01){return this['replies']['find'](_0x5a0e64=>_0x5a0e64['id']===_0x404f01);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2755b9=>_0x2755b9['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x3a00e0){const _0xe4742b=new fi({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x3a00e0});return this['replies']['push'](_0xe4742b),_0xe4742b['delegate'](...ne)['to'](this),this['fire']('replyCreated',_0xe4742b),_0xe4742b;}['setConversationTitle'](_0x523e8b,_0x146156=!0x1){this['fire']('setConversationTitle',_0x523e8b,_0x146156);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var ce=function(_0x198b01){return _0x198b01['FILE']='file',_0x198b01['DOCUMENT']='document',_0x198b01['URL']='web-resource',_0x198b01['TEXT']='text',_0x198b01['SELECTION']='selection',_0x198b01;}({}),Ie=function(_0x4757f4){return _0x4757f4['TEXT']='text',_0x4757f4['MARKDOWN']='markdown',_0x4757f4['HTML']='html',_0x4757f4;}({});const Ii=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class vi extends _0x3a17ed(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x41fda4,config:_0x3487a8,ownerId:_0x304b26}){super(),this['_connector']=_0x41fda4,this['_config']=_0x3487a8,this['_ownerId']=_0x304b26;}['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'](_0x155f50){const _0x552bb3=await this['_createContextItemFromContent'](_0x155f50);return this['_addToConversationContextItem'](_0x552bb3),'current-document'===_0x552bb3['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x552bb3;}async['_createContextItemFromContent'](_0x824b8e){if(_0x824b8e['type']===ce['DOCUMENT']){const _0x4d362e=await this['_connector']['fetchDocument'](this['_ownerId'],_0x824b8e['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x824b8e['type'],'content':_0x4d362e['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x4d362e['attributes']?.['version'],'sessionId':_0x4d362e['attributes']?.['sessionId']};}return{'id':_0x824b8e['id'],'uiId':_0x824b8e['id'],'label':_0x824b8e['attributes']?.['label']||_0x824b8e['name']||_0x824b8e['url']||_0x824b8e['id'],'type':_0x824b8e['type'],..._0x824b8e?.['attributes']?.['resourceId']?{'resourceId':_0x824b8e['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1cfa41){const _0x2d97fa=this['_pendingContextItems']['get'](_0x1cfa41);_0x2d97fa?.['isReadOnly']||this['_removeContextItem'](_0x1cfa41);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3d409f of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3d409f['uiId']);const _0x6cff45=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x6cff45&&this['_addContextItem']({..._0x6cff45,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3c1995){for(const _0x34de13 of _0x3c1995['values']())this['_addToConversationContextItem'](_0x34de13);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'](_0x4b37c8){return Array['from'](_0x4b37c8['values']())['map'](_0x535086=>this['_mapContextItemToRequestData'](_0x535086))['filter'](_0x112939=>null!==_0x112939);}async['addFilesToContext'](_0x18c47e,_0x3000dc,_0x405328=ce['FILE']){const _0x293c2f='files-'+_0x215bb4();this['_startUploadOperation'](_0x293c2f);try{await Promise['all'](_0x18c47e['map'](async _0x2776d4=>{const _0x7e5e3d='file-'+_0x215bb4(),_0x50f6fc=_0x14ded9(_0x2776d4['name']);try{this['_addContextItem']({'type':_0x405328,'label':_0x3000dc?.['label']||_0x50f6fc,'uiId':_0x7e5e3d,'resourceId':_0x3000dc?.['resourceId']},!0x0);const _0x5b4e5a=this['_connector']['uploadFile'](this['_ownerId'],_0x2776d4,_0x3000dc);this['_ongoingUploads']['set'](_0x7e5e3d,_0x5b4e5a['abortController']);const {id:_0x34cccf}=await _0x5b4e5a['getId']();this['_ongoingUploads']['delete'](_0x7e5e3d),this['_finishContextItemLoading']({'type':_0x405328,'id':_0x34cccf,'label':_0x3000dc?.['label']||_0x50f6fc,'uiId':_0x7e5e3d,'resourceId':_0x3000dc?.['resourceId']},!0x1);}catch(_0x557c19){this['_ongoingUploads']['delete'](_0x7e5e3d);if(!_0x557c19['message']['startsWith']('ai-request-aborted')){const _0x20211a=new _0x516722('ai-chat-file-upload-failed',null,{'fileName':_0x50f6fc});_0x20211a['stack']=_0x557c19['stack'],this['fire']('error',{'error':_0x20211a,'fileName':_0x50f6fc});}this['_removeContextItem'](_0x7e5e3d);}}));}finally{this['_finishUploadOperation'](_0x293c2f);}}['addCurrentDocumentToContext'](_0x1d3ebe){if(this['isCurrentDocumentInContext']())return;const _0x19a92b={'type':ce['DOCUMENT'],'uiId':'current-document','label':_0x1d3ebe,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x19a92b);}async['updateCurrentDocument'](_0x3775a0,_0x348b45,_0x4b9ecd,_0x1fbaa8){const _0x327e4f=this['_pendingContextItems']['get']('current-document');if(_0x327e4f&&_0x3775a0){_0x327e4f['selection']=_0x1fbaa8?_0x1fbaa8['map'](_0x1a8075=>({'start':_0x1a8075['start'],'end':_0x1a8075['end']})):[];try{if(_0x327e4f['version']===_0x348b45)return;const {id:_0x40a631}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x3775a0,{'version':_0x348b45,'sessionId':_0x4b9ecd})['getId']();_0x327e4f['id']=_0x40a631,_0x327e4f['content']=_0x3775a0,_0x327e4f['version']=_0x348b45,_0x327e4f['sessionId']=_0x4b9ecd;}catch(_0x59d748){const _0x45ad02=new _0x516722('ai-chat-document-upload-failed',null);_0x45ad02['stack']=_0x59d748['stack'],this['fire']('error',{'error':_0x45ad02});}}}['addSelectionToContext'](_0x1a6328){this['_addContextItem']({'type':ce['SELECTION'],'label':_0x1a6328,'uiId':'selection','content':_0x1a6328});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x16ba16,_0x1b812e){const _0xccd2f3='url-'+_0x215bb4();this['_startUploadOperation'](_0xccd2f3);const _0x54682f='url-'+_0x215bb4();try{this['_addContextItem']({'type':ce['URL'],'label':_0x1b812e?.['label']||_0x16ba16,'uiId':_0x54682f,'resourceId':_0x1b812e?.['resourceId']},!0x0);const _0x5739a8=this['_connector']['uploadUrl'](this['_ownerId'],_0x16ba16,_0x1b812e);this['_ongoingUploads']['set'](_0x54682f,_0x5739a8['abortController']);const {id:_0x281254}=await _0x5739a8['getId']();this['_ongoingUploads']['delete'](_0x54682f),this['_finishContextItemLoading']({'type':ce['URL'],'id':_0x281254,'label':_0x1b812e?.['label']||_0x16ba16,'uiId':_0x54682f,'resourceId':_0x1b812e?.['resourceId']},!0x1);}catch(_0x47e09c){this['_ongoingUploads']['delete'](_0x54682f),(_0x47e09c['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x516722('ai-chat-url-upload-failed',this,{'url':_0x16ba16,'originalError':_0x47e09c}),'url':_0x16ba16}),this['_removeContextItem'](_0x54682f));}finally{this['_finishUploadOperation'](_0xccd2f3);}}async['loadSourceResources'](_0x106bb7,_0x3e6ce4,_0x3d6443){const _0x1ffaff=this['_addContextOptionsState']['sources']['find'](_0x2bd610=>_0x2bd610['id']===_0x106bb7);if(!_0x1ffaff)return this['fire']('error',{'error':new _0x516722('ai-chat-source-not-found',this,{'sourceId':_0x106bb7}),'sourceId':_0x106bb7}),[];try{const _0x57d167=(await _0x1ffaff['getResources'](_0x3e6ce4))['map'](_0x5f3672=>{const _0x3620c1=this['_isResourceInContext'](_0x5f3672['id']);return{..._0x5f3672,'isInContext':_0x3620c1};});return _0x1ffaff['resources']=_0x57d167,this['fire']('sourceResourcesLoaded',{'sourceId':_0x106bb7,'source':_0x1ffaff,'resources':_0x57d167,'uid':_0x3d6443}),_0x57d167;}catch(_0x4aa3cc){return this['fire']('error',{'error':new _0x516722('ai-chat-source-resources-load-failed',this,{'sourceId':_0x106bb7,'originalError':_0x4aa3cc}),'sourceId':_0x106bb7,'sourceLabel':_0x1ffaff['label']}),[];}}async['addResourceToContext'](_0x3b21d3,_0x5dcb84){if(this['_isResourceInContext'](_0x5dcb84['id']))return;let _0x25149a=_0x5dcb84['data'];if(!_0x25149a&&_0x3b21d3['getData'])try{_0x25149a=await _0x3b21d3['getData'](_0x5dcb84['id']);}catch(_0x3909fc){return void this['fire']('error',{'error':new _0x516722('ai-chat-resource-load-failed',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id'],'originalError':_0x3909fc}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});}if(_0x25149a)switch(_0x5dcb84['type']){case ce['URL']:if('string'!=typeof _0x25149a)return void this['fire']('error',{'error':new _0x516722('ai-chat-context-invalid-data',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id'],'expectedType':'string','actualType':typeof _0x25149a}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});await this['addUrlToContext'](_0x25149a,{'label':_0x5dcb84['label'],'resourceId':_0x5dcb84['id']});break;case ce['FILE']:if(!(_0x25149a instanceof File))return void this['fire']('error',{'error':new _0x516722('ai-chat-context-invalid-data',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id'],'expectedType':'File','actualType':typeof _0x25149a}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});await this['addFilesToContext']([_0x25149a],{'label':_0x5dcb84['label'],'resourceId':_0x5dcb84['id']});break;case ce['TEXT']:if('object'!=typeof _0x25149a||!('content'in _0x25149a)||!('type'in _0x25149a))return void this['fire']('error',{'error':new _0x516722('ai-chat-context-invalid-data',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x25149a}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});_0x25149a=vi['_convertTextResourceToFile'](_0x25149a,_0x5dcb84['label']),await this['addFilesToContext']([_0x25149a],{'label':_0x5dcb84['label'],'resourceId':_0x5dcb84['id']},ce['TEXT']);break;default:this['fire']('error',{'error':new _0x516722('ai-chat-context-unsupported-type',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id'],'resourceType':_0x5dcb84['type']}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});}else this['fire']('error',{'error':new _0x516722('ai-chat-resource-no-data',this,{'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']}),'resourceId':_0x5dcb84['id'],'sourceId':_0x3b21d3['id']});}static['_convertTextResourceToFile'](_0x56e08f,_0x6a5ec7){switch(_0x56e08f['type']){case Ie['MARKDOWN']:return new File([_0x56e08f['content']],_0x6a5ec7,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x56e08f['content']],_0x6a5ec7,{'type':'text/html'});default:return new File([_0x56e08f['content']],_0x6a5ec7,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x20ffa7){switch(_0x20ffa7['type']){case ce['FILE']:return{'type':ce['FILE'],'id':_0x20ffa7['id']};case ce['URL']:return{'type':ce['URL'],'id':_0x20ffa7['id']};case ce['DOCUMENT']:return{'type':ce['DOCUMENT'],'id':_0x20ffa7['id'],..._0x20ffa7['selection']?.['length']&&{'selection':_0x20ffa7['selection']}};case ce['TEXT']:return{'type':ce['FILE'],'id':_0x20ffa7['id']};default:return null;}}['_addContextItem'](_0x10d9b8,_0x208817=!0x1){if(this['_pendingContextItems']['set'](_0x10d9b8['uiId'],_0x10d9b8),_0x10d9b8['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x10d9b8,'isLoading':_0x208817}),'current-document'===_0x10d9b8['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x10d9b8['resourceId']){const _0x30f1f7=this['_findSourceIdsByResourceId'](_0x10d9b8['resourceId']);_0x30f1f7&&_0x30f1f7['forEach'](_0x4c1ff2=>{this['_updateResourceInContextState'](_0x4c1ff2,_0x10d9b8['resourceId'],!0x0);});}}['_removeContextItem'](_0x1edf1d){const _0x603f61=this['_pendingContextItems']['get'](_0x1edf1d),_0xecb6a6=this['_ongoingUploads']['get'](_0x1edf1d);if(_0xecb6a6&&(_0xecb6a6['abort'](),this['_ongoingUploads']['delete'](_0x1edf1d)),_0x603f61?.['resourceId']){const _0x529775=this['_findSourceIdsByResourceId'](_0x603f61['resourceId']);_0x529775&&_0x529775['forEach'](_0x9216da=>{this['_updateResourceInContextState'](_0x9216da,_0x603f61['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1edf1d),this['fire']('contextItemRemoved',{'uiId':_0x1edf1d,'type':_0x603f61?.['type']}),'current-document'===_0x1edf1d&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x5eb42e,_0x469442){if(this['_pendingContextItems']['has'](_0x5eb42e['uiId'])&&(this['_pendingContextItems']['set'](_0x5eb42e['uiId'],_0x5eb42e),this['fire']('contextItemLoadingEnded',{'contextItem':_0x5eb42e,'isLoading':_0x469442}),_0x5eb42e['resourceId'])){const _0x3e3173=this['_findSourceIdsByResourceId'](_0x5eb42e['resourceId']);_0x3e3173&&_0x3e3173['forEach'](_0x6d470c=>{this['_updateResourceInContextState'](_0x6d470c,_0x5eb42e['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x25b06d){this['_conversationContextItems']['set'](_0x25b06d['uiId'],_0x25b06d);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x467ebe=>({..._0x467ebe,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x532014=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x532014,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x2339e1){for(const _0x3eb502 of this['_pendingContextItems']['values']())if(_0x3eb502['resourceId']===_0x2339e1)return!0x0;for(const _0x55e28c of this['_conversationContextItems']['values']())if(_0x55e28c['resourceId']===_0x2339e1)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x490ff8){const _0x565b56=[];for(const _0x5d082c of this['_addContextOptionsState']['sources']){_0x5d082c['resources']['find'](_0x53dab4=>_0x53dab4['id']===_0x490ff8)&&_0x565b56['push'](_0x5d082c['id']);}return 0x0===_0x565b56['length']?null:_0x565b56;}['_updateResourceInContextState'](_0x4aeb40,_0x106dda,_0x212e60){const _0x297eef=this['_addContextOptionsState']['sources']['find'](_0x498679=>_0x498679['id']===_0x4aeb40);if(!_0x297eef)return;const _0x46d890=_0x297eef['resources']['find'](_0x9e009c=>_0x9e009c['id']===_0x106dda);_0x46d890&&(_0x46d890['isInContext']=_0x212e60,this['fire']('resourceStateChanged',{'sourceId':_0x4aeb40,'resourceId':_0x106dda,'isInContext':_0x212e60}));}['_startUploadOperation'](_0x2068ee){this['_ongoingUploadOperations']['set'](_0x2068ee,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2b972a){this['_ongoingUploadOperations']['delete'](_0x2b972a),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const xi=['capabilitiesUpdated'];class Ci extends _0x1f835a(){['_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'](_0x199553){const _0xfcdd19={};return _0x199553&&_0x199553['isWebSearchEnabled']&&(_0xfcdd19['webSearch']={}),_0x199553&&_0x199553['isReasoningEnabled']&&(_0xfcdd19['reasoning']={}),_0xfcdd19;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x1d062d){_0x1d062d!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x1d062d,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x15a933){_0x15a933!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x15a933,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class gi extends oe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x283707){super(_0x283707),this['conversationId']=_0x283707['conversationId'],this['contextItems']=_0x283707['contextItems'],this['capabilities']=_0x283707['capabilities'],this['userMessage']=_0x283707['userMessage'],this['model']=_0x283707['model'],this['quickActionData']=_0x283707['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':vi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ci['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class at extends _0x1f835a(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5d7007){super(),this['options']=_0x5d7007,this['connector']=_0x5d7007['connector'],this['chatModels']=_0x5d7007['chatModels'],this['id']=_0x5d7007['conversationId'];}async['init'](_0x373036){try{this['chatContext']=new vi({'connector':this['connector'],'config':_0x373036,'ownerId':this['id']}),this['chatContext']['delegate'](...Ii)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ci(),this['chatCapabilities']['delegate'](...xi)['to'](this),this['chatCapabilities']['init']();const _0x53a07f=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x53a07f});const _0x31579a=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x31579a&&await this['setModel'](_0x31579a);}catch(_0x2eb86b){const _0x59015e=new _0x516722('ai-chat-conversation-init-failed',null,{'message':_0x2eb86b['message']});_0x59015e['stack']=_0x2eb86b['stack'],this['fire']('error',{'error':_0x59015e});}}async['start'](){if(this['isStarted'])throw new _0x516722('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x516722('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xa3470c}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xa3470c,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4a4c8e){const _0x3ed118=new _0x516722('ai-chat-conversation-start-failed',null,{'message':_0x4a4c8e['message']});_0x3ed118['stack']=_0x4a4c8e['stack'],this['fire']('error',{'error':_0x3ed118});}}async['load'](_0xda0ad4,_0x4a640d){try{const _0x15311b=await this['connector']['fetchConversation'](_0xda0ad4)['getConversation'](),_0x29396f=await this['connector']['fetchConversationMessages'](_0xda0ad4)['getMessages'](),_0x4d611b=_0x29396f[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x15311b['id'],'title'in _0x15311b?this['fire']('setConversationTitle',_0x15311b['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x599b79=(await this['chatModels']['getAll']())['find'](_0x3c6d60=>_0x3c6d60['id']['toLowerCase']()===_0x4d611b['toLowerCase']());return this['selectedModel']=_0x599b79,this['fire']('modelSelected',{'selectedModel':_0x599b79,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x29396f,_0x4a640d,_0x4d611b),this['currentInteraction']=void 0x0,this;}catch(_0x2fde8d){const _0x1feaad=new _0x516722('ai-chat-conversation-init-from-id-failed',null,{'message':_0x2fde8d['message'],'conversationId':_0xda0ad4});throw _0x1feaad['stack']=_0x2fde8d['stack'],this['fire']('error',{'error':_0x1feaad}),_0x1feaad;}}async['_processMessagesToInteractions'](_0x437234,_0x5304f4,_0x28d293){let _0x369efa;for(const _0x74208d of _0x437234)if('user'===_0x74208d['role']){const _0x5d7509=await this['_extractContextItems'](_0x74208d),_0x27ff25={'isReasoningEnabled':Object['hasOwn'](_0x74208d['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x74208d['capabilities'],'webSearch')};_0x369efa=this['createInteraction']({'userMessage':_0x74208d['prompt'],'contextItems':_0x5d7509,'capabilities':_0x27ff25,'modelId':_0x28d293,'quickActionData':_0x74208d['attributes']?.['quickActionData']}),this['currentInteraction']=_0x369efa,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x74208d['role']&&_0x369efa)for(const _0x29b4a0 of _0x74208d['content']){const _0x3f4dc7='text'===_0x29b4a0['type']?'text-delta':'modification-delta',_0x44c443=_0x369efa['getDocumentContext']()?.['sessionId']!==_0x5304f4;_0x369efa['currentReply']=_0x369efa['createReply']({'type':_0x3f4dc7,'isDone':!0x0,'interactionId':_0x369efa['id'],'areActionsDisabled':_0x44c443}),_0x369efa['currentReply']['appendContent'](_0x29b4a0['content']);}}}async['_extractContextItems'](_0x437ccf){const _0x4ba024=new Map();if(!_0x437ccf['content'])return _0x4ba024;for(const _0x248d51 of _0x437ccf['content']){const _0x4f304c=await this['chatContext']['populateFromMessage'](_0x248d51);_0x4f304c&&_0x4ba024['set'](_0x4f304c['id'],_0x4f304c);}return _0x4ba024;}async['handleUserInteraction']({userMessage:_0x20227c,quickActionData:_0x11c9ca}){if(!this['isStarted'])throw new _0x516722('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x516722('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x2c14b9=this['chatContext']['getPendingContextItems'](),_0x120609=this['chatCapabilities']['getCapabilitiesConfig'](),_0x3d97c9=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x20227c,'contextItems':_0x2c14b9,'capabilities':_0x120609,'modelId':_0x3d97c9,'quickActionData':_0x11c9ca}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x568952){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x568952});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x27c9fe,contextItems:_0x37b8c4,capabilities:_0x48168b,modelId:_0x2aeedf,quickActionData:_0x56e6d2}){const _0x236c42=new gi({'userMessage':_0x27c9fe,'contextItems':_0x37b8c4,'capabilities':_0x48168b,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2aeedf,'quickActionData':_0x56e6d2});return _0x236c42['delegate'](...ne)['to'](this),this['interactions']['push'](_0x236c42),this['fire']('interactionCreated',_0x236c42),_0x236c42;}['getInteraction'](_0xd6166d){return this['interactions']['find'](_0x158fee=>_0x158fee['id']===_0xd6166d);}['removeInteraction'](_0x7c4d3f){const _0x27f29c=this['getInteraction'](_0x7c4d3f);_0x27f29c&&(_0x27f29c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x27f29c),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x365fc2){this['chatContext']['addCurrentDocumentToContext'](_0x365fc2);}async['updateCurrentDocumentInContext']({content:_0x4810b0,version:_0x17b2d2,sessionId:_0xe6a38,selections:_0x4a3b67}){await this['chatContext']['updateCurrentDocument'](_0x4810b0,_0x17b2d2,_0xe6a38,_0x4a3b67);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3c24dd){this['chatContext']['addSelectionToContext'](_0x3c24dd);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3d07e7){this['chatContext']['addFilesToContext'](_0x3d07e7);}['addUrlToContext'](_0x366568){this['chatContext']['addUrlToContext'](_0x366568);}['addResourceToContext'](_0x500f4d,_0x2c6dd9){this['chatContext']['addResourceToContext'](_0x500f4d,_0x2c6dd9);}['loadSourceResources'](_0x493adc,_0x1ab188,_0x187cd4){return this['chatContext']['loadSourceResources'](_0x493adc,_0x1ab188,_0x187cd4);}['removeFromContext'](_0x5b06cf){this['chatContext']['removeFromContext'](_0x5b06cf);}['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'](_0xaae181){if(!_0xaae181)throw new _0x516722('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0xaae181))throw new _0x516722('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0xaae181});_0xaae181['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0xaae181,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0xaae181}));}}function N(_0x239d30){if(_0x239d30 instanceof st)return _0x239d30;if(_0x239d30?.['editors']&&_0x239d30['editors']['get'](0x0))return _0x239d30['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.'),_0x239d30['editors']['get'](0x0);throw new _0x516722('ai-get-editor-from-context-no-editor');}const ht='ai-selection';class a extends _0x150b32{['_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 _0xf55f6b=N(this['context']),_0x57ad53=_0xf55f6b['plugins']['has']('RealTimeCollaborationClient')&&_0xf55f6b['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x57ad53||_0x215bb4();}return this['_sessionId'];}['getDocumentData'](){const _0x360c9f=N(this['context']),_0x2705a3=_0x360c9f['model'],_0x144b46=_0x360c9f['data']['toView'](_0x2705a3['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1301ca=new kt(_0x360c9f['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x144b46,_0x1301ca);let _0x208ecc=_0x360c9f['data']['processor']['toData'](_0x144b46);const _0x9e1463=this['_getMarkersInDocumentOrder'](),_0x58d644=[];for(const _0x33a84e of _0x9e1463){const _0x3d86a6='<'+_0x33a84e['name']+':start></'+_0x33a84e['name']+':start>',_0x44be30=_0x208ecc['indexOf'](_0x3d86a6);_0x208ecc=_0x208ecc['substring'](0x0,_0x44be30)+_0x208ecc['substring'](_0x44be30+_0x3d86a6['length']);const _0x38aa3e='<'+_0x33a84e['name']+':end></'+_0x33a84e['name']+':end>',_0x3c8fa6=_0x208ecc['indexOf'](_0x38aa3e);_0x208ecc=_0x208ecc['substring'](0x0,_0x3c8fa6)+_0x208ecc['substring'](_0x3c8fa6+_0x38aa3e['length']),_0x58d644['push']({'markerName':_0x33a84e['name'],'start':_0x44be30,'end':_0x3c8fa6,'htmlFragment':_0x208ecc['substring'](_0x44be30,_0x3c8fa6)});}return{'content':_0x208ecc,'version':_0x360c9f['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x58d644};}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x4bd460,_0x220cf3)=>{_0x220cf3['on']('ready',()=>{this['_integrateEditor'](_0x220cf3);});});}['_integrateEditor'](_0x1d54cb){_0x1d54cb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ht,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1d54cb['conversion']['for']('dataDowncast')['markerToElement']({'model':ht,'view':(_0x3f75f7,{writer:_0x22db99,options:_0x29956f})=>_0x29956f['convertAiChatSelectionMarker']?_0x22db99['createUIElement'](_0x3f75f7['markerName']+':'+(_0x3f75f7['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0xaf8c17,_0x401597,_0xe6c761=!0x1,_0x3bdc7d=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x3bdc7d)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x401597,this['_displayedFakeSelectionLocked']=_0xe6c761;const _0x25966d=N(this['context'])['model'];return _0x25966d['change'](_0x1c2b64=>{let _0x3cd6ff=0x0;for(let _0x208f00 of _0xaf8c17){const _0x5857ed=ht+':'+_0x3cd6ff;if(_0x208f00['start']['isAtEnd']){const _0x23d477=_0x208f00['start']['getLastMatchingPosition'](({item:_0xf6af31})=>!_0x25966d['schema']['isContent'](_0xf6af31),{'boundaries':_0x208f00});_0x208f00=_0x1c2b64['createRange'](_0x23d477,_0x208f00['end']);}_0x1c2b64['addMarker'](_0x5857ed,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x208f00}),_0x3cd6ff++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x527783){if(this['_displayedFakeSelectionId']!=_0x527783)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x5bb390=N(this['context']),_0x4583a0=_0x5bb390['model']['markers']['getMarkersGroup'](ht);return _0x5bb390['model']['change'](_0x5df568=>{for(const _0xd32fdb of _0x4583a0)_0x5df568['removeMarker'](_0xd32fdb);}),!0x0;}['modelToViewWithIds'](_0x16b268){const _0x40d42a=N(this['context']),_0x8f8fba=_0x40d42a['data']['toView'](_0x16b268),_0x33d397=new kt(_0x40d42a['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x8f8fba,_0x33d397),_0x8f8fba;}['_setDataIdsOnChildren'](_0x243b02,_0x4cc0f7){let _0x8c01f7=!0x1;const _0x200659=new Set();for(const _0x118091 of _0x243b02['getChildren']()){const _0x464400=_0x118091['is']('emptyElement')||_0x118091['is']('containerElement');if(!_0x118091['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x118091,_0x4cc0f7)||_0x464400)&&(_0x4cc0f7['setAttribute']('data-id',this['_nextDataId'](_0x200659),_0x118091),_0x8c01f7=!0x0);}return _0x8c01f7;}['_nextDataId'](_0x4b9393){let _0x48cac8;do{_0x48cac8='';for(let _0x43493b=0x0;_0x43493b<0x4;_0x43493b++)_0x48cac8+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x4b9393['has'](_0x48cac8));return _0x4b9393['add'](_0x48cac8),_0x48cac8;}['getSelectionText'](){const {model:_0xcd146e}=N(this['context']),_0x10158a=_0xcd146e['document']['selection'],_0x1f44f9=_0xcd146e['getSelectedContent'](_0x10158a),_0x5a9d6c=[],_0x37eaf0=_0xcd146e['createRangeIn'](_0x1f44f9)['getWalker']();for(const {item:_0x328726}of _0x37eaf0)_0x328726['is']('$textProxy')?_0x5a9d6c['push'](_0x328726['data']):_0x328726['is']('element')&&_0x5a9d6c['length']>0x0&&'\x20'!==_0x5a9d6c[_0x5a9d6c['length']-0x1]&&_0x5a9d6c['push']('\x20');return'\x22'+_0x5a9d6c['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x1a5974=N(this['context'])['model'];return Array['from'](_0x1a5974['markers']['getMarkersGroup'](ht))['sort']((_0x505329,_0x27ea41)=>_0x505329['getStart']()['isBefore'](_0x27ea41['getStart']())?-0x1:_0x505329['getStart']()['isAfter'](_0x27ea41['getStart']())?0x1:0x0);}}class ct extends _0x1f835a(){['_modelList']=[];['_connector'];constructor({connector:_0x51d700}){super(),this['_connector']=_0x51d700;}async['getAll'](){if(!this['_modelList']['length']){const _0x12e0e5=this['_connector']['getModels'](),_0x33ca15=(await _0x12e0e5['list']())['items']['sort']((_0x5d37c4,_0x42d85c)=>{const _0x544c23=Object['values'](_0x5d37c4['capabilities'])['filter'](_0x134e81=>_0x134e81['enabled'])['length'];return Object['values'](_0x42d85c['capabilities'])['filter'](_0x340511=>_0x340511['enabled'])['length']-_0x544c23;});this['_modelList']=_0x33ca15;}return this['_modelList'];}async['getDefault'](_0x111175){const _0x5b2cea=await this['getAll']();if(!_0x5b2cea['length'])return null;if(_0x111175){const _0x5a13b1=_0x5b2cea['find'](_0x177b69=>_0x177b69['id']===_0x111175);if(_0x5a13b1)return _0x5a13b1;_0x170b6a('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x111175,'fallBackModelId':_0x5b2cea[0x0]['id']});}return _0x5b2cea[0x0];}async['isAvailable'](_0x470672){return(await this['getAll']())['some'](_0xb2126d=>_0xb2126d['name']===_0x470672['name']&&_0xb2126d['provider']===_0x470672['provider']);}}function w({editor:_0x481bd7,interaction:_0x1a750c,reply:_0xb9b543,groups:_0x449c17,transform:_0x57ade8,documentCompare:_0x3d4b9b,documentCompareOptions:_0x277d87}){const _0x5d55a3=_0x1a750c['getDocumentContext']();if(!_0x5d55a3)return[];const _0x558b23=_0x5d55a3['content'],_0x19622b=_0x5d55a3['version'],_0x28eddc=_0xb9b543['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x36eaa6}of _0x449c17){const _0x3680e9=_0x36eaa6['filter'](_0xb55c9a=>'new'!=_0xb55c9a['type'])['map'](_0x49e678=>_t('data-id',_0x49e678['id'],_0x28eddc)),_0xfaa1b5=_0x36eaa6['filter'](_0x3c036d=>'removed'!=_0x3c036d['type'])['map'](_0x325d73=>_0x325d73['node']['cloneNode'](!0x0));let _0x499e6d=null;if(_0x3680e9['length']){_0x499e6d=_0x3680e9[0x0]['previousSibling'];for(let _0x40d3cb=0x0;_0x40d3cb<_0x3680e9['length'];_0x40d3cb++)_0x975f(_0x3680e9[_0x40d3cb]);}if(_0xfaa1b5['length']){_0x499e6d||(_0x36eaa6[0x0]['anchorId']?_0x499e6d=_t('data-id',_0x36eaa6[0x0]['anchorId'],_0x28eddc):(_0x499e6d=_0xfaa1b5['shift'](),to(_0x28eddc,_0x499e6d)));for(let _0x304e5f=0x0;_0x304e5f<_0xfaa1b5['length'];_0x304e5f++)_0x422718(_0x499e6d,_0xfaa1b5[_0x304e5f]),_0x499e6d=_0xfaa1b5[_0x304e5f];}}const _0xf4ede9=ft(_0x28eddc),_0x3763a3=_0x3d4b9b['getDiff'](_0x558b23,_0xf4ede9,_0x277d87)['getOperations']();if(_0x57ade8){const _0x2d60c8=_0x481bd7['model']['document']['history']['getOperations'](_0x19622b),_0x2ce6af={'document':_0x481bd7['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x3b6950(_0x3763a3,_0x2d60c8,_0x2ce6af)['operationsA'];}return _0x3763a3;}function d({editor:_0x3812db,changeGroups:_0x2e6122,documentContextContent:_0x37cb7c,showDiff:_0x1398d6,trimUnchanged:_0x538551=!0x0}){return _0x2e6122['map'](_0x4263e1=>{const _0x25d5fa=new Ct([]),_0x2aba62=new Ct([]);for(const _0x2e5a26 of _0x4263e1['changes'])if(_0x1398d6&&'removed'==_0x2e5a26['type']||_0x2aba62['children']['push'](_0x2e5a26['node']['cloneNode'](!0x0)),'new'!=_0x2e5a26['type']&&(_0x1398d6||'removed'!=_0x2e5a26['type'])){const _0x1523c0=ut(_0x2bb6ec=>mt(_0x2bb6ec,'data-id')==_0x2e5a26['id'],_0x37cb7c,!0x0);_0x1523c0&&_0x25d5fa['children']['push'](_0x1523c0['cloneNode'](!0x0));}const _0x35d68b=function(_0x5905c3,_0x33f296,_0x1e08b5,_0x1456b2,_0x584f75=!0x0){const _0x4f666c=_0x5905c3['plugins']['get']('DocumentCompare'),_0x591111=_0x5905c3['plugins']['get']('TrackChangesEditing'),_0x164a6a=ft(_0x33f296),_0x3afc61=ft(_0x1e08b5),_0x15957c=_0x5905c3['data']['parse'](_0x164a6a,'$root'),_0x87b085=_0x5905c3['model']['createPositionAt'](_0x15957c,0x0),_0x57ef19=_0x4f666c['getDiff'](_0x164a6a,_0x3afc61,{'anchor':_0x87b085,'markDeletions':_0x1456b2}),_0x4ad875=_0x57ef19['getOperations']();if(0x0==_0x4ad875['length'])return null;_0x1456b2?_0x591111['_applyOperationsAsSuggestions'](_0x4ad875):_0x5905c3['model']['change'](_0x132b76=>{for(const _0x59c710 of _0x4ad875)if('remove'==_0x59c710['type']){const _0x547284=_0x59c710['sourcePosition'],_0x59d2f5=_0x59c710['howMany'],_0x5704f0=new pt(_0x547284,_0x59d2f5);_0x132b76['batch']['addOperation'](_0x5704f0),_0x5905c3['model']['applyOperation'](_0x5704f0);}else _0x59c710['baseVersion']=null,_0x59c710['isDocumentOperation']=!0x1,_0x132b76['batch']['addOperation'](_0x59c710),_0x5905c3['model']['applyOperation'](_0x59c710);});if(_0x584f75){const _0x50fa22=gt(_0x5905c3,_0x4ad875,_0x15957c);lt(_0x5905c3['model'],_0x50fa22),function(_0x213bbf,_0x14f20c){const _0x241ed3=_0x14f20c['getFirstRange']()['start'];let _0x2374f9=_0x14f20c['getFirstRange']()['end'];const _0x5e464b=_0x241ed3['root'];(_0x2374f9['textNode']||_0x2374f9['nodeAfter']&&_0x2374f9['nodeAfter']['is']('$text'))&&(_0x689ebb(_0x2374f9,'...'),_0x2374f9=_0x2374f9['getShiftedBy'](0x3)),(_0x241ed3['textNode']||_0x241ed3['nodeBefore']&&_0x241ed3['nodeBefore']['is']('$text'))&&(_0x689ebb(_0x241ed3,'...'),function(_0x428aa8,_0x20bd39,_0x672f1c){for(let [_0x596894,_0x107993]of _0x428aa8['markers']){const _0x1815e6=_0x107993['_getTransformedByInsertion'](_0x20bd39,_0x672f1c,!0x1);_0x107993=_0x1815e6[0x0],_0x428aa8['markers']['set'](_0x596894,_0x107993);}}(_0x5e464b,_0x241ed3,0x3),_0x241ed3['parent']==_0x2374f9['parent']&&(_0x2374f9=_0x2374f9['getShiftedBy'](0x3)));const _0x358337=_0x213bbf['createRange'](_0x213bbf['createPositionAt'](_0x5e464b,0x0),_0x241ed3),_0x5dedaa=_0x213bbf['createRange'](_0x2374f9,_0x213bbf['createPositionAt'](_0x5e464b,'end')),_0x2cdd03=[..._0x358337['getMinimalFlatRanges'](),..._0x5dedaa['getMinimalFlatRanges']()];_0x2cdd03['reverse']();for(const _0x5686c9 of _0x2cdd03)_0x551ca0(_0x5686c9),Wn(_0x5e464b,_0x5686c9);}(_0x5905c3['model'],_0x50fa22);}const _0x23e0d3=_0x5905c3['data']['stringify'](_0x15957c,{'showSuggestionHighlights':!0x0});return Ye(_0x23e0d3);}(_0x3812db,_0x25d5fa,_0x2aba62,_0x1398d6,_0x538551);return{'type':_0x4263e1['changes'][0x0]['type'],'index':_0x4263e1['index'],'content':_0x35d68b};});}function gt(_0x39cea8,_0x3d68e2,_0x428a67){const _0x12e270=_0x39cea8['plugins']['get']('DocumentCompare');let _0x5f1cea=_0x39cea8['model']['createPositionAt'](_0x428a67,Number['POSITIVE_INFINITY']),_0x39db78=_0x39cea8['model']['createPositionAt'](_0x428a67,0x0);for(const _0x29a09f of _0x3d68e2){let _0x17a886,_0x5da759;if(_0x12e270['isMarkedRemoveOperation'](_0x29a09f))_0x17a886=_0x29a09f['newRange']['start'],_0x5da759=_0x29a09f['newRange']['end'];else switch(_0x29a09f['type']){case'rename':_0x17a886=_0x29a09f['position'],_0x5da759=_0x17a886['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x17a886=_0x29a09f['range']['start'],_0x5da759=_0x29a09f['range']['end'];break;case'insert':_0x17a886=_0x29a09f['position'],_0x5da759=_0x17a886['getShiftedBy'](_0x29a09f['howMany']);break;case'split':_0x17a886=_0x29a09f['splitPosition'],_0x5da759=_0x29a09f['moveTargetPosition'];break;case'merge':{const _0x16d85d=_0x29a09f['targetPosition']['path']['slice'](-0x1);_0x17a886=_0x39cea8['model']['createPositionFromPath'](_0x428a67,_0x16d85d),_0x5da759=_0x17a886['getShiftedBy'](0x1);break;}case'remove':{const _0x16264a=_0x29a09f['howMany'],_0x442346=_0x29a09f['sourcePosition']['_getTransformedByInsertion'](_0x29a09f['targetPosition'],_0x16264a),_0x1396f2=_0x29a09f['getMovedRangeStart']();'remove'==_0x29a09f['type']?(_0x17a886=_0x442346,_0x5da759=_0x442346):(_0x17a886=_0x1396f2,_0x5da759=_0x1396f2['getShiftedBy'](_0x16264a));break;}}_0x17a886&&_0x17a886['isBefore'](_0x5f1cea)&&(_0x5f1cea=_0x17a886),_0x5da759&&_0x5da759['isAfter'](_0x39db78)&&(_0x39db78=_0x5da759);}return _0x39cea8['model']['createSelection'](_0x39cea8['model']['createRange'](_0x5f1cea,_0x39db78));}function lt(_0x15fb11,_0x512fd5){eo(_0x15fb11,_0x512fd5,'forward');const _0x21ffa3=_0x512fd5['getFirstRange']();_0x512fd5['setTo']([]),_0x512fd5['setTo'](_0x21ffa3,{'backward':!0x0}),eo(_0x15fb11,_0x512fd5,'backward');}function eo(_0x5bc113,_0x553e34,_0x32b0e7){let _0x208e61=0x14;for(;_0x208e61;){_0x5bc113['modifySelection'](_0x553e34,{'unit':'word','direction':_0x32b0e7}),_0x208e61--;const _0x19ceab=_0x553e34['focus']['forward'==_0x32b0e7?'nodeBefore':'nodeAfter'];if(_0x19ceab&&_0x19ceab['is']('element')&&_0x5bc113['schema']['isBlock'](_0x19ceab)&&_0x5bc113['schema']['isObject'](_0x19ceab))break;}}function Wn(_0xe65fe4,_0x561c47){for(let [_0x543252,_0x557d55]of _0xe65fe4['markers'])_0x557d55=_0x557d55['_getTransformedByDeletion'](_0x561c47['start'],_0x561c47['end']['offset']-_0x561c47['start']['offset']),_0xe65fe4['markers']['set'](_0x543252,_0x557d55);}class rh extends _0x47fea8{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x2f82ee,_0x506b71={},_0x43ad18){super(_0x2f82ee),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x506b71};const _0x1a7e6c=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1a7e6c?'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'](_0x43ad18),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x3678e7(this['locale']),this['likeButton']['set']({'icon':_0x2fe68d,'label':Vn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x53c76f=>!_0x53c76f),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x3678e7(this['locale']),this['dislikeButton']['set']({'icon':_0x1e72ea,'label':Vn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4ff329=>!_0x4ff329),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x3678e7(this['locale']),this['copyButton']['set']({'icon':_0x243bf9,'label':Vn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x176d6e=>!_0x176d6e);const _0x13bdbc=new _0x30b390();_0x13bdbc['set']({'content':_0x465b02}),_0x13bdbc['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'](_0x13bdbc);}['_setupShowChangesButton'](_0x2ccda6){this['showChangesButton']=new _0x3678e7(this['locale']),this['showChangesButton']['set']({'icon':_0x5d3306,'label':Vn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x2ccda6}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x59cb9b=>!_0x59cb9b),this['showChangesButton']['on']('execute',()=>{const _0x5eac4d=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x5eac4d,'icon':_0x5eac4d?_0x4db985:_0x5d3306}),this['fire']('toggleShowChanges',_0x5eac4d);});}}class dh extends _0x179f2b{['showChangesToggleView'];constructor(_0x4a6012,_0x1da399){super(_0x4a6012),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new Kn(_0x4a6012),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Vn(_0x4a6012,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1da399['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4bb058=>_0x4bb058?_0x166162:_0x50b920),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x38df0c=new _0x30b390();_0x38df0c['content']=_0x96c2b3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1da399['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x38df0c,{'tag':'span','children':[Vn(_0x4a6012,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class Kn extends _0x3678e7{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ia{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x5ee454){this['options']={'delay':_0x5ee454['delay']??0x14,'textNodeStyle':_0x5ee454['textNodeStyle'],'onStreamUpdate':_0x5ee454['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x8c260a,targetElement:_0x3e0dfd,abortSignal:_0x3a4a18}){this['isStreaming']&&this['stop'](),_0x3a4a18?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xac1c48(_0x8c260a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x170b6a('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x59f087=0x0;_0x59f087<this['currentIndex'];_0x59f087++)this['nodesList'][_0x59f087]['shouldBeStreamed']=!0x0;let _0x3d06fa=0x0;for(let _0x4cf63c=this['currentIndex'];_0x4cf63c<this['nodesList']['length'];_0x4cf63c++){const _0x2259ac=Date['now'](),_0x5aa290=this['nodesList'][_0x4cf63c],_0x3f97c3=_0x2259ac-_0x3d06fa;_0x5aa290['shouldBeStreamed']=!0x0;let _0x2bf066=_0x5aa290['parent'];for(;_0x2bf066;)_0x2bf066['shouldBeStreamed']=!0x0,_0x2bf066=_0x2bf066['parent'];if(_0x3f97c3<this['options']['delay'])try{const {promise:_0x2647d7,abortController:_0x154b30}=mr(this['options']['delay']-_0x3f97c3);this['timeoutAbortController']=_0x154b30,await _0x2647d7;}catch(_0x3370d0){return;}_0x2c1590(_0x3e0dfd,'<'+_0x3e0dfd['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3e0dfd['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x4cf63c,_0x3d06fa=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x179f66}){Array['from'](_0x179f66['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5d3538=>{_0x5d3538['replaceWith'](_0x5d3538['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x9b1aed){let _0x3aea5d='';if(function(_0x3a8b45){return tn(_0x3a8b45);}(_0x9b1aed)){for(const _0x1ab868 of _0x9b1aed['children'])_0x3aea5d+=this['renderNode'](_0x1ab868);}else{if(ar(_0x9b1aed)){if(!_0x9b1aed['shouldBeStreamed'])return'';const _0x3953d0=_0x9b1aed,_0x2c3718=Object['entries'](_0x3953d0['attribs'])['map'](([_0x59937f,_0x3fd0e0])=>_0x59937f+'=\x22'+_0x3fd0e0+'\x22')['join']('\x20');_0x3aea5d+='<'+_0x3953d0['tagName']+(_0x2c3718?'\x20'+_0x2c3718:'')+'>';for(const _0x58bfa2 of _0x5d9ffb(_0x3953d0))_0x3aea5d+=this['renderNode'](_0x58bfa2);_0x3aea5d+='</'+_0x3953d0['tagName']+'>';}else{if(!cr(_0x9b1aed))return'';if(!_0x9b1aed['shouldBeStreamed'])return'';!function(_0x5c416e){if(!_0x5c416e['parent']||!ar(_0x5c416e['parent']))return!0x1;if(!hr['includes'](_0x5c416e['parent']['tagName']))return!0x1;return!_0x1d4589(_0x5c416e)['match'](/^\s*[<>]\s*$/);}(_0x9b1aed)?_0x3aea5d+=_0x2d3ed1(_0x9b1aed):_0x3aea5d+=_0x2d3ed1(new _0x2ccea4('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x9b1aed]));}}return _0x3aea5d;}['getParsedDocumentNodeList'](){const _0xb65646=[];return function(_0x3551d5,_0xc86962){const _0x1bb988=_0x235211=>{if(_0xc86962(_0x235211),_0x235211 instanceof _0x18d794)for(let _0x462ac0=0x0;_0x462ac0<_0x235211['children']['length'];_0x462ac0++){const _0x814068=_0x235211['children'][_0x462ac0];_0x1bb988(_0x814068);}};for(let _0x5eb819=0x0;_0x5eb819<_0x3551d5['children']['length'];_0x5eb819++)_0x1bb988(_0x3551d5['children'][_0x5eb819]);}(this['document'],_0xd8b63f=>{if(cr(_0xd8b63f)){const _0x2f0ded=this['splitTextNodeIntoWordNodes'](_0xd8b63f);_0x2f0ded['length']&&_0xb65646['push'](..._0x2f0ded);}_0xd8b63f['isWordSplitSource']||_0xd8b63f['isWordSplitResult']||_0xb65646['push'](_0xd8b63f);}),_0xb65646;}['splitTextNodeIntoWordNodes'](_0x1f4168){if(_0x1f4168['isWordSplitSource']||_0x1f4168['isWordSplitResult'])return[];const _0x413bfb=_0x1d4589(_0x1f4168)['match'](/(?:\s*\S+\s*)/g),_0x5e308f=[];if(_0x413bfb&&_0x413bfb['length']>0x1){for(const _0x398d4a of _0x413bfb){const _0x3e23a3=new _0x3419c5(_0x398d4a);_0x3e23a3['isWordSplitResult']=!0x0,_0x8a3d6b(_0x1f4168,_0x3e23a3),_0x5e308f['push'](_0x3e23a3);}_0x1f4168['isWordSplitSource']=!0x0,_0x975f(_0x1f4168);}return _0x5e308f;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0x224404){return _0x80b4b7(_0x224404);}function ar(_0x40908c){return _0x40109d(_0x40908c);}function mr(_0x40e60b){const _0x5008ce=new AbortController();return{'promise':new Promise((_0x573049,_0x1d9916)=>{const _0x18bb9b=setTimeout(_0x573049,_0x40e60b);_0x5008ce['signal']['addEventListener']('abort',()=>{clearTimeout(_0x18bb9b),_0x1d9916();});}),'abortController':_0x5008ce};}const me=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Ar extends _0x179f2b{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x38cc9f,{part:_0xfe51e5,areActionsDisabled:_0x216f63}){super(_0x38cc9f),this['set']('partDefinition',_0xfe51e5),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x120e69=>'pending'==_0x120e69&&!_0x216f63),this['children']=this['createCollection'](),this['htmlStreamer']=new ia({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new An(_0x38cc9f,_0xfe51e5),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...me)['to'](this);const _0x35ecff=this['bindTemplate'];this['contentView']=new _0x179f2b(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x35ecff['to']('state',_0x2b6c41=>'ck-ai-suggestion__body__content-part_'+_0x2b6c41),_0x35ecff['to']('isEnabled',_0x5689ec=>_0x5689ec?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x35ecff['if']('isVisible','ck-hidden',_0x321a7a=>!_0x321a7a)]},'children':this['children'],'on':{'mouseenter':_0x35ecff['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0xfe51e5['index']});}),'mouseleave':_0x35ecff['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0xfe51e5['index']});})}});}async['updateContent']({part:_0x106d3c,renderingStrategy:_0x53a81f,abortSignal:_0x2708d9}){this['partDefinition']=_0x106d3c,this['isVisible']=!!this['partDefinition']['content'],this['partDefinition']['content']&&('streaming'===_0x53a81f?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x2708d9}):this['contentView']['element']['innerHTML']=ft(this['partDefinition']['content']));}['toggleHeader'](_0x4cc44f){_0x4cc44f?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class An extends _0x179f2b{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x3ea11e,_0x33a5e1){super(_0x3ea11e),this['set']('partDefinition',_0x33a5e1),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x5ae2fc=new _0x30b390();_0x5ae2fc['content']=_0x47ec67,_0x5ae2fc['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x49dd31=new _0x3678e7(_0x3ea11e);_0x49dd31['set']({'label':Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x73a439}),_0x49dd31['bind']('isEnabled')['to'](this),_0x49dd31['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x33a5e1['index']});});const _0x1d36aa=new _0x3678e7(_0x3ea11e);_0x1d36aa['set']({'label':Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1cfda4}),_0x1d36aa['bind']('isEnabled')['to'](this),_0x1d36aa['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x33a5e1['index']});});const _0x14a083=new _0x3678e7(_0x3ea11e);_0x14a083['set']({'label':Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3c48a6}),_0x14a083['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x33a5e1['index']});}),_0x14a083['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x47fea8(_0x3ea11e),this['_toolbarView']['items']['addMany']([_0x49dd31,_0x1d36aa,_0x14a083]),this['_iconStateAccepted']=new _0x30b390(),this['_iconStateAccepted']['content']=_0x4d5b37,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x30b390(),this['_iconStateRejected']['content']=_0x528ba9,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x4ad2d3=new _0x179f2b(_0x3ea11e);_0x4ad2d3['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Vn(_0x3ea11e,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x33a5e1['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x5ae2fc,_0x4ad2d3,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x82297d,_0x3f662e,_0x39fa07,_0x53bdbe)=>{switch(_0x53bdbe){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x39fa07){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class g extends _0x1f835a(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5a0978){const _0xfaa1a5=this['createTask'](_0x5a0978);return this['queue']['push'](_0xfaa1a5),this['_processQueue'](),_0xfaa1a5['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(_0x4bf0f0=>{this['once']('_queueEmpty',()=>{_0x4bf0f0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x23754c=this['queue']['shift']();try{await _0x23754c['callback'](this['_abortController']['signal']),_0x23754c['resolve']();}catch(_0x57e795){_0x23754c['reject'](_0x57e795);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xc47df0){let _0x1565a6,_0xf9673c;const _0x217dc0=new Promise((_0x327252,_0x540f76)=>{_0x1565a6=_0x327252,_0xf9673c=_0x540f76;});return{'callback':_0xc47df0,'resolve':_0x1565a6,'reject':_0xf9673c,'completePromise':_0x217dc0};}}class Cr extends _0x179f2b{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x62b323){super();const _0x5ee587=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ia({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x62b323,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5ee587['if']('isDone','ck-ai-chat__feed__item_done'),_0x5ee587['if']('isVisible','ck-hidden',_0x2ddf79=>!_0x2ddf79),'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'](_0x204303=>{_0x204303['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x264db1,_0x127e17,_0x2544ea){await this['htmlStreamer']['stream']({'document':_0x264db1,'targetElement':_0x127e17,'abortSignal':_0x2544ea});}}class ye extends Cr{constructor(_0x2cf438){super(_0x2cf438),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x2cf438['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4546d3){this['element']['innerHTML']=_0x4546d3;}}class gh extends _0x179f2b{['_children'];['_areActionsDisabled'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x36bdc4,{areActionsDisabled:_0x39e075}){super(_0x36bdc4),this['_areActionsDisabled']=_0x39e075,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new ye({'id':'empty-parts-warning','initialContent':Vn(_0x36bdc4,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x14d2f8,renderingStrategy:_0x18b979,abortSignal:_0x181fa0}){for(const _0x4891ff of _0x14d2f8)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1bbb95=>{let _0x3a4a63=this['_children']['find'](_0x5c7e11=>_0x5c7e11['partDefinition']['index']==_0x4891ff['index']);_0x3a4a63||(_0x3a4a63=new Ar(this['locale'],{'part':_0x4891ff,'areActionsDisabled':this['_areActionsDisabled']}),_0x3a4a63['delegate'](...me)['to'](this),this['_children']['add'](_0x3a4a63),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x3a4a63['toggleHeader'](this['_children']['length']>0x1),await _0x3a4a63['updateContent']({'part':_0x4891ff,'renderingStrategy':_0x18b979,'abortSignal':_0x1bbb95});});return _0x181fa0?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1f5984,_0x4798dd){this['_children']['get'](_0x1f5984)['state']=_0x4798dd,this['hasPendingParts']='pending'==_0x4798dd||Array['from'](this['_children'])['some'](_0x11d21c=>'pending'==_0x11d21c['state']);}['getPartView'](_0x467f30){return this['_children']['get'](_0x467f30);}['markAsDone'](){const _0x1124d7=!this['_children']['find'](_0x17568f=>!!_0x17568f['partDefinition']['content']),_0x1d4c3b=!!this['_children']['find'](_0x5e8223=>!_0x5e8223['partDefinition']['content']);this['_emptyPartsWarningView']['isVisible']=_0x1d4c3b,_0x1124d7?this['_emptyPartsWarningView']['setContent'](Vn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Vn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x57b838=>!!_0x57b838['partDefinition']['content']);}}class Ve extends _0x3fce23{constructor(_0x19aed4=void 0x0){super();const _0x39e250=_0x19aed4?'ck-ai-spinner_'+_0x19aed4:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x39e250]}});}}class s extends _0x179f2b{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x3722e4,{showDiff:_0x36dea4,areActionsDisabled:_0x446fe9,miniToolbarConfig:_0x1e76da,hideHeader:_0x585d0b,showLoader:_0x76df62}){super(_0x3722e4),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x76df62),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x585d0b||(this['headerView']=new dh(_0x3722e4,{'showDiff':_0x36dea4}),this['headerView']['on']('toggleShowChanges',(_0x35e5c2,_0x97fe95)=>{this['areChangesVisible']=_0x97fe95['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x97fe95['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new gh(_0x3722e4,{'areActionsDisabled':_0x446fe9}),this['bodyView']['delegate'](...me)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0x3722e4,_0x1e76da,_0x36dea4),this['miniToolbarView']['delegate'](...me)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x4c6dc6,_0x54c1b1)=>{this['areChangesVisible']=_0x54c1b1,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x54c1b1});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new jr(this['locale']),this['children']['add'](this['sourcesView']),_0x76df62&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x2f5328){await this['bodyView']['updateContentParts'](_0x2f5328);}['updateSources'](_0xe889b3){this['sourcesView']['children']['addMany'](_0xe889b3['map'](_0x4395b5=>new Sr(this['locale'],_0x4395b5))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x56559d=new _0x179f2b(this['locale']),_0x5467af=new Ve('small');_0x5467af['isVisible']=!0x0;const _0x15f77c=new _0x179f2b(this['locale']);return _0x15f77c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Vn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x56559d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x15caf1=>!_0x15caf1)]},'children':[_0x5467af,_0x15f77c]}),_0x56559d;}}class jr extends _0x179f2b{['children'];constructor(_0x3f556a){super(_0x3f556a),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',_0x2673c8=>!_0x2673c8)]},'children':this['children']});const _0x2e8692=new _0x179f2b(this['locale']),_0x31cd4b=new _0x30b390();_0x31cd4b['content']=_0x3732ee,_0x2e8692['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x31cd4b,{'tag':'span','children':[{'text':'Sources'}]}]}),this['children']['add'](_0x2e8692);}}class Sr extends _0x3678e7{constructor(_0x415138,_0x51bdba){super(_0x415138),this['set']({'icon':_0x3732ee,'label':_0x51bdba['title'],'tooltip':_0x51bdba['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});}}class hs extends _0x47fea8{constructor(_0x45758d,_0x50d7c0=!0x0,_0x5dd876=!0x0){super(_0x45758d),this['set']('isLoading',!0x1),_0x50d7c0&&(this['applyButton']=this['_createButton'](Vn(_0x45758d,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x2ef661=>!_0x2ef661),this['items']['add'](this['applyButton'])),_0x5dd876&&(this['suggestButton']=this['_createButton'](Vn(_0x45758d,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x70f001=>!_0x70f001),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x2cce3b,_0x230663){const _0x3b24d0=new _0x3678e7(this['locale']);return _0x3b24d0['set']({'label':_0x2cce3b,'class':_0x230663||'','isVisible':!0x0,'withText':!0x0}),_0x3b24d0;}}class rs extends _0x179f2b{constructor(_0x1a6a14){super(_0x1a6a14),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Vn(_0x1a6a14,'AI_DISCLAIMER_TEXT')}]}]});}}const A=['applySuggestion','insertSuggestion','showNext','showPrevious'];class j extends _0x179f2b{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x3d069b,_0x368107){super(_0x3d069b),this['set']('isLoading',!0x1),this['focusTracker']=new _0x54be86(),this['keystrokes']=new _0x46e306(),this['_focusables']=this['createCollection'](),this['focusCycler']=new ts({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x476d2b(),this['_addContentView'](_0x368107['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x368107['showApplyButton'],_0x368107['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']});}['render'](){super['render']();for(const _0x5792e2 of this['_focusables'])this['focusTracker']['add'](_0x5792e2['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5be86e){-0x1===_0x5be86e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x39a1b0){const _0x2ccb4d=this['_createNextButtonView'](),_0x88d023=this['_createPreviousButtonView']();_0x39a1b0['view']['headerView']['children']['add'](_0x2ccb4d,0x2),_0x39a1b0['view']['headerView']['children']['add'](_0x88d023,0x0),this['_focusables']['addMany']([_0x2ccb4d,_0x88d023]),this['focusTracker']['add'](_0x2ccb4d['element']),this['focusTracker']['add'](_0x88d023['element']);}['_addContentView'](_0x1e2864){this['_mainView']=_0x1e2864,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new rs(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x1e37c3=!0x0,_0xdd045e=!0x0){this['toolbar']=new hs(this['locale'],_0x1e37c3,_0xdd045e),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x1aa549=new _0x3678e7(this['locale']);return _0x1aa549['set']({'icon':_0x5210bf,'tooltip':Vn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x1aa549['on']('execute',()=>{this['fire']('showNext');}),_0x1aa549;}['_createPreviousButtonView'](){const _0xc19b96=new _0x3678e7(this['locale']);return _0xc19b96['set']({'icon':_0x5ef96b,'tooltip':Vn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0xc19b96['on']('execute',()=>{this['fire']('showPrevious');}),_0xc19b96;}}class m extends _0x150b32{static get['requires'](){return[o,a];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x2a4c18){const _0xeedf70=N(this['context']);this['_config']=_0x2a4c18,this['balloonView']=new j(_0xeedf70['locale'],_0x2a4c18),this['balloonView']['delegate'](...A)['to'](this),this['_showDialog'](_0x2a4c18);}['close'](){N(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x2ad40e,_0x1cc65d){this['context']['plugins']['get'](a)['showFakeVisualSelection'](_0x2ad40e,'ai-balloon-'+_0x1cc65d,!0x0,!0x0);}['_showDialog'](_0x4317d6){const _0x192aef=N(this['context']);this['_setupVisualSelection'](_0x4317d6['ranges'],_0x4317d6['index']),_0x192aef['plugins']['get']('Dialog')['show']({'title':_0x4317d6['title'],'icon':_0x4317d6['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x4317d6['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0xa12043=>{_0x4317d6['showRotator']&&this['balloonView']['setupRotator'](_0xa12043),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x4317d6['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5ab0a7,_0x11408a){const _0x226cfd=N(this['context']);if(!_0x11408a)return{'left':0x0,'top':0x0};const _0x21a6c2=_0x5f2efd(_0x226cfd['editing'],[..._0x226cfd['model']['markers']['getMarkersGroup']('ai-selection'),..._0x226cfd['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x21a6c2||0x0===_0x21a6c2['length'])return{'left':Math['round'](_0x11408a['left']+_0x11408a['width']/0x2-_0x5ab0a7['width']/0x2),'top':Math['round'](_0x11408a['top']+_0x11408a['height']/0x2-_0x5ab0a7['height']/0x2)};const _0x4eb159=Math['round'](_0x11408a['left']+_0x11408a['width']/0x2-_0x5ab0a7['width']/0x2),_0x37fba0=_0x21a6c2[0x0]['getBoundingClientRect'](),_0x15eb07=_0x21a6c2[_0x21a6c2['length']-0x1]['getBoundingClientRect'](),_0x5b43e1=_0x5ab0a7['height'],_0x548464=this['_config']['showRotator']?0x8:0x0;return{'left':_0x4eb159,'top':this['_calculateOptimalTopPosition'](_0x37fba0,_0x15eb07,_0x5b43e1,_0x548464)};}['_calculateOptimalTopPosition'](_0x3d06f6,_0x1e952c,_0x2f62d8,_0x228dcf=0x0){const _0x41e728=_0x1e952c['top']+_0x1e952c['height'],_0x4a135a=_0x3d06f6['top']-_0x2f62d8-_0x228dcf,_0x1df9d5=window['innerHeight']-_0x41e728-0xa,_0x5dea77=_0x3d06f6['top']-_0x228dcf-0xa;let _0x3df5cd;if(_0x1df9d5>=_0x2f62d8)_0x3df5cd=_0x41e728+0xa;else{if(_0x5dea77>=_0x2f62d8)_0x3df5cd=_0x4a135a-0xa;else _0x3df5cd=_0x3d06f6['top']+(_0x1e952c['top']+_0x1e952c['height'])/0x2-(_0x2f62d8+_0x228dcf)/0x2;}return _0x3df5cd;}}class tt extends _0x150b32{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[o,m,_0x122df6];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new ct({'connector':this['_aiConnector']});const _0x8f7e6a=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x4c5cf7,_0x47793f)=>{this['_handleUIUserMessage']({'userMessage':_0x47793f});}),this['listenTo'](_0x8f7e6a,'resizedTabs',(_0x54d6e5,_0x28c6f8)=>{this['_setIsMaximized'](_0x28c6f8);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x8f7e6a['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Vn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x49b47e,_0x2bb8a6)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2bb8a6));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xf2fa8a,_0x17471e)=>{this['activeConversation']?.['addUrlToContext'](_0x17471e);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1e0727,_0x46cbb6)=>{this['activeConversation']?.['addResourceToContext'](_0x46cbb6['source'],_0x46cbb6['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x5422cf,_0x507e9d)=>{this['_removeFromContext'](_0x507e9d);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x2eb417,_0x360bf4)=>{this['activeConversation']?.['loadSourceResources'](_0x360bf4['sourceId'],_0x360bf4['query'],_0x360bf4['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3a53ad,_0x46ab23)=>{this['activeConversation']?.['setModel'](_0x46ab23);}),this['listenTo'](this['_aiChatUi'],'like',(_0x54c7b3,{replyId:_0x193158})=>{console['log']('Liked\x20response',_0x193158);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x2dd3e2,{replyId:_0x5ae9b8})=>{console['log']('Disliked\x20response',_0x5ae9b8);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x33494a,_0x210ca3)=>{this['context']['plugins']['get'](m)['close'](),this['_insertSuggestion'](_0x210ca3);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x166455,{replyId:_0x4436a3,partIndex:_0x48d576})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4436a3,_0x48d576);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x24c1a8,{replyId:_0x4accf9,partIndex:_0x59f11c})=>{const _0xf6c55d=this['_getDocumentRangeForReplyChanges'](_0x4accf9,_0x59f11c);_0xf6c55d&&'$graveyard'!=_0xf6c55d['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0xf6c55d['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x48d697,_0x4cf8c2)=>{this['context']['plugins']['get'](m)['close'](),this['_applySuggestion'](_0x4cf8c2);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2b6cf3,_0x69b75)=>{const {reply:_0x1d0db5}=this['getInteractionAndReplyById'](_0x69b75['replyId']),_0x377b7e=d({'editor':N(this['context']),'changeGroups':_0x1d0db5['changeGroups'],'documentContextContent':_0x1d0db5['documentContextContent'],'showDiff':_0x69b75['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1d0db5['id'],'parts':_0x377b7e,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x37a791,{replyId:_0x3bf978,partIndex:_0x201bfd})=>{this['_previewedChangeGroup']?.['replyId']==_0x3bf978&&this['_previewedChangeGroup']?.['partIndex']==_0x201bfd&&this['context']['plugins']['get'](m)['close']();const {reply:_0x5cbf2e}=this['getInteractionAndReplyById'](_0x3bf978);_0x5cbf2e['setChangeGroupState'](_0x201bfd,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof st?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x34d034,_0x1eb25)=>{_0x1eb25['on']('ready',()=>{this['_integrateEditor'](_0x1eb25);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0x1c2932){const _0x5a5dfd=N(this['context']);if(!_0x5a5dfd['plugins']['has']('TrackChangesEditing'))return;const _0x1409d4=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x15841e,interaction:_0x139aa4}=this['getInteractionAndReplyById'](_0x1c2932['replyId']),_0x2a8c4e=this['_getDocumentRangeForReplyChanges'](_0x1c2932['replyId'],_0x1c2932['partIndex']),_0x14d622=void 0x0!==_0x1c2932['partIndex']?[_0x15841e['changeGroups'][_0x1c2932['partIndex']]]:_0x15841e['changeGroups']['filter'](_0x3f3145=>'pending'==_0x3f3145['state']),_0x317b64=_0x14d622['map'](_0x173e51=>_0x15841e['changeGroups']['indexOf'](_0x173e51));_0x317b64['forEach'](_0xc03d99=>_0x15841e['setChangeGroupState'](_0xc03d99,'accepted'));const _0x59ebfc=w({'editor':_0x5a5dfd,'reply':_0x15841e,'interaction':_0x139aa4,'groups':_0x14d622,'transform':!0x0,'documentCompare':_0x1409d4,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x21e012;_0x2a8c4e&&this['_scrollToSuggestionRange'](_0x2a8c4e['range']),_0x5a5dfd['model']['change'](_0x936a7f=>{_0x21e012=_0x936a7f['batch'],_0x5a5dfd['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x59ebfc),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x21e012,{'interactionId':_0x139aa4['id'],'replyId':_0x15841e['id'],'indexes':_0x317b64['slice']()});}['_applySuggestion'](_0x19f760){const _0x28271c=N(this['context']),_0x51fe48=this['context']['plugins']['get'](_0x122df6),{reply:_0x353b17,interaction:_0x1ba3a1}=this['getInteractionAndReplyById'](_0x19f760['replyId']),_0x2315b0=this['_getDocumentRangeForReplyChanges'](_0x19f760['replyId'],_0x19f760['partIndex']),_0x423a04=void 0x0!==_0x19f760['partIndex']?[_0x353b17['changeGroups'][_0x19f760['partIndex']]]:_0x353b17['changeGroups']['filter'](_0x4c8a4f=>'pending'==_0x4c8a4f['state']),_0x169657=_0x423a04['map'](_0x2a037e=>_0x353b17['changeGroups']['indexOf'](_0x2a037e));_0x169657['forEach'](_0x3af5e1=>_0x353b17['setChangeGroupState'](_0x3af5e1,'accepted'));const _0xd8e16=w({'editor':_0x28271c,'reply':_0x353b17,'interaction':_0x1ba3a1,'groups':_0x423a04,'transform':!0x0,'documentCompare':_0x51fe48,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x29ec76;_0x2315b0&&this['_scrollToSuggestionRange'](_0x2315b0['range']),_0x28271c['model']['change'](_0x59b3c7=>{_0x29ec76=_0x59b3c7['batch'];for(const _0x53fb27 of _0xd8e16)_0x53fb27['baseVersion']=_0x28271c['model']['document']['version'],_0x59b3c7['batch']['addOperation'](_0x53fb27),_0x28271c['model']['applyOperation'](_0x53fb27);}),this['_batchToChanges']['set'](_0x29ec76,{'interactionId':_0x1ba3a1['id'],'replyId':_0x353b17['id'],'indexes':_0x169657['slice']()});}['_openBalloonFor'](_0x1074e6,_0x39d4b6){const _0x185987=N(this['context']),_0x399059=this['_getDocumentRangeForReplyChanges'](_0x1074e6,_0x39d4b6),_0x36767f=this['context']['plugins']['get'](m);if(!_0x399059)return void _0x36767f['close']();const {range:_0x31de58,currentIndex:_0x443cc0,previousIndex:_0x2191bb,nextIndex:_0x6df28c}=_0x399059;if(this['_previewedChangeGroup']?.['replyId']==_0x1074e6&&this['_previewedChangeGroup']?.['partIndex']==_0x443cc0)return;this['_previewedChangeGroup']={'replyId':_0x1074e6,'partIndex':_0x443cc0};const _0x7b6c01=new s(_0x185987['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x567ef6}=this['getInteractionAndReplyById'](_0x1074e6),_0x31be14=d({'editor':_0x185987,'changeGroups':[_0x567ef6['changeGroups'][_0x443cc0]],'documentContextContent':_0x567ef6['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x7b6c01['updateContent']({'parts':_0x31be14,'renderingStrategy':'static'});const _0x563608=_0x443cc0!==_0x2191bb;this['_scrollToSuggestionRange'](_0x31de58,!0x0),_0x36767f['open']({'index':_0x443cc0,'title':'Suggestion\x20'+(_0x443cc0+0x1),'icon':It,'mainView':_0x7b6c01,'showRotator':_0x563608,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x31de58]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1074e6,_0x443cc0),this['listenTo'](_0x7b6c01,'toggleSuggestionDisplayMode',(_0xc0ae66,{showDiff:_0x1a5c7d})=>{this['_balloonShowDiff']=_0x1a5c7d;const {reply:_0x32ef86}=this['getInteractionAndReplyById'](_0x1074e6),_0xacdf66=d({'editor':_0x185987,'changeGroups':[_0x32ef86['changeGroups'][_0x443cc0]],'documentContextContent':_0x32ef86['documentContextContent'],'showDiff':_0x1a5c7d});_0x7b6c01['updateContent']({'parts':_0xacdf66,'renderingStrategy':'static'});}),this['listenTo'](_0x36767f,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x1074e6,'partIndex':_0x443cc0}),_0x563608?this['_openBalloonFor'](_0x1074e6,_0x6df28c):_0x36767f['close']();}),this['listenTo'](_0x36767f,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x1074e6,'partIndex':_0x443cc0}),_0x563608?this['_openBalloonFor'](_0x1074e6,_0x6df28c):_0x36767f['close']();}),_0x563608&&(this['listenTo'](_0x36767f,'showNext',()=>{this['_openBalloonFor'](_0x1074e6,_0x6df28c);}),this['listenTo'](_0x36767f,'showPrevious',()=>{this['_openBalloonFor'](_0x1074e6,_0x2191bb);})),this['listenTo'](_0x36767f,'dialogClosed',()=>{this['stopListening'](_0x36767f),this['stopListening'](_0x7b6c01),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x53c0c4,_0x1b6feb){const _0x4f5c4b=N(this['context']),{reply:_0x1b8b0b,interaction:_0x50690f}=this['getInteractionAndReplyById'](_0x53c0c4),_0x51c469=_0x1b8b0b['changeGroups']['filter'](_0x36efbe=>'pending'==_0x36efbe['state']),_0x4c7082=_0x51c469['map'](_0x50a638=>_0x1b8b0b['changeGroups']['indexOf'](_0x50a638));void 0x0===_0x1b6feb&&(_0x1b6feb=_0x4c7082[0x0]);const _0x49b8a6=_0x4c7082['indexOf'](_0x1b6feb);if(-0x1==_0x49b8a6)return null;const _0x108b6b=0x0==_0x49b8a6?_0x4c7082[_0x4c7082['length']-0x1]:_0x4c7082[_0x49b8a6-0x1],_0x3c8ef4=_0x49b8a6==_0x4c7082['length']-0x1?_0x4c7082[0x0]:_0x4c7082[_0x49b8a6+0x1],_0x107c56=_0x51c469[_0x49b8a6],_0x3108f0=new Ct([]),_0x3cc571=new Ct([]);for(const _0x126e4e of _0x107c56['changes'])if('removed'!=_0x126e4e['type']&&_0x3cc571['children']['push'](_0x126e4e['node']['cloneNode'](!0x0)),'new'!=_0x126e4e['type']){const _0x68d8cd=ut(_0x206732=>mt(_0x206732,'data-id')==_0x126e4e['id'],_0x1b8b0b['documentContextContent'],!0x0);_0x3108f0['children']['push'](_0x68d8cd['cloneNode'](!0x0));}if(0x0==_0x3108f0['children']['length']){if(_0x107c56['changes'][0x0]['anchorId']){const _0x194a1f=_t('data-id',_0x107c56['changes'][0x0]['anchorId'],_0x1b8b0b['documentContextContent']);_0x3108f0['children']['unshift'](_0x194a1f['cloneNode'](!0x0)),_0x3cc571['children']['unshift'](_0x194a1f['cloneNode'](!0x0)),_0x194a1f['nextSibling']&&(_0x3108f0['children']['push'](_0x194a1f['nextSibling']['cloneNode'](!0x0)),_0x3cc571['children']['push'](_0x194a1f['nextSibling']['cloneNode'](!0x0)));}else{const _0x1fe94d=_0x1b8b0b['documentContextContent']['children'][0x0];if(!_0x1fe94d)return null;_0x3108f0['children']['push'](_0x1fe94d['cloneNode'](!0x0)),_0x3cc571['children']['push'](_0x1fe94d['cloneNode'](!0x0));}}const _0x58cfd6=_0x50690f['getDocumentContext'](),_0x597f37=_0x4f5c4b['data']['parse'](_0x58cfd6['content']),_0x3ba2c4=ft(_0x3108f0),_0x4eb903=_0x4f5c4b['data']['parse'](_0x3ba2c4),_0x5cab89=_0x4f5c4b['data']['parse'](_0x3ba2c4),_0x43655a=_0x4f5c4b['model']['createPositionAt'](_0x4eb903,0x0),_0x3c24e4=ft(_0x3cc571),_0x22a5ba={'anchor':_0x43655a,'markDeletions':!0x1},_0x768983=_0x4f5c4b['plugins']['get'](_0x122df6)['getDiff'](_0x3ba2c4,_0x3c24e4,_0x22a5ba)['getOperations']();if(!_0x768983['length'])return null;_0x4f5c4b['model']['change'](_0x461128=>{for(const _0x50b1d2 of _0x768983)if('remove'==_0x50b1d2['type']){const _0x4a9b14=_0x50b1d2['sourcePosition'],_0x1d34a7=_0x50b1d2['howMany'],_0xf91779=new pt(_0x4a9b14,_0x1d34a7);_0x461128['batch']['addOperation'](_0xf91779),_0x4f5c4b['model']['applyOperation'](_0xf91779);}else _0x50b1d2['baseVersion']=null,_0x50b1d2['isDocumentOperation']=!0x1,_0x461128['batch']['addOperation'](_0x50b1d2),_0x4f5c4b['model']['applyOperation'](_0x50b1d2);});const _0xd0443f=gt(_0x4f5c4b,_0x768983,_0x4eb903);lt(_0x4f5c4b['model'],_0xd0443f);const _0x4c2d75=_0xd0443f['getFirstRange']()['start']['path']['slice'](),_0x2e81fc=_0xd0443f['getFirstRange']()['end']['path']['slice'](),_0x1936a6=[];let _0x3efd83=_0x4eb903,_0x1fc0ef=_0x5cab89;for(let _0x1ca286=0x0;_0x1ca286<_0x2e81fc['length'];_0x1ca286++){const _0xc2d950=_0x3efd83['maxOffset']-_0x2e81fc[_0x1ca286];_0x1936a6[_0x1ca286]=_0x1fc0ef['maxOffset']-_0xc2d950,_0x3efd83=_0x3efd83['getChildAtOffset'](_0x2e81fc[_0x1ca286]),_0x1fc0ef=_0x1fc0ef['getChildAtOffset'](_0x1936a6[_0x1ca286]);}const _0x2399e9=_0x4f5c4b['model']['createRange'](_0x4f5c4b['model']['createPositionFromPath'](_0x5cab89,_0x4c2d75),_0x4f5c4b['model']['createPositionFromPath'](_0x5cab89,_0x1936a6)),_0x36c971=_0x5cab89['getChild'](0x0)['getAttribute'](dt),_0x1eb78=Array['from'](_0x597f37['getChildren']())['find'](_0x3790e4=>_0x3790e4['getAttribute'](dt)==_0x36c971)['getPath'](),_0x4772f2=_0x2399e9['start']['path']['slice'](),_0x4ae894=_0x2399e9['end']['path']['slice']();_0x4772f2[0x0]=_0x1eb78[0x0]+_0x4772f2[0x0],_0x4ae894[0x0]=_0x1eb78[0x0]+_0x4ae894[0x0];let _0x39993d=_0x4f5c4b['model']['createRange'](_0x4f5c4b['model']['createPositionFromPath'](_0x4f5c4b['model']['document']['getRoot'](),_0x4772f2),_0x4f5c4b['model']['createPositionFromPath'](_0x4f5c4b['model']['document']['getRoot'](),_0x4ae894));const _0x101d95=_0x4f5c4b['model']['document']['history']['getOperations'](_0x58cfd6['version']);for(const _0x3bd1d4 of _0x101d95)_0x39993d=_0xf5c05f['_createFromRanges'](_0x39993d['getTransformedByOperation'](_0x3bd1d4));return{'range':_0x39993d,'previousIndex':_0x108b6b,'nextIndex':_0x3c8ef4,'currentIndex':_0x1b6feb};}['_integrateEditor'](_0x46eb60){if(!_0x46eb60['plugins']['has']('Undo'))return;const _0x2ecd18=_0x46eb60['commands']['get']('undo'),_0x562f18=_0x46eb60['commands']['get']('redo');this['listenTo'](_0x2ecd18,'revert',(_0x5f180c,_0x6ebec6,_0x557020)=>{const _0x13d601=this['_batchToChanges']['get'](_0x6ebec6);if(!_0x13d601)return;const _0xbc4d45=this['activeConversation']['getInteraction'](_0x13d601['interactionId'])['getReply'](_0x13d601['replyId']);_0x13d601['indexes']['forEach'](_0x12d139=>_0xbc4d45['setChangeGroupState'](_0x12d139,'pending')),this['_batchToChanges']['delete'](_0x6ebec6),this['_batchToChanges']['set'](_0x557020,_0x13d601);}),this['listenTo'](_0x562f18,'revert',(_0x3536f0,_0x21d690,_0x17a304)=>{const _0x4ae06c=this['_batchToChanges']['get'](_0x21d690);if(!_0x4ae06c)return;const _0x5c5259=this['activeConversation']['getInteraction'](_0x4ae06c['interactionId'])['getReply'](_0x4ae06c['replyId']);_0x4ae06c['indexes']['forEach'](_0xadca09=>_0x5c5259['setChangeGroupState'](_0xadca09,'accepted')),this['_batchToChanges']['delete'](_0x21d690),this['_batchToChanges']['set'](_0x17a304,_0x4ae06c);});}async['loadConversation'](_0x38dad0){this['context']['plugins']['get'](m)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x4c3778=this['context']['plugins']['get'](rt);this['updateConversationTitle']('\x20'),_0x4c3778['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x38dad0);const {sessionId:_0x99378}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x38dad0,_0x99378),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Vn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x3cb2a7){console['error']('Failed\x20to\x20load\x20conversation',_0x3cb2a7);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x2e4eb2){this['activeConversation']['id']===_0x2e4eb2&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x1e876c=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x1e876c),this['activeConversation']?.['addCurrentDocumentToContext'](Vn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x5fc861,quickActionData:_0x12c066}){await this['_handleUIUserMessage']({'userMessage':_0x5fc861,'quickActionData':_0x12c066});}['getGroupId'](){const _0x1be4ee=this['context']['config']['get']('collaboration.channelId');if(!_0x1be4ee)throw new _0x516722('ai-chat-missing-channel-id',this);return _0x1be4ee;}async['_handleStartConversation'](_0x3d43f8){const _0x4fc0bc=this['context']['plugins']['get'](m);let _0x29d145;_0x4fc0bc['isOpen']&&_0x4fc0bc['close'](),_0x29d145=_0x3d43f8||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x1a82bf=this['getGroupId'](),_0x309145=_0x3d43f8||_0x215bb4();this['activeConversation']=new at({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x29d145,'conversationId':_0x309145,'group':_0x1a82bf,'getEditor':()=>N(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x2e00f2,_0x49be6f)=>{_0x49be6f['availableModels']=this['_filterModels'](_0x49be6f['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x49be6f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x3d43f8||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Vn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x1dbb59,_0x1590e0)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x1590e0['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x4511eb,_0x2bb37b)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2bb37b),this['_aiChatUi']['addFeedInteractionHeader'](_0x2bb37b);}),this['activeConversation']['on']('interactionStarted',(_0x4b9f74,_0x3ad219)=>{this['_aiChatUi']['startInteraction'](_0x3ad219);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3f159b,_0x45a0bb)=>{this['_aiChatUi']['removeFeedInteraction'](_0x45a0bb['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x420ab8,_0x476f5b,_0x3c30e8)=>{this['updateConversationTitle'](_0x476f5b,_0x3c30e8);}),this['activeConversation']['on']('replyCreated',(_0x199b55,_0x2ac61d)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x2ac61d['interactionId']}),'text-delta'===_0x2ac61d['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2ac61d):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2ac61d);}),this['activeConversation']['on']('replyContentUpdated',async(_0x4f62d2,_0x72ac31,_0x378084)=>{await this['_updateReplyContent']({'reply':_0x72ac31,'changeGroups':_0x378084});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x32b22f,{reply:_0x2f5d37,index:_0x507855,state:_0x1293eb})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x2f5d37['id'],'index':_0x507855,'state':_0x1293eb});}),this['activeConversation']['on']('contextItemAdded',(_0x276694,_0xda8409)=>{if(this['_aiChatUi']['addContextItem'](_0xda8409['contextItem'],_0xda8409['isLoading']),'selection'===_0xda8409['contextItem']['type']){const _0x2ca7dd=[...N(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x2ca7dd,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x48198e,_0x11a40a)=>{this['_aiChatUi']['removeContextItem'](_0x11a40a['uiId']),'current-document'==_0x11a40a['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x11a40a['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x34b68c,_0x5ea6f9)=>{this['_aiChatUi']['setContextItemLoading'](_0x5ea6f9['contextItem']['uiId'],_0x5ea6f9['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x6692bb,_0xd4b85e)=>{this['_aiChatUi']['setConversationContext'](_0xd4b85e['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5ad63c,_0x2027bc)=>{this['_aiChatUi']['setAddContextOptions'](_0x2027bc['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x8a1528,_0x347b73)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x347b73['sourceId'],_0x347b73['source'],_0x347b73['resources'],_0x347b73['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x18abce,_0x3deff2)=>{this['_aiChatUi']['updateResourceState'](_0x3deff2['sourceId'],_0x3deff2['resourceId'],_0x3deff2['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xc09036,_0x58c018)=>{this['_aiChatUi']['updateCapabilities'](_0x58c018);}),this['activeConversation']['on']('modelSelected',(_0x53317d,_0x59b527)=>{this['_aiChatUi']['setSelectedModel'](_0x59b527['selectedModel'],_0x59b527['isDisabled']);}),this['activeConversation']['on']('error',(_0x36b3ac,{error:_0x4f74e8,interactionId:_0x30b84f,fileName:_0x4fc7b4,url:_0x12cb81,sourceId:_0x17b6f9,sourceLabel:_0x37d098})=>{const _0x1cc36b=_0x30b84f?_0x30b84f+':'+_0x215bb4():_0x215bb4();_0x4f74e8['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Vn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1cc36b}):_0x4f74e8['message']['startsWith']('ai-chat-conversation-init-failed')||_0x4f74e8['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1cc36b}),this['_logError'](_0x4f74e8)):_0x4f74e8['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4fc7b4),'id':_0x1cc36b}):_0x4f74e8['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x12cb81),'id':_0x1cc36b}):_0x4f74e8['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1cc36b}):_0x4f74e8['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1cc36b}):_0x4f74e8['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x17b6f9&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x17b6f9),this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x37d098||'source'),'id':_0x1cc36b}),this['_logError'](_0x4f74e8)):_0x4f74e8['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1cc36b}),this['_logError'](_0x4f74e8)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Vn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1cc36b}),this['_logError'](_0x4f74e8));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x3d43f8||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x143906,quickActionData:_0x8fe59}){if(!this['activeConversation'])throw new _0x516722('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x143906,'quickActionData':_0x8fe59}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x1af7da=N(this['context'])['model'],_0x6a4359=Array['from'](_0x1af7da['markers']['getMarkersGroup'](ht));_0x1af7da['change'](_0x244137=>{_0x6a4359['forEach'](_0x5915db=>_0x244137['removeMarker'](_0x5915db));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x20c548){this['_aiChatUi']['setIsMaximized'](_0x20c548);}['_logError'](_0x204279){ot(_0x204279['message']);}['_removeFromContext'](_0x5ad78a){this['activeConversation']?.['removeFromContext'](_0x5ad78a);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x3411f0){const [_0x50857e,_0x1a31ec]=_0x3411f0['split'](':'),_0x336dcd=this['activeConversation']['getInteraction'](_0x50857e),_0x4edf3e=_0x336dcd['getReply'](_0x1a31ec);return{'interaction':_0x336dcd,'reply':_0x4edf3e};}['_scrollToSuggestionRange'](_0x3a73d6,_0x5590ea=!0x1){const _0x16eb55=N(this['context']),_0x8e5e7d={'target':_0x16eb55['editing']['view']['domConverter']['viewRangeToDom'](_0x16eb55['editing']['mapper']['toViewRange'](_0x3a73d6)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x5590ea};_0x5590ea&&(_0x8e5e7d['alignToTop']=!0x0),nt(_0x8e5e7d);}['updateConversationTitle'](_0x5d20e5,_0x3bf0fd=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5d20e5||Vn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3bf0fd);}['_filterModels'](_0x595cdb,_0x252354){let _0x5d0e34;if(_0x252354){_0x5d0e34=[];const _0x10c732='string'==typeof _0x252354?[_0x252354['toLocaleLowerCase']()]:_0x252354['map'](_0x4f5bfe=>_0x4f5bfe['toLocaleLowerCase']());for(const _0xcce12c of _0x10c732)for(const _0x529c94 of _0x595cdb)(_0x529c94['id']['toLocaleLowerCase']()===_0xcce12c||_0x529c94['name']['toLocaleLowerCase']()===_0xcce12c||_0x529c94['provider']['toLocaleLowerCase']()===_0xcce12c||_0x529c94['id']['toLocaleLowerCase']()['startsWith'](_0xcce12c))&&_0x5d0e34['push'](_0x529c94);}else _0x5d0e34=_0x595cdb;return _0x5d0e34;}async['_updateReplyContent']({reply:_0x168e4f,changeGroups:_0x497ee0,renderingStrategy:_0x2ac88f}){const {id:_0x1dd11e,isDone:_0xc0904d,type:_0x55fc7f,parsedContent:_0x53e172}=_0x168e4f;if('modification-delta'===_0x55fc7f){const _0x35aa3f=d({'editor':N(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x497ee0,'documentContextContent':_0x168e4f['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1dd11e,'parts':_0x35aa3f,'renderingStrategy':_0x2ac88f,'isDone':_0xc0904d});}else'text-delta'===_0x55fc7f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1dd11e,'parsedContent':_0x53e172,'renderingStrategy':_0x2ac88f,'isDone':_0xc0904d});_0xc0904d&&_0x168e4f['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1dd11e,_0x168e4f['sources']);}async['_stopLastInteraction'](){const _0x194b8b=this['activeConversation']?.['lastInteraction'];_0x194b8b&&(_0x194b8b['stop'](),this['_aiChatUi']['stopInteraction'](_0x194b8b));}async['_flushLastInteractionUI'](){const _0x16cfef=this['activeConversation']?.['lastInteraction'];if(_0x16cfef){for await(const _0xc82b36 of _0x16cfef['replies'])await this['_updateReplyContent']({'reply':_0xc82b36,'changeGroups':_0xc82b36['changeGroups'],'renderingStrategy':'static'});}}}const Pt=[...me,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends _0x179f2b{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x5948de){super(_0x5948de);const _0x34dfe8=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x25cf5d({'label':Vn(_0x5948de,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x73a439,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x25cf5d({'label':Vn(_0x5948de,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x1cfda4,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new zo(_0x5948de,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':Vn(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x34dfe8['if']('isVisible','ck-hidden',_0x22a51e=>!_0x22a51e)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x3a5a0e){const _0x2b5ea7=this['locale'];this['actionsDropdown']['set']({'label':Vn(_0x2b5ea7,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x3a5a0e),'tooltip':Vn(_0x2b5ea7,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x3a5a0e)}),this['showChangeInTextModel']['label']=Vn(_0x2b5ea7,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x3a5a0e),this['insertSuggestionModel']['label']=Vn(_0x2b5ea7,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x3a5a0e);}}class zo extends _0x38de22{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x3f8131,_0xc92c9c){super(_0x3f8131),this['balloonPanelView']=new _0x4f7937(this['locale']),this['bodyCollection']=new qt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0xc92c9c['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Vn(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Jo:Qo]}),this['listView']['focus']());}),_0x23c9f6({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x4a410b){const _0x3da862=this['locale'],_0x16fb52=new _0x56c802(_0x3da862);for(const _0x55ed30 of _0x4a410b){const _0x382329=new _0xfd7405(_0x3da862),_0x2c6783=new _0x4e5418(_0x3da862);_0x2c6783['bind'](...Object['keys'](_0x55ed30))['to'](_0x55ed30),_0x2c6783['delegate']('execute')['to'](_0x16fb52),_0x382329['children']['add'](_0x2c6783),_0x16fb52['items']['add'](_0x382329);}return _0x16fb52['items']['delegate']('execute')['to'](this),_0x16fb52['on']('execute',_0x1c9629=>{const _0x1ad117=_0x1c9629['source'];this['fire'](_0x1ad117['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x16fb52;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x46e306(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x2477ec,_0x52e608)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x52e608();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Jo(_0x89e604){return{'top':_0x89e604['bottom'],'left':_0x89e604['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Qo(_0x404fc8,_0x3f141e){return{'top':_0x404fc8['bottom'],'left':_0x404fc8['left']-(_0x3f141e['width']-_0x404fc8['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends Cr{['containerView'];['actionsView'];constructor(_0x4dcd95,_0x2aa0d9){super(_0x2aa0d9),this['containerView']=new s(_0x4dcd95,{'showDiff':_0x2aa0d9['showDiff'],'areActionsDisabled':_0x2aa0d9['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0xd0527d,_0x3e32a4)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3e32a4['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x3f80d9,{index:_0x33cf34})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x33cf34});}),this['containerView']['on']('insertSuggestion',(_0x4b404b,{index:_0xda5187})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0xda5187});}),this['containerView']['on']('rejectSuggestion',(_0x3c1d38,{index:_0x1e3a0a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1e3a0a});}),this['containerView']['on']('mouseOverSuggestion',(_0x510275,{index:_0x4b6b3b})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b6b3b});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x59350f,{index:_0x268997})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x268997});}),this['actionsView']=new nh(_0x4dcd95),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x2aa0d9['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x223f16){await this['containerView']['updateContent'](_0x223f16),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x54ed41,_0x10f6be){this['containerView']['bodyView']['updatePartState'](_0x54ed41,_0x10f6be);}['updateSources'](_0x32e803){this['containerView']['updateSources'](_0x32e803);}['getPartView'](_0x2815e7){return this['containerView']['bodyView']['getPartView'](_0x2815e7);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Se extends Cr{['replyContainer'];constructor(_0xd3b041){super(_0xd3b041),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x179f2b(),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':Ye(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x143bfc,renderingStrategy:_0x38f898,abortSignal:_0x130531}){'streaming'===_0x38f898?await this['streamIntoElement'](_0x143bfc,this['replyContainer']['element'],_0x130531):this['replyContainer']['element']['innerHTML']=_0x2d3ed1(_0x143bfc);}['updateSources'](_0xa41390){const _0x2e229c=new jr(this['locale']);_0x2e229c['children']['addMany'](_0xa41390['map'](_0x5294a6=>new Sr(this['locale'],_0x5294a6))),_0x2e229c['isVisible']=!0x0,this['children']['add'](_0x2e229c);}}const mn={'file':_0x2545bc,'document':_0x4dc2d9,'web-resource':_0x5987a4,'text':_0x2545bc,'selection':_0x1a306c},qn='ck-ai-chat-context-chip',$n='ck-ai-chat-context-chip_wide',Qn='ck-ai-chat-context-chip_document',Xn='ck-ai-chat-context-chip__label',zn='ck-ai-chat-context-chip__type-icon',jn='ck-ai-chat-context-controls__chip-tooltip',wn='n';class mo extends _0x3678e7{constructor(_0xc3857,_0x246837,_0x408a52,_0x3fb159,_0x13e1f4=!0x1){super(_0xc3857),this['_isAnimationOnEnterEnabled']=_0x3fb159,this['_initializeProperties'](_0x246837,_0x408a52,_0x13e1f4),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'](_0x563070,_0x50b0e4,_0xa097ba){this['set']('label',_0x563070['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x563070['type']),this['set']('id',_0x563070['uiId']),this['set']('readonly',_0x50b0e4),this['set']('isLoading',_0xa097ba);}['_setupTemplate'](){const _0x167a6e=this['_createIconView'](),_0x51540c=this['_createRemoveButton'](),_0x5a01d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x5a01d5),'children':this['_createTemplateChildren'](_0x167a6e,_0x51540c,_0x5a01d5)});}['_createTemplateAttributes'](_0x25d1d2){return{'class':[qn,_0x25d1d2['if']('itemType',Qn,_0x2cc7ea=>'document'==_0x2cc7ea),_0x25d1d2['if']('itemType',$n,_0x28f65e=>'selection'==_0x28f65e)],'data-cke-tooltip-text':_0x25d1d2['to']('label',Tn),'data-cke-tooltip-position':wn,'data-cke-tooltip-class':jn};}['_createTemplateChildren'](_0x2f3e8d,_0x2de793,_0x5d7e20){const _0x4d4d8f=this['_createLabelElement'](_0x5d7e20),_0x441410=this['_createLoaderIcon']();return this['readonly']?[_0x2f3e8d,_0x4d4d8f]:[_0x2f3e8d,_0x441410,_0x4d4d8f,_0x2de793];}['_createLabelElement'](_0x1c8326){return{'tag':'span','attributes':{'class':Xn},'children':[{'text':_0x1c8326['to']('label')}]};}['_createRemoveButton'](){const _0x55bbc9=new _0x3678e7(this['locale']);return _0x55bbc9['set']({'label':Vn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x3be0ad}),this['_setupRemoveButtonEvent'](_0x55bbc9),_0x55bbc9;}['_setupRemoveButtonEvent'](_0x5a9ff8){_0x5a9ff8['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x310b5e=this['bindTemplate'],_0x451d82=new _0x30b390();return _0x451d82['content']=mn[this['itemType']],_0x451d82['extendTemplate']({'attributes':{'class':[zn,_0x310b5e['if']('isLoading','ck-hidden',_0x2dd39=>_0x2dd39)]}}),_0x451d82;}['_handleAnimationEndOnce'](_0x49763e,_0x2933b3){if(!_0x49763e)return;const _0x2b10bb=()=>{_0x2933b3(),_0x49763e['removeEventListener']('animationend',_0x2b10bb),_0x49763e['removeEventListener']('webkitAnimationEnd',_0x2b10bb);};_0x49763e['addEventListener']('animationend',_0x2b10bb),_0x49763e['addEventListener']('webkitAnimationEnd',_0x2b10bb);}['_createLoaderIcon'](){const _0x4fd61e=new Ve('small');return _0x4fd61e['bind']('isVisible')['to'](this,'isLoading',_0x1565be=>_0x1565be),_0x4fd61e;}}function Tn(_0x3ce112){if(!_0x3ce112)return _0x3ce112;if(_0x3ce112['length']<=0x78)return _0x3ce112;const _0xb8a8e7=_0x3ce112['slice'](0x0,0x78),_0x316c39=_0xb8a8e7['lastIndexOf']('\x20');return(_0x316c39>0x0?_0xb8a8e7['slice'](0x0,_0x316c39):_0xb8a8e7)+'…';}const sn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},hn='300px';class po{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0xe5ad7d,_0x3b6c8e,_0x18c4a1,_0x17e021,_0x5daaac){this['_locale']=_0xe5ad7d,this['_visibleChips']=_0x3b6c8e,this['_config']={...sn,..._0x18c4a1,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x18c4a1['cssClasses']}},this['_overflowChips']=new _0x3febd7(),this['_bodyCollection']=_0x17e021,this['_parentView']=_0x5daaac||null;}['setContainerElement'](_0x12d056){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x12d056,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 _0x28486e=[...this['_visibleChips'],...this['_overflowChips']],_0x44a988=this['_createCalculationContainer'](),_0x5d1bb8=this['_calculateOverflowInContainer'](_0x44a988,_0x28486e),_0x5f44e0=_0x44a988['_ancestorsToRestore'];_0x5f44e0&&this['_restoreAncestorVisibility'](_0x5f44e0),_0x44a988['remove'](),this['_applyOverflowResults'](_0x28486e,_0x5d1bb8);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x23c9f6({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x30d2cf=new _0x3678e7(this['_locale']);_0x30d2cf['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x5e2b3=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x5e2b3['push'](this['_config']['cssClasses']['controlsButton']),_0x30d2cf['extendTemplate']({'attributes':{'class':_0x5e2b3}}),_0x30d2cf;}['_createShowMoreBalloonPanelView'](){const _0x2cf22c=new _0x4f7937(this['_locale']);return _0x2cf22c['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2cf22c),_0x2cf22c;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x4ee5dc=>{_0x4ee5dc['disableAnimationOnEnter']();});const _0x440689=new _0x179f2b(this['_locale']);_0x440689['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x440689);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x45a73b=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x45a73b?'':'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'](_0x84c7f1){const _0x1f6343=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5b8f05=this['_containerElement']?.['classList'];if(_0x5b8f05){const _0x477b0f=_0x5b8f05[0x0]||'',_0x4de5a3=_0x84c7f1['querySelector']('.'+_0x477b0f),_0x3f91e8=_0x84c7f1['querySelector'](_0x1f6343);return _0x4de5a3||_0x3f91e8||_0x84c7f1;}return _0x84c7f1['querySelector'](_0x1f6343)||_0x84c7f1;}['_calculateContainerWidth'](){const _0x230b5e=this['_parentView']?.['element']||this['_containerElement'];if(!_0x230b5e)return hn;const _0x206a72=window['getComputedStyle'](_0x230b5e)['width'];if('auto'===_0x206a72||'0px'===_0x206a72||!_0x206a72){const _0x318076=_0x230b5e['parentElement'];if(_0x318076){const _0x3d1465=window['getComputedStyle'](_0x318076);return'auto'!==_0x3d1465['width']?_0x3d1465['width']:hn;}return hn;}return _0x206a72;}['_applyCalculationStyles'](_0x1a32f6,_0x15b13c){this['_config']['cssClasses']['calculationContainer']&&_0x1a32f6['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1a32f6['style']['width']=_0x15b13c,_0x1a32f6['style']['position']='absolute',_0x1a32f6['style']['top']='-9999px',_0x1a32f6['style']['left']='-9999px',_0x1a32f6['style']['opacity']='0',_0x1a32f6['style']['pointerEvents']='none',_0x1a32f6['style']['zIndex']='-1',_0x1a32f6['style']['visibility']='visible\x20!important',_0x1a32f6['style']['display']='block\x20!important',_0x1a32f6['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x73183d){_0x73183d['forEach'](({element:_0xccbcf1,originalDisplay:_0x1ffe24,originalVisibility:_0x300630})=>{_0xccbcf1['style']['display']=_0x1ffe24,_0xccbcf1['style']['visibility']=_0x300630;});}['_makeAncestorsVisible'](_0x5ddd8e){const _0x22048d=[];let _0x3114ab=_0x5ddd8e;for(;_0x3114ab&&_0x3114ab!==document['body'];){const _0x224f2e=window['getComputedStyle'](_0x3114ab);'none'!==_0x224f2e['display']&&'hidden'!==_0x224f2e['visibility']||(_0x22048d['push']({'element':_0x3114ab,'originalDisplay':_0x3114ab['style']['display'],'originalVisibility':_0x3114ab['style']['visibility']}),_0x3114ab['style']['display']='block',_0x3114ab['style']['visibility']='visible'),_0x3114ab=_0x3114ab['parentElement'];}return _0x22048d;}['_createContainerElements'](){let _0x5f3f97,_0x3cc4eb;return this['_parentView']?.['element']?(_0x5f3f97=this['_parentView']['element']['cloneNode'](!0x0),_0x3cc4eb=this['_findTargetContainer'](_0x5f3f97)):(_0x5f3f97=document['createElement']('div'),_0x3cc4eb=_0x5f3f97),{'calculationContainer':_0x5f3f97,'targetContainer':_0x3cc4eb};}['_createCalculationContainer'](){const {calculationContainer:_0xfb2dd4,targetContainer:_0x1e4e94}=this['_createContainerElements'](),_0x35de40=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0xfb2dd4,_0x35de40);const _0x1449e9=this['_parentView']?.['element']||this['_containerElement'],_0x239564=_0x1449e9?.['parentElement'];_0x239564?_0x239564['appendChild'](_0xfb2dd4):document['body']['appendChild'](_0xfb2dd4),_0xfb2dd4['_targetContainer']=_0x1e4e94;const _0x3d3cce=this['_makeAncestorsVisible'](_0x239564||null);return _0xfb2dd4['offsetWidth'],_0xfb2dd4['_ancestorsToRestore']=_0x3d3cce,_0xfb2dd4;}['_calculateOverflowInContainer'](_0x1944f8,_0x2c2993){const _0x3975e9=_0x1944f8['_targetContainer']||_0x1944f8,_0x473291=[],{rowCount:_0x482a2d}=this['_renderChipsAndCountRows'](_0x3975e9,_0x2c2993);if(_0x482a2d<=this['_config']['maxVisibleRows'])return _0x473291;const _0x263c7c=_0x2c2993['slice']();for(;_0x263c7c['length']>0x0;){if(this['_testButtonFit'](_0x1944f8,_0x3975e9,_0x263c7c)){const _0x3597f8=_0x2c2993['filter'](_0x497b9a=>!_0x263c7c['includes'](_0x497b9a));_0x473291['push'](..._0x3597f8);break;}if(!_0x263c7c['pop']())break;}return _0x473291;}['_renderChipsAndCountRows'](_0x428b1f,_0x121f55){_0x428b1f['innerHTML']='',_0x121f55['forEach'](_0x3e67c9=>{if(_0x3e67c9['element']){const _0x16767c=_0x3e67c9['element']['cloneNode'](!0x0);_0x428b1f['appendChild'](_0x16767c);}}),_0x428b1f['offsetWidth'];const _0x1405d9=_0x428b1f['children'],_0x32bbf6=[];return Array['from'](_0x1405d9)['forEach'](_0x5abdec=>{const _0xeae769=_0x5abdec['getBoundingClientRect']()['top'];_0x32bbf6['some'](_0x994bf=>Math['abs'](_0x994bf-_0xeae769)<this['_config']['rowDetectionTolerance'])||_0x32bbf6['push'](_0xeae769);}),{'rowCount':_0x32bbf6['length']};}['_createMockButton'](){const _0x2f49d1=document['createElement']('button');return _0x2f49d1['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2f49d1['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2f49d1['textContent']='+\x201',_0x2f49d1;}['_testButtonFit'](_0x5a64c9,_0x54b808,_0x1a10ec){this['_renderChipsAndCountRows'](_0x54b808,_0x1a10ec);const _0x499a72=this['_createMockButton']();_0x5a64c9['appendChild'](_0x499a72),_0x5a64c9['offsetWidth'];const _0x133d86=[..._0x54b808['children'],_0x499a72],_0x1ec2db=[];_0x133d86['forEach'](_0x2316d3=>{const _0x4a0d9c=_0x2316d3['getBoundingClientRect']()['top'];_0x1ec2db['some'](_0x35ca14=>Math['abs'](_0x35ca14-_0x4a0d9c)<this['_config']['rowDetectionTolerance'])||_0x1ec2db['push'](_0x4a0d9c);});const _0x2c6681=_0x1ec2db['length'];return _0x499a72['remove'](),_0x2c6681<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x3a6cdf,_0x44ad5d){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x3a6cdf['forEach'](_0x2ddfa3=>{_0x44ad5d['includes'](_0x2ddfa3)?this['_overflowChips']['add'](_0x2ddfa3):this['_visibleChips']['add'](_0x2ddfa3);});}['_updateOverflowUI'](_0x268188){if(_0x268188>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x268188>0x0&&this['_showMoreButtonView']){const _0x19629f=''+this['_config']['showMoreLabelPrefix']+(_0x268188<0x63?_0x268188:'99');this['_showMoreButtonView']['label']=_0x19629f;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1ecbd8,_0xa1a695){this['_distributeChips'](_0x1ecbd8,_0xa1a695),this['_updateOverflowUI'](_0xa1a695['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x475430=>{_0x475430[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 _0x297677=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x297677['width']||0x0===_0x297677['height'])return!0x1;const _0x1aba2c=window['innerHeight']||document['documentElement']['clientHeight'],_0x4828eb=window['innerWidth']||document['documentElement']['clientWidth'],_0x201fc9=0xc8;return _0x297677['bottom']>=-0xc8&&_0x297677['top']<=_0x1aba2c+_0x201fc9&&_0x297677['right']>=-0xc8&&_0x297677['left']<=_0x4828eb+_0x201fc9;}}const Jn='ck-ai-chat__feed__context-chips',Zn='ck-ai-chat-context-chips-wrapper',Nr='ck-ai-chat-context-chips-wrapper-balloon',Pr='ck-ai-chat-controls-button',Dr='ck-ai-chat-controls_context_show-more-button',Gr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x179f2b{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x36c21e,_0x46a6ad,_0x14fdf7){super(_0x36c21e),this['_bodyCollection']=_0x14fdf7,this['_createContextChips'](_0x46a6ad);const _0x870cc4={'cssClasses':{'showMoreButton':Dr,'showMoreBalloon':Gr,'overflowContainer':Nr,'controlsButton':Pr}};this['_overflowManager']=new po(_0x36c21e,this['_contextChips'],_0x870cc4,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Jn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Zn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1dc482=this['element']['querySelector']('.'+Zn);_0x1dc482&&(this['_overflowManager']['setContainerElement'](_0x1dc482),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x963a06){for(const _0x30a069 of _0x963a06){const _0x5137ef=new mo(this['locale'],_0x30a069,!0x0,!0x1);this['_contextChips']['add'](_0x5137ef);}}}class ve extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x4e0b47,_0x4edbe4,_0x5b568d){super(_0x4edbe4),this['_locale']=_0x4e0b47,this['_bodyCollection']=_0x5b568d,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'](_0x190a57=>!_0x190a57['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x179f2b(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Rt extends Cr{constructor(_0x3575f1,_0x56a62c){super(_0x56a62c);const {isWebSearchEnabled:_0xccb0f3,isReasoningEnabled:_0x13f2b1}=_0x56a62c['capabilities'],_0x479226=[];let _0x5a67d3='';_0xccb0f3&&_0x13f2b1?(_0x5a67d3=Vn(_0x3575f1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x479226['push'](e_(_0x3732ee)),_0x479226['push'](e_(_0x11c39e))):_0xccb0f3?(_0x5a67d3=Vn(_0x3575f1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x479226['push'](e_(_0x3732ee))):_0x13f2b1&&(_0x5a67d3=Vn(_0x3575f1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x479226['push'](e_(_0x11c39e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5a67d3?'':'ck-hidden']}});const _0x527d5e=new _0x179f2b();_0x527d5e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x479226,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5a67d3]}]}),this['children']['add'](_0x527d5e);}}function e_(_0x972428){const _0x2b13e7=new _0x30b390();return _0x2b13e7['content']=_0x972428,_0x2b13e7;}const ls=['wheel','touchstart','pointerdown','keydown'],ms=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class _e{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x22fb5d){this['element']=_0x22fb5d,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x3c0de8 of ls){const _0x4d7822='keydown'!==_0x3c0de8;this['element']['addEventListener'](_0x3c0de8,this['_onUserEvent']['bind'](this),{'passive':_0x4d7822,'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'](_0x378d77){if(this['isRunning']){if('keydown'===_0x378d77['type']){const _0x18a47b=_0x378d77['key'];if(!ms['includes'](_0x18a47b))return;}_0x378d77 instanceof WheelEvent?_0x378d77['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4cca27,scrollHeight:_0x52dda5,clientHeight:_0x2232c3}=this['element'];return _0x52dda5-_0x4cca27-_0x2232c3<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class je extends _0x179f2b{constructor(_0x3c2834,_0x30c76f){super(_0x3c2834),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x30c76f)});}['_createSkeletonItems'](_0xcfdbb7){const _0x16b56e=['ck','ck-ai-skeleton__item'];return _0xcfdbb7['map'](_0x12c38a=>{let _0x5c5f90='';switch(_0x12c38a['attributes']['align']){case'right':_0x5c5f90='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5c5f90='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5c5f90='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x12c38a['tag'],'attributes':{'class':[..._0x16b56e,_0x12c38a['attributes']['class']?_0x12c38a['attributes']['class']:''],'style':'width:\x20'+_0x12c38a['attributes']['width']+';\x20height:\x20'+_0x12c38a['attributes']['height']+';'+_0x5c5f90}};});}}const Le={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':$i(0x5,'100%','44px','right'),'aiChatResources':$i(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function $i(_0xee31f0,_0x366b7c,_0x493ebc,_0x10fffa){return new Array(_0xee31f0)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x366b7c,'height':_0x493ebc,'align':_0x10fffa}}));}class ji extends _0x179f2b{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x486ec1,_0x4e3863){super(_0x486ec1),this['_bodyCollection']=_0x4e3863,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new _e(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x4180e4,_0x4a5f48){let _0x21b9ae;_0x21b9ae='ai-reply'===_0x4180e4?new Se(_0x4a5f48):'ai-suggestion-reply'===_0x4180e4?new ke(this['locale'],_0x4a5f48):'user-message'===_0x4180e4?new ve(this['locale'],_0x4a5f48,this['_bodyCollection']):'interaction-header'===_0x4180e4?new Rt(this['locale'],_0x4a5f48):new ye(_0x4a5f48),this['children']['add'](_0x21b9ae);}async['updateReplyItem']({id:_0x1faaff,parsedContent:_0x467168,renderingStrategy:_0x2ab426,abortSignal:_0x385e92}){const _0x510cd0=this['getItemById'](_0x1faaff);if(!(_0x510cd0 instanceof Se))throw new _0x516722('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x510cd0,'id':_0x1faaff,'parsedContent':_0x467168});await _0x510cd0['updateContent']({'parsedContent':_0x467168,'renderingStrategy':_0x2ab426,'abortSignal':_0x385e92});}async['updateWebSources'](_0x10b1a7,_0x496eaa){const _0x56e855=this['getItemById'](_0x10b1a7);if(_0x56e855 instanceof ke)_0x56e855['updateSources'](_0x496eaa);else{if(!(_0x56e855 instanceof Se))throw new _0x516722('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x56e855,'id':_0x10b1a7,'sources':_0x496eaa});_0x56e855['updateSources'](_0x496eaa);}}async['updateSuggestionItem']({id:_0x9e9a7c,parts:_0xaf8a87,renderingStrategy:_0x40fcd7,abortSignal:_0x3fa8f5}){const _0x1359d0=this['getItemById'](_0x9e9a7c);if(!(_0x1359d0 instanceof ke))throw new _0x516722('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1359d0,'id':_0x9e9a7c,'parts':_0xaf8a87});await _0x1359d0['updateContent']({'parts':_0xaf8a87,'renderingStrategy':_0x40fcd7,'abortSignal':_0x3fa8f5});}['updateSuggestionPartState']({id:_0x447147,index:_0x3e7270,state:_0x17b2c9}){const _0x4384a4=this['getItemById'](_0x447147);if(!(_0x4384a4 instanceof ke))throw new _0x516722('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x447147});_0x4384a4['updatePartState'](_0x3e7270,_0x17b2c9);}['markItemAsDone'](_0x6db749){this['getItemById'](_0x6db749)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x32fdd1=>_0x32fdd1['options']['id']);}['removeItem'](_0x413e82){this['children']['remove'](this['getItemById'](_0x413e82));}['scrollToSuggestion'](_0xa5544e,_0x576a5a){const _0x315d0d=this['getItemById'](_0xa5544e);if(!(_0x315d0d instanceof ke))return void _0x170b6a('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xa5544e,'partIndex':_0x576a5a});const _0x378cb0=_0x315d0d['getPartView'](_0x576a5a);_0x378cb0?nt({'target':_0x378cb0['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x170b6a('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xa5544e,'partIndex':_0x576a5a});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x35e597=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x35e597,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x4aaa99=new je(this['locale'],Le['aiFeed']);return _0x4aaa99['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x340ad2=>!_0x340ad2)]}}),_0x4aaa99;}['_createFeedItems'](){const _0x2e5a8b=new _0x179f2b(this['locale']);return _0x2e5a8b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x2e5a8b;}['_createFeedLoader'](){const _0x23919a=new _0x179f2b(this['locale']);return _0x23919a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x442427=>!_0x442427)]},'children':this['_createLoaderChildren']()}),_0x23919a;}['_createLoaderChildren'](){const _0x37d996=new Ve();return _0x37d996['isVisible']=!0x0,[_0x37d996,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x52ceae){const _0x1c0fe2=this['children']['find'](_0x575c07=>_0x575c07['options']['id']['includes'](_0x52ceae));if(!_0x1c0fe2)throw new _0x516722('ai-chat-feed-view-item-not-found',this,{'id':_0x52ceae});return _0x1c0fe2;}['setLoadingMessage'](_0x1f1e3c){this['set']('loadingMessage',_0x1f1e3c);}['toggleLoadingSkeleton'](_0x3c72b6){this['set']('isLoadingSkeletonVisible',_0x3c72b6);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x56c802{['filter'](){let _0x5ad563=0x0;for(const _0x49a03e of this['items'])_0x5ad563+=_0x49a03e['items']['length'];return{'resultsCount':_0x5ad563,'totalItemsCount':_0x5ad563};}}class we extends _0x352dbb{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x315714,_0x1fef1a){super(_0x315714,{'queryView':{'label':'','creator':_0x5432a7,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x315714),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x1fef1a,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=we['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=we['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',(_0xe87615,_0xfa32c6)=>!_0xe87615&&!_0xfa32c6),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x27af3d,_0xbe5c3b)=>{this['isUploadInProgress']||this['isEmpty']||_0x27af3d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xbe5c3b());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x471698=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x471698)return this['queryView']['errorText']=Vn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x56c066=_0x14ded9(_0x471698);this['fire']('sendUserMessage',_0x56c066),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x322bb5){this['queryView']['fieldView']['set']('placeholder',_0x322bb5);}['_createSubmitButton'](){const _0x5c9fcb=new _0x3678e7(this['locale']);return _0x5c9fcb['set']({'icon':_0xbe2b8c,'label':Vn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x5c9fcb['on']('execute',()=>{this['submit']();}),_0x5c9fcb;}['setIsUploadInProgress'](_0x15679d){this['isUploadInProgress']=_0x15679d;}['_setUpAddContextButtonPositioning'](){const _0x3a481d=this['locale'],_0x457b76=()=>{_0x136098['window']['requestAnimationFrame'](()=>{if(_0x30a94f(this['element'])){const _0x223a58=new _0x209e41(this['queryView']['fieldView']['element']),_0x18736d=new _0x209e41(this['_addContextButtonView']['element']),_0x99a6a8=_0x223a58['width'],_0x58cb2d='rtl'===_0x3a481d['uiLanguageDirection']?'right':'left';_0x223a58['excludeScrollbarsAndBorders']();const _0x5a04e0=_0x99a6a8-_0x223a58['width']+0x1;this['_addContextButtonView']['element']['style'][_0x58cb2d]='calc('+(_0x99a6a8-_0x18736d['width']-_0x5a04e0)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x457b76),this['on']('render',()=>{_0x457b76(),this['_queryViewResizeObserver']=new _0x23e0d2(this['queryView']['fieldView']['element'],()=>{_0x457b76();});});}}const Yr='ck-ai-chat__prompt-capabilities',Wr='ck-ai-chat-controls-button',Kr='ck-ai-chat-controls-button--commands',$r='ck-ai-chat-controls__model-selection',Qr='ck-ai-chat-controls__model-selection__item-name',Xr='ck-ai-chat-controls__model-selection__item-description',Jr='ck-ai-chat-controls__model-selection__item-capabilities',Zr='n';class Ce extends _0x179f2b{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x367ed3){super(_0x367ed3),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x35c75c=>_0x35c75c),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x331f5d=>_0x331f5d?this['_modelSelectionDropdown']['buttonView']['label']:Vn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2a0798=>_0x2a0798),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x522e78=>_0x522e78),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1a3e44=>!_0x1a3e44),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x25b02b=>Vn(this['locale'],_0x25b02b?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x5cf603=>_0x5cf603),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x541d1d=>!_0x541d1d),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4c4610=>Vn(this['locale'],_0x4c4610?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Yr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x3febd7(),_0x245f97(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x14d19f,_0x5686ee){if(this['set']('modelSelectorVisible',!(_0x5686ee&&_0x14d19f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x14d19f?.['length'])for(const _0x3519ef of _0x14d19f){const _0x53d8e5=new _0x25cf5d({'label':_0x3519ef['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3519ef['id'],'model':_0x3519ef});_0x53d8e5['bind']('isOn')['to'](this,'activeModelId',_0x1f0e20=>_0x1f0e20===_0x3519ef['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x53d8e5,'labelView':new sa(this['locale'],_0x3519ef)});}}['setWebSearch'](_0x418087){this['set']('webSearchActive',_0x418087);}['setReasoning'](_0x5bfd07){this['set']('reasoningActive',_0x5bfd07);}['setModel'](_0x3463fd){if(!_0x3463fd)return;this['activeModelId']=_0x3463fd['id'],this['activeModelName']=_0x3463fd['name']||_0x3463fd['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3463fd['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3463fd['name']);const _0x568757=_0x3463fd['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x568757),this['_webSearchButton']['set']('isVisible',_0x568757);const _0x4a2387=_0x3463fd['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4a2387),this['_reasoningButton']['set']('isVisible',_0x4a2387);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x3820c4){this['set']('modelSelectorEnabled',!0x1),_0x3820c4&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x55ee8b=new _0x3678e7();return _0x55ee8b['set']({'label':Vn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3732ee,'class':Wr,'isToggleable':!0x0,'tooltipPosition':Zr}),_0x55ee8b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x55ee8b;}['_createReasoningButton'](){const _0x5a616c=new _0x3678e7();return _0x5a616c['set']({'label':Vn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x11c39e,'class':Wr,'isToggleable':!0x0,'tooltipPosition':Zr}),_0x5a616c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x5a616c;}['_createCommandsButton'](){const _0x52b3a6=new _0x3678e7();return _0x52b3a6['set']({'label':Vn(this['locale'],'AI_CHAT_COMMANDS'),'icon':It,'withText':!0x0,'class':Wr,'isToggleable':!0x0,'tooltip':Vn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Zr}),_0x52b3a6['extendTemplate']({'attributes':{'class':[Kr]}}),_0x52b3a6['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x52b3a6;}['_createModelSelectionDropdown'](){const _0x2653cb=_0x3e7f7b(this['locale']);return _0x2653cb['set']({'panelPosition':'ne','class':[$r]}),_0x2653cb['buttonView']['set']({'label':Vn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Zr}),this['listenTo'](_0x2653cb,'execute',_0x453948=>{this['fire']('selectModel',_0x453948['source']['model']);}),_0x2653cb;}['_createModelNameView'](){const _0x4b784c=new jo(this['locale']);return _0x4b784c['bind']('text')['to'](this,'activeModelName',_0x1a024e=>_0x1a024e??''),_0x4b784c['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x441909,_0x2b6899)=>!_0x441909&&!_0x2b6899?.['toLowerCase']()['startsWith']('agent')),_0x4b784c;}}let sa=class extends _0x5a6277{constructor(_0x4ae0c3,_0x39b20d){super();const _0x3002b9=this['bindTemplate'],_0x16c145=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3002b9['to']('style'),'id':_0x3002b9['to']('id')},'children':[{'tag':'div','attributes':{'class':[Qr]},'children':[{'text':_0x3002b9['to']('text')}]},{'tag':'div','attributes':{'class':[Xr]},'children':[{'tag':'span','children':[{'text':_0x39b20d['description']}]}]},{'tag':'div','attributes':{'class':[Jr]},'children':_0x16c145}]}),_0x16c145['addMany'](this['_getCapabilityParts'](_0x4ae0c3,_0x3732ee,'AI_CHAT_SEARCH_WEB',_0x39b20d['capabilities']['webSearch']?.['enabled']??!0x1)),_0x16c145['addMany'](this['_getCapabilityParts'](_0x4ae0c3,_0x11c39e,'AI_CHAT_REASONING',_0x39b20d['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2748fe,_0x2dd948,_0x13d498,_0x1c40eb){const _0x20a4a9=new _0x30b390();_0x20a4a9['content']=_0x2dd948;const _0x13cd34=new _0x179f2b(_0x2748fe);_0x13cd34['setTemplate']({'tag':'span','children':[{'text':Vn(_0x2748fe,_0x13d498)+':\x20'}]});const _0x2546b0=new _0x179f2b(_0x2748fe);return _0x2546b0['setTemplate']({'tag':'span','children':[{'text':Vn(_0x2748fe,_0x1c40eb?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x20a4a9,_0x13cd34,_0x2546b0];}};class jo extends _0x179f2b{constructor(_0x78b8f7){super(_0x78b8f7),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x54a8f6=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x54a8f6['if']('isVisible','ck-hidden',_0x3561d6=>!_0x3561d6)]},'children':[{'text':_0x54a8f6['to']('text')}]});}}const na='ck-ai-chat-context-controls__url-form',ra='ck-ai-chat-context-controls__url-input-section';class wo extends _0x179f2b{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x2d87e3){super(_0x2d87e3),this['focusTracker']=new _0x54be86(),this['keystrokes']=new _0x46e306(),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 ts({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5aacaa=>{this['focusTracker']['add'](_0x5aacaa['element']),this['keystrokes']['listenTo'](_0x5aacaa['element']);}),_0x2e022f({'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'](_0x2f2de6){this['urlInputField']['errorText']=_0x2f2de6,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x1545ac=new _0x3678e7(this['locale']);return _0x1545ac['set']({'icon':_0x5ef96b,'tooltip':Vn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x1545ac;}['_createUrlInputField'](){const _0x52f148=new th(this['locale'],_0x2aae5d);return _0x52f148['set']({'label':Vn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x52f148['fieldView']['set']({'placeholder':Vn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x52f148;}['_createConfirmButton'](){const _0xf99d16=new _0x3678e7(this['locale']);return _0xf99d16['set']({'icon':_0x465b02,'tooltip':Vn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0xf99d16;}['_setupTemplate'](){const _0x4d89cd=new _0x4b2793(this['locale'],{'label':Vn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x4d89cd['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':na,'tabindex':'-1'},'children':[_0x4d89cd,{'tag':'div','attributes':{'class':ra},'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',_0x65ec3e=>{_0x65ec3e['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x3e81d1,_0x3c6bbd)=>{this['clear'](),this['fire']('cancel'),_0x3c6bbd();});}['_handleSubmit'](){const _0x4abde7=this['getValue']()['trim']();_0x4abde7?this['_isValidUrl'](_0x4abde7)?(this['clearError'](),this['fire']('submitUrl',_0x4abde7)):this['setError'](Vn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Vn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x54ad2a=this['getValue']()['trim'](),_0x2f21a2=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x54ad2a['length']>0x0&&!_0x2f21a2;}['_isValidUrl'](_0x2fca72){try{return!!new URL(_0x2fca72);}catch{return!0x1;}}}const oa='ck-ai-chat-resources__item',aa='ck-ai-chat-resources__item--in-context',ha='ck-ai-chat-resources__item-title',ca='ck-ai-chat-resources__item__icon';class tc extends _0xfd7405{['resource'];['_titleView'];['_iconView'];constructor(_0x43e8a0,_0x4e9aba){super(_0x43e8a0),this['resource']=_0x4e9aba,this['set']('isInContext',!!_0x4e9aba['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x38a4b6){if(_0x38a4b6['isInContext'])return _0x465b02;switch(_0x38a4b6['type']){case ce['DOCUMENT']:return _0x4dc2d9;case ce['URL']:return _0x5987a4;case ce['FILE']:case ce['TEXT']:return _0x2545bc;default:return _0x35aa9f;}}['highlightText'](_0x2868b1){if(!_0x2868b1||''===_0x2868b1['trim']())return void this['_titleView']['highlightText'](null);const _0x2ffd2d=new RegExp(_0x4fd9bb(_0x2868b1),'gi');this['_titleView']['highlightText'](_0x2ffd2d);}['updateResourceState'](_0x1f23e8){this['resource']['isInContext']=_0x1f23e8,this['isInContext']=_0x1f23e8,this['_updateIcon']();}['_createTitleView'](){const _0x412e8c=new _0x5ca561();return _0x412e8c['text']=this['resource']['label'],_0x412e8c['extendTemplate']({'tag':'span','attributes':{'class':[ha]}}),_0x412e8c;}['_createIconView'](){const _0x39b833=new _0x30b390();return _0x39b833['content']=this['getResourceIcon'](this['resource']),_0x39b833;}['_setupTemplate'](){const _0x2e622b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[oa,_0x2e622b['if']('isVisible','ck-hidden',_0x5113da=>!_0x5113da),_0x2e622b['if']('isInContext',aa)]},'children':[{'tag':'div','attributes':{'class':[ca]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2e622b['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const la='ck-ai-chat-resources__list';class Ur extends _0x56c802{['_source'];constructor(_0x2bcb8e,_0x37bdad){super(_0x2bcb8e),this['_source']=_0x37bdad,this['extendTemplate']({'attributes':{'class':[la]}});}['setResources'](_0x5a72d3,_0x504834){this['items']['clear']();let _0x11d9dc=_0x5a72d3;if(this['_source']['useDefaultFiltering']&&_0x504834&&''!==_0x504834['trim']()){const _0x31999f=new RegExp(_0x504834['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x11d9dc=_0x5a72d3['filter'](_0x4ac9d3=>_0x31999f['test'](_0x4ac9d3['label']));}for(const _0x48c091 of _0x11d9dc){const _0x3ef2e5=new tc(this['locale'],_0x48c091);_0x3ef2e5['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x48c091);}),this['items']['add'](_0x3ef2e5);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x504834);}['highlightText'](_0x30545d){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5a811c=>{_0x5a811c['highlightText'](_0x30545d);});}['updateResourceState'](_0x27dbf1,_0x32b844){for(const _0x55aef5 of this['items']){const _0x344d70=_0x55aef5;_0x344d70['resource']['id']===_0x27dbf1&&_0x344d70['updateResourceState'](_0x32b844);}}['_handleResourceSelection'](_0x5335c1,_0xe1bcfc){this['fire']('addResourceToContext',{'source':_0x5335c1,'resource':_0xe1bcfc});}}class zr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x15bee5){const t=_0x15bee5['t'],_0x288572={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x2aae5d,'label':Vn(_0x15bee5,'AI_CHAT_SEARCH_RESOURCES')};super(_0x15bee5,_0x288572['creator']),this['label']=_0x288572['label'],this['_viewConfig']=_0x288572,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x15bee5,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5579fe){this['fire']('search',_0x5579fe);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x30b390(),this['iconView']['content']=_0x33055c,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x20585c,t){this['resetButtonView']=new _0x3678e7(_0x20585c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x1c9538,'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',_0x4659c9=>!_0x4659c9),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Br extends _0x179f2b{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x3a90cd,_0xbaccc9){super(_0x3a90cd),this['_source']=_0xbaccc9,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x31f04b=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x476d2b([_0x31f04b,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x3d687b=new _0x179f2b(this['locale']);return _0x3d687b['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x20517f,_0x2a21cf)=>{this['loadResources'](_0x2a21cf),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2a21cf);}),_0x3d687b;}['_createResourcesListView'](){const _0x2b4ea2=new Ur(this['locale'],this['_source']);return _0x2b4ea2['delegate']('addResourceToContext')['to'](this),_0x2b4ea2['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2b4ea2;}['_createSkeletonView'](){const _0x391e88=new je(this['locale'],Le['aiChatResources']);return _0x391e88['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x481719=>!_0x481719)]}}),_0x391e88;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x8d8d76){const _0x208fb6=_0x215bb4();this['_latestLoadResourcesUid']=_0x208fb6,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x8d8d76,'uid':_0x208fb6}),this['isLoading']=!0x0;}['setResources'](_0xccff74,_0x2ecbe4){if(_0x2ecbe4&&_0x2ecbe4!==this['_latestLoadResourcesUid'])return;const _0x31f8d1=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0xccff74,_0x31f8d1),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x6b07cd,_0x53d0cb){this['_resourcesListView']['updateResourceState'](_0x6b07cd,_0x53d0cb);}}const da='ck-ai-chat-context-controls__source-balloon-panel',ua='ck-button-icon\x20ck-button-back',_a='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Bo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x17834b,_0x370673,_0x1393da){this['_locale']=_0x17834b,this['_bodyCollection']=_0x370673,this['_config']=_0x1393da;}['showSourceResourcesBalloon'](_0x4d592d){let _0x1d27c8=this['_sourceResourceBalloons']['get'](_0x4d592d['id']);_0x1d27c8||(_0x1d27c8=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x4d592d['id'],_0x1d27c8),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1d27c8)),this['_addSourceResourceContent'](_0x1d27c8,_0x4d592d),_0x1d27c8['show']();const _0xc7ec8c=this['_config']['getTargetElement']();_0xc7ec8c&&_0x1d27c8['pin']({'target':_0xc7ec8c,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x394039,_0x3d1f5d,_0x1dfb7f){const _0xefd780=this['_sourceResourceBalloons']['get'](_0x394039);if(!_0xefd780)return;const _0x2b2f66=this['_getResourcesViewFromBalloon'](_0xefd780);_0x2b2f66&&_0x2b2f66['setResources'](_0x3d1f5d,_0x1dfb7f);}['closeSourceResourceBalloon'](_0x32ad10){const _0x5eba89=this['_sourceResourceBalloons']['get'](_0x32ad10);_0x5eba89&&requestAnimationFrame(()=>{_0x5eba89['hide'](),this['_sourceResourceBalloons']['delete'](_0x32ad10),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x393f8c of this['_sourceResourceBalloons']['values']())if(_0x393f8c['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1db8fd,_0xa59826,_0x5bb097){const _0x191fdf=this['_sourceResourceBalloons']['get'](_0x1db8fd);if(!_0x191fdf||!_0x191fdf['isVisible'])return;const _0x494174=this['_config']['getTargetElement']();if(!_0x494174)return;_0x191fdf['pin']({'target':_0x494174,'limiter':this['_config']['getLimiterElement']()});const _0xb8a61a=this['_getResourcesViewFromBalloon'](_0x191fdf);_0xb8a61a&&_0xb8a61a['updateResourceState'](_0xa59826,_0x5bb097);}['destroy'](){for(const _0x206128 of this['_sourceResourceBalloons']['values']())_0x206128['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x263fce=new _0x4f7937(this['_locale']);return _0x263fce['extendTemplate']({'attributes':{'class':da}}),this['_bodyCollection']['add'](_0x263fce),_0x263fce;}['_addSourceResourceContent'](_0x142ce2,_0x469f7f){_0x142ce2['content']['clear']();const _0x50b5ff=this['_createBalloonHeader'](_0x142ce2,_0x469f7f);_0x142ce2['content']['add'](_0x50b5ff);const _0x3ddedb=this['_createBalloonResourcesView'](_0x469f7f);_0x142ce2['content']['add'](_0x3ddedb);}['_createBalloonHeader'](_0x1f964f,_0x1f2298){const _0x165c79=this['_createBackButton'](_0x1f964f),_0x1d0d8e=new _0x4b2793(this['_locale'],{'label':_0x1f2298['label'],'class':_a});return _0x1d0d8e['children']['add'](_0x165c79,0x0),_0x1d0d8e;}['_createBackButton'](_0x125259){const _0x5de40c=new _0x3678e7(this['_locale']);return _0x5de40c['set']({'icon':_0x5ef96b,'tooltip':Vn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ua}),_0x5de40c['on']('execute',()=>{_0x125259['hide'](),this['_config']['onBackToContext']();}),_0x5de40c;}['_createBalloonResourcesView'](_0x14e269){const _0x2951a8=new Br(this['_locale'],_0x14e269);return _0x2951a8['on']('loadSourceResources',(_0x1b76c3,_0x231a63)=>{this['_config']['onLoadSourceResources'](_0x231a63);}),_0x2951a8['on']('addResourceToContext',(_0x48e245,_0x56e56e)=>{this['_config']['onResourceSelected'](_0x56e56e['source'],_0x56e56e['resource']),this['closeSourceResourceBalloon'](_0x14e269['id']);}),_0x2951a8;}['_getResourcesViewFromBalloon'](_0x7cd27f){const _0x455859=_0x7cd27f['content']['get'](0x1);return _0x455859 instanceof Br?_0x455859:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x5c8a35){_0x23c9f6({'emitter':_0x5c8a35,'contextElements':[_0x5c8a35['element']],'callback':()=>{_0x5c8a35['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x5c8a35['isVisible']});}}const be=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],bo='ck-ai-chat-context-controls',To='ck-ai-chat-context-controls__pending-contexts',Ao='ck-ai-chat-context-controls__add-context-balloon-panel',ko='ck-ai-chat-context-controls__add-context-button',Eo='ck-ai-chat-context-controls__url-balloon-panel',vo='ck-ai-chat-context-controls__balloon-button',go='ck-ai-chat-context-controls__balloon-button-source',Vo='ck-ai-chat-controls-button',fo='ck-ai-chat-context-chips-wrapper-balloon',Io='ck-ai-chat-controls_context_show-more-button',Po='ck-ai-chat-context-controls__show-more-balloon-panel',Ro='ck-ai-chat',So=[_0x4f7937['defaultPositions']['northArrowSouthWest'],_0x4f7937['defaultPositions']['northArrowSouth'],_0x4f7937['defaultPositions']['northArrowSouthEast'],_0x4f7937['defaultPositions']['southArrowNorthWest'],_0x4f7937['defaultPositions']['southArrowNorth'],_0x4f7937['defaultPositions']['southArrowNorthEast']];class xe extends _0x179f2b{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x3f4710,_0x4c417f){super(_0x3f4710),this['bodyCollection']=_0x4c417f,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3f4710),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3f4710),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3f4710),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3f4710,_0x4c417f);const _0x4ddf2b={'cssClasses':{'showMoreButton':Io,'showMoreBalloon':Po,'overflowContainer':fo,'controlsButton':Vo}};this['_overflowManager']=new po(_0x3f4710,this['_currentContextsChips'],_0x4ddf2b,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'](_0x534fdb,_0x299d4e){const _0x3ce934=this['_createContextButton'](_0x534fdb,'current',!0x0,_0x299d4e);this['_addContextToCollection'](_0x3ce934,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4986ae){this['_removeContextFromCollection'](_0x4986ae,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4986ae,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x263847,_0x17d8d1){let _0x286d7=this['_currentContextsChips']['find'](_0x5084eb=>_0x5084eb['id']===_0x263847);_0x286d7||(_0x286d7=this['_overflowManager']['overflowChips']['find'](_0x4b234e=>_0x4b234e['id']===_0x263847)),_0x286d7&&(_0x286d7['isLoading']=_0x17d8d1);}['setConversationContext'](_0x5cb8b4){this['_conversationContextsChips']['clear']();for(const _0x4c1f29 of _0x5cb8b4){const _0x2f4546=this['_createContextButton'](_0x4c1f29,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x2f4546,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0xba5d70,_0x2f22e5,_0xc13a10){this['_resourcesBalloonView']['updateResourceState'](_0xba5d70,_0x2f22e5,_0xc13a10);}['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'](_0x3d25e6){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x3d25e6),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x1a892d,_0x313947,_0x1cf95,_0x3a30b2){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x1a892d,_0x1cf95,_0x3a30b2);}['closeSourceResourceBalloon'](_0x16aaf2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x16aaf2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2961d0){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2961d0),this['_setAddContextButtonEnabled'](_0x2961d0);}['_setAddContextButtonEnabled'](_0x22ac63){const _0x565da2=!_0x22ac63['document']['isHidden']&&_0x22ac63['document']['enabled'],_0x12582e=_0x22ac63['urls']['enabled'],_0x24025b=_0x22ac63['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x565da2||_0x12582e||_0x24025b;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[bo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':To},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x39876f){const _0x397af6=new _0x3678e7(_0x39876f);return _0x397af6['set']({'label':Vn(_0x39876f,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vo+'\x20'+ko,'icon':_0x2347cb,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x397af6;}['_createAddContextBalloonPanelView'](_0x1fc8a5){return this['_createBaseBalloonPanel'](_0x1fc8a5,Ao);}['_createUrlBalloonPanelView'](_0x3a853a){const _0x30e623=this['_createBaseBalloonPanel'](_0x3a853a,Eo);return this['_addUrlContent'](_0x30e623,_0x3a853a),_0x30e623;}['_createResourcesBalloonView'](_0x49e2bb,_0x2f42f0){return new Bo(_0x49e2bb,_0x2f42f0,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});},'onResourceSelected':(_0x225cfc,_0x2c50a4)=>{this['fire']('addResourceToContext',{'source':_0x225cfc,'resource':_0x2c50a4});},'onLoadSourceResources':_0x27e6cc=>{this['fire']('loadSourceResources',_0x27e6cc);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ro)||document['body'];}['_createBaseBalloonPanel'](_0xe42099,_0x200a86){const _0x3e5d70=new _0x4f7937(_0xe42099);return _0x3e5d70['extendTemplate']({'attributes':{'class':_0x200a86}}),this['bodyCollection']['add'](_0x3e5d70),_0x3e5d70;}['_setBalloonPanelContent'](_0x2ebfa5,_0x22b6a8,_0x1964a2){if(_0x2ebfa5['content']['clear'](),!_0x1964a2['document']['isHidden']&&_0x1964a2['document']['enabled']){const _0x31c055=this['_createBalloonButton'](_0x22b6a8,{'label':Vn(_0x22b6a8,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4dc2d9});_0x31c055['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2ebfa5['content']['add'](_0x31c055);}if(_0x1964a2['urls']['enabled']){const _0x4b35fb=this['_createBalloonButton'](_0x22b6a8,{'label':Vn(_0x22b6a8,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5987a4});_0x4b35fb['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}),this['_urlInputView']['focus']();}),_0x2ebfa5['content']['add'](_0x4b35fb);}if(_0x1964a2['files']['enabled']){const _0x8f4152=new _0x5753d1(_0x22b6a8);_0x8f4152['set']({'label':Vn(_0x22b6a8,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x4d2436,'withText':!0x0,'tooltip':!0x0,'class':vo,'allowMultipleFiles':!0x0}),_0x8f4152['on']('done',(_0x1a291b,_0x42b079)=>{this['fire']('addFileToContext',_0x42b079),this['hideAddContextBalloonPanel']();}),_0x8f4152['tooltip']=!0x0,_0x2ebfa5['content']['add'](_0x8f4152);}for(const _0x30e930 of _0x1964a2['sources']){const _0x474523=this['_createBalloonButton'](_0x22b6a8,{'label':_0x30e930['label'],'icon':_0x30e930['icon']||_0x35aa9f,'type':'source'});_0x2ebfa5['content']['add'](_0x474523),_0x474523['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x30e930);});}}['_addUrlContent'](_0x116de4,_0x2d060c){this['_urlInputView']=new wo(_0x2d060c),this['_urlInputView']['on']('submitUrl',(_0x16cadb,_0x53d686)=>{this['_handleUrlSubmit'](_0x53d686);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),_0x116de4['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x228c42,_0x28aba3){const _0x57449e='source'===_0x28aba3['type']?new Ia(_0x228c42):new _0x3678e7(_0x228c42);return _0x57449e['set']({'label':_0x28aba3['label'],'icon':_0x28aba3['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':vo}),_0x57449e;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x23c9f6({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x1357d2){const _0x4fefaf=this['_addContextBalloonConfig'];_0x4fefaf['buttonView']['isOn']=_0x1357d2,_0x1357d2?_0x4fefaf['balloonView']['show']():_0x4fefaf['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x42e248,buttonView:_0x333bb2,hideMethod:_0x831dc4}=this['_addContextBalloonConfig'];_0x23c9f6({'emitter':_0x42e248,'contextElements':[_0x42e248['element'],_0x333bb2['element']],'callback':()=>{_0x831dc4();},'activator':()=>_0x333bb2['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x426bb9,_0x3dc294,_0xafec42=!0x1,_0x66cf2d=!0x1){const _0x38833e='conversation'===_0x3dc294||!0x0===_0x426bb9['isReadOnly'],_0x5f44f7=new mo(this['locale'],_0x426bb9,_0x38833e,_0xafec42,_0x66cf2d);return _0x38833e||_0x5f44f7['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x5f44f7['id']);}),_0x5f44f7;}['_addContextToCollection'](_0x418ded,_0x4326b8){_0x4326b8['add'](_0x418ded,0x0);}['_removeContextFromCollection'](_0x436e6f,_0x362a95){const _0x1928e3=_0x362a95['find'](_0x57c2d8=>_0x57c2d8['id']===_0x436e6f);_0x1928e3&&_0x362a95['remove'](_0x1928e3);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}));}['_handleUrlSubmit'](_0x225489){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x225489);}}class Ia extends _0x3678e7{['arrowView'];constructor(_0x33e018){super(_0x33e018),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[go]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x385f2c=new _0x30b390();return _0x385f2c['content']=_0x51ff1f,_0x385f2c['extendTemplate']({'attributes':{'class':go+'__arrow'}}),_0x385f2c;}}class Pe extends _0x179f2b{['_cancelButtonView'];['_loaderView'];constructor(_0x3faea9){super(_0x3faea9),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 _0x3b1b0a=new _0x3678e7(this['locale']);return _0x3b1b0a['set']({'label':Vn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x53dded}),_0x3b1b0a['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3b1b0a;}['_createLoaderView'](){const _0x4fb79f=new _0x179f2b(this['locale']);return _0x4fb79f['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':Vn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4fb79f;}}class ki extends _0x179f2b{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x12a39f,_0x113240){super(_0x12a39f),this['_contextPanelView']=this['_createContextPanelView'](_0x12a39f,_0x113240),this['_promptInputView']=this['_createPromptInputView'](_0x12a39f),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x12a39f),this['_loaderView']=this['_createLoaderView'](_0x12a39f),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'](...be)['to'](this);const _0x10ae76=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x10ae76['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x10ae76['if']('isLoading','ck-hidden',_0x5147eb=>!_0x5147eb)]},'children':[this['_loaderView']]}]}),_0x23c9f6({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x2516f1,_0x56f3fc){return new xe(_0x2516f1,_0x56f3fc);}['_createPromptInputView'](_0x15919c){return new we(_0x15919c,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x26b880){return new Ce(_0x26b880);}['_createLoaderView'](_0x4ed4da){return new Pe(_0x4ed4da);}['_handlePromptInputFocus'](_0x565fc0,_0x3a9b29,_0x56703c){_0x56703c?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x58d609,_0x253878){this['_contextPanelView']['addContextItem'](_0x58d609,_0x253878);}['removeContextItem'](_0x437529){this['_contextPanelView']['removeContextItem'](_0x437529);}['setContextItemLoading'](_0x401e4f,_0x364436){this['_contextPanelView']['setContextItemLoading'](_0x401e4f,_0x364436);}['setIsUploadInProgress'](_0x4bca7b){this['_promptInputView']['setIsUploadInProgress'](_0x4bca7b);}['setConversationContext'](_0x52d589){this['_contextPanelView']['setConversationContext'](_0x52d589);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x369b6e,_0x5e4626,_0x389ae7){this['_contextPanelView']['updateResourceState'](_0x369b6e,_0x5e4626,_0x389ae7);}['setWebSearch'](_0x4a7b13){this['_promptCapabilitiesView']['setWebSearch'](_0x4a7b13);}['setReasoning'](_0x551f0d){this['_promptCapabilitiesView']['setReasoning'](_0x551f0d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1a3ef7){this['_contextPanelView']['setAddContextOptions'](_0x1a3ef7);}['setInputPlaceholder'](_0x339f49){this['_promptInputView']['setPlaceholderText'](_0x339f49);}['setModelList'](_0x5a9148,_0x2b187a){this['_promptCapabilitiesView']['setModelList'](_0x5a9148,_0x2b187a);}['setModel'](_0x52cea3){this['_promptCapabilitiesView']['setModel'](_0x52cea3);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2a1d05){this['_promptCapabilitiesView']['disableModelSelector'](_0x2a1d05);}['populateSourceResourceBalloon'](_0x35d1ee,_0x5e9444,_0x3ae8f2,_0xa908b1){this['_contextPanelView']['populateSourceResourceBalloon'](_0x35d1ee,_0x5e9444,_0x3ae8f2,_0xa908b1);}['closeSourceResourceBalloon'](_0x4822a9){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4822a9);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class yi extends _0x4b2793{['conversationStartButton'];['resizeButton'];constructor(_0x2fb7df,_0x10cc6f){super(_0x2fb7df,{'label':Vn(_0x2fb7df,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x2fb7df),this['children']['add'](this['conversationStartButton']),_0x10cc6f&&(this['resizeButton']=As(_0x2fb7df,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x1b2c13){const _0x5db7ad=new _0x3678e7(_0x1b2c13);return _0x5db7ad['set']({'label':Vn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x225485,'class':'ck-ai-chat__start-conversation'}),_0x5db7ad['on']('execute',()=>{this['fire']('startConversation');}),_0x5db7ad;}}class Bi extends _0x179f2b{constructor(_0x27f78f){super(_0x27f78f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Vn(_0x27f78f,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0x179f2b{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x2328de,_0x1bc239){super(_0x2328de),this['_bodyCollection']=new qt(_0x2328de),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new yi(_0x2328de,_0x1bc239),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new ji(_0x2328de,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ki(_0x2328de,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Bi(_0x2328de),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x2328de['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x42c0c1,_0x5105e7,_0x144731,_0x4f546e){this['chatControls']['populateSourceResourceBalloon'](_0x42c0c1,_0x5105e7,_0x144731,_0x4f546e);}['closeSourceResourceBalloon'](_0x49368a){this['chatControls']['closeSourceResourceBalloon'](_0x49368a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class et extends _0x150b32{static get['requires'](){return[rt];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;constructor(_0x30187d){super(_0x30187d);const _0x3525a7=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new Et(this['context']['locale'],_0x3525a7['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x10f722,{showDiff:_0x2e70e6})=>{this['showDiff']=_0x2e70e6;}),_0x3525a7['view']['addTab']({'id':'chat','buttonLabel':Vn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x215355=>_0x215355),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0xcf163c=>_0xcf163c),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x3db2df){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x3db2df['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Vn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x34e302,staticMessage:_0x421f2c}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x34e302,'initialContent':'<p>'+_0x421f2c+'</p>'});}['addFeedItemUserMessage'](_0xdce867){const _0x34bf0b=_0xdce867['quickActionData']?.['displayedPrompt']||_0xdce867['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xdce867['contextItems']['values']()),'initialContent':'<p>'+_0x34bf0b+'</p>','id':_0xdce867['id']});}['addFeedItemError']({errorMessage:_0x5a1908,id:_0x2474a2}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5a1908+'</p>','id':_0x2474a2});}['addFeedItemAIReply'](_0x423754){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x423754['interactionId']+':'+_0x423754['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x584ebc){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x584ebc['interactionId']+':'+_0x584ebc['id'],'areActionsDisabled':_0x584ebc['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x5a0d23){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5a0d23['id'],'capabilities':_0x5a0d23['capabilities']});}['updateFeedInteractionHeader'](_0x32f2e0){const _0x20eaa0=this['_view']['chatFeed']['children']['find'](_0x50867b=>_0x50867b['options']['id']==_0x32f2e0['id']&&_0x50867b instanceof Rt);_0x20eaa0&&_0x20eaa0['set']('isVisible',_0x32f2e0['isVisible']);}async['updateFeedItemAIReplyContent'](_0x471866){const _0x178214=_0x471866['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x451f0d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x471866,'abortSignal':_0x451f0d,'renderingStrategy':_0x178214}),_0x471866['isDone']&&this['markFeedItemAsDone'](_0x471866['id']);});}['updateFeedItemAIReplySources'](_0x50b77e,_0x4d314e){this['_view']['chatFeed']['updateWebSources'](_0x50b77e,_0x4d314e);}async['updateFeedItemAIReplySuggestionContent'](_0x4344e0){const _0x51f039=_0x4344e0['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4c8db4=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4344e0,'abortSignal':_0x4c8db4,'renderingStrategy':_0x51f039}),_0x4344e0['isDone']&&this['markFeedItemAsDone'](_0x4344e0['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x42167a){this['_view']['chatFeed']['updateSuggestionPartState'](_0x42167a);}['markFeedItemAsDone'](_0x3af265){this['_view']['chatFeed']['markItemAsDone'](_0x3af265);}['removeFeedInteraction'](_0x22bcb8){this['_view']['chatFeed']['getItemIds']()['filter'](_0x45f35f=>_0x45f35f['startsWith'](_0x22bcb8))['forEach'](_0x1775a4=>this['_view']['chatFeed']['removeItem'](_0x1775a4));}['startInteraction'](_0x2524ba){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x2524ba)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3f64c1){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1bfa04=>_0x1bfa04['startsWith'](_0x3f64c1['id']))['forEach'](_0x2fd7d9=>this['markFeedItemAsDone'](_0x2fd7d9)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x1c3a54,_0x5ee1ef){this['_view']['chatControls']['addContextItem'](_0x1c3a54,_0x5ee1ef);}['removeContextItem'](_0x3151e2){this['_view']['chatControls']['removeContextItem'](_0x3151e2);}['setContextItemLoading'](_0x321e70,_0x28f7e8){this['_view']['chatControls']['setContextItemLoading'](_0x321e70,_0x28f7e8);}['setIsUploadInProgress'](_0x37bd16){this['_view']['chatControls']['setIsUploadInProgress'](_0x37bd16);}['setConversationContext'](_0x416e0c){this['_view']['chatControls']['setConversationContext'](_0x416e0c);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x50ecf1,_0x25bbc6,_0x3c6e40){this['_view']['chatControls']['updateResourceState'](_0x50ecf1,_0x25bbc6,_0x3c6e40);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x113a94){this['_view']['chatControls']['setAddContextOptions'](_0x113a94);}['updateCapabilities'](_0x24c487){this['_view']['chatControls']['setWebSearch'](_0x24c487['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x24c487['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x24c487));}['setSelectedModel'](_0x3dadfb,_0x16eaf2){this['_view']['chatControls']['setModel'](_0x3dadfb),_0x16eaf2&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x385628){this['feedItemRenderingStrategy']=_0x385628;}['toggleLoadingSkeleton'](_0x2cc314){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2cc314);}['resetConversationTitle'](){this['setConversationTitle'](Vn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4c950d,_0x3ad2ed=!0x1){if(_0x3ad2ed&&!At()&&_0x4c950d['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4c950d);this['_view']['chatHeader']['label']=_0x4c950d;}['_animateConversationTitle'](_0x5eb7ff){let _0x1a96a8=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5eb7ff[_0x1a96a8],_0x1a96a8++,_0x1a96a8===_0x5eb7ff['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x2d4942){this['_view']['chatHeader']['isMaximized']=_0x2d4942;}['_getLoadingMessage'](_0x439a5f){const _0x311ba1=_0x439a5f['capabilities'];return _0x311ba1['isWebSearchEnabled']&&_0x311ba1['isReasoningEnabled']?Vn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x311ba1['isWebSearchEnabled']?Vn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x311ba1['isReasoningEnabled']?Vn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Vn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x3c0a5d){return _0x3c0a5d?_0x3c0a5d['isWebSearchEnabled']&&_0x3c0a5d['isReasoningEnabled']?Vn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x3c0a5d['isWebSearchEnabled']?Vn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x3c0a5d['isReasoningEnabled']?Vn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Vn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Vn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x5e5965,_0x348aa1,_0x167a99,_0x51a6d3){this['_view']['populateSourceResourceBalloon'](_0x5e5965,_0x348aa1,_0x167a99,_0x51a6d3);}['closeSourceResourceBalloon'](_0x187165){this['_view']['closeSourceResourceBalloon'](_0x187165);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x77f5e5,_0x2e3119){this['_view']['chatFeed']['scrollToSuggestion'](_0x77f5e5,_0x2e3119);}}class Mi extends _0x56c802{['sections'];constructor(_0xd45215,_0x5be4f1){super(_0xd45215),this['sections']=_0x5be4f1,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2aef0e){let _0xab4b8d=0x0,_0x4694da=0x0;for(const _0x3427d5 of this['sections']){const {resultsCount:_0x35af95,totalItemsCount:_0x251cdf}=_0x3427d5['filter'](_0x2aef0e);_0xab4b8d+=_0x35af95,_0x4694da+=_0x251cdf;}return{'resultsCount':_0xab4b8d,'totalItemsCount':_0x4694da};}}class Di extends _0xfd7405{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5a8e80,{title:_0x4cc6f4,items:_0x5f5147}){super(_0x5a8e80);const _0x32eab1=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4cc6f4,this['itemsViews']=_0x5f5147;const _0x36e6dd=new _0x179f2b(_0x5a8e80);_0x36e6dd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x56c802(_0x5a8e80),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x32eab1['if']('isVisible','ck-hidden',_0x522b03=>!_0x522b03)]},'children':[_0x36e6dd,this['_itemsListView']]});}['filter'](_0x5792ef){const _0x1ca8a4=this['itemsViews']['length'];let _0x18bb84=0x0;for(const _0x5d8f72 of this['itemsViews']){if(_0x5792ef){const _0x12fe91=_0x5d8f72['isMatching'](_0x5792ef);_0x5d8f72['isVisible']=!!_0x12fe91,_0x5d8f72['highlightText'](_0x5792ef);}else _0x5d8f72['isVisible']=!0x0,_0x5d8f72['highlightText'](null);_0x5d8f72['isVisible']&&_0x18bb84++;}return this['isVisible']=_0x18bb84>0x0,{'resultsCount':_0x18bb84,'totalItemsCount':_0x1ca8a4};}['getItem'](_0x16459b){return this['itemsViews']['find'](_0x23fe22=>_0x23fe22['id']===_0x16459b);}['removeItem'](_0x5078ab){const _0x51bed3=this['itemsViews']['indexOf'](_0x5078ab);-0x1!==_0x51bed3&&(this['itemsViews']['splice'](_0x51bed3,0x1),this['_itemsListView']['items']['remove'](_0x5078ab));}}class zi extends _0x3891e7(_0xfd7405){['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(_0x29e4d2,_0x3a6b23){super(_0x29e4d2);const _0x1eccb7=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3a6b23['pinned']),this['set']('loadingState',null),this['id']=_0x3a6b23['id'];const {title:_0x57eee5,createdAt:_0x2074c3,active:_0x44ede4=!0x1}=_0x3a6b23;this['_titleView']=new _0x5ca561(),this['_titleView']['text']=_0x57eee5,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0xcdbe47=this['_createCheckView'](),_0x540896=this['_createPinButtonView'](_0x29e4d2),_0x92b515=this['_createMenuDropdownView'](),_0x62e27a=this['_createEditInputView'](_0x29e4d2,_0x57eee5),_0xb899b9=this['_createAcceptEditButtonView'](_0x29e4d2,_0x62e27a),_0x21930c=this['_createCancelEditButtonView'](_0x29e4d2,_0x62e27a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x540896),this['actions']['add'](_0x92b515),this['on']('change:isEdit',(_0x2442bf,_0x5c06ed,_0x5a7ed1)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5a7ed1?(this['actions']['add'](_0xb899b9),this['actions']['add'](_0x21930c),this['mainContent']['add'](_0x62e27a),_0x62e27a['element']['focus']()):(this['actions']['add'](_0x540896),this['actions']['add'](_0x92b515),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x44ede4?'ck-ai-chat-history__item--active':'',_0x1eccb7['if']('isVisible','ck-hidden',_0x3edcc2=>!_0x3edcc2),_0x1eccb7['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',_0x1eccb7['if']('loadingState','ck-hidden',_0x3ffeef=>!!_0x3ffeef)]},'children':_0x44ede4?[_0xcdbe47]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1eccb7['if']('loadingState','ck-hidden',_0x51ba89=>!_0x51ba89)]},'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',_0x1eccb7['if']('loadingState','ck-hidden',_0x1d7de8=>!!_0x1d7de8)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1eccb7['if']('loadingState','ck-hidden',_0xaab6d5=>!_0xaab6d5)]},'children':[{'text':_0x1eccb7['to']('loadingState',_0x3e26a6=>_0x3e26a6?Vn(this['locale'],zi['LOADING_LABELS'][_0x3e26a6]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2074c3]}]},{'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'](_0x265843){this['_titleView']['text']=_0x14ded9(_0x265843);}['updateLoadingState'](_0x163c4b,_0x6405af){this['set']('loadingState',_0x6405af?_0x163c4b:null);}['_createCheckView'](){const _0x1edbb1=new _0x30b390();return _0x1edbb1['set']({'content':_0xe9aaa5}),_0x1edbb1;}['_createPinButtonView'](_0x4eac75){const _0x2189e0=new _0x3678e7(_0x4eac75);return _0x2189e0['set']({'label':Vn(_0x4eac75,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5ed191,'withText':!0x1,'tooltip':!0x0}),_0x2189e0['bind']('isOn')['to'](this,'pinned'),_0x2189e0['on']('execute',()=>{const _0x3eec80=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3eec80});}),_0x2189e0;}['_createMenuDropdownView'](){const _0x173774=_0x3e7f7b(this['locale'],_0x10c42a),_0x41eaf5=_0x173774['panelView']['children'];_0x173774['buttonView']['set']({'label':Vn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x321948}),_0x173774['panelPosition']='sw';const _0xa5a4bd=new _0x3678e7(this['locale']);_0xa5a4bd['label']=Vn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xa5a4bd['withText']=!0x0,_0xa5a4bd['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5e4fd8=new _0x3678e7(this['locale']);_0x5e4fd8['label']=Vn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5e4fd8['withText']=!0x0,_0x5e4fd8['on']('execute',()=>{this['showConfirm'](Vn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x4a5740=new _0x56c802(this['locale']),_0x31147=new _0xfd7405(this['locale']);_0x31147['children']['add'](_0xa5a4bd);const _0x49ad48=new _0xfd7405(this['locale']);return _0x49ad48['children']['add'](_0x5e4fd8),_0x4a5740['items']['addMany']([_0x31147,_0x49ad48]),_0x41eaf5['add'](_0x4a5740),_0x173774;}['_createEditInputView'](_0x4aa0b6,_0x42efaf){const _0x175cdc=new _0x4df4e3(_0x4aa0b6),_0x16ca2d=_0x175cdc['bindTemplate'];return _0x175cdc['value']=_0x42efaf,_0x175cdc['extendTemplate']({'on':{'keydown':_0x16ca2d['to'](_0x3f31a9=>{'Enter'==_0x3f31a9['key']&&this['_commitEditInputValue'](_0x175cdc);})}}),_0x175cdc;}['_createAcceptEditButtonView'](_0x15bd77,_0x4cd40f){const _0x5dbf68=new _0x3678e7(_0x15bd77);return _0x5dbf68['set']({'icon':_0xe9aaa5,'withText':!0x1,'tooltip':Vn(_0x15bd77,'AI_CHAT_HISTORY_ACCEPT')}),_0x5dbf68['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5dbf68['on']('execute',()=>{this['_commitEditInputValue'](_0x4cd40f);}),_0x5dbf68;}['_commitEditInputValue'](_0x5cd17a){const _0x3e219a=_0x5cd17a['element']['value']||'';this['_titleView']['text']=_0x3e219a,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3e219a});}['_createCancelEditButtonView'](_0x37de6d,_0x3477a6){const _0x7b0ce0=new _0x3678e7(_0x37de6d);return _0x7b0ce0['set']({'icon':_0x1c9538,'withText':!0x1,'tooltip':Vn(_0x37de6d,'AI_CHAT_HISTORY_CANCEL')}),_0x7b0ce0['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x7b0ce0['on']('execute',()=>{this['isEdit']=!0x1,_0x3477a6['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x7b0ce0;}['_createSpinnerView'](){const _0x1201af=new Ve('tiny');return _0x1201af['isVisible']=!0x0,_0x1201af;}['isMatching'](_0x12aa19){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x12aa19)?{'title':!0x0}:null;}['highlightText'](_0x130de8){this['_titleView']['highlightText'](_0x130de8);}}class vt extends _0x179f2b{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x54252b,_0x16c66b){super(_0x54252b),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x46ee71=new _0x4b2793(_0x54252b,{'label':Vn(_0x54252b,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x16c66b&&(this['resizeButton']=As(_0x54252b,this),_0x46ee71['children']['add'](this['resizeButton'])),this['sectionsView']=new Mi(_0x54252b,[]),this['sectionsView']['delegate'](...Fi)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0x46ee71,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x2ec14a=new _0x1e3c39(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Vn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x476661=>Vn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x476661),'secondary':Vn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x2ec14a['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x2ec14a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x12ddab=>!_0x12ddab)]}}),_0x2ec14a;}['_createSkeletonView'](){const _0x18df7d=new je(this['locale'],Le['aiHistory']);return _0x18df7d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x20bd3a=>!_0x20bd3a)]}}),_0x18df7d;}['_createErrorView'](){const _0x3058b5=new _0x179f2b(this['locale']),_0x4102e6=new _0x3678e7(this['locale']);return _0x4102e6['set']({'withText':!0x1,'icon':_0x1c9538,'class':'ck-ai-chat-error__dismiss-button'}),_0x4102e6['bind']('isVisible')['to'](this,'hasItems',_0x2e86ab=>!!_0x2e86ab),_0x4102e6['on']('execute',()=>{this['errorMessage']='';}),_0x3058b5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x36442f=>!_0x36442f)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x4102e6]}),_0x3058b5;}['_createEmptyStateView'](){const _0x2e698e=new _0x3678e7(this['locale']);_0x2e698e['set']({'withText':!0x0,'label':Vn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x2e698e['on']('execute',()=>{this['fire']('openChat');});const _0x4cc560=new _0x179f2b(this['locale']);return _0x4cc560['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x17f659=>!_0x17f659)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Vn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2e698e]}),_0x4cc560;}['_createListItemViews'](_0x4b7daa,_0x2a746d){const _0xba6b68=[];for(const _0xa76735 of _0x4b7daa){const _0x401359=new zi(_0x2a746d,_0xa76735);_0x401359['delegate'](...Fi)['to'](this),_0xba6b68['push'](_0x401359);}return _0xba6b68;}['updateHistoryItemsWithCategories'](_0x1d71b1){const _0x14513b=this['locale']||'en',_0x5a49d1=[];for(const _0x1b9b8d of _0x1d71b1){const _0x3e9fe0=this['_createListItemViews'](_0x1b9b8d['items'],_0x14513b);_0x5a49d1['push'](new Di(_0x14513b,{'title':_0x1b9b8d['title'],'items':_0x3e9fe0}));}this['sectionsView']['sections']=_0x5a49d1,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5a49d1),this['hasItems']=_0x1d71b1['some'](_0x25e3ef=>_0x25e3ef['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x352347){for(const _0x125b5d of this['sectionsView']['sections']){const _0x591115=_0x125b5d['getItem'](_0x352347);if(_0x591115){if(_0x125b5d['removeItem'](_0x591115),0x0===_0x125b5d['itemsViews']['length']){const _0x4171a1=this['sectionsView']['sections']['indexOf'](_0x125b5d);-0x1!==_0x4171a1&&(this['sectionsView']['sections']['splice'](_0x4171a1,0x1),this['sectionsView']['items']['remove'](_0x125b5d));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5712c5,_0x206d7){for(const _0x5a4fc0 of this['sectionsView']['sections']){const _0x150b0e=_0x5a4fc0['getItem'](_0x5712c5);if(_0x150b0e){_0x150b0e['updateTitle'](_0x206d7);break;}}}['updateItemLoadingState'](_0x33fad9,_0x4760e1,_0x5e5deb){for(const _0x369e0d of this['sectionsView']['sections']){const _0x171459=_0x369e0d['getItem'](_0x33fad9);if(_0x171459){_0x171459['updateLoadingState'](_0x4760e1,_0x5e5deb);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x1bbc32=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x1bbc32);}}}const Fi=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class jt extends _0x150b32{static get['requires'](){return[rt];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10db64){super(_0x10db64);const _0x38f92a=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x38f92a['showResizeButton']),this['_historyView']['delegate'](...Fi)['to'](this),_0x38f92a['view']['addTab']({'id':'history','buttonLabel':Vn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5562b4){this['_historyView']['removeHistoryItem'](_0x5562b4);}['updateItems'](_0x510664){this['_historyView']['updateHistoryItemsWithCategories'](_0x510664);}['updateItemTitle'](_0x36d095,_0x1a81ef){this['_historyView']['updateItemTitle'](_0x36d095,_0x1a81ef);}['updateItemLoadingState'](_0x4d801b,_0x5dd0d8,_0xf6b6ad){this['_historyView']['updateItemLoadingState'](_0x4d801b,_0x5dd0d8,_0xf6b6ad);}['setLoadingSkeleton'](_0x484afa){this['_historyView']['isLoading']=_0x484afa;}['showError'](_0x23f7bf){this['_historyView']['errorMessage']=_0x23f7bf;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x4141dd){this['_historyView']['isMaximized']=_0x4141dd;}}class De extends _0x3a17ed(){['id'];['createdAt'];constructor({id:_0x472d5f,title:_0x4077ab,createdAt:_0x2cb125,updatedAt:_0xa33488,pinned:_0x7615d3}){super(),this['id']=_0x472d5f,this['createdAt']=new Date(_0x2cb125),this['set']('title',_0x4077ab),this['set']('updatedAt',_0xa33488?new Date(_0xa33488):null),this['set']('pinned',_0x7615d3||!0x1);}['updateTitle'](_0x2d1cfd){this['set']('title',_0x14ded9(_0x2d1cfd)),this['updatedAt']=new Date();}['updatePinned'](_0x360b5a){this['set']('pinned',_0x360b5a),this['updatedAt']=new Date();}}class Tt extends _0x1f835a(){['items']=[];['connector'];['group'];constructor({connector:_0x373bd0,group:_0x5b9098}){super(),this['connector']=_0x373bd0,this['group']=_0x5b9098;}async['init'](){try{const _0x2711bf=this['connector']['fetchConversations'](this['group']),_0x54d3fb=await _0x2711bf['getConversations']();this['loadItems'](_0x54d3fb);}catch(_0x3a307e){this['fire']('error',{'error':_0x3a307e,'operation':'init'});}}['addItem'](_0x3bed01){this['items']['push'](_0x3bed01);}async['removeItem'](_0x1dd158){const _0xd2c020=this['items']['findIndex'](_0x165b9b=>_0x165b9b['id']===_0x1dd158);if(-0x1===_0xd2c020)return!0x1;try{return await this['connector']['deleteConversation'](_0x1dd158)['execute'](),this['items']['splice'](_0xd2c020,0x1),this['fire']('itemRemoved',{'itemId':_0x1dd158}),!0x0;}catch(_0x1c0674){return this['fire']('error',{'error':_0x1c0674,'operation':'removeItem','itemId':_0x1dd158}),!0x1;}}['getItem'](_0x247c71){return this['items']['find'](_0x30035d=>_0x30035d['id']===_0x247c71);}async['updateItemTitle'](_0x352314,_0x9dca4b){const _0x582363=this['getItem'](_0x352314);if(!_0x582363)return!0x1;try{return await this['connector']['updateConversation'](_0x352314,{'title':_0x9dca4b})['getResult'](),_0x582363['updateTitle'](_0x9dca4b),this['fire']('itemUpdated',{'itemId':_0x352314,'updates':{'title':_0x9dca4b}}),!0x0;}catch(_0x28153e){return this['fire']('error',{'error':_0x28153e,'operation':'updateItemTitle','itemId':_0x352314}),!0x1;}}async['updateItemPinned'](_0x5c19f5,_0x154cc9){const _0x603ab=this['getItem'](_0x5c19f5);if(!_0x603ab)return!0x1;try{return await this['connector']['updateConversation'](_0x5c19f5,{'pinned':_0x154cc9})['getResult'](),_0x603ab['updatePinned'](_0x154cc9),this['fire']('itemUpdated',{'itemId':_0x5c19f5,'updates':{'pinned':_0x154cc9}}),!0x0;}catch(_0x18f563){return this['fire']('error',{'error':_0x18f563,'operation':'updateItemPinned','itemId':_0x5c19f5}),!0x1;}}['loadItems'](_0x26d8b2){try{this['items']=[],_0x26d8b2['map'](_0x1e37d8=>{this['addItem'](new De(_0x1e37d8));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x367a3e){this['fire']('error',{'error':_0x367a3e,'operation':'loadItems'});}}['getItems'](_0x3c904e={}){const _0x575775=void 0x0!==_0x3c904e['pinned']&&_0x3c904e['pinned'],_0x425355=_0x3c904e['from']?new Date(_0x3c904e['from']['getFullYear'](),_0x3c904e['from']['getMonth'](),_0x3c904e['from']['getDate']()):null,_0x1897ba=_0x3c904e['to']?new Date(_0x3c904e['to']['getFullYear'](),_0x3c904e['to']['getMonth'](),_0x3c904e['to']['getDate']()):null;return this['items']['filter'](_0x9b4e17=>{if(_0x9b4e17['pinned']!==_0x575775)return!0x1;if(_0x1897ba){const _0x597204=new Date(_0x9b4e17['createdAt']['getFullYear'](),_0x9b4e17['createdAt']['getMonth'](),_0x9b4e17['createdAt']['getDate']());return _0x425355?_0x425355['getTime']()===_0x1897ba['getTime']()?_0x597204['getTime']()===_0x425355['getTime']():_0x597204<_0x1897ba&&_0x597204>=_0x425355:_0x597204<_0x1897ba;}return!0x0;});}}class yt extends _0x150b32{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[o,tt,jt,rt];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](o),this['_aiChatHistoryUi']=this['context']['plugins']['get'](jt),this['_aiChatController']=this['context']['plugins']['get'](tt);const _0x57a446=this['context']['plugins']['get'](rt),_0x40be5f=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x40be5f}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x19a149,_0x2e0040)=>{this['_setItemLoading'](_0x2e0040['id'],'remove'),this['_handleRemove'](_0x2e0040['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3b0d92,_0x456c61)=>{this['_setItemLoading'](_0x456c61['id'],'rename'),this['_handleEditTitle'](_0x456c61['id'],_0x456c61['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x4b080c,_0x1302d4)=>{void 0x0!==_0x1302d4['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x1302d4['itemId'],_0x1302d4['updates']['title']),void 0x0!==_0x1302d4['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x1302d4['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x58b07b,_0x407c82)=>{this['_aiChatController']['handleRemovedConversation'](_0x407c82['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x407c82['itemId']),this['_clearItemLoading'](_0x407c82['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x30efd5,_0x3bed8f)=>{this['_handleHistoryErrorUI'](_0x3bed8f['error'],_0x3bed8f['operation'],_0x3bed8f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4e9d0f,_0x3be208)=>{this['_handleSelectConversation'](_0x3be208['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x5b8f73,_0x4a5982)=>{const _0x4043b8=_0x4a5982['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4a5982['id'],_0x4043b8),this['_handleTogglePin'](_0x4a5982['id'],_0x4a5982['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x57a446['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x57a446['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x57a446,'resizedTabs',(_0x1904df,_0x1d8d98)=>{this['_setIsMaximized'](_0x1d8d98);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x57a446['resize']();});}async['_handleEditTitle'](_0x1f69fa,_0xd58be6){await this['history']['updateItemTitle'](_0x1f69fa,_0xd58be6);}async['_handleTogglePin'](_0x409a76,_0xb29e53){await this['history']['updateItemPinned'](_0x409a76,_0xb29e53);}async['_handleRemove'](_0x102a58){await this['history']['removeItem'](_0x102a58);}async['_handleSelectConversation'](_0x4ad81e){await this['_aiChatController']['loadConversation'](_0x4ad81e);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x314551=this['_aiChatController']['activeConversation']?.['id'],_0x32955b=this['_getCategorizedItems']()['map'](_0x1d851e=>({'title':_0x1d851e['title'],'items':_0x1d851e['items']['map'](_0x35a84d=>({'id':_0x35a84d['id'],'title':_0x35a84d['title']||Vn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x35a84d['createdAt'])['toLocaleDateString'](),'active':_0x35a84d['id']===_0x314551,'pinned':_0x35a84d['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x32955b);}['_setItemLoading'](_0x305aea,_0x87d58c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x305aea,_0x87d58c,!0x0);}['_clearItemLoading'](_0x269e3b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x269e3b,null,!0x1);}['_handleHistoryErrorUI'](_0x2b0c4f,_0x15ebb2,_0x8f156d){const _0x434440=this['_generateErrorMessage'](_0x15ebb2,_0x8f156d);this['_aiChatHistoryUi']['showError'](_0x434440),_0x8f156d&&this['_clearItemLoading'](_0x8f156d),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4c9ec9,_0x58d165){const _0x43c3a3=_0x58d165?this['history']['getItem'](_0x58d165):null,_0x3d360e=_0x43c3a3?.['title']||Vn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4c9ec9){case'updateItemTitle':return Vn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3d360e);case'updateItemPinned':{const _0x3df000=Vn(this['context']['locale'],_0x43c3a3?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Vn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3df000,_0x3d360e]);}case'removeItem':return Vn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3d360e);case'init':case'loadItems':return Vn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Vn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x8ea6be=new Date(),_0x3ba533=new Date(_0x8ea6be['getFullYear'](),_0x8ea6be['getMonth'](),_0x8ea6be['getDate']()),_0x3bbea8=new Date(_0x3ba533);_0x3bbea8['setDate'](_0x3bbea8['getDate']()-0x1);const _0x40413e=new Date(_0x3ba533);_0x40413e['setDate'](_0x40413e['getDate']()-0xe);const _0x374eb5=this['history']['getItems']({'pinned':!0x0}),_0x1fcabb=this['history']['getItems']({'from':_0x3ba533,'to':_0x3ba533}),_0x5c2fba=this['history']['getItems']({'from':_0x3bbea8,'to':_0x3bbea8}),_0x489858=this['history']['getItems']({'from':_0x40413e,'to':_0x3bbea8}),_0x4dbc82=this['history']['getItems']({'to':_0x40413e}),_0x21857f=[];return _0x374eb5['length']>0x0&&_0x21857f['push']({'title':Vn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x374eb5}),_0x1fcabb['length']>0x0&&_0x21857f['push']({'title':Vn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1fcabb}),_0x5c2fba['length']>0x0&&_0x21857f['push']({'title':Vn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x5c2fba}),_0x489858['length']>0x0&&_0x21857f['push']({'title':Vn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x489858}),_0x4dbc82['length']>0x0&&_0x21857f['push']({'title':Vn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4dbc82}),_0x21857f;}['_setIsMaximized'](_0x4b58e6){this['_aiChatHistoryUi']['setIsMaximized'](_0x4b58e6);}}class it extends _0x150b32{static get['requires'](){return[yt,jt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ga extends _0x150b32{static get['requires'](){return[tt,a,et,it];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf4cbb5){super(_0xf4cbb5);const _0x469bb3=_0xf4cbb5['config'];_0x469bb3['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x469bb3['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](tt)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](tt)['startConversation']();}async['sendMessage']({message:_0x16068f,quickActionData:_0xd11d6b}){await this['context']['plugins']['get'](tt)['sendMessage']({'message':_0x16068f,'quickActionData':_0xd11d6b});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](tt)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](tt)['focusPromptInput']();}}function Aa(_0x335d4c,_0x3164fb,_0x548fb1){const t=_0x335d4c['t'];switch(_0x3164fb){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x548fb1);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x3164fb;}}function Yt(_0x5675ff,_0x2703bf,_0x17ae3c=!0x1,_0x32c421=!0x0){return()=>{const _0x1ee419=_0x5675ff['locale'],_0x2d6873=new _0x3678e7(_0x1ee419),_0x5691e3=_0x2d6873['bindTemplate'];_0x2d6873['extendTemplate']({'on':{'mouseenter':_0x5691e3['to'](()=>{_0x2d6873['focus']();})}});const _0xc443a1=_0x2703bf['icon']??_0x2703bf['parent']?.['icon'];return _0x2d6873['set']({'label':_0x2703bf['displayedPrompt'],'withText':_0x17ae3c,'role':'menuitem','icon':_0x32c421?_0xc443a1??_0x37a60c:void 0x0,'tooltip':!_0x17ae3c}),_0x2d6873['on']('execute',()=>{_0x5675ff['editing']['view']['focus'](),_0x5675ff['commands']['execute']('aiQuickAction',_0x2703bf);}),_0x2d6873;};}const gs='menu',qs='menuitem';class io extends _0x179f2b{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0xcbdf53,_0x27bf6a,_0x578bc2,_0x730b8e){const _0x27b6c3=_0xcbdf53['locale'];super(_0x27b6c3),this['_bodyCollection']=_0x730b8e;const _0xc8c416=this['_createListItems'](_0xcbdf53,_0x27bf6a,_0x578bc2);this['optionsListView']=new _0x56c802(_0x27b6c3),this['optionsListView']['role']=gs,this['optionsListView']['items']['addMany'](_0xc8c416),this['focusTracker']=new _0x54be86(),this['keystrokes']=new _0x46e306(),this['_focusables']=_0xc8c416,this['focusCycler']=new ts({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x27b6c3['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x3abc9b,_0x4e5876,_0x4cfa11){const _0x3e03cc=new _0x476d2b();return _0x4e5876['forEach'](_0x5eeb56=>{'actions'in _0x5eeb56?_0x3e03cc['add'](this['_createActionGroupButton'](_0x3abc9b,_0x5eeb56,_0x4cfa11)):_0x3e03cc['add'](this['_createActionButton'](_0x3abc9b,_0x5eeb56));}),_0x3e03cc;}['_createActionButton'](_0x4ade10,_0x24e9f6){const _0x3a1bba=new _0xfd7405(this['locale']),_0x492d55=Yt(_0x4ade10,_0x24e9f6,!0x0)();return _0x3a1bba['children']['add'](_0x492d55),_0x3a1bba;}['_createActionGroupButton'](_0x622b60,_0x5dfb57,_0x4e82e2){const _0x6f1553=new _0xfd7405(this['locale']),_0x4962e7=new _0x4ebc14(this['locale']),_0x3ba58a=_0x4962e7['bindTemplate'],_0x38a20f='rtl'===_0x4e82e2['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x5c8287=this['_createGroupActionsList'](_0x622b60,_0x5dfb57['actions'],_0x4e82e2);_0x4962e7['set']({'label':_0x5dfb57['label'],'withText':!0x0,'role':qs,'icon':_0x5dfb57['icon']??_0x37a60c}),_0x4962e7['extendTemplate']({'on':{'mouseenter':_0x3ba58a['to'](()=>{_0x4962e7['focus']();})}});const _0x104a81=new _0x4f7937(this['locale']);return _0x104a81['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x3ba58a['to'](_0x43f9c7=>{_0x43f9c7['key']==_0x38a20f&&(_0x4962e7['focus'](),this['_hideNestedPanel'](_0x104a81));})}}),_0x4962e7['bind']('isOn')['to'](_0x104a81,'isVisible'),this['_bodyCollection']['add'](_0x104a81),_0x104a81['content']['add'](_0x5c8287),this['_setupGroupMenuBehavior'](_0x4962e7,_0x104a81),_0x6f1553['children']['add'](_0x4962e7),_0x6f1553;}['_createGroupActionsList'](_0x2e5728,_0x56d5c7,_0x47a2e3){const _0x4f59bd=new _0x56c802(this['locale']);return _0x4f59bd['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x56d5c7['forEach'](_0x5b7429=>{const _0x46eb59=new _0xfd7405(this['locale']),_0x9ef9ed=Yt(_0x2e5728,_0x5b7429,!0x0,!0x1)();_0x46eb59['children']['add'](_0x9ef9ed),_0x47a2e3['focusTracker']['add'](_0x9ef9ed),_0x4f59bd['items']['add'](_0x46eb59);}),_0x4f59bd;}['_setupGroupMenuBehavior'](_0x4459d6,_0x44777c){const _0x81a4aa=_0x4459d6['bindTemplate'],_0x436099='rtl'===_0x4459d6['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x4459d6['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x81a4aa['to'](()=>{this['_showNestedPanel'](_0x44777c,_0x4459d6);}),'mouseleave':_0x81a4aa['to'](_0x3c33a4=>{const _0x476845=_0x3c33a4['relatedTarget'];this['_isMovingToNestedMenu'](_0x476845,_0x44777c)||this['_hideNestedPanel'](_0x44777c);}),'keydown':_0x81a4aa['to'](_0x27e702=>{_0x27e702['key']==_0x436099&&(this['_showNestedPanel'](_0x44777c,_0x4459d6),_0x44777c['content']['get'](0x0)['focus']());})}}),_0x44777c['on']('render',()=>{_0x44777c['element']?.['addEventListener']('mouseleave',_0x4f4d8f=>{const _0x59e6ac=_0x4f4d8f['relatedTarget'];_0x4459d6['element']?.['contains'](_0x59e6ac)||this['_isMovingToNestedMenu'](_0x59e6ac,_0x44777c)||this['_hideNestedPanel'](_0x44777c);});});}['_showNestedPanel'](_0x122608,_0x44f5d5){this['_openNestedPanels']['forEach'](_0x22ad2f=>{_0x22ad2f!==_0x122608&&_0x22ad2f['isVisible']&&_0x22ad2f['hide']();}),_0x122608['show'](),_0x122608['pin']({'positions':[_0x58671d['eastSouth']],'target':_0x44f5d5['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x122608);}['_hideNestedPanel'](_0x2ddd38){_0x2ddd38['hide'](),this['_openNestedPanels']['delete'](_0x2ddd38);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3aea19=>_0x3aea19['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x4bc88e,_0x3237b0){if(!_0x4bc88e)return!0x1;if(_0x3237b0['element']?.['contains'](_0x4bc88e))return!0x0;const _0x56cc58=_0x4bc88e;return _0x56cc58['closest']&&(null!==_0x56cc58['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x56cc58['closest']('.ck-ai-quick-actions-group-list')||null!==_0x56cc58['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Dt(_0x109888,_0x21355c,_0x47c013,_0x3f26b4){return()=>{const _0x1977f2=_0x109888['locale'],_0x1051d5=_0x3e7f7b(_0x1977f2);_0x1051d5['buttonView']['set']({'icon':_0x47c013['icon']??_0x37a60c,'label':_0x47c013['label'],'tooltip':!0x0}),_0x1051d5['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x20a8e9=new io(_0x109888,_0x21355c,_0x1051d5,_0x3f26b4);return _0x1051d5['panelView']['children']['add'](_0x20a8e9),_0x1051d5;};}const Ft='<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>',zt='<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>',Wt='<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 oi=function(_0x3646b){return _0x3646b['CHAT']='CHAT',_0x3646b['ACTION']='ACTION',_0x3646b['REVIEW']='REVIEW',_0x3646b;}({}),ma=function(_0x23c77f){return _0x23c77f['CHAT']='AIChat',_0x23c77f['ACTION']='AIActions',_0x23c77f['REVIEW']='AIReviewMode',_0x23c77f;}({});class ti extends _0x2c78e0{static get['requires'](){return[Gt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2c275f){return function(_0x460571){const _0xefc356=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x460571['uiLanguage']),_0x1fd6a1=_0xefc356||'English',_0x264d1a=[{'id':'ask-ai','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Qt},{'id':'chat-commands','label':Aa(_0x460571,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Ot,'actions':[{'id':'explain','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ft['replace']('%0',_0x1fd6a1),'type':'CHAT'},{'id':'summarize','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':zt['replace']('%0',_0x1fd6a1),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Wt['replace']('%0',_0x1fd6a1),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Kt},{'id':'continue','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Ut},{'id':'fix-grammar','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':bt},{'id':'adjust-length','label':Aa(_0x460571,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Nt,'actions':[{'id':'make-shorter','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':Aa(_0x460571,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':xt,'actions':[{'id':'make-tone-casual','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Lt,'actions':[{'id':'translate-to-english','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':Aa(_0x460571,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Aa(_0x460571,'AI_QUICK_ACTIONS_OTHER'),'icon':Mt,'actions':[]}];return _0x264d1a;}(_0x2c275f);}['_getDefaultAndCustomActions'](){const _0xf00073=ti['getDefaultQuickActions'](this['editor']['locale']),_0x4bad6c=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x38f928=>({..._0x38f928,'icon':void 0x0}));return _0xf00073['find'](_0x2d0b75=>'other'===_0x2d0b75['id'])['actions']['push'](..._0x4bad6c),_0xf00073;}['_initializeQuickActionsComponentsAndCommands'](){const _0x19dc3b=new qt(this['editor']['locale']);_0x19dc3b['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x19dc3b),this['_initializeQuickActionsComponents'](_0x19dc3b);}['_initializeQuickActionsDropdown'](_0x3077f3){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Dt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x37a60c,'label':Aa(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x3077f3));}['_prepareQuickActionsDefinition'](_0x359b43){this['_quickActionsDefinition']=_0x359b43['map'](_0x148fca=>{if('actions'in _0x148fca){const _0x2a647d=_0x148fca;return{..._0x2a647d,'actions':_0x2a647d['actions']['map'](_0x507aa7=>{const {actions:_0x2c4e04,..._0x5588f0}=_0x2a647d;return{..._0x507aa7,'parent':_0x5588f0};})['filter'](_0x47d7b7=>this['_shouldIncludeAction'](_0x47d7b7))};}return _0x148fca;})['filter'](_0xf02285=>'actions'in _0xf02285?_0xf02285['actions']['length']>0x0:this['_shouldIncludeAction'](_0xf02285));}['_shouldIncludeAction'](_0x37a70a){const _0x2f17e2=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](ma[_0x37a70a['type']])&&!_0x2f17e2['includes'](_0x37a70a['id']);}['_initializeQuickActionsComponents'](_0x436a46){this['_quickActionsDefinition']['forEach'](_0x1a1497=>{if('actions'in _0x1a1497){const _0x1eaa3a=Dt(this['editor'],_0x1a1497['actions'],_0x1a1497,_0x436a46);this['editor']['ui']['componentFactory']['add'](_0x1a1497['id'],_0x1eaa3a),_0x1a1497['actions']['forEach'](_0x1b5351=>{const _0x15cf34=Yt(this['editor'],_0x1b5351);this['editor']['ui']['componentFactory']['add'](_0x1b5351['id'],_0x15cf34);});}else{const _0x5d710a=Yt(this['editor'],_0x1a1497);this['editor']['ui']['componentFactory']['add'](_0x1a1497['id'],_0x5d710a);}});}}class ci extends _0x2ae2c4{['execute'](_0x3ec1f8){switch(_0x3ec1f8['type']){case oi['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x1ad4d5=Aa(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x516722('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1ad4d5});}this['_handleAIChatAction'](_0x3ec1f8);break;case oi['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x284c85=Aa(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x516722('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x284c85});}this['_handleAIActionsAction'](_0x3ec1f8);break;case oi['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x22e636=Aa(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x516722('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x22e636});}this['_handleAIReviewAction'](_0x3ec1f8);}}async['_handleAIChatAction'](_0x1b6569){const _0x23da2e=this['editor']['plugins']['get']('AIChat'),_0x123670=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x1b6569['id'])_0x123670['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0x23da2e['addSelectionToChatContext'](),_0x23da2e['focusPromptInput']();else await _0x23da2e['startConversation'](),await _0x23da2e['addSelectionToChatContext'](),await _0x23da2e['sendMessage']({'message':_0x1b6569['prompt']||_0x1b6569['displayedPrompt'],'quickActionData':{'id':_0x1b6569['id'],'displayedPrompt':_0x1b6569['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3b7978=this['editor'],_0x15b0a8=_0x3b7978['model']['document']['selection'];if(!_0x15b0a8['isCollapsed'])return;const _0x1f1d6d=_0x478af3(_0x15b0a8['getSelectedBlocks']())||_0x3b7978['model']['schema']['getLimitElement'](_0x15b0a8);_0x3b7978['model']['change'](_0x290c74=>{_0x290c74['setSelection'](_0x1f1d6d,'in');});}async['_handleAIActionsAction'](_0x2b442c){const _0x18fb86=this['editor']['plugins']['get']('AIActions'),_0x55ae8f=_0x2b442c['prompt']?{'userMessage':_0x2b442c['prompt'],'model':_0x2b442c['model']}:{'actionName':_0x2b442c['actionName']||_0x2b442c['id'],'args':_0x2b442c['args']};await _0x18fb86['executeAction'](_0x55ae8f,_0x2b442c['displayedPrompt'],_0x2b442c['icon']);}async['_handleAIReviewAction'](_0x42af75){console['log']('handleAIReviewAction',_0x42af75);}}class ri extends _0x2c78e0{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x52643e=this['editor'],_0xb619e8=new ci(this['editor']);if(_0x52643e['commands']['add']('aiQuickAction',_0xb619e8),_0x52643e['plugins']['has']('AIChat')){const _0x329b24=this['editor']['plugins']['get']('AIChat');_0x52643e['model']['document']['selection']['on']('change:range',(_0x198e7d,_0x3cca8c)=>{_0x3cca8c['directChange']&&_0x329b24['removeSelectionFromChatContext']();});}}}class pa extends _0x2c78e0{static get['requires'](){return[ti,ri];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cdbf1){super(_0x3cdbf1),_0x3cdbf1['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class he extends fi{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),this['parsedContent']['children']['length']>0x0){const _0x1f2843=[];for(const _0x466309 of this['parsedContent']['children'])if(_0x40109d(_0x466309)){const _0x3c6e27=mt(_0x466309,'data-id');_0x3c6e27&&_0x1f2843['push']({'node':_0x466309,'type':'modified','id':_0x3c6e27});}_0x1f2843['length']>0x0?this['changeGroups']=[{'changes':_0x1f2843,'state':'pending','index':0x0}]:this['changeGroups']=[{'changes':[{'node':this['parsedContent']['children'][0x0],'type':'modified','id':'ai-actions-content'}],'state':'pending','index':0x0}];}else this['changeGroups']=[];}}class c extends oe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x542735){super(_0x542735),this['content']=_0x542735['content'],this['version']=_0x542735['version'],this['actionName']=_0x542735['actionName'],this['args']=_0x542735['args'],this['userMessage']=_0x542735['userMessage'],this['model']=_0x542735['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':ce['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x3c88e7){const _0x23ffe7=new he({'editor':this['editor'],'documentContextContent':this['content'],..._0x3c88e7});return this['replies']['push'](_0x23ffe7),_0x23ffe7['delegate'](...ne)['to'](this),this['fire']('replyCreated',_0x23ffe7),_0x23ffe7;}}class Ta extends _0x2c78e0{static get['requires'](){return[o,_0x1abae0,a,m,_0x122df6];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x476d2b();['_promiseQueue'];constructor(_0x5c8d18){super(_0x5c8d18),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0x39c62c,_0x56a7da,_0x2ed716){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']())return this['_executeActionOnTable'](_0x39c62c,_0x56a7da,_0x2ed716);}return this['_executeActionRegular'](_0x39c62c,_0x56a7da,_0x2ed716);}['_executeActionRegular'](_0x457f09,_0x229b8c,_0x36e676){const _0x1a093b=this['editor']['plugins']['get'](a),_0x5128b1=this['editor']['plugins']['get'](m),_0x10d74a=this['editor']['model']['document']['selection'];if(_0x10d74a['isCollapsed']){const _0x6871b=_0x478af3(_0x10d74a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x10d74a);this['editor']['model']['change'](_0x4b7655=>{_0x4b7655['setSelection'](_0x6871b,'in');});}const _0x4d0a41=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x10d74a),_0x10d74a),_0x43ec28=_0x1a093b['modelToViewWithIds'](_0x4d0a41),_0x478ade=this['editor']['data']['processor']['toData'](_0x43ec28),_0x449c27=this['editor']['model']['document']['version'],_0x5817c2=[..._0x10d74a['getRanges']()],_0x3556d5=new s(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x5128b1['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x229b8c,'icon':_0x36e676||_0x37a60c,'mainView':_0x3556d5,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x5817c2}),this['_setLoadingState'](_0x3556d5,_0x5128b1);const _0xba3c1a=_0x10d74a['getFirstPosition']();return this['listenTo'](_0x5128b1,'applySuggestion',()=>{this['_applySuggestion'](_0xba3c1a);}),this['listenTo'](_0x5128b1,'insertSuggestion',()=>{this['_insertSuggestion'](_0xba3c1a);}),this['listenTo'](_0x5128b1,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x5128b1);}),this['_createInteraction'](_0x478ade,_0x449c27,_0x3556d5,_0x5128b1,_0x457f09);}['_executeActionOnTable'](_0x50b4e9,_0xc0a38d,_0x3d6fb0){const _0x1bbf2f=this['editor']['plugins']['get'](a),_0x10487b=this['editor']['plugins']['get'](m),_0x1ca794=this['editor']['model']['document']['selection'],_0x5c6c60=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x39f22d=_0x1bbf2f['modelToViewWithIds'](_0x5c6c60),_0x5bbbe2=this['editor']['data']['processor']['toData'](_0x39f22d),_0x5582dc=this['editor']['model']['document']['version'],_0x471c19=[..._0x1ca794['getRanges']()],_0x31ea30=new s(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']}});_0x10487b['open']({'index':0x0,'title':_0xc0a38d,'icon':_0x3d6fb0||_0x37a60c,'mainView':_0x31ea30,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x471c19}),this['_setLoadingState'](_0x31ea30,_0x10487b);const _0x39ebe4=_0x1ca794['getFirstPosition']();return this['listenTo'](_0x10487b,'applySuggestion',()=>{this['_applySuggestion'](_0x39ebe4);}),this['listenTo'](_0x10487b,'insertSuggestion',()=>{this['_insertSuggestion'](_0x39ebe4);}),this['listenTo'](_0x10487b,'dialogClosed',()=>{this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['stopListening'](_0x10487b);}),this['_createInteraction'](_0x5bbbe2,_0x5582dc,_0x31ea30,_0x10487b,_0x50b4e9);}['_wrapWithCommonAncestors'](_0x4e1f57,_0x3cb6a3){const _0x14b069=_0x3cb6a3['getFirstRange']()['getCommonAncestor'](),_0x200f58=_0x14b069['is']('documentFragment')?[]:_0x14b069['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x200f58['length']){const _0x97c4a2=_0x200f58['map'](_0x4aafda=>_0x4aafda['_clone'](!0x1));for(let _0x3d7b29=0x1;_0x3d7b29<_0x97c4a2['length'];_0x3d7b29++)_0x97c4a2[_0x3d7b29-0x1]['_appendChild'](_0x97c4a2[_0x3d7b29]);return _0x97c4a2[_0x97c4a2['length']-0x1]['_appendChild'](_0x4e1f57),new _0x59e9ed(_0x97c4a2[0x0]);}return _0x4e1f57;}async['_createInteraction'](_0x1a3ab1,_0x2d5a29,_0x42cfbc,_0x2baefe,_0x3d8556){const _0x41ca1a=this['editor'];this['_currentInteractionParams']={'action':_0x3d8556,'content':_0x1a3ab1,'version':_0x2d5a29,'mainView':_0x42cfbc,'aiBalloon':_0x2baefe},this['_interaction']=new c({'connector':this['_aiConnector'],'editor':_0x41ca1a,'content':_0x1a3ab1,'version':_0x2d5a29,..._0x3d8556});const _0x4c3ec4=(_0x7aad6a,_0x3892ee,_0x245004=!0x1,_0x469a96='streaming')=>this['_promiseQueue']['enqueue'](async _0x5ce182=>{try{const _0x2dc457=d({'editor':_0x41ca1a,'changeGroups':_0x7aad6a['changeGroups'],'documentContextContent':_0x7aad6a['documentContextContent'],'showDiff':_0x245004,'trimUnchanged':!0x1});await _0x3892ee['updateContent']({'parts':_0x2dc457,'renderingStrategy':_0x469a96,'abortSignal':_0x5ce182});}catch(_0x47e554){if(this['_isAbortError'](_0x47e554))return;throw _0x47e554;}});this['_interaction']['on']('replyCreated',(_0x501b9f,_0x291c25)=>{_0x42cfbc['hideLoader'](),_0x4c3ec4(_0x291c25,_0x42cfbc)['catch'](_0x440fe0=>{this['_isAbortError'](_0x440fe0)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x440fe0);});}),this['_interaction']['on']('replyContentUpdated',(_0x23ddbb,_0x50f594)=>{_0x4c3ec4(_0x50f594,_0x42cfbc)['catch'](_0x4c56b8=>{this['_isAbortError'](_0x4c56b8)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x4c56b8);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x42cfbc,_0x2baefe);}catch(_0x3a0020){this['_isAbortError'](_0x3a0020)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3a0020);}}),this['listenTo'](_0x42cfbc,'toggleSuggestionDisplayMode',(_0x643762,{showDiff:_0x1c5b08})=>{this['_balloonShowDiff']=_0x1c5b08;const _0x314e07=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x314e07&&_0x4c3ec4(_0x314e07,_0x42cfbc,_0x1c5b08,'static')['catch'](_0x3ca7f6=>{this['_isAbortError'](_0x3ca7f6)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3ca7f6);});}),this['_setLoadingState'](_0x42cfbc,_0x2baefe);try{return await this['_interaction']['start']();}catch(_0x48d971){if(this['_isAbortError'](_0x48d971))return;throw _0x48d971;}}['_insertSuggestion'](_0x47964b){const _0x658bc0=this['editor'],_0x384419=this['editor']['plugins']['get'](_0x122df6),_0x3aad4b=this['_interaction'],_0x43418e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x5bfa53=_0x43418e['changeGroups'],_0x4d974c=w({'editor':_0x658bc0,'reply':_0x43418e,'interaction':_0x3aad4b,'groups':_0x5bfa53,'transform':!0x1,'documentCompare':_0x384419,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});for(const _0x54f406 of _0x4d974c)this['_anchorOperation'](_0x47964b,_0x54f406);const _0x15f4ef=_0x3aad4b['getDocumentContext']()['version'],_0x4768ca=_0x658bc0['model']['document']['history']['getOperations'](_0x15f4ef),_0x5c574c={'document':_0x658bc0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4fe171=_0x3b6950(_0x4d974c,_0x4768ca,_0x5c574c)['operationsA'];_0x658bc0['model']['change'](_0x4d8e2a=>{_0x4d8e2a['setSelection'](_0x658bc0['model']['document']['selection']['focus']),_0x658bc0['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4fe171);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_applySuggestion'](_0x31c2fe){const _0x21373f=this['editor'],_0x46236d=this['editor']['plugins']['get'](_0x122df6),_0x495f76=this['_interaction'],_0x4bb825=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0xe05a6d=_0x4bb825['changeGroups'],_0x938fca=w({'editor':_0x21373f,'reply':_0x4bb825,'interaction':_0x495f76,'groups':_0xe05a6d,'transform':!0x1,'documentCompare':_0x46236d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});for(const _0x6f1599 of _0x938fca)this['_anchorOperation'](_0x31c2fe,_0x6f1599);const _0x202403=_0x495f76['getDocumentContext']()['version'],_0x1665ce=_0x21373f['model']['document']['history']['getOperations'](_0x202403),_0x164350={'document':_0x21373f['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2427b0=_0x3b6950(_0x938fca,_0x1665ce,_0x164350)['operationsA'];_0x21373f['model']['change'](_0x52b7e7=>{_0x52b7e7['setSelection'](_0x21373f['model']['document']['selection']['focus']);for(const _0x3eff05 of _0x2427b0)_0x3eff05['baseVersion']=_0x21373f['model']['document']['version'],_0x52b7e7['batch']['addOperation'](_0x3eff05),_0x21373f['model']['applyOperation'](_0x3eff05);}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_anchorOperation'](_0x447454,_0x2fec6a){for(const _0x409615 in _0x2fec6a){const _0x3c233f=_0x2fec6a[_0x409615];_0x3c233f instanceof _0xf5c05f?_0x2fec6a[_0x409615]=new _0xf5c05f(_0xa089a8(_0x3c233f['start']),_0xa089a8(_0x3c233f['end'])):_0x3c233f instanceof _0x34be7e&&(_0x2fec6a[_0x409615]=_0xa089a8(_0x3c233f));}function _0xa089a8(_0x14d701){if(_0x14d701['root']!=_0x447454['root'])return _0x14d701;const _0x678285=_0x14d701['path']['slice']();for(let _0x5dfb4e=0x0;_0x5dfb4e<_0x447454['path']['length']&&_0x5dfb4e<_0x678285['length'];_0x5dfb4e++){const _0x5a0a5b=0x0!=_0x678285[_0x5dfb4e];if(_0x678285[_0x5dfb4e]+=_0x447454['path'][_0x5dfb4e],_0x5a0a5b)break;}return new _0x34be7e(_0x14d701['root'],_0x678285,_0x14d701['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x29fa7c,content:_0x5de686,version:_0x599f65,mainView:_0x55a853,aiBalloon:_0x3c3b08}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x55a853),_0x55a853['showLoader'](),this['_createInteraction'](_0x5de686,_0x599f65,_0x55a853,_0x3c3b08,_0x29fa7c)['catch'](_0x42e43b=>{this['_isAbortError'](_0x42e43b)||console['error']('Error\x20refreshing\x20interaction:',_0x42e43b);});}['_clearSuggestionContent'](_0xf21212){const _0x5d06d8=_0xf21212['bodyView']['_children'];for(;_0x5d06d8['length']>0x0;)_0x5d06d8['remove'](_0x5d06d8['first']);_0xf21212['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x20eb47){return!!_0x20eb47['message']&&_0x20eb47['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0xc70051=new _0x3678e7(this['editor']['locale']);_0xc70051['set']({'icon':_0x43d481,'label':Vn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0xc70051['bind']('isEnabled')['to'](this,'isBusy',_0x2b5416=>!_0x2b5416),_0xc70051['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0xc70051);}['_setLoadingState'](_0xc2669,_0x5b844f){_0xc2669['setLoading'](),_0x5b844f['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x49b14,_0x560359){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x49b14['clearLoading'](),_0x560359['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x9f71e4,title:_0x1876fb,description:_0x179938,isParameterized:_0x157c3c,useArgs:_0x43d611,options:_0x332d2b}){this['id']=_0x9f71e4,this['title']=_0x1876fb,this['description']=_0x179938,this['isParameterized']=_0x157c3c,this['useArgs']=_0x43d611,this['options']=_0x332d2b;}}class ea extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x121614){this['_models']=_0x121614;}}const ta=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','default':'spanish','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ei extends _0x3a17ed(){['_checks'];constructor(){super(),this['_checks']=this['_getAvailableReviewChecks']();}get['checks'](){return this['_checks'];}get['getExpandedChecks'](){return this['_getExpandedReviewChecks']();}['getCheckById'](_0xa3e182){return this['getExpandedChecks']['find'](_0x31adf1=>_0x31adf1['id']===_0xa3e182);}['_getAvailableReviewChecks'](){return ta['map'](_0xc41640=>'custom'===_0xc41640['id']?new ea(_0xc41640):new vs(_0xc41640));}['_getExpandedReviewChecks'](){return ta['flatMap'](_0x3422c0=>{if(_0x3422c0?.['useArgs'])return[_0x3422c0];if(_0x3422c0['isParameterized']&&_0x3422c0['options']?.['length']){const _0x383db0=_0x3422c0['options']['map'](_0x1f73fb=>_0x1f73fb['data']||[]);return _0x383db0['reduce']((_0x4c350f,_0x28f525)=>_0x4c350f['flatMap'](_0x4d52e1=>_0x28f525['map'](_0x26ee00=>[..._0x4d52e1,_0x26ee00])),[[]])['map'](_0x270cf3=>{const _0x56b7be=_0x270cf3['map'](_0x405177=>_0x405177['id'])['join']('-'),_0x4ed629=_0x270cf3['map'](_0x2da4dd=>_0x2da4dd['label'])['join'](',\x20');return{..._0x3422c0,'id':_0x3422c0['id']+'-'+_0x56b7be,'title':_0x3422c0['title']+':\x20\x0a'+_0x4ed629,'selectedOptions':_0x270cf3};});}return[_0x3422c0];});}}class Rs extends _0x1f835a(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x183deb,contentNew:_0x595fd9,contentInitial:_0x56636e,documentVersion:_0x295975}){super(),this['id']=_0x183deb,this['contentNew']=_0x595fd9,this['contentInitial']=_0x56636e,this['documentVersion']=_0x295975;}}class Cs extends _0x3a17ed(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4a2560,_0x3bea79,_0x447b54){super(),this['id']=_0x4a2560,this['parent']=_0x447b54,this['_data']=_0x3bea79,this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class xs extends _0x3a17ed(){['id']=_0x215bb4();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x7837fa,_0x300218,_0x2fde9b,_0x5ab415){super(),this['_documentData']=_0x7837fa,this['_sourceCheck']=_0x300218,this['_aiConnector']=_0x2fde9b,this['_reviewArgs']=_0x5ab415,this['on']('change:status',(_0x56018b,_0x580873,_0x2d9cb6)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x2d9cb6,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x12ab21=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1b2b29 of _0x12ab21)'unmodified'!==_0x1b2b29['data']['operation']&&('error'!==_0x1b2b29['data']['operation']?this['_addReviewCheckResult'](_0x1b2b29['data']['dataId'],_0x1b2b29['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(this['status']='ready');}catch(_0x471a5b){this['_currentError']=_0x471a5b,_0x471a5b instanceof Error&&_0x471a5b['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'](_0x2280e3,_0x1aebf5){const _0x5491f0=this['_results']['get'](_0x2280e3);if(!_0x5491f0)return;const _0x1e55c3=[];_0x1aebf5['forEach']((_0x39bb97,_0x157d4a)=>{const _0x189ac7=new Cs(_0x5491f0['id']+'-'+_0x157d4a,_0x39bb97,_0x5491f0);_0x189ac7['on']('change:status',()=>{'accepted'===_0x189ac7['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x189ac7}):'rejected'===_0x189ac7['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x189ac7});}),this['_changes']['push'](_0x189ac7),_0x1e55c3['push'](_0x189ac7);}),this['fire']('reviewCheckResultReady',{'changes':_0x1e55c3,'result':_0x5491f0,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x35e99e){const _0x3288b2=this['_changes']['find'](_0x439da3=>_0x439da3['id']===_0x35e99e);return!(!_0x3288b2||'active'!==_0x3288b2['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x560a04=>'active'===_0x560a04['status']);}['markAllChangesAsAccepted'](){for(const _0xbfc60d of this['_changes'])'active'===_0xbfc60d['status']&&(_0xbfc60d['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1ad4ef){const _0x5c82f8=this['_changes']['find'](_0x9abf48=>_0x9abf48['id']===_0x1ad4ef);_0x5c82f8&&'active'===_0x5c82f8['status']&&(_0x5c82f8['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0xa77f32){const _0x33130c=this['_changes']['find'](_0x3b4843=>_0x3b4843['id']===_0xa77f32);_0x33130c&&'active'===_0x33130c['status']&&(_0x33130c['status']='rejected'),this['_checkIfFinished']();}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x304e65,_0x3537c0){const _0x5015f4=this['_documentData']['elements']['get'](_0x304e65);if(!_0x5015f4)return;const _0x21888e=_0x5015f4['getContent']();if(_0x21888e===_0x3537c0)return;const _0x227553=new Rs({'id':_0x304e65,'contentInitial':_0x21888e,'contentNew':_0x3537c0,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x227553['id'],_0x227553),this['fire']('reviewCheckResultAdded',{'result':_0x227553,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x31f065=>'active'===_0x31f065['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class hi extends xs{['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_sourceCheck']['id'],'content':this['_documentData']['content'],'args':this['_reviewArgs']});}}class ni extends xs{['_prompt'];['_model'];constructor(_0xdc94c9,_0x4b73dc,_0x7f4ef6,_0x2a24da,_0x3b4393){super(_0x7f4ef6,_0x2a24da,_0x3b4393),this['_prompt']=_0xdc94c9,this['_model']=_0x4b73dc;}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class ai extends _0x1f835a(){['_modelList']=[];['_connector'];constructor({connector:_0x4b3048}){super(),this['_connector']=_0x4b3048;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x1a251a=this['_connector']['getModels'](),_0xfc3cfc=await _0x1a251a['list']();this['_modelList']=_0xfc3cfc['items'];}catch{}return this['_modelList'];}}class ee extends _0x150b32{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;static get['requires'](){return[o];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing'),this['_aiReviewCheckList']=new ei(),this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',async()=>{const _0x55b94a=new ai({'connector':this['_aiConnector']});this['_aiReviewCheckList']['checks']['find'](_0x2f9a99=>'custom'===_0x2f9a99['id'])['models']=await _0x55b94a['getAll'](),this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x1a8e31,_0x5dff28)=>{const _0x118fbe=this['_aiReviewCheckList']['getCheckById'](_0x5dff28['id']);if(_0x118fbe){this['_onDiffChange'](this['_isDiffOn']),_0x5dff28['isCustom']?(this['_aiReviewModeUi']['setCheckResultTitle'](_0x5dff28['args']['prompt']),this['_currentReviewCheckRun']=new ni(_0x5dff28['args']['prompt'],_0x5dff28['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x118fbe,this['_aiConnector'])):(this['_aiReviewModeUi']['setCheckResultTitle'](_0x118fbe['title']),this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x118fbe,this['_aiConnector'],_0x5dff28['args'])),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4a2a86,_0x3eaf63)=>{'data'===_0x3eaf63['status']||'loading'===_0x3eaf63['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x3eaf63)):'finished'===_0x3eaf63['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x3eaf63['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'error-general'===_0x3eaf63['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x3eaf63['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x3eaf63['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4e5419,_0x461cf6)=>{if(!this['_currentReviewCheckRun'])throw new _0x516722('aireviewmode-no-current-check-run',this);const _0x423aaa=this['_aiReviewModeEditing']['diffContent'](_0x461cf6['result']['contentInitial'],_0x461cf6['result']['contentNew']);_0x461cf6['source']['addResultChanges'](_0x461cf6['result']['id'],_0x423aaa);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x34709a,_0xe95d84)=>{for(const _0x5f39f5 of _0xe95d84['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x5f39f5);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0xe95d84['changes'],_0xe95d84['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x4569d3,_0x49f064)=>{this['_aiReviewModeUi']['updateChangeState'](_0x49f064['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x274c1d,_0x3fab42)=>{this['_aiReviewModeUi']['updateChangeState'](_0x3fab42['change']['id'],'rejected');});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2bfee5){_0x2bfee5 instanceof Error&&_0x2bfee5['message']['includes']('ai-request-aborted')||(_0x2bfee5 instanceof _0x516722?this['_logError'](_0x2bfee5):this['_logError'](new _0x516722('aireviewmode-check-run-failed',this,{'error':_0x2bfee5})));}}else this['_logError'](new _0x516722('aireviewmode-source-check-not-found',this,{'checkId':_0x5dff28['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',async()=>{if(!this['_currentReviewCheckRun'])return;const _0x294ffb=this['_currentReviewCheckRun']['getActiveChanges']();_0x294ffb['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x294ffb['map'](_0x3cea50=>_0x3cea50['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',async(_0x418dbb,_0x2252cd)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2252cd['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x2252cd['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2252cd['id']));}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',async(_0x777560,_0xa1a65b)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xa1a65b['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0xa1a65b['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0xa1a65b['id']));}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x37cce9,_0x5de90f)=>{this['_isDiffOn']=_0x5de90f['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'scrollToSuggestionInDocument',async(_0x146d9a,_0x3615a2)=>{const {source:_0x423f6f}=_0x3615a2;this['_aiReviewModeUi']['resetActiveStateInResults'](),_0x423f6f['setItemAsActive'](),this['_aiReviewModeEditing']['scrollToChangeInEditorContent']({'id':_0x3615a2['id']});});}['_onReviewModeRunLeave'](_0x4c13e9=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x4c13e9&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit']();const _0x14f69d=this['_aiReviewModeEditing']['getContentElement']();_0x14f69d&&(_0x14f69d['classList']['remove']('ck-ai-review-mode-diff'),_0x14f69d['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x5686cc){const _0x373459=this['_aiReviewModeEditing']['getContentElement']();_0x373459&&(_0x373459['classList']['remove']('ck-ai-review-mode-diff'),_0x373459['classList']['remove']('ck-ai-review-mode-highlights'),_0x373459['classList']['add'](_0x5686cc?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_logError'](_0x1de5a8){ot(_0x1de5a8['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x179f2b{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x122cde,_0x7f3644){super(_0x122cde),this['_defaultValue']=_0x7f3644['default']||(_0x7f3644['data']['length']>0x0?_0x7f3644['data'][0x0]['id']:''),this['_defaultLabel']=_0x7f3644['data']['find'](_0x182fa9=>_0x182fa9['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x3e7f7b(this['locale']);const _0xfad254=this['_prepareListOptions'](_0x7f3644['data']);_0x245f97(this['_dropdownView'],_0xfad254,{'role':'menu','ariaLabel':_0x7f3644['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xd5311d=>{_0xd5311d['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x468be6=>{this['formValue']=_0x468be6['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x468be6['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0xbf1d85=[]){const _0x5608b9=new _0x3febd7();this['resetToDefault']();for(const _0x33b69d of _0xbf1d85){const _0x575709=new _0x25cf5d({'label':_0x33b69d['label'],'withText':!0x0,'role':'menuitemradio','id':_0x33b69d['id'],'model':_0x33b69d});_0x575709['bind']('isOn')['to'](this,'formValue',_0xc52e82=>_0xc52e82===_0x575709['id']);const _0x74167={'type':'button','model':_0x575709};_0x5608b9['add'](_0x74167);}return _0x5608b9;}}class Fs extends _0xfd7405{['_formItem']=null;constructor(_0x41b30a,_0x3546bb,_0x485b67){super(_0x41b30a),this['argsKey']=_0x3546bb?.['argsKey'];if('dropdown'===_0x3546bb['formType'])this['_formItem']=new Mr(this['locale'],_0x3546bb);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x18082f=new _0x3bbf23(this['locale'],{'children':[this['_formItem']],'class':[_0x485b67?'ck-form__row_with-submit':'']});_0x485b67&&_0x18082f['children']['add'](_0x485b67),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x18082f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Ds extends _0x3728ef{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x110c6a){super(_0x110c6a),this['set']('isEmpty',!0x0),this['minRows']=Ds['MIN_ROWS'],this['maxRows']=Ds['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4d6941=>{_0x4d6941['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x2ed9bf){this['set']('placeholder',_0x2ed9bf);}}class Gs extends _0x179f2b{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x4ff934,_0x2e072a){super(_0x4ff934),this['_check']=_0x2e072a,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x2e072a['models']&&_0x2e072a['models']['length']>0x0?_0x2e072a['models'][0x0]['id']:'',this['_defaultLabel']=_0x2e072a['models']&&_0x2e072a['models']['length']>0x0?_0x2e072a['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new Ds(_0x4ff934),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x3febd7(),this['_setModelList'](),_0x245f97(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x3ca724=new _0x179f2b(_0x4ff934);_0x3ca724['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x3bbf23(this['locale'],{'children':[this['promptInputView']]}),new _0x3bbf23(this['locale'],{'children':[_0x3ca724]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0x16d3e8=new _0x3678e7(this['locale']),t=this['locale']['t'];return _0x16d3e8['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x16d3e8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5f37a9=>{_0x5f37a9['stopPropagation']();})}}),_0x16d3e8['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x16d3e8;}['_createCancelButtonView'](){const _0x33835a=new _0x3678e7(this['locale']),t=this['locale']['t'];return _0x33835a['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x33835a['on']('execute',()=>{this['resetToDefault']();}),_0x33835a;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x5a8bf4=this['_check']['models'];if(this['resetToDefault'](),_0x5a8bf4?.['length'])for(const _0x423850 of _0x5a8bf4){const _0x2f9ea3=new _0x25cf5d({'label':_0x423850['name'],'withText':!0x0,'role':'menuitemradio','id':_0x423850['id'],'model':_0x423850});_0x2f9ea3['bind']('isOn')['to'](this,'modelId',_0x402887=>_0x402887===_0x423850['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2f9ea3,'labelView':new js(this['locale'],_0x423850)});}}['_createModelSelectionDropdown'](){const _0x32490c=_0x3e7f7b(this['locale']);return _0x32490c['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x32490c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x44b2d9=>{_0x44b2d9['stopPropagation']();})}}),_0x32490c['buttonView']['set']({'label':this['_check']['models'][0x0]['name'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x32490c,'execute',_0x1038f1=>{this['modelId']=_0x1038f1['source']['model']['id'],_0x32490c['buttonView']['label']=_0x1038f1['source']['label'];}),_0x32490c;}}class js extends _0x5a6277{constructor(_0x5db477,_0x7fcde0){super();const _0x297e69=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x297e69['to']('style'),'id':_0x297e69['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x297e69['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0x7fcde0['description']}]}]}]});}}class zs extends _0xfd7405{['_formItemsCollection']=new _0x476d2b();['_customCheckView']=null;constructor(_0x5ac287,_0x112155,_0xdf337e){super(_0x5ac287),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x112155['isParameterized']);const _0x3417f0=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x1a84c8=>_0x1a84c8),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x214e40=>_0x214e40)],'style':{'--ck-ai-check-list-item-index':_0xdf337e}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x112155['title']}]},_0x3417f0]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x112155['description']}]}]}]},..._0x112155['isParameterized']?[this['_createParameterizedView'](_0x112155)]:[],...'custom'===_0x112155['id']?[this['_createCustomView'](_0x112155)]:[]]}),this['on']('click',()=>{_0x112155['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x112155['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x23c9f6({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x55d0f8=>{_0x55d0f8['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x2a4fa7=new _0x30b390();return _0x2a4fa7['content']=_0x1800e1,_0x2a4fa7['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x2a4fa7;}['_createParameterizedView'](_0xfc286f){const _0x2d7fe0=new _0x179f2b(),_0x574cdf=this['_createFormView'](_0xfc286f);return _0x2d7fe0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3b3e09=>!_0x3b3e09)]},'children':[_0x574cdf]}),_0x2d7fe0;}['_createFormView'](_0xe308aa){const _0x38727f=new _0x179f2b(),_0xc5e84c=Array['isArray'](_0xe308aa['options'])?_0xe308aa['options']:[],_0x47c7ee=new _0x3678e7(this['locale']),t=this['locale']['t'];_0x47c7ee['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x47c7ee['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5c7e5c=>{_0x5c7e5c['stopPropagation']();})}}),_0x47c7ee['on']('execute',()=>{const _0x3bb38a=[];let _0x5c5f08;this['_formItemsCollection']['forEach'](_0x18a965=>{_0x3bb38a['push'](_0x18a965['value']),_0xe308aa['useArgs']&&_0xe308aa['options']&&(_0x5c5f08={[_0x18a965['argsKey']]:_0x18a965['value']});});const _0x23c485=_0xe308aa['useArgs']?_0xe308aa['id']:[_0xe308aa['id'],..._0x3bb38a]['join']('-');this['fire']('runReviewCheck',{'id':_0x23c485,'args':_0x5c5f08});});const _0x383334=_0xc5e84c['length'];return _0xc5e84c['forEach']((_0x3373c1,_0x149b1a)=>{const _0x5a9a50=_0x149b1a===_0x383334-0x1;this['_formItemsCollection']['add'](new Fs(this['locale'],_0x3373c1,_0x5a9a50?_0x47c7ee:null));}),_0x38727f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x38727f;}['_createCustomView'](_0x4e4b0a){return this['_customCheckView']=new Gs(this['locale'],_0x4e4b0a),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x369416=>!_0x369416)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Hs extends _0xfd7405{['_checkViews'];constructor(_0x26b333){super(_0x26b333),this['_checkViews']=new _0x476d2b();const _0x302f4a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x302f4a['if']('isVisible','ck-hidden',_0x5e6465=>!_0x5e6465)]},'children':this['_checkViews']});}['setChecks'](_0x22211f){this['_checkViews']['clear']();for(const [_0x4a7989,_0x1cd160]of _0x22211f['entries']()){const _0x429d18=new zs(this['locale'],_0x1cd160,_0x4a7989);_0x429d18['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x429d18);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4c4125 of this['_checkViews'])_0x4c4125 instanceof zs&&_0x4c4125['resetToDefault']();}}function p(_0x35c757,_0x6496f3){const {t:t}=_0x35c757;switch(_0x6496f3){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.\x20You\x20can\x20now\x20return\x20to\x20the\x20command\x20list.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review\x20Mode'});default:return _0x6496f3;}}class Ws extends _0x179f2b{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x52492c,_0x1ae146){super(_0x52492c),this['id']=_0x1ae146,this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](_0x1ae146),this['dismissButtonView']=this['_createDismissButtonView'](_0x1ae146),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('scrollToSuggestionInDocument',{'id':_0x1ae146,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x615370=new _0x179f2b(this['locale']);return _0x615370['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-response']}}),_0x615370;}['_createAcceptButtonView'](_0x50b761){const _0x5e0788=new _0x3678e7(this['locale']);return _0x5e0788['set']({'label':p(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x5e0788['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x229187=>{this['fire']('acceptChange',{'id':_0x50b761}),_0x229187['stopPropagation']();})}}),_0x5e0788;}['_createDismissButtonView'](_0xa9c7ef){const _0x2f9c8a=new _0x3678e7(this['locale']);return _0x2f9c8a['set']({'label':p(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x2f9c8a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5c86a6=>{this['fire']('dismissChange',{'id':_0xa9c7ef}),_0x5c86a6['stopPropagation']();})}}),_0x2f9c8a;}['_createInfoButtonView'](){const _0x21936b=new _0x3678e7(this['locale']);return _0x21936b['set']({'label':p(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0xd3405,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x21936b['bind']('isOn')['to'](this,'isInfoToggleOn',_0x220e18=>_0x220e18),_0x21936b['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x21936b;}}class Ks extends _0xfd7405{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x1c6c85){super(_0x1c6c85),this['_resultViews']=new _0x476d2b(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Bi(_0x1c6c85),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x180902=this['_createCombinedSkeletonLoader'](),_0x2da1c9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x2da1c9['if']('isVisible','ck-hidden',_0x132bc2=>!_0x132bc2)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x23a6bd=>_0x23a6bd)]},'children':this['_resultViews']},_0x180902]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x10781d){const _0xc6a403=new Ws(this['locale'],_0x10781d['id']);_0xc6a403['delegate']('acceptChange','dismissChange','scrollToSuggestionInDocument')['to'](this),this['_resultViews']['add'](_0xc6a403),_0xc6a403['resultResponseView']['element']['innerHTML']=_0x10781d['contentDiffed'];}['hideResult'](_0x22fe58){const _0x1aa347=this['_resultViews']['find'](_0x41fcf4=>_0x41fcf4['id']===_0x22fe58);_0x1aa347&&(_0x1aa347['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x1aa347['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x1aa347),_0x1aa347['destroy']();},{'once':!0x0}));}['setTitle'](_0x28f097){this['headerTitle']=_0x28f097;}['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 je(this['locale'],Le['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x5ea9ad=new _0x179f2b(this['locale']),_0x460760=[];for(let _0x375970=0x0;_0x375970<0x10;_0x375970++){const _0x42443b=this['_createSkeletonLoader']();_0x42443b['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x460760['push'](_0x42443b);}return _0x5ea9ad['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x291c4c=>!_0x291c4c)]},'children':_0x460760}),_0x5ea9ad;}['_createErrorView'](){const _0x50a2a2=new _0x179f2b(this['locale']),_0x51fc47=new _0x3678e7(this['locale']),t=this['locale']['t'];return _0x50a2a2['delegate']('retryReview')['to'](this),_0x51fc47['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x51fc47['on']('execute',()=>{this['fire']('retryReview');}),_0x50a2a2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x5dc732=>!_0x5dc732),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x206f0a=>'chunk'===_0x206f0a)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x47b055=>'chunk'===_0x47b055)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1ab156=>'general'!==_0x1ab156)]},'children':[{'text':p(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x594d17=>'chunk'!==_0x594d17)]},'children':[{'text':p(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x51fc47]}),_0x50a2a2;}['_createCancelButtonView'](){const _0x24013e=new _0x3678e7(this['locale']);return _0x24013e['set']({'label':p(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x53dded}),_0x24013e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4a5a39=>_0x4a5a39)]}}),_0x24013e['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x24013e;}['_createToggleDiffButtonView'](){const _0x9bbf14=new _0x3678e7(this['locale']);_0x9bbf14['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x9bbf14['bind']('isEnabled')['to'](this,'isError',_0x3f512b=>!_0x3f512b),_0x9bbf14['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x331c0b=>!_0x331c0b)]}});const _0x13cdd3=p(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x152bee=p(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x9bbf14['bind']('isOn')['to'](this,'isToggleDiffOn',_0x486e3a=>_0x486e3a),_0x9bbf14['bind']('icon')['to'](this,'isToggleDiffOn',_0x9b4610=>_0x9b4610?_0x12d50a:_0x199ee6),_0x9bbf14['bind']('label')['to'](this,'isToggleDiffOn',_0x3163c7=>_0x3163c7?_0x13cdd3:_0x152bee),_0x9bbf14['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x9bbf14;}['_createAcceptAllButtonView'](){const _0x5c3fa5=new _0x3678e7(this['locale']);return _0x5c3fa5['set']({'label':p(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x5c3fa5['bind']('isEnabled')['to'](this,'isError',_0x1bfe60=>!_0x1bfe60),_0x5c3fa5['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x31bce4=>!_0x31bce4)]}}),_0x5c3fa5['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x5c3fa5;}['_createExitReviewButtonView'](){const _0x27ea59=new _0x3678e7(this['locale']);return _0x27ea59['set']({'label':p(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x27ea59['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x54e27e=>!_0x54e27e)]}}),_0x27ea59['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x27ea59;}['_createResultHeaderView'](){const _0x199f9a=new _0x179f2b(this['locale']),_0x9bb11f=new Ve();return _0x9bb11f['bind']('isVisible')['to'](this,'isResultReady',_0x399bbd=>!_0x399bbd),_0x199f9a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x9bb11f,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x199f9a;}}class Ns extends _0xfd7405{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x1d0bd5){super(_0x1d0bd5),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView']();const _0x56cdcb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x56cdcb['if']('isVisible','ck-hidden',_0x5c2e42=>!_0x5c2e42)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'🎉'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':p(_0x1d0bd5,'AI_REVIEW_MODE_COMPLETED_TEXT')}]}]}]});}['_createFinishReviewButtonView'](){const _0x53d8f7=new _0x3678e7(this['locale']);return _0x53d8f7['set']({'label':p(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x53d8f7['on']('execute',()=>{this['fire']('finishReview');}),_0x53d8f7;}['_createResultHeaderView'](){const _0x2805a3=new _0x179f2b(this['locale']);return _0x2805a3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':p(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2805a3;}}class se extends _0x179f2b{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x3b53bf){super(_0x3b53bf),this['reviewModeHeader']=new _0x4b2793(_0x3b53bf,{'label':p(_0x3b53bf,'AI_REVIEW_MODE'),'icon':te,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Hs(_0x3b53bf),this['reviewCheckListView']['delegate'](...Js)['to'](this),this['reviewCheckResultsView']=new Ks(_0x3b53bf),this['reviewCheckResultsView']['delegate'](...Js)['to'](this),this['reviewCompletedView']=new Ns(_0x3b53bf),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-content\x20','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0xf0f7f6){this['reviewCheckResultsView']['addResult'](_0xf0f7f6),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}const Js=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','scrollToSuggestionInDocument','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x150b32{['_reviewModeView'];static get['requires'](){return[rt];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd99450){super(_0xd99450),this['_reviewModeView']=new se(this['context']['locale']),this['_reviewModeView']['delegate'](...Js)['to'](this);}['init'](){const _0x50f13c=this['context']['plugins']['get']('AITabs');_0x50f13c['view']['on']('activateTab',(_0x391757,_0x3f9aec)=>{'reviewMode'===_0x3f9aec?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x50f13c['view']['addTab']({'id':'reviewMode','buttonLabel':p(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':te,'order':0x0,'content':this['_reviewModeView']});}['setAvailableChecks'](_0x459e9d){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x459e9d),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x44df87){_0x44df87&&('error-general'!==_0x44df87['status']?'error-chunk'!==_0x44df87['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x44adfe){this['_reviewModeView']['addCheckRunResult'](_0x44adfe);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x31d965){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x31d965);}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x25667f=>_0x25667f['setItemAsInactive']());}['updateChangeState'](_0x166f9c,_0x5da3ef){'accepted'!==_0x5da3ef&&'rejected'!==_0x5da3ef||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x166f9c);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}}const Xt='reviewmode-';class re extends _0x150b32{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x49e07c,a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['afterInit'](){const _0x452aad=N(this['context']);_0x452aad['conversion']['for']('editingDowncast')['markerToElement']({'model':Xt+'insert','view':(_0x2cab78,{writer:_0x35dd31})=>{const _0x19a366=this['_markers']['get'](_0x2cab78['markerName']);return _0x35dd31['createUIElement']('span',{'class':'ck-ai_review-mode-marker_add'},function(_0xa9858e){const _0x7c7032=this['toDomElement'](_0xa9858e);return _0x7c7032['innerHTML']=_0x19a366?.['text']||'',_0x7c7032;});}}),_0x452aad['conversion']['for']('dataDowncast')['markerToElement']({'model':Xt+'suggestion-context','view':(_0x4787f3,{writer:_0xc5b28c})=>_0xc5b28c['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x4787f3['isOpening']?'start':'end')})}),_0x452aad['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xt+'remove-only','view':()=>({'classes':'ck-ai_review-mode-marker_strikethrough'})}),_0x452aad['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xt+'remove-context','view':()=>({'classes':'ck-ai_review-mode-marker_underline'})}),_0x452aad['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xt+'remove-text','view':()=>({'classes':'ck-ai_review-mode-marker_hide'})}),_0x452aad['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x81414a,'view':Vt});}['getDocumentData'](){const _0x122d2b=this['context']['plugins']['get']('AIEditing'),_0x19307c=N(this['context']),_0x195fa6=_0x19307c['model'],_0x169e7c=new _0x59e9ed();for(const _0x5cb1f5 of _0x195fa6['document']['getRoot']()['getChildren']()){const _0x411404=_0x5cb1f5['_clone'](!0x0);_0x169e7c['_appendChild'](_0x411404);}for(const _0x51356f of _0x195fa6['markers'])_0x169e7c['markers']['set'](_0x51356f['name'],this['_changeRangeOwnerDocument'](_0x51356f['getRange']()['clone'](),_0x169e7c));const _0x35baca=new Jt({'ignoreElementEnd':!0x0,'startPosition':_0x195fa6['createPositionAt'](_0x169e7c,0x0)}),_0x22e7b9=new Set(),_0x3e2942=new Map();for(const {item:_0x1b1ea6}of _0x35baca){if(!_0x1b1ea6['is']('$textProxy'))continue;const _0x37a6aa=_0x1b1ea6['parent'];if((!_0x37a6aa||!_0x37a6aa['is']('element','caption'))&&(_0x37a6aa&&_0x37a6aa['is']('element'))){let _0x58cb00=_0x37a6aa['getAttribute'](_0x81414a);_0x58cb00||(_0x58cb00=_0x122d2b['_nextDataId'](_0x22e7b9),_0x37a6aa['_setAttribute'](_0x81414a,_0x58cb00)),_0x22e7b9['add'](_0x58cb00);const _0x457357=this['_getTopElement'](_0x37a6aa);_0x3e2942['set'](_0x58cb00,{'path':_0x37a6aa['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x457357['_clone'](!0x0),_0x58cb00,_0x19307c['data'])}),_0x35baca['jumpTo'](_0x195fa6['createPositionAfter'](_0x37a6aa));}}return{'content':_0x19307c['data']['processor']['toData'](_0x19307c['data']['toView'](_0x169e7c)),'version':_0x19307c['model']['document']['version'],'elements':_0x3e2942};}['diffContent'](_0x479077,_0x471045){const _0x97de78=N(this['context']),_0x2cdf15=_0x97de78['data']['parse'](_0x479077,'$documentFragment'),_0x55ad7d=_0x97de78['model']['createPositionAt'](_0x2cdf15,0x0),_0x23e60f=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x479077,_0x471045,{'anchor':_0x55ad7d,'markDeletions':!0x0})['getOperations']()['filter'](_0x315c58=>'insert'===_0x315c58['type']||'marker'===_0x315c58['type']&&_0x315c58['name']['startsWith']('$markedRemove')),_0x100ec4=this['_groupAdjacentOperations'](_0x23e60f),_0x7d2e7b=[];let _0x1abdc9=0x0;return _0x97de78['model']['change'](_0x25e344=>{for(let _0x35064e=0x0;_0x35064e<_0x100ec4['length'];_0x35064e++){const _0x23b9b6=_0x100ec4[_0x35064e],_0x1a267e=_0x25e344['createDocumentFragment']();for(const _0x3f5ba2 of _0x2cdf15['getChildren']())_0x25e344['append'](_0x3f5ba2['_clone'](!0x0),_0x1a267e);for(const _0x5dc550 of _0x23b9b6['operationsIsolated'])if('insert'===_0x5dc550['type']){const _0x2ea514=_0x5dc550;_0x2ea514['baseVersion']=null,_0x2ea514['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x2ea514,_0x1a267e),_0x25e344['batch']['addOperation'](_0x5dc550),_0x97de78['model']['applyOperation'](_0x5dc550);const _0xd6fe3d='suggestion:insertion:id:authorId:'+_0x1abdc9++,_0x327eff=_0x97de78['model']['createRange'](_0x2ea514['position'],_0x2ea514['position']['getShiftedBy'](_0x2ea514['howMany']));_0x1a267e['markers']['set'](_0xd6fe3d,_0x327eff);}else{if('marker'===_0x5dc550['type']&&_0x5dc550['name']['startsWith']('$markedRemove')){const _0x3a1e53=_0x5dc550,_0x1fb277='suggestion:deletion:id:authorId:'+_0x1abdc9++;this['_changeOperationOwnerDocument'](_0x3a1e53,_0x1a267e),_0x1a267e['markers']['set'](_0x1fb277,_0x3a1e53['newRange']);}}const _0x5f16d1=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x23b9b6['operationsIsolated'][0x0]),_0x1a267e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x23b9b6['operationsIsolated'][_0x23b9b6['operationsIsolated']['length']-0x1]),_0x1a267e));_0x1a267e['markers']['set'](Xt+'suggestion-context',new _0xf5c05f(_0x5f16d1['start'],_0x5f16d1['end'])),_0x7d2e7b['push']({..._0x23b9b6,'context':this['_createGetContextFn'](_0x1a267e,_0x97de78['data'],{'ellipsisBefore':_0x5f16d1['hasContentBefore'],'ellipsisAfter':_0x5f16d1['hasContentAfter']}),'content':this['_createGetContentFn'](_0x1a267e,_0x97de78['data'])});}}),_0x7d2e7b;}['markChangePositionInEditorContent'](_0x2dde18,_0x611ba){const _0x3de4c4=_0x2dde18[0x0]['parent']['id'],_0x51a929=_0x611ba['elements']['get'](_0x3de4c4);if(!_0x51a929)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x3de4c4);const _0x5601f5=_0x51a929['path'],_0x35bfed=N(this['context']),_0x214a88=_0x35bfed['model']['document']['history']['getOperations'](_0x611ba['version']),_0x34e377=[];for(const _0x1863dc of _0x2dde18){const _0x9067c5=_0x1863dc['operationsIsolated']['map'](_0x432d7c=>this['_translateOperationToEditorContent'](_0x432d7c,_0x5601f5,_0x35bfed['model']['document']['getRoots']()[0x0]));if(!_0x9067c5||!_0x9067c5['length'])continue;const _0x317cc7=_0x9067c5['every'](_0x5c7a68=>'marker'===_0x5c7a68['type']&&_0x5c7a68['name']['startsWith']('$markedRemove')),_0x9cac61={'document':_0x35bfed['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5f319f=_0x3b6950(_0x9067c5,_0x214a88,_0x9cac61)['operationsA'];for(const _0x3bc6cd of _0x5f319f)if('insert'===_0x3bc6cd['type']){const _0xd99c0f=_0x3bc6cd,_0x57b76e=_0xd99c0f['nodes'];let _0x5ee296='';for(const _0x4a6fdf of _0x57b76e)_0x4a6fdf&&_0x4a6fdf['is']('model:$text')&&(_0x5ee296+=_0x4a6fdf['data']);_0x34e377['push']({'start':_0xd99c0f['position'],'end':_0xd99c0f['position'],'type':'insert','groupId':_0x1863dc['id'],'text':_0x5ee296});}else{if('marker'===_0x3bc6cd['type']&&_0x3bc6cd['name']['startsWith']('$markedRemove')){const _0x291808=_0x3bc6cd;let _0x5945f9='remove-text';if(_0x317cc7){const _0x4bba54=this['_findAdjacentContextDistance'](_0x291808['newRange']['start'],'backward',_0x35bfed['model']['schema']),_0x4cc686=this['_findAdjacentContextDistance'](_0x291808['newRange']['end'],'forward',_0x35bfed['model']['schema']);if(_0x4bba54||_0x4cc686){const _0x191e5b=_0x291808['newRange']['start']['getShiftedBy'](-_0x4bba54),_0x199275=_0x291808['newRange']['end']['getShiftedBy'](_0x4cc686);_0x34e377['push']({'start':_0x191e5b,'end':_0x199275,'groupId':_0x1863dc['id'],'type':'remove-context'});}else _0x5945f9='remove-only';}_0x34e377['push']({'start':_0x291808['newRange']['start'],'end':_0x291808['newRange']['end'],'groupId':_0x1863dc['id'],'type':_0x5945f9});}}}this['_insertMarkers'](_0x34e377);}['clearAllMarkers'](){N(this['context'])['model']['change'](_0x4e172f=>{for(const _0x125073 of this['_markers']['keys']())_0x4e172f['removeMarker'](_0x125073);}),this['_markers']['clear']();}['switchToReadOnly'](){N(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){N(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x29ff7c){const _0x51d96a=N(this['context']),_0x4db91a=_0x51d96a['model'],_0xd48bd0=_0x29ff7c['map'](_0x48a1f5=>this['_getMarkersDataForGroup'](_0x48a1f5))['flat']();_0x4db91a['change'](_0xf8bcb7=>{for(const _0xbbd8ca of _0xd48bd0){const _0x5c0e19=_0x51d96a['model']['markers']['get'](_0xbbd8ca['id']);_0x5c0e19&&('insert'===_0xbbd8ca['type']?_0x4db91a['insertContent'](_0xf8bcb7['createText'](_0xbbd8ca['text']||''),_0x5c0e19['getRange']()['start']):'remove-text'!==_0xbbd8ca['type']&&'remove-only'!==_0xbbd8ca['type']||_0x4db91a['deleteContent'](_0x4db91a['createSelection'](_0x5c0e19['getRange']())),_0xf8bcb7['removeMarker'](_0xbbd8ca['id']),this['_markers']['delete'](_0xbbd8ca['id']));}});}['rejectChange'](_0x2f4596){const _0x2e8ca2=N(this['context']),_0x4e5ac0=this['_getMarkersDataForGroup'](_0x2f4596);_0x2e8ca2['model']['change'](_0x32cbe9=>{for(const _0x132f92 of _0x4e5ac0)_0x32cbe9['removeMarker'](_0x132f92['id']),this['_markers']['delete'](_0x132f92['id']);});}['getContentElement'](){const _0x44b27c=N(this['context']);return _0x44b27c&&_0x44b27c['ui']&&_0x44b27c['ui']['element']?_0x44b27c['ui']['element']:null;}['_translateOperationToEditorContent'](_0x50331,_0x8e6d6f,_0x3cb7f1){if('insert'===_0x50331['type']){const _0xc5b993=_0x50331;return new $t(this['_changePosition'](_0xc5b993['position'],_0x8e6d6f['concat'](_0xc5b993['position']['offset']),_0x3cb7f1),_0xc5b993['nodes'],_0xc5b993['baseVersion']);}if('marker'===_0x50331['type']&&_0x50331['name']['startsWith']('$markedRemove')){const _0x123067=_0x50331;return new Bt(_0x123067['name'],_0x123067['oldRange'],this['_changeRange'](_0x123067['newRange'],_0x8e6d6f['concat'](_0x123067['newRange']['start']['offset']),_0x8e6d6f['concat'](_0x123067['newRange']['end']['offset']),_0x3cb7f1),_0x123067['_markers'],_0x123067['affectsData'],_0x123067['baseVersion']);}return _0x50331;}['_groupAdjacentOperations'](_0x12a431){if(!_0x12a431['length'])return[];const _0x4db01b=[];let _0x2bd3d5=0x0,_0x43bfb9=0x0,_0x1e6e8a=[];for(let _0x19f8e3=0x0;_0x19f8e3<=_0x12a431['length'];_0x19f8e3++){const _0x2038c2=_0x12a431[_0x19f8e3],_0x15f417=_0x12a431[_0x19f8e3-0x1];!_0x2038c2||_0x15f417&&!this['_getOperationEnd'](_0x15f417)['isTouching'](this['_getOperationStart'](_0x2038c2))?(_0x4db01b['push']({'operations':_0x1e6e8a,'operationsIsolated':_0x1e6e8a['map'](_0x585063=>this['_shiftOperation'](_0x585063['clone'](),-_0x43bfb9)),'groupOffset':_0x2bd3d5}),_0x1e6e8a=_0x2038c2?[_0x2038c2]:[],_0x43bfb9+=_0x2bd3d5,_0x2bd3d5=0x0):_0x1e6e8a['push'](_0x2038c2),_0x2038c2&&'insert'===_0x2038c2['type']&&(_0x2bd3d5+=_0x2038c2['howMany']);}return _0x4db01b;}['scrollToChangeInEditorContent'](_0x191293){console['log']('Scroll\x20to\x20change\x20in\x20editor\x20content',_0x191293['id']);}['_findAdjacentContextDistance'](_0x3ccba8,_0x3a5169,_0x42fb69,_0x201272=0x1){const _0x41a9a6=new Jt({'startPosition':_0x3ccba8,'direction':_0x3a5169});let _0x33f953=0x0;for(let _0x4749ca=0x0;_0x4749ca<_0x201272;_0x4749ca++){let _0x4f4a63=0x0,_0xa19bfd=!0x1,_0x4b8a87='forward'===_0x3a5169?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3ab5a8}of _0x41a9a6)if(_0x3ab5a8['is']('$textProxy')){const _0x4c3e43=_0x4b8a87['exec'](_0x3ab5a8['data']);if(_0x4c3e43&&_0x4c3e43['length']){if(_0x4f4a63+='forward'===_0x3a5169?_0x4c3e43['index']+_0x4c3e43[0x0]['length']:_0x3ab5a8['data']['length']-_0x4c3e43['index'],_0x4c3e43[0x0]['length']!==_0x3ab5a8['data']['length'])break;_0xa19bfd=!0x0,_0x4b8a87='forward'===_0x3a5169?/^\w+/:/\w+$/;}else{if(_0xa19bfd)break;_0x4f4a63+=_0x3ab5a8['offsetSize'];}}else{if(_0x3ab5a8['is']('element')){_0x42fb69['isInline'](_0x3ab5a8)&&!_0xa19bfd&&(_0x4f4a63+=0x1);break;}}_0x33f953+=_0x4f4a63,_0x41a9a6['jumpTo'](_0x3ccba8['getShiftedBy']('forward'===_0x3a5169?_0x33f953:-_0x33f953));}return _0x33f953;}['_getChangeContext'](_0x5c1a91,_0x25ecde){const _0x892db6=N(this['context'])['model']['schema'],_0x4b95f5=this['_findAdjacentContextDistance'](_0x5c1a91,'backward',_0x892db6,0x6),_0x37e9e7=this['_findAdjacentContextDistance'](_0x25ecde,'forward',_0x892db6,0x6),_0x111c74=_0x5c1a91['getShiftedBy'](-_0x4b95f5),_0x2fdec5=_0x25ecde['getShiftedBy'](_0x37e9e7);return{'start':_0x111c74,'end':_0x2fdec5,'hasContentBefore':!_0x111c74['isAtStart'],'hasContentAfter':!_0x2fdec5['isAtEnd']};}['_insertMarkers'](_0x1cda25){N(this['context'])['model']['change'](_0x4e332e=>{for(const _0x2dae67 of _0x1cda25){const _0x40175f=''+Xt+_0x2dae67['type']+':'+_0x2dae67['groupId']+'_'+_0x215bb4();this['_markers']['set'](_0x40175f,{'id':_0x40175f,'groupId':_0x2dae67['groupId'],'type':_0x2dae67['type'],'text':_0x2dae67['text']}),_0x4e332e['addMarker'](_0x40175f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4e332e['createRange'](_0x2dae67['start'],_0x2dae67['end'])});}});}['_createGetContextFn'](_0x2b65ea,_0x4f21ae,_0x3afbcb){let _0x3e52c4='';return()=>{if(!_0x3e52c4){const _0x407630=_0x4f21ae['toView'](_0x2b65ea,{'showSuggestionHighlights':!0x0}),_0x381273=_0x407630['getChild'](0x0);if(!_0x381273)return'';let _0x545a3=!0x1;const _0x5c3df0=[];for(const _0x3f348b of _0x381273['getChildren']())_0x3f348b['is']('element','span')&&_0x3f348b['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x545a3=!0x1),_0x545a3&&_0x5c3df0['push'](_0x3f348b),_0x3f348b['is']('element','span')&&_0x3f348b['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x545a3=!0x0);_0x381273['_removeChildren'](0x0,_0x381273['childCount']),_0x3afbcb?.['ellipsisBefore']&&_0x381273['_appendChild']('…'),_0x381273['_appendChild'](_0x5c3df0),_0x3afbcb?.['ellipsisAfter']&&_0x381273['_appendChild']('…');const _0xca2e6e=_0x4f21ae['htmlProcessor']['domConverter']['viewToDom'](_0x407630),_0x5a1e42=_0x4f21ae['htmlProcessor']['htmlWriter']['getHtml'](_0xca2e6e);_0x3e52c4=_0x5a1e42;}return _0x3e52c4;};}['_createGetContentFn'](_0x384d19,_0x7153a0){let _0x494a53='';return()=>(_0x494a53||(_0x494a53=_0x7153a0['stringify'](_0x384d19,{'showSuggestionHighlights':!0x0})),_0x494a53);}['_createGetContentUsingDataIdFn'](_0x1a76f4,_0x4be8dc,_0x343fa6){let _0x4aead9='';return()=>{if(!_0x4aead9){const _0x58249d=_0x343fa6['toView'](new _0x59e9ed(_0x1a76f4)),_0x32fee4=_0x343fa6['htmlProcessor']['domConverter']['viewToDom'](_0x58249d)['querySelector']('[data-id=\x22'+_0x4be8dc+'\x22]');_0x4aead9=_0x32fee4?.['outerHTML']||'';}return _0x4aead9;};}['_getMarkersDataForGroup'](_0x18ff42){return Array['from'](this['_markers']['values']())['filter'](_0x540aa4=>_0x540aa4['groupId']===_0x18ff42);}['_getOperationStart'](_0x436e06){return'insert'===_0x436e06['type']?_0x436e06['position']:_0x436e06['newRange']['start'];}['_getOperationEnd'](_0x52bf18,_0x4e3a49=!0x1){return'insert'===_0x52bf18['type']?_0x4e3a49?_0x52bf18['position']:_0x52bf18['position']['getShiftedBy'](_0x52bf18['howMany']):_0x52bf18['newRange']['end'];}['_shiftOperation'](_0x2c5160,_0x128049){return'insert'===_0x2c5160['type']?_0x2c5160['position']=_0x2c5160['position']['getShiftedBy'](_0x128049):'marker'===_0x2c5160['type']&&_0x2c5160['newRange']&&(_0x2c5160['newRange']=new _0xf5c05f(_0x2c5160['newRange']['start']['getShiftedBy'](_0x128049),_0x2c5160['newRange']['end']['getShiftedBy'](_0x128049))),_0x2c5160;}['_changeOperationOwnerDocument'](_0xf2bc61,_0x56562d){'insert'===_0xf2bc61['type']?_0xf2bc61['position']=this['_changePositionOwnerDocument'](_0xf2bc61['position'],_0x56562d):'marker'===_0xf2bc61['type']&&_0xf2bc61['newRange']&&(_0xf2bc61['newRange']=this['_changeRangeOwnerDocument'](_0xf2bc61['newRange'],_0x56562d));}['_changePositionOwnerDocument'](_0xca50c4,_0x5033e7){return new _0x34be7e(_0x5033e7,_0xca50c4['path']);}['_changeRangeOwnerDocument'](_0x2894e2,_0x726176){return new _0xf5c05f(this['_changePositionOwnerDocument'](_0x2894e2['start'],_0x726176),this['_changePositionOwnerDocument'](_0x2894e2['end'],_0x726176));}['_changePosition'](_0x5afc36,_0x163155,_0x7a2287){return new _0x34be7e(_0x7a2287,[..._0x163155]);}['_changeRange'](_0xe69a35,_0x1b86dc,_0x2eb12a,_0x56251e){return new _0xf5c05f(this['_changePosition'](_0xe69a35['start'],_0x1b86dc,_0x56251e),this['_changePosition'](_0xe69a35['end'],_0x2eb12a,_0x56251e));}['_getTopElement'](_0x13fdf0){let _0x19083f=_0x13fdf0;for(;_0x19083f['parent']&&!_0x19083f['parent']['is']('documentFragment');)_0x19083f=_0x19083f['parent'];return _0x19083f;}}class wa extends _0x150b32{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Ta as AIActions,F as AIAdapter,Dn as AIAssistant,v as AIAssistantUI,m as AIBalloon,ga as AIChat,tt as AIChatController,it as AIChatHistory,yt as AIChatHistoryController,jt as AIChatHistoryUI,et as AIChatUI,o as AIConnector,a as AIEditing,oi as AIQuickActionType,pa as AIQuickActions,ti as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,Rs as AIReviewCheckResult,xs as AIReviewCheckRun,wa as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,rt as AITabs,ae as AITextAdapter,Gn as AWSTextAdapter,Un as OpenAITextAdapter,J as ShowAIAssistantCommand,As as createResizeButton,Mn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x20f5e5,Command as Nt,ContextPlugin as _0x3e9f85,Editor as ot}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x440998,IconCheck as _0x519140,IconError as _0x503ee4,IconSubmit as _0xb7829d,IconAIHistory as Ht,IconMagicWand as _0x4b7b3d,IconRobotPencil as _0x46c7c5,IconMaximize as _0x1aac40,IconMinimize as _0xeabb22,IconShowChangesOn as _0x48ac84,IconShowChangesOff as _0x241ff6,IconDocument as _0x4e4b26,IconThreeStars as _0x2e662c,IconDocumentWithLoupe as _0xfdca25,IconAddComment as _0x50242c,IconRemove as _0x1ee77d,IconDocumentWithCheckmark as _0x187479,IconDocumentWithCross as _0x3f5cf7,IconLoupe as _0x2b1e17,IconCancel as _0x564668,IconStop as _0x38b63,IconAIChat as St,IconPlus as _0x22e17e,IconPin as _0x51d429,IconThreeHorizontalDots as _0x311d45,IconChevronRight as _0x3f1895,IconInfo as _0x414616,IconEye as _0x817ebb,IconEyeCrossedOut as _0x26e1ac,IconAIReview as te}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x190955,CKEditorError as _0x599d16,ObservableMixin as _0x3491c8,global as _0x34a915,isVisible as _0x33d5ba,Rect as _0x5ed23e,Collection as _0xe98229,FocusTracker as _0x14ef6c,KeystrokeHandler as _0x4f7a26,first as _0x5f24ba,toArray as _0x53b110,EmitterMixin as Mt,logWarning as _0x1f6f14,logError as nt,scrollViewportToShowTarget as rt,ResizeObserver as _0x31ce92,_isMotionReduced as At,scrollAncestorsToShowTarget as _0x5de7fa,DomEmitterMixin as bt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x581355,ButtonView as _0x4b3349,View as _0x3a2ab2,SpinnerView as _0x5d8343,IconView as _0x1f8dd5,AutocompleteView as _0x7ab78d,ListView as _0x586ac5,ListItemGroupView as _0x3e6dc5,ListItemView as _0x1f44f8,ButtonLabelView as _0x39c654,FocusCycler as _0x3d067c,createLabeledTextarea as _0x456b9c,Dialog as _0x889ca7,createDropdown as _0x45dc52,addMenuToDropdown as _0x201b22,MenuBarMenuView as _0x3db66d,MenuBarMenuListItemButtonView as _0x4389d5,DialogViewPosition as _0x7944f3,MenuBarMenuListView as _0x26ac41,MenuBarMenuListItemView as _0x5e1da0,ViewCollection as _0x4346f0,UIModel as _0x45b9d4,SplitButtonView as _0x127212,BalloonPanelView as _0x1618b0,BodyCollection as _0x582686,clickOutsideHandler as _0xca342f,ListItemButtonView as _0x4e269d,addListToDropdown as _0x291cf2,submitHandler as _0x4e85c1,LabeledFieldView as _0xaf91ac,createLabeledInputText as _0x5d068d,FormHeaderView as _0x20b76f,HighlightedTextView as _0x200fd8,FileDialogButtonView as _0x2ce7ec,InputTextView as _0x2d6582,SearchTextView as _0x28d88c,DropdownMenuButtonView as _0x2d18b1,DropdownMenuPanelPositioningFunctions as _0x2649c1,BalloonToolbar as Bt,FormRowView as _0x1c3fa1,TextareaView as _0x1b9be6}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x7babf7,ClipboardMarkersUtils as _0x4a3991}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x75fd74,ViewDataTransfer as _0x3cec43,ViewUpcastWriter as _0x1d0d0b,Matcher as _0x462754,ViewDowncastWriter as kt,transformOperationSets as it,_DetachOperation as tt,_insertIntoModelNodeList as _0x4050db,_removeFromModelNodeList as _0xc0cbf7,ModelRange as _0x625116,ModelDocumentFragment as _0x1dd05a,ModelPosition as _0x2aa99a,ModelTreeWalker as Ot,InsertOperation as $t,MarkerOperation as Dt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2a6371,escape as _0x512f25,escapeRegExp as _0x1c0115}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xe8427d,InvokeModelWithResponseStreamCommand as _0x22500e,InvokeModelCommand as _0x53e009}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x218393}from'htmlparser2';import{isTag as _0x2c7bda,findOne as mt,getParent as _0x13688c,findAll as _0x524e18,removeElement as _0x38cbf5,replaceElement as _0x43b5c3,prepend as _0x4522c2,prependChild as to,appendChild as _0x2e740b,append as _0x1ce7f1,find as _0x47fa7a,isComment as _0x10bbce,getChildren as tn,textContent as _0x585589}from'domutils';import _0x49a0ef from'dom-serializer';import{Document as _t,Element as _0x309e49,Text as _0x1594f5,cloneNode as _0x518b7f,isDocument as _0x2e8cf8,isText as _0xe71ef1,NodeWithChildren as _0x519ee5}from'domhandler';import{MarkdownGfmMdToHtml as _0xb9c5ff}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0xfebbba,DocumentCompare as _0x348a94,DATA_ID_MODEL_ATTRIBUTE as gt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x53f27c,IconThumbDown as _0x46a254,IconCopy as _0x233e02,IconCheck as _0x112b00,IconShowChangesOff as _0x2b7c68,IconShowChangesOn as _0x5c4167,IconWeb as t_,IconNextArrow as _0x2b1293,IconPreviousArrow as _0x1a2643,IconAI as yt,IconClose as _0x311f04,IconSelection as _0x36536e,IconFileUpload as _0x44a88a,IconLink as _0x2b16a2,IconDocument as _0x14043e,IconBulb as _0x2eac00,IconDocumentOutline as _0x24e0c5,IconPaperClip as _0x1d4e36,IconBrowseFiles as _0x9306a4,IconDropdownArrow as _0x248f31,IconAIQuickActions as _0x351952,IconAIAskAI as Kt,IconAIChatCommands as Yt,IconAIImproveWriting as Wt,IconAIContinueWriting as qt,IconAIGrammarCheck as zt,IconAIAdjustLength as Qt,IconAIChangeTone as Lt,IconAITranslate as Vt,IconAIOther as Jt,IconRefresh as _0x5b6f7b}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x2c16a9 from'morphdom';import{ConfirmMixin as _0x1209a,LateFocusDropdownButtonView as _0x437b8f,DocumentCompare as _0x24dc23,DATA_ID_VIEW_ATTRIBUTE as Ft,DATA_ID_MODEL_ATTRIBUTE as _0x2c24e1}from'ckeditor5-collaboration/dist/index.js';import{diffArrays as _0x3e248a}from'diff';const K='_ungrouppedCommands';function o(_0x2e6d80,_0x5a324b){const _0x1ac410=(0x0,_0x5a324b['t'])('Other');return _0x2e6d80['length']?'groupId'in _0x2e6d80[0x0]?_0x2e6d80:[{'groupId':K,'groupLabel':_0x1ac410,'order':0x1/0x0,'commands':_0x2e6d80}]:[{'groupId':K,'groupLabel':_0x1ac410,'order':0x1/0x0,'commands':[]}];}const Un=globalThis['DataTransfer'],w='ai-ui';class a extends _0x20f5e5{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x11b263}=this,_0xf8068=['ck-fake-ai-selection'];_0x11b263['config']['get']('ai.assistant.useTheme')&&_0xf8068['push']('ck-ai-assistant-ui_theme'),_0x11b263['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0xf8068,'priority':0xc}}),_0x11b263['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x3cb40f,{writer:_0x4ebf03})=>{if(!_0x3cb40f['markerRange']['isCollapsed'])return null;const _0x4b9fa7=_0x4ebf03['createUIElement']('span');return _0x4ebf03['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4b9fa7),_0x4b9fa7;}});}['afterInit'](){!async function(_0x28b4e9){const _0x4c6635=_0xb528c([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]),_0xad8d11=0x3dffc4e1,_0xf1e8dc=0x3df8b071^_0xad8d11,_0x578c4a=window[_0xb528c([0x44,0x61,0x74,0x65])][_0xb528c([0x6e,0x6f,0x77])](),_0x185352=_0x28b4e9[_0xb528c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58cde1=new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x245df3=>{_0x185352[_0xb528c([0x6f,0x6e,0x63,0x65])](_0xb528c([0x72,0x65,0x61,0x64,0x79]),_0x245df3);}),_0xf879ee={[_0xb528c([0x6b,0x74,0x79])]:_0xb528c([0x45,0x43]),[_0xb528c([0x75,0x73,0x65])]:_0xb528c([0x73,0x69,0x67]),[_0xb528c([0x63,0x72,0x76])]:_0xb528c([0x50,0x2d,0x32,0x35,0x36]),[_0xb528c([0x78])]:_0xb528c([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]),[_0xb528c([0x79])]:_0xb528c([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]),[_0xb528c([0x61,0x6c,0x67])]:_0xb528c([0x45,0x53,0x32,0x35,0x36])},_0xefea77=_0x185352[_0xb528c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xb528c([0x67,0x65,0x74])](_0xb528c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x44d580(){let _0x2e1581,_0x12a57b=null,_0x1059bb=null;try{if(_0xefea77==_0xb528c([0x47,0x50,0x4c]))return _0xb528c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2e1581=_0xe198ff(),!_0x2e1581)return _0xb528c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2e1581[_0xb528c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1059bb=_0x2c2866(_0x2e1581[_0xb528c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2e1581[_0xb528c([0x6a,0x74,0x69])])),await _0x4ac871()?_0x1e55a3()?_0x5b2e75()?_0xb528c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1cb21b()?(_0x2e1581[_0xb528c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xb528c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x12a57b=_0x1280b5(_0xb528c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2e1581[_0xb528c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xb528c([0x74,0x72,0x69,0x61,0x6c])&&(_0x12a57b=_0x1280b5(_0xb528c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4b0efc()):_0xb528c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xb528c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xb528c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xb528c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5b2e75(){const _0x501124=[_0xb528c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xb528c([0x74,0x72,0x69,0x61,0x6c])][_0xb528c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2e1581[_0xb528c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x578c4a/0x3e8:0xe10*_0xf1e8dc;return _0x2e1581[_0xb528c([0x65,0x78,0x70])]<_0x501124;}function _0x1e55a3(){const _0x2d6df7=_0x2e1581[_0xb528c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2d6df7&&(!!_0x2d6df7[_0xb528c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xb528c([0x2a]))||!!_0x2d6df7[_0xb528c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xb528c([0x41,0x49])));}function _0x1cb21b(){const _0x27d6d0=_0x2e1581[_0xb528c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x27d6d0||0x0==_0x27d6d0[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x386f63}=new URL(window[_0xb528c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x27d6d0[_0xb528c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x386f63))return!0x0;const _0x219c86=_0x386f63[_0xb528c([0x73,0x70,0x6c,0x69,0x74])](_0xb528c([0x2e]));return _0x27d6d0[_0xb528c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1ec430=>_0x1ec430[_0xb528c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xb528c([0x2a])))[_0xb528c([0x6d,0x61,0x70])](_0x5b364e=>_0x5b364e[_0xb528c([0x73,0x70,0x6c,0x69,0x74])](_0xb528c([0x2e])))[_0xb528c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x14ca90=>_0x14ca90[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x219c86[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xb528c([0x6d,0x61,0x70])](_0x178bb0=>Array(_0x219c86[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x178bb0[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xb528c([0x66,0x69,0x6c,0x6c])](_0x178bb0[0x0]===_0xb528c([0x2a])?_0xb528c([0x2a]):'')[_0xb528c([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x178bb0))[_0xb528c([0x73,0x6f,0x6d,0x65])](_0x3913f1=>_0x219c86[_0xb528c([0x65,0x76,0x65,0x72,0x79])]((_0x5c55d5,_0x27489)=>_0x3913f1[_0x27489]===_0x5c55d5||_0x3913f1[_0x27489]===_0xb528c([0x2a])));}function _0x4b0efc(){return _0x12a57b&&_0x1059bb?new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x99e526,_0x1ade58)=>{_0x12a57b[_0xb528c([0x74,0x68,0x65,0x6e])](_0x99e526,_0x1ade58),_0x1059bb[_0xb528c([0x74,0x68,0x65,0x6e])](_0x2e611f=>{_0x2e611f!=_0xb528c([0x56,0x61,0x6c,0x69,0x64])&&_0x99e526(_0x2e611f);},_0x1ade58);}):_0x12a57b||_0x1059bb||_0xb528c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2c2866(_0x510885,_0x45b97f){return new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4cbd94=>{if(_0x36e183())return _0x4cbd94(_0xb528c([0x56,0x61,0x6c,0x69,0x64]));_0x5275db(),_0x185352[_0xb528c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xb528c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2b92ff=!0x1;const _0x110a72=_0x190955();function _0x54235b(_0x13b45e){return!!_0x13b45e&&(typeof _0x13b45e===_0xb528c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x13b45e===_0xb528c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x13b45e[_0xb528c([0x74,0x68,0x65,0x6e])]===_0xb528c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x13b45e[_0xb528c([0x63,0x61,0x74,0x63,0x68])]===_0xb528c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x176ae5(_0x34a8f8){_0x42d532(_0x34a8f8)[_0xb528c([0x74,0x68,0x65,0x6e])](_0x5e6c32=>{if(!_0x5e6c32||_0x5e6c32[_0xb528c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xb528c([0x6f,0x6b]))return _0xb528c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1ff115(_0x203c18(_0x110a72+_0x45b97f))!=_0x5e6c32[_0xb528c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xb528c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xb528c([0x56,0x61,0x6c,0x69,0x64]);})[_0xb528c([0x74,0x68,0x65,0x6e])](_0x1b2025=>(_0x48ceee(),_0x1b2025),()=>{const _0x469353=_0x44560b();return null==_0x469353?(_0x48ceee(),_0xb528c([0x56,0x61,0x6c,0x69,0x64])):_0xb528c(_0x578c4a-_0x469353>(0x19f340e1^_0xad8d11)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xb528c([0x74,0x68,0x65,0x6e])](_0x4cbd94)[_0xb528c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4cbd94(_0xb528c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x523018=0x3dc92a61^_0xad8d11;function _0x48ceee(){const _0x22ed23=_0xb528c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1ff115(_0x203c18(_0x510885)),_0xebeb22=_0x1f06db(_0x1ff115(window[_0xb528c([0x4d,0x61,0x74,0x68])][_0xb528c([0x63,0x65,0x69,0x6c])](_0x578c4a/_0x523018)));window[_0xb528c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xb528c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x22ed23,_0xebeb22);}function _0x44560b(){const _0x595941=_0xb528c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1ff115(_0x203c18(_0x510885)),_0x356a1d=window[_0xb528c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xb528c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x595941);return _0x356a1d?window[_0xb528c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1f06db(_0x356a1d),0x10)*_0x523018:null;}function _0x42d532(_0x17baef){return new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a3061,_0xc74e40)=>{_0x17baef[_0xb528c([0x74,0x68,0x65,0x6e])](_0x4a3061,_0xc74e40),window[_0xb528c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xc74e40,0x3dfe1021^_0xad8d11);});}}_0x185352[_0xb528c([0x6f,0x6e])](_0xb528c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x9c9cbf,_0x26079f)=>{if(_0x26079f[0x0]!=_0x510885)return _0x4cbd94(_0xb528c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x26079f[0x1]={..._0x26079f[0x1],[_0xb528c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x110a72};},{[_0xb528c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xb528c([0x68,0x69,0x67,0x68])}),_0x185352[_0xb528c([0x6f,0x6e])](_0xb528c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x53dac9=>{_0x54235b(_0x53dac9[_0xb528c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2b92ff=!0x0,_0x176ae5(_0x53dac9[_0xb528c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xb528c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xb528c([0x6c,0x6f,0x77])}),_0x58cde1[_0xb528c([0x74,0x68,0x65,0x6e])](()=>{_0x2b92ff||_0x4cbd94(_0xb528c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x36e183(){return _0x185352[_0xb528c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xb528c([0x76,0x69,0x65,0x77])][_0xb528c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xb528c([0x61,0x75,0x74,0x6f]);}function _0x5275db(){_0x185352[_0xb528c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xb528c([0x76,0x69,0x65,0x77])][_0xb528c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xb528c([0x61,0x75,0x74,0x6f]);}}function _0x1280b5(_0x5553a9){const _0x1d6f37=[new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x834e95=>setTimeout(_0x834e95,0x3df6fa2d^_0xad8d11)),_0x58cde1[_0xb528c([0x74,0x68,0x65,0x6e])](()=>new window[(_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15bab2=>{let _0x437eea=0x0;_0x185352[_0xb528c([0x6d,0x6f,0x64,0x65,0x6c])][_0xb528c([0x6f,0x6e])](_0xb528c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4c5dff,_0x2e0694)=>{_0x2e0694[0x0][_0xb528c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x437eea++,_0x437eea==(0x3dffc519^_0xad8d11)&&(_0x15bab2(),_0x4c5dff[_0xb528c([0x6f,0x66,0x66])]());});}))];return window[_0xb528c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xb528c([0x72,0x61,0x63,0x65])](_0x1d6f37)[_0xb528c([0x74,0x68,0x65,0x6e])](()=>_0x5553a9);}async function _0x2af6a7(){await _0x58cde1,_0x185352[_0xb528c([0x6d,0x6f,0x64,0x65,0x6c])][_0xb528c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x257ef3,_0x185352[_0xb528c([0x6d,0x6f,0x64,0x65,0x6c])][_0xb528c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x257ef3,_0x185352[_0xb528c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xb528c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3bc00c(_0x247b4f){const _0xd9cf2f=_0x376155();_0x185352[_0xd9cf2f]=_0xb528c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x247b4f,_0x247b4f!=_0xb528c([0x56,0x61,0x6c,0x69,0x64])&&_0x2af6a7();}function _0x376155(){const _0x1684cf=window[_0xb528c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xb528c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xb528c([0x6e,0x6f,0x77])]())[_0xb528c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xb528c([0x2e]),'');let _0x17de2d=_0xb528c([0x6e]);for(let _0x47af45=0x0;_0x47af45<_0x1684cf[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x47af45+=0x2){let _0x3c74a4=window[_0xb528c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1684cf[_0xb528c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x47af45,_0x47af45+0x2));_0x3c74a4>=_0x4c6635[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3c74a4-=_0x4c6635[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x17de2d+=_0x4c6635[_0x3c74a4];}return _0x17de2d;}function _0xe198ff(){const _0xf5f80a=_0xefea77[_0xb528c([0x73,0x70,0x6c,0x69,0x74])](_0xb528c([0x2e]));if(0x3!=_0xf5f80a[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x12fb0d(_0xf5f80a[0x1]);function _0x12fb0d(_0x22c0fd){const _0x56095e=_0x1312f8(_0x22c0fd);return _0x56095e&&_0x8c657()?_0x56095e:null;function _0x8c657(){const _0x10b460=_0x56095e[_0xb528c([0x6a,0x74,0x69])],_0x156ad1=window[_0xb528c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10b460[_0xb528c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x10b460[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3282b4={..._0x56095e,[_0xb528c([0x6a,0x74,0x69])]:_0x10b460[_0xb528c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x10b460[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3282b4[_0xb528c([0x76,0x63])],_0x203c18(_0x3282b4)==_0x156ad1;}}}async function _0x4ac871(){let _0x133c72=!0x0;try{const _0x3be724=_0xefea77[_0xb528c([0x73,0x70,0x6c,0x69,0x74])](_0xb528c([0x2e])),[_0x19f77b,_0x40de6c,_0x5148f1]=_0x3be724;return _0xe59423(_0x19f77b),await _0x2d6346(_0x19f77b,_0x40de6c,_0x5148f1),_0x133c72;}catch{return!0x1;}function _0xe59423(_0x5dc27f){const _0x5675fd=_0x1312f8(_0x5dc27f);_0x5675fd&&_0x5675fd[_0xb528c([0x61,0x6c,0x67])]==_0xb528c([0x45,0x53,0x32,0x35,0x36])||(_0x133c72=!0x1);}async function _0x2d6346(_0x4f92d1,_0x389c92,_0x196c25){const _0x164d85=window[_0xb528c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xb528c([0x66,0x72,0x6f,0x6d])](_0x5c4041(_0x196c25),_0x4fdef4=>_0x4fdef4[_0xb528c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x21e9e0=new window[(_0xb528c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xb528c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f92d1+_0xb528c([0x2e])+_0x389c92),_0xef5259=window[_0xb528c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xb528c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0xef5259)return;const _0x4cd81e=await _0xef5259[_0xb528c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xb528c([0x6a,0x77,0x6b]),_0xf879ee,{[_0xb528c([0x6e,0x61,0x6d,0x65])]:_0xb528c([0x45,0x43,0x44,0x53,0x41]),[_0xb528c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xb528c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xb528c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0xef5259[_0xb528c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xb528c([0x6e,0x61,0x6d,0x65])]:_0xb528c([0x45,0x43,0x44,0x53,0x41]),[_0xb528c([0x68,0x61,0x73,0x68])]:{[_0xb528c([0x6e,0x61,0x6d,0x65])]:_0xb528c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4cd81e,_0x164d85,_0x21e9e0)||(_0x133c72=!0x1);}}function _0x1312f8(_0x1c34ae){return _0x1c34ae[_0xb528c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xb528c([0x65,0x79]))?JSON[_0xb528c([0x70,0x61,0x72,0x73,0x65])](_0x5c4041(_0x1c34ae)):null;}function _0x5c4041(_0x887b1c){return window[_0xb528c([0x61,0x74,0x6f,0x62])](_0x887b1c[_0xb528c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xb528c([0x2b]))[_0xb528c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xb528c([0x2f])));}function _0x203c18(_0x940c73){let _0x1d3692=0x1505;function _0x61daa8(_0x581ca4){for(let _0x396255=0x0;_0x396255<_0x581ca4[_0xb528c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x396255++){const _0x9173f=_0x581ca4[_0xb528c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x396255);_0x1d3692=(_0x1d3692<<0x5)+_0x1d3692+_0x9173f,_0x1d3692&=_0x1d3692;}}function _0x5e2851(_0x24a4f4){Array[_0xb528c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x24a4f4)?_0x24a4f4[_0xb528c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5e2851):_0x24a4f4&&typeof _0x24a4f4==_0xb528c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xb528c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x24a4f4)[_0xb528c([0x73,0x6f,0x72,0x74])]()[_0xb528c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3da793,_0x5d99af])=>{_0x61daa8(_0x3da793),_0x5e2851(_0x5d99af);}):_0x61daa8(window[_0xb528c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x24a4f4));}return _0x5e2851(_0x940c73),_0x1d3692>>>0x0;}function _0x1ff115(_0x4c06f4){return _0x4c06f4[_0xb528c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xb528c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xb528c([0x30]));}function _0x1f06db(_0x3d6165){return _0x3d6165[_0xb528c([0x73,0x70,0x6c,0x69,0x74])]('')[_0xb528c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xb528c([0x6a,0x6f,0x69,0x6e])]('');}function _0x257ef3(){}function _0xb528c(_0x32719c){return _0x32719c['map'](_0x40dc22=>String['fromCharCode'](_0x40dc22))['join']('');}_0x3bc00c(await _0x44d580());}(this);}['showFakeVisualSelection'](){const _0x399a2c=this['editor']['model'];_0x399a2c['change'](_0xb43aa1=>{const _0x331c83=_0x399a2c['document']['selection']['getRanges']();let _0x55497d=0x0;for(const _0x209137 of _0x331c83){const _0x2f4842=w+':'+_0x55497d;if(_0x399a2c['markers']['has'](_0x2f4842))_0xb43aa1['updateMarker'](_0x2f4842,{'range':_0x209137});else{if(_0x209137['start']['isAtEnd']){const _0x2a60c0=_0x209137['start']['getLastMatchingPosition'](({item:_0x42ee69})=>!_0x399a2c['schema']['isContent'](_0x42ee69),{'boundaries':_0x209137});_0xb43aa1['addMarker'](_0x2f4842,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb43aa1['createRange'](_0x2a60c0,_0x209137['end'])});}else _0xb43aa1['addMarker'](_0x2f4842,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x209137});}_0x55497d++;}});}['hideFakeVisualSelection'](){const _0xf21bea=this['editor']['model'],_0x21d085=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x21d085['length']&&_0xf21bea['change'](_0x23f468=>{_0x21d085['forEach'](_0x3aa8c2=>{_0x23f468['removeMarker'](_0x3aa8c2);});});}['insertContent'](_0x2377d3,_0x3acba4){const _0x3c0c4e=this['_getAISelection'](),_0x78bc64=_0x3acba4||_0x3c0c4e['getFirstRange']();this['editor']['model']['canEditAt'](_0x78bc64)&&this['editor']['model']['change'](_0x2916d6=>{this['hideFakeVisualSelection'](),_0x3acba4||this['_resetContentOfSelectedTableCells'](_0x2916d6,_0x3c0c4e),this['_pasteHTMLUsingClipboard']({'insertAt':_0x78bc64,'writer':_0x2916d6,'html':_0x2377d3});});}['insertContentBelow'](_0x3206df){const {model:_0x57b07b}=this['editor'],_0x415d10=this['_getAISelection']();_0x57b07b['change'](()=>{const _0x32cc97=this['_prepareTableInsertBelowPosition'](_0x3206df,_0x415d10)||this['_getDefaultInsertBelowPosition'](_0x415d10);this['insertContent'](_0x3206df,_0x32cc97);});}['_getAISelection'](){const _0x9a593c=this['editor']['model'],_0x3d4059=Array['from'](_0x9a593c['markers']['getMarkersGroup'](w))['map'](_0x532b4d=>_0x532b4d['getRange']());return _0x9a593c['createSelection'](_0x3d4059);}['_pasteHTMLUsingClipboard']({writer:_0x20f9df,html:_0xbc795a,insertAt:_0x55e8d6}){const {view:_0x4df5b4}=this['editor']['editing'],_0x405bbb=this['editor']['plugins']['get'](_0x7babf7),_0x46f31d=new Un();_0x46f31d['setData']('text/html',_0xbc795a);const _0x18b65f=new ClipboardEvent('paste',{'clipboardData':_0x46f31d}),_0x47c53e=new _0x75fd74(_0x4df5b4,_0x18b65f,{'dataTransfer':new _0x3cec43(_0x46f31d)});_0x20f9df['setSelection'](_0x55e8d6);const _0x3ce5b7=(_0x526c08,_0x2f397b)=>{_0x2f397b['resultRange']&&_0x20f9df['setSelection'](_0x2f397b['resultRange']);};_0x405bbb['once']('contentInsertion',_0x3ce5b7,{'priority':'lowest'}),_0x4df5b4['document']['fire']('paste',_0x47c53e),_0x405bbb['off']('contentInsertion',_0x3ce5b7);}['_getDefaultInsertBelowPosition'](_0x5ee31c){const {model:_0x42bbd3}=this['editor'],_0x1df6e2=Array['from'](_0x5ee31c['getSelectedBlocks']());return _0x1df6e2['length']?_0x42bbd3['createPositionAfter'](_0x1df6e2['pop']()):_0x5ee31c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1cedfe,_0x4da8fc){const {model:_0x345192,plugins:_0x172323}=this['editor'];if(_0x172323['has']('TableUtils')){const _0xad9be0=_0x172323['get']('TableUtils')['getSelectedTableCells'](_0x4da8fc);if(_0xad9be0['length']){const _0x2a23cc=this['_getTableRowCountFromContent'](_0x1cedfe),_0x1a0030=this['_createEmptyTableRows'](_0xad9be0,_0x2a23cc);return _0x345192['createPositionAt'](_0x1a0030,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1d66a4){const _0x2ae201=this['editor']['plugins']['get']('TableUtils'),_0x2abb83=this['editor']['data']['parse'](_0x1d66a4),_0x11f418=Array['from'](_0x2abb83['getChildren']())['filter'](_0x5d31bd=>_0x5d31bd['is']('element','table'));let _0x4c9736=0x0;return _0x11f418['forEach'](_0x7fabe5=>{_0x4c9736+=_0x2ae201['getRows'](_0x7fabe5);}),_0x4c9736;}['_createEmptyTableRows'](_0x338ee6,_0x20a74a){const _0x1d5c28=this['editor']['plugins']['get']('TableUtils'),_0x1a7007=_0x1d5c28['getRowIndexes'](_0x338ee6),_0x532296=_0x1d5c28['getColumnIndexes'](_0x338ee6),_0x37c6b8=_0x1a7007['last']+0x1,_0x409e7a=_0x532296['first'],_0x212bd5=_0x338ee6[0x0]['findAncestor']('table');for(let _0x1f9fd1=0x0;_0x1f9fd1<_0x20a74a;_0x1f9fd1++)_0x1d5c28['insertRows'](_0x212bd5,{'at':_0x37c6b8});return _0x212bd5['getChild'](_0x37c6b8)['getChild'](_0x409e7a);}['_resetContentOfSelectedTableCells'](_0x3baf94,_0x557c11){const {plugins:_0x23b063}=this['editor'],{model:_0x2fb842}=_0x3baf94;if(!_0x23b063['has']('TableUtils'))return;_0x23b063['get']('TableUtils')['getSelectedTableCells'](_0x557c11)['length']&&_0x2fb842['deleteContent'](_0x557c11);}}class x extends _0x20f5e5{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x599d16('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x5e29ef){super(_0x5e29ef),this['name']='AIRequestError';}}function Vn(_0x35c544,_0x46bea5,_0x7ebde4){const t=_0x35c544['t'];switch(_0x46bea5){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',_0x7ebde4);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x7ebde4);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'},_0x7ebde4);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 _0x46bea5;}}class E extends Nt{['_commandDefinitions'];constructor(_0x49de37,_0x56cec5){super(_0x49de37),this['_commandDefinitions']=_0x56cec5,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x55400f,_0x3aef6f,_0x359606)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x359606));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x43d29b,_0x5dddcc,_0x15b57c)=>{this['enabledCommandsIds']=_0x15b57c?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x335774=this['editor']['model'];this['_hasContext']=function(_0x4b98cb){const _0x936dec=_0x4b98cb['document']['selection'];return _0x936dec['isCollapsed']?0x0!==[..._0x936dec['getSelectedBlocks']()]['length']&&![..._0x936dec['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4b98cb['hasContent'](_0x936dec['getFirstRange']());}(_0x335774);const _0x2a77ea=_0x335774['document']['selection'],_0x59370d=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x223c54 of _0x2a77ea['getRanges']())for(const _0x93bb9b of _0x223c54['getItems']())if(_0x93bb9b['is']('element')&&_0x59370d['includes'](_0x93bb9b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x155939='',_0x2f2271='',_0x46adaa='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x155939,_0x2f2271,_0x46adaa);}}function ns(_0x46565d,_0x2f4ca9){const _0x116ddf=new Set();for(const _0x508ac0 of _0x46565d['values']())(_0x2f4ca9||!0x1===_0x508ac0['requiresContent'])&&_0x116ddf['add'](_0x508ac0['id']);return Array['from'](_0x116ddf);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x3491c8(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x111d05,_0x1ad759,_0xaa958b){super(),this['editor']=_0x111d05,this['textAdapter']=_0x1ad759,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xaa958b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x39eb5b,_0x3e1b83,_0x227f53)=>{this['view']['value']=this['_sanitizeHTML'](_0x227f53);}),this['listenTo'](this['view'],'submitPrompt',(_0x4b6c57,_0x4fdd38)=>{const _0x5b304=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4fdd38,_0x5b304,'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:_0x504d83,query:_0x397145,htmlContent:_0x28c19f,label:_0xec9384,mainActionLabel:_0x3d204b}){this['view']['prompt']=_0xec9384,this['view']['mainAction']=_0x3d204b,this['initialContext']=_0x28c19f,_0x397145&&(this['view']['isRendered']?this['_handleQuery'](_0x397145,_0x28c19f,_0x504d83,_0xec9384):this['view']['once']('render',()=>{this['_handleQuery'](_0x397145,_0x28c19f,_0x504d83,_0xec9384);}));}['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'](_0x5d4220,_0x2b609f,_0x364bb8,_0x5a4b48){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2b609f,this['previousQuery']=_0x5d4220,this['previousLabel']=_0x5a4b48||_0x5d4220,this['previousActionId']=_0x364bb8,new Promise(_0xa170f3=>{this['textAdapter']['makeRequest']({'query':_0x5d4220,'context':_0x2b609f,'onData':_0x2f4d7e=>{this['currentResponse']=_0x2f4d7e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x364bb8})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x33a6a4=>{_0x33a6a4 instanceof tr?this['view']['handleError'](_0x33a6a4['message']):this['view']['handleError'](),_0xa170f3();})['finally'](()=>{this['stopProcessing'](),_0xa170f3();});});}['_parseAndNormalizeContent'](_0x159dc0,_0x330775=!0x1){const _0x4e465a=hs['exec'](_0x159dc0);_0x159dc0=_0x4e465a?_0x159dc0['substring'](_0x4e465a[0x1]['length']):_0x159dc0['length']<0x64&&!_0x330775?'':this['_stripMarkdownSyntax'](_0x159dc0);const _0x2cbe1a=this['_domParser']['parseFromString'](_0x159dc0,'text/html');if(_0x4e465a){const _0x26641e=Array['from'](_0x2cbe1a['body']['childNodes']);_0x26641e['reverse']();for(const _0x280c8b of _0x26641e){if(_0x280c8b['nodeType']==Node['ELEMENT_NODE'])break;_0x280c8b['remove']();}}const _0x55e31f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2cbe1a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x55e31f);const _0x4854e2=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4bb9fa=this['editor']['data']['toModel'](_0x55e31f);return _0x4854e2||_0x4bb9fa['markers']['clear'](),this['editor']['data']['stringify'](_0x4bb9fa);}['_normalizeResponseHeadings'](_0x4fe6c8){const _0x2f49c1=new _0x1d0d0b(this['editor']['editing']['view']['document']),_0xb10627=new _0x462754({'name':/^h[1-5]$/}),_0x1bf8a8=[];let _0x9c1f9=!0x1;for(const _0x56ffd2 of _0x4fe6c8)_0x56ffd2['is']('element')&&_0xb10627['match'](_0x56ffd2)&&(_0x1bf8a8['push'](_0x56ffd2),'h1'==_0x56ffd2['name']&&(_0x9c1f9=!0x0));if(_0x9c1f9){for(const _0x56c1d9 of _0x1bf8a8)_0x2f49c1['rename']('h'+(parseInt(_0x56c1d9['name'][0x1])+0x1),_0x56c1d9);}}['_isH1TagSupportEnabled'](){const {data:_0x4adfa8,editing:_0x8f76a0}=this['editor'],_0x353bc9=_0x4adfa8['htmlProcessor']['toView']('<h1></h1>'),_0x1140b3=_0x4adfa8['toView'](_0x4adfa8['toModel'](_0x353bc9));return!!_0x8f76a0['view']['domConverter']['viewToDom'](_0x1140b3)['querySelector']('h1');}['_sanitizeHTML'](_0xfdc96c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xfdc96c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x18c899){const _0x4eb9af=_0x18c899['trim']();return _0x4eb9af['startsWith']('```html')?_0x4eb9af['endsWith']('```')?_0x4eb9af['substring'](0x7,_0x4eb9af['length']-0x3):_0x4eb9af['substring'](0x7):_0x18c899;}}const _={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x581355{constructor(_0x1cb955){super(_0x1cb955),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x7931d7=>Vn(_0x1cb955,'AI_'+_0x7931d7['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Vn(_0x1cb955,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Vn(_0x1cb955,'Try\x20again')),this['stopButton']=this['_createButton'](Vn(_0x1cb955,'Stop'));const _0x16fb5c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x16fb5c['if']('isVisible','ck-hidden',_0x18691c=>!_0x18691c)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3b7d9b,_0x144b45){const _0x3e7593=new _0x4b3349(this['locale']);return _0x3e7593['set']({'label':_0x3b7d9b,'class':_0x144b45||'','isVisible':!0x0,'withText':!0x0}),_0x3e7593;}}class yr extends _0x3a2ab2{['contentFieldView'];['copyButtonView'];constructor(_0x4f9934,_0x3177b3=''){super(_0x4f9934),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x43421d=this['bindTemplate'];this['contentFieldView']=new Gn(_0x4f9934,_0x3177b3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x43421d['if']('isVisible','ck-hidden',_0x4832d5=>!_0x4832d5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x43421d['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 _0x412ef3=!0x1;this['on']('change:value',(_0x3aa9c0,_0x505cc7,_0xdba549)=>{const _0x9d50=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xdba549),this['isProcessing']&&_0x9d50&&!_0x412ef3&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x244e95,_0x2f7a2d,_0xb42a49)=>{_0x412ef3=!0x1,_0xb42a49?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x412ef3=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x412ef3=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x16b5a4=this['locale'],_0x5507d4=new _0x4b3349(this['locale']),_0x222a22='ck-ai-form__copy-button';return _0x5507d4['set']({'label':Vn(_0x16b5a4,'Copy'),'icon':_0x440998,'class':_0x222a22,'tooltip':!0x0}),_0x5507d4['bind']('isVisible')['to'](this,'value',_0xa5f72a=>!!_0xa5f72a),_0x5507d4['bind']('isEnabled')['to'](this,'isProcessing',_0x11a8e8=>!_0x11a8e8),_0x5507d4['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5507d4['icon']=_0x519140,_0x5507d4['class']=_0x222a22+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5507d4['icon']=_0x440998,_0x5507d4['class']=_0x222a22;},0x3e8);}),_0x5507d4;}['_copyHTMLToClipboard'](_0x6575b9){const {window:_0x226b82,document:_0x308b42}=_0x34a915;if(_0x226b82['ClipboardItem']){const {Blob:_0x32f8c4,ClipboardItem:_0x4b7314}=_0x226b82,_0x2362cc=[new _0x4b7314({'text/html':new _0x32f8c4([_0x6575b9['innerHTML']],{'type':'text/html'}),'text/plain':new _0x32f8c4([_0x6575b9['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2362cc);}else{const _0x4c40f9=_0x308b42['createElement']('div');_0x4c40f9['style']['position']='absolute',_0x4c40f9['style']['left']='-9999px',_0x4c40f9['innerHTML']='<span>[</span>'+_0x6575b9['innerHTML']+'<span>]</span>',_0x308b42['body']['appendChild'](_0x4c40f9);const _0x57641f=_0x308b42['createRange']();_0x57641f['setStartAfter'](_0x4c40f9['firstElementChild']),_0x57641f['setEndBefore'](_0x4c40f9['lastElementChild']);const _0x57d66e=_0x226b82['getSelection']();_0x57d66e['removeAllRanges'](),_0x57d66e['addRange'](_0x57641f),_0x308b42['execCommand']('copy'),_0x4c40f9['remove']();}}}class Gn extends _0x3a2ab2{constructor(_0x552e00,_0x40feb1=''){super(_0x552e00),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x40feb1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x41ad07){this['element']['innerHTML']=_0x41ad07;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2df70a=new _0x3a2ab2(),_0x4d6e58=this['locale'],_0x560c76=new _0x5d8343();return _0x560c76['isVisible']=!0x0,_0x2df70a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x560c76,{'text':Vn(_0x4d6e58,'AI\x20is\x20writing...')}]}),_0x2df70a['render'](),_0x2df70a;}}class gr extends _0x3a2ab2{constructor(_0x1f092e,_0x38eae0=''){super(_0x1f092e);const _0x2cb6ce=new _0x1f8dd5(),_0x51a3ac=this['bindTemplate'];this['set']('text',_0x38eae0),_0x2cb6ce['content']=_0x503ee4,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2cb6ce,{'text':_0x51a3ac['to']('text')}]});}}class Er extends _0x7ab78d{['submitButtonView'];['showHistoryButtonView'];constructor(_0x419f53,_0x145f82){super(_0x419f53,_0x145f82),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',(_0x53d033,_0x4bb8fc)=>{_0x53d033['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4bb8fc());});}['_createSubmitButton'](){const _0x274c21=new _0x4b3349(this['locale']),_0x3b2b3d=this['locale'];return _0x274c21['set']({'icon':_0xb7829d,'label':Vn(_0x3b2b3d,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x274c21['on']('execute',()=>{this['submit']();}),_0x274c21['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x40017e,_0x190584)=>!_0x40017e&&_0x190584),_0x274c21;}['_createShowHistoryButton'](){const _0x3a9069=new _0x4b3349(this['locale']),_0x32e96a=this['resultsView'],_0x23e78e=this['locale'];_0x3a9069['set']({'label':Vn(_0x23e78e,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3a9069['bind']('isOn')['to'](_0x32e96a,'isVisible'),_0x3a9069['bind']('isEnabled')['to'](this,'isEnabled'),_0x3a9069['on']('execute',()=>{_0x32e96a['isVisible']=!_0x32e96a['isVisible'],_0x32e96a['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x461a92=()=>{_0x34a915['window']['requestAnimationFrame'](()=>{if(_0x33d5ba(this['element'])){const _0x541285=new _0x5ed23e(this['queryView']['fieldView']['element']),_0x4ec03c=_0x541285['width'],_0x435212='rtl'===_0x23e78e['uiLanguageDirection']?'left':'right';_0x541285['excludeScrollbarsAndBorders'](),_0x3a9069['element']['style'][_0x435212]=_0x4ec03c-_0x541285['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x461a92),this['on']('render',_0x461a92),_0x3a9069;}['submit'](){const _0x25597c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x25597c);}['focus'](_0x29e89b){-0x1===_0x29e89b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x586ac5{['historyGroupView'];['clearHistoryButton'];constructor(_0x4ee6fd){super(_0x4ee6fd),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x3e6dc5(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Vn(_0x4ee6fd,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5db7a9=0x0;for(const _0x285e77 of this['items'])_0x5db7a9+=_0x285e77['items']['length'];return{'resultsCount':_0x5db7a9,'totalItemsCount':_0x5db7a9};}['_createClearHistoryButton'](){const _0x2ce439=this['locale'],_0xdb71c5=new _0x4b3349(this['locale']);return _0xdb71c5['set']({'label':'('+Vn(_0x2ce439,'Clear')+')','withText':!0x0}),_0xdb71c5['on']('execute',()=>this['fire']('clearHistory')),_0xdb71c5;}}class Ar extends _0x1f44f8{constructor(_0x2c112a){super();const _0x2eeb1c=new _0x39c654(),_0x3ceb4f=new _0x4b3349(this['locale'],_0x2eeb1c);this['children']['add'](_0x3ceb4f),_0x3ceb4f['set']({'label':_0x2c112a['prompt'],'withText':!0x0}),_0x3ceb4f['on']('execute',()=>{this['fire']('execute',{'value':_0x2a6371(_0x2c112a['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class Pr extends _0xe98229{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x37c0be,_0x3e23bf)=>{const _0x302206=co(_0x3e23bf['prompt']);for(const _0x6d25b2 of this)if(_0x6d25b2!=_0x3e23bf&&co(_0x6d25b2['prompt'])===_0x302206){this['remove'](_0x6d25b2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x36b8f4=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0x36b8f4));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0x55fb9f=>_0x55fb9f)));}}function co(_0x5dea76){return _0x5dea76['toLowerCase']()['trim']();}class k extends _0x3a2ab2{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x17c285,_0x2cdb50,_0x240f7c=''){super(_0x17c285),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x17c285),this['contentArea']=new yr(_0x17c285,_0x240f7c),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 _0x14ef6c(),this['keystrokes']=new _0x4f7a26(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3d067c({'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 _0x3a566d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2cdb50],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3a566d['if']('isError','ck-hidden',_0x14a9f4=>!_0x14a9f4)]},'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'](_0x161739=0x1){-0x1===_0x161739?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 _0x5a0d02=this['locale'],_0x5e9c07=new Er(_0x5a0d02,{'queryView':{'label':Vn(_0x5a0d02,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x456b9c,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Vn(_0x5a0d02,'Empty\x20history'),'secondary':Vn(_0x5a0d02,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5e9c07['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a9a9c,_0x1eb643)=>_0x2a9a9c&&!_0x1eb643),this['listenTo'](_0x5e9c07,'submit',(_0x280707,_0x363163)=>{this['prompt']=_0x363163;const _0x3589a5=_0x512f25(_0x363163);this['fire']('submitPrompt',_0x3589a5),_0x363163['trim']()&&this['_promptHistory']['add']({'prompt':_0x3589a5},0x0);},{'priority':'high'}),_0x5e9c07;}['_createHistoryView'](){const _0x3d8e1a=new vr(this['locale']);return _0x3d8e1a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x3d8e1a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d8e1a;}['_createToolbar'](){const _0x4ce036=new wr(this['locale']);return _0x4ce036['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1ff5c9,_0x8f2038,_0x401fd1)=>_0x1ff5c9&&!_0x8f2038&&!!_0x401fd1),_0x4ce036['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4ce036['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4f4f0f,_0x39069d,_0x4188b7)=>_0x4f4f0f&&!_0x39069d&&!!_0x4188b7),_0x4ce036['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4ce036['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1c1aa9,_0x9d96b4)=>_0x1c1aa9&&!_0x9d96b4),_0x4ce036['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4ce036['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4ce036['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4ce036;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x475e8a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Vn(_0x475e8a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x442a5b){const _0x478de9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x442a5b||Vn(_0x478de9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x20f5e5{['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[_0x4a3991,a,x,_0x889ca7];}constructor(_0xa3c11d){super(_0xa3c11d),_0xa3c11d['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0xa3c11d['config']['define']('ai.assistant.contentAreaCssClass',''),_0xa3c11d['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xa3c11d['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xba98d}=this;this['_aiAdapter']=_0xba98d['plugins']['get'](x),this['_dialog']=_0xba98d['plugins']['get'](_0x889ca7),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x28c8be=new E(_0xba98d,Array['from'](this['_commandDefinitions']['values']()));_0xba98d['commands']['add']('showAIAssistant',_0x28c8be),_0xba98d['ui']['componentFactory']['add']('aiCommands',_0x4363c4=>{const _0x2bbd18=_0x45dc52(_0x4363c4);return _0x2bbd18['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2bbd18['buttonView']['set']({'label':Vn(_0x4363c4,'AI\x20Commands'),'icon':_0x4b7b3d,'tooltip':!0x0}),_0x2bbd18['on']('execute',_0x5977d8=>this['_onExecute'](_0x5977d8['source']['id'])),_0x201b22(_0x2bbd18,_0xba98d['ui']['view']['body'],function(_0x2464c5){const _0x22c607=o(_0x2464c5['config']['get']('ai.assistant.commands'),_0x2464c5['locale']),_0x28c222=U(_0x2464c5,_0x22c607)['filter'](_0x3c0d21=>_0x3c0d21['commands']['length']);if(0x1===_0x28c222['length'])return U(_0x2464c5,_0x28c222[0x0]['commands'])['map'](_0x4769c4=>({'id':_0x4769c4['id'],'label':_0x4769c4['label']}));return _0x28c222['map'](_0x380743=>{const {groupId:_0x596aee,groupLabel:_0x9a88ac,commands:_0x2848f0}=_0x380743,_0x3d8d04=U(_0x2464c5,_0x2848f0)['map'](_0x4e37d6=>({'id':_0x4e37d6['id'],'label':_0x4e37d6['label']}));return{'id':_0x596aee,'menu':_0x9a88ac||_0x596aee,'children':_0x3d8d04};});}(_0xba98d),{'ariaLabel':Vn(_0x4363c4,'AI\x20Commands')}),_0x2bbd18['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x28c8be['on']('change:enabledCommandsIds',_0x29f388),_0x2bbd18['menuView']['once']('render',_0x29f388),_0x2bbd18;function _0x29f388(){_0x2bbd18['isEnabled']=_0x28c8be['enabledCommandsIds']['length']>0x0;for(const _0x8adf98 of _0x2bbd18['menuView']['buttons'])_0x8adf98['isEnabled']=_0x28c8be['enabledCommandsIds']['includes'](_0x8adf98['id']);}}),_0xba98d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x30c5f4=>{const _0x530e08=new _0x3db66d(_0x30c5f4);_0x530e08['buttonView']['set']({'label':Vn(_0x30c5f4,'AI\x20Commands'),'icon':_0x4b7b3d}),_0x530e08['bind']('isEnabled')['to'](_0x28c8be,'enabledCommandsIds',_0x227c7c=>_0x227c7c['length']>0x0);const _0x3aeea5=o(_0xba98d['config']['get']('ai.assistant.commands'),_0x30c5f4);return this['_populateMenuBarMenu'](_0x28c8be,_0x530e08,_0x3aeea5,_0x44c560=>this['_onExecute'](_0x44c560)),_0x530e08;}),_0xba98d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0xcc37ab=this['_createAIAssistantUIButton'](_0x4b3349);return _0xcc37ab['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0xcc37ab;}),_0xba98d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5ab13f=this['_createAIAssistantUIButton'](_0x4389d5);return _0x5ab13f['set']({'role':'menuitemcheckbox'}),_0x5ab13f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e42ed=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x574e69;for(const _0x2a24b8 in _0x3e42ed){const _0x29e072=_0x2a24b8,_0x14970f=_0x3e42ed[_0x29e072];if('aiLicenseKeyValid'==_0x14970f||'aiLicenseKeyInvalid'==_0x14970f||'aiLicenseKeyExpired'==_0x14970f||'aiLicenseKeyDomainLimit'==_0x14970f||'aiLicenseKeyNotAllowed'==_0x14970f||'aiLicenseKeyEvaluationLimit'==_0x14970f||'aiLicenseKeyTrialLimit'==_0x14970f||'aiLicenseKeyUsageLimit'==_0x14970f){delete _0x3e42ed[_0x29e072],_0x574e69=_0x14970f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x574e69&&_0x3e42ed['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x574e69&&_0x3e42ed['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x574e69&&_0x3e42ed['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x574e69&&_0x3e42ed['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x574e69&&_0x3e42ed['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x574e69&&_0x3e42ed['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x574e69&&_0x3e42ed['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x53215b='',_0x49fdb1='',_0x556c00='custom'){const _0x1a2e50=this['editor'],_0x263b03=_0x1a2e50['editing']['view'],_0x58a29f=_0x1a2e50['plugins']['get'](a),_0xba5c12=_0x1a2e50['plugins']['get'](_0x4a3991);_0x58a29f['showFakeVisualSelection']();const _0x2a6dfd=new l(),_0xd3fbb=new ClipboardEvent('copy',{'clipboardData':_0x2a6dfd}),_0x52b500=new _0x3cec43(_0x2a6dfd),_0x1ef15b=new _0x75fd74(_0x263b03,_0xd3fbb,{'dataTransfer':_0x52b500});_0xba5c12['_forceMarkersCopy']('comment',()=>{_0x263b03['document']['fire']('copy',_0x1ef15b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x1a2e50,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x6658ef=_0x52b500['getData']('text/html');const _0xabfa4d=_0x1a2e50['model']['document']['selection'],_0x4132d1=Array['from'](_0xabfa4d['getRanges']());0x1===_0x4132d1['length']&&_0x4132d1[0x0]['isFlat']&&!_0xabfa4d['getSelectedElement']()&&''!==_0x6658ef['replace'](/ /g,'')['trim']()&&(_0x6658ef='<p>'+_0x6658ef+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x556c00,'query':_0x53215b,'htmlContent':_0x6658ef,'label':_0x49fdb1,'mainActionLabel':_[_0x1a2e50['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x46c7c5,'title':Vn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x7944f3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x58a29f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x20c837=new Map(),_0x77b45=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1f062c of _0x77b45)for(const _0x4f9fc0 of _0x1f062c['commands'])_0x20c837['set'](_0x4f9fc0['id'],{..._0x4f9fc0,'groupId':_0x1f062c['groupId'],'groupLabel':_0x1f062c['groupLabel']||_0x1f062c['groupId']});return _0x20c837;}['_createAIAssistantUIButton'](_0x15d4c5){const _0x8d14f4=this['editor'],_0x2b9d88=_0x8d14f4['commands']['get']('showAIAssistant'),_0x28f94b=new _0x15d4c5(_0x8d14f4['locale']);return _0x28f94b['set']({'label':Vn(_0x8d14f4['locale'],'AI\x20Assistant'),'icon':_0x46c7c5,'isToggleable':!0x0}),_0x28f94b['bind']('isEnabled')['to'](_0x2b9d88),_0x28f94b['bind']('isOn')['to'](this['_dialog'],'id',_0x56628b=>'aiAssistant'===_0x56628b),this['listenTo'](_0x28f94b,'execute',()=>{_0x28f94b['isOn']?this['hideUI']():_0x2b9d88['execute']();}),_0x28f94b;}['_initView'](){const _0x2b3a56=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',()=>{_0x2b3a56['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2b3a56['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x35054f,ui:{ariaLiveAnnouncer:_0x8e1d37}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2c66d6,_0x4154d0,_0x6b0ec1)=>{const _0x46336d=this['_aiAssistantController']['currentContext'];_0x6b0ec1?_0x8e1d37['announce'](Vn(_0x35054f,'AI\x20is\x20writing')):_0x46336d&&_0x8e1d37['announce'](Vn(_0x35054f,'Generated\x20content:\x20%0',_0x46336d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xef0fd3,_0x4c57bf,_0x58b28c)=>{if(_0x58b28c){const _0x16ae73=this['_formView']['errorView']['text'];_0x8e1d37['announce'](Vn(_0x35054f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x16ae73));}});}['_onExecute'](_0x4b63f3){const _0x5edc24=this['_commandDefinitions']['get'](_0x4b63f3),_0x1a9d1e=this['editor'],_0x549ecb=_0x1a9d1e['model']['document']['selection'],_0x28f637=_0x1a9d1e['commands']['get']('showAIAssistant'),_0x2fc7b6=_0x1a9d1e['plugins']['get'](a),_0x9fef41=''+(_0x5edc24['groupId']!==K?_0x5edc24['groupLabel']+':\x20':'')+_0x5edc24['label'];if(!0x1!==_0x5edc24['requiresContent']&&_0x549ecb['isCollapsed']){const _0x4035c5=_0x5f24ba(_0x549ecb['getSelectedBlocks']())||_0x1a9d1e['model']['schema']['getLimitElement'](_0x549ecb);_0x1a9d1e['model']['change'](_0x4bea18=>{_0x4bea18['setSelection'](_0x4035c5,'in');});}_0x2fc7b6['showFakeVisualSelection'](),_0x28f637['execute'](_0x5edc24['prompt'],_0x9fef41,'command:'+_0x4b63f3);}['_populateMenuBarMenu'](_0x5ef959,_0x1205a6,_0x496b6a,_0xb5fb7a){const _0x2b69e6=this['editor'],_0x408e6b=_0x2b69e6['locale'],_0x303d72=new _0x26ac41(_0x408e6b),_0x4204a8=U(_0x2b69e6,_0x496b6a)['filter'](_0x241382=>_0x241382['commands']['length']);0x1===_0x4204a8['length']?this['_getMenuBarGroupButtons']({'command':_0x5ef959,'commands':_0x4204a8[0x0]['commands'],'parentMenuView':_0x1205a6,'onExecute':_0xb5fb7a})['forEach'](_0x40f0bc=>_0x303d72['items']['add'](_0x40f0bc)):_0x4204a8['forEach'](({groupId:_0x1c6e39,groupLabel:_0xe960e1,commands:_0x5adcc5})=>{const _0x1bf1e8=new _0x5e1da0(_0x408e6b,_0x1205a6),_0x32da6e=new _0x3db66d(_0x408e6b),_0x6a216c=new _0x26ac41(_0x408e6b),_0x6ac3eb=this['_getMenuBarGroupButtons']({'command':_0x5ef959,'commands':_0x5adcc5,'parentMenuView':_0x32da6e,'onExecute':_0xb5fb7a});_0x32da6e['buttonView']['set']({'label':_0xe960e1||_0x1c6e39}),_0x32da6e['delegate']('execute')['to'](_0x1205a6),_0x6a216c['items']['addMany'](_0x6ac3eb),_0x32da6e['panelView']['children']['add'](_0x6a216c),_0x1bf1e8['children']['add'](_0x32da6e),_0x303d72['items']['add'](_0x1bf1e8);}),_0x1205a6['panelView']['children']['add'](_0x303d72);}['_getMenuBarGroupButtons']({command:_0x280652,commands:_0x204a5e,parentMenuView:_0x5604d2,onExecute:_0x4f5136}){const _0x42305c=this['editor'],_0x2c37ea=_0x42305c['locale'];return U(_0x42305c,_0x204a5e)['map'](_0x4ebf7b=>{const _0x5e1c36=new _0x5e1da0(_0x2c37ea,_0x5604d2),_0x3e8f6d=new _0x4389d5(_0x2c37ea);return _0x3e8f6d['set']({'label':_0x4ebf7b['label']}),_0x3e8f6d['delegate']('execute')['to'](_0x5604d2),_0x3e8f6d['on']('execute',()=>_0x4f5136(_0x4ebf7b['id'])),_0x3e8f6d['bind']('isEnabled')['to'](_0x280652,'enabledCommandsIds',_0x4fde85=>_0x4fde85['includes'](_0x4ebf7b['id'])),_0x5e1c36['children']['add'](_0x3e8f6d),_0x5e1c36;});}}function T(_0x51dfba,_0x184509){return void 0x0!==_0x51dfba['order']&&void 0x0===_0x184509['order']?0x1:void 0x0===_0x51dfba['order']&&void 0x0!==_0x184509['order']?-0x1:void 0x0!==_0x51dfba['order']&&void 0x0!==_0x184509['order']?_0x51dfba['order']-_0x184509['order']:0x0;}function U(_0x1ed6a3,_0x2c3cc5){_0x2c3cc5['sort'](T);const _0x850f1a={},_0x3fc06d=[];for(const _0x57e491 of _0x2c3cc5)if(void 0x0!==_0x57e491['order']){if(_0x57e491['order']in _0x850f1a)throw new _0x599d16('ai-commands-config-order-collision',_0x1ed6a3,{'conflictingDefinitions':[_0x57e491,_0x850f1a[_0x57e491['order']]]});_0x850f1a[_0x57e491['order']]=_0x57e491,_0x3fc06d['splice'](_0x57e491['order'],0x0,_0x57e491);}else _0x3fc06d['push'](_0x57e491);return _0x3fc06d;}class Bn extends _0x20f5e5{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b997b){super(_0x3b997b);const _0x4fb480=_0x3b997b['config'],_0x594fd2=_0x3b997b['locale'];_0x4fb480['define']('ai.assistant.preserveComments',!0x0),_0x4fb480['define']('ai.assistant.commands',Kn(_0x594fd2)),_0x4fb480['define']('ai.assistant.extraCommandGroups',[]),_0x4fb480['define']('ai.assistant.removeCommands',[]);let _0x425bc0=o(_0x4fb480['get']('ai.assistant.commands'),_0x594fd2);const _0x50188e=_0x4fb480['get']('ai.assistant.extraCommandGroups'),_0x267047=_0x4fb480['get']('ai.assistant.removeCommands');_0x50188e['forEach'](_0xff413d=>{const _0x338dcc=_0x425bc0['find'](_0x483b3a=>_0x483b3a['groupId']===_0xff413d['groupId']);_0x338dcc?_0x338dcc['commands']=_0x338dcc['commands']['concat'](_0xff413d['commands']):_0x425bc0['push'](_0xff413d);}),_0x425bc0=_0x425bc0['filter'](_0x579057=>!_0x267047['includes'](_0x579057['groupId'])),_0x425bc0['forEach'](_0xec9b06=>{_0xec9b06['commands']=_0xec9b06['commands']['filter'](_0x3d98a0=>!_0x267047['includes'](_0x3d98a0['id']));}),_0x4fb480['set']('ai.assistant.commands',_0x425bc0);}}function Kn(_0x109eeb){return[{'groupId':'editOrReview','groupLabel':Vn(_0x109eeb,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Vn(_0x109eeb,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Vn(_0x109eeb,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Vn(_0x109eeb,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Vn(_0x109eeb,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Vn(_0x109eeb,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Vn(_0x109eeb,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Vn(_0x109eeb,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Vn(_0x109eeb,'Change\x20tone'),'commands':[{'id':'professional','label':Vn(_0x109eeb,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Vn(_0x109eeb,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Vn(_0x109eeb,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Vn(_0x109eeb,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Vn(_0x109eeb,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Vn(_0x109eeb,'Change\x20style'),'commands':[{'id':'business','label':Vn(_0x109eeb,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Vn(_0x109eeb,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Vn(_0x109eeb,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Vn(_0x109eeb,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Vn(_0x109eeb,'Translate'),'commands':[{'id':'translateEnglish','label':Vn(_0x109eeb,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Vn(_0x109eeb,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Vn(_0x109eeb,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Vn(_0x109eeb,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Vn(_0x109eeb,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Vn(_0x109eeb,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Vn(_0x109eeb,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Vn(_0x109eeb,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class de extends _0x20f5e5{['abortController'];static get['requires'](){return[x];}constructor(_0x279c3b){super(_0x279c3b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2eec3f){return this['sendRequest'](_0x2eec3f)['catch'](_0xa5c622=>{if(_0xa5c622 instanceof tr)return Promise['reject'](_0xa5c622);if('AbortError'==_0xa5c622['name'])return Promise['resolve']();throw console['error'](_0xa5c622),new _0x599d16('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x377524,_0x9d797){const _0x33e971=this['editor']['locale'],_0xa32f62={'Content-Type':'application/json'};if('object'==typeof _0x377524)Object['assign'](_0xa32f62,_0x377524);else{if(_0x377524)try{const _0x32eed1=await _0x377524(_0x9d797);Object['assign'](_0xa32f62,_0x32eed1);}catch{return Promise['reject'](new tr(Vn(_0x33e971,'AI_ERROR_GET_HEADERS')));}}return _0xa32f62;}async['_prepareRequestParameters'](_0x48906d,_0x5f59f9){const _0x1d99f=this['editor']['locale'];if('object'==typeof _0x48906d)return _0x48906d;try{return await _0x48906d(_0x5f59f9);}catch{return Promise['reject'](new tr(Vn(_0x1d99f,'AI_ERROR_GET_PARAMETERS')));}}}class Wn extends de{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x41c64f){super(_0x41c64f),_0x41c64f['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x41c64f['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x41c64f['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x41c64f['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x41c64f['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x41c64f['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x478931,context:_0x248abd,onData:_0x3f4e20,actionId:_0x505c7e}){const _0x2090cc=this['editor']['locale'],_0x92011d=await this['prepareMessages'](_0x478931,_0x248abd,_0x505c7e),_0x2fa7b7=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x505c7e),_0x41337e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x505c7e),_0x3a3a1e={'messages':_0x92011d,..._0x41337e},_0x9ba330={'method':'POST','headers':_0x2fa7b7,'body':JSON['stringify'](_0x3a3a1e),'signal':this['abortController']['signal']},_0x247e2e=await fetch(this['_apiUrl'],_0x9ba330);if(_0x247e2e['ok'])return _0x41337e['stream']?await this['_readStreamableResponse'](_0x247e2e,_0x3f4e20):await this['_readStaticResponse'](_0x247e2e,_0x3f4e20),Promise['resolve']();{const _0xb8dbce=await _0x247e2e['text']();return _0xb8dbce['includes']('context_length_exceeded')?Promise['reject'](new tr(Vn(_0x2090cc,'AI_ERROR_CONTEXT_LENGTH'))):_0xb8dbce['includes']('Moderation')?Promise['reject'](new tr(Vn(_0x2090cc,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xb8dbce));}}async['prepareMessages'](_0x46e6b7,_0x299474,_0x1818ad){let _0x3ae6ea,_0x4422bf;return _0x299474?(_0x3ae6ea='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.',_0x4422bf='Instruction:\x0a'+_0x46e6b7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x299474):(_0x3ae6ea='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.',_0x4422bf=_0x46e6b7),[{'role':'system','content':_0x3ae6ea},{'role':'user','content':_0x4422bf}];}async['_readStreamableResponse'](_0x405b64,_0x3e8ada){const _0x46067d=_0x405b64['body']['getReader'](),_0x30c3d4=new TextDecoder();let _0xf30776='',_0x36a9da='',_0x33552e='',_0x108758=!0x1;for(;!_0x108758;){const {done:_0x2f7956,value:_0x306581}=await _0x46067d['read'](),_0xc223ca=_0xf30776+_0x30c3d4['decode'](_0x306581);let _0x4cd67d='';_0x108758=_0x2f7956;try{_0x4cd67d=this['_cleanUpData'](_0xc223ca),_0xf30776='';}catch{_0xf30776=_0xc223ca;continue;}_0x36a9da+=_0x4cd67d,!_0x108758&&this['_isBufferIncomplete'](_0x36a9da)||_0x36a9da&&(_0x33552e+=_0x36a9da,_0x36a9da='',_0x3e8ada(_0x33552e));}return Promise['resolve']();}async['_readStaticResponse'](_0x247410,_0x1f8070){return _0x1f8070((await _0x247410['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x46d5db){const _0x5cf5be=_0x46d5db['split']('<')['length']!==_0x46d5db['split']('>')['length'],_0x1b42da=_0x46d5db['length']<0x1e;return _0x5cf5be&&_0x1b42da;}['_cleanUpData'](_0x3b20ca){return _0x3b20ca['split'](/\n(?![^{]*\})/g)['map'](_0x1d0675=>_0x1d0675['replace']('data:\x20',''))['filter'](_0x596956=>_0x596956&&_0x596956['length']>0x0&&'[DONE]'!==_0x596956)['map'](_0x2bbb5a=>{const {choices:_0x1347b0}=JSON['parse'](_0x2bbb5a);if(_0x1347b0[0x0]?.['delta']?.['content'])return _0x1347b0[0x0]['delta']['content'];})['filter'](_0x38a038=>_0x38a038)['join']('');}}class Fn extends de{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x50ad36){super(_0x50ad36),_0x50ad36['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x50ad36['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']=_0x50ad36['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x50ad36['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x50ad36['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x50ad36['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x39317a,context:_0x3884f3,onData:_0x667659,actionId:_0x58fa5c}){const {model:_0x52b8aa,stream:_0x5e2add,..._0x9d17c8}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x58fa5c),_0x4177e8={'prompt':await this['preparePrompt'](_0x39317a,_0x3884f3,_0x52b8aa,_0x58fa5c),..._0x9d17c8};this['_apiUrl']?await this['_processProxyRequest'](_0x4177e8,_0x52b8aa,_0x5e2add,_0x667659,_0x58fa5c):await this['_processAWSRequest'](_0x4177e8,_0x52b8aa,_0x5e2add,_0x667659);}async['preparePrompt'](_0x501388,_0x5a6fa3,_0x489709,_0x4a0ceb){let _0x1d3058,_0x2e6575;return _0x5a6fa3?(_0x1d3058='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.',_0x2e6575='Instruction:\x0a'+_0x501388+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5a6fa3):(_0x1d3058='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.',_0x2e6575=_0x501388),'meta.llama'==this['getModelFamily'](_0x489709)?'<<SYS>>\x0a'+_0x1d3058+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2e6575+'\x0a[/INST]':'Human:\x0a'+_0x1d3058+'\x0a'+_0x2e6575+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5cd73a){if(/^anthropic\.claude/['test'](_0x5cd73a))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5cd73a))return'ai21.j2';if(/^cohere\.command/['test'](_0x5cd73a))return'cohere.command';if(/^meta\.llama/['test'](_0x5cd73a))return'meta.llama';throw new tr(Vn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5cd73a));}async['_processProxyRequest'](_0x8dc298,_0x10668d,_0xb0aa5e,_0x155dc5,_0x2bea39){const _0x5495ef={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2bea39),'body':JSON['stringify']({..._0x8dc298,'model':_0x10668d,'stream':_0xb0aa5e}),'signal':this['abortController']['signal']},_0x26c11a=await fetch(this['_apiUrl'],_0x5495ef);_0xb0aa5e?await this['_readStreamableResponse'](_0x26c11a,_0x10668d,_0x155dc5):await this['_readStaticResponse'](_0x26c11a,_0x10668d,_0x155dc5);}async['_processAWSRequest'](_0x129e3c,_0x27ea89,_0x3c17eb,_0x334e93){const _0x2cab94=new _0xe8427d(this['_bedrockClientConfig']),_0x20a3e1={'body':JSON['stringify'](_0x129e3c),'contentType':'application/json','accept':'application/json','modelId':_0x27ea89};let _0x16799a;if(_0x3c17eb){const _0x701ae0=new _0x22500e(_0x20a3e1);_0x16799a=await _0x2cab94['send'](_0x701ae0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x16799a,_0x27ea89,_0x334e93);}else{const _0x1555c4=new _0x53e009(_0x20a3e1);_0x16799a=await _0x2cab94['send'](_0x1555c4,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x16799a,_0x27ea89,_0x334e93);}}async['_readAsyncIterableResponse'](_0x5a1a5f,_0x5d5d51,_0x414455){const _0x8014a8=_0x5a1a5f['body'],_0x29d433=new TextDecoder('utf-8');let _0x5ea1a0='';for await(const _0x3f8f8b of _0x8014a8)if(_0x3f8f8b['chunk']){const _0x34ef37=_0x29d433['decode'](_0x3f8f8b['chunk']['bytes']),_0x4e15da=JSON['parse'](_0x34ef37);_0x5ea1a0+=this['_getGeneratedText'](_0x4e15da,_0x5d5d51),_0x414455(_0x5ea1a0);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5f7f80,_0x331676,_0x34ff57){const _0x447b09=_0x5f7f80['body'],_0x1a91f5=new TextDecoder('utf-8'),_0x46eec3=_0x447b09['getReader']();let _0x403f68='',_0x11aae5='',_0x438263=!0x1;for(;!_0x438263;){const {done:_0x91decc,value:_0x5bdbb1}=await _0x46eec3['read']();if(_0x438263=_0x91decc,_0x438263)break;const _0x29edea=(_0x403f68+_0x1a91f5['decode'](_0x5bdbb1))['split']('\x0a')['map'](_0x3ecf41=>{try{return _0x403f68='',JSON['parse'](_0x3ecf41);}catch{return _0x403f68=_0x3ecf41,null;}})['filter'](_0x25f71d=>null!==_0x25f71d);_0x29edea['length']&&(_0x11aae5+=_0x29edea['map'](_0x559280=>this['_getGeneratedText'](_0x559280,_0x331676))['join'](''),_0x34ff57(_0x11aae5));}return Promise['resolve']();}async['_readStaticResponse'](_0x5d525e,_0x4cbfdd,_0x51d06a){let _0x2cde38;return _0x2cde38=_0x5d525e instanceof Response?await _0x5d525e['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x5d525e['body'])),(_0x51d06a(this['_getGeneratedText'](_0x2cde38,_0x4cbfdd)),Promise['resolve']());}['_getGeneratedText'](_0x38c94c,_0x277dc9){switch(this['getModelFamily'](_0x277dc9)){case'anthropic.claude':return _0x38c94c['completion'];case'ai21.j2':return _0x38c94c['completions'][0x0]['data']['text'];case'cohere.command':return _0x38c94c['generations'][0x0]['text'];case'meta.llama':return _0x38c94c['generation'];}}}class Ks extends _0x4b3349{constructor(_0x108624,_0x2da59f={}){super(_0x108624),this['isToggleable']=!0x0,this['set']('side',_0x2da59f['side']||'top');const _0x4462ee=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x53b110(_0x2da59f['class']||[]),_0x4462ee['to']('side',_0x4772fc=>'ck-tab-button_'+_0x4772fc),_0x4462ee['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Us extends _0x3a2ab2{['children'];constructor(_0x11a528,_0x882506={}){super(_0x11a528);const _0x40332f=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x53b110(_0x882506['class']||[]),_0x40332f['to']('class'),_0x40332f['if']('isVisible','ck-hidden',_0x4bd856=>!_0x4bd856)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends _0x3a2ab2{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xd9b842,_0x353e2b={}){super(_0xd9b842),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x353e2b['side']||'top'),this['set']('isMaximized',!0x1);const _0x4f3833=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x53b110(_0x353e2b['class']||[]),_0x4f3833['to']('side',_0x4ed1aa=>'ck-tabs_'+_0x4ed1aa),_0x4f3833['to']('class'),_0x4f3833['to']('isMaximized',_0x535a09=>_0x535a09?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x4f3833['to']('side',_0xb7f8a8=>'ck-tabs__buttons-container_'+_0xb7f8a8)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x4f3833['to']('side',_0x16e372=>'ck-tabs__panels-container_'+_0x16e372)]},'children':this['panelViews']},..._0x53b110(_0x353e2b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x6a2687){const _0x3a6eeb=this['_tabs']['get'](_0x6a2687);return _0x3a6eeb||null;}['addTab'](_0x37d701){const _0x340172=this['_setupButton']({'id':_0x37d701['id'],'label':_0x37d701['buttonLabel'],'icon':_0x37d701['buttonIcon'],'order':_0x37d701['order']}),_0x1b9cdd=new Us(this['locale']);return _0x1b9cdd['render'](),_0x37d701['content']&&_0x1b9cdd['children']['add'](_0x37d701['content']),this['panelViews']['add'](_0x1b9cdd),this['_tabs']['set'](_0x37d701['id'],{'button':_0x340172,'panel':_0x1b9cdd,'order':void 0x0!==_0x37d701['order']?_0x37d701['order']:null}),this['fire']('addTab:'+_0x37d701['id'],{'id':_0x37d701['id'],'button':_0x340172,'panel':_0x1b9cdd}),null===this['activeTab']?this['activateTab'](_0x37d701['id']):this['_hidePanel'](_0x37d701['id']),{'button':_0x340172,'panel':_0x1b9cdd};}['activateTab'](_0xb49a71){if(null!==_0xb49a71&&!this['getTab'](_0xb49a71))throw new _0x599d16('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xb49a71});this['activeTab']!==_0xb49a71&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0xb49a71,_0xb49a71&&this['_showPanel'](_0xb49a71),this['fire']('activateTab:'+_0xb49a71,_0xb49a71));}['showTab'](_0x10544c){if(!this['getTab'](_0x10544c))throw new _0x599d16('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x10544c});this['_showPanel'](_0x10544c),this['_showButton'](_0x10544c),this['fire']('show:'+_0x10544c,_0x10544c);}['hideTab'](_0x5d13ec){if(!this['getTab'](_0x5d13ec))throw new _0x599d16('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5d13ec});const _0x3781d6=this['activeTab'];this['_hidePanel'](_0x5d13ec),this['_hideButton'](_0x5d13ec);const _0x17e84f=this['getTabIds']();_0x3781d6===_0x5d13ec&&_0x17e84f['length']>0x1&&this['activateTab'](_0x17e84f['find'](_0x889d9e=>_0x889d9e!==_0x5d13ec)),this['fire']('hide:'+_0x5d13ec,_0x5d13ec);}['_getPanel'](_0x46b829){const _0x402cf9=this['_tabs']['get'](_0x46b829);return _0x402cf9?_0x402cf9['panel']:null;}['_showPanel'](_0x2af0f6){null!==this['activeTab']&&this['activeTab']!==_0x2af0f6||this['_getPanel'](_0x2af0f6)['show']();}['_hidePanel'](_0x38d08e){const _0x40f7bd=this['_getPanel'](_0x38d08e);_0x40f7bd['isVisible']&&(this['activeTab']===_0x38d08e&&(this['activeTab']=null),_0x40f7bd['hide']());}['_getButton'](_0xc17a26){const _0xce7921=this['_tabs']['get'](_0xc17a26);return _0xce7921?_0xce7921['button']:null;}['_showButton'](_0xb993c8){this['_getButton'](_0xb993c8)['show']();}['_hideButton'](_0x3f2e2c){this['_getButton'](_0x3f2e2c)['hide']();}['_setupButton'](_0x6bbfed){const _0x50c75f=new Ks(this['locale'],{'side':this['side']}),_0x2aa896=this['buttonViews'];if(_0x50c75f['set']({'label':_0x6bbfed['label'],'icon':_0x6bbfed['icon'],'tooltip':!0x0,'withText':!0x0}),_0x50c75f['bind']('isOn')['to'](this,'activeTab',_0x748583=>_0x748583===_0x6bbfed['id']),_0x50c75f['bind']('side')['to'](this,'side'),_0x6bbfed['order']){const _0x4beb10=[...this['_tabs']]['reduce']((_0x2f73dd,_0x5a14f7)=>{const _0x467dc2=_0x5a14f7[0x0],{order:_0x1a6198}=_0x5a14f7[0x1];return!_0x1a6198||_0x1a6198>_0x6bbfed['order']?_0x2f73dd:_0x1a6198>=_0x2f73dd['order']?{'id':_0x467dc2,'order':_0x1a6198}:_0x2f73dd;},{'id':'','order':0x0}),_0xe15a61=_0x2aa896['getIndex'](this['_getButton'](_0x4beb10['id']));_0x2aa896['add'](_0x50c75f,_0xe15a61+0x1);}else _0x2aa896['add'](_0x50c75f);return _0x50c75f['on']('execute',()=>{this['activateTab'](_0x6bbfed['id']);}),_0x50c75f;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ts{constructor(_0x2f259e,_0x5b04f0={}){super(_0x2f259e,_0x5b04f0),this['set']('type',_0x5b04f0['type']||'sidebar'),this['set']('side',_0x5b04f0['side']||'right');const _0x38c9fd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x38c9fd['if']('type','ck-ai-tabs__overlay',_0xda3835=>'overlay'===_0xda3835),_0x38c9fd['if']('type','ck-ai-tabs__sidebar',_0x2bc79c=>'sidebar'===_0x2bc79c)]}}),this['buttonViews']['on']('add',(_0x4c5dab,_0x37051d)=>{_0x37051d['set']('withText',!0x1);});}}class ht extends _0x3e9f85{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3567b2){super(_0x3567b2);const _0x2b9e4a=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x2b9e4a)throw new _0x599d16('ai-tabs-configuration-not-found');if(void 0x0!==_0x2b9e4a['showResizeButton']&&(this['showResizeButton']=_0x2b9e4a['showResizeButton']),'sidebar'!==_0x2b9e4a['type']&&'overlay'!==_0x2b9e4a['type']||_0x2b9e4a['side']&&(this['side']=_0x2b9e4a['side']),'sidebar'===_0x2b9e4a['type']){if(this['container']=_0x2b9e4a['element'],this['set']('type','sidebar'),!this['container'])throw new _0x599d16('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x2b9e4a['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['container']&&this['container']['appendChild'](this['view']['element']),this['context']instanceof ot&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x2abadf){if(_0x2abadf&&this['type']!==_0x2abadf){if(!di['includes'](_0x2abadf))throw new _0x599d16('ai-tabs-unsupported-ui-type');this['type']=_0x2abadf;}}['switchSide'](_0x47f847){if(_0x47f847&&this['side']!==_0x47f847){if(!ui['includes'](_0x47f847))throw new _0x599d16('ai-tabs-unsupported-ui-side');this['side']=_0x47f847;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}function Yn(_0x31a76f,_0x3f9244,_0x3a2878){const t=_0x31a76f['t'];switch(_0x3f9244){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'},_0x3a2878);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi,\x20I\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'The\x20request\x20was\x20aborted.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x3a2878);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.'},_0x3a2878);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.'},_0x3a2878);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x3a2878);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x3a2878);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x3a2878);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x3a2878);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x3a2878);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x3a2878);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x3a2878);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x3a2878);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.'},_0x3a2878);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.'},_0x3a2878);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.'},_0x3a2878);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'},_0x3a2878);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'The\x20suggestion\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20it\x20correctly..'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20suggestions\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20them\x20correctly.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});default:return _0x3f9244;}}class N extends _0x3e9f85{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x441f33){super(_0x441f33),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 _0x3b6997=this['context']['plugins']['get']('CloudServices');if(!_0x3b6997['token'])throw new _0x599d16('ai-missing-token',this);this['_token']=_0x3b6997['token'];}['startConversation'](_0x294d42,_0x58e07d){const _0xfdbe3=this['_sendApiRequest']('/conversations','POST',{'id':_0x294d42,'group':_0x58e07d});return{'getConversation':async()=>(await _0xfdbe3['request'])['json'](),'abortController':_0xfdbe3['abortController']};}['queryAssistant']({message:_0x2f301f,conversationId:_0x389c2f,parts:_0x2dcc27,capabilities:_0x11feaf,model:_0x53abcf,quickActionData:_0x53dad9}){const _0xbb9884={..._0x53dad9&&{'quickActionData':_0x53dad9}},_0x2c3b88={'prompt':_0x2f301f,'content':_0x2dcc27,'model':_0x53abcf,..._0x11feaf&&{'capabilities':_0x11feaf},...Object['keys'](_0xbb9884)['length']>0x0&&{'attributes':_0xbb9884}},_0x5f19e4=this['_sendApiRequest']('/conversations/'+_0x389c2f+'/messages','POST',_0x2c3b88);return{'getStream':async()=>{const _0x241260=(await _0x5f19e4['request'])['body'];return this['_getStreamReader'](_0x241260);},'abortController':_0x5f19e4['abortController']};}['executeCustomAction']({content:_0xd89b70,message:_0x99b673,model:_0x53d497,outputFormat:_0x49fdc3}){const _0x121cc5={'content':[{'type':'text','content':_0xd89b70}],'prompt':_0x99b673,'model':_0x53d497,'outputFormat':_0x49fdc3},_0x3d6626=this['_sendApiRequest']('/actions/custom/calls','POST',_0x121cc5);return{'getStream':async()=>{const _0x379977=(await _0x3d6626['request'])['body'];return this['_getStreamReader'](_0x379977);},'abortController':_0x3d6626['abortController']};}['executeAction']({actionName:_0x4af4ee,content:_0x1597dd,args:_0xc013c3}){const _0x184afb={'content':[{'type':'text','content':_0x1597dd}],'args':_0xc013c3},_0xd0e71a=this['_sendApiRequest']('/actions/system/'+_0x4af4ee+'/calls','POST',_0x184afb);return{'getStream':async()=>{const _0x5e6f32=(await _0xd0e71a['request'])['body'];return this['_getStreamReader'](_0x5e6f32);},'abortController':_0xd0e71a['abortController']};}['uploadFile'](_0x392b31,_0x1df89f,_0x3b3665){const _0x3a4d06=new FormData();_0x3a4d06['append']('file',_0x1df89f,_0x1df89f['name']),_0x3b3665&&_0x3a4d06['append']('attributes',JSON['stringify'](_0x3b3665));const _0xf7ddce=this['_sendApiRequest']('/conversations/'+_0x392b31+'/files','POST',_0x3a4d06);return{'getId':async()=>(await _0xf7ddce['request'])['json'](),'abortController':_0xf7ddce['abortController']};}['fetchDocument'](_0x5d323a,_0xb2f1ab){const _0x59577f=this['_sendApiRequest']('/conversations/'+_0x5d323a+'/documents/'+_0xb2f1ab,'GET');return{'getDocument':async()=>(await _0x59577f['request'])['json'](),'abortController':_0x59577f['abortController']};}['uploadDocument'](_0x41fb4e,_0x332686,_0x4cf121){const _0x27e552={'content':_0x332686};_0x4cf121&&(_0x27e552['attributes']=_0x4cf121);const _0x2f8830=this['_sendApiRequest']('/conversations/'+_0x41fb4e+'/documents','POST',_0x27e552);return{'getId':async()=>(await _0x2f8830['request'])['json'](),'abortController':_0x2f8830['abortController']};}['fetchConversations'](_0x535c9a,_0xa0f260){const _0x18d567=new URLSearchParams();_0x18d567['append']('excludeEmpty','true'),_0x18d567['append']('limit','100'),_0x18d567['append']('group',_0x535c9a),_0xa0f260&&_0x18d567['append']('search',_0xa0f260);const _0x581eb1=this['_sendApiRequest']('/conversations?'+_0x18d567['toString'](),'GET');return{'getConversations':async()=>{const _0x171d61=await _0x581eb1['request'];return(await _0x171d61['json']())['items'];},'abortController':_0x581eb1['abortController']};}['deleteConversation'](_0x245128){const _0x24ffc2=this['_sendApiRequest']('/conversations/'+_0x245128,'DELETE');return{'execute':async()=>{await _0x24ffc2['request'];},'abortController':_0x24ffc2['abortController']};}['updateConversation'](_0x586dad,_0x29b81d){const _0x2b196b=this['_sendApiRequest']('/conversations/'+_0x586dad,'PATCH',_0x29b81d);return{'getResult':async()=>(await _0x2b196b['request'],_0x29b81d),'abortController':_0x2b196b['abortController']};}['fetchConversation'](_0x41eeff){const _0x460936=this['_sendApiRequest']('/conversations/'+_0x41eeff,'GET');return{'getConversation':async()=>(await _0x460936['request'])['json'](),'abortController':_0x460936['abortController']};}['fetchConversationMessages'](_0x2eb141){const _0x3d3f37=this['_sendApiRequest']('/conversations/'+_0x2eb141+'/messages','GET');return{'getMessages':async()=>{const _0x2333ab=await _0x3d3f37['request'];return(await _0x2333ab['json']())['items'];},'abortController':_0x3d3f37['abortController']};}['uploadUrl'](_0x48b28a,_0x19a06e,_0x12828d){const _0x7138e7=this['_sendApiRequest']('/conversations/'+_0x48b28a+'/web-resources','POST',{'url':_0x19a06e,'attributes':_0x12828d});return{'getId':async()=>(await _0x7138e7['request'])['json'](),'abortController':_0x7138e7['abortController']};}['getModels'](){const _0x158e77=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x2ea936=await(await _0x158e77['request'])['json'](),_0x3a6e62=_0x2ea936['items']['map'](_0x2c8dd8=>({..._0x2c8dd8,'description':Yn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x2c8dd8['id']['toUpperCase']())}));return{..._0x2ea936,'items':_0x3a6e62};},'abortController':_0x158e77['abortController']};}['deleteFile'](_0x5f1c9b,_0x208c28){const _0x1359a1=this['_sendApiRequest']('/conversations/'+_0x5f1c9b+'/files/'+_0x208c28,'DELETE');return{'execute':async()=>{await _0x1359a1['request'];},'abortController':_0x1359a1['abortController']};}['deleteDocument'](_0x125e6b,_0x320e8f){const _0x77d214=this['_sendApiRequest']('/conversations/'+_0x125e6b+'/documents/'+_0x320e8f,'DELETE');return{'execute':async()=>{await _0x77d214['request'];},'abortController':_0x77d214['abortController']};}['deleteWebResource'](_0xac1f35,_0x4796cf){const _0x9e2591=this['_sendApiRequest']('/conversations/'+_0xac1f35+'/web-resources/'+_0x4796cf,'DELETE');return{'execute':async()=>{await _0x9e2591['request'];},'abortController':_0x9e2591['abortController']};}['callSystemReview']({reviewName:_0x3b7ce2,content:_0x170ea0,args:_0x66c118}){const _0x433b63=this['_sendApiRequest']('/reviews/system/'+_0x3b7ce2+'/calls','POST',{'content':[{'type':'text','content':_0x170ea0}],'args':_0x66c118});return{'getStream':async()=>{const _0x5ebb60=(await _0x433b63['request'])['body'];return this['_getStreamReader'](_0x5ebb60);},'abortController':_0x433b63['abortController']};}['callCustomReview']({content:_0x32b5b6,prompt:_0x9c5460,model:_0x379390}){const _0xb79d72=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x32b5b6}],'prompt':_0x9c5460,'model':_0x379390});return{'getStream':async()=>{const _0x2207b2=(await _0xb79d72['request'])['body'];return this['_getStreamReader'](_0x2207b2);},'abortController':_0xb79d72['abortController']};}['_sendApiRequest'](_0x51e2ac,_0x3315ca,_0xcb370d){const _0x5c995c=new AbortController(),_0x111b8=_0xcb370d instanceof FormData,_0x27dde6={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0xcb370d&&!_0x111b8&&(_0x27dde6['Content-Type']='application/json');const _0x21eb1e={'method':_0x3315ca,'headers':_0x27dde6,'signal':_0x5c995c['signal']};return _0xcb370d&&(_0x21eb1e['body']=_0x111b8?_0xcb370d:JSON['stringify'](_0xcb370d)),{'request':fetch(''+this['_apiUrl']+_0x51e2ac,_0x21eb1e)['catch'](_0x5d2030=>{this['_handleError'](_0x5d2030);})['then'](_0x5f4e3a=>{if(!_0x5f4e3a['ok'])throw new _0x599d16('ai-request-failed',this);return _0x5f4e3a;}),'abortController':_0x5c995c};}async*['_getStreamReader'](_0x534208){const _0x3d7ded=[],_0x167e18=_0x534208['getReader'](),_0x40e05f=wt({'onError':_0x2e74ee=>{this['_handleError'](_0x2e74ee);},'onEvent':_0x2dfe23=>{_0x2dfe23['data']=JSON['parse'](_0x2dfe23['data']),_0x3d7ded['push'](_0x2dfe23);}});try{let _0x5b357b=!0x1;for(;!_0x5b357b;){const {done:_0x4e1f37,value:_0x268602}=await _0x167e18['read']();_0x4e1f37&&(_0x5b357b=!0x0),_0x40e05f['feed'](this['_decoder']['decode'](_0x268602,{'stream':!0x0})),yield*_0x3d7ded,_0x3d7ded['length']=0x0;}}catch(_0x446f02){this['_handleError'](_0x446f02);}finally{_0x167e18['releaseLock'](),_0x40e05f['reset']();}}['_handleError'](_0x2946ba){if(_0x2946ba instanceof _0x599d16)throw _0x2946ba;if(_0x2946ba instanceof Error&&'AbortError'===_0x2946ba['name'])throw new _0x599d16('ai-request-aborted',this,{'originalError':_0x2946ba});throw new _0x599d16('ai-request-failed',this,{'originalError':_0x2946ba});}}function As(_0x3e41f3,_0x3fec35){const _0xf907ff=new _0x4b3349(_0x3e41f3),_0x2a5515=Yn(_0x3e41f3,'AI_TABS_LABEL_MINIMIZE'),_0x2be172=Yn(_0x3e41f3,'AI_TABS_LABEL_MAXIMIZE');return _0xf907ff['set']({'withText':!0x1,'icon':_0x1aac40,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0xf907ff['bind']('label')['to'](_0x3fec35,'isMaximized',_0x2fe5fd=>_0x2fe5fd?_0x2a5515:_0x2be172),_0xf907ff['bind']('icon')['to'](_0x3fec35,'isMaximized',_0x47017=>_0x47017?_0xeabb22:_0x1aac40),_0xf907ff['bind']('isOn')['to'](_0x3fec35,'isMaximized'),_0xf907ff['on']('execute',()=>{_0x3fec35['fire']('resizeTabs');}),_0xf907ff;}function Oe(_0x111dd3){return _0x218393(_0x111dd3);}function Ct(_0x2c2e7a){return _0x49a0ef(_0x2c2e7a);}function It(_0x50afd2,_0x416a08,_0x238591){const _0x3513f2=null!==_0x416a08?_0x4071f7=>_0x4071f7['attribs'][_0x50afd2]===_0x416a08:_0x4271a0=>Boolean(_0x4271a0['attribs'][_0x50afd2]);return mt(_0x4f1e29=>_0x2c7bda(_0x4f1e29)&&_0x3513f2(_0x4f1e29),_0x238591);}function ze(_0xbb6c0c,_0x38576d,_0xdf164){const _0x1e1602=null!==_0x38576d?_0x1d034a=>_0x1d034a['attribs'][_0xbb6c0c]===_0x38576d:_0x4e4fac=>Boolean(_0x4e4fac['attribs'][_0xbb6c0c]);return _0x524e18(_0x4d0eaf=>_0x2c7bda(_0x4d0eaf)&&_0x1e1602(_0x4d0eaf),_0xdf164);}function ft(_0x310a5e,_0x4d7eee){return _0x310a5e&&_0x2c7bda(_0x310a5e)?_0x310a5e['attribs'][_0x4d7eee]:null;}function $e(_0x3be62b,_0x19b29d,_0x56b2e6){_0x2c7bda(_0x3be62b)&&(null===_0x56b2e6?delete _0x3be62b['attribs'][_0x19b29d]:_0x3be62b['attribs'][_0x19b29d]=_0x56b2e6);}function Ke(_0x30b80e,_0x2fb375,_0x191524){const _0x523e44=_0x2fb375['cloneNode'](!0x0);'beforebegin'===_0x191524?_0x4522c2(_0x30b80e,_0x523e44):'afterbegin'===_0x191524?to(_0x30b80e,_0x523e44):'beforeend'===_0x191524?_0x2e740b(_0x30b80e,_0x523e44):'afterend'===_0x191524&&_0x1ce7f1(_0x30b80e,_0x523e44);}function Ge(_0x5f0bd3){const _0x4cb2fa=[];let _0x525c20=_0x5f0bd3;for(;_0x525c20;)_0x525c20=_0x13688c(_0x525c20),_0x525c20&&_0x4cb2fa['push'](_0x525c20);return _0x4cb2fa;}function $n(_0x2c80ac){return _0x2c80ac['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Pi(_0x6fc544){let _0x2e44e6=0x0;for(;_0x6fc544['parentNode'];)_0x6fc544=_0x6fc544['parentNode'],_0x2e44e6++;return _0x2e44e6;}function Gi(_0x487b59){const _0x13e441=[];let _0x13f44c=_0x487b59['nextSibling'];for(;_0x13f44c;)_0x13e441['push'](_0x13f44c),_0x13f44c=_0x13f44c['nextSibling'];_0x13e441['forEach'](_0x25c7e6=>{_0x38cbf5(_0x25c7e6);});}class We extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x3491c8(){['_m2html'];constructor(){super(),this['_m2html']=new _0xb9c5ff();}['convertMarkdownToHTML'](_0x2a6aa5){const _0x5238a4=this['_m2html']['parse'](_0x2a6aa5);return this['parseAndNormalizeHTML'](_0x5238a4);}['parseAndNormalizeHTML'](_0x47a0c0){return this['_parseHTML'](_0x47a0c0);}['_parseHTML'](_0x20f409){const _0x4c942e=Oe('<dummy>'+_0x20f409['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4c942e['children']=_0x4c942e['children'][0x0]['children'],_0x4c942e;}}class qe extends/* #__PURE__ -- @preserve */
|
|
26
|
+
_0x3491c8(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x22e59d){super(),this['_generateUid']=_0x22e59d||_0x190955;}['merge'](_0x20ceb8,_0x1af242,_0x1e94ce){const _0x58335f=_0x20ceb8['cloneNode'](!0x0);if(0x0===_0x1af242['childNodes']['length']){const _0x3d52d0=[];return ze('data-id','new-element',_0x58335f)['forEach'](_0x188db5=>{const _0x46f653=this['_generateUid']();$e(_0x188db5,'data-id',_0x46f653),_0x3d52d0['push'](_0x46f653);}),this['_removeSpecialComments'](_0x58335f),{'parsedContent':_0x58335f,'newNodeIds':_0x3d52d0,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1e94ce&&_0x1e94ce['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x58335f),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(ze('data-id',null,_0x1af242)['map'](_0xafaa59=>ft(_0xafaa59,'data-id'))['filter'](_0x2d5ebb=>!!_0x2d5ebb));let _0x536c04=-0x1,_0x26e7f4=!0x1;const _0x37a211=_0x58335f['childNodes'],_0x3f865c=Array['from'](_0x37a211)['filter'](_0x1f8f11=>!(0x3===_0x1f8f11['nodeType']&&''===Ct(_0x1f8f11)['trim']())),_0x336ac4=_0x3f865c['length'];for(let _0x49d03a=0x0;_0x49d03a<_0x336ac4;_0x49d03a++){const _0x2f8604=_0x3f865c[_0x49d03a],_0x30bddb=_0x3f865c[_0x49d03a+0x1];if(this['_isNewNode'](_0x2f8604)){if(-0x1===_0x536c04&&(_0x536c04=_0x49d03a),this['_markWrappedElements'](_0x2f8604),!this['_isNewNode'](_0x30bddb)){const [_0x3a9917,_0x5ca803]=this['_findReferenceNode'](_0x2f8604,_0x26e7f4,_0x1af242);if(_0x3a9917){const _0x1829e9=Array['from'](_0x3f865c)['slice'](_0x536c04,_0x49d03a+0x1);this['_insertNodes'](_0x3a9917,_0x1829e9,_0x5ca803),_0x536c04=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2f8604))_0x26e7f4=!0x0;else{if(this['_isExistingNode'](_0x2f8604)){const _0x4a23aa=ft(_0x2f8604,'data-id');if(_0x4a23aa&&this['_existingDataIds']['has'](_0x4a23aa)){const _0x111155=It('data-id',_0x4a23aa,_0x1af242);this['_replaceNode'](_0x111155,_0x2f8604);}if(this['_touchedNodesState']['removedIds']['includes'](_0x4a23aa)){const _0x1fa9f5=this['_touchedNodesState']['removedIds']['indexOf'](_0x4a23aa);this['_touchedNodesState']['removedIds']['splice'](_0x1fa9f5,0x1);}}else{if(this['_isDelNode'](_0x2f8604)){const _0x36b2bc=ft(_0x2f8604,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x36b2bc)||this['_storeDeletedElementIds'](_0x2f8604);}}}}}for(const _0x474e88 of this['_touchedNodesState']['removedIds']){const _0xc806a0=It('data-id',_0x474e88,_0x1af242);if(_0xc806a0){if(_0x1e94ce&&_0x1e94ce['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x474e88;const _0x5a15bf=_0x1e94ce['replaceRemovedWith']['cloneNode'](!0x0);$e(_0x5a15bf,'data-id',_0x474e88),$e(_0x5a15bf,'data-removed','true'),_0x43b5c3(_0xc806a0,_0x5a15bf);}else _0x38cbf5(_0xc806a0);}}if(ze('data-wrapped-id',null,_0x1af242)['forEach'](_0x5c10b5=>{const _0x1631a5=It('data-id',ft(_0x5c10b5,'data-wrapped-id'),_0x1af242);var _0x45d31f,_0xef488d;_0x1631a5&&(_0xef488d=_0x5c10b5,_0x38cbf5(_0x45d31f=_0x1631a5),_0x43b5c3(_0xef488d,_0x45d31f));}),ze('data-id','new-element',_0x1af242)['forEach'](_0x1262de=>{const _0x388605=this['_getUid'](_0x1262de);$e(_0x1262de,'data-id',_0x388605),this['_touchedNodesState']['newIds']['push'](_0x388605);}),this['_removeSpecialComments'](_0x1af242),_0x1e94ce&&_0x1e94ce['markUnstableElements']&&this['_markUnstableElements'](_0x1af242,_0x1e94ce['markUnstableElementsDepth']||0x0),_0x1e94ce&&_0x1e94ce['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x30ec0a=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1af242);for(;_0x30ec0a;)Gi(_0x30ec0a),_0x30ec0a=_0x30ec0a['parentNode'];}return{'parsedContent':_0x1af242,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0xa3e200,_0x415e30,_0x534efe){for(const _0x27db79 of _0x415e30){const _0x2bf170=this['_getUid'](_0x27db79);$e(_0x27db79,'data-id',_0x2bf170),this['_touchedNodesState']['newIds']['push'](_0x2bf170),this['_touchedNodesState']['lastTouchedId']=_0x2bf170;}const _0x34a727='afterbegin'===_0x534efe||'afterend'===_0x534efe?_0x415e30['reverse']():_0x415e30;for(const _0x3b8200 of _0x34a727)Ke(_0xa3e200,_0x3b8200,_0x534efe);}['_replaceNode'](_0x48a45d,_0x20bbf3){if(!_0x48a45d)return;if(_0x2e1985=_0x20bbf3,$n(Ct(_0x48a45d))===$n(Ct(_0x2e1985)))return;var _0x2e1985;const _0x1a67d5=this['_getUid'](_0x48a45d);$e(_0x20bbf3,'data-id',_0x1a67d5),this['_touchedNodesState']['modifiedIds']['push'](_0x1a67d5),this['_touchedNodesState']['lastTouchedId']=_0x1a67d5,_0x43b5c3(_0x48a45d,_0x20bbf3['cloneNode'](!0x0));}['_findReferenceNode'](_0x4e57fe,_0x21d1c3,_0x47f0c6){const _0x11f891=this['_findPrevElementWithDataId'](_0x4e57fe,!0x1);if(_0x11f891){const _0x1affcd=this['_getNodeDataId'](_0x11f891),_0x1c042e=It('data-id',_0x1affcd,_0x47f0c6);if(_0x1c042e)return[_0x1c042e,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1affcd);}const _0xaeff50=this['_findNextElementWithDataId'](_0x4e57fe,!0x1);if(_0xaeff50){const _0xbbbbc0=this['_getNodeDataId'](_0xaeff50),_0x14a85f=It('data-id',_0xbbbbc0,_0x47f0c6);if(_0x14a85f)return[_0x14a85f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0xbbbbc0);}return _0x21d1c3?_0x4e57fe['nextSibling']?this['_findFallbackReferenceNode'](_0x4e57fe,_0x47f0c6):[_0x47f0c6['childNodes'][_0x47f0c6['childNodes']['length']-0x1],'afterend']:[_0x47f0c6['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3258e8,_0xce822){const _0x2e8004=[],_0x2bd8aa=this['_findPrevElementWithDataId'](_0x3258e8,!0x0);if(_0x2bd8aa){const _0x483c9f=It('data-id',this['_getNodeDataId'](_0x2bd8aa),_0xce822);_0x483c9f&&_0x2e8004['push']([_0x483c9f,'afterend']);}const _0x1be1fe=this['_findNextElementWithDataId'](_0x3258e8,!0x0);if(_0x1be1fe){const _0x4c9c5b=It('data-id',this['_getNodeDataId'](_0x1be1fe),_0xce822);_0x4c9c5b&&_0x2e8004['push']([_0x4c9c5b,'beforebegin']);}if(_0x2e8004['length']>0x1)return Pi(_0x2e8004[0x0][0x0])<=Pi(_0x2e8004[0x1][0x0])?_0x2e8004[0x0]:_0x2e8004[0x1];return 0x1===_0x2e8004['length']?_0x2e8004[0x0]:[_0xce822['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x36073c,_0x3050c1){let _0x1dddb8=_0x36073c['nextSibling'],_0x44150f=null,_0x5dff5b=!0x1;for(;_0x1dddb8;){if(_0x10bbce(_0x1dddb8)){if(this['_isDelNode'](_0x1dddb8)&&(_0x44150f=_0x1dddb8),this['_isExistingContentComment'](_0x1dddb8)&&_0x3050c1&&!_0x5dff5b){_0x5dff5b=!0x0,_0x1dddb8=_0x1dddb8['nextSibling'];continue;}break;}const _0x2da3b7=ft(_0x1dddb8,'data-id');if(_0x2da3b7&&'new-element'!==_0x2da3b7&&this['_existingDataIds']['has'](_0x2da3b7)){_0x44150f=_0x1dddb8;break;}_0x1dddb8=_0x1dddb8['nextSibling'];}return _0x44150f;}['_findPrevElementWithDataId'](_0x15db33,_0x280600){let _0x55dfac=_0x15db33['previousSibling'],_0x48f9cd=null,_0x1c3014=!0x1;for(;_0x55dfac;){if(_0x10bbce(_0x55dfac)){if(this['_isDelNode'](_0x55dfac)&&(_0x48f9cd=_0x55dfac),this['_isExistingContentComment'](_0x55dfac)&&_0x280600&&!_0x1c3014){_0x1c3014=!0x0,_0x55dfac=_0x55dfac['previousSibling'];continue;}break;}const _0x2e2e4b=ft(_0x55dfac,'data-id');if(_0x2e2e4b&&'new-element'!==_0x2e2e4b&&this['_existingDataIds']['has'](_0x2e2e4b)){_0x48f9cd=_0x55dfac;break;}_0x55dfac=_0x55dfac['previousSibling'];}return _0x48f9cd;}['_markWrappedElements'](_0x2ef3af){_0x2c7bda(_0x2ef3af)&&ze('data-id',null,_0x2ef3af)['forEach'](_0x499a00=>{this['_isExistingNode'](_0x499a00)&&!this['_hasWrappedParent'](_0x499a00)&&($e(_0x499a00,'data-wrapped-id',ft(_0x499a00,'data-id')),$e(_0x499a00,'data-id',null));});}['_getNodeDataId'](_0x4d972d){if(!_0x4d972d)return null;if(_0x2c7bda(_0x4d972d))return ft(_0x4d972d,'data-id');if(_0x10bbce(_0x4d972d)){const _0x18e17c=Ct(_0x4d972d)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x18e17c&&_0x18e17c[0x1])return _0x18e17c[0x1];}return null;}['_storeDeletedElementIds'](_0x42b493){if(_0x10bbce(_0x42b493)){const _0xa7dd9=Ct(_0x42b493)['match'](/removed[\s*-]data-id="([^"]+)"/);_0xa7dd9&&_0xa7dd9[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0xa7dd9[0x1]);}}['_getUid'](_0xbb1f79){return this['_isExistingNode'](_0xbb1f79)?ft(_0xbb1f79,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x51f1d3){(function(_0x260add){return _0x47fa7a(_0x5c1f28=>_0x10bbce(_0x5c1f28),_0x260add,!0x0,0x1/0x0);}(_0x51f1d3)['filter'](_0x4139b7=>this['_isDelNode'](_0x4139b7)||this['_isExistingContentComment'](_0x4139b7))['forEach'](_0x46603e=>{_0x38cbf5(_0x46603e);}));}['_markLastTagElementUnstable'](_0x14eee1){const _0x4979e3=_0x14eee1['childNodes'],_0x10ac6f=_0x4979e3[_0x4979e3['length']-0x1];_0x10ac6f&&_0x2c7bda(_0x10ac6f)&&$e(_0x10ac6f,'data-unstable','true');}['_markUnstableElements'](_0x253df1,_0x217884){const _0xab104c=It('data-unstable','true',_0x253df1);if(!_0xab104c)return;const _0xe9ee7e=Ge(_0xab104c)['slice'](0x0,-0x1),_0x5b172f=_0xe9ee7e['length'];let _0x1cc9c6=_0xab104c;if(_0x5b172f>_0x217884){let _0x1b88ce=_0x5b172f,_0x2587f3=null;for(;_0x1b88ce>_0x217884&&_0x1b88ce>=0x0;)_0x1b88ce--,_0x2587f3=_0xe9ee7e[_0x1b88ce];_0x2587f3&&(_0x1cc9c6=_0x2587f3,$e(_0xab104c,'data-unstable',null),$e(_0x2587f3,'data-unstable','true'));}else{if(_0x5b172f<_0x217884){let _0x2687dd=_0x5b172f,_0x175267=_0xab104c;for(;_0x2687dd<_0x217884;){const _0x4a3826=_0x175267['childNodes']['filter'](_0x1b66e7=>_0x2c7bda(_0x1b66e7));if(0x0===_0x4a3826['length'])break;_0x2687dd++,_0x175267=_0x4a3826[_0x4a3826['length']-0x1];}_0x175267&&(_0x1cc9c6=_0x175267,$e(_0xab104c,'data-unstable',null),$e(_0x175267,'data-unstable','true'));}}let _0x355a32=_0x1cc9c6;for(;_0x355a32;){for(;_0x355a32['nextSibling'];)_0x355a32=_0x355a32['nextSibling'],_0x2c7bda(_0x355a32)&&$e(_0x355a32,'data-unstable','true');_0x355a32=_0x355a32['parentNode'];}}['_isNewNode'](_0x4755be){return Boolean('new-element'===ft(_0x4755be,'data-id'));}['_isExistingNode'](_0x5b03da){return Boolean((ft(_0x5b03da,'data-id')||'')['length']>0x0&&'new-element'!==ft(_0x5b03da,'data-id'));}['_isDelNode'](_0x280d11){return!!_0x280d11&&Boolean(_0x10bbce(_0x280d11)&&Ct(_0x280d11)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x308197){let _0x7d0205=_0x308197['parentNode'];for(;_0x7d0205;){if(ft(_0x7d0205,'data-wrapped-id'))return!0x0;_0x7d0205=_0x7d0205['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x5ee1d0){return Boolean(_0x10bbce(_0x5ee1d0)&&Ct(_0x5ee1d0)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const qn=['modification-delta','text-delta'],Qn=['reasoning'];class fe extends _0x3491c8(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x464e78,content:_0x20f65='',isDone:_0x4f880f=!0x1,interactionId:_0x352f3c,areActionsDisabled:_0x35e86f,documentContextContent:_0x254633,editor:_0x1f86c4}){super(),this['id']=_0x190955(),this['interactionId']=_0x352f3c,this['type']=_0x464e78,this['areActionsDisabled']=!!_0x35e86f,this['editor']=_0x1f86c4,this['aiResponseParser']=new We(),this['aiResponseApplier']=new qe(),this['documentContextContent']=Oe(_0x254633||''),this['set']('isDone',_0x4f880f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x20f65);}['appendContent'](_0x2f09ed){this['set']('content',this['content']+_0x2f09ed);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b6899,_0x34ad07){this['changeGroups'][_0x5b6899]['state']=_0x34ad07,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b6899,'state':_0x34ad07});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xfd77bb=this['changeGroups'];this['updateChangeGroups']();const _0xe02043=this['_getDifferentChangeGroups'](_0xfd77bb,this['changeGroups']);(_0xe02043['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0xe02043);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x54a62c,_0x1ba7ce){const _0xb1fb0f=[];for(const _0x36d4cb of _0x1ba7ce){const _0x232fe4=_0x54a62c[_0x36d4cb['index']];_0x232fe4?_0x232fe4['changes']['length']!==_0x36d4cb['changes']['length']?_0xb1fb0f['push'](_0x36d4cb):_0x232fe4['changes']['forEach']((_0x1b2028,_0x167f4)=>{const _0x352e8f=_0x36d4cb['changes'][_0x167f4];_0x1b2028['id']!==_0x352e8f['id']&&_0xb1fb0f['push'](_0x36d4cb);}):_0xb1fb0f['push'](_0x36d4cb);}return _0xb1fb0f;}['updateChangeGroups'](){const _0x3a513b=new _0x309e49('p',{},[new _0x309e49('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x1594f5('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x13c91f=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x3a513b,'cutAfterLastChange':!this['isDone']});if(!_0x13c91f['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x13c91f['parsedContent'];let _0x3532e1=[];if(_0x524e18(_0xcd2ae8=>{const _0x262039=ft(_0xcd2ae8,'data-id');if(!_0x262039||!_0x1b514a(_0x262039))return!0x1;const _0x1e9341=[_0xcd2ae8,...Ge(_0xcd2ae8)]['at'](-0x2);if(_0xcd2ae8!=_0x1e9341){const _0x27b731=ft(_0x1e9341,'data-id');_0x1b514a(_0x27b731)||(_0x3532e1['push']({'node':_0x1e9341,'id':_0x27b731,'type':'modified'}),_0x13c91f['modifiedNodeIds']['push'](_0x27b731));}else _0x13c91f['modifiedNodeIds']['includes'](_0x262039)?_0x3532e1['push']({'node':_0xcd2ae8,'type':'modified','id':_0x262039}):_0x13c91f['newNodeIds']['includes'](_0x262039)?_0x3532e1['push']({'node':_0xcd2ae8,'type':'new','id':_0x262039,'anchorId':ft(_0xcd2ae8['previousSibling'],'data-id')}):_0x3532e1['push']({'node':_0xcd2ae8,'type':'removed','id':_0x262039});return!0x0;},this['parsedMergedContent']),_0x3532e1=_0x3532e1['filter'](({node:_0xbf3ac3})=>[...Ge(_0xbf3ac3),_0xbf3ac3]['every'](_0x52834e=>!ft(_0x52834e,'data-unstable'))),0x0==_0x3532e1['length'])return;const _0x1a035b=[[_0x3532e1[0x0]]];for(let _0x23a715=0x1;_0x23a715<_0x3532e1['length'];_0x23a715++){const _0x2258f5=_0x1a035b[_0x1a035b['length']-0x1],_0x3d28c0=_0x2258f5[_0x2258f5['length']-0x1];_0x3532e1[_0x23a715]['node']['previousSibling']==_0x3d28c0['node']&&'modified'!=_0x3532e1[_0x23a715]['type']&&'modified'!=_0x3d28c0['type']?_0x2258f5['push'](_0x3532e1[_0x23a715]):_0x1a035b['push']([_0x3532e1[_0x23a715]]);}for(const _0x1443c2 of _0x1a035b){const _0x474f58=_0x1443c2[0x0],_0xd690cf=_0x1443c2[_0x1443c2['length']-0x1],_0x58045d=_0x28fe44(_0x474f58['node']['previousSibling']);_0x58045d&&_0x1443c2['unshift'](_0x58045d);const _0x110e7b=_0x28fe44(_0xd690cf['node']['nextSibling']);_0x110e7b&&_0x1443c2['push'](_0x110e7b);}function _0x1b514a(_0x3e5412){return _0x13c91f['modifiedNodeIds']['includes'](_0x3e5412)||_0x13c91f['newNodeIds']['includes'](_0x3e5412)||_0x13c91f['removedNodeIds']['includes'](_0x3e5412);}function _0x28fe44(_0x22cf6f){if(_0x22cf6f&&ft(_0x22cf6f,'data-id')&&!ft(_0x22cf6f,'data-unstable')){const _0x3d7840=ft(_0x22cf6f,'data-id');if(!_0x1b514a(_0x3d7840))return{'node':_0x22cf6f,'type':'context','id':_0x3d7840};}return null;}this['changeGroups']=_0x1a035b['map']((_0x540a9b,_0x13f045)=>({'changes':_0x540a9b,'state':'pending','index':_0x13f045}));}}function Fi(_0x338426){return Object['values'](qn)['includes'](_0x338426);}function Di(_0x5a5610){return Qn['includes'](_0x5a5610);}function Ui(_0x36dc17){return'conversation-title'===_0x36dc17;}function qi(_0x2cbec3){return'source'===_0x2cbec3;}const ge=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class pe extends Mt(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x2c7fe7,editor:_0x543990}){super(),this['id']=_0x190955(),this['connector']=_0x2c7fe7,this['isStopped']=!0x0,this['editor']=_0x543990;}async['start'](){let _0x5b4959;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x55b858=await this['currentRequest']['getStream'](),_0x1a3d04=[];for await(const _0x12814b of _0x55b858){if(this['isStopped'])return;if('error'===_0x12814b['event'])return void this['fire']('error',{'error':new _0x599d16('ai-chat-interaction-error',this)});Ui(_0x12814b['event'])&&this['setConversationTitle'](_0x12814b['data']['conversationTitle'],!0x0),qi(_0x12814b['event'])?_0x1a3d04['push'](_0x12814b['data']['source']):Fi(_0x12814b['event'])?(_0x12814b['event']!==_0x5b4959&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x12814b['event'],'interactionId':this['id']}),_0x1a3d04['length']>0x0&&(this['currentReply']['sources']=_0x1a3d04['splice'](0x0)),_0x5b4959=_0x12814b['event']),this['currentReply']['appendContent'](_0x12814b['data']['textDelta'])):Di(_0x12814b['event'])||_0x1f6f14('ai-interaction-invalid-event-type',{'chunk':_0x12814b});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1bb5aa){return this['replies']['find'](_0x13eca3=>_0x13eca3['id']===_0x1bb5aa);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4f4526=>_0x4f4526['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x109d55){const _0x54bc7a=new fe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x109d55});return this['replies']['push'](_0x54bc7a),_0x54bc7a['delegate'](...ge)['to'](this),this['fire']('replyCreated',_0x54bc7a),_0x54bc7a;}['setConversationTitle'](_0x4717f1,_0x52f106=!0x1){this['fire']('setConversationTitle',_0x4717f1,_0x52f106);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var xe=function(_0x77ebae){return _0x77ebae['FILE']='file',_0x77ebae['DOCUMENT']='document',_0x77ebae['URL']='web-resource',_0x77ebae['TEXT']='text',_0x77ebae['SELECTION']='selection',_0x77ebae;}({}),Ie=function(_0xc3042e){return _0xc3042e['TEXT']='text',_0xc3042e['MARKDOWN']='markdown',_0xc3042e['HTML']='html',_0xc3042e;}({});const wi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class mi extends _0x3491c8(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x493e13,config:_0x5e1407,ownerId:_0x3f3251}){super(),this['_connector']=_0x493e13,this['_config']=_0x5e1407,this['_ownerId']=_0x3f3251;}['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'](_0x320dfd){const _0x4d298e=await this['_createContextItemFromContent'](_0x320dfd);return this['_addToConversationContextItem'](_0x4d298e),'current-document'===_0x4d298e['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4d298e;}async['_createContextItemFromContent'](_0x59f655){if(_0x59f655['type']===xe['DOCUMENT']){const _0x34e8d9=await this['_connector']['fetchDocument'](this['_ownerId'],_0x59f655['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x59f655['type'],'content':_0x34e8d9['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x34e8d9['attributes']?.['version'],'sessionId':_0x34e8d9['attributes']?.['sessionId']};}return{'id':_0x59f655['id'],'uiId':_0x59f655['id'],'label':_0x59f655['attributes']?.['label']||_0x59f655['name']||_0x59f655['url']||_0x59f655['id'],'type':_0x59f655['type'],..._0x59f655?.['attributes']?.['resourceId']?{'resourceId':_0x59f655['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1051d0){const _0x19589a=this['_pendingContextItems']['get'](_0x1051d0);_0x19589a?.['isReadOnly']||this['_removeContextItem'](_0x1051d0);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x5d4184 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x5d4184['uiId']);const _0x171f47=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x171f47&&this['_addContextItem']({..._0x171f47,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x8192d4){for(const _0x40dcea of _0x8192d4['values']())this['_addToConversationContextItem'](_0x40dcea);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'](_0x258840){return Array['from'](_0x258840['values']())['map'](_0x404aa3=>this['_mapContextItemToRequestData'](_0x404aa3))['filter'](_0x5af0cf=>null!==_0x5af0cf);}async['addFilesToContext'](_0x320d52,_0x3d9668,_0x13b88e=xe['FILE']){const _0x28689f='files-'+_0x190955();this['_startUploadOperation'](_0x28689f);try{await Promise['all'](_0x320d52['map'](async _0x80d692=>{const _0x13bf00='file-'+_0x190955(),_0x383268=_0x512f25(_0x80d692['name']);try{this['_addContextItem']({'type':_0x13b88e,'label':_0x3d9668?.['label']||_0x383268,'uiId':_0x13bf00,'resourceId':_0x3d9668?.['resourceId']},!0x0);const _0x22444c=this['_connector']['uploadFile'](this['_ownerId'],_0x80d692,_0x3d9668);this['_ongoingUploads']['set'](_0x13bf00,_0x22444c['abortController']);const {id:_0x5596fb}=await _0x22444c['getId']();this['_ongoingUploads']['delete'](_0x13bf00),this['_finishContextItemLoading']({'type':_0x13b88e,'id':_0x5596fb,'label':_0x3d9668?.['label']||_0x383268,'uiId':_0x13bf00,'resourceId':_0x3d9668?.['resourceId']},!0x1);}catch(_0x3bc88c){this['_ongoingUploads']['delete'](_0x13bf00);if(!_0x3bc88c['message']['startsWith']('ai-request-aborted')){const _0x10e19a=new _0x599d16('ai-chat-file-upload-failed',null,{'fileName':_0x383268});_0x10e19a['stack']=_0x3bc88c['stack'],this['fire']('error',{'error':_0x10e19a,'fileName':_0x383268});}this['_removeContextItem'](_0x13bf00);}}));}finally{this['_finishUploadOperation'](_0x28689f);}}['addCurrentDocumentToContext'](_0x256c8e){if(this['isCurrentDocumentInContext']())return;const _0x34b37f={'type':xe['DOCUMENT'],'uiId':'current-document','label':_0x256c8e,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x34b37f);}async['updateCurrentDocument'](_0x4891b9,_0x2a7a29,_0x536e08,_0x5111c0){const _0x27de47=this['_pendingContextItems']['get']('current-document');if(_0x27de47&&_0x4891b9){_0x27de47['selection']=_0x5111c0?_0x5111c0['map'](_0x407745=>({'start':_0x407745['start'],'end':_0x407745['end']})):[];try{if(_0x27de47['version']===_0x2a7a29)return;const {id:_0x51c108}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4891b9,{'version':_0x2a7a29,'sessionId':_0x536e08})['getId']();_0x27de47['id']=_0x51c108,_0x27de47['content']=_0x4891b9,_0x27de47['version']=_0x2a7a29,_0x27de47['sessionId']=_0x536e08;}catch(_0x678bba){const _0x3b5c4f=new _0x599d16('ai-chat-document-upload-failed',null);_0x3b5c4f['stack']=_0x678bba['stack'],this['fire']('error',{'error':_0x3b5c4f});}}}['addSelectionToContext'](_0x4774f4){this['_addContextItem']({'type':xe['SELECTION'],'label':_0x4774f4,'uiId':'selection','content':_0x4774f4});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x41de19,_0x2318b0){const _0x4bd8ac='url-'+_0x190955();this['_startUploadOperation'](_0x4bd8ac);const _0x529e97='url-'+_0x190955();try{this['_addContextItem']({'type':xe['URL'],'label':_0x2318b0?.['label']||_0x41de19,'uiId':_0x529e97,'resourceId':_0x2318b0?.['resourceId']},!0x0);const _0xf6a403=this['_connector']['uploadUrl'](this['_ownerId'],_0x41de19,_0x2318b0);this['_ongoingUploads']['set'](_0x529e97,_0xf6a403['abortController']);const {id:_0x328c5d}=await _0xf6a403['getId']();this['_ongoingUploads']['delete'](_0x529e97),this['_finishContextItemLoading']({'type':xe['URL'],'id':_0x328c5d,'label':_0x2318b0?.['label']||_0x41de19,'uiId':_0x529e97,'resourceId':_0x2318b0?.['resourceId']},!0x1);}catch(_0x5e34d6){this['_ongoingUploads']['delete'](_0x529e97),(_0x5e34d6['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x599d16('ai-chat-url-upload-failed',this,{'url':_0x41de19,'originalError':_0x5e34d6}),'url':_0x41de19}),this['_removeContextItem'](_0x529e97));}finally{this['_finishUploadOperation'](_0x4bd8ac);}}async['loadSourceResources'](_0x2a711f,_0x137b33,_0x3af589){const _0xe365d0=this['_addContextOptionsState']['sources']['find'](_0x1115b3=>_0x1115b3['id']===_0x2a711f);if(!_0xe365d0)return this['fire']('error',{'error':new _0x599d16('ai-chat-source-not-found',this,{'sourceId':_0x2a711f}),'sourceId':_0x2a711f}),[];try{const _0x5a0a32=(await _0xe365d0['getResources'](_0x137b33))['map'](_0x11dc72=>{const _0x18aa02=this['_isResourceInContext'](_0x11dc72['id']);return{..._0x11dc72,'isInContext':_0x18aa02};});return _0xe365d0['resources']=_0x5a0a32,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2a711f,'source':_0xe365d0,'resources':_0x5a0a32,'uid':_0x3af589}),_0x5a0a32;}catch(_0x145a65){return this['fire']('error',{'error':new _0x599d16('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2a711f,'originalError':_0x145a65}),'sourceId':_0x2a711f,'sourceLabel':_0xe365d0['label']}),[];}}async['addResourceToContext'](_0x38d0d6,_0x133607){if(this['_isResourceInContext'](_0x133607['id']))return;let _0x36895e=_0x133607['data'];if(!_0x36895e&&_0x38d0d6['getData'])try{_0x36895e=await _0x38d0d6['getData'](_0x133607['id']);}catch(_0x11f2fd){return void this['fire']('error',{'error':new _0x599d16('ai-chat-resource-load-failed',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id'],'originalError':_0x11f2fd}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});}if(_0x36895e)switch(_0x133607['type']){case xe['URL']:if('string'!=typeof _0x36895e)return void this['fire']('error',{'error':new _0x599d16('ai-chat-context-invalid-data',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id'],'expectedType':'string','actualType':typeof _0x36895e}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});await this['addUrlToContext'](_0x36895e,{'label':_0x133607['label'],'resourceId':_0x133607['id']});break;case xe['FILE']:if(!(_0x36895e instanceof File))return void this['fire']('error',{'error':new _0x599d16('ai-chat-context-invalid-data',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id'],'expectedType':'File','actualType':typeof _0x36895e}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});await this['addFilesToContext']([_0x36895e],{'label':_0x133607['label'],'resourceId':_0x133607['id']});break;case xe['TEXT']:if('object'!=typeof _0x36895e||!('content'in _0x36895e)||!('type'in _0x36895e))return void this['fire']('error',{'error':new _0x599d16('ai-chat-context-invalid-data',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x36895e}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});_0x36895e=mi['_convertTextResourceToFile'](_0x36895e,_0x133607['label']),await this['addFilesToContext']([_0x36895e],{'label':_0x133607['label'],'resourceId':_0x133607['id']},xe['TEXT']);break;default:this['fire']('error',{'error':new _0x599d16('ai-chat-context-unsupported-type',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id'],'resourceType':_0x133607['type']}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});}else this['fire']('error',{'error':new _0x599d16('ai-chat-resource-no-data',this,{'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']}),'resourceId':_0x133607['id'],'sourceId':_0x38d0d6['id']});}static['_convertTextResourceToFile'](_0x4c49bb,_0x27e0aa){switch(_0x4c49bb['type']){case Ie['MARKDOWN']:return new File([_0x4c49bb['content']],_0x27e0aa,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x4c49bb['content']],_0x27e0aa,{'type':'text/html'});default:return new File([_0x4c49bb['content']],_0x27e0aa,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4bc397){switch(_0x4bc397['type']){case xe['FILE']:return{'type':xe['FILE'],'id':_0x4bc397['id']};case xe['URL']:return{'type':xe['URL'],'id':_0x4bc397['id']};case xe['DOCUMENT']:return{'type':xe['DOCUMENT'],'id':_0x4bc397['id'],..._0x4bc397['selection']?.['length']&&{'selection':_0x4bc397['selection']}};case xe['TEXT']:return{'type':xe['FILE'],'id':_0x4bc397['id']};default:return null;}}['_addContextItem'](_0xe4b362,_0x4f84de=!0x1){if(this['_pendingContextItems']['set'](_0xe4b362['uiId'],_0xe4b362),_0xe4b362['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xe4b362,'isLoading':_0x4f84de}),'current-document'===_0xe4b362['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xe4b362['resourceId']){const _0x3153d0=this['_findSourceIdsByResourceId'](_0xe4b362['resourceId']);_0x3153d0&&_0x3153d0['forEach'](_0x368cab=>{this['_updateResourceInContextState'](_0x368cab,_0xe4b362['resourceId'],!0x0);});}}['_removeContextItem'](_0x3acf6d){const _0x26a698=this['_pendingContextItems']['get'](_0x3acf6d),_0x549010=this['_ongoingUploads']['get'](_0x3acf6d);if(_0x549010&&(_0x549010['abort'](),this['_ongoingUploads']['delete'](_0x3acf6d)),_0x26a698?.['resourceId']){const _0xe5e299=this['_findSourceIdsByResourceId'](_0x26a698['resourceId']);_0xe5e299&&_0xe5e299['forEach'](_0x4a8f39=>{this['_updateResourceInContextState'](_0x4a8f39,_0x26a698['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x3acf6d),this['fire']('contextItemRemoved',{'uiId':_0x3acf6d,'type':_0x26a698?.['type']}),'current-document'===_0x3acf6d&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3543e9,_0x52a6a9){if(this['_pendingContextItems']['has'](_0x3543e9['uiId'])&&(this['_pendingContextItems']['set'](_0x3543e9['uiId'],_0x3543e9),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3543e9,'isLoading':_0x52a6a9}),_0x3543e9['resourceId'])){const _0x18a24d=this['_findSourceIdsByResourceId'](_0x3543e9['resourceId']);_0x18a24d&&_0x18a24d['forEach'](_0xa7389f=>{this['_updateResourceInContextState'](_0xa7389f,_0x3543e9['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x57fbbf){this['_conversationContextItems']['set'](_0x57fbbf['uiId'],_0x57fbbf);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1204d3=>({..._0x1204d3,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x3e08d4=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x3e08d4,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0xbb636c){for(const _0x569c90 of this['_pendingContextItems']['values']())if(_0x569c90['resourceId']===_0xbb636c)return!0x0;for(const _0xfbae9e of this['_conversationContextItems']['values']())if(_0xfbae9e['resourceId']===_0xbb636c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x20918b){const _0x19286e=[];for(const _0x17ae68 of this['_addContextOptionsState']['sources']){_0x17ae68['resources']['find'](_0x3ba313=>_0x3ba313['id']===_0x20918b)&&_0x19286e['push'](_0x17ae68['id']);}return 0x0===_0x19286e['length']?null:_0x19286e;}['_updateResourceInContextState'](_0x4e9468,_0x160b80,_0xba2e1){const _0x52838c=this['_addContextOptionsState']['sources']['find'](_0x355bd5=>_0x355bd5['id']===_0x4e9468);if(!_0x52838c)return;const _0x5b330e=_0x52838c['resources']['find'](_0xd5bf1e=>_0xd5bf1e['id']===_0x160b80);_0x5b330e&&(_0x5b330e['isInContext']=_0xba2e1,this['fire']('resourceStateChanged',{'sourceId':_0x4e9468,'resourceId':_0x160b80,'isInContext':_0xba2e1}));}['_startUploadOperation'](_0x459df1){this['_ongoingUploadOperations']['set'](_0x459df1,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x538666){this['_ongoingUploadOperations']['delete'](_0x538666),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ii=['capabilitiesUpdated'];class vi extends Mt(){['_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'](_0x4d06ac){const _0x168a0e={};return _0x4d06ac&&_0x4d06ac['isWebSearchEnabled']&&(_0x168a0e['webSearch']={}),_0x4d06ac&&_0x4d06ac['isReasoningEnabled']&&(_0x168a0e['reasoning']={}),_0x168a0e;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x5c73c0){_0x5c73c0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x5c73c0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4014e3){_0x4014e3!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4014e3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class fi extends pe{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x1196ef){super(_0x1196ef),this['conversationId']=_0x1196ef['conversationId'],this['contextItems']=_0x1196ef['contextItems'],this['capabilities']=_0x1196ef['capabilities'],this['userMessage']=_0x1196ef['userMessage'],this['model']=_0x1196ef['model'],this['quickActionData']=_0x1196ef['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':mi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':vi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ct extends Mt(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x343eb8){super(),this['options']=_0x343eb8,this['connector']=_0x343eb8['connector'],this['chatModels']=_0x343eb8['chatModels'],this['id']=_0x343eb8['conversationId'];}async['init'](_0x2f29a8){try{this['chatContext']=new mi({'connector':this['connector'],'config':_0x2f29a8,'ownerId':this['id']}),this['chatContext']['delegate'](...wi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new vi(),this['chatCapabilities']['delegate'](...Ii)['to'](this),this['chatCapabilities']['init']();const _0x2de8e3=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x2de8e3});const _0x6cec78=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x6cec78&&await this['setModel'](_0x6cec78);}catch(_0x2f862a){const _0x97e766=new _0x599d16('ai-chat-conversation-init-failed',null,{'message':_0x2f862a['message']});_0x97e766['stack']=_0x2f862a['stack'],this['fire']('error',{'error':_0x97e766});}}async['start'](){if(this['isStarted'])throw new _0x599d16('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x599d16('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x5c6e5b}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5c6e5b,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x170a8a){const _0x197862=new _0x599d16('ai-chat-conversation-start-failed',null,{'message':_0x170a8a['message']});_0x197862['stack']=_0x170a8a['stack'],this['fire']('error',{'error':_0x197862});}}async['load'](_0x5253fc,_0x23b83b){try{const _0x39847c=await this['connector']['fetchConversation'](_0x5253fc)['getConversation'](),_0x2cafeb=await this['connector']['fetchConversationMessages'](_0x5253fc)['getMessages'](),_0x470225=_0x2cafeb[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x39847c['id'],'title'in _0x39847c?this['fire']('setConversationTitle',_0x39847c['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x580e3e=(await this['chatModels']['getAll']())['find'](_0x64c7c2=>_0x64c7c2['id']['toLowerCase']()===_0x470225['toLowerCase']());return this['selectedModel']=_0x580e3e,this['fire']('modelSelected',{'selectedModel':_0x580e3e,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x2cafeb,_0x23b83b,_0x470225),this['currentInteraction']=void 0x0,this;}catch(_0x308d25){const _0x218ef7=new _0x599d16('ai-chat-conversation-init-from-id-failed',null,{'message':_0x308d25['message'],'conversationId':_0x5253fc});throw _0x218ef7['stack']=_0x308d25['stack'],this['fire']('error',{'error':_0x218ef7}),_0x218ef7;}}async['_processMessagesToInteractions'](_0x583bb4,_0xe34745,_0x18ab8e){let _0x2437cc;for(const _0x49be0c of _0x583bb4)if('user'===_0x49be0c['role']){const _0x12ab5b=await this['_extractContextItems'](_0x49be0c),_0x2125ce={'isReasoningEnabled':Object['hasOwn'](_0x49be0c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x49be0c['capabilities'],'webSearch')};_0x2437cc=this['createInteraction']({'userMessage':_0x49be0c['prompt'],'contextItems':_0x12ab5b,'capabilities':_0x2125ce,'modelId':_0x18ab8e,'quickActionData':_0x49be0c['attributes']?.['quickActionData']}),this['currentInteraction']=_0x2437cc,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x49be0c['role']&&_0x2437cc)for(const _0x19728c of _0x49be0c['content']){const _0x55c569='text'===_0x19728c['type']?'text-delta':'modification-delta',_0x22977c=_0x2437cc['getDocumentContext']()?.['sessionId']!==_0xe34745;_0x2437cc['currentReply']=_0x2437cc['createReply']({'type':_0x55c569,'isDone':!0x0,'interactionId':_0x2437cc['id'],'areActionsDisabled':_0x22977c}),_0x2437cc['currentReply']['appendContent'](_0x19728c['content']);}}}async['_extractContextItems'](_0xff3721){const _0x524bc8=new Map();if(!_0xff3721['content'])return _0x524bc8;for(const _0x5cd64f of _0xff3721['content']){const _0x23d4be=await this['chatContext']['populateFromMessage'](_0x5cd64f);_0x23d4be&&_0x524bc8['set'](_0x23d4be['id'],_0x23d4be);}return _0x524bc8;}async['handleUserInteraction']({userMessage:_0x2841cd,quickActionData:_0x4de906}){if(!this['isStarted'])throw new _0x599d16('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x599d16('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5d252f=this['chatContext']['getPendingContextItems'](),_0x2c843e=this['chatCapabilities']['getCapabilitiesConfig'](),_0x42ee56=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2841cd,'contextItems':_0x5d252f,'capabilities':_0x2c843e,'modelId':_0x42ee56,'quickActionData':_0x4de906}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x4588c9){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x4588c9});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xf60404,contextItems:_0x388bc6,capabilities:_0x2bb479,modelId:_0x354927,quickActionData:_0xcf2033}){const _0x20091d=new fi({'userMessage':_0xf60404,'contextItems':_0x388bc6,'capabilities':_0x2bb479,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x354927,'quickActionData':_0xcf2033});return _0x20091d['delegate'](...ge)['to'](this),this['interactions']['push'](_0x20091d),this['fire']('interactionCreated',_0x20091d),_0x20091d;}['getInteraction'](_0x3e45c2){return this['interactions']['find'](_0x4d7ad2=>_0x4d7ad2['id']===_0x3e45c2);}['removeInteraction'](_0xf24ec7){const _0x30080e=this['getInteraction'](_0xf24ec7);_0x30080e&&(_0x30080e['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x30080e),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x40b716){this['chatContext']['addCurrentDocumentToContext'](_0x40b716);}async['updateCurrentDocumentInContext']({content:_0x4861b2,version:_0x102fc1,sessionId:_0x5332ae,selections:_0x373720}){await this['chatContext']['updateCurrentDocument'](_0x4861b2,_0x102fc1,_0x5332ae,_0x373720);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x47712f){this['chatContext']['addSelectionToContext'](_0x47712f);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x291bc4){this['chatContext']['addFilesToContext'](_0x291bc4);}['addUrlToContext'](_0x42c38e){this['chatContext']['addUrlToContext'](_0x42c38e);}['addResourceToContext'](_0x1da3ad,_0x3d5b02){this['chatContext']['addResourceToContext'](_0x1da3ad,_0x3d5b02);}['loadSourceResources'](_0x3511a8,_0x159f58,_0x296efb){return this['chatContext']['loadSourceResources'](_0x3511a8,_0x159f58,_0x296efb);}['removeFromContext'](_0xb2dbf1){this['chatContext']['removeFromContext'](_0xb2dbf1);}['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'](_0x421d30){if(!_0x421d30)throw new _0x599d16('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x421d30))throw new _0x599d16('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x421d30});_0x421d30['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x421d30,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x421d30}));}}function V(_0x65d9a7){if(_0x65d9a7 instanceof ot)return _0x65d9a7;if(_0x65d9a7?.['editors']&&_0x65d9a7['editors']['get'](0x0))return _0x65d9a7['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.'),_0x65d9a7['editors']['get'](0x0);throw new _0x599d16('ai-get-editor-from-context-no-editor');}const dt='ai-selection';class O extends _0x3e9f85{['_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 _0x4092e6=V(this['context']),_0x30ffcc=_0x4092e6['plugins']['has']('RealTimeCollaborationClient')&&_0x4092e6['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x30ffcc||_0x190955();}return this['_sessionId'];}['getDocumentData'](){const _0x480d8c=V(this['context']),_0x59a9ef=_0x480d8c['model'],_0x5026fc=_0x480d8c['data']['toView'](_0x59a9ef['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x1b9764=new kt(_0x480d8c['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5026fc,_0x1b9764);let _0xfeda11=_0x480d8c['data']['processor']['toData'](_0x5026fc);const _0xfa11eb=this['_getMarkersInDocumentOrder'](),_0x57ec93=[];for(const _0x237500 of _0xfa11eb){const _0x3df82c='<'+_0x237500['name']+':start></'+_0x237500['name']+':start>',_0x30610e=_0xfeda11['indexOf'](_0x3df82c);_0xfeda11=_0xfeda11['substring'](0x0,_0x30610e)+_0xfeda11['substring'](_0x30610e+_0x3df82c['length']);const _0xb466b0='<'+_0x237500['name']+':end></'+_0x237500['name']+':end>',_0x1138ee=_0xfeda11['indexOf'](_0xb466b0);_0xfeda11=_0xfeda11['substring'](0x0,_0x1138ee)+_0xfeda11['substring'](_0x1138ee+_0xb466b0['length']),_0x57ec93['push']({'markerName':_0x237500['name'],'start':_0x30610e,'end':_0x1138ee,'htmlFragment':_0xfeda11['substring'](_0x30610e,_0x1138ee)});}return{'content':_0xfeda11,'version':_0x480d8c['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x57ec93};}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2c5da8,_0x12418e)=>{_0x12418e['on']('ready',()=>{this['_integrateEditor'](_0x12418e);});});}['_integrateEditor'](_0x1b731){_0x1b731['conversion']['for']('editingDowncast')['markerToHighlight']({'model':dt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x1b731['conversion']['for']('dataDowncast')['markerToElement']({'model':dt,'view':(_0x98e14b,{writer:_0x4f8fce,options:_0x4991aa})=>_0x4991aa['convertAiChatSelectionMarker']?_0x4f8fce['createUIElement'](_0x98e14b['markerName']+':'+(_0x98e14b['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1cdddd,_0x4ee19b,_0x2f5eec=!0x1,_0x13437f=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x13437f)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x4ee19b,this['_displayedFakeSelectionLocked']=_0x2f5eec;const _0x297847=V(this['context'])['model'];return _0x297847['change'](_0x3e0198=>{let _0x8b0a59=0x0;for(let _0x1c676b of _0x1cdddd){const _0x233332=dt+':'+_0x8b0a59;if(_0x1c676b['start']['isAtEnd']){const _0x2e1a9e=_0x1c676b['start']['getLastMatchingPosition'](({item:_0x32a1fc})=>!_0x297847['schema']['isContent'](_0x32a1fc),{'boundaries':_0x1c676b});_0x1c676b=_0x3e0198['createRange'](_0x2e1a9e,_0x1c676b['end']);}_0x3e0198['addMarker'](_0x233332,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1c676b}),_0x8b0a59++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3b2f99){if(this['_displayedFakeSelectionId']!=_0x3b2f99)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x512a44=V(this['context']),_0x5e8342=_0x512a44['model']['markers']['getMarkersGroup'](dt);return _0x512a44['model']['change'](_0x38e8e4=>{for(const _0x4bd32d of _0x5e8342)_0x38e8e4['removeMarker'](_0x4bd32d);}),!0x0;}['modelToViewWithIds'](_0x99aa21){const _0x47c132=V(this['context']),_0x4fe85b=_0x47c132['data']['toView'](_0x99aa21),_0x3d3771=new kt(_0x47c132['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x4fe85b,_0x3d3771),_0x4fe85b;}['_setDataIdsOnChildren'](_0x5d8d98,_0x345c4f){let _0x5c8e3f=!0x1;const _0x17a6ee=new Set();for(const _0xb508ad of _0x5d8d98['getChildren']()){const _0x507b07=_0xb508ad['is']('emptyElement')||_0xb508ad['is']('containerElement');if(!_0xb508ad['is']('element'))continue;(this['_setDataIdsOnChildren'](_0xb508ad,_0x345c4f)||_0x507b07)&&(_0x345c4f['setAttribute']('data-id',this['_nextDataId'](_0x17a6ee),_0xb508ad),_0x5c8e3f=!0x0);}return _0x5c8e3f;}['_nextDataId'](_0x16df2c){let _0x1f57bf;do{_0x1f57bf='';for(let _0x147847=0x0;_0x147847<0x4;_0x147847++)_0x1f57bf+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x16df2c['has'](_0x1f57bf));return _0x16df2c['add'](_0x1f57bf),_0x1f57bf;}['getSelectionText'](){const {model:_0x211e6a}=V(this['context']),_0x11cb5f=_0x211e6a['document']['selection'],_0xc5df43=_0x211e6a['getSelectedContent'](_0x11cb5f),_0x309ea3=[],_0x4beac3=_0x211e6a['createRangeIn'](_0xc5df43)['getWalker']();for(const {item:_0x294c6c}of _0x4beac3)_0x294c6c['is']('$textProxy')?_0x309ea3['push'](_0x294c6c['data']):_0x294c6c['is']('element')&&_0x309ea3['length']>0x0&&'\x20'!==_0x309ea3[_0x309ea3['length']-0x1]&&_0x309ea3['push']('\x20');return'\x22'+_0x309ea3['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x5e5fe7=V(this['context'])['model'];return Array['from'](_0x5e5fe7['markers']['getMarkersGroup'](dt))['sort']((_0x1e6ccf,_0x1309ca)=>_0x1e6ccf['getStart']()['isBefore'](_0x1309ca['getStart']())?-0x1:_0x1e6ccf['getStart']()['isAfter'](_0x1309ca['getStart']())?0x1:0x0);}}class lt extends Mt(){['_modelList']=[];['_connector'];constructor({connector:_0x459d0e}){super(),this['_connector']=_0x459d0e;}async['getAll'](){if(!this['_modelList']['length']){const _0x2ec739=this['_connector']['getModels'](),_0x15df31=(await _0x2ec739['list']())['items']['sort']((_0x18c6f6,_0x3bb047)=>{const _0x3c9f7c=Object['values'](_0x18c6f6['capabilities'])['filter'](_0x136d0d=>_0x136d0d['enabled'])['length'];return Object['values'](_0x3bb047['capabilities'])['filter'](_0x4686b1=>_0x4686b1['enabled'])['length']-_0x3c9f7c;});this['_modelList']=_0x15df31;}return this['_modelList'];}async['getDefault'](_0x325865){const _0x5ef9b6=await this['getAll']();if(!_0x5ef9b6['length'])return null;if(_0x325865){const _0x51c728=_0x5ef9b6['find'](_0x4ab268=>_0x4ab268['id']===_0x325865);if(_0x51c728)return _0x51c728;_0x1f6f14('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x325865,'fallBackModelId':_0x5ef9b6[0x0]['id']});}return _0x5ef9b6[0x0];}async['isAvailable'](_0x1a3cc1){return(await this['getAll']())['some'](_0x4938b1=>_0x4938b1['name']===_0x1a3cc1['name']&&_0x4938b1['provider']===_0x1a3cc1['provider']);}}function z({editor:_0x3c558a,interaction:_0x21d71c,reply:_0xc3b6cd,groups:_0x34fe61,transform:_0x4c6ef7,documentCompare:_0x2ac45f,documentCompareOptions:_0x36135e}){const _0x34a66d=_0x21d71c['getDocumentContext']();if(!_0x34a66d)return[];const _0x3138b5=_0x34a66d['content'],_0x3c7c07=_0x34a66d['version'],_0x5d5cde=_0xc3b6cd['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2dcd95}of _0x34fe61){const _0x2cc202=_0x2dcd95['filter'](_0x2e77b8=>'new'!=_0x2e77b8['type'])['map'](_0x350893=>It('data-id',_0x350893['id'],_0x5d5cde)),_0x74bcb2=_0x2dcd95['filter'](_0x7d08dc=>'removed'!=_0x7d08dc['type'])['map'](_0x497c1a=>_0x497c1a['node']['cloneNode'](!0x0));let _0x5b3687=null;if(_0x2cc202['length']){_0x5b3687=_0x2cc202[0x0]['previousSibling'];for(let _0x2999b4=0x0;_0x2999b4<_0x2cc202['length'];_0x2999b4++)_0x38cbf5(_0x2cc202[_0x2999b4]);}if(_0x74bcb2['length']){_0x5b3687||(_0x2dcd95[0x0]['anchorId']?_0x5b3687=It('data-id',_0x2dcd95[0x0]['anchorId'],_0x5d5cde):(_0x5b3687=_0x74bcb2['shift'](),to(_0x5d5cde,_0x5b3687)));for(let _0x368f58=0x0;_0x368f58<_0x74bcb2['length'];_0x368f58++)_0x1ce7f1(_0x5b3687,_0x74bcb2[_0x368f58]),_0x5b3687=_0x74bcb2[_0x368f58];}}const _0x38f3c1=Ct(_0x5d5cde),_0x1c604f=_0x2ac45f['getDiff'](_0x3138b5,_0x38f3c1,_0x36135e)['getOperations']();if(_0x4c6ef7){const _0x4b5606=_0x3c558a['model']['document']['history']['getOperations'](_0x3c7c07),_0x985c26={'document':_0x3c558a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return it(_0x1c604f,_0x4b5606,_0x985c26)['operationsA'];}return _0x1c604f;}function Y({editor:_0x4e7681,changeGroups:_0x23dc88,documentContextContent:_0x36a420,showDiff:_0x10fc81,trimUnchanged:_0x2b730f=!0x0}){return _0x23dc88['map'](_0x5f46bc=>{const _0xf94e28=new _t([]),_0x115026=new _t([]);for(const _0x53b254 of _0x5f46bc['changes'])if(_0x10fc81&&'removed'==_0x53b254['type']||_0x115026['children']['push'](_0x53b254['node']['cloneNode'](!0x0)),'new'!=_0x53b254['type']&&(_0x10fc81||'removed'!=_0x53b254['type'])){const _0x57164d=mt(_0x570e19=>ft(_0x570e19,'data-id')==_0x53b254['id'],_0x36a420,!0x0);_0x57164d&&_0xf94e28['children']['push'](_0x57164d['cloneNode'](!0x0));}const {content:_0x2181dc,hasChanges:_0x1e1499}=function(_0x1ebafc,_0x5c6002,_0x30d942,_0x52816c,_0x38c2eb=!0x0){const _0x5ebeca=_0x1ebafc['plugins']['get']('DocumentCompare'),_0x464836=_0x1ebafc['plugins']['get']('TrackChangesEditing'),_0x5a6c29=Ct(_0x5c6002),_0x384573=Ct(_0x30d942),_0x3fd27e=_0x1ebafc['data']['parse'](_0x5a6c29,'$root'),_0x1c1457=_0x1ebafc['model']['createPositionAt'](_0x3fd27e,0x0),_0x178883=_0x5ebeca['getDiff'](_0x5a6c29,_0x384573,{'anchor':_0x1c1457,'markDeletions':_0x52816c}),_0x19e4e0=_0x178883['getOperations']();if(0x0==_0x19e4e0['length'])return{'content':_0x5c6002['cloneNode'](!0x0),'hasChanges':!0x1};_0x52816c?_0x464836['_applyOperationsAsSuggestions'](_0x19e4e0):_0x1ebafc['model']['change'](_0x49ed48=>{for(const _0x54fca4 of _0x19e4e0)if('remove'==_0x54fca4['type']){const _0x4c6612=_0x54fca4['sourcePosition'],_0x52bd25=_0x54fca4['howMany'],_0x5f4147=new tt(_0x4c6612,_0x52bd25);_0x49ed48['batch']['addOperation'](_0x5f4147),_0x1ebafc['model']['applyOperation'](_0x5f4147);}else _0x54fca4['baseVersion']=null,_0x54fca4['isDocumentOperation']=!0x1,_0x49ed48['batch']['addOperation'](_0x54fca4),_0x1ebafc['model']['applyOperation'](_0x54fca4);});if(_0x38c2eb){const _0x3458d4=ut(_0x1ebafc,_0x19e4e0,_0x3fd27e);pt(_0x1ebafc['model'],_0x3458d4),function(_0x8514a1,_0x5cb3e1){const _0x13225e=_0x5cb3e1['getFirstRange']()['start'];let _0x54fa13=_0x5cb3e1['getFirstRange']()['end'];const _0x3c10ca=_0x13225e['root'];(_0x54fa13['textNode']||_0x54fa13['nodeAfter']&&_0x54fa13['nodeAfter']['is']('$text'))&&(_0x4050db(_0x54fa13,'...'),_0x54fa13=_0x54fa13['getShiftedBy'](0x3)),(_0x13225e['textNode']||_0x13225e['nodeBefore']&&_0x13225e['nodeBefore']['is']('$text'))&&(_0x4050db(_0x13225e,'...'),function(_0x3400b0,_0x4c1e5e,_0x3f5626){for(let [_0x569b5c,_0x51f6f5]of _0x3400b0['markers']){const _0x11a3e3=_0x51f6f5['_getTransformedByInsertion'](_0x4c1e5e,_0x3f5626,!0x1);_0x51f6f5=_0x11a3e3[0x0],_0x3400b0['markers']['set'](_0x569b5c,_0x51f6f5);}}(_0x3c10ca,_0x13225e,0x3),_0x13225e['parent']==_0x54fa13['parent']&&(_0x54fa13=_0x54fa13['getShiftedBy'](0x3)));const _0x28edca=_0x8514a1['createRange'](_0x8514a1['createPositionAt'](_0x3c10ca,0x0),_0x13225e),_0x37e995=_0x8514a1['createRange'](_0x54fa13,_0x8514a1['createPositionAt'](_0x3c10ca,'end')),_0x4b80c9=[..._0x28edca['getMinimalFlatRanges'](),..._0x37e995['getMinimalFlatRanges']()];_0x4b80c9['reverse']();for(const _0x55fda7 of _0x4b80c9)_0xc0cbf7(_0x55fda7),Xn(_0x3c10ca,_0x55fda7);}(_0x1ebafc['model'],_0x3458d4);}const _0x3d4e71=_0x1ebafc['data']['stringify'](_0x3fd27e,{'showSuggestionHighlights':!0x0});return{'content':Oe(_0x3d4e71),'hasChanges':!0x0};}(_0x4e7681,_0xf94e28,_0x115026,_0x10fc81,_0x2b730f);return{'type':_0x5f46bc['changes'][0x0]['type'],'index':_0x5f46bc['index'],'content':_0x2181dc,'hasChanges':_0x1e1499};});}function ut(_0xfaf8cc,_0xdeec64,_0x551ed2){const _0x4ffd08=_0xfaf8cc['plugins']['get']('DocumentCompare');let _0x2fee90=_0xfaf8cc['model']['createPositionAt'](_0x551ed2,Number['POSITIVE_INFINITY']),_0x59fbe6=_0xfaf8cc['model']['createPositionAt'](_0x551ed2,0x0);for(const _0x3bbb55 of _0xdeec64){let _0x1f18a3,_0xd38da4;if(_0x4ffd08['isMarkedRemoveOperation'](_0x3bbb55))_0x1f18a3=_0x3bbb55['newRange']['start'],_0xd38da4=_0x3bbb55['newRange']['end'];else switch(_0x3bbb55['type']){case'rename':_0x1f18a3=_0x3bbb55['position'],_0xd38da4=_0x1f18a3['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1f18a3=_0x3bbb55['range']['start'],_0xd38da4=_0x3bbb55['range']['end'];break;case'insert':_0x1f18a3=_0x3bbb55['position'],_0xd38da4=_0x1f18a3['getShiftedBy'](_0x3bbb55['howMany']);break;case'split':_0x1f18a3=_0x3bbb55['splitPosition'],_0xd38da4=_0x3bbb55['moveTargetPosition'];break;case'merge':{const _0x25feb0=_0x3bbb55['targetPosition']['path']['slice'](-0x1);_0x1f18a3=_0xfaf8cc['model']['createPositionFromPath'](_0x551ed2,_0x25feb0),_0xd38da4=_0x1f18a3['getShiftedBy'](0x1);break;}case'remove':{const _0x51fa10=_0x3bbb55['howMany'],_0x91bf05=_0x3bbb55['sourcePosition']['_getTransformedByInsertion'](_0x3bbb55['targetPosition'],_0x51fa10),_0x512c70=_0x3bbb55['getMovedRangeStart']();'remove'==_0x3bbb55['type']?(_0x1f18a3=_0x91bf05,_0xd38da4=_0x91bf05):(_0x1f18a3=_0x512c70,_0xd38da4=_0x512c70['getShiftedBy'](_0x51fa10));break;}}_0x1f18a3&&_0x1f18a3['isBefore'](_0x2fee90)&&(_0x2fee90=_0x1f18a3),_0xd38da4&&_0xd38da4['isAfter'](_0x59fbe6)&&(_0x59fbe6=_0xd38da4);}return _0xfaf8cc['model']['createSelection'](_0xfaf8cc['model']['createRange'](_0x2fee90,_0x59fbe6));}function pt(_0x548770,_0x406bba){fn(_0x548770,_0x406bba,'forward');const _0x43e63e=_0x406bba['getFirstRange']();_0x406bba['setTo']([]),_0x406bba['setTo'](_0x43e63e,{'backward':!0x0}),fn(_0x548770,_0x406bba,'backward');}function fn(_0x10609e,_0x31c9f8,_0x4ab230){let _0x31f519=0x14;for(;_0x31f519;){_0x10609e['modifySelection'](_0x31c9f8,{'unit':'word','direction':_0x4ab230}),_0x31f519--;const _0x4103c5=_0x31c9f8['focus']['forward'==_0x4ab230?'nodeBefore':'nodeAfter'];if(_0x4103c5&&_0x4103c5['is']('element')&&_0x10609e['schema']['isBlock'](_0x4103c5)&&_0x10609e['schema']['isObject'](_0x4103c5))break;}}function Xn(_0x18072d,_0x5ad08e){for(let [_0x513151,_0x4f0be4]of _0x18072d['markers'])_0x4f0be4=_0x4f0be4['_getTransformedByDeletion'](_0x5ad08e['start'],_0x5ad08e['end']['offset']-_0x5ad08e['start']['offset']),_0x18072d['markers']['set'](_0x513151,_0x4f0be4);}class ah extends _0x581355{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3e9629,_0x5c9db4={},_0x17fa88){super(_0x3e9629),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x5c9db4};const _0x343086=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x343086?'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'](_0x17fa88),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['_setupRatingButtons'](){this['likeButton']=new _0x4b3349(this['locale']),this['likeButton']['set']({'icon':_0x53f27c,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xaeb980=>!_0xaeb980),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x4b3349(this['locale']),this['dislikeButton']['set']({'icon':_0x46a254,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4602c4=>!_0x4602c4),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x4b3349(this['locale']),this['copyButton']['set']({'icon':_0x233e02,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3b807b=>!_0x3b807b);const _0x29d47a=new _0x1f8dd5();_0x29d47a['set']({'content':_0x112b00}),_0x29d47a['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'](_0x29d47a);}['_setupShowChangesButton'](_0x457a5b){this['showChangesButton']=new _0x4b3349(this['locale']),this['showChangesButton']['set']({'icon':_0x2b7c68,'label':Yn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x457a5b}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x5b2e09=>!_0x5b2e09),this['showChangesButton']['on']('execute',()=>{const _0x52a63e=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x52a63e,'icon':_0x52a63e?_0x5c4167:_0x2b7c68}),this['fire']('toggleShowChanges',_0x52a63e);});}}class nh extends _0x3a2ab2{['showChangesToggleView'];constructor(_0x567f68,_0x53e5b5){super(_0x567f68),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new zn(_0x567f68),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Yn(_0x567f68,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x53e5b5['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0xc89999=>_0xc89999?_0x48ac84:_0x241ff6),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2f6b98=new _0x1f8dd5();_0x2f6b98['content']=_0x4e4b26,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x53e5b5['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2f6b98,{'tag':'span','children':[Yn(_0x567f68,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class zn extends _0x4b3349{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ta{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x501fa9){this['options']={'delay':_0x501fa9['delay']??0x14,'textNodeStyle':_0x501fa9['textNodeStyle'],'onStreamUpdate':_0x501fa9['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x562aa1,targetElement:_0x1ab771,abortSignal:_0x32ecc3}){this['isStreaming']&&this['stop'](),_0x32ecc3?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x518b7f(_0x562aa1,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x1f6f14('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x2fb650=0x0;_0x2fb650<this['currentIndex'];_0x2fb650++)this['nodesList'][_0x2fb650]['shouldBeStreamed']=!0x0;let _0x4f7a68=0x0;for(let _0x22c09e=this['currentIndex'];_0x22c09e<this['nodesList']['length'];_0x22c09e++){const _0x7bb641=Date['now'](),_0x516a80=this['nodesList'][_0x22c09e],_0x3d7e43=_0x7bb641-_0x4f7a68;_0x516a80['shouldBeStreamed']=!0x0;let _0x1788e8=_0x516a80['parent'];for(;_0x1788e8;)_0x1788e8['shouldBeStreamed']=!0x0,_0x1788e8=_0x1788e8['parent'];if(_0x3d7e43<this['options']['delay'])try{const {promise:_0x203258,abortController:_0x19b29e}=mr(this['options']['delay']-_0x3d7e43);this['timeoutAbortController']=_0x19b29e,await _0x203258;}catch(_0xd0e40b){return;}_0x2c16a9(_0x1ab771,'<'+_0x1ab771['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1ab771['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x22c09e,_0x4f7a68=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0xd8e6ac}){Array['from'](_0xd8e6ac['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x38b8b2=>{_0x38b8b2['replaceWith'](_0x38b8b2['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0xe7bdea){let _0x59a1d1='';if(function(_0x2faffa){return _0x2e8cf8(_0x2faffa);}(_0xe7bdea)){for(const _0x16c671 of _0xe7bdea['children'])_0x59a1d1+=this['renderNode'](_0x16c671);}else{if(ar(_0xe7bdea)){if(!_0xe7bdea['shouldBeStreamed'])return'';const _0x5b6eae=_0xe7bdea,_0x22fd0f=Object['entries'](_0x5b6eae['attribs'])['map'](([_0x2a0358,_0x478061])=>_0x2a0358+'=\x22'+_0x478061+'\x22')['join']('\x20');_0x59a1d1+='<'+_0x5b6eae['tagName']+(_0x22fd0f?'\x20'+_0x22fd0f:'')+'>';for(const _0x10bb94 of tn(_0x5b6eae))_0x59a1d1+=this['renderNode'](_0x10bb94);_0x59a1d1+='</'+_0x5b6eae['tagName']+'>';}else{if(!cr(_0xe7bdea))return'';if(!_0xe7bdea['shouldBeStreamed'])return'';!function(_0x453622){if(!_0x453622['parent']||!ar(_0x453622['parent']))return!0x1;if(!hr['includes'](_0x453622['parent']['tagName']))return!0x1;return!_0x585589(_0x453622)['match'](/^\s*[<>]\s*$/);}(_0xe7bdea)?_0x59a1d1+=_0x49a0ef(_0xe7bdea):_0x59a1d1+=_0x49a0ef(new _0x309e49('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0xe7bdea]));}}return _0x59a1d1;}['getParsedDocumentNodeList'](){const _0x52455f=[];return function(_0x170ead,_0x1647de){const _0x42bd13=_0xa76699=>{if(_0x1647de(_0xa76699),_0xa76699 instanceof _0x519ee5)for(let _0x186555=0x0;_0x186555<_0xa76699['children']['length'];_0x186555++){const _0xebec9d=_0xa76699['children'][_0x186555];_0x42bd13(_0xebec9d);}};for(let _0x56a75c=0x0;_0x56a75c<_0x170ead['children']['length'];_0x56a75c++)_0x42bd13(_0x170ead['children'][_0x56a75c]);}(this['document'],_0x3387e7=>{if(cr(_0x3387e7)){const _0x10b50b=this['splitTextNodeIntoWordNodes'](_0x3387e7);_0x10b50b['length']&&_0x52455f['push'](..._0x10b50b);}_0x3387e7['isWordSplitSource']||_0x3387e7['isWordSplitResult']||_0x52455f['push'](_0x3387e7);}),_0x52455f;}['splitTextNodeIntoWordNodes'](_0x59057){if(_0x59057['isWordSplitSource']||_0x59057['isWordSplitResult'])return[];const _0x2ede19=_0x585589(_0x59057)['match'](/(?:\s*\S+\s*)/g),_0x2b40e4=[];if(_0x2ede19&&_0x2ede19['length']>0x1){for(const _0x31bd8a of _0x2ede19){const _0x9d3e3d=new _0x1594f5(_0x31bd8a);_0x9d3e3d['isWordSplitResult']=!0x0,_0x4522c2(_0x59057,_0x9d3e3d),_0x2b40e4['push'](_0x9d3e3d);}_0x59057['isWordSplitSource']=!0x0,_0x38cbf5(_0x59057);}return _0x2b40e4;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0x594160){return _0xe71ef1(_0x594160);}function ar(_0x1787e5){return _0x2c7bda(_0x1787e5);}function mr(_0x595d23){const _0x334336=new AbortController();return{'promise':new Promise((_0x2829d3,_0x133974)=>{const _0x32cdf2=setTimeout(_0x2829d3,_0x595d23);_0x334336['signal']['addEventListener']('abort',()=>{clearTimeout(_0x32cdf2),_0x133974();});}),'abortController':_0x334336};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Sr extends _0x3a2ab2{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x3a06d8,{part:_0x6efc6c,areActionsDisabled:_0x572fe5}){super(_0x3a06d8),this['set']('partDefinition',_0x6efc6c),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x16323a=>'pending'==_0x16323a&&!_0x572fe5),this['children']=this['createCollection'](),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new yn(_0x3a06d8,_0x6efc6c),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x5df76b=this['bindTemplate'];this['contentView']=new _0x3a2ab2(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5df76b['to']('state',_0x422185=>'ck-ai-suggestion__body__content-part_'+_0x422185),_0x5df76b['to']('isEnabled',_0x4a510e=>_0x4a510e?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x5df76b['if']('isVisible','ck-hidden',_0xd8162b=>!_0xd8162b)]},'children':this['children'],'on':{'mouseenter':_0x5df76b['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x6efc6c['index']});}),'mouseleave':_0x5df76b['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x6efc6c['index']});})}});}async['updateContent']({part:_0x1b4573,renderingStrategy:_0x482f54,showUnchangedParts:_0x595bfc=!0x1,abortSignal:_0x4e0424}){this['partDefinition']=_0x1b4573,this['isVisible']=this['partDefinition']['hasChanges']||_0x595bfc,this['isVisible']&&('streaming'===_0x482f54?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x4e0424}):this['contentView']['element']['innerHTML']=Ct(this['partDefinition']['content']));}['toggleHeader'](_0x4508ed){_0x4508ed?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class yn extends _0x3a2ab2{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x4ab333,_0x399d68){super(_0x4ab333),this['set']('partDefinition',_0x399d68),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x45bf2e=new _0x1f8dd5();_0x45bf2e['content']=_0x2e662c,_0x45bf2e['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x586c34=new _0x4b3349(_0x4ab333);_0x586c34['set']({'label':Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0xfdca25}),_0x586c34['bind']('isEnabled')['to'](this),_0x586c34['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x399d68['index']});});const _0x3a59ce=new _0x4b3349(_0x4ab333);_0x3a59ce['set']({'label':Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x50242c}),_0x3a59ce['bind']('isEnabled')['to'](this),_0x3a59ce['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x399d68['index']});});const _0x11d9db=new _0x4b3349(_0x4ab333);_0x11d9db['set']({'label':Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1ee77d}),_0x11d9db['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x399d68['index']});}),_0x11d9db['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x581355(_0x4ab333),this['_toolbarView']['items']['addMany']([_0x586c34,_0x3a59ce,_0x11d9db]),this['_iconStateAccepted']=new _0x1f8dd5(),this['_iconStateAccepted']['content']=_0x187479,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x1f8dd5(),this['_iconStateRejected']['content']=_0x3f5cf7,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x2c7bc9=new _0x3a2ab2(_0x4ab333);_0x2c7bc9['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Yn(_0x4ab333,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x399d68['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x45bf2e,_0x2c7bc9,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x257728,_0x26b0e6,_0x3636c9,_0x5a9416)=>{switch(_0x5a9416){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x3636c9){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class Q extends Mt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x16f10c){const _0x2ed21a=this['createTask'](_0x16f10c);return this['queue']['push'](_0x2ed21a),this['_processQueue'](),_0x2ed21a['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(_0x2c6cda=>{this['once']('_queueEmpty',()=>{_0x2c6cda();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x39f0ec=this['queue']['shift']();try{await _0x39f0ec['callback'](this['_abortController']['signal']),_0x39f0ec['resolve']();}catch(_0x181a84){_0x39f0ec['reject'](_0x181a84);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x44454c){let _0x264f62,_0x2704a8;const _0x2ce2db=new Promise((_0x20316a,_0xb89632)=>{_0x264f62=_0x20316a,_0x2704a8=_0xb89632;});return{'callback':_0x44454c,'resolve':_0x264f62,'reject':_0x2704a8,'completePromise':_0x2ce2db};}}class Cr extends _0x3a2ab2{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x710fee){super();const _0x59545c=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x710fee,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x59545c['if']('isDone','ck-ai-chat__feed__item_done'),_0x59545c['if']('isVisible','ck-hidden',_0x21f4d1=>!_0x21f4d1),'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'](_0x4dfc3e=>{_0x4dfc3e['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2421d2,_0x276eb5,_0x2bd34f){await this['htmlStreamer']['stream']({'document':_0x2421d2,'targetElement':_0x276eb5,'abortSignal':_0x2bd34f});}}class Te extends Cr{constructor(_0x3b3827){super(_0x3b3827),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x3b3827['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x1dbffb){this['element']['innerHTML']=_0x1dbffb;}}class ch extends _0x3a2ab2{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x259759,{areActionsDisabled:_0x5527a4,showUnchangedParts:_0x492eda}){super(_0x259759),this['_areActionsDisabled']=_0x5527a4,this['_showUnchangedParts']=_0x492eda,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new Q(),this['_emptyPartsWarningView']=new Te({'id':'empty-parts-warning','initialContent':Yn(_0x259759,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x20126e,renderingStrategy:_0x55ca4c,abortSignal:_0x210653}){for(const _0x156713 of _0x20126e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x35b35f=>{let _0x57131a=this['_children']['find'](_0x2dcd00=>_0x2dcd00['partDefinition']['index']==_0x156713['index']);_0x57131a||(_0x57131a=new Sr(this['locale'],{'part':_0x156713,'areActionsDisabled':this['_areActionsDisabled']}),_0x57131a['delegate'](...Ee)['to'](this),this['_children']['add'](_0x57131a),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x57131a['toggleHeader'](this['_children']['length']>0x1),await _0x57131a['updateContent']({'part':_0x156713,'renderingStrategy':_0x55ca4c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x35b35f});});return _0x210653?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x259ffe,_0x379ea9){this['_children']['get'](_0x259ffe)['state']=_0x379ea9,this['hasPendingParts']='pending'==_0x379ea9||Array['from'](this['_children'])['some'](_0x767cb8=>'pending'==_0x767cb8['state']);}['getPartView'](_0x30e166){return this['_children']['get'](_0x30e166);}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x17bd6c=!this['_children']['find'](_0x3aeda7=>_0x3aeda7['partDefinition']['hasChanges']),_0x2bc0b7=!!this['_children']['find'](_0x308e2d=>!_0x308e2d['partDefinition']['hasChanges']);this['_emptyPartsWarningView']['isVisible']=_0x2bc0b7,_0x17bd6c?this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x4fcac6=>_0x4fcac6['partDefinition']['hasChanges']);}}class De extends _0x5d8343{constructor(_0x5f5655=void 0x0){super();const _0x572752=_0x5f5655?'ck-ai-spinner_'+_0x5f5655:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x572752]}});}}class F extends _0x3a2ab2{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x354a2c,{showDiff:_0x26e15c,areActionsDisabled:_0x409661,miniToolbarConfig:_0x3e4e92,hideHeader:_0x332edc,showLoader:_0x27ccfc,showUnchangedParts:_0x49c554}){super(_0x354a2c),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x27ccfc),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x332edc||(this['headerView']=new nh(_0x354a2c,{'showDiff':_0x26e15c}),this['headerView']['on']('toggleShowChanges',(_0x314d4,_0x477aa3)=>{this['areChangesVisible']=_0x477aa3['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x477aa3['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new ch(_0x354a2c,{'areActionsDisabled':_0x409661,'showUnchangedParts':!!_0x49c554}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new ah(_0x354a2c,_0x3e4e92,_0x26e15c),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x1787c3,_0xc16ad3)=>{this['areChangesVisible']=_0xc16ad3,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xc16ad3});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new _r(this['locale']),this['children']['add'](this['sourcesView']),_0x27ccfc&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x4d8674){await this['bodyView']['updateContentParts'](_0x4d8674);}['updateSources'](_0x3651be){this['sourcesView']['children']['addMany'](_0x3651be['map'](_0x2bf0ab=>new jr(this['locale'],_0x2bf0ab))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x3aa407=new _0x3a2ab2(this['locale']),_0x2af791=new De('small');_0x2af791['isVisible']=!0x0;const _0xd97b4c=new _0x3a2ab2(this['locale']);return _0xd97b4c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Yn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x3aa407['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x56c543=>!_0x56c543)]},'children':[_0x2af791,_0xd97b4c]}),_0x3aa407;}}class _r extends _0x3a2ab2{['children'];constructor(_0xbfaaae){super(_0xbfaaae),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',_0x3f1d65=>!_0x3f1d65)]},'children':this['children']});const _0x14a7e3=new _0x3a2ab2(this['locale']),_0x42fa8c=new _0x1f8dd5();_0x42fa8c['content']=t_,_0x14a7e3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x42fa8c,{'tag':'span','children':[{'text':Yn(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x14a7e3);}}class jr extends _0x4b3349{constructor(_0x4b0e40,_0x3911f8){super(_0x4b0e40),this['set']({'label':_0x3911f8['title'],'tooltip':_0x3911f8['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5f0786=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5f0786['to'](()=>{window['open'](_0x3911f8['url'],'_blank');})}}),_0x3911f8['favicon']){const _0x36b882=new _0x3a2ab2(_0x4b0e40);_0x36b882['setTemplate']({'tag':'img','attributes':{'src':_0x3911f8['favicon']||t_,'alt':_0x3911f8['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x36b882);}else this['set']('icon',t_);}}class ls extends _0x581355{constructor(_0x4a9c4e,_0x335a6e=!0x0,_0x541de4=!0x0){super(_0x4a9c4e),this['set']('isLoading',!0x1),_0x335a6e&&(this['applyButton']=this['_createButton'](Yn(_0x4a9c4e,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x58a9d5=>!_0x58a9d5),this['items']['add'](this['applyButton'])),_0x541de4&&(this['suggestButton']=this['_createButton'](Yn(_0x4a9c4e,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x47ab7b=>!_0x47ab7b),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x41a611,_0x92e32a){const _0x456007=new _0x4b3349(this['locale']);return _0x456007['set']({'label':_0x41a611,'class':_0x92e32a||'','isVisible':!0x0,'withText':!0x0}),_0x456007;}}class ds extends _0x3a2ab2{constructor(_0xa12d84){super(_0xa12d84),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Yn(_0xa12d84,'AI_DISCLAIMER_TEXT')}]}]});}}const P=['applySuggestion','insertSuggestion','showNext','showPrevious'];class D extends _0x3a2ab2{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x23488e,_0x563823){super(_0x23488e),this['set']('isLoading',!0x1),this['focusTracker']=new _0x14ef6c(),this['keystrokes']=new _0x4f7a26(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x3d067c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x4346f0(),this['_addContentView'](_0x563823['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x563823['showApplyButton'],_0x563823['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']});}['render'](){super['render']();for(const _0x4d3cb5 of this['_focusables'])this['focusTracker']['add'](_0x4d3cb5['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x404eaf){-0x1===_0x404eaf?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x501a0a){const _0x24a6df=this['_createNextButtonView'](),_0x10c762=this['_createPreviousButtonView']();_0x501a0a['view']['headerView']['children']['add'](_0x24a6df,0x2),_0x501a0a['view']['headerView']['children']['add'](_0x10c762,0x0),this['_focusables']['addMany']([_0x24a6df,_0x10c762]),this['focusTracker']['add'](_0x24a6df['element']),this['focusTracker']['add'](_0x10c762['element']);}['_addContentView'](_0x539cbd){this['_mainView']=_0x539cbd,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ds(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x2c0eef=!0x0,_0x39df10=!0x0){this['toolbar']=new ls(this['locale'],_0x2c0eef,_0x39df10),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x41a64a=new _0x4b3349(this['locale']);return _0x41a64a['set']({'icon':_0x2b1293,'tooltip':Yn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x41a64a['on']('execute',()=>{this['fire']('showNext');}),_0x41a64a;}['_createPreviousButtonView'](){const _0x47ee67=new _0x4b3349(this['locale']);return _0x47ee67['set']({'icon':_0x1a2643,'tooltip':Yn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x47ee67['on']('execute',()=>{this['fire']('showPrevious');}),_0x47ee67;}}class W extends _0x3e9f85{static get['requires'](){return[N,O];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x1c29f8){const _0x17dc8e=V(this['context']);this['_config']=_0x1c29f8,this['balloonView']=new D(_0x17dc8e['locale'],_0x1c29f8),this['balloonView']['delegate'](...P)['to'](this),this['_showDialog'](_0x1c29f8);}['close'](){V(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x2e559b,_0x2f28dd){this['context']['plugins']['get'](O)['showFakeVisualSelection'](_0x2e559b,'ai-balloon-'+_0x2f28dd,!0x0,!0x0);}['_showDialog'](_0x2b72c1){const _0x1b1ac2=V(this['context']);this['_setupVisualSelection'](_0x2b72c1['ranges'],_0x2b72c1['index']),_0x1b1ac2['plugins']['get']('Dialog')['show']({'title':_0x2b72c1['title'],'icon':_0x2b72c1['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x2b72c1['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x5bc7b7=>{_0x2b72c1['showRotator']&&this['balloonView']['setupRotator'](_0x5bc7b7),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x2b72c1['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x27af37,_0x402f0d){const _0x1e5c46=V(this['context']);if(!_0x402f0d)return{'left':0x0,'top':0x0};const _0x536e7d=_0xfebbba(_0x1e5c46['editing'],[..._0x1e5c46['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1e5c46['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x536e7d||0x0===_0x536e7d['length'])return{'left':Math['round'](_0x402f0d['left']+_0x402f0d['width']/0x2-_0x27af37['width']/0x2),'top':Math['round'](_0x402f0d['top']+_0x402f0d['height']/0x2-_0x27af37['height']/0x2)};const _0x422ab3=Math['round'](_0x402f0d['left']+_0x402f0d['width']/0x2-_0x27af37['width']/0x2),_0x32d3ca=_0x536e7d[0x0]['getBoundingClientRect'](),_0x4e5eff=_0x536e7d[_0x536e7d['length']-0x1]['getBoundingClientRect'](),_0xb10d2a=_0x27af37['height'],_0x4af8b6=this['_config']['showRotator']?0x8:0x0;return{'left':_0x422ab3,'top':this['_calculateOptimalTopPosition'](_0x32d3ca,_0x4e5eff,_0xb10d2a,_0x4af8b6)};}['_calculateOptimalTopPosition'](_0x3cd2aa,_0x229a9f,_0x24facc,_0x3d8380=0x0){const _0x18da80=_0x229a9f['top']+_0x229a9f['height'],_0x58806a=_0x3cd2aa['top']-_0x24facc-_0x3d8380,_0x212e62=window['innerHeight']-_0x18da80-0xa,_0x2d5b32=_0x3cd2aa['top']-_0x3d8380-0xa;let _0x8f34fd;if(_0x212e62>=_0x24facc)_0x8f34fd=_0x18da80+0xa;else{if(_0x2d5b32>=_0x24facc)_0x8f34fd=_0x58806a-0xa;else _0x8f34fd=_0x3cd2aa['top']+(_0x229a9f['top']+_0x229a9f['height'])/0x2-(_0x24facc+_0x3d8380)/0x2;}return _0x8f34fd;}}class et extends _0x3e9f85{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[N,W,_0x348a94];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new lt({'connector':this['_aiConnector']});const _0x3777dd=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1bd471,_0x4915ba)=>{this['_handleUIUserMessage']({'userMessage':_0x4915ba});}),this['listenTo'](_0x3777dd,'resizedTabs',(_0x36b82c,_0x28bbf5)=>{this['_setIsMaximized'](_0x28bbf5);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x3777dd['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x3e6e50,_0x2e5a42)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2e5a42));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x192541,_0x2f6887)=>{this['activeConversation']?.['addUrlToContext'](_0x2f6887);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4d4648,_0x4eccc7)=>{this['activeConversation']?.['addResourceToContext'](_0x4eccc7['source'],_0x4eccc7['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2e085b,_0x2ebeff)=>{this['_removeFromContext'](_0x2ebeff);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x2c0556,_0x3a91c0)=>{this['activeConversation']?.['loadSourceResources'](_0x3a91c0['sourceId'],_0x3a91c0['query'],_0x3a91c0['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3a1a4a,_0x591d46)=>{this['activeConversation']?.['setModel'](_0x591d46);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2f6ae4,{replyId:_0x57a406})=>{console['log']('Liked\x20response',_0x57a406);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x31469a,{replyId:_0x37bf75})=>{console['log']('Disliked\x20response',_0x37bf75);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xbfb501,_0x3a305f)=>{this['context']['plugins']['get'](W)['close'](),this['_insertSuggestion'](_0x3a305f);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x4244ff,{replyId:_0x34d461,partIndex:_0x5470df})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x34d461,_0x5470df);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x31f69a,{replyId:_0x28ffbe,partIndex:_0x2ecc8a})=>{const _0x363cd7=this['_getDocumentRangeForReplyChanges'](_0x28ffbe,_0x2ecc8a);_0x363cd7&&'$graveyard'!=_0x363cd7['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x363cd7['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x470108,_0x79b77)=>{this['context']['plugins']['get'](W)['close'](),this['_applySuggestion'](_0x79b77);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x1d4dfd,_0x409a9b)=>{const {reply:_0xd26b50}=this['getInteractionAndReplyById'](_0x409a9b['replyId']),_0x148274=Y({'editor':V(this['context']),'changeGroups':_0xd26b50['changeGroups'],'documentContextContent':_0xd26b50['documentContextContent'],'showDiff':_0x409a9b['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xd26b50['id'],'parts':_0x148274,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x545807,{replyId:_0x58d376,partIndex:_0x2214ce})=>{this['_previewedChangeGroup']?.['replyId']==_0x58d376&&this['_previewedChangeGroup']?.['partIndex']==_0x2214ce&&this['context']['plugins']['get'](W)['close']();const {reply:_0x4b109a}=this['getInteractionAndReplyById'](_0x58d376);_0x4b109a['setChangeGroupState'](_0x2214ce,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x231ae2,_0x2165dc)=>{_0x2165dc['on']('ready',()=>{this['_integrateEditor'](_0x2165dc);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0xe17cb2){const _0x5f3bd6=V(this['context']);if(!_0x5f3bd6['plugins']['has']('TrackChangesEditing'))return;const _0x253fc8=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4a63e0,interaction:_0x182c21}=this['getInteractionAndReplyById'](_0xe17cb2['replyId']),_0x2e24b5=this['_getDocumentRangeForReplyChanges'](_0xe17cb2['replyId'],_0xe17cb2['partIndex']),_0x10a7ec=void 0x0!==_0xe17cb2['partIndex']?[_0x4a63e0['changeGroups'][_0xe17cb2['partIndex']]]:_0x4a63e0['changeGroups']['filter'](_0xeefb3b=>'pending'==_0xeefb3b['state']),_0x363ad3=_0x10a7ec['map'](_0x468e0e=>_0x4a63e0['changeGroups']['indexOf'](_0x468e0e));_0x363ad3['forEach'](_0x3e151a=>_0x4a63e0['setChangeGroupState'](_0x3e151a,'accepted'));const _0x1dce6b=z({'editor':_0x5f3bd6,'reply':_0x4a63e0,'interaction':_0x182c21,'groups':_0x10a7ec,'transform':!0x0,'documentCompare':_0x253fc8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x1f8cf5;_0x2e24b5&&this['_scrollToSuggestionRange'](_0x2e24b5['range']),_0x5f3bd6['model']['change'](_0x59f4d6=>{_0x1f8cf5=_0x59f4d6['batch'],_0x5f3bd6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1dce6b),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x1f8cf5,{'interactionId':_0x182c21['id'],'replyId':_0x4a63e0['id'],'indexes':_0x363ad3['slice']()});}['_applySuggestion'](_0x5396d9){const _0x8fe9f9=V(this['context']),_0x33c578=this['context']['plugins']['get'](_0x348a94),{reply:_0x37ee08,interaction:_0x2a463f}=this['getInteractionAndReplyById'](_0x5396d9['replyId']),_0xb97c47=this['_getDocumentRangeForReplyChanges'](_0x5396d9['replyId'],_0x5396d9['partIndex']),_0x7b452f=void 0x0!==_0x5396d9['partIndex']?[_0x37ee08['changeGroups'][_0x5396d9['partIndex']]]:_0x37ee08['changeGroups']['filter'](_0xfce1c4=>'pending'==_0xfce1c4['state']),_0x430ded=_0x7b452f['map'](_0x4dc7b8=>_0x37ee08['changeGroups']['indexOf'](_0x4dc7b8));_0x430ded['forEach'](_0x153e19=>_0x37ee08['setChangeGroupState'](_0x153e19,'accepted'));const _0x303338=z({'editor':_0x8fe9f9,'reply':_0x37ee08,'interaction':_0x2a463f,'groups':_0x7b452f,'transform':!0x0,'documentCompare':_0x33c578,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x7fa276;_0xb97c47&&this['_scrollToSuggestionRange'](_0xb97c47['range']),_0x8fe9f9['model']['change'](_0x1f22e1=>{_0x7fa276=_0x1f22e1['batch'];for(const _0x41849f of _0x303338)_0x41849f['baseVersion']=_0x8fe9f9['model']['document']['version'],_0x1f22e1['batch']['addOperation'](_0x41849f),_0x8fe9f9['model']['applyOperation'](_0x41849f);}),this['_batchToChanges']['set'](_0x7fa276,{'interactionId':_0x2a463f['id'],'replyId':_0x37ee08['id'],'indexes':_0x430ded['slice']()});}['_openBalloonFor'](_0x103fff,_0x512388){const _0x4e35e5=V(this['context']),_0x2313a6=this['_getDocumentRangeForReplyChanges'](_0x103fff,_0x512388),_0x5aab59=this['context']['plugins']['get'](W);if(!_0x2313a6)return void _0x5aab59['close']();const {range:_0xb46129,currentIndex:_0x228dda,previousIndex:_0x40182e,nextIndex:_0x19f005}=_0x2313a6;if(this['_previewedChangeGroup']?.['replyId']==_0x103fff&&this['_previewedChangeGroup']?.['partIndex']==_0x228dda)return;this['_previewedChangeGroup']={'replyId':_0x103fff,'partIndex':_0x228dda};const _0x2bb891=new F(_0x4e35e5['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x384fc2}=this['getInteractionAndReplyById'](_0x103fff),_0x423613=Y({'editor':_0x4e35e5,'changeGroups':[_0x384fc2['changeGroups'][_0x228dda]],'documentContextContent':_0x384fc2['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x2bb891['updateContent']({'parts':_0x423613,'renderingStrategy':'static'});const _0x1e4c0d=_0x228dda!==_0x40182e;this['_scrollToSuggestionRange'](_0xb46129,!0x0),_0x5aab59['open']({'index':_0x228dda,'title':Yn(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x228dda+0x1)['toString']()),'icon':yt,'mainView':_0x2bb891,'showRotator':_0x1e4c0d,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0xb46129]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x103fff,_0x228dda),this['listenTo'](_0x2bb891,'toggleSuggestionDisplayMode',(_0x11e94f,{showDiff:_0x294dba})=>{this['_balloonShowDiff']=_0x294dba;const {reply:_0x1cc782}=this['getInteractionAndReplyById'](_0x103fff),_0x31fae8=Y({'editor':_0x4e35e5,'changeGroups':[_0x1cc782['changeGroups'][_0x228dda]],'documentContextContent':_0x1cc782['documentContextContent'],'showDiff':_0x294dba});_0x2bb891['updateContent']({'parts':_0x31fae8,'renderingStrategy':'static'});}),this['listenTo'](_0x5aab59,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x103fff,'partIndex':_0x228dda}),_0x1e4c0d?this['_openBalloonFor'](_0x103fff,_0x19f005):_0x5aab59['close']();}),this['listenTo'](_0x5aab59,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x103fff,'partIndex':_0x228dda}),_0x1e4c0d?this['_openBalloonFor'](_0x103fff,_0x19f005):_0x5aab59['close']();}),_0x1e4c0d&&(this['listenTo'](_0x5aab59,'showNext',()=>{this['_openBalloonFor'](_0x103fff,_0x19f005);}),this['listenTo'](_0x5aab59,'showPrevious',()=>{this['_openBalloonFor'](_0x103fff,_0x40182e);})),this['listenTo'](_0x5aab59,'dialogClosed',()=>{this['stopListening'](_0x5aab59),this['stopListening'](_0x2bb891),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x1778de,_0x400a39){const _0x443a83=V(this['context']),{reply:_0x5dfe5c,interaction:_0x33935e}=this['getInteractionAndReplyById'](_0x1778de),_0x28fe79=_0x5dfe5c['changeGroups']['filter'](_0x12ddf9=>'pending'==_0x12ddf9['state']),_0x51800c=_0x28fe79['map'](_0x3095a8=>_0x5dfe5c['changeGroups']['indexOf'](_0x3095a8));void 0x0===_0x400a39&&(_0x400a39=_0x51800c[0x0]);const _0x4a1d0d=_0x51800c['indexOf'](_0x400a39);if(-0x1==_0x4a1d0d)return null;const _0x3db614=0x0==_0x4a1d0d?_0x51800c[_0x51800c['length']-0x1]:_0x51800c[_0x4a1d0d-0x1],_0x34ed61=_0x4a1d0d==_0x51800c['length']-0x1?_0x51800c[0x0]:_0x51800c[_0x4a1d0d+0x1],_0x55decc=_0x28fe79[_0x4a1d0d],_0x4d53ad=new _t([]),_0x4a278a=new _t([]);for(const _0x2f27b6 of _0x55decc['changes'])if('removed'!=_0x2f27b6['type']&&_0x4a278a['children']['push'](_0x2f27b6['node']['cloneNode'](!0x0)),'new'!=_0x2f27b6['type']){const _0x484469=mt(_0x4c0c91=>ft(_0x4c0c91,'data-id')==_0x2f27b6['id'],_0x5dfe5c['documentContextContent'],!0x0);_0x4d53ad['children']['push'](_0x484469['cloneNode'](!0x0));}if(0x0==_0x4d53ad['children']['length']){if(_0x55decc['changes'][0x0]['anchorId']){const _0x2221b4=It('data-id',_0x55decc['changes'][0x0]['anchorId'],_0x5dfe5c['documentContextContent']);_0x4d53ad['children']['unshift'](_0x2221b4['cloneNode'](!0x0)),_0x4a278a['children']['unshift'](_0x2221b4['cloneNode'](!0x0)),_0x2221b4['nextSibling']&&(_0x4d53ad['children']['push'](_0x2221b4['nextSibling']['cloneNode'](!0x0)),_0x4a278a['children']['push'](_0x2221b4['nextSibling']['cloneNode'](!0x0)));}else{const _0x53a3ed=_0x5dfe5c['documentContextContent']['children'][0x0];if(!_0x53a3ed)return null;_0x4d53ad['children']['push'](_0x53a3ed['cloneNode'](!0x0)),_0x4a278a['children']['push'](_0x53a3ed['cloneNode'](!0x0));}}const _0x38f278=_0x33935e['getDocumentContext'](),_0x41dc4d=_0x443a83['data']['parse'](_0x38f278['content']),_0x55250d=Ct(_0x4d53ad),_0x8cc45e=_0x443a83['data']['parse'](_0x55250d),_0x1c6a45=_0x443a83['data']['parse'](_0x55250d),_0x416104=_0x443a83['model']['createPositionAt'](_0x8cc45e,0x0),_0x21e6fc=Ct(_0x4a278a),_0x1db228={'anchor':_0x416104,'markDeletions':!0x1},_0x31a315=_0x443a83['plugins']['get'](_0x348a94)['getDiff'](_0x55250d,_0x21e6fc,_0x1db228)['getOperations']();if(!_0x31a315['length'])return null;_0x443a83['model']['change'](_0x55422a=>{for(const _0x4c2dc8 of _0x31a315)if('remove'==_0x4c2dc8['type']){const _0x4bae54=_0x4c2dc8['sourcePosition'],_0x43326c=_0x4c2dc8['howMany'],_0x36ea2d=new tt(_0x4bae54,_0x43326c);_0x55422a['batch']['addOperation'](_0x36ea2d),_0x443a83['model']['applyOperation'](_0x36ea2d);}else _0x4c2dc8['baseVersion']=null,_0x4c2dc8['isDocumentOperation']=!0x1,_0x55422a['batch']['addOperation'](_0x4c2dc8),_0x443a83['model']['applyOperation'](_0x4c2dc8);});const _0x1e668c=ut(_0x443a83,_0x31a315,_0x8cc45e);pt(_0x443a83['model'],_0x1e668c);const _0x537d5f=_0x1e668c['getFirstRange']()['start']['path']['slice'](),_0x48e75c=_0x1e668c['getFirstRange']()['end']['path']['slice'](),_0x25f0af=[];let _0x1fb856=_0x8cc45e,_0x49741b=_0x1c6a45;for(let _0x4e544d=0x0;_0x4e544d<_0x48e75c['length'];_0x4e544d++){const _0x5d0be0=_0x1fb856['maxOffset']-_0x48e75c[_0x4e544d];_0x25f0af[_0x4e544d]=_0x49741b['maxOffset']-_0x5d0be0,_0x1fb856=_0x1fb856['getChildAtOffset'](_0x48e75c[_0x4e544d]),_0x49741b=_0x49741b['getChildAtOffset'](_0x25f0af[_0x4e544d]);}const _0x252071=_0x443a83['model']['createRange'](_0x443a83['model']['createPositionFromPath'](_0x1c6a45,_0x537d5f),_0x443a83['model']['createPositionFromPath'](_0x1c6a45,_0x25f0af)),_0x22d1b1=_0x1c6a45['getChild'](0x0)['getAttribute'](gt),_0x497a0c=Array['from'](_0x41dc4d['getChildren']())['find'](_0x188a05=>_0x188a05['getAttribute'](gt)==_0x22d1b1)['getPath'](),_0x2a3a2d=_0x252071['start']['path']['slice'](),_0x2c06a6=_0x252071['end']['path']['slice']();_0x2a3a2d[0x0]=_0x497a0c[0x0]+_0x2a3a2d[0x0],_0x2c06a6[0x0]=_0x497a0c[0x0]+_0x2c06a6[0x0];let _0x580263=_0x443a83['model']['createRange'](_0x443a83['model']['createPositionFromPath'](_0x443a83['model']['document']['getRoot'](),_0x2a3a2d),_0x443a83['model']['createPositionFromPath'](_0x443a83['model']['document']['getRoot'](),_0x2c06a6));const _0x5bd777=_0x443a83['model']['document']['history']['getOperations'](_0x38f278['version']);for(const _0x1fc099 of _0x5bd777)_0x580263=_0x625116['_createFromRanges'](_0x580263['getTransformedByOperation'](_0x1fc099));return{'range':_0x580263,'previousIndex':_0x3db614,'nextIndex':_0x34ed61,'currentIndex':_0x400a39};}['_integrateEditor'](_0x3674a9){if(!_0x3674a9['plugins']['has']('Undo'))return;const _0x26d439=_0x3674a9['commands']['get']('undo'),_0x7065ea=_0x3674a9['commands']['get']('redo');this['listenTo'](_0x26d439,'revert',(_0x21e6e5,_0xb317f6,_0x2f88d7)=>{const _0x1e82aa=this['_batchToChanges']['get'](_0xb317f6);if(!_0x1e82aa)return;const _0x456499=this['activeConversation']['getInteraction'](_0x1e82aa['interactionId'])['getReply'](_0x1e82aa['replyId']);_0x1e82aa['indexes']['forEach'](_0x2c7196=>_0x456499['setChangeGroupState'](_0x2c7196,'pending')),this['_batchToChanges']['delete'](_0xb317f6),this['_batchToChanges']['set'](_0x2f88d7,_0x1e82aa);}),this['listenTo'](_0x7065ea,'revert',(_0x5e9fba,_0x3387a1,_0x2d1ef2)=>{const _0x1908f5=this['_batchToChanges']['get'](_0x3387a1);if(!_0x1908f5)return;const _0x5b0649=this['activeConversation']['getInteraction'](_0x1908f5['interactionId'])['getReply'](_0x1908f5['replyId']);_0x1908f5['indexes']['forEach'](_0x1664f2=>_0x5b0649['setChangeGroupState'](_0x1664f2,'accepted')),this['_batchToChanges']['delete'](_0x3387a1),this['_batchToChanges']['set'](_0x2d1ef2,_0x1908f5);});}async['loadConversation'](_0x4b9412){this['context']['plugins']['get'](W)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x3a544f=this['context']['plugins']['get'](ht);this['updateConversationTitle']('\x20'),_0x3a544f['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x4b9412);const {sessionId:_0x8288cf}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x4b9412,_0x8288cf),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x250cd7){console['error']('Failed\x20to\x20load\x20conversation',_0x250cd7);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x53d185){this['activeConversation']['id']===_0x53d185&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x208c68=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x208c68),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x28c91f,quickActionData:_0x20d390}){await this['_handleUIUserMessage']({'userMessage':_0x28c91f,'quickActionData':_0x20d390});}['getGroupId'](){const _0x51c5be=this['context']['config']['get']('collaboration.channelId');if(!_0x51c5be)throw new _0x599d16('ai-chat-missing-channel-id',this);return _0x51c5be;}async['_handleStartConversation'](_0x5cd4b3){const _0x4aaefe=this['context']['plugins']['get'](W);let _0x3bf1c8;_0x4aaefe['isOpen']&&_0x4aaefe['close'](),_0x3bf1c8=_0x5cd4b3||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x533fa7=this['getGroupId'](),_0x2207e8=_0x5cd4b3||_0x190955();this['activeConversation']=new ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x3bf1c8,'conversationId':_0x2207e8,'group':_0x533fa7,'getEditor':()=>V(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x44d340,_0x450a75)=>{_0x450a75['availableModels']=this['_filterModels'](_0x450a75['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x450a75),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5cd4b3||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x248a39,_0x5eb835)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5eb835['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x1c7916,_0x543719)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x543719),this['_aiChatUi']['addFeedInteractionHeader'](_0x543719);}),this['activeConversation']['on']('interactionStarted',(_0x4e7494,_0x500208)=>{this['_aiChatUi']['startInteraction'](_0x500208);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1034cc,_0xd32cb9)=>{this['_aiChatUi']['removeFeedInteraction'](_0xd32cb9['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x38131b,_0x3019e3,_0x3a89b8)=>{this['updateConversationTitle'](_0x3019e3,_0x3a89b8);}),this['activeConversation']['on']('replyCreated',(_0x421582,_0x5103c3)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x5103c3['interactionId']}),'text-delta'===_0x5103c3['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5103c3):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5103c3);}),this['activeConversation']['on']('replyContentUpdated',async(_0x43ffeb,_0x2dc22e,_0x306a5b)=>{await this['_updateReplyContent']({'reply':_0x2dc22e,'changeGroups':_0x306a5b});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x29e74b,{reply:_0x20044e,index:_0x1d3ae8,state:_0x355c92})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x20044e['id'],'index':_0x1d3ae8,'state':_0x355c92});}),this['activeConversation']['on']('contextItemAdded',(_0x120ee0,_0x54c79f)=>{if(this['_aiChatUi']['addContextItem'](_0x54c79f['contextItem'],_0x54c79f['isLoading']),'selection'===_0x54c79f['contextItem']['type']){const _0x80ce6e=[...V(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x80ce6e,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x271396,_0x28f617)=>{this['_aiChatUi']['removeContextItem'](_0x28f617['uiId']),'current-document'==_0x28f617['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x28f617['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3336d7,_0x4c1ac9)=>{this['_aiChatUi']['setContextItemLoading'](_0x4c1ac9['contextItem']['uiId'],_0x4c1ac9['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2f2b0e,_0x2e8304)=>{this['_aiChatUi']['setConversationContext'](_0x2e8304['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x1bb2a3,_0x2110c4)=>{this['_aiChatUi']['setAddContextOptions'](_0x2110c4['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x35b0ee,_0x5e7e1c)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x5e7e1c['sourceId'],_0x5e7e1c['source'],_0x5e7e1c['resources'],_0x5e7e1c['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4dcdec,_0x1ae9b3)=>{this['_aiChatUi']['updateResourceState'](_0x1ae9b3['sourceId'],_0x1ae9b3['resourceId'],_0x1ae9b3['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x4f5f69,_0x18317e)=>{this['_aiChatUi']['updateCapabilities'](_0x18317e);}),this['activeConversation']['on']('modelSelected',(_0x47d4c2,_0x256d63)=>{this['_aiChatUi']['setSelectedModel'](_0x256d63['selectedModel'],_0x256d63['isDisabled']);}),this['activeConversation']['on']('error',(_0x29003b,{error:_0x259286,interactionId:_0x42a7a7,fileName:_0x16939d,url:_0x45facd,sourceId:_0x5d860a,sourceLabel:_0x279902})=>{const _0x44bae1=_0x42a7a7?_0x42a7a7+':'+_0x190955():_0x190955();_0x259286['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Yn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x44bae1}):_0x259286['message']['startsWith']('ai-chat-conversation-init-failed')||_0x259286['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x44bae1}),this['_logError'](_0x259286)):_0x259286['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x16939d),'id':_0x44bae1}):_0x259286['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x45facd),'id':_0x44bae1}):_0x259286['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x44bae1}):_0x259286['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x44bae1}):_0x259286['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5d860a&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5d860a),this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x279902||'source'),'id':_0x44bae1}),this['_logError'](_0x259286)):_0x259286['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x44bae1}),this['_logError'](_0x259286)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x44bae1}),this['_logError'](_0x259286));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5cd4b3||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4de1ce,quickActionData:_0x1963a1}){if(!this['activeConversation'])throw new _0x599d16('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4de1ce,'quickActionData':_0x1963a1}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x23f646=V(this['context'])['model'],_0xa9a2ae=Array['from'](_0x23f646['markers']['getMarkersGroup'](dt));_0x23f646['change'](_0x376c60=>{_0xa9a2ae['forEach'](_0x1b22e2=>_0x376c60['removeMarker'](_0x1b22e2));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x279cea){this['_aiChatUi']['setIsMaximized'](_0x279cea);}['_logError'](_0x2cf4ed){nt(_0x2cf4ed['message']);}['_removeFromContext'](_0x4f2b58){this['activeConversation']?.['removeFromContext'](_0x4f2b58);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x47e928){const [_0x2c144b,_0x54578e]=_0x47e928['split'](':'),_0x5fb4b1=this['activeConversation']['getInteraction'](_0x2c144b),_0x1c9b32=_0x5fb4b1['getReply'](_0x54578e);return{'interaction':_0x5fb4b1,'reply':_0x1c9b32};}['_scrollToSuggestionRange'](_0x18caa3,_0x745a83=!0x1){const _0x501a52=V(this['context']),_0xae651f={'target':_0x501a52['editing']['view']['domConverter']['viewRangeToDom'](_0x501a52['editing']['mapper']['toViewRange'](_0x18caa3)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x745a83};_0x745a83&&(_0xae651f['alignToTop']=!0x0),rt(_0xae651f);}['updateConversationTitle'](_0xf69165,_0x2f5b76=!0x1){this['_aiChatUi']['setConversationTitle'](_0xf69165||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2f5b76);}['_filterModels'](_0x1a74ae,_0x5806d6){let _0x748794;if(_0x5806d6){_0x748794=[];const _0x5c8c67='string'==typeof _0x5806d6?[_0x5806d6['toLocaleLowerCase']()]:_0x5806d6['map'](_0x538b3b=>_0x538b3b['toLocaleLowerCase']());for(const _0x242f51 of _0x5c8c67)for(const _0x3be2fc of _0x1a74ae)(_0x3be2fc['id']['toLocaleLowerCase']()===_0x242f51||_0x3be2fc['name']['toLocaleLowerCase']()===_0x242f51||_0x3be2fc['provider']['toLocaleLowerCase']()===_0x242f51||_0x3be2fc['id']['toLocaleLowerCase']()['startsWith'](_0x242f51))&&_0x748794['push'](_0x3be2fc);}else _0x748794=_0x1a74ae;return _0x748794;}async['_updateReplyContent']({reply:_0x44ae65,changeGroups:_0x270a84,renderingStrategy:_0x374fbe}){const {id:_0x3aae92,isDone:_0x2e636c,type:_0x14b642,parsedContent:_0x1cbad5}=_0x44ae65;if('modification-delta'===_0x14b642){const _0x45162b=Y({'editor':V(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x270a84,'documentContextContent':_0x44ae65['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3aae92,'parts':_0x45162b,'renderingStrategy':_0x374fbe,'isDone':_0x2e636c});}else'text-delta'===_0x14b642&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3aae92,'parsedContent':_0x1cbad5,'renderingStrategy':_0x374fbe,'isDone':_0x2e636c});_0x2e636c&&_0x44ae65['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3aae92,_0x44ae65['sources']);}async['_stopLastInteraction'](){const _0x3f9bb1=this['activeConversation']?.['lastInteraction'];_0x3f9bb1&&(_0x3f9bb1['stop'](),this['_aiChatUi']['stopInteraction'](_0x3f9bb1));}async['_flushLastInteractionUI'](){const _0x45aff2=this['activeConversation']?.['lastInteraction'];if(_0x45aff2){for await(const _0x27d107 of _0x45aff2['replies'])await this['_updateReplyContent']({'reply':_0x27d107,'changeGroups':_0x27d107['changeGroups'],'renderingStrategy':'static'});}}}const Pt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class th extends _0x3a2ab2{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x44627c){super(_0x44627c);const _0x269306=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x45b9d4({'label':Yn(_0x44627c,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0xfdca25,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x45b9d4({'label':Yn(_0x44627c,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x50242c,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new Oo(_0x44627c,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':Yn(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x269306['if']('isVisible','ck-hidden',_0x5185b3=>!_0x5185b3)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x4fafed){const _0x3d162e=this['locale'];this['actionsDropdown']['set']({'label':Yn(_0x3d162e,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x4fafed),'tooltip':Yn(_0x3d162e,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x4fafed)}),this['showChangeInTextModel']['label']=Yn(_0x3d162e,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x4fafed),this['insertSuggestionModel']['label']=Yn(_0x3d162e,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x4fafed);}}class Oo extends _0x127212{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x44bd51,_0x139bed){super(_0x44bd51),this['balloonPanelView']=new _0x1618b0(this['locale']),this['bodyCollection']=new _0x582686(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x139bed['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Yn(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?go:Co]}),this['listView']['focus']());}),_0xca342f({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x16b9c6){const _0xa10b27=this['locale'],_0x37b55e=new _0x586ac5(_0xa10b27);for(const _0x32aade of _0x16b9c6){const _0x2a2895=new _0x1f44f8(_0xa10b27),_0x49d188=new _0x4e269d(_0xa10b27);_0x49d188['bind'](...Object['keys'](_0x32aade))['to'](_0x32aade),_0x49d188['delegate']('execute')['to'](_0x37b55e),_0x2a2895['children']['add'](_0x49d188),_0x37b55e['items']['add'](_0x2a2895);}return _0x37b55e['items']['delegate']('execute')['to'](this),_0x37b55e['on']('execute',_0x503ed6=>{const _0x53cf14=_0x503ed6['source'];this['fire'](_0x53cf14['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x37b55e;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x4f7a26(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x3897d1,_0x977f60)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x977f60();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function go(_0x15e249){return{'top':_0x15e249['bottom'],'left':_0x15e249['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Co(_0x4eb702,_0x2c2f55){return{'top':_0x4eb702['bottom'],'left':_0x4eb702['left']-(_0x2c2f55['width']-_0x4eb702['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends Cr{['containerView'];['actionsView'];constructor(_0x559a69,_0x587141){super(_0x587141),this['containerView']=new F(_0x559a69,{'showDiff':_0x587141['showDiff'],'areActionsDisabled':_0x587141['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x57fd6d,_0x747dd7)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x747dd7['showDiff']});}),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x42c981,{index:_0x1d3bec})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1d3bec});}),this['containerView']['on']('insertSuggestion',(_0x23ce28,{index:_0x3acc07})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3acc07});}),this['containerView']['on']('rejectSuggestion',(_0x2440c3,{index:_0x4b5bd7})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4b5bd7});}),this['containerView']['on']('mouseOverSuggestion',(_0x26aa2d,{index:_0x3e8f5a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e8f5a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4f5ab4,{index:_0x2bd184})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2bd184});}),this['actionsView']=new th(_0x559a69),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x587141['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x45f5c2){await this['containerView']['updateContent'](_0x45f5c2),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x1f7e6e,_0x4f3e8b){this['containerView']['bodyView']['updatePartState'](_0x1f7e6e,_0x4f3e8b);}['updateSources'](_0x52270b){this['containerView']['updateSources'](_0x52270b);}['getPartView'](_0x59cc17){return this['containerView']['bodyView']['getPartView'](_0x59cc17);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Le extends Cr{['replyContainer'];constructor(_0x2d707f,_0x1790e5){super(_0x1790e5),this['locale']=_0x2d707f,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x3a2ab2(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Oe(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x2916db,renderingStrategy:_0x5f46c5,abortSignal:_0x62e571}){'streaming'===_0x5f46c5?await this['streamIntoElement'](_0x2916db,this['replyContainer']['element'],_0x62e571):this['replyContainer']['element']['innerHTML']=_0x49a0ef(_0x2916db);}['updateSources'](_0x2b4a83){const _0x316a2b=new _r(this['locale']);_0x316a2b['children']['addMany'](_0x2b4a83['map'](_0x1d0663=>new jr(this['locale'],_0x1d0663))),_0x316a2b['isVisible']=!0x0,this['children']['add'](_0x316a2b);}}const kn={'file':_0x44a88a,'document':_0x14043e,'web-resource':_0x2b16a2,'text':_0x44a88a,'selection':_0x36536e},jn='ck-ai-chat-context-chip',Jn='ck-ai-chat-context-chip_wide',Zn='ck-ai-chat-context-chip_document',Nr='ck-ai-chat-context-chip__label',Gr='ck-ai-chat-context-chip__type-icon',Kr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class ao extends _0x4b3349{constructor(_0x160082,_0xc6e528,_0x486d18,_0x3f1cd7,_0x236489=!0x1){super(_0x160082),this['_isAnimationOnEnterEnabled']=_0x3f1cd7,this['_initializeProperties'](_0xc6e528,_0x486d18,_0x236489),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'](_0x2dd003,_0x293381,_0x1063e0){this['set']('label',_0x2dd003['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2dd003['type']),this['set']('id',_0x2dd003['uiId']),this['set']('readonly',_0x293381),this['set']('isLoading',_0x1063e0);}['_setupTemplate'](){const _0xc2b5ed=this['_createIconView'](),_0x23da90=this['_createRemoveButton'](),_0x3827bb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3827bb),'children':this['_createTemplateChildren'](_0xc2b5ed,_0x23da90,_0x3827bb)});}['_createTemplateAttributes'](_0x57e02c){return{'class':[jn,_0x57e02c['if']('itemType',Zn,_0x20af25=>'document'==_0x20af25),_0x57e02c['if']('itemType',Jn,_0x5c5923=>'selection'==_0x5c5923)],'data-cke-tooltip-text':_0x57e02c['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Kr};}['_createTemplateChildren'](_0x985701,_0x932317,_0x5a40db){const _0x2f3d8f=this['_createLabelElement'](_0x5a40db),_0x13f93e=this['_createLoaderIcon']();return this['readonly']?[_0x985701,_0x2f3d8f]:[_0x985701,_0x13f93e,_0x2f3d8f,_0x932317];}['_createLabelElement'](_0x1abb68){return{'tag':'span','attributes':{'class':Nr},'children':[{'text':_0x1abb68['to']('label')}]};}['_createRemoveButton'](){const _0x45dd70=new _0x4b3349(this['locale']);return _0x45dd70['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x311f04}),this['_setupRemoveButtonEvent'](_0x45dd70),_0x45dd70;}['_setupRemoveButtonEvent'](_0x51b7e2){_0x51b7e2['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3dc334=this['bindTemplate'],_0x112966=new _0x1f8dd5();return _0x112966['content']=kn[this['itemType']],_0x112966['extendTemplate']({'attributes':{'class':[Gr,_0x3dc334['if']('isLoading','ck-hidden',_0xabe4a=>_0xabe4a)]}}),_0x112966;}['_handleAnimationEndOnce'](_0x497223,_0x440fe0){if(!_0x497223)return;const _0x5ef7f8=()=>{_0x440fe0(),_0x497223['removeEventListener']('animationend',_0x5ef7f8),_0x497223['removeEventListener']('webkitAnimationEnd',_0x5ef7f8);};_0x497223['addEventListener']('animationend',_0x5ef7f8),_0x497223['addEventListener']('webkitAnimationEnd',_0x5ef7f8);}['_createLoaderIcon'](){const _0xd57328=new De('small');return _0xd57328['bind']('isVisible')['to'](this,'isLoading',_0xa9b52e=>_0xa9b52e),_0xd57328;}}function In(_0x58206e){if(!_0x58206e)return _0x58206e;if(_0x58206e['length']<=0x78)return _0x58206e;const _0xa392b5=_0x58206e['slice'](0x0,0x78),_0x1bdcf5=_0xa392b5['lastIndexOf']('\x20');return(_0x1bdcf5>0x0?_0xa392b5['slice'](0x0,_0x1bdcf5):_0xa392b5)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},ln='300px';class lo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x2dbacf,_0x35077e,_0x26a2d9,_0x419a94,_0x5f3b24){this['_locale']=_0x2dbacf,this['_visibleChips']=_0x35077e,this['_config']={...hn,..._0x26a2d9,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x26a2d9['cssClasses']}},this['_overflowChips']=new _0xe98229(),this['_bodyCollection']=_0x419a94,this['_parentView']=_0x5f3b24||null;}['setContainerElement'](_0xfdb7d4){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xfdb7d4,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 _0x8fe4fb=[...this['_visibleChips'],...this['_overflowChips']],_0x312920=this['_createCalculationContainer'](),_0x7376ab=this['_calculateOverflowInContainer'](_0x312920,_0x8fe4fb),_0x3aa3cd=_0x312920['_ancestorsToRestore'];_0x3aa3cd&&this['_restoreAncestorVisibility'](_0x3aa3cd),_0x312920['remove'](),this['_applyOverflowResults'](_0x8fe4fb,_0x7376ab);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0xca342f({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0xbbe575=new _0x4b3349(this['_locale']);_0xbbe575['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x2722cd=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x2722cd['push'](this['_config']['cssClasses']['controlsButton']),_0xbbe575['extendTemplate']({'attributes':{'class':_0x2722cd}}),_0xbbe575;}['_createShowMoreBalloonPanelView'](){const _0x28592e=new _0x1618b0(this['_locale']);return _0x28592e['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x28592e),_0x28592e;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x2c91d6=>{_0x2c91d6['disableAnimationOnEnter']();});const _0x28eb30=new _0x3a2ab2(this['_locale']);_0x28eb30['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x28eb30);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x25800f=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x25800f?'':'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'](_0x23c6e9){const _0x1819a3=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2702f3=this['_containerElement']?.['classList'];if(_0x2702f3){const _0x56e5b2=_0x2702f3[0x0]||'',_0x6b1840=_0x23c6e9['querySelector']('.'+_0x56e5b2),_0x5c160c=_0x23c6e9['querySelector'](_0x1819a3);return _0x6b1840||_0x5c160c||_0x23c6e9;}return _0x23c6e9['querySelector'](_0x1819a3)||_0x23c6e9;}['_calculateContainerWidth'](){const _0x1292d6=this['_parentView']?.['element']||this['_containerElement'];if(!_0x1292d6)return ln;const _0x50abe4=window['getComputedStyle'](_0x1292d6)['width'];if('auto'===_0x50abe4||'0px'===_0x50abe4||!_0x50abe4){const _0x37c99b=_0x1292d6['parentElement'];if(_0x37c99b){const _0x2faf05=window['getComputedStyle'](_0x37c99b);return'auto'!==_0x2faf05['width']?_0x2faf05['width']:ln;}return ln;}return _0x50abe4;}['_applyCalculationStyles'](_0x17a1f8,_0x57ab1f){this['_config']['cssClasses']['calculationContainer']&&_0x17a1f8['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x17a1f8['style']['width']=_0x57ab1f,_0x17a1f8['style']['position']='absolute',_0x17a1f8['style']['top']='-9999px',_0x17a1f8['style']['left']='-9999px',_0x17a1f8['style']['opacity']='0',_0x17a1f8['style']['pointerEvents']='none',_0x17a1f8['style']['zIndex']='-1',_0x17a1f8['style']['visibility']='visible\x20!important',_0x17a1f8['style']['display']='block\x20!important',_0x17a1f8['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x355b77){_0x355b77['forEach'](({element:_0x3e1065,originalDisplay:_0x2e065a,originalVisibility:_0x12eacc})=>{_0x3e1065['style']['display']=_0x2e065a,_0x3e1065['style']['visibility']=_0x12eacc;});}['_makeAncestorsVisible'](_0x1d3917){const _0x1ea03b=[];let _0x2144b0=_0x1d3917;for(;_0x2144b0&&_0x2144b0!==document['body'];){const _0x171473=window['getComputedStyle'](_0x2144b0);'none'!==_0x171473['display']&&'hidden'!==_0x171473['visibility']||(_0x1ea03b['push']({'element':_0x2144b0,'originalDisplay':_0x2144b0['style']['display'],'originalVisibility':_0x2144b0['style']['visibility']}),_0x2144b0['style']['display']='block',_0x2144b0['style']['visibility']='visible'),_0x2144b0=_0x2144b0['parentElement'];}return _0x1ea03b;}['_createContainerElements'](){let _0x5aa427,_0x4baf68;return this['_parentView']?.['element']?(_0x5aa427=this['_parentView']['element']['cloneNode'](!0x0),_0x4baf68=this['_findTargetContainer'](_0x5aa427)):(_0x5aa427=document['createElement']('div'),_0x4baf68=_0x5aa427),{'calculationContainer':_0x5aa427,'targetContainer':_0x4baf68};}['_createCalculationContainer'](){const {calculationContainer:_0x297eb3,targetContainer:_0x26b3cc}=this['_createContainerElements'](),_0x180abc=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x297eb3,_0x180abc);const _0x2b0746=this['_parentView']?.['element']||this['_containerElement'],_0x5185ff=_0x2b0746?.['parentElement'];_0x5185ff?_0x5185ff['appendChild'](_0x297eb3):document['body']['appendChild'](_0x297eb3),_0x297eb3['_targetContainer']=_0x26b3cc;const _0x496f02=this['_makeAncestorsVisible'](_0x5185ff||null);return _0x297eb3['offsetWidth'],_0x297eb3['_ancestorsToRestore']=_0x496f02,_0x297eb3;}['_calculateOverflowInContainer'](_0x420595,_0x18e0ec){const _0x48b605=_0x420595['_targetContainer']||_0x420595,_0x235de8=[],{rowCount:_0x4d53d0}=this['_renderChipsAndCountRows'](_0x48b605,_0x18e0ec);if(_0x4d53d0<=this['_config']['maxVisibleRows'])return _0x235de8;const _0x4af219=_0x18e0ec['slice']();for(;_0x4af219['length']>0x0;){if(this['_testButtonFit'](_0x420595,_0x48b605,_0x4af219)){const _0x1627fc=_0x18e0ec['filter'](_0xd97539=>!_0x4af219['includes'](_0xd97539));_0x235de8['push'](..._0x1627fc);break;}if(!_0x4af219['pop']())break;}return _0x235de8;}['_renderChipsAndCountRows'](_0x191fec,_0x5a8625){_0x191fec['innerHTML']='',_0x5a8625['forEach'](_0x197a4f=>{if(_0x197a4f['element']){const _0x36cd27=_0x197a4f['element']['cloneNode'](!0x0);_0x191fec['appendChild'](_0x36cd27);}}),_0x191fec['offsetWidth'];const _0x5d5490=_0x191fec['children'],_0x1f0ef4=[];return Array['from'](_0x5d5490)['forEach'](_0x2d6ea7=>{const _0x5a205f=_0x2d6ea7['getBoundingClientRect']()['top'];_0x1f0ef4['some'](_0x4d0cd8=>Math['abs'](_0x4d0cd8-_0x5a205f)<this['_config']['rowDetectionTolerance'])||_0x1f0ef4['push'](_0x5a205f);}),{'rowCount':_0x1f0ef4['length']};}['_createMockButton'](){const _0x3c7200=document['createElement']('button');return _0x3c7200['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x3c7200['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x3c7200['textContent']='+\x201',_0x3c7200;}['_testButtonFit'](_0x2965ad,_0x200e94,_0x2ace5b){this['_renderChipsAndCountRows'](_0x200e94,_0x2ace5b);const _0x2b4dfe=this['_createMockButton']();_0x2965ad['appendChild'](_0x2b4dfe),_0x2965ad['offsetWidth'];const _0x45d7a5=[..._0x200e94['children'],_0x2b4dfe],_0x127d53=[];_0x45d7a5['forEach'](_0xa43f3f=>{const _0x4cf6b4=_0xa43f3f['getBoundingClientRect']()['top'];_0x127d53['some'](_0xfe12=>Math['abs'](_0xfe12-_0x4cf6b4)<this['_config']['rowDetectionTolerance'])||_0x127d53['push'](_0x4cf6b4);});const _0x43d23d=_0x127d53['length'];return _0x2b4dfe['remove'](),_0x43d23d<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x52fc71,_0x24ea11){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x52fc71['forEach'](_0x2194f8=>{_0x24ea11['includes'](_0x2194f8)?this['_overflowChips']['add'](_0x2194f8):this['_visibleChips']['add'](_0x2194f8);});}['_updateOverflowUI'](_0x5951cb){if(_0x5951cb>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5951cb>0x0&&this['_showMoreButtonView']){const _0x5652fd=''+this['_config']['showMoreLabelPrefix']+(_0x5951cb<0x63?_0x5951cb:'99');this['_showMoreButtonView']['label']=_0x5652fd;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x65aac5,_0x50420c){this['_distributeChips'](_0x65aac5,_0x50420c),this['_updateOverflowUI'](_0x50420c['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4076e6=>{_0x4076e6[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 _0x4e6ec6=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4e6ec6['width']||0x0===_0x4e6ec6['height'])return!0x1;const _0x388945=window['innerHeight']||document['documentElement']['clientHeight'],_0x41a41a=window['innerWidth']||document['documentElement']['clientWidth'],_0xb3bd6b=0xc8;return _0x4e6ec6['bottom']>=-0xc8&&_0x4e6ec6['top']<=_0x388945+_0xb3bd6b&&_0x4e6ec6['right']>=-0xc8&&_0x4e6ec6['left']<=_0x41a41a+_0xb3bd6b;}}const Wr='ck-ai-chat__feed__context-chips',Yr='ck-ai-chat-context-chips-wrapper',$r='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls-button',Xr='ck-ai-chat-controls_context_show-more-button',Jr='ck-ai-chat-context-controls__show-more-balloon-panel';class eh extends _0x3a2ab2{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1b3fda,_0x2d5bc9,_0x2f092c){super(_0x1b3fda),this['_bodyCollection']=_0x2f092c,this['_createContextChips'](_0x2d5bc9);const _0x1ada59={'cssClasses':{'showMoreButton':Xr,'showMoreBalloon':Jr,'overflowContainer':$r,'controlsButton':Qr}};this['_overflowManager']=new lo(_0x1b3fda,this['_contextChips'],_0x1ada59,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x24b441=this['element']['querySelector']('.'+Yr);_0x24b441&&(this['_overflowManager']['setContainerElement'](_0x24b441),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4b2a01){for(const _0x12047e of _0x4b2a01){const _0x619917=new ao(this['locale'],_0x12047e,!0x0,!0x1);this['_contextChips']['add'](_0x619917);}}}class Me extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3c03e3,_0x35ddca,_0x3c6d5b){super(_0x35ddca),this['_locale']=_0x3c03e3,this['_bodyCollection']=_0x3c6d5b,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 eh(this['_locale'],this['options']['contextItems']['filter'](_0x474fb8=>!_0x474fb8['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x3a2ab2(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Rt extends Cr{constructor(_0x5e3fc3,_0x2bb74a){super(_0x2bb74a);const {isWebSearchEnabled:_0x202b3c,isReasoningEnabled:_0x254a09}=_0x2bb74a['capabilities'],_0x2db8f8=[];let _0x4216e3='';_0x202b3c&&_0x254a09?(_0x4216e3=Yn(_0x5e3fc3,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x2db8f8['push'](i_(t_)),_0x2db8f8['push'](i_(_0x2eac00))):_0x202b3c?(_0x4216e3=Yn(_0x5e3fc3,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x2db8f8['push'](i_(t_))):_0x254a09&&(_0x4216e3=Yn(_0x5e3fc3,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x2db8f8['push'](i_(_0x2eac00))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4216e3?'':'ck-hidden']}});const _0x21004f=new _0x3a2ab2();_0x21004f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x2db8f8,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4216e3]}]}),this['children']['add'](_0x21004f);}}function i_(_0x25e105){const _0x2ace8f=new _0x1f8dd5();return _0x2ace8f['content']=_0x25e105,_0x2ace8f;}const ps=['wheel','touchstart','pointerdown','keydown'],ws=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Ae{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x409331){this['element']=_0x409331,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x2448fa of ps){const _0x2be133='keydown'!==_0x2448fa;this['element']['addEventListener'](_0x2448fa,this['_onUserEvent']['bind'](this),{'passive':_0x2be133,'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'](_0x19c586){if(this['isRunning']){if('keydown'===_0x19c586['type']){const _0x13cab2=_0x19c586['key'];if(!ws['includes'](_0x13cab2))return;}_0x19c586 instanceof WheelEvent?_0x19c586['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x408b26,scrollHeight:_0xc81656,clientHeight:_0x2d281d}=this['element'];return _0xc81656-_0x408b26-_0x2d281d<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Fe extends _0x3a2ab2{constructor(_0x5d7052,_0x4b2931){super(_0x5d7052),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x4b2931)});}['_createSkeletonItems'](_0x586366){const _0x439a5c=['ck','ck-ai-skeleton__item'];return _0x586366['map'](_0x3db5b7=>{let _0x1a1769='';switch(_0x3db5b7['attributes']['align']){case'right':_0x1a1769='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1a1769='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1a1769='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x3db5b7['tag'],'attributes':{'class':[..._0x439a5c,_0x3db5b7['attributes']['class']?_0x3db5b7['attributes']['class']:''],'style':'width:\x20'+_0x3db5b7['attributes']['width']+';\x20height:\x20'+_0x3db5b7['attributes']['height']+';'+_0x1a1769}};});}}const Be={'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':$i(0x5,'100%','44px','right'),'aiChatResources':$i(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function $i(_0x140649,_0x44fbc9,_0x1da035,_0x250e05){return new Array(_0x140649)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x44fbc9,'height':_0x1da035,'align':_0x250e05}}));}class pi extends _0x3a2ab2{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x4e7bce,_0x1ec5c9){super(_0x4e7bce),this['_bodyCollection']=_0x1ec5c9,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Ae(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x2d60f2,_0x213717){let _0x14e71b;_0x14e71b='ai-reply'===_0x2d60f2?new Le(this['locale'],_0x213717):'ai-suggestion-reply'===_0x2d60f2?new ke(this['locale'],_0x213717):'user-message'===_0x2d60f2?new Me(this['locale'],_0x213717,this['_bodyCollection']):'interaction-header'===_0x2d60f2?new Rt(this['locale'],_0x213717):new Te(_0x213717),this['children']['add'](_0x14e71b);}async['updateReplyItem']({id:_0x58aeb8,parsedContent:_0x3dcf88,renderingStrategy:_0x458c69,abortSignal:_0x54ca47}){const _0x1f5472=this['getItemById'](_0x58aeb8);if(!(_0x1f5472 instanceof Le))throw new _0x599d16('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1f5472,'id':_0x58aeb8,'parsedContent':_0x3dcf88});await _0x1f5472['updateContent']({'parsedContent':_0x3dcf88,'renderingStrategy':_0x458c69,'abortSignal':_0x54ca47});}async['updateWebSources'](_0x123ca2,_0x64798){const _0x3fd2f4=this['getItemById'](_0x123ca2);if(_0x3fd2f4 instanceof ke)_0x3fd2f4['updateSources'](_0x64798);else{if(!(_0x3fd2f4 instanceof Le))throw new _0x599d16('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3fd2f4,'id':_0x123ca2,'sources':_0x64798});_0x3fd2f4['updateSources'](_0x64798);}}async['updateSuggestionItem']({id:_0x33bfed,parts:_0x4bbcf6,renderingStrategy:_0x1f2e86,abortSignal:_0x3973ee}){const _0x12882c=this['getItemById'](_0x33bfed);if(!(_0x12882c instanceof ke))throw new _0x599d16('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x12882c,'id':_0x33bfed,'parts':_0x4bbcf6});await _0x12882c['updateContent']({'parts':_0x4bbcf6,'renderingStrategy':_0x1f2e86,'abortSignal':_0x3973ee});}['updateSuggestionPartState']({id:_0x2fec12,index:_0xf0c39b,state:_0x58b06e}){const _0x1ddb6c=this['getItemById'](_0x2fec12);if(!(_0x1ddb6c instanceof ke))throw new _0x599d16('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2fec12});_0x1ddb6c['updatePartState'](_0xf0c39b,_0x58b06e);}['markItemAsDone'](_0x39efd3){this['getItemById'](_0x39efd3)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2577ce=>_0x2577ce['options']['id']);}['removeItem'](_0x208704){this['children']['remove'](this['getItemById'](_0x208704));}['scrollToSuggestion'](_0x108416,_0x2c3b93){const _0x4301e9=this['getItemById'](_0x108416);if(!(_0x4301e9 instanceof ke))return void _0x1f6f14('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x108416,'partIndex':_0x2c3b93});const _0xeb07f8=_0x4301e9['getPartView'](_0x2c3b93);_0xeb07f8?rt({'target':_0xeb07f8['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x1f6f14('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x108416,'partIndex':_0x2c3b93});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x5ee2c4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x5ee2c4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3a1a8b=new Fe(this['locale'],Be['aiFeed']);return _0x3a1a8b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0xd0d4ed=>!_0xd0d4ed)]}}),_0x3a1a8b;}['_createFeedItems'](){const _0xfb57c3=new _0x3a2ab2(this['locale']);return _0xfb57c3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xfb57c3;}['_createFeedLoader'](){const _0x357b5a=new _0x3a2ab2(this['locale']);return _0x357b5a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x535cff=>!_0x535cff)]},'children':this['_createLoaderChildren']()}),_0x357b5a;}['_createLoaderChildren'](){const _0x60ee4a=new De();return _0x60ee4a['isVisible']=!0x0,[_0x60ee4a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4fab0c){const _0x5ee68c=this['children']['find'](_0x4a518c=>_0x4a518c['options']['id']['includes'](_0x4fab0c));if(!_0x5ee68c)throw new _0x599d16('ai-chat-feed-view-item-not-found',this,{'id':_0x4fab0c});return _0x5ee68c;}['setLoadingMessage'](_0xf23019){this['set']('loadingMessage',_0xf23019);}['toggleLoadingSkeleton'](_0x352579){this['set']('isLoadingSkeletonVisible',_0x352579);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Vr extends _0x586ac5{['filter'](){let _0x334457=0x0;for(const _0xd4bb33 of this['items'])_0x334457+=_0xd4bb33['items']['length'];return{'resultsCount':_0x334457,'totalItemsCount':_0x334457};}}class Pe extends _0x7ab78d{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1147f2,_0x213f63){super(_0x1147f2,{'queryView':{'label':'','creator':_0x456b9c,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Vr(_0x1147f2),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x213f63,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',(_0x43a519,_0x43ea31)=>!_0x43a519&&!_0x43ea31),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2cd72b,_0x35c4a1)=>{this['isUploadInProgress']||this['isEmpty']||_0x2cd72b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x35c4a1());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3dd70d=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3dd70d)return this['queryView']['errorText']=Yn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x31795c=_0x512f25(_0x3dd70d);this['fire']('sendUserMessage',_0x31795c),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x1dc785){this['queryView']['fieldView']['set']('placeholder',_0x1dc785);}['_createSubmitButton'](){const _0x3a9c9e=new _0x4b3349(this['locale']);return _0x3a9c9e['set']({'icon':_0xb7829d,'label':Yn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x3a9c9e['on']('execute',()=>{this['submit']();}),_0x3a9c9e;}['setIsUploadInProgress'](_0x3cc91a){this['isUploadInProgress']=_0x3cc91a;}['_setUpAddContextButtonPositioning'](){const _0x3c1601=this['locale'],_0x42ad7e=()=>{_0x34a915['window']['requestAnimationFrame'](()=>{if(_0x33d5ba(this['element'])){const _0x4b59d4=new _0x5ed23e(this['queryView']['fieldView']['element']),_0x37e7b2=new _0x5ed23e(this['_addContextButtonView']['element']),_0x367e6=_0x4b59d4['width'],_0x5c2203='rtl'===_0x3c1601['uiLanguageDirection']?'right':'left';_0x4b59d4['excludeScrollbarsAndBorders']();const _0x14d6e7=_0x367e6-_0x4b59d4['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5c2203]='calc('+(_0x367e6-_0x37e7b2['width']-_0x14d6e7)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x42ad7e),this['on']('render',()=>{_0x42ad7e(),this['_queryViewResizeObserver']=new _0x31ce92(this['queryView']['fieldView']['element'],()=>{_0x42ad7e();});});}}const Zr='ck-ai-chat__prompt-capabilities',ea='ck-ai-chat-controls-button',ia='ck-ai-chat-controls-button--commands',sa='ck-ai-chat-controls__model-selection',na='ck-ai-chat-controls__model-selection__item-name',ra='ck-ai-chat-controls__model-selection__item-description',oa='ck-ai-chat-controls__model-selection__item-capabilities',aa='n';class ve extends _0x3a2ab2{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x58524a){super(_0x58524a),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelSelectorVisible',_0x2d4c98=>_0x2d4c98),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x32c2c2=>_0x32c2c2?this['_modelSelectionDropdown']['buttonView']['label']:Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xccb172=>_0xccb172),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x230acf=>_0x230acf),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5e5f92=>!_0x5e5f92),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x84a6f8=>Yn(this['locale'],_0x84a6f8?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x125348=>_0x125348),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x34dc87=>!_0x34dc87),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x222cb0=>Yn(this['locale'],_0x222cb0?'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 _0xe98229(),_0x291cf2(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x98b399,_0x474f46){if(this['set']('modelSelectorVisible',!(_0x474f46&&_0x98b399['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x98b399?.['length'])for(const _0x565984 of _0x98b399){const _0x574a9b=new _0x45b9d4({'label':_0x565984['name'],'withText':!0x0,'role':'menuitemradio','id':_0x565984['id'],'model':_0x565984});_0x574a9b['bind']('isOn')['to'](this,'activeModelId',_0x588078=>_0x588078===_0x565984['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x574a9b,'labelView':new ha(this['locale'],_0x565984)});}}['setWebSearch'](_0x599184){this['set']('webSearchActive',_0x599184);}['setReasoning'](_0x1a075e){this['set']('reasoningActive',_0x1a075e);}['setModel'](_0x3e9c32){if(!_0x3e9c32)return;this['activeModelId']=_0x3e9c32['id'],this['activeModelName']=_0x3e9c32['name']||_0x3e9c32['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x3e9c32['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x3e9c32['name']);const _0x5984f2=_0x3e9c32['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5984f2),this['_webSearchButton']['set']('isVisible',_0x5984f2);const _0x5432c5=_0x3e9c32['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x5432c5),this['_reasoningButton']['set']('isVisible',_0x5432c5);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x29cbea){this['set']('modelSelectorEnabled',!0x1),_0x29cbea&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x4eeee9=new _0x4b3349();return _0x4eeee9['set']({'label':Yn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':t_,'class':ea,'isToggleable':!0x0,'tooltipPosition':aa}),_0x4eeee9['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4eeee9;}['_createReasoningButton'](){const _0x27cfed=new _0x4b3349();return _0x27cfed['set']({'label':Yn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2eac00,'class':ea,'isToggleable':!0x0,'tooltipPosition':aa}),_0x27cfed['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x27cfed;}['_createCommandsButton'](){const _0x13ff96=new _0x4b3349();return _0x13ff96['set']({'label':Yn(this['locale'],'AI_CHAT_COMMANDS'),'icon':yt,'withText':!0x0,'class':ea,'isToggleable':!0x0,'tooltip':Yn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':aa}),_0x13ff96['extendTemplate']({'attributes':{'class':[ia]}}),_0x13ff96['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x13ff96;}['_createModelSelectionDropdown'](){const _0x1895a7=_0x45dc52(this['locale']);return _0x1895a7['set']({'panelPosition':'ne','class':[sa]}),_0x1895a7['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':aa}),this['listenTo'](_0x1895a7,'execute',_0x1e89ee=>{this['fire']('selectModel',_0x1e89ee['source']['model']);}),_0x1895a7;}['_createModelNameView'](){const _0x2608a8=new Jo(this['locale']);return _0x2608a8['bind']('text')['to'](this,'activeModelName',_0x257273=>_0x257273??''),_0x2608a8['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x52acb3,_0x7a5c06)=>!_0x52acb3&&!_0x7a5c06?.['toLowerCase']()['startsWith']('agent')),_0x2608a8;}}let ha=class extends _0x39c654{constructor(_0x113e65,_0x299078){super();const _0x3982fd=this['bindTemplate'],_0x3a5ec8=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3982fd['to']('style'),'id':_0x3982fd['to']('id')},'children':[{'tag':'div','attributes':{'class':[na]},'children':[{'text':_0x3982fd['to']('text')}]},{'tag':'div','attributes':{'class':[ra]},'children':[{'tag':'span','children':[{'text':_0x299078['description']}]}]},{'tag':'div','attributes':{'class':[oa]},'children':_0x3a5ec8}]}),_0x3a5ec8['addMany'](this['_getCapabilityParts'](_0x113e65,t_,'AI_CHAT_SEARCH_WEB',_0x299078['capabilities']['webSearch']?.['enabled']??!0x1)),_0x3a5ec8['addMany'](this['_getCapabilityParts'](_0x113e65,_0x2eac00,'AI_CHAT_REASONING',_0x299078['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2c7ea9,_0x90d99c,_0x2cbfe7,_0x40061b){const _0x16e4d2=new _0x1f8dd5();_0x16e4d2['content']=_0x90d99c;const _0x36feae=new _0x3a2ab2(_0x2c7ea9);_0x36feae['setTemplate']({'tag':'span','children':[{'text':Yn(_0x2c7ea9,_0x2cbfe7)+':\x20'}]});const _0x26b342=new _0x3a2ab2(_0x2c7ea9);return _0x26b342['setTemplate']({'tag':'span','children':[{'text':Yn(_0x2c7ea9,_0x40061b?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x16e4d2,_0x36feae,_0x26b342];}};class Jo extends _0x3a2ab2{constructor(_0x4014d0){super(_0x4014d0),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x52fa10=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x52fa10['if']('isVisible','ck-hidden',_0x4b2360=>!_0x4b2360)]},'children':[{'text':_0x52fa10['to']('text')}]});}}const ca='ck-ai-chat-context-controls__url-form',la='ck-ai-chat-context-controls__url-input-section';class Vo extends _0x3a2ab2{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4824e5){super(_0x4824e5),this['focusTracker']=new _0x14ef6c(),this['keystrokes']=new _0x4f7a26(),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 _0x3d067c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x2e4fd2=>{this['focusTracker']['add'](_0x2e4fd2['element']),this['keystrokes']['listenTo'](_0x2e4fd2['element']);}),_0x4e85c1({'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'](_0x424a67){this['urlInputField']['errorText']=_0x424a67,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x49dc0a=new _0x4b3349(this['locale']);return _0x49dc0a['set']({'icon':_0x1a2643,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0x49dc0a;}['_createUrlInputField'](){const _0x9f5172=new _0xaf91ac(this['locale'],_0x5d068d);return _0x9f5172['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x9f5172['fieldView']['set']({'placeholder':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x9f5172;}['_createConfirmButton'](){const _0x2f0552=new _0x4b3349(this['locale']);return _0x2f0552['set']({'icon':_0x112b00,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2f0552;}['_setupTemplate'](){const _0x553f6d=new _0x20b76f(this['locale'],{'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x553f6d['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ca,'tabindex':'-1'},'children':[_0x553f6d,{'tag':'div','attributes':{'class':la},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x4512e6=>{_0x4512e6['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4991e8,_0x293e94)=>{this['clear'](),this['fire']('cancel'),_0x293e94();});}['_handleSubmit'](){const _0x1ed9d1=this['getValue']()['trim']();_0x1ed9d1?this['_isValidUrl'](_0x1ed9d1)?(this['clearError'](),this['fire']('submitUrl',_0x1ed9d1)):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x38e4ca=this['getValue']()['trim'](),_0x4ab16a=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x38e4ca['length']>0x0&&!_0x4ab16a;}['_isValidUrl'](_0x4eb5c4){try{return!!new URL(_0x4eb5c4);}catch{return!0x1;}}}const da='ck-ai-chat-resources__item',ua='ck-ai-chat-resources__item--in-context',_a='ck-ai-chat-resources__item-title',Ia='ck-ai-chat-resources__item__icon';class tc extends _0x1f44f8{['resource'];['_titleView'];['_iconView'];constructor(_0x126e1a,_0x3f43df){super(_0x126e1a),this['resource']=_0x3f43df,this['set']('isInContext',!!_0x3f43df['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x178041){if(_0x178041['isInContext'])return _0x112b00;switch(_0x178041['type']){case xe['DOCUMENT']:return _0x14043e;case xe['URL']:return _0x2b16a2;case xe['FILE']:case xe['TEXT']:return _0x44a88a;default:return _0x24e0c5;}}['highlightText'](_0x7a82ca){if(!_0x7a82ca||''===_0x7a82ca['trim']())return void this['_titleView']['highlightText'](null);const _0xae35d4=new RegExp(_0x1c0115(_0x7a82ca),'gi');this['_titleView']['highlightText'](_0xae35d4);}['updateResourceState'](_0x146d38){this['resource']['isInContext']=_0x146d38,this['isInContext']=_0x146d38,this['_updateIcon']();}['_createTitleView'](){const _0x186b5c=new _0x200fd8();return _0x186b5c['text']=this['resource']['label'],_0x186b5c['extendTemplate']({'tag':'span','attributes':{'class':[_a]}}),_0x186b5c;}['_createIconView'](){const _0x20a455=new _0x1f8dd5();return _0x20a455['content']=this['getResourceIcon'](this['resource']),_0x20a455;}['_setupTemplate'](){const _0x1ace48=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[da,_0x1ace48['if']('isVisible','ck-hidden',_0xebf447=>!_0xebf447),_0x1ace48['if']('isInContext',ua)]},'children':[{'tag':'div','attributes':{'class':[Ia]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1ace48['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Aa='ck-ai-chat-resources__list';class Ur extends _0x586ac5{['_source'];constructor(_0x30bf8f,_0x5ce5b2){super(_0x30bf8f),this['_source']=_0x5ce5b2,this['extendTemplate']({'attributes':{'class':[Aa]}});}['setResources'](_0x39f4ea,_0xa1a781){this['items']['clear']();let _0x548492=_0x39f4ea;if(this['_source']['useDefaultFiltering']&&_0xa1a781&&''!==_0xa1a781['trim']()){const _0x594f30=new RegExp(_0xa1a781['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x548492=_0x39f4ea['filter'](_0x5a63e5=>_0x594f30['test'](_0x5a63e5['label']));}for(const _0x38b0bf of _0x548492){const _0x5be2db=new tc(this['locale'],_0x38b0bf);_0x5be2db['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x38b0bf);}),this['items']['add'](_0x5be2db);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xa1a781);}['highlightText'](_0x1244c4){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x3d7fd5=>{_0x3d7fd5['highlightText'](_0x1244c4);});}['updateResourceState'](_0x5d77fb,_0x3e7c0e){for(const _0x39e3c3 of this['items']){const _0xc89a6b=_0x39e3c3;_0xc89a6b['resource']['id']===_0x5d77fb&&_0xc89a6b['updateResourceState'](_0x3e7c0e);}}['_handleResourceSelection'](_0x4240a0,_0x224e6e){this['fire']('addResourceToContext',{'source':_0x4240a0,'resource':_0x224e6e});}}class Dr extends _0xaf91ac{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x111739){const t=_0x111739['t'],_0x594afa={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x5d068d,'label':Yn(_0x111739,'AI_CHAT_SEARCH_RESOURCES')};super(_0x111739,_0x594afa['creator']),this['label']=_0x594afa['label'],this['_viewConfig']=_0x594afa,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x111739,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4c454a){this['fire']('search',_0x4c454a);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x1f8dd5(),this['iconView']['content']=_0x2b1e17,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x34abff,t){this['resetButtonView']=new _0x4b3349(_0x34abff),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x564668,'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',_0x9d9d7d=>!_0x9d9d7d),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class Br extends _0x3a2ab2{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xa73662,_0x24bb8c){super(_0xa73662),this['_source']=_0x24bb8c,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x437e2c=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x4346f0([_0x437e2c,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new Dr(this['locale']);}['_createSearchSection'](){const _0x3a71b7=new _0x3a2ab2(this['locale']);return _0x3a71b7['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5730ad,_0x51c6c3)=>{this['loadResources'](_0x51c6c3),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x51c6c3);}),_0x3a71b7;}['_createResourcesListView'](){const _0xb884bb=new Ur(this['locale'],this['_source']);return _0xb884bb['delegate']('addResourceToContext')['to'](this),_0xb884bb['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xb884bb;}['_createSkeletonView'](){const _0x135112=new Fe(this['locale'],Be['aiChatResources']);return _0x135112['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0xa86ae7=>!_0xa86ae7)]}}),_0x135112;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4f1f11){const _0x23cefa=_0x190955();this['_latestLoadResourcesUid']=_0x23cefa,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4f1f11,'uid':_0x23cefa}),this['isLoading']=!0x0;}['setResources'](_0x1f445a,_0x4f3ac5){if(_0x4f3ac5&&_0x4f3ac5!==this['_latestLoadResourcesUid'])return;const _0x2a7182=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1f445a,_0x2a7182),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x270921,_0xb2aa1c){this['_resourcesListView']['updateResourceState'](_0x270921,_0xb2aa1c);}}const ga='ck-ai-chat-context-controls__source-balloon-panel',ma='ck-button-icon\x20ck-button-back',pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class fo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x156b29,_0x286c34,_0x188a0f){this['_locale']=_0x156b29,this['_bodyCollection']=_0x286c34,this['_config']=_0x188a0f;}['showSourceResourcesBalloon'](_0x6602ed){let _0x503973=this['_sourceResourceBalloons']['get'](_0x6602ed['id']);_0x503973||(_0x503973=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x6602ed['id'],_0x503973),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x503973)),this['_addSourceResourceContent'](_0x503973,_0x6602ed),_0x503973['show']();const _0x2c1a39=this['_config']['getTargetElement']();_0x2c1a39&&_0x503973['pin']({'target':_0x2c1a39,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x34e4d3,_0x21a8b2,_0x1d1653){const _0x43e823=this['_sourceResourceBalloons']['get'](_0x34e4d3);if(!_0x43e823)return;const _0x504d9d=this['_getResourcesViewFromBalloon'](_0x43e823);_0x504d9d&&_0x504d9d['setResources'](_0x21a8b2,_0x1d1653);}['closeSourceResourceBalloon'](_0x55240c){const _0x38a9a3=this['_sourceResourceBalloons']['get'](_0x55240c);_0x38a9a3&&requestAnimationFrame(()=>{_0x38a9a3['hide'](),this['_sourceResourceBalloons']['delete'](_0x55240c),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x55a211 of this['_sourceResourceBalloons']['values']())if(_0x55a211['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x55f86b,_0x5af428,_0x269cb1){const _0x3176b1=this['_sourceResourceBalloons']['get'](_0x55f86b);if(!_0x3176b1||!_0x3176b1['isVisible'])return;const _0x6900e1=this['_config']['getTargetElement']();if(!_0x6900e1)return;_0x3176b1['pin']({'target':_0x6900e1,'limiter':this['_config']['getLimiterElement']()});const _0x2229da=this['_getResourcesViewFromBalloon'](_0x3176b1);_0x2229da&&_0x2229da['updateResourceState'](_0x5af428,_0x269cb1);}['destroy'](){for(const _0x5e2615 of this['_sourceResourceBalloons']['values']())_0x5e2615['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4fa754=new _0x1618b0(this['_locale']);return _0x4fa754['extendTemplate']({'attributes':{'class':ga}}),this['_bodyCollection']['add'](_0x4fa754),_0x4fa754;}['_addSourceResourceContent'](_0x559e3a,_0x1bdb42){_0x559e3a['content']['clear']();const _0x39a8e7=this['_createBalloonHeader'](_0x559e3a,_0x1bdb42);_0x559e3a['content']['add'](_0x39a8e7);const _0x4bf860=this['_createBalloonResourcesView'](_0x1bdb42);_0x559e3a['content']['add'](_0x4bf860);}['_createBalloonHeader'](_0x597781,_0x17cbdb){const _0x4d777b=this['_createBackButton'](_0x597781),_0x2e3635=new _0x20b76f(this['_locale'],{'label':_0x17cbdb['label'],'class':pa});return _0x2e3635['children']['add'](_0x4d777b,0x0),_0x2e3635;}['_createBackButton'](_0x2c3912){const _0x304dd9=new _0x4b3349(this['_locale']);return _0x304dd9['set']({'icon':_0x1a2643,'tooltip':Yn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ma}),_0x304dd9['on']('execute',()=>{_0x2c3912['hide'](),this['_config']['onBackToContext']();}),_0x304dd9;}['_createBalloonResourcesView'](_0x383ad1){const _0x37467=new Br(this['_locale'],_0x383ad1);return _0x37467['on']('loadSourceResources',(_0x5a3610,_0x303bcc)=>{this['_config']['onLoadSourceResources'](_0x303bcc);}),_0x37467['on']('addResourceToContext',(_0x4eab20,_0x1d9558)=>{this['_config']['onResourceSelected'](_0x1d9558['source'],_0x1d9558['resource']),this['closeSourceResourceBalloon'](_0x383ad1['id']);}),_0x37467;}['_getResourcesViewFromBalloon'](_0x391c33){const _0x2b4742=_0x391c33['content']['get'](0x1);return _0x2b4742 instanceof Br?_0x2b4742:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x206293){_0xca342f({'emitter':_0x206293,'contextElements':[_0x206293['element']],'callback':()=>{_0x206293['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x206293['isVisible']});}}const Ve=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Po='ck-ai-chat-context-controls',Ro='ck-ai-chat-context-controls__pending-contexts',Uo='ck-ai-chat-context-controls__add-context-balloon-panel',Lo='ck-ai-chat-context-controls__add-context-button',No='ck-ai-chat-context-controls__url-balloon-panel',Mo='ck-ai-chat-context-controls__balloon-button',Ho='ck-ai-chat-context-controls__balloon-button-source',uo='ck-ai-chat-controls-button',jo='ck-ai-chat-context-chips-wrapper-balloon',xo='ck-ai-chat-controls_context_show-more-button',mo='ck-ai-chat-context-controls__show-more-balloon-panel',Xo='ck-ai-chat',Do=[_0x1618b0['defaultPositions']['northArrowSouthWest'],_0x1618b0['defaultPositions']['northArrowSouth'],_0x1618b0['defaultPositions']['northArrowSouthEast'],_0x1618b0['defaultPositions']['southArrowNorthWest'],_0x1618b0['defaultPositions']['southArrowNorth'],_0x1618b0['defaultPositions']['southArrowNorthEast']];class _e extends _0x3a2ab2{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x5359dc,_0x59cd50){super(_0x5359dc),this['bodyCollection']=_0x59cd50,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5359dc),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5359dc),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5359dc),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5359dc,_0x59cd50);const _0x495322={'cssClasses':{'showMoreButton':xo,'showMoreBalloon':mo,'overflowContainer':jo,'controlsButton':uo}};this['_overflowManager']=new lo(_0x5359dc,this['_currentContextsChips'],_0x495322,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'](_0x3f6503,_0x502aa7){const _0x5d7ce0=this['_createContextButton'](_0x3f6503,'current',!0x0,_0x502aa7);this['_addContextToCollection'](_0x5d7ce0,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3cd273){this['_removeContextFromCollection'](_0x3cd273,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3cd273,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4c3628,_0x4b4012){let _0x194472=this['_currentContextsChips']['find'](_0xa69dac=>_0xa69dac['id']===_0x4c3628);_0x194472||(_0x194472=this['_overflowManager']['overflowChips']['find'](_0x4478ea=>_0x4478ea['id']===_0x4c3628)),_0x194472&&(_0x194472['isLoading']=_0x4b4012);}['setConversationContext'](_0x5b0a06){this['_conversationContextsChips']['clear']();for(const _0x24df03 of _0x5b0a06){const _0x58225e=this['_createContextButton'](_0x24df03,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x58225e,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x27ab91,_0x4532ae,_0x333cd2){this['_resourcesBalloonView']['updateResourceState'](_0x27ab91,_0x4532ae,_0x333cd2);}['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'](_0x4c42d9){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x4c42d9),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x40b37a,_0x4a6e02,_0x193217,_0x5dcabb){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x40b37a,_0x193217,_0x5dcabb);}['closeSourceResourceBalloon'](_0x559325){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x559325),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x44a0a3){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x44a0a3),this['_setAddContextButtonEnabled'](_0x44a0a3);}['_setAddContextButtonEnabled'](_0x4c9781){const _0x286c59=!_0x4c9781['document']['isHidden']&&_0x4c9781['document']['enabled'],_0xb9ddad=_0x4c9781['urls']['enabled'],_0x2c5cc8=_0x4c9781['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x286c59||_0xb9ddad||_0x2c5cc8;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Po,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Ro},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x1e43ce){const _0x260cc9=new _0x4b3349(_0x1e43ce);return _0x260cc9['set']({'label':Yn(_0x1e43ce,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':uo+'\x20'+Lo,'icon':_0x1d4e36,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x260cc9;}['_createAddContextBalloonPanelView'](_0x188629){return this['_createBaseBalloonPanel'](_0x188629,Uo);}['_createUrlBalloonPanelView'](_0x2f90d3){const _0x2435ec=this['_createBaseBalloonPanel'](_0x2f90d3,No);return this['_addUrlContent'](_0x2435ec,_0x2f90d3),_0x2435ec;}['_createResourcesBalloonView'](_0xd058d,_0x4eae8e){return new fo(_0xd058d,_0x4eae8e,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});},'onResourceSelected':(_0x92460c,_0x1d5fb5)=>{this['fire']('addResourceToContext',{'source':_0x92460c,'resource':_0x1d5fb5});},'onLoadSourceResources':_0x455761=>{this['fire']('loadSourceResources',_0x455761);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Xo)||document['body'];}['_createBaseBalloonPanel'](_0xe7a1c8,_0xa77c03){const _0x58bcf7=new _0x1618b0(_0xe7a1c8);return _0x58bcf7['extendTemplate']({'attributes':{'class':_0xa77c03}}),this['bodyCollection']['add'](_0x58bcf7),_0x58bcf7;}['_setBalloonPanelContent'](_0x454dc8,_0xb729fc,_0x938d65){if(_0x454dc8['content']['clear'](),!_0x938d65['document']['isHidden']&&_0x938d65['document']['enabled']){const _0x4a8d9c=this['_createBalloonButton'](_0xb729fc,{'label':Yn(_0xb729fc,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x14043e});_0x4a8d9c['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x454dc8['content']['add'](_0x4a8d9c);}if(_0x938d65['urls']['enabled']){const _0x4ec957=this['_createBalloonButton'](_0xb729fc,{'label':Yn(_0xb729fc,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x2b16a2});_0x4ec957['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do}),this['_urlInputView']['focus']();}),_0x454dc8['content']['add'](_0x4ec957);}if(_0x938d65['files']['enabled']){const _0x43e52f=new _0x2ce7ec(_0xb729fc);_0x43e52f['set']({'label':Yn(_0xb729fc,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x9306a4,'withText':!0x0,'tooltip':!0x0,'class':Mo,'allowMultipleFiles':!0x0}),_0x43e52f['on']('done',(_0x533359,_0x40c60b)=>{this['fire']('addFileToContext',_0x40c60b),this['hideAddContextBalloonPanel']();}),_0x43e52f['tooltip']=!0x0,_0x454dc8['content']['add'](_0x43e52f);}for(const _0x157715 of _0x938d65['sources']){const _0x1172e2=this['_createBalloonButton'](_0xb729fc,{'label':_0x157715['label'],'icon':_0x157715['icon']||_0x24e0c5,'type':'source'});_0x454dc8['content']['add'](_0x1172e2),_0x1172e2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x157715);});}}['_addUrlContent'](_0x2c50ce,_0xda25be){this['_urlInputView']=new Vo(_0xda25be),this['_urlInputView']['on']('submitUrl',(_0x263bca,_0x14be83)=>{this['_handleUrlSubmit'](_0x14be83);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do});}),_0x2c50ce['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x4a517d,_0x58f0e0){const _0xe68098='source'===_0x58f0e0['type']?new Ta(_0x4a517d):new _0x4b3349(_0x4a517d);return _0xe68098['set']({'label':_0x58f0e0['label'],'icon':_0x58f0e0['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Mo}),_0xe68098;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0xca342f({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x43143a){const _0x48898e=this['_addContextBalloonConfig'];_0x48898e['buttonView']['isOn']=_0x43143a,_0x43143a?_0x48898e['balloonView']['show']():_0x48898e['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x35ba28,buttonView:_0x5e6a4d,hideMethod:_0x1dd346}=this['_addContextBalloonConfig'];_0xca342f({'emitter':_0x35ba28,'contextElements':[_0x35ba28['element'],_0x5e6a4d['element']],'callback':()=>{_0x1dd346();},'activator':()=>_0x5e6a4d['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1911b4,_0x277349,_0x207288=!0x1,_0x405809=!0x1){const _0x49b615='conversation'===_0x277349||!0x0===_0x1911b4['isReadOnly'],_0x32f377=new ao(this['locale'],_0x1911b4,_0x49b615,_0x207288,_0x405809);return _0x49b615||_0x32f377['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x32f377['id']);}),_0x32f377;}['_addContextToCollection'](_0x4b1787,_0x39b3b3){_0x39b3b3['add'](_0x4b1787,0x0);}['_removeContextFromCollection'](_0x2d2100,_0x273cc4){const _0x1f0306=_0x273cc4['find'](_0x1fe7e6=>_0x1fe7e6['id']===_0x2d2100);_0x1f0306&&_0x273cc4['remove'](_0x1f0306);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Do}));}['_handleUrlSubmit'](_0x577891){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x577891);}}class Ta extends _0x4b3349{['arrowView'];constructor(_0x23c174){super(_0x23c174),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Ho]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x1477ac=new _0x1f8dd5();return _0x1477ac['content']=_0x248f31,_0x1477ac['extendTemplate']({'attributes':{'class':Ho+'__arrow'}}),_0x1477ac;}}class Se extends _0x3a2ab2{['_cancelButtonView'];['_loaderView'];constructor(_0x1f4023){super(_0x1f4023),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 _0x191b82=new _0x4b3349(this['locale']);return _0x191b82['set']({'label':Yn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x38b63}),_0x191b82['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x191b82;}['_createLoaderView'](){const _0x43d696=new _0x3a2ab2(this['locale']);return _0x43d696['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':Yn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x43d696;}}class ji extends _0x3a2ab2{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x4bb41c,_0x415c36){super(_0x4bb41c),this['_contextPanelView']=this['_createContextPanelView'](_0x4bb41c,_0x415c36),this['_promptInputView']=this['_createPromptInputView'](_0x4bb41c),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4bb41c),this['_loaderView']=this['_createLoaderView'](_0x4bb41c),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Ve)['to'](this);const _0x253e38=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x253e38['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x253e38['if']('isLoading','ck-hidden',_0x5b0149=>!_0x5b0149)]},'children':[this['_loaderView']]}]}),_0xca342f({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x465c69,_0x531cd8){return new _e(_0x465c69,_0x531cd8);}['_createPromptInputView'](_0x585ef8){return new Pe(_0x585ef8,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x284c48){return new ve(_0x284c48);}['_createLoaderView'](_0x4b8e6e){return new Se(_0x4b8e6e);}['_handlePromptInputFocus'](_0x39fea9,_0xf1a915,_0x3e5042){_0x3e5042?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x517099,_0x1f714b){this['_contextPanelView']['addContextItem'](_0x517099,_0x1f714b);}['removeContextItem'](_0x3b64b9){this['_contextPanelView']['removeContextItem'](_0x3b64b9);}['setContextItemLoading'](_0x520ff8,_0x39e66d){this['_contextPanelView']['setContextItemLoading'](_0x520ff8,_0x39e66d);}['setIsUploadInProgress'](_0x5472c8){this['_promptInputView']['setIsUploadInProgress'](_0x5472c8);}['setConversationContext'](_0x3085d2){this['_contextPanelView']['setConversationContext'](_0x3085d2);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x520b66,_0x149e7e,_0x39fdc3){this['_contextPanelView']['updateResourceState'](_0x520b66,_0x149e7e,_0x39fdc3);}['setWebSearch'](_0x13d2c5){this['_promptCapabilitiesView']['setWebSearch'](_0x13d2c5);}['setReasoning'](_0x14532d){this['_promptCapabilitiesView']['setReasoning'](_0x14532d);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x42850a){this['_contextPanelView']['setAddContextOptions'](_0x42850a);}['setInputPlaceholder'](_0x2a6fcd){this['_promptInputView']['setPlaceholderText'](_0x2a6fcd);}['setModelList'](_0x1ac687,_0x4f9845){this['_promptCapabilitiesView']['setModelList'](_0x1ac687,_0x4f9845);}['setModel'](_0x2e6328){this['_promptCapabilitiesView']['setModel'](_0x2e6328);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x4f75f0){this['_promptCapabilitiesView']['disableModelSelector'](_0x4f75f0);}['populateSourceResourceBalloon'](_0xb8c022,_0x40fa4d,_0x218b30,_0x538753){this['_contextPanelView']['populateSourceResourceBalloon'](_0xb8c022,_0x40fa4d,_0x218b30,_0x538753);}['closeSourceResourceBalloon'](_0x4b6c69){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4b6c69);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ki extends _0x20b76f{['conversationStartButton'];['resizeButton'];constructor(_0x4d7475,_0x43b88c){super(_0x4d7475,{'label':Yn(_0x4d7475,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4d7475),this['children']['add'](this['conversationStartButton']),_0x43b88c&&(this['resizeButton']=As(_0x4d7475,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x271a74){const _0xe303a0=new _0x4b3349(_0x271a74);return _0xe303a0['set']({'label':Yn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x22e17e,'class':'ck-ai-chat__start-conversation'}),_0xe303a0['on']('execute',()=>{this['fire']('startConversation');}),_0xe303a0;}}class Ci extends _0x3a2ab2{constructor(_0x4e5e6a){super(_0x4e5e6a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Yn(_0x4e5e6a,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0x3a2ab2{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x4d99ef,_0x248b59){super(_0x4d99ef),this['_bodyCollection']=new _0x582686(_0x4d99ef),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x4d99ef,_0x248b59),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new pi(_0x4d99ef,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ji(_0x4d99ef,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Ci(_0x4d99ef),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x4d99ef['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1295b5,_0x350227,_0x577f29,_0x336440){this['chatControls']['populateSourceResourceBalloon'](_0x1295b5,_0x350227,_0x577f29,_0x336440);}['closeSourceResourceBalloon'](_0x1dae06){this['chatControls']['closeSourceResourceBalloon'](_0x1dae06);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class at extends _0x3e9f85{static get['requires'](){return[ht];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;constructor(_0x1f9666){super(_0x1f9666);const _0x48610c=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_view']=new Et(this['context']['locale'],_0x48610c['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x55aff9,{showDiff:_0xf06387})=>{this['showDiff']=_0xf06387;}),_0x48610c['view']['addTab']({'id':'chat','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x39af2c=>_0x39af2c),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x3a46e5=>_0x3a46e5),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x37c889){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x37c889['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Yn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x574919,staticMessage:_0x43ab2a}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x574919,'initialContent':'<p>'+_0x43ab2a+'</p>'});}['addFeedItemUserMessage'](_0x2df94c){const _0x34ad3b=_0x2df94c['quickActionData']?.['displayedPrompt']||_0x2df94c['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x2df94c['contextItems']['values']()),'initialContent':'<p>'+_0x34ad3b+'</p>','id':_0x2df94c['id']});}['addFeedItemError']({errorMessage:_0x27ec93,id:_0x22d0c2}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x27ec93+'</p>','id':_0x22d0c2});}['addFeedItemAIReply'](_0x383a18){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x383a18['interactionId']+':'+_0x383a18['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x558012){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x558012['interactionId']+':'+_0x558012['id'],'areActionsDisabled':_0x558012['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x182c3a){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x182c3a['id'],'capabilities':_0x182c3a['capabilities']});}['updateFeedInteractionHeader'](_0x440a25){const _0x2e9fd4=this['_view']['chatFeed']['children']['find'](_0x2426db=>_0x2426db['options']['id']==_0x440a25['id']&&_0x2426db instanceof Rt);_0x2e9fd4&&_0x2e9fd4['set']('isVisible',_0x440a25['isVisible']);}async['updateFeedItemAIReplyContent'](_0xd3283a){const _0x43b138=_0xd3283a['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5203ea=>{await this['_view']['chatFeed']['updateReplyItem']({..._0xd3283a,'abortSignal':_0x5203ea,'renderingStrategy':_0x43b138}),_0xd3283a['isDone']&&this['markFeedItemAsDone'](_0xd3283a['id']);});}['updateFeedItemAIReplySources'](_0xcc7bc2,_0x2a71bd){this['_view']['chatFeed']['updateWebSources'](_0xcc7bc2,_0x2a71bd);}async['updateFeedItemAIReplySuggestionContent'](_0x3b47a1){const _0x44a370=_0x3b47a1['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5036f7=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x3b47a1,'abortSignal':_0x5036f7,'renderingStrategy':_0x44a370}),_0x3b47a1['isDone']&&this['markFeedItemAsDone'](_0x3b47a1['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3deaeb){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3deaeb);}['markFeedItemAsDone'](_0x4f987a){this['_view']['chatFeed']['markItemAsDone'](_0x4f987a);}['removeFeedInteraction'](_0x6b886a){this['_view']['chatFeed']['getItemIds']()['filter'](_0xdd0da6=>_0xdd0da6['startsWith'](_0x6b886a))['forEach'](_0xaad4a=>this['_view']['chatFeed']['removeItem'](_0xaad4a));}['startInteraction'](_0x10b44a){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x10b44a)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3d7243){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x15bf0e=>_0x15bf0e['startsWith'](_0x3d7243['id']))['forEach'](_0x9c9729=>this['markFeedItemAsDone'](_0x9c9729)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x27ec34,_0x28dd45){this['_view']['chatControls']['addContextItem'](_0x27ec34,_0x28dd45);}['removeContextItem'](_0xcdeefb){this['_view']['chatControls']['removeContextItem'](_0xcdeefb);}['setContextItemLoading'](_0x156105,_0x2916ae){this['_view']['chatControls']['setContextItemLoading'](_0x156105,_0x2916ae);}['setIsUploadInProgress'](_0x4a7c47){this['_view']['chatControls']['setIsUploadInProgress'](_0x4a7c47);}['setConversationContext'](_0x31d87a){this['_view']['chatControls']['setConversationContext'](_0x31d87a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5b83b4,_0x5eb27e,_0x162706){this['_view']['chatControls']['updateResourceState'](_0x5b83b4,_0x5eb27e,_0x162706);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2800c5){this['_view']['chatControls']['setAddContextOptions'](_0x2800c5);}['updateCapabilities'](_0x2dbf81){this['_view']['chatControls']['setWebSearch'](_0x2dbf81['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2dbf81['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2dbf81));}['setSelectedModel'](_0x264a7e,_0xe954ec){this['_view']['chatControls']['setModel'](_0x264a7e),_0xe954ec&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x147e75){this['feedItemRenderingStrategy']=_0x147e75;}['toggleLoadingSkeleton'](_0x291288){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x291288);}['resetConversationTitle'](){this['setConversationTitle'](Yn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x27d4bf,_0x22e4ef=!0x1){if(_0x22e4ef&&!At()&&_0x27d4bf['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x27d4bf);this['_view']['chatHeader']['label']=_0x27d4bf;}['_animateConversationTitle'](_0x44347f){let _0x8c8aa7=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x44347f[_0x8c8aa7],_0x8c8aa7++,_0x8c8aa7===_0x44347f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x494521){this['_view']['chatHeader']['isMaximized']=_0x494521;}['_getLoadingMessage'](_0x56f0d6){const _0x417768=_0x56f0d6['capabilities'];return _0x417768['isWebSearchEnabled']&&_0x417768['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x417768['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x417768['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x188e87){return _0x188e87?_0x188e87['isWebSearchEnabled']&&_0x188e87['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x188e87['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x188e87['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x21beb9,_0x17cd3d,_0x39089a,_0x11749b){this['_view']['populateSourceResourceBalloon'](_0x21beb9,_0x17cd3d,_0x39089a,_0x11749b);}['closeSourceResourceBalloon'](_0x5f60a6){this['_view']['closeSourceResourceBalloon'](_0x5f60a6);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x5ce72b,_0x45c58e){this['_view']['chatFeed']['scrollToSuggestion'](_0x5ce72b,_0x45c58e);}}class xi extends _0x586ac5{['sections'];constructor(_0x276fa0,_0x354755){super(_0x276fa0),this['sections']=_0x354755,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x10e965){let _0x45ccc7=0x0,_0x40efea=0x0;for(const _0x419c31 of this['sections']){const {resultsCount:_0x5bfdeb,totalItemsCount:_0x3e0672}=_0x419c31['filter'](_0x10e965);_0x45ccc7+=_0x5bfdeb,_0x40efea+=_0x3e0672;}return{'resultsCount':_0x45ccc7,'totalItemsCount':_0x40efea};}}class Yi extends _0x1f44f8{['title'];['itemsViews'];['_itemsListView'];constructor(_0xd0464b,{title:_0x18394f,items:_0x610cdc}){super(_0xd0464b);const _0x478036=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x18394f,this['itemsViews']=_0x610cdc;const _0x3aea25=new _0x3a2ab2(_0xd0464b);_0x3aea25['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x586ac5(_0xd0464b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x478036['if']('isVisible','ck-hidden',_0x36d05f=>!_0x36d05f)]},'children':[_0x3aea25,this['_itemsListView']]});}['filter'](_0xd7e3e){const _0x1c0854=this['itemsViews']['length'];let _0x133d14=0x0;for(const _0x2de7cc of this['itemsViews']){if(_0xd7e3e){const _0x110652=_0x2de7cc['isMatching'](_0xd7e3e);_0x2de7cc['isVisible']=!!_0x110652,_0x2de7cc['highlightText'](_0xd7e3e);}else _0x2de7cc['isVisible']=!0x0,_0x2de7cc['highlightText'](null);_0x2de7cc['isVisible']&&_0x133d14++;}return this['isVisible']=_0x133d14>0x0,{'resultsCount':_0x133d14,'totalItemsCount':_0x1c0854};}['getItem'](_0x5c521c){return this['itemsViews']['find'](_0x3e24e7=>_0x3e24e7['id']===_0x5c521c);}['removeItem'](_0x1943eb){const _0xc20767=this['itemsViews']['indexOf'](_0x1943eb);-0x1!==_0xc20767&&(this['itemsViews']['splice'](_0xc20767,0x1),this['_itemsListView']['items']['remove'](_0x1943eb));}}class Mi extends _0x1209a(_0x1f44f8){['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(_0x398247,_0x23db60){super(_0x398247);const _0x3743ff=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x23db60['pinned']),this['set']('loadingState',null),this['id']=_0x23db60['id'];const {title:_0x4836b4,createdAt:_0x498f7e,active:_0x29cedf=!0x1}=_0x23db60;this['_titleView']=new _0x200fd8(),this['_titleView']['text']=_0x4836b4,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x3ebc78=this['_createCheckView'](),_0xd97ea=this['_createPinButtonView'](_0x398247),_0x47acbe=this['_createMenuDropdownView'](),_0x2be2ac=this['_createEditInputView'](_0x398247,_0x4836b4),_0x2793e1=this['_createAcceptEditButtonView'](_0x398247,_0x2be2ac),_0x6203fe=this['_createCancelEditButtonView'](_0x398247,_0x2be2ac);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xd97ea),this['actions']['add'](_0x47acbe),this['on']('change:isEdit',(_0x5d4135,_0x2546ab,_0x57fbed)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x57fbed?(this['actions']['add'](_0x2793e1),this['actions']['add'](_0x6203fe),this['mainContent']['add'](_0x2be2ac),_0x2be2ac['element']['focus']()):(this['actions']['add'](_0xd97ea),this['actions']['add'](_0x47acbe),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x29cedf?'ck-ai-chat-history__item--active':'',_0x3743ff['if']('isVisible','ck-hidden',_0x58de8c=>!_0x58de8c),_0x3743ff['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',_0x3743ff['if']('loadingState','ck-hidden',_0x4586c8=>!!_0x4586c8)]},'children':_0x29cedf?[_0x3ebc78]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x3743ff['if']('loadingState','ck-hidden',_0x8e9f8a=>!_0x8e9f8a)]},'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',_0x3743ff['if']('loadingState','ck-hidden',_0x5be7f4=>!!_0x5be7f4)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x3743ff['if']('loadingState','ck-hidden',_0x419bbe=>!_0x419bbe)]},'children':[{'text':_0x3743ff['to']('loadingState',_0xdd1ac4=>_0xdd1ac4?Yn(this['locale'],Mi['LOADING_LABELS'][_0xdd1ac4]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x498f7e]}]},{'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'](_0x44fff7){this['_titleView']['text']=_0x512f25(_0x44fff7);}['updateLoadingState'](_0x182261,_0x38e213){this['set']('loadingState',_0x38e213?_0x182261:null);}['_createCheckView'](){const _0xd701de=new _0x1f8dd5();return _0xd701de['set']({'content':_0x519140}),_0xd701de;}['_createPinButtonView'](_0x4a7149){const _0x2437d5=new _0x4b3349(_0x4a7149);return _0x2437d5['set']({'label':Yn(_0x4a7149,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x51d429,'withText':!0x1,'tooltip':!0x0}),_0x2437d5['bind']('isOn')['to'](this,'pinned'),_0x2437d5['on']('execute',()=>{const _0x40f420=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x40f420});}),_0x2437d5;}['_createMenuDropdownView'](){const _0x2a6c33=_0x45dc52(this['locale'],_0x437b8f),_0x389364=_0x2a6c33['panelView']['children'];_0x2a6c33['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x311d45}),_0x2a6c33['panelPosition']='sw';const _0x688fd6=new _0x4b3349(this['locale']);_0x688fd6['label']=Yn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x688fd6['withText']=!0x0,_0x688fd6['on']('execute',()=>{this['isEdit']=!0x0;});const _0x29a2d4=new _0x4b3349(this['locale']);_0x29a2d4['label']=Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x29a2d4['withText']=!0x0,_0x29a2d4['on']('execute',()=>{this['showConfirm'](Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x2c8bd4=new _0x586ac5(this['locale']),_0x2c0c2c=new _0x1f44f8(this['locale']);_0x2c0c2c['children']['add'](_0x688fd6);const _0x5c7f74=new _0x1f44f8(this['locale']);return _0x5c7f74['children']['add'](_0x29a2d4),_0x2c8bd4['items']['addMany']([_0x2c0c2c,_0x5c7f74]),_0x389364['add'](_0x2c8bd4),_0x2a6c33;}['_createEditInputView'](_0x2f30b7,_0x4a66f0){const _0xa896ac=new _0x2d6582(_0x2f30b7),_0x4ca157=_0xa896ac['bindTemplate'];return _0xa896ac['value']=_0x4a66f0,_0xa896ac['extendTemplate']({'on':{'keydown':_0x4ca157['to'](_0x496b0c=>{'Enter'==_0x496b0c['key']&&this['_commitEditInputValue'](_0xa896ac);})}}),_0xa896ac;}['_createAcceptEditButtonView'](_0x38dee0,_0x2e7455){const _0x3aa3a8=new _0x4b3349(_0x38dee0);return _0x3aa3a8['set']({'icon':_0x519140,'withText':!0x1,'tooltip':Yn(_0x38dee0,'AI_CHAT_HISTORY_ACCEPT')}),_0x3aa3a8['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x3aa3a8['on']('execute',()=>{this['_commitEditInputValue'](_0x2e7455);}),_0x3aa3a8;}['_commitEditInputValue'](_0x3297f3){const _0x2fa54d=_0x3297f3['element']['value']||'';this['_titleView']['text']=_0x2fa54d,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2fa54d});}['_createCancelEditButtonView'](_0xf6b47e,_0x2fa57d){const _0x5382a3=new _0x4b3349(_0xf6b47e);return _0x5382a3['set']({'icon':_0x564668,'withText':!0x1,'tooltip':Yn(_0xf6b47e,'AI_CHAT_HISTORY_CANCEL')}),_0x5382a3['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5382a3['on']('execute',()=>{this['isEdit']=!0x1,_0x2fa57d['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x5382a3;}['_createSpinnerView'](){const _0x21accc=new De('tiny');return _0x21accc['isVisible']=!0x0,_0x21accc;}['isMatching'](_0x3269b3){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x3269b3)?{'title':!0x0}:null;}['highlightText'](_0x2851e1){this['_titleView']['highlightText'](_0x2851e1);}}class vt extends _0x3a2ab2{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x116176,_0x4b18ff){super(_0x116176),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0xb1c40e=new _0x20b76f(_0x116176,{'label':Yn(_0x116176,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x4b18ff&&(this['resizeButton']=As(_0x116176,this),_0xb1c40e['children']['add'](this['resizeButton'])),this['sectionsView']=new xi(_0x116176,[]),this['sectionsView']['delegate'](...Li)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['on']('change:isLoading',()=>this['_updateViewVisibility']()),this['on']('change:hasItems',()=>this['_updateViewVisibility']()),this['on']('change:errorMessage',()=>this['_updateViewVisibility']()),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat-history','ck-rounded-corners'],'dir':'ltr'},'children':[_0xb1c40e,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x4fb0e9=new _0x28d88c(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x593a2c=>Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x593a2c),'secondary':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x4fb0e9['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x4fb0e9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x433167=>!_0x433167)]}}),_0x4fb0e9;}['_createSkeletonView'](){const _0xcedb10=new Fe(this['locale'],Be['aiHistory']);return _0xcedb10['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x52359f=>!_0x52359f)]}}),_0xcedb10;}['_createErrorView'](){const _0x47e3c9=new _0x3a2ab2(this['locale']),_0x565d0c=new _0x4b3349(this['locale']);return _0x565d0c['set']({'withText':!0x1,'icon':_0x564668,'class':'ck-ai-chat-error__dismiss-button'}),_0x565d0c['bind']('isVisible')['to'](this,'hasItems',_0x1ebb16=>!!_0x1ebb16),_0x565d0c['on']('execute',()=>{this['errorMessage']='';}),_0x47e3c9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x6ca352=>!_0x6ca352)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x565d0c]}),_0x47e3c9;}['_createEmptyStateView'](){const _0x38b487=new _0x4b3349(this['locale']);_0x38b487['set']({'withText':!0x0,'label':Yn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x38b487['on']('execute',()=>{this['fire']('openChat');});const _0x48c9af=new _0x3a2ab2(this['locale']);return _0x48c9af['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x421b0e=>!_0x421b0e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Yn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x38b487]}),_0x48c9af;}['_createListItemViews'](_0x3139bc,_0x248052){const _0x5723e0=[];for(const _0x4ad253 of _0x3139bc){const _0x4b8d45=new Mi(_0x248052,_0x4ad253);_0x4b8d45['delegate'](...Li)['to'](this),_0x5723e0['push'](_0x4b8d45);}return _0x5723e0;}['updateHistoryItemsWithCategories'](_0x1b3166){const _0x261a2e=this['locale']||'en',_0x2b7c02=[];for(const _0x16b6a3 of _0x1b3166){const _0x53d0ab=this['_createListItemViews'](_0x16b6a3['items'],_0x261a2e);_0x2b7c02['push'](new Yi(_0x261a2e,{'title':_0x16b6a3['title'],'items':_0x53d0ab}));}this['sectionsView']['sections']=_0x2b7c02,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2b7c02),this['hasItems']=_0x1b3166['some'](_0x5cbfc4=>_0x5cbfc4['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x2615af){for(const _0x22ce6e of this['sectionsView']['sections']){const _0xf19a10=_0x22ce6e['getItem'](_0x2615af);if(_0xf19a10){if(_0x22ce6e['removeItem'](_0xf19a10),0x0===_0x22ce6e['itemsViews']['length']){const _0x36d787=this['sectionsView']['sections']['indexOf'](_0x22ce6e);-0x1!==_0x36d787&&(this['sectionsView']['sections']['splice'](_0x36d787,0x1),this['sectionsView']['items']['remove'](_0x22ce6e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1c71d2,_0x3d51e1){for(const _0x244e01 of this['sectionsView']['sections']){const _0x623fec=_0x244e01['getItem'](_0x1c71d2);if(_0x623fec){_0x623fec['updateTitle'](_0x3d51e1);break;}}}['updateItemLoadingState'](_0x2f3f73,_0x2bb67b,_0x17e830){for(const _0x423cfd of this['sectionsView']['sections']){const _0xd40fc=_0x423cfd['getItem'](_0x2f3f73);if(_0xd40fc){_0xd40fc['updateLoadingState'](_0x2bb67b,_0x17e830);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x27dd1d=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x27dd1d);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3e9f85{static get['requires'](){return[ht];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3738a4){super(_0x3738a4);const _0x436790=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x436790['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x436790['view']['addTab']({'id':'history','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2dca95){this['_historyView']['removeHistoryItem'](_0x2dca95);}['updateItems'](_0x4dc649){this['_historyView']['updateHistoryItemsWithCategories'](_0x4dc649);}['updateItemTitle'](_0x30b46d,_0x8270ec){this['_historyView']['updateItemTitle'](_0x30b46d,_0x8270ec);}['updateItemLoadingState'](_0x1e0cec,_0x28933b,_0xda0141){this['_historyView']['updateItemLoadingState'](_0x1e0cec,_0x28933b,_0xda0141);}['setLoadingSkeleton'](_0x42b5b7){this['_historyView']['isLoading']=_0x42b5b7;}['showError'](_0x31ce4f){this['_historyView']['errorMessage']=_0x31ce4f;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x1a7b5d){this['_historyView']['isMaximized']=_0x1a7b5d;}}class Ue extends _0x3491c8(){['id'];['createdAt'];constructor({id:_0xe5134e,title:_0x5586a5,createdAt:_0xadf8d5,updatedAt:_0xc18b71,pinned:_0xd5b2d9}){super(),this['id']=_0xe5134e,this['createdAt']=new Date(_0xadf8d5),this['set']('title',_0x5586a5),this['set']('updatedAt',_0xc18b71?new Date(_0xc18b71):null),this['set']('pinned',_0xd5b2d9||!0x1);}['updateTitle'](_0x2fa7b1){this['set']('title',_0x512f25(_0x2fa7b1)),this['updatedAt']=new Date();}['updatePinned'](_0x51f389){this['set']('pinned',_0x51f389),this['updatedAt']=new Date();}}class Tt extends Mt(){['items']=[];['connector'];['group'];constructor({connector:_0x55cd0a,group:_0x40ea12}){super(),this['connector']=_0x55cd0a,this['group']=_0x40ea12;}async['init'](){try{const _0x5b09be=this['connector']['fetchConversations'](this['group']),_0x3a38a9=await _0x5b09be['getConversations']();this['loadItems'](_0x3a38a9);}catch(_0x4c8922){this['fire']('error',{'error':_0x4c8922,'operation':'init'});}}['addItem'](_0x39955e){this['items']['push'](_0x39955e);}async['removeItem'](_0x2dd1ad){const _0x23b521=this['items']['findIndex'](_0x32adca=>_0x32adca['id']===_0x2dd1ad);if(-0x1===_0x23b521)return!0x1;try{return await this['connector']['deleteConversation'](_0x2dd1ad)['execute'](),this['items']['splice'](_0x23b521,0x1),this['fire']('itemRemoved',{'itemId':_0x2dd1ad}),!0x0;}catch(_0x1af7de){return this['fire']('error',{'error':_0x1af7de,'operation':'removeItem','itemId':_0x2dd1ad}),!0x1;}}['getItem'](_0x2b60f8){return this['items']['find'](_0x1441d9=>_0x1441d9['id']===_0x2b60f8);}async['updateItemTitle'](_0x99ebb3,_0x199537){const _0x50d891=this['getItem'](_0x99ebb3);if(!_0x50d891)return!0x1;try{return await this['connector']['updateConversation'](_0x99ebb3,{'title':_0x199537})['getResult'](),_0x50d891['updateTitle'](_0x199537),this['fire']('itemUpdated',{'itemId':_0x99ebb3,'updates':{'title':_0x199537}}),!0x0;}catch(_0x1211d2){return this['fire']('error',{'error':_0x1211d2,'operation':'updateItemTitle','itemId':_0x99ebb3}),!0x1;}}async['updateItemPinned'](_0x4b44f1,_0x51b9bb){const _0x19765f=this['getItem'](_0x4b44f1);if(!_0x19765f)return!0x1;try{return await this['connector']['updateConversation'](_0x4b44f1,{'pinned':_0x51b9bb})['getResult'](),_0x19765f['updatePinned'](_0x51b9bb),this['fire']('itemUpdated',{'itemId':_0x4b44f1,'updates':{'pinned':_0x51b9bb}}),!0x0;}catch(_0x267734){return this['fire']('error',{'error':_0x267734,'operation':'updateItemPinned','itemId':_0x4b44f1}),!0x1;}}['loadItems'](_0x519207){try{this['items']=[],_0x519207['map'](_0x32d939=>{this['addItem'](new Ue(_0x32d939));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x58f503){this['fire']('error',{'error':_0x58f503,'operation':'loadItems'});}}['getItems'](_0x3ae078={}){const _0x2ebc5f=void 0x0!==_0x3ae078['pinned']&&_0x3ae078['pinned'],_0x1bebf1=_0x3ae078['from']?new Date(_0x3ae078['from']['getFullYear'](),_0x3ae078['from']['getMonth'](),_0x3ae078['from']['getDate']()):null,_0x45723b=_0x3ae078['to']?new Date(_0x3ae078['to']['getFullYear'](),_0x3ae078['to']['getMonth'](),_0x3ae078['to']['getDate']()):null;return this['items']['filter'](_0x4979a7=>{if(_0x4979a7['pinned']!==_0x2ebc5f)return!0x1;if(_0x45723b){const _0x3b8a42=new Date(_0x4979a7['createdAt']['getFullYear'](),_0x4979a7['createdAt']['getMonth'](),_0x4979a7['createdAt']['getDate']());return _0x1bebf1?_0x1bebf1['getTime']()===_0x45723b['getTime']()?_0x3b8a42['getTime']()===_0x1bebf1['getTime']():_0x3b8a42<_0x45723b&&_0x3b8a42>=_0x1bebf1:_0x3b8a42<_0x45723b;}return!0x0;});}}class jt extends _0x3e9f85{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[N,et,xt,ht];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](N),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](et);const _0x27af5e=this['context']['plugins']['get'](ht),_0x60035e=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x60035e}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2cdce9,_0x347df1)=>{this['_setItemLoading'](_0x347df1['id'],'remove'),this['_handleRemove'](_0x347df1['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1f3710,_0x3d7774)=>{this['_setItemLoading'](_0x3d7774['id'],'rename'),this['_handleEditTitle'](_0x3d7774['id'],_0x3d7774['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x44fa08,_0x5d8e7e)=>{void 0x0!==_0x5d8e7e['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x5d8e7e['itemId'],_0x5d8e7e['updates']['title']),void 0x0!==_0x5d8e7e['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x5d8e7e['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1b60f4,_0x24ab60)=>{this['_aiChatController']['handleRemovedConversation'](_0x24ab60['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x24ab60['itemId']),this['_clearItemLoading'](_0x24ab60['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x41bd75,_0x8ef888)=>{this['_handleHistoryErrorUI'](_0x8ef888['error'],_0x8ef888['operation'],_0x8ef888['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5d62bb,_0x493bb9)=>{this['_handleSelectConversation'](_0x493bb9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x55b97f,_0x409032)=>{const _0x34084a=_0x409032['pinned']?'pin':'unpin';this['_setItemLoading'](_0x409032['id'],_0x34084a),this['_handleTogglePin'](_0x409032['id'],_0x409032['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x27af5e['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x27af5e['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x27af5e,'resizedTabs',(_0x2300fa,_0x2b2284)=>{this['_setIsMaximized'](_0x2b2284);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x27af5e['resize']();});}async['_handleEditTitle'](_0x3a2b8b,_0x2efa56){await this['history']['updateItemTitle'](_0x3a2b8b,_0x2efa56);}async['_handleTogglePin'](_0x2e06ae,_0x1b42d5){await this['history']['updateItemPinned'](_0x2e06ae,_0x1b42d5);}async['_handleRemove'](_0x4736b3){await this['history']['removeItem'](_0x4736b3);}async['_handleSelectConversation'](_0x21a500){await this['_aiChatController']['loadConversation'](_0x21a500);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x57f434=this['_aiChatController']['activeConversation']?.['id'],_0x1ab2bf=this['_getCategorizedItems']()['map'](_0x2d92f8=>({'title':_0x2d92f8['title'],'items':_0x2d92f8['items']['map'](_0xe20acd=>({'id':_0xe20acd['id'],'title':_0xe20acd['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xe20acd['createdAt'])['toLocaleDateString'](),'active':_0xe20acd['id']===_0x57f434,'pinned':_0xe20acd['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x1ab2bf);}['_setItemLoading'](_0x38c9de,_0x45170a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x38c9de,_0x45170a,!0x0);}['_clearItemLoading'](_0x1b885e){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1b885e,null,!0x1);}['_handleHistoryErrorUI'](_0x1925b2,_0x360ca3,_0x1a14d4){const _0x1e93ed=this['_generateErrorMessage'](_0x360ca3,_0x1a14d4);this['_aiChatHistoryUi']['showError'](_0x1e93ed),_0x1a14d4&&this['_clearItemLoading'](_0x1a14d4),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x165037,_0x14630f){const _0x1425ab=_0x14630f?this['history']['getItem'](_0x14630f):null,_0xae9309=_0x1425ab?.['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x165037){case'updateItemTitle':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0xae9309);case'updateItemPinned':{const _0x246733=Yn(this['context']['locale'],_0x1425ab?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x246733,_0xae9309]);}case'removeItem':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0xae9309);case'init':case'loadItems':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x313d33=new Date(),_0x6a9113=new Date(_0x313d33['getFullYear'](),_0x313d33['getMonth'](),_0x313d33['getDate']()),_0x3739a3=new Date(_0x6a9113);_0x3739a3['setDate'](_0x3739a3['getDate']()-0x1);const _0x383dd3=new Date(_0x6a9113);_0x383dd3['setDate'](_0x383dd3['getDate']()-0xe);const _0x3d5141=this['history']['getItems']({'pinned':!0x0}),_0x4df911=this['history']['getItems']({'from':_0x6a9113,'to':_0x6a9113}),_0x3d0a10=this['history']['getItems']({'from':_0x3739a3,'to':_0x3739a3}),_0x35b50f=this['history']['getItems']({'from':_0x383dd3,'to':_0x3739a3}),_0x539c55=this['history']['getItems']({'to':_0x383dd3}),_0x10dfb8=[];return _0x3d5141['length']>0x0&&_0x10dfb8['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x3d5141}),_0x4df911['length']>0x0&&_0x10dfb8['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4df911}),_0x3d0a10['length']>0x0&&_0x10dfb8['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x3d0a10}),_0x35b50f['length']>0x0&&_0x10dfb8['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x35b50f}),_0x539c55['length']>0x0&&_0x10dfb8['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x539c55}),_0x10dfb8;}['_setIsMaximized'](_0x3323d9){this['_aiChatHistoryUi']['setIsMaximized'](_0x3323d9);}}class st extends _0x3e9f85{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x3e9f85{static get['requires'](){return[et,O,at,st];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b5ebf){super(_0x1b5ebf);const _0x29578c=_0x1b5ebf['config'];_0x29578c['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x29578c['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](et)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](et)['startConversation']();}async['sendMessage']({message:_0x13186b,quickActionData:_0x357bee}){await this['context']['plugins']['get'](et)['sendMessage']({'message':_0x13186b,'quickActionData':_0x357bee});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](et)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](et)['focusPromptInput']();}}function i(_0x766c4,_0x450b4d,_0x281999){const t=_0x766c4['t'];switch(_0x450b4d){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x281999);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x450b4d;}}function Zt(_0x1783d0,_0x21d6fc,_0x272fe8=!0x1,_0x16a4cb=!0x0){return()=>{const _0xc2062b=_0x1783d0['locale'],_0x3fd073=new _0x4b3349(_0xc2062b),_0x48bb78=_0x3fd073['bindTemplate'];_0x3fd073['extendTemplate']({'on':{'mouseenter':_0x48bb78['to'](()=>{_0x3fd073['focus']();})}});const _0x157fb=_0x21d6fc['icon']??_0x21d6fc['parent']?.['icon'];return _0x3fd073['set']({'label':_0x21d6fc['displayedPrompt'],'withText':_0x272fe8,'role':'menuitem','icon':_0x16a4cb?_0x157fb??_0x351952:void 0x0,'tooltip':!_0x272fe8}),_0x3fd073['on']('execute',()=>{_0x1783d0['editing']['view']['focus'](),_0x1783d0['commands']['execute']('aiQuickAction',_0x21d6fc);}),_0x3fd073;};}const Fs='menu',Js='menuitem';class io extends _0x3a2ab2{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x297236,_0x591597,_0x1aaabb,_0x11fa41){const _0x47cf77=_0x297236['locale'];super(_0x47cf77),this['_bodyCollection']=_0x11fa41;const _0x1c6f65=this['_createListItems'](_0x297236,_0x591597,_0x1aaabb);this['optionsListView']=new _0x586ac5(_0x47cf77),this['optionsListView']['role']=Fs,this['optionsListView']['items']['addMany'](_0x1c6f65),this['focusTracker']=new _0x14ef6c(),this['keystrokes']=new _0x4f7a26(),this['_focusables']=_0x1c6f65,this['focusCycler']=new _0x3d067c({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x47cf77['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x48ea8f,_0x5a017a,_0x53936e){const _0x438ef6=new _0x4346f0();return _0x5a017a['forEach'](_0x493004=>{'actions'in _0x493004?_0x438ef6['add'](this['_createActionGroupButton'](_0x48ea8f,_0x493004,_0x53936e)):_0x438ef6['add'](this['_createActionButton'](_0x48ea8f,_0x493004));}),_0x438ef6;}['_createActionButton'](_0x4a8ba0,_0x4ab846){const _0x20d048=new _0x1f44f8(this['locale']),_0x55c768=Zt(_0x4a8ba0,_0x4ab846,!0x0)();return _0x20d048['children']['add'](_0x55c768),_0x20d048;}['_createActionGroupButton'](_0xb5fb27,_0xdf6632,_0x2d4898){const _0x518dbe=new _0x1f44f8(this['locale']),_0x190f8e=new _0x2d18b1(this['locale']),_0x22db30=_0x190f8e['bindTemplate'],_0x136911='rtl'===_0x2d4898['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x51729f=this['_createGroupActionsList'](_0xb5fb27,_0xdf6632['actions'],_0x2d4898);_0x190f8e['set']({'label':_0xdf6632['label'],'withText':!0x0,'role':Js,'icon':_0xdf6632['icon']??_0x351952}),_0x190f8e['extendTemplate']({'on':{'mouseenter':_0x22db30['to'](()=>{_0x190f8e['focus']();})}});const _0x236e19=new _0x1618b0(this['locale']);return _0x236e19['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x22db30['to'](_0x5b8e89=>{_0x5b8e89['key']==_0x136911&&(_0x190f8e['focus'](),this['_hideNestedPanel'](_0x236e19));})}}),_0x190f8e['bind']('isOn')['to'](_0x236e19,'isVisible'),this['_bodyCollection']['add'](_0x236e19),_0x236e19['content']['add'](_0x51729f),this['_setupGroupMenuBehavior'](_0x190f8e,_0x236e19),_0x518dbe['children']['add'](_0x190f8e),_0x518dbe;}['_createGroupActionsList'](_0x31b210,_0x2b7c9c,_0x27489c){const _0x335247=new _0x586ac5(this['locale']);return _0x335247['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x2b7c9c['forEach'](_0x54663b=>{const _0x12ad71=new _0x1f44f8(this['locale']),_0x29e984=Zt(_0x31b210,_0x54663b,!0x0,!0x1)();_0x12ad71['children']['add'](_0x29e984),_0x27489c['focusTracker']['add'](_0x29e984),_0x335247['items']['add'](_0x12ad71);}),_0x335247;}['_setupGroupMenuBehavior'](_0x2fc356,_0x1aebaf){const _0x52b52a=_0x2fc356['bindTemplate'],_0x2d270a='rtl'===_0x2fc356['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x2fc356['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x52b52a['to'](()=>{this['_showNestedPanel'](_0x1aebaf,_0x2fc356);}),'mouseleave':_0x52b52a['to'](_0x381b89=>{const _0x4e2f2b=_0x381b89['relatedTarget'];this['_isMovingToNestedMenu'](_0x4e2f2b,_0x1aebaf)||this['_hideNestedPanel'](_0x1aebaf);}),'keydown':_0x52b52a['to'](_0x491b8e=>{_0x491b8e['key']==_0x2d270a&&(this['_showNestedPanel'](_0x1aebaf,_0x2fc356),_0x1aebaf['content']['get'](0x0)['focus']());})}}),_0x1aebaf['on']('render',()=>{_0x1aebaf['element']?.['addEventListener']('mouseleave',_0x13d94f=>{const _0x3550fa=_0x13d94f['relatedTarget'];_0x2fc356['element']?.['contains'](_0x3550fa)||this['_isMovingToNestedMenu'](_0x3550fa,_0x1aebaf)||this['_hideNestedPanel'](_0x1aebaf);});});}['_showNestedPanel'](_0x43af51,_0x3d7020){this['_openNestedPanels']['forEach'](_0x390305=>{_0x390305!==_0x43af51&&_0x390305['isVisible']&&_0x390305['hide']();}),_0x43af51['show'](),_0x43af51['pin']({'positions':[_0x2649c1['eastSouth']],'target':_0x3d7020['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x43af51);}['_hideNestedPanel'](_0x2c9010){_0x2c9010['hide'](),this['_openNestedPanels']['delete'](_0x2c9010);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xcd596e=>_0xcd596e['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xff4485,_0x32a1c0){if(!_0xff4485)return!0x1;if(_0x32a1c0['element']?.['contains'](_0xff4485))return!0x0;const _0x35f13a=_0xff4485;return _0x35f13a['closest']&&(null!==_0x35f13a['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x35f13a['closest']('.ck-ai-quick-actions-group-list')||null!==_0x35f13a['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Xt(_0x3c06a4,_0x4f8de1,_0x58329c,_0x2ba14c){return()=>{const _0x4e8745=_0x3c06a4['locale'],_0x46e2ae=_0x45dc52(_0x4e8745);_0x46e2ae['buttonView']['set']({'icon':_0x58329c['icon']??_0x351952,'label':_0x58329c['label'],'tooltip':!0x0}),_0x46e2ae['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x237a23=new io(_0x3c06a4,_0x4f8de1,_0x46e2ae,_0x2ba14c);return _0x46e2ae['panelView']['children']['add'](_0x237a23),_0x46e2ae;};}const ne='<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>',ae='<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>',ce='<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 Ut=function(_0xb6df14){return _0xb6df14['CHAT']='CHAT',_0xb6df14['ACTION']='ACTION',_0xb6df14['REVIEW']='REVIEW',_0xb6df14;}({}),Ca=function(_0x4ac707){return _0x4ac707['CHAT']='AIChat',_0x4ac707['ACTION']='AIActions',_0x4ac707['REVIEW']='AIReviewMode',_0x4ac707;}({});class ci extends _0x20f5e5{static get['requires'](){return[Bt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2f9f71){return function(_0x12546a){const _0x276458=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x12546a['uiLanguage']),_0x27a67a=_0x276458||'English',_0x36c2ee=[{'id':'ask-ai','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Kt},{'id':'chat-commands','label':i(_0x12546a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Yt,'actions':[{'id':'explain','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':ne['replace']('%0',_0x27a67a),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':ae['replace']('%0',_0x27a67a),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':ce['replace']('%0',_0x27a67a),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Wt},{'id':'continue','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':qt},{'id':'fix-grammar','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':zt},{'id':'adjust-length','label':i(_0x12546a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x12546a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Lt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Vt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x12546a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x12546a,'AI_QUICK_ACTIONS_OTHER'),'icon':Jt,'actions':[]}];return _0x36c2ee;}(_0x2f9f71);}['_getDefaultAndCustomActions'](){const _0x473f8b=ci['getDefaultQuickActions'](this['editor']['locale']),_0xed5c8=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x143397=>({..._0x143397,'icon':void 0x0}));return _0x473f8b['find'](_0x2b5b56=>'other'===_0x2b5b56['id'])['actions']['push'](..._0xed5c8),_0x473f8b;}['_initializeQuickActionsComponentsAndCommands'](){const _0x585ce3=new _0x582686(this['editor']['locale']);_0x585ce3['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x585ce3),this['_initializeQuickActionsComponents'](_0x585ce3);}['_initializeQuickActionsDropdown'](_0x5a2cb1){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Xt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x351952,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x5a2cb1));}['_prepareQuickActionsDefinition'](_0x4e90b8){this['_quickActionsDefinition']=_0x4e90b8['map'](_0x149588=>{if('actions'in _0x149588){const _0x284f09=_0x149588;return{..._0x284f09,'actions':_0x284f09['actions']['map'](_0x4a09e4=>{const {actions:_0x334192,..._0x935ccf}=_0x284f09;return{..._0x4a09e4,'parent':_0x935ccf};})['filter'](_0x3e6f31=>this['_shouldIncludeAction'](_0x3e6f31))};}return _0x149588;})['filter'](_0x2568d2=>'actions'in _0x2568d2?_0x2568d2['actions']['length']>0x0:this['_shouldIncludeAction'](_0x2568d2));}['_shouldIncludeAction'](_0x522d59){const _0x2aa914=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ca[_0x522d59['type']])&&!_0x2aa914['includes'](_0x522d59['id']);}['_initializeQuickActionsComponents'](_0x4d80a9){this['_quickActionsDefinition']['forEach'](_0x25080f=>{if('actions'in _0x25080f){const _0x2147ea=Xt(this['editor'],_0x25080f['actions'],_0x25080f,_0x4d80a9);this['editor']['ui']['componentFactory']['add'](_0x25080f['id'],_0x2147ea),_0x25080f['actions']['forEach'](_0x4e2177=>{const _0x1ce12e=Zt(this['editor'],_0x4e2177);this['editor']['ui']['componentFactory']['add'](_0x4e2177['id'],_0x1ce12e);});}else{const _0x463195=Zt(this['editor'],_0x25080f);this['editor']['ui']['componentFactory']['add'](_0x25080f['id'],_0x463195);}});}}class ni extends Nt{['execute'](_0x2eb5e2){switch(_0x2eb5e2['type']){case Ut['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x597f4d=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x599d16('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x597f4d});}this['_handleAIChatAction'](_0x2eb5e2);break;case Ut['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x1fe03a=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x599d16('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1fe03a});}this['_handleAIActionsAction'](_0x2eb5e2);break;case Ut['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x5b74ad=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x599d16('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5b74ad});}this['_handleAIReviewAction'](_0x2eb5e2);}}async['_handleAIChatAction'](_0x172bac){const _0xf1b687=this['editor']['plugins']['get']('AIChat'),_0x39dc41=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x172bac['id'])_0x39dc41['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0xf1b687['addSelectionToChatContext'](),_0xf1b687['focusPromptInput']();else await _0xf1b687['startConversation'](),await _0xf1b687['addSelectionToChatContext'](),await _0xf1b687['sendMessage']({'message':_0x172bac['prompt']||_0x172bac['displayedPrompt'],'quickActionData':{'id':_0x172bac['id'],'displayedPrompt':_0x172bac['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x104387=this['editor'],_0x160033=_0x104387['model']['document']['selection'];if(!_0x160033['isCollapsed'])return;const _0x1a948a=_0x5f24ba(_0x160033['getSelectedBlocks']())||_0x104387['model']['schema']['getLimitElement'](_0x160033);_0x104387['model']['change'](_0x1a0185=>{_0x1a0185['setSelection'](_0x1a948a,'in');});}['_handleAIActionsActionLabel'](_0x3a0452){return _0x3a0452['parent']?.['label']&&'other'!==_0x3a0452['parent']?.['id']?_0x3a0452['parent']['label']+':\x20'+_0x3a0452['displayedPrompt']:_0x3a0452['displayedPrompt'];}async['_handleAIActionsAction'](_0x5eac53){const _0x122280=this['editor']['plugins']['get']('AIActions'),_0x43bc13=_0x5eac53['prompt']?{'userMessage':_0x5eac53['prompt'],'model':_0x5eac53['model']}:{'actionName':_0x5eac53['actionName']||_0x5eac53['id'],'args':_0x5eac53['args']},_0x4be240=this['_handleAIActionsActionLabel'](_0x5eac53);await _0x122280['executeAction'](_0x43bc13,_0x4be240,_0x5eac53['icon']);}async['_handleAIReviewAction'](_0x546301){console['log']('handleAIReviewAction',_0x546301);}}class oi extends _0x20f5e5{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4624f7=this['editor'],_0x21b8e9=new ni(this['editor']);if(_0x4624f7['commands']['add']('aiQuickAction',_0x21b8e9),_0x4624f7['plugins']['has']('AIChat')){const _0x51966d=this['editor']['plugins']['get']('AIChat');_0x4624f7['model']['document']['selection']['on']('change:range',(_0x537c1f,_0x2c7eb0)=>{_0x2c7eb0['directChange']&&_0x51966d['removeSelectionFromChatContext']();});}}}class wa extends _0x20f5e5{static get['requires'](){return[ci,oi];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d1096){super(_0x1d1096),_0x1d1096['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class ye extends fe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x122a3c=this['documentContextContent']['children']['map'](_0x2197f9=>({'node':_0x2197f9,'id':ft(_0x2197f9,'data-id')})),_0x4a0ea3=this['parsedMergedContent']['children']['map'](_0x390bb2=>({'node':_0x390bb2,'id':ft(_0x390bb2,'data-id')||_0x190955()})),_0x11dc3e=_0x3e248a(_0x122a3c,_0x4a0ea3,{'comparator':(_0x34cf79,_0x4e6cf4)=>_0x34cf79['id']==_0x4e6cf4['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x11dc3e['length']&&_0x11dc3e[_0x11dc3e['length']-0x1]['removed'];)_0x11dc3e['pop']();}const _0x3d1777=_0x11dc3e['map'](_0x2a4b6a=>{const _0x5ac38f=_0x2a4b6a['added']?'new':_0x2a4b6a['removed']?'removed':'modified';return{'node':_0x2a4b6a['value'][0x0]['node'],'type':_0x5ac38f,'id':_0x2a4b6a['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3d1777,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4cc3ee,_0x5ff6f0){return _0x5ff6f0;}}class q extends pe{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x1f5814){super(_0x1f5814),this['content']=_0x1f5814['content'],this['version']=_0x1f5814['version'],this['actionName']=_0x1f5814['actionName'],this['args']=_0x1f5814['args'],this['userMessage']=_0x1f5814['userMessage'],this['model']=_0x1f5814['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'](_0x34cbee){const _0xc5eacc=new ye({'editor':this['editor'],'documentContextContent':this['content'],..._0x34cbee});return this['replies']['push'](_0xc5eacc),_0xc5eacc['delegate'](...ge)['to'](this),this['fire']('replyCreated',_0xc5eacc),_0xc5eacc;}}class fa extends _0x20f5e5{static get['requires'](){return[N,_0x889ca7,O,W,_0x348a94];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x4346f0();['_promiseQueue'];constructor(_0x4cf81b){super(_0x4cf81b),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0xb3eb6d,_0x467fad,_0x1b998f){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x2cb500,anchorData:_0x46e94a}=this['_getExecuteDataInTable']();return this['_executeAction'](_0xb3eb6d,_0x2cb500,_0x46e94a,_0x467fad,_0x1b998f);}}const {modelFragment:_0x457ff1,anchorData:_0x2344bd}=this['_getExecuteDataRegular']();return this['_executeAction'](_0xb3eb6d,_0x457ff1,_0x2344bd,_0x467fad,_0x1b998f);}['_getExecuteDataRegular'](){const _0x58abc0=this['editor']['model']['document']['selection'];if(_0x58abc0['isCollapsed']){const _0x2ff957=_0x5f24ba(_0x58abc0['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x58abc0);this['editor']['model']['change'](_0x44bfb0=>{_0x44bfb0['setSelection'](_0x2ff957,'in');});}const _0x11733c=_0x58abc0['getFirstRange'](),_0x63567b=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x58abc0),_0x11733c['start'],_0x11733c['end']),_0x3d19b=_0x58abc0['getFirstRange']()['start'],_0xc06a2d=new Map();let _0x167fb7=_0x63567b;for(let _0x1aad37=0x0;_0x1aad37<_0x3d19b['path']['length'];_0x1aad37++)_0xc06a2d['set'](_0x167fb7,_0x3d19b['path'][_0x1aad37]),_0x167fb7=_0x167fb7['getChild'](0x0);return{'modelFragment':_0x63567b,'anchorData':_0xc06a2d};}['_getExecuteDataInTable'](){const _0x10d03b=this['editor']['model']['document']['selection'],_0xd53e1=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x903658=_0x10d03b['getFirstRange']()['start']['parent']['parent'],_0xe3c6a2=this['_wrapWithCommonAncestors'](_0xd53e1,this['editor']['model']['createPositionBefore'](_0x903658),this['editor']['model']['createPositionAfter'](_0x903658)),_0x105bb2=_0x10d03b['getFirstRange']()['start'],_0x183a68=new Map();let _0xcd4154=_0xe3c6a2;for(let _0x13c785=0x0;_0x13c785<_0x105bb2['path']['length'];_0x13c785++)if(_0x183a68['set'](_0xcd4154,_0x105bb2['path'][_0x13c785]),_0x13c785<_0x105bb2['path']['length']-0x1)_0xcd4154=_0xcd4154['getChild'](0x0);else{let _0x41cb04=_0xcd4154['nextSibling'];for(;_0x41cb04;)_0x183a68['set'](_0x41cb04,_0x105bb2['path'][_0x13c785]),_0x41cb04=_0x41cb04['nextSibling'];}return{'modelFragment':_0xe3c6a2,'anchorData':_0x183a68};}['_executeAction'](_0x4e4d4b,_0x5e4532,_0x55a950,_0x5621de,_0x5a43cb){const _0x583f97=this['editor']['plugins']['get'](O),_0x1296cc=this['editor']['plugins']['get'](W),_0xa2427=this['editor']['model']['document']['selection'],_0x3abe0c=_0x583f97['modelToViewWithIds'](_0x5e4532),_0x364ce6=this['editor']['data']['processor']['toData'](_0x3abe0c),_0x341664=this['editor']['model']['document']['version'],_0xcd6ea9=[..._0xa2427['getRanges']()],_0x39eae5=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0});return _0x1296cc['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x5621de,'icon':_0x5a43cb||_0x351952,'mainView':_0x39eae5,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0xcd6ea9}),this['_setLoadingState'](_0x39eae5,_0x1296cc),this['listenTo'](_0x1296cc,'applySuggestion',()=>{this['_applyChanges'](_0x5e4532,_0x55a950,!0x1);}),this['listenTo'](_0x1296cc,'insertSuggestion',()=>{this['_applyChanges'](_0x5e4532,_0x55a950,!0x0);}),this['listenTo'](_0x1296cc,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x1296cc);}),this['_createInteraction'](_0x364ce6,_0x341664,_0x39eae5,_0x1296cc,_0x4e4d4b);}['_wrapWithCommonAncestors'](_0x16d930,_0x5220b3,_0x3f048b){const _0xe10d92=this['editor']['model']['createRange'](_0x5220b3,_0x3f048b)['getCommonAncestor'](),_0x1845a6=_0xe10d92['is']('documentFragment')?[]:_0xe10d92['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x1845a6['length']){const _0x31e1f4=_0x1845a6['map'](_0x524332=>_0x524332['_clone'](!0x1));for(let _0x4390a3=0x1;_0x4390a3<_0x31e1f4['length'];_0x4390a3++)_0x31e1f4[_0x4390a3-0x1]['_appendChild'](_0x31e1f4[_0x4390a3]);return _0x31e1f4[_0x31e1f4['length']-0x1]['_appendChild'](_0x16d930),new _0x1dd05a(_0x31e1f4[0x0]);}return _0x16d930;}async['_createInteraction'](_0x4768fb,_0x15c618,_0x33db64,_0x47c45c,_0x48b1d9){const _0x4f8f7e=this['editor'];this['_currentInteractionParams']={'action':_0x48b1d9,'content':_0x4768fb,'version':_0x15c618,'mainView':_0x33db64,'aiBalloon':_0x47c45c},this['_interaction']=new q({'connector':this['_aiConnector'],'editor':_0x4f8f7e,'content':_0x4768fb,'version':_0x15c618,..._0x48b1d9});const _0x272e59=(_0x478794,_0x5b7184,_0x3f35e7=!0x1,_0x455a6a='streaming')=>this['_promiseQueue']['enqueue'](async _0x1edab7=>{try{const _0x459669=Y({'editor':_0x4f8f7e,'changeGroups':_0x478794['changeGroups'],'documentContextContent':_0x478794['documentContextContent'],'showDiff':_0x3f35e7,'trimUnchanged':!0x1});await _0x5b7184['updateContent']({'parts':_0x459669,'renderingStrategy':_0x455a6a,'abortSignal':_0x1edab7});}catch(_0x550e40){if(this['_isAbortError'](_0x550e40))return;throw _0x550e40;}});this['_interaction']['on']('replyCreated',(_0x2e1bc6,_0x5a5531)=>{_0x33db64['hideLoader'](),_0x272e59(_0x5a5531,_0x33db64)['catch'](_0xf6c19=>{this['_isAbortError'](_0xf6c19)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xf6c19);});}),this['_interaction']['on']('replyContentUpdated',(_0x1a2fbc,_0x21c1ab)=>{_0x272e59(_0x21c1ab,_0x33db64)['catch'](_0x1ded80=>{this['_isAbortError'](_0x1ded80)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x1ded80);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x33db64,_0x47c45c);}catch(_0x578269){this['_isAbortError'](_0x578269)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x578269);}}),this['listenTo'](_0x33db64,'toggleSuggestionDisplayMode',(_0x1572f0,{showDiff:_0x559607})=>{this['_balloonShowDiff']=_0x559607;const _0x2c0429=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2c0429&&_0x272e59(_0x2c0429,_0x33db64,_0x559607,'static')['catch'](_0x2b1afd=>{this['_isAbortError'](_0x2b1afd)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x2b1afd);});}),this['_setLoadingState'](_0x33db64,_0x47c45c);try{return await this['_interaction']['start']();}catch(_0x19848e){if(this['_isAbortError'](_0x19848e))return;throw _0x19848e;}}['_applyChanges'](_0x299318,_0x2bdb88,_0x5b81f7){const _0x48106e=this['editor'],_0xd3f86b=this['editor']['plugins']['get'](_0x348a94),_0x1198ee=this['_interaction'],_0x250cb0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x236afa=_0x250cb0['changeGroups'];let _0x423985=z({'editor':_0x48106e,'reply':_0x250cb0,'interaction':_0x1198ee,'groups':_0x236afa,'transform':!0x1,'documentCompare':_0xd3f86b,'documentCompareOptions':{'anchor':_0x48106e['model']['createPositionAt'](_0x299318,0x0),'markDeletions':_0x5b81f7}});_0x423985=this['_filterOperationsOutsideRange'](_0x423985,_0x2bdb88);for(const _0x561462 of _0x423985)this['_anchorOperation'](_0x2bdb88,_0x561462,_0x48106e['model']['document']['getRoot']());const _0x53cea6=_0x1198ee['getDocumentContext']()['version'],_0x4e572a=_0x48106e['model']['document']['history']['getOperations'](_0x53cea6),_0x2c351b={'document':_0x48106e['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x115e2c=it(_0x423985,_0x4e572a,_0x2c351b)['operationsA'];_0x48106e['model']['change'](_0x2c87fa=>{if(_0x2c87fa['setSelection'](_0x48106e['model']['document']['selection']['focus']),_0x5b81f7)_0x48106e['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x115e2c);else{for(const _0x400f54 of _0x115e2c)_0x400f54['baseVersion']=_0x48106e['model']['document']['version'],_0x2c87fa['batch']['addOperation'](_0x400f54),_0x48106e['model']['applyOperation'](_0x400f54);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x24a3d3,_0xfb013a){return _0x24a3d3['filter'](_0x3257b9=>{if('rename'==_0x3257b9['type']){const _0x49b2d1=_0x3257b9['position']['nodeAfter'];return!_0xfb013a['has'](_0x49b2d1);}if(_0x3257b9['type']['indexOf']('Attribute')>-0x1){const _0x20d073=_0x3257b9['range']['start']['nodeAfter'];return!_0xfb013a['has'](_0x20d073);}return!0x0;});}['_anchorOperation'](_0xbeb30f,_0x4f1c98,_0x2ef8bc){const _0x1af358=_0x4f1c98['clone']();for(const _0x4b574b in _0x4f1c98){const _0x3cd491=_0x4f1c98[_0x4b574b];_0x3cd491 instanceof _0x625116?_0x4f1c98[_0x4b574b]=new _0x625116(_0x2b9202(_0x3cd491['start']),_0x2b9202(_0x3cd491['end'])):_0x3cd491 instanceof _0x2aa99a&&(_0x4f1c98[_0x4b574b]=_0x2b9202(_0x3cd491));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x1af358['type'])){if(_0x1af358['isDocumentOperation']=!0x1,_0x1af358['baseVersion']=null,'remove'==_0x1af358['type']){const _0x20b9d5=_0x1af358['sourcePosition'],_0x13ee8c=_0x1af358['howMany'];new tt(_0x20b9d5,_0x13ee8c)['_execute']();}else _0x1af358['_execute']();}function _0x2b9202(_0x324982){if('$graveyard'==_0x324982['root']['rootName'])return _0x324982;const _0xdf855e=[];let _0x5afc54=_0x324982['root'];for(let _0x380509=0x0;_0x380509<_0x324982['path']['length'];_0x380509++){const _0x277bb5=_0xbeb30f['get'](_0x5afc54)||0x0;_0xdf855e[_0x380509]=_0x324982['path'][_0x380509]+_0x277bb5,_0x5afc54=_0x5afc54['getChildAtOffset'](_0x324982['path'][_0x380509]);}return new _0x2aa99a(_0x2ef8bc,_0xdf855e,_0x324982['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x29248d,content:_0x392fec,version:_0xe1401,mainView:_0x576595,aiBalloon:_0x53da1c}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x576595),_0x576595['showLoader'](),this['_createInteraction'](_0x392fec,_0xe1401,_0x576595,_0x53da1c,_0x29248d)['catch'](_0x481d95=>{this['_isAbortError'](_0x481d95)||console['error']('Error\x20refreshing\x20interaction:',_0x481d95);});}['_clearSuggestionContent'](_0x598273){const _0x463784=_0x598273['bodyView']['_children'];for(;_0x463784['length']>0x0;)_0x463784['remove'](_0x463784['first']);_0x598273['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x2fae4f){return!!_0x2fae4f['message']&&_0x2fae4f['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x127dc6=new _0x4b3349(this['editor']['locale']);_0x127dc6['set']({'icon':_0x5b6f7b,'label':Yn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x127dc6['bind']('isEnabled')['to'](this,'isBusy',_0xa61ec=>!_0xa61ec),_0x127dc6['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x127dc6);}['_setLoadingState'](_0x255f8f,_0x4f2252){_0x255f8f['setLoading'](),_0x4f2252['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x2c7e49,_0x314e03){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x2c7e49['clearLoading'](),_0x314e03['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x111b66,title:_0x14b400,description:_0x58447b,isParameterized:_0x1f7c2a,useArgs:_0x3a447f,options:_0x30dd6c}){this['id']=_0x111b66,this['title']=_0x14b400,this['description']=_0x58447b,this['isParameterized']=_0x1f7c2a,this['useArgs']=_0x3a447f,this['options']=_0x30dd6c;}}class kr extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x2c4849){this['_models']=_0x2c4849;}}class ti extends _0x3491c8(){['_checks'];constructor(_0x5ab937){super(),this['_checks']=this['_mapCheckDefinitions'](_0x5ab937);}get['checks'](){return this['_checks'];}['getCheckById'](_0x10d2da){return this['checks']['find'](_0x43dc45=>_0x43dc45['id']===_0x10d2da);}['_mapCheckDefinitions'](_0x42d359){return _0x42d359['map'](_0x181b7d=>'custom'===_0x181b7d['id']?new kr(_0x181b7d):new vs(_0x181b7d));}}class gs extends Mt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x10135f,contentNew:_0x471848,contentInitial:_0x21da22,documentVersion:_0x46e11f}){super(),this['id']=_0x10135f,this['contentNew']=_0x471848,this['contentInitial']=_0x21da22,this['documentVersion']=_0x46e11f;}}class Cs extends _0x3491c8(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4ce4dd,_0x2904fa,_0x5a9a9d){super(),this['id']=_0x4ce4dd,this['parent']=_0x5a9a9d,this['_data']=_0x2904fa,this['set']('isActivated',!0x1),this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class pr extends _0x3491c8(){['id']=_0x190955();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x7a7d4c,_0x5d1f9e,_0x41d4b1,_0x489354,_0x33c33e){super(),this['_documentData']=_0x7a7d4c,this['_sourceCheck']=_0x5d1f9e,this['_aiConnector']=_0x41d4b1,this['_reviewParams']=_0x489354,this['_reviewArgs']=_0x33c33e,this['on']('change:status',(_0x5ec16d,_0x1d9bfb,_0x306429)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x306429,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4699fc=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x332048 of _0x4699fc)'unmodified'!==_0x332048['data']['operation']&&('error'!==_0x332048['data']['operation']?this['_addReviewCheckResult'](_0x332048['data']['dataId'],_0x332048['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x4690f3){this['_currentError']=_0x4690f3,_0x4690f3 instanceof Error&&_0x4690f3['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'](_0x6a3636,_0x1d54f4){const _0x4f4c12=this['_results']['get'](_0x6a3636);if(!_0x4f4c12)return;const _0x426617=[];_0x1d54f4['forEach']((_0x419ec5,_0x2c9f38)=>{const _0x1ab98f=new Cs(_0x4f4c12['id']+'-'+_0x2c9f38,_0x419ec5,_0x4f4c12);_0x1ab98f['on']('change:status',()=>{'accepted'===_0x1ab98f['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x1ab98f}):'rejected'===_0x1ab98f['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x1ab98f});}),_0x1ab98f['on']('change:isActivated',()=>{_0x1ab98f['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1ab98f}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1ab98f});}),this['_changes']['push'](_0x1ab98f),_0x426617['push'](_0x1ab98f);}),this['fire']('reviewCheckResultReady',{'changes':_0x426617,'result':_0x4f4c12,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x84b372){const _0x335c8d=this['_changes']['find'](_0x18c0e6=>_0x18c0e6['id']===_0x84b372);return!(!_0x335c8d||'active'!==_0x335c8d['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5bb141=>'active'===_0x5bb141['status']);}['markAllChangesAsAccepted'](){for(const _0x22c00c of this['_changes'])'active'===_0x22c00c['status']&&(_0x22c00c['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1694fd){const _0x44a872=this['_changes']['find'](_0x300eb0=>_0x300eb0['id']===_0x1694fd);_0x44a872&&'active'===_0x44a872['status']&&(_0x44a872['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3547d1){const _0x6038fc=this['_changes']['find'](_0x203ee0=>_0x203ee0['id']===_0x3547d1);_0x6038fc&&'active'===_0x6038fc['status']&&(_0x6038fc['status']='rejected'),this['_checkIfFinished']();}['activateChange'](_0x33ee7b){this['_changes']['filter'](_0x417b72=>_0x417b72['isActivated']&&_0x417b72['id']!==_0x33ee7b)['forEach'](_0x33f199=>{_0x33f199['isActivated']=!0x1;});const _0x346d07=this['_changes']['find'](_0x5f4885=>_0x5f4885['id']===_0x33ee7b);_0x346d07&&(_0x346d07['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x48fe87=>_0x48fe87['isActivated'])['forEach'](_0x4c8c2a=>{_0x4c8c2a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x476bf6,_0x5b7e36){const _0xb298b7=this['_documentData']['elements']['get'](_0x476bf6);if(!_0xb298b7)return;const _0x3bec6a=_0xb298b7['getContent']();if(_0x3bec6a===_0x5b7e36)return;const _0x5083df=new gs({'id':_0x476bf6,'contentInitial':_0x3bec6a,'contentNew':_0x5b7e36,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5083df['id'],_0x5083df),this['fire']('reviewCheckResultAdded',{'result':_0x5083df,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x27ba6f=>'active'===_0x27ba6f['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class ei extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x42c0b7=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x2340f4=0x0;_0x2340f4<this['_reviewParams']['length'];_0x2340f4++){if(!this['_reviewParams'][_0x2340f4]||!this['_sourceCheck']['options'][_0x2340f4])continue;const _0x1e2a7d=this['_sourceCheck']['options'][_0x2340f4],_0x15da90=_0x1e2a7d['data']?.['find'](_0x54400d=>_0x54400d['id']===this['_reviewParams'][_0x2340f4]);_0x15da90&&_0x42c0b7['push'](_0x15da90['label']);}return this['_sourceCheck']['title']+':\x20'+_0x42c0b7['join'](',\x20');}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class si extends pr{['_prompt'];['_model'];constructor(_0x54f007,_0x4704d9,_0x5ca888,_0x4e86e7,_0x36929f){super(_0x5ca888,_0x4e86e7,_0x36929f),this['_prompt']=_0x54f007,this['_model']=_0x4704d9;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class hi extends Mt(){['_modelList']=[];['_connector'];constructor({connector:_0x4f69c6}){super(),this['_connector']=_0x4f69c6;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x555fb4=this['_connector']['getModels'](),_0x52f6c0=await _0x555fb4['list']();this['_modelList']=_0x52f6c0['items'];}catch{}return this['_modelList'];}}const ri=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]}]}];class ee extends _0x3e9f85{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[N];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x6c0428=this['context']['config']['get']('ai.reviewMode.translations');if(_0x6c0428){for(const _0xe3aaf1 of ri)'translate'===_0xe3aaf1['id']&&(_0xe3aaf1['options'][0x0]['data']=_0x6c0428);}const _0x290aea=this['_translateReviewChecks'](ri);this['_aiReviewCheckList']=new ti(_0x290aea);const _0x4fd58a=this['_aiReviewCheckList']['checks']['find'](_0x305290=>'custom'===_0x305290['id']);if(_0x4fd58a){const _0xd8534a=await new hi({'connector':this['_aiConnector']})['getAll']();_0x4fd58a['models']=_0xd8534a['map'](_0x396a62=>({..._0x396a62,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x396a62['id']['toUpperCase'](),_0x396a62['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x259c07,_0x733dd1)=>{const _0x81dd06=this['_aiReviewCheckList']['getCheckById'](_0x733dd1['id']);if(_0x81dd06){this['_onDiffChange'](this['_isDiffOn']),_0x733dd1['isCustom']?this['_currentReviewCheckRun']=new si(_0x733dd1['args']['prompt'],_0x733dd1['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x81dd06,this['_aiConnector']):this['_currentReviewCheckRun']=new ei(this['_aiReviewModeEditing']['getDocumentData'](),_0x81dd06,this['_aiConnector'],_0x733dd1['params'],_0x733dd1['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0xbf7fed,_0xbee4b0)=>{'data'===_0xbee4b0['status']||'loading'===_0xbee4b0['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0xbee4b0)):'finished'===_0xbee4b0['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0xbee4b0['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0xbee4b0['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0xbee4b0['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0xbee4b0['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0xbee4b0['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1063db,_0x396693)=>{if(!this['_currentReviewCheckRun'])throw new _0x599d16('aireviewmode-no-current-check-run',this);const _0x381b65=this['_aiReviewModeEditing']['diffContent'](_0x396693['result']['contentInitial'],_0x396693['result']['contentNew']);_0x396693['source']['addResultChanges'](_0x396693['result']['id'],_0x381b65);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3be658,_0xbf4eb1)=>{for(const _0x3f2a49 of _0xbf4eb1['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x3f2a49);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0xbf4eb1['changes'],_0xbf4eb1['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x278bfe,_0x4d085f)=>{this['_aiReviewModeUi']['updateChangeState'](_0x4d085f['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x58be7c,_0x1f50da)=>{this['_aiReviewModeUi']['updateChangeState'](_0x1f50da['change']['id'],'rejected');}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4d1a96,_0x2bf5ee)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x2bf5ee['change']['id']);const _0x43e56a=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x2bf5ee['change']['id']);if(_0x43e56a){if('content'===this['_changeActivationSource']){const _0x1d958f=this['_aiReviewModeUi']['getChangeElement'](_0x2bf5ee['change']['id']);_0x1d958f&&_0x5de7fa(_0x1d958f['closest']('.ck-ai-review-mode__check-run-result')||_0x1d958f);}else{if('panel'===this['_changeActivationSource']){const _0x3d9fc3={'target':_0x43e56a['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};rt(_0x3d9fc3);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x2bf5ee['change'],_0x43e56a['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5af24e){_0x5af24e instanceof Error&&_0x5af24e['message']['includes']('ai-request-aborted')||(_0x5af24e instanceof _0x599d16?this['_logError'](_0x5af24e):this['_logError'](new _0x599d16('aireviewmode-check-run-failed',this,{'error':_0x5af24e})));}}else this['_logError'](new _0x599d16('aireviewmode-source-check-not-found',this,{'checkId':_0x733dd1['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x1bece5=this['_currentReviewCheckRun']['getActiveChanges']();_0x1bece5['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x1bece5['map'](_0xd765f0=>_0xd765f0['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x117abb,_0x5a4407)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5a4407['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x5a4407['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5a4407['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x5cb43a,_0x515dc7)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x515dc7['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x515dc7['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x515dc7['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x4398e1,_0x3ebcaa)=>{this['_isDiffOn']=_0x3ebcaa['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x36d7e0,_0x5f2448)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5f2448['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x4d0907,_0x229ba5)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x229ba5['changeId']));});}['_onReviewModeRunLeave'](_0x4396b0=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x4396b0&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x5ebb6c=this['_aiReviewModeEditing']['getContentElement']();_0x5ebb6c&&(_0x5ebb6c['classList']['remove']('ck-ai-review-mode-diff'),_0x5ebb6c['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0xf2d8a8){const _0xb4cc4b=this['_aiReviewModeEditing']['getContentElement']();_0xb4cc4b&&(_0xb4cc4b['classList']['remove']('ck-ai-review-mode-diff'),_0xb4cc4b['classList']['remove']('ck-ai-review-mode-highlights'),_0xb4cc4b['classList']['add'](_0xf2d8a8?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x44fbec){return _0x44fbec['map'](_0x1d8d24=>{const _0x53a4e6='AI_REVIEW_CHECK_'+_0x1d8d24['id']['toUpperCase']()['replaceAll']('-','_'),_0x2a5bef={..._0x1d8d24,'title':this['_getTranslationWithDefault'](_0x53a4e6+'_TITLE',_0x1d8d24['title']),'description':this['_getTranslationWithDefault'](_0x53a4e6+'_DESCRIPTION',_0x1d8d24['description'])};return _0x1d8d24['options']&&(_0x2a5bef['options']=_0x1d8d24['options']['map'](_0x3d66dd=>({..._0x3d66dd,'label':this['_getTranslationWithDefault'](_0x53a4e6+'_OPTIONS_LABEL',_0x3d66dd['label']||''),'data':_0x3d66dd['data']?_0x3d66dd['data']['map'](_0x3ae5cc=>({..._0x3ae5cc,'label':this['_getTranslationWithDefault'](_0x53a4e6+'_OPTIONS_DATA_'+_0x3ae5cc['id']['toUpperCase'](),_0x3ae5cc['label'])})):void 0x0}))),_0x2a5bef;});}['_getTranslationWithDefault'](_0x1113d7,_0x4ef8bd){const _0x5c622d=Yn(this['context']['locale'],_0x1113d7);return _0x5c622d===_0x1113d7?_0x4ef8bd:_0x5c622d;}['_logError'](_0x280b1b){nt(_0x280b1b['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x3a2ab2{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x3fdbf1,_0x414f0b){super(_0x3fdbf1),this['_defaultValue']=_0x414f0b['default']||(_0x414f0b['data']['length']>0x0?_0x414f0b['data'][0x0]['id']:''),this['_defaultLabel']=_0x414f0b['data']['find'](_0x2499a7=>_0x2499a7['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x45dc52(this['locale']);const _0x5565ce=this['_prepareListOptions'](_0x414f0b['data']);_0x291cf2(this['_dropdownView'],_0x5565ce,{'role':'menu','ariaLabel':_0x414f0b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x59ce60=>{_0x59ce60['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x2b8ddf=>{this['formValue']=_0x2b8ddf['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x2b8ddf['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x389c63=[]){const _0x3e6f5f=new _0xe98229();this['resetToDefault']();for(const _0x36ff66 of _0x389c63){const _0x1e4add=new _0x45b9d4({'label':_0x36ff66['label'],'withText':!0x0,'role':'menuitemradio','id':_0x36ff66['id'],'model':_0x36ff66});_0x1e4add['bind']('isOn')['to'](this,'formValue',_0xad36ac=>_0xad36ac===_0x1e4add['id']);const _0x178807={'type':'button','model':_0x1e4add};_0x3e6f5f['add'](_0x178807);}return _0x3e6f5f;}}class Ps extends _0x1f44f8{['_formItem']=null;constructor(_0x1bf13c,_0x38f48a,_0x493d1){super(_0x1bf13c),this['argsKey']=_0x38f48a?.['argsKey'];if('dropdown'===_0x38f48a['formType'])this['_formItem']=new Mr(this['locale'],_0x38f48a);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x15286f=new _0x1c3fa1(this['locale'],{'children':[this['_formItem']],'class':[_0x493d1?'ck-form__row_with-submit':'']});_0x493d1&&_0x15286f['children']['add'](_0x493d1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x15286f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Bs extends _0x1b9be6{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x573c3c){super(_0x573c3c),this['set']('isEmpty',!0x0),this['minRows']=Bs['MIN_ROWS'],this['maxRows']=Bs['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x26ffb7=>{_0x26ffb7['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x20f0a1){this['set']('placeholder',_0x20f0a1);}}class js extends _0x3a2ab2{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x241235,_0x557dde){super(_0x241235),this['_check']=_0x557dde,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x557dde['models']&&_0x557dde['models']['length']>0x0?_0x557dde['models'][0x0]['id']:'',this['_defaultLabel']=_0x557dde['models']&&_0x557dde['models']['length']>0x0?_0x557dde['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new Bs(_0x241235),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0xe98229(),this['_setModelList'](),_0x291cf2(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x2a18eb=new _0x3a2ab2(_0x241235);_0x2a18eb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x1c3fa1(this['locale'],{'children':[this['promptInputView']]}),new _0x1c3fa1(this['locale'],{'children':[_0x2a18eb]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0x326378=new _0x4b3349(this['locale']),t=this['locale']['t'];return _0x326378['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x326378['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x147972=>{_0x147972['stopPropagation']();})}}),_0x326378['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x326378;}['_createCancelButtonView'](){const _0x5684c0=new _0x4b3349(this['locale']),t=this['locale']['t'];return _0x5684c0['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x5684c0['on']('execute',()=>{this['resetToDefault']();}),_0x5684c0;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x4e9f24=this['_check']['models'];if(this['resetToDefault'](),_0x4e9f24?.['length'])for(const _0xebe058 of _0x4e9f24){const _0x30f112=new _0x45b9d4({'label':_0xebe058['name'],'withText':!0x0,'role':'menuitemradio','id':_0xebe058['id'],'model':_0xebe058});_0x30f112['bind']('isOn')['to'](this,'modelId',_0xda6496=>_0xda6496===_0xebe058['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x30f112,'labelView':new Ds(this['locale'],_0xebe058)});}}['_createModelSelectionDropdown'](){const _0x3e00df=_0x45dc52(this['locale']);return _0x3e00df['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x3e00df['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x31420c=>{_0x31420c['stopPropagation']();})}}),_0x3e00df['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x3e00df,'execute',_0x29d44f=>{this['modelId']=_0x29d44f['source']['model']['id'],_0x3e00df['buttonView']['label']=_0x29d44f['source']['label'];}),_0x3e00df;}}class Ds extends _0x39c654{constructor(_0x261ca1,_0xc9b74f){super();const _0x541e35=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x541e35['to']('style'),'id':_0x541e35['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x541e35['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0xc9b74f['description']}]}]}]});}}class Rs extends _0x1f44f8{['_formItemsCollection']=new _0x4346f0();['_customCheckView']=null;constructor(_0x2662eb,_0x9c38a4,_0x57ac39){super(_0x2662eb),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x9c38a4['isParameterized']);const _0x3f47e2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x1755c4=>_0x1755c4),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x38af40=>_0x38af40)],'style':{'--ck-ai-check-list-item-index':_0x57ac39}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x9c38a4['title']}]},_0x3f47e2]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x9c38a4['description']}]}]}]},..._0x9c38a4['isParameterized']?[this['_createParameterizedView'](_0x9c38a4)]:[],...'custom'===_0x9c38a4['id']?[this['_createCustomView'](_0x9c38a4)]:[]]}),this['on']('click',()=>{_0x9c38a4['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x9c38a4['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0xca342f({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2dfad7=>{_0x2dfad7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0xfbaaee=new _0x1f8dd5();return _0xfbaaee['content']=_0x3f1895,_0xfbaaee['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0xfbaaee;}['_createParameterizedView'](_0xd683ae){const _0x5a18c4=new _0x3a2ab2(),_0x44b01d=this['_createFormView'](_0xd683ae);return _0x5a18c4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xb4ce22=>!_0xb4ce22)]},'children':[_0x44b01d]}),_0x5a18c4;}['_createFormView'](_0x277ba5){const _0x49257d=new _0x3a2ab2(),_0x4f492e=Array['isArray'](_0x277ba5['options'])?_0x277ba5['options']:[],_0x401376=new _0x4b3349(this['locale']),t=this['locale']['t'];_0x401376['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x401376['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xe49a89=>{_0xe49a89['stopPropagation']();})}}),_0x401376['on']('execute',()=>{const _0x58fb1e=[],_0x659e3c={};this['_formItemsCollection']['forEach'](_0x32f294=>{_0x58fb1e['push'](_0x32f294['value']),_0x277ba5['useArgs']&&_0x277ba5['options']&&(_0x659e3c[_0x32f294['argsKey']]=_0x32f294['value']);}),this['fire']('runReviewCheck',{'id':_0x277ba5['id'],'params':_0x58fb1e['length']?_0x58fb1e:void 0x0,'args':Object['keys'](_0x659e3c)['length']?_0x659e3c:void 0x0});});const _0x5b4a49=_0x4f492e['length'];return _0x4f492e['forEach']((_0xa1a57b,_0x30eb02)=>{const _0x172d0e=_0x30eb02===_0x5b4a49-0x1;this['_formItemsCollection']['add'](new Ps(this['locale'],_0xa1a57b,_0x172d0e?_0x401376:null));}),_0x49257d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x49257d;}['_createCustomView'](_0x5383ec){return this['_customCheckView']=new js(this['locale'],_0x5383ec),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x418fb9=>!_0x418fb9)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Ws extends _0x1f44f8{['_checkViews'];constructor(_0x451964){super(_0x451964),this['_checkViews']=new _0x4346f0();const _0x30358d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x30358d['if']('isVisible','ck-hidden',_0x29a5c2=>!_0x29a5c2)]},'children':this['_checkViews']});}['setChecks'](_0x324005){this['_checkViews']['clear']();for(const [_0x3122e4,_0x1a5eca]of _0x324005['entries']()){const _0x16cf77=new Rs(this['locale'],_0x1a5eca,_0x3122e4);_0x16cf77['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x16cf77);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2745f6 of this['_checkViews'])_0x2745f6 instanceof Rs&&_0x2745f6['resetToDefault']();}}class xs extends _0x3a2ab2{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x2a3307,_0x3c2503){super(_0x2a3307),this['id']=_0x3c2503,this['set']('changeId',_0x3c2503),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x3c2503,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x558a64=new _0x3a2ab2(this['locale']);return _0x558a64['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-ai-review-mode__check-run-result-response']}}),_0x558a64;}['_createAcceptButtonView'](){const _0x529b09=new _0x4b3349(this['locale']);return _0x529b09['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x529b09['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x45b535=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x45b535['stopPropagation']();})}}),_0x529b09;}['_createDismissButtonView'](){const _0x420108=new _0x4b3349(this['locale']);return _0x420108['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x420108['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x266595=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x266595['stopPropagation']();})}}),_0x420108;}['_createInfoButtonView'](){const _0x204119=new _0x4b3349(this['locale']);return _0x204119['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x414616,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x204119['bind']('isOn')['to'](this,'isInfoToggleOn',_0x352e58=>_0x352e58),_0x204119['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x204119;}}class Hs extends _0x1f44f8{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x12c9ed){super(_0x12c9ed),this['_resultViews']=new _0x4346f0(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Ci(_0x12c9ed),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x51b01f=this['_createCombinedSkeletonLoader'](),_0x33c0ce=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x33c0ce['if']('isVisible','ck-hidden',_0x2fa670=>!_0x2fa670)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2a78bb=>_0x2a78bb)]},'children':this['_resultViews']},_0x51b01f]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0xef2548){const _0x4ea218=new xs(this['locale'],_0xef2548['id']);_0x4ea218['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x4ea218),_0x4ea218['resultResponseView']['element']['innerHTML']=_0xef2548['contentDiffed'];}['hideResult'](_0x26d9b9){const _0x3b08ed=this['_resultViews']['find'](_0x198f25=>_0x198f25['id']===_0x26d9b9);_0x3b08ed&&(_0x3b08ed['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x3b08ed['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x3b08ed),_0x3b08ed['destroy']();},{'once':!0x0}));}['setTitle'](_0x4d01a6){this['headerTitle']=_0x4d01a6;}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new Fe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x403215=new _0x3a2ab2(this['locale']),_0x1ee5eb=[];for(let _0x20fc91=0x0;_0x20fc91<0x10;_0x20fc91++){const _0x4dfe06=this['_createSkeletonLoader']();_0x4dfe06['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x1ee5eb['push'](_0x4dfe06);}return _0x403215['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x410ab2=>!_0x410ab2)]},'children':_0x1ee5eb}),_0x403215;}['_createErrorView'](){const _0x5aa75f=new _0x3a2ab2(this['locale']),_0xdc7cd2=new _0x4b3349(this['locale']),t=this['locale']['t'];return _0x5aa75f['delegate']('retryReview')['to'](this),_0xdc7cd2['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0xdc7cd2['on']('execute',()=>{this['fire']('retryReview');}),_0x5aa75f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x39a2ee=>!_0x39a2ee),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x1d8afe=>'chunk'===_0x1d8afe)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x110232=>'chunk'===_0x110232)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x18958d=>'general'!==_0x18958d)]},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x46d713=>'chunk'!==_0x46d713)]},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0xdc7cd2]}),_0x5aa75f;}['_createCancelButtonView'](){const _0x19cfa2=new _0x4b3349(this['locale']);return _0x19cfa2['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x38b63}),_0x19cfa2['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x391a36=>_0x391a36)]}}),_0x19cfa2['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x19cfa2;}['_createToggleDiffButtonView'](){const _0x14fa36=new _0x4b3349(this['locale']);_0x14fa36['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x14fa36['bind']('isEnabled')['to'](this,'isError',_0x534de1=>!_0x534de1),_0x14fa36['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x52e3b9=>!_0x52e3b9)]}});const _0x3a35bf=Yn(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3c71d1=Yn(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x14fa36['bind']('isOn')['to'](this,'isToggleDiffOn',_0x55a21c=>_0x55a21c),_0x14fa36['bind']('icon')['to'](this,'isToggleDiffOn',_0x3bb2e0=>_0x3bb2e0?_0x817ebb:_0x26e1ac),_0x14fa36['bind']('label')['to'](this,'isToggleDiffOn',_0x4fe1ef=>_0x4fe1ef?_0x3a35bf:_0x3c71d1),_0x14fa36['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x14fa36;}['_createAcceptAllButtonView'](){const _0x35d7b1=new _0x4b3349(this['locale']);return _0x35d7b1['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x35d7b1['bind']('isEnabled')['to'](this,'isError',_0x3322f5=>!_0x3322f5),_0x35d7b1['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4e9b21=>!_0x4e9b21)]}}),_0x35d7b1['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x35d7b1;}['_createExitReviewButtonView'](){const _0x26a665=new _0x4b3349(this['locale']);return _0x26a665['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x26a665['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5ec9af=>!_0x5ec9af)]}}),_0x26a665['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x26a665;}['_createResultHeaderView'](){const _0x32f04e=new _0x3a2ab2(this['locale']),_0x512fa4=new De();return _0x512fa4['bind']('isVisible')['to'](this,'isResultReady',_0xafb8ed=>!_0xafb8ed),_0x32f04e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x512fa4,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x32f04e;}}class Ns extends _0x1f44f8{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x3b929d){super(_0x3b929d),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['set']('viewType','completed');const _0x22b3f2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x22b3f2['if']('isVisible','ck-hidden',_0x53cdbf=>!_0x53cdbf)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'🎉'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':_0x22b3f2['to']('viewType',_0x20b582=>Yn(_0x3b929d,'completed'===_0x20b582?'AI_REVIEW_MODE_COMPLETED_TEXT':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'))}]}]}]});}['_createFinishReviewButtonView'](){const _0x3a72ea=new _0x4b3349(this['locale']);return _0x3a72ea['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3a72ea['on']('execute',()=>{this['fire']('finishReview');}),_0x3a72ea;}['_createResultHeaderView'](){const _0x4ddafd=new _0x3a2ab2(this['locale']);return _0x4ddafd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4ddafd;}}class oe extends _0x3a2ab2{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5ab833){super(_0x5ab833),this['reviewModeHeader']=new _0x20b76f(_0x5ab833,{'label':Yn(_0x5ab833,'AI_REVIEW_MODE'),'icon':te,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Ws(_0x5ab833),this['reviewCheckListView']['delegate'](...Gs)['to'](this),this['reviewCheckResultsView']=new Hs(_0x5ab833),this['reviewCheckResultsView']['delegate'](...Gs)['to'](this),this['reviewCompletedView']=new Ns(_0x5ab833),this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0);}['addCheckRunResult'](_0x2c74a0){this['reviewCheckResultsView']['addResult'](_0x2c74a0),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','completed'),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','unmodified'),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class he extends _0x1618b0{['resultItemView'];constructor(_0x2effbd,_0x4ef5de){super(_0x2effbd),this['set']({'isVisible':!0x1,'position':'se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x4ef5de['add'](this),_0xca342f({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['updateContent'](_0x1744ad){this['resultItemView']['changeId']=_0x1744ad['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x1744ad['contentDiffed'];}['showBalloon'](_0x224c17,_0x3b0010){this['updateContent'](_0x224c17),this['show'](),this['pin']({'target':_0x3b0010});}['hideBalloon'](){this['hide'](),this['unpin']();}['deactivateChange'](){this['fire']('deactivateChange');}['_createContentView'](){const _0x16fdd5=new _0x3a2ab2();return this['resultItemView']=new xs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x16fdd5['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x16fdd5;}}const Gs=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x3e9f85{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[ht];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19c237){super(_0x19c237),this['_bodyCollection']=new _0x582686(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new oe(this['context']['locale']),this['_reviewModeView']['delegate'](...Gs)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new he(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x4245a3=this['context']['plugins']['get']('AITabs');_0x4245a3['view']['on']('activateTab',(_0x3ef5f1,_0xe3de08)=>{'reviewMode'===_0xe3de08?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x4245a3['view']['addTab']({'id':'reviewMode','buttonLabel':Yn(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':te,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3c2504){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x3c2504),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5400ac){_0x5400ac&&('error-general'!==_0x5400ac['status']?'error-chunk'!==_0x5400ac['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x44bb2b){this['_reviewModeView']['addCheckRunResult'](_0x44bb2b);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3bf036){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x3bf036);}['setActiveStateInResults'](_0x450cc9){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3fc52a=>{_0x3fc52a['id']===_0x450cc9&&_0x3fc52a['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x258b7a=>_0x258b7a['setItemAsInactive']());}['updateChangeState'](_0x4c3ff2,_0x2ed83c){'accepted'!==_0x2ed83c&&'rejected'!==_0x2ed83c||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x4c3ff2);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x4c8ce6,_0x1c32de){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x4c8ce6,_0x1c32de);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['getChangeElement'](_0x9a088e){const _0x3ca6d9=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x27e22e=>_0x27e22e['id']===_0x9a088e);return _0x3ca6d9?_0x3ca6d9['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const Gt='reviewmode-';class re extends _0x3e9f85{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x24dc23,O];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x20bbd5){super(_0x20bbd5),this['_domEmitter']=new(bt())(),this['_eventEmitter']=new(Mt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5e9b6c=V(this['context']);_0x5e9b6c['conversion']['for']('editingDowncast')['markerToElement']({'model':Gt+'insert','view':(_0x45b2bb,{writer:_0x1e8080})=>{const _0x1dff93=this['_markers']['get'](_0x45b2bb['markerName']),_0x2ca34d={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x45b2bb['markerName']};return _0x1e8080['createUIElement']('span',_0x2ca34d,function(_0x185ed2){const _0x466fbf=this['toDomElement'](_0x185ed2);return _0x466fbf['innerHTML']=_0x1dff93?.['text']||'',_0x466fbf;});}}),_0x5e9b6c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Gt+'remove-only','view':_0x3a4c52=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x3a4c52['markerName']}})}),_0x5e9b6c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Gt+'remove-context','view':_0x111346=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x111346['markerName']}})}),_0x5e9b6c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Gt+'remove-text','view':_0xb4d307=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0xb4d307['markerName']}})}),_0x5e9b6c['conversion']['for']('dataDowncast')['markerToElement']({'model':Gt+'suggestion-context','view':(_0x25cd09,{writer:_0x4d441a})=>_0x4d441a['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x25cd09['isOpening']?'start':'end')})}),_0x5e9b6c['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2c24e1,'view':Ft}),this['_domEmitter']['listenTo'](document,'click',(_0x1ccdf8,_0x2e7a0e)=>{const _0x40c410=_0x2e7a0e['target'],_0x54c691=this['_findMarkerElement'](_0x40c410);if(!_0x54c691)return;const _0x5e985d=_0x54c691['getAttribute']('data-marker-id'),_0x49581c=_0x5e985d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x5e985d,'changeId':_0x49581c});});}['getDocumentData'](){const _0x19741e=this['context']['plugins']['get']('AIEditing'),_0x1c2733=V(this['context']),_0x31933b=_0x1c2733['model'],_0x5815b4=new _0x1dd05a();for(const _0x2266cf of _0x31933b['document']['getRoot']()['getChildren']()){const _0x587d76=_0x2266cf['_clone'](!0x0);_0x5815b4['_appendChild'](_0x587d76);}for(const _0x3f7e2d of _0x31933b['markers'])_0x5815b4['markers']['set'](_0x3f7e2d['name'],this['_changeRangeOwnerDocument'](_0x3f7e2d['getRange']()['clone'](),_0x5815b4));const _0x1b9e7a=new Ot({'ignoreElementEnd':!0x0,'startPosition':_0x31933b['createPositionAt'](_0x5815b4,0x0)}),_0x248740=new Set(),_0x3149c0=new Map();for(const {item:_0x22a0d1}of _0x1b9e7a){if(!_0x22a0d1['is']('$textProxy'))continue;const _0x3eb26a=_0x22a0d1['parent'];if((!_0x3eb26a||!_0x3eb26a['is']('element','caption'))&&(_0x3eb26a&&_0x3eb26a['is']('element'))){let _0x408559=_0x3eb26a['getAttribute'](_0x2c24e1);_0x408559||(_0x408559=_0x19741e['_nextDataId'](_0x248740),_0x3eb26a['_setAttribute'](_0x2c24e1,_0x408559)),_0x248740['add'](_0x408559);const _0x3217d8=this['_getTopElement'](_0x3eb26a);_0x3149c0['set'](_0x408559,{'path':_0x3eb26a['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3217d8['_clone'](!0x0),_0x408559,_0x1c2733['data'])}),_0x1b9e7a['jumpTo'](_0x31933b['createPositionAfter'](_0x3eb26a));}}return{'content':_0x1c2733['data']['processor']['toData'](_0x1c2733['data']['toView'](_0x5815b4)),'version':_0x1c2733['model']['document']['version'],'elements':_0x3149c0};}['diffContent'](_0x5605ae,_0x3fda29){const _0x5e7b03=V(this['context']),_0x581c42=_0x5e7b03['data']['parse'](_0x5605ae,'$documentFragment'),_0x539e65=_0x5e7b03['model']['createPositionAt'](_0x581c42,0x0),_0x36fd04=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5605ae,_0x3fda29,{'anchor':_0x539e65,'markDeletions':!0x0})['getOperations']()['filter'](_0x5e299f=>'insert'===_0x5e299f['type']||'marker'===_0x5e299f['type']&&_0x5e299f['name']['startsWith']('$markedRemove')),_0x1b1202=this['_groupAdjacentOperations'](_0x36fd04),_0x1548fe=[];let _0x5ce2bd=0x0;return _0x5e7b03['model']['change'](_0x5c6334=>{for(let _0x340bf7=0x0;_0x340bf7<_0x1b1202['length'];_0x340bf7++){const _0x1552f1=_0x1b1202[_0x340bf7],_0x46d26d=_0x5c6334['createDocumentFragment']();for(const _0x57482a of _0x581c42['getChildren']())_0x5c6334['append'](_0x57482a['_clone'](!0x0),_0x46d26d);for(const _0x208130 of _0x1552f1['operationsIsolated'])if('insert'===_0x208130['type']){const _0x1b881d=_0x208130;_0x1b881d['baseVersion']=null,_0x1b881d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1b881d,_0x46d26d),_0x5c6334['batch']['addOperation'](_0x208130),_0x5e7b03['model']['applyOperation'](_0x208130);const _0x5cb6b6='suggestion:insertion:id:authorId:'+_0x5ce2bd++,_0x2cf7d8=_0x5e7b03['model']['createRange'](_0x1b881d['position'],_0x1b881d['position']['getShiftedBy'](_0x1b881d['howMany']));_0x46d26d['markers']['set'](_0x5cb6b6,_0x2cf7d8);}else{if('marker'===_0x208130['type']&&_0x208130['name']['startsWith']('$markedRemove')){const _0x50ed8a=_0x208130,_0x10bfa4='suggestion:deletion:id:authorId:'+_0x5ce2bd++;this['_changeOperationOwnerDocument'](_0x50ed8a,_0x46d26d),_0x46d26d['markers']['set'](_0x10bfa4,_0x50ed8a['newRange']);}}const _0x54a227=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1552f1['operationsIsolated'][0x0]),_0x46d26d),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1552f1['operationsIsolated'][_0x1552f1['operationsIsolated']['length']-0x1]),_0x46d26d));_0x46d26d['markers']['set'](Gt+'suggestion-context',new _0x625116(_0x54a227['start'],_0x54a227['end'])),_0x1548fe['push']({..._0x1552f1,'context':this['_createGetContextFn'](_0x46d26d,_0x5e7b03['data'],{'ellipsisBefore':_0x54a227['hasContentBefore'],'ellipsisAfter':_0x54a227['hasContentAfter']}),'content':this['_createGetContentFn'](_0x46d26d,_0x5e7b03['data'])});}}),_0x1548fe;}['markChangePositionInEditorContent'](_0x457d5b,_0x448a7c){const _0x4f1667=_0x457d5b[0x0]['parent']['id'],_0x2c44a8=_0x448a7c['elements']['get'](_0x4f1667);if(!_0x2c44a8)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4f1667);const _0xc9b2a7=_0x2c44a8['path'],_0x2957e1=V(this['context']),_0x54145b=_0x2957e1['model']['document']['history']['getOperations'](_0x448a7c['version']),_0x2e2d7a=[];for(const _0x30b640 of _0x457d5b){const _0xb83c5f=_0x30b640['operationsIsolated']['map'](_0x26ad89=>this['_translateOperationToEditorContent'](_0x26ad89,_0xc9b2a7,_0x2957e1['model']['document']['getRoots']()[0x0]));if(!_0xb83c5f||!_0xb83c5f['length'])continue;const _0x3aa0ab=_0xb83c5f['every'](_0x4b6889=>'marker'===_0x4b6889['type']&&_0x4b6889['name']['startsWith']('$markedRemove')),_0x3e46d1={'document':_0x2957e1['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3279e4=it(_0xb83c5f,_0x54145b,_0x3e46d1)['operationsA'];for(const _0x2295c5 of _0x3279e4)if('insert'===_0x2295c5['type']){const _0x352913=_0x2295c5,_0x318d19=_0x352913['nodes'];let _0x1b7ba8='';for(const _0x32835c of _0x318d19)_0x32835c&&_0x32835c['is']('model:$text')&&(_0x1b7ba8+=_0x32835c['data']);_0x2e2d7a['push']({'start':_0x352913['position'],'end':_0x352913['position'],'type':'insert','groupId':_0x30b640['id'],'text':_0x1b7ba8});}else{if('marker'===_0x2295c5['type']&&_0x2295c5['name']['startsWith']('$markedRemove')){const _0x4706ea=_0x2295c5;let _0x16ed87='remove-text';if(_0x3aa0ab){const _0x5a6f5a=this['_findAdjacentContextDistance'](_0x4706ea['newRange']['start'],'backward',_0x2957e1['model']['schema']),_0x1d2045=this['_findAdjacentContextDistance'](_0x4706ea['newRange']['end'],'forward',_0x2957e1['model']['schema']);if(_0x5a6f5a||_0x1d2045){const _0x46320d=_0x4706ea['newRange']['start']['getShiftedBy'](-_0x5a6f5a),_0x666016=_0x4706ea['newRange']['end']['getShiftedBy'](_0x1d2045);_0x2e2d7a['push']({'start':_0x46320d,'end':_0x666016,'groupId':_0x30b640['id'],'type':'remove-context'});}else _0x16ed87='remove-only';}_0x2e2d7a['push']({'start':_0x4706ea['newRange']['start'],'end':_0x4706ea['newRange']['end'],'groupId':_0x30b640['id'],'type':_0x16ed87});}}}this['_insertMarkers'](_0x2e2d7a);}['clearAllMarkers'](){V(this['context'])['model']['change'](_0x4de3c9=>{for(const _0x32a802 of this['_markers']['keys']())_0x4de3c9['removeMarker'](_0x32a802);}),this['_markers']['clear']();}['switchToReadOnly'](){V(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){V(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x5ff1eb){const _0x30da46=V(this['context']),_0x4ce7b1=_0x30da46['model'],_0x32535a=_0x5ff1eb['map'](_0x29a6fa=>this['_getMarkersDataForGroup'](_0x29a6fa))['flat']();_0x4ce7b1['change'](_0x4fe876=>{for(const _0x44bf22 of _0x32535a){const _0x4a80f9=_0x30da46['model']['markers']['get'](_0x44bf22['id']);_0x4a80f9&&('insert'===_0x44bf22['type']?_0x4ce7b1['insertContent'](_0x4fe876['createText'](_0x44bf22['text']||''),_0x4a80f9['getRange']()['start']):'remove-text'!==_0x44bf22['type']&&'remove-only'!==_0x44bf22['type']||_0x4ce7b1['deleteContent'](_0x4ce7b1['createSelection'](_0x4a80f9['getRange']())),_0x4fe876['removeMarker'](_0x44bf22['id']),this['_markers']['delete'](_0x44bf22['id']));}});}['rejectChange'](_0x9ed03b){const _0x2291d9=V(this['context']),_0x252bb8=this['_getMarkersDataForGroup'](_0x9ed03b);_0x2291d9['model']['change'](_0x6f288e=>{for(const _0x2ac048 of _0x252bb8)_0x6f288e['removeMarker'](_0x2ac048['id']),this['_markers']['delete'](_0x2ac048['id']);});}['getContentElement'](){const _0x40ef82=V(this['context']);return _0x40ef82&&_0x40ef82['ui']&&_0x40ef82['ui']['element']?_0x40ef82['ui']['element']:null;}['getMarkerElementForChange'](_0x1b572b){const _0x163e49=Array['from'](this['_markers']['values']())['filter'](_0x550bee=>_0x550bee['groupId']===_0x1b572b);if(!_0x163e49['length'])return null;const _0x10d3d8=0x1===_0x163e49['length']?_0x163e49[0x0]:this['_sortMarkers'](_0x163e49)[0x0],_0x5299e6=V(this['context']),_0x1048ef=_0x5299e6['model']['markers']['get'](_0x10d3d8['id']);if(!_0x1048ef)return null;const _0x5a1449=_0x1048ef['getRange'](),_0x58168b=_0x5299e6['editing']['view']['getDomRoot']();if(!_0x58168b||!_0x5a1449)return null;const _0xf70fe8=_0x58168b['querySelector']('[data-marker-id=\x22'+_0x10d3d8['id']+'\x22]');return _0xf70fe8?{'modelRange':_0x5a1449,'domElement':_0xf70fe8}:null;}['_translateOperationToEditorContent'](_0x2fb1a8,_0x41be7d,_0x46d983){if('insert'===_0x2fb1a8['type']){const _0x5beb5b=_0x2fb1a8;return new $t(this['_changePosition'](_0x5beb5b['position'],_0x41be7d['concat'](_0x5beb5b['position']['offset']),_0x46d983),_0x5beb5b['nodes'],_0x5beb5b['baseVersion']);}if('marker'===_0x2fb1a8['type']&&_0x2fb1a8['name']['startsWith']('$markedRemove')){const _0x222a2c=_0x2fb1a8;return new Dt(_0x222a2c['name'],_0x222a2c['oldRange'],this['_changeRange'](_0x222a2c['newRange'],_0x41be7d['concat'](_0x222a2c['newRange']['start']['offset']),_0x41be7d['concat'](_0x222a2c['newRange']['end']['offset']),_0x46d983),_0x222a2c['_markers'],_0x222a2c['affectsData'],_0x222a2c['baseVersion']);}return _0x2fb1a8;}['_groupAdjacentOperations'](_0x38cb27){if(!_0x38cb27['length'])return[];const _0x2600e9=[];let _0x3dcebd=0x0,_0x803755=0x0,_0x1ce42e=[];for(let _0x246885=0x0;_0x246885<=_0x38cb27['length'];_0x246885++){const _0x796906=_0x38cb27[_0x246885],_0x3e341f=_0x38cb27[_0x246885-0x1];!_0x796906||_0x3e341f&&!this['_getOperationEnd'](_0x3e341f)['isTouching'](this['_getOperationStart'](_0x796906))?(_0x2600e9['push']({'operations':_0x1ce42e,'operationsIsolated':_0x1ce42e['map'](_0x37475c=>this['_shiftOperation'](_0x37475c['clone'](),-_0x803755)),'groupOffset':_0x3dcebd}),_0x1ce42e=_0x796906?[_0x796906]:[],_0x803755+=_0x3dcebd,_0x3dcebd=0x0):_0x1ce42e['push'](_0x796906),_0x796906&&'insert'===_0x796906['type']&&(_0x3dcebd+=_0x796906['howMany']);}return _0x2600e9;}['_findAdjacentContextDistance'](_0x432803,_0x542e28,_0x19204e,_0x417a00=0x1){const _0xadf88a=new Ot({'startPosition':_0x432803,'direction':_0x542e28});let _0x3e793f=0x0;for(let _0x6991e0=0x0;_0x6991e0<_0x417a00;_0x6991e0++){let _0x175919=0x0,_0x1739f8=!0x1,_0x3f2faa='forward'===_0x542e28?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x56c47f}of _0xadf88a)if(_0x56c47f['is']('$textProxy')){const _0x218917=_0x3f2faa['exec'](_0x56c47f['data']);if(_0x218917&&_0x218917['length']){if(_0x175919+='forward'===_0x542e28?_0x218917['index']+_0x218917[0x0]['length']:_0x56c47f['data']['length']-_0x218917['index'],_0x218917[0x0]['length']!==_0x56c47f['data']['length'])break;_0x1739f8=!0x0,_0x3f2faa='forward'===_0x542e28?/^\w+/:/\w+$/;}else{if(_0x1739f8)break;_0x175919+=_0x56c47f['offsetSize'];}}else{if(_0x56c47f['is']('element')){_0x19204e['isInline'](_0x56c47f)&&!_0x1739f8&&(_0x175919+=0x1);break;}}_0x3e793f+=_0x175919,_0xadf88a['jumpTo'](_0x432803['getShiftedBy']('forward'===_0x542e28?_0x3e793f:-_0x3e793f));}return _0x3e793f;}['_getChangeContext'](_0x59c5ff,_0x16af6c){const _0x220b9b=V(this['context'])['model']['schema'],_0x43624a=this['_findAdjacentContextDistance'](_0x59c5ff,'backward',_0x220b9b,0x6),_0x35e653=this['_findAdjacentContextDistance'](_0x16af6c,'forward',_0x220b9b,0x6),_0x2459d1=_0x59c5ff['getShiftedBy'](-_0x43624a),_0x331900=_0x16af6c['getShiftedBy'](_0x35e653);return{'start':_0x2459d1,'end':_0x331900,'hasContentBefore':!_0x2459d1['isAtStart'],'hasContentAfter':!_0x331900['isAtEnd']};}['_insertMarkers'](_0x21b557){const _0x556c9d=this['context']['plugins']['get']('AIEditing'),_0x365974=new Set();V(this['context'])['model']['change'](_0x599490=>{for(const _0x50a843 of _0x21b557){const _0x44cd00=''+Gt+_0x50a843['type']+':'+_0x50a843['groupId']+'_'+_0x556c9d['_nextDataId'](_0x365974);this['_markers']['set'](_0x44cd00,{'id':_0x44cd00,'groupId':_0x50a843['groupId'],'type':_0x50a843['type'],'text':_0x50a843['text']}),_0x599490['addMarker'](_0x44cd00,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x599490['createRange'](_0x50a843['start'],_0x50a843['end'])});}});}['_createGetContextFn'](_0x35e621,_0x4849be,_0x243f24){let _0x3b716f='';return()=>{if(!_0x3b716f){const _0xcbf4cf=_0x4849be['toView'](_0x35e621,{'showSuggestionHighlights':!0x0}),_0x1d4920=_0xcbf4cf['getChild'](0x0);if(!_0x1d4920)return'';let _0x33f46c=!0x1;const _0x169b6a=[];for(const _0x11a1b2 of _0x1d4920['getChildren']())_0x11a1b2['is']('element','span')&&_0x11a1b2['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x33f46c=!0x1),_0x33f46c&&_0x169b6a['push'](_0x11a1b2),_0x11a1b2['is']('element','span')&&_0x11a1b2['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x33f46c=!0x0);_0x1d4920['_removeChildren'](0x0,_0x1d4920['childCount']),_0x243f24?.['ellipsisBefore']&&_0x1d4920['_appendChild']('…'),_0x1d4920['_appendChild'](_0x169b6a),_0x243f24?.['ellipsisAfter']&&_0x1d4920['_appendChild']('…');const _0x1f6aa5=_0x4849be['htmlProcessor']['domConverter']['viewToDom'](_0xcbf4cf),_0xa10f8d=_0x4849be['htmlProcessor']['htmlWriter']['getHtml'](_0x1f6aa5);_0x3b716f=_0xa10f8d;}return _0x3b716f;};}['_createGetContentFn'](_0x5b2624,_0xed5cfd){let _0x39e733='';return()=>(_0x39e733||(_0x39e733=_0xed5cfd['stringify'](_0x5b2624,{'showSuggestionHighlights':!0x0})),_0x39e733);}['_createGetContentUsingDataIdFn'](_0x37da0b,_0x15387a,_0x28190b){let _0x642dc6='';return()=>{if(!_0x642dc6){const _0x27bc10=_0x28190b['toView'](new _0x1dd05a(_0x37da0b)),_0x46dfb0=_0x28190b['htmlProcessor']['domConverter']['viewToDom'](_0x27bc10)['querySelector']('[data-id=\x22'+_0x15387a+'\x22]');_0x642dc6=_0x46dfb0?.['outerHTML']||'';}return _0x642dc6;};}['_findMarkerElement'](_0xeab47e,_0x309c29=0x5){let _0x14dfa9=_0xeab47e,_0x111244=null;for(let _0x820bf7=0x0;_0x820bf7<_0x309c29&&_0x14dfa9;_0x820bf7++){if(!_0x14dfa9['className']){_0x14dfa9=_0x14dfa9['parentElement'];continue;}if(!(''+_0x14dfa9['className'])['includes']('ck-ai_review-mode-marker_')){_0x14dfa9=_0x14dfa9['parentElement'];continue;}if(!_0x14dfa9['getAttribute']('data-marker-id'))break;_0x111244=_0x14dfa9;break;}return _0x111244;}['_getMarkersDataForGroup'](_0x3fc29d){return Array['from'](this['_markers']['values']())['filter'](_0x7c599f=>_0x7c599f['groupId']===_0x3fc29d);}['_getOperationStart'](_0x2b1f9d){return'insert'===_0x2b1f9d['type']?_0x2b1f9d['position']:_0x2b1f9d['newRange']['start'];}['_getOperationEnd'](_0x29a013,_0x229bbe=!0x1){return'insert'===_0x29a013['type']?_0x229bbe?_0x29a013['position']:_0x29a013['position']['getShiftedBy'](_0x29a013['howMany']):_0x29a013['newRange']['end'];}['_shiftOperation'](_0x51d81c,_0x393d51){return'insert'===_0x51d81c['type']?_0x51d81c['position']=_0x51d81c['position']['getShiftedBy'](_0x393d51):'marker'===_0x51d81c['type']&&_0x51d81c['newRange']&&(_0x51d81c['newRange']=new _0x625116(_0x51d81c['newRange']['start']['getShiftedBy'](_0x393d51),_0x51d81c['newRange']['end']['getShiftedBy'](_0x393d51))),_0x51d81c;}['_changeOperationOwnerDocument'](_0x200430,_0x2399ee){'insert'===_0x200430['type']?_0x200430['position']=this['_changePositionOwnerDocument'](_0x200430['position'],_0x2399ee):'marker'===_0x200430['type']&&_0x200430['newRange']&&(_0x200430['newRange']=this['_changeRangeOwnerDocument'](_0x200430['newRange'],_0x2399ee));}['_changePositionOwnerDocument'](_0x4b1ab1,_0x1cf925){return new _0x2aa99a(_0x1cf925,_0x4b1ab1['path']);}['_changeRangeOwnerDocument'](_0x53fcad,_0x4333a0){return new _0x625116(this['_changePositionOwnerDocument'](_0x53fcad['start'],_0x4333a0),this['_changePositionOwnerDocument'](_0x53fcad['end'],_0x4333a0));}['_changePosition'](_0x4fd572,_0x191f08,_0x4a734b){return new _0x2aa99a(_0x4a734b,[..._0x191f08]);}['_changeRange'](_0x140b8a,_0x56bd25,_0x1cf7ea,_0x4acb76){return new _0x625116(this['_changePosition'](_0x140b8a['start'],_0x56bd25,_0x4acb76),this['_changePosition'](_0x140b8a['end'],_0x1cf7ea,_0x4acb76));}['_getTopElement'](_0x4e336a){let _0x47e2d7=_0x4e336a;for(;_0x47e2d7['parent']&&!_0x47e2d7['parent']['is']('documentFragment');)_0x47e2d7=_0x47e2d7['parent'];return _0x47e2d7;}['_sortMarkers'](_0x58f174){const _0x2b7dfd=_0x20b099=>{switch(_0x20b099){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x58f174['sort']((_0x5198b0,_0x4d9b1a)=>_0x2b7dfd(_0x5198b0['type'])-_0x2b7dfd(_0x4d9b1a['type']));}}class Sa extends _0x3e9f85{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{fa as AIActions,x as AIAdapter,Bn as AIAssistant,n as AIAssistantUI,W as AIBalloon,Ea as AIChat,et as AIChatController,st as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,at as AIChatUI,N as AIConnector,O as AIEditing,Ut as AIQuickActionType,wa as AIQuickActions,ci as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,gs as AIReviewCheckResult,pr as AIReviewCheckRun,Sa as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,ht as AITabs,de as AITextAdapter,Fn as AWSTextAdapter,Wn as OpenAITextAdapter,E as ShowAIAssistantCommand,As as createResizeButton,Kn as getDefaultAICommands};
|