@ckeditor/ckeditor5-ai 48.8.1-alpha.3 → 49.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/aiactions/aiactions.d.ts +109 -73
- package/dist/aiactions/model/aiactionsinteraction.d.ts +58 -50
- package/dist/aiactions/model/aiactionsreply.d.ts +18 -11
- package/dist/aiassistant/adapters/aiadapter.d.ts +48 -48
- package/dist/aiassistant/adapters/aitextadapter.d.ts +133 -133
- package/dist/aiassistant/adapters/awstextadapter.d.ts +42 -42
- package/dist/aiassistant/adapters/openaitextadapter.d.ts +184 -184
- package/dist/aiassistant/aiassistant.d.ts +425 -436
- package/dist/aiassistant/aiassistantediting.d.ts +51 -51
- package/dist/aiassistant/aiassistantui.d.ts +50 -53
- package/dist/aiassistant/legacyerrors.d.ts +0 -4
- package/dist/aiassistant/ui/aiassistantcontroller.d.ts +106 -105
- package/dist/aiassistant/ui/form/aiformcontentarea.d.ts +43 -43
- package/dist/aiassistant/ui/form/aiformerrorview.d.ts +19 -19
- package/dist/aiassistant/ui/form/aiformpromptview.d.ts +38 -38
- package/dist/aiassistant/ui/form/aiformtoolbarview.d.ts +50 -50
- package/dist/aiassistant/ui/form/aiformview.d.ts +121 -121
- package/dist/aiassistant/ui/form/aihistorylistitemview.d.ts +13 -13
- package/dist/aiassistant/ui/form/aihistorylistview.d.ts +27 -27
- package/dist/aiassistant/ui/form/prompthistory.d.ts +15 -15
- package/dist/aiassistant/ui/showaiassistantcommand.d.ts +35 -35
- package/dist/aiassistant/utils/common-translations.d.ts +6 -6
- package/dist/aiassistant/utils/normalizecommandsconfig.d.ts +9 -9
- package/dist/aiballoon/aiballoon.d.ts +85 -89
- package/dist/aiballoon/ui/aiballoondisclaimerview.d.ts +17 -0
- package/dist/aiballoon/ui/aiballoontoolbarview.d.ts +56 -0
- package/dist/aiballoon/ui/aiballoonview.d.ts +74 -27
- package/dist/aiballoon/utils/contentwidth.d.ts +1 -0
- package/dist/aichat/aichat.d.ts +88 -87
- package/dist/aichat/aichatballoon.d.ts +88 -79
- package/dist/aichat/aichatcontroller.d.ts +284 -258
- package/dist/aichat/aichatui.d.ts +352 -328
- package/dist/aichat/model/aichatcontext.d.ts +655 -654
- package/dist/aichat/model/aichatconversation.d.ts +270 -269
- package/dist/aichat/model/aichatinteraction.d.ts +45 -49
- package/dist/aichat/ui/aichatballoonview.d.ts +73 -101
- package/dist/aichat/ui/aichatcontrolsview.d.ts +121 -125
- package/dist/aichat/ui/aichatfeedview.d.ts +145 -128
- package/dist/aichat/ui/aichatview.d.ts +42 -40
- package/dist/aichat/ui/controls/aichatchipsoverflowmanager.d.ts +73 -63
- package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +41 -41
- package/dist/aichat/ui/controls/aichatcontextpanelurlinputview.d.ts +79 -79
- package/dist/aichat/ui/controls/aichatcontextpanelview.d.ts +110 -100
- package/dist/aichat/ui/controls/aichatdropzoneview.d.ts +30 -0
- package/dist/aichat/ui/controls/aichatpromptcapabilitiesview.d.ts +72 -81
- package/dist/aichat/ui/controls/aichatpromptinputview.d.ts +50 -44
- package/dist/aichat/ui/controls/aichatpromptsuggestionslistview.d.ts +13 -13
- package/dist/aichat/ui/controls/resources/aichatcontextresourceslistview.d.ts +44 -44
- package/dist/aichat/ui/controls/resources/aichatcontextresourcesview.d.ts +52 -52
- package/dist/aichat/ui/controls/resources/aichatresourcelistitemview.d.ts +57 -56
- package/dist/aichat/ui/controls/resources/aichatresourcesballoonview.d.ts +104 -100
- package/dist/aichat/ui/controls/resources/aichatresourcessearchinputview.d.ts +53 -53
- package/dist/aichat/ui/feed/aichatfeedcontextchipsview.d.ts +22 -22
- package/dist/aichat/ui/feed/aichatfeedcustomelementview.d.ts +30 -34
- package/dist/aichat/ui/feed/aichatfeederroritemview.d.ts +30 -33
- package/dist/aichat/ui/feed/aichatfeedinteractionheaderview.d.ts +24 -24
- package/dist/aichat/ui/feed/aichatfeeditemview.d.ts +39 -39
- package/dist/aichat/ui/feed/aichatfeedreplyitemview.d.ts +40 -40
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemactionsview.d.ts +62 -63
- package/dist/aichat/ui/feed/aichatfeedsuggestionitemview.d.ts +87 -82
- package/dist/aichat/ui/feed/aichatfeedusermessageitem.d.ts +33 -33
- package/dist/aichat/utils/eventnames.d.ts +8 -4
- package/dist/aichat/utils/parsesingleurl.d.ts +1 -0
- package/dist/aichat/utils/promisequeue.d.ts +26 -25
- package/dist/aichat/utils/readdatatransferfiles.d.ts +14 -0
- package/dist/aichat/utils/resolvepaste.d.ts +71 -0
- package/dist/aichathistory/aichathistory.d.ts +26 -26
- package/dist/aichathistory/aichathistorycontroller.d.ts +36 -35
- package/dist/aichathistory/aichathistoryui.d.ts +80 -89
- package/dist/aichathistory/model/aichathistoryconversations.d.ts +95 -102
- package/dist/aichathistory/model/aichathistoryitem.d.ts +52 -53
- package/dist/aichathistory/ui/aichathistorylistitemview.d.ts +41 -40
- package/dist/aichathistory/ui/aichathistorylistview.d.ts +28 -28
- package/dist/aichathistory/ui/aichathistorysectionlistview.d.ts +16 -16
- package/dist/aichathistory/ui/aichathistoryview.d.ts +33 -33
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +295 -295
- package/dist/aichatshortcuts/ui/aichatshortcutsview.d.ts +24 -18
- package/dist/aichatshortcuts/ui/aichatshortcutview.d.ts +18 -18
- package/dist/aiconfig.d.ts +362 -227
- package/dist/aicore/aiconnector.d.ts +428 -334
- package/dist/aicore/aicore.d.ts +53 -0
- package/dist/aicore/aiediting.d.ts +103 -88
- package/dist/aicore/aierrorreporter.d.ts +101 -0
- package/dist/aicore/aigateway.d.ts +135 -0
- package/dist/aicore/errors/aicoreerror.d.ts +67 -0
- package/dist/aicore/errors/geterrorcode.d.ts +17 -0
- package/dist/aicore/errors/isaborterror.d.ts +12 -0
- package/dist/aicore/errors/normalizeerror.d.ts +23 -0
- package/dist/aicore/model/aicapabilities.d.ts +69 -53
- package/dist/aicore/model/aicontext.d.ts +116 -77
- package/dist/aicore/model/aicontextlibrary.d.ts +71 -0
- package/dist/aicore/model/aicontextref.d.ts +37 -0
- package/dist/aicore/model/aidefaultcontext.d.ts +83 -0
- package/dist/aicore/model/aieditorroot.d.ts +26 -0
- package/dist/aicore/model/aiinteraction.d.ts +162 -162
- package/dist/aicore/model/aimodels.d.ts +80 -76
- package/dist/aicore/model/aireply.d.ts +129 -121
- package/dist/aicore/model/airunresult.d.ts +43 -0
- package/dist/aicore/model/airunsinglerootresult.d.ts +104 -0
- package/dist/aicore/pipeline/airesponseapplier.d.ts +284 -296
- package/dist/aicore/pipeline/airesponseparser.d.ts +24 -23
- package/dist/aicore/ui/aidisclaimerview.d.ts +12 -13
- package/dist/aicore/ui/aidotsloader.d.ts +18 -0
- package/dist/aicore/ui/aiheaderview.d.ts +27 -28
- package/dist/aicore/ui/aimodelselectorview.d.ts +151 -0
- package/dist/aicore/ui/aiseparatorview.d.ts +25 -0
- package/dist/aicore/ui/aiskeleton.d.ts +43 -32
- package/dist/aicore/ui/aispinner.d.ts +10 -11
- package/dist/aicore/ui/suggestioncontainer/aiminitoolbarview.d.ts +55 -56
- package/dist/aicore/ui/suggestioncontainer/aisuggestionbodyview.d.ts +95 -80
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontainerview.d.ts +45 -46
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartheaderview.d.ts +67 -37
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartstateview.d.ts +21 -31
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentparttoolbarview.d.ts +46 -21
- package/dist/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.d.ts +91 -58
- package/dist/aicore/ui/suggestioncontainer/aisuggestionheaderview.d.ts +26 -35
- package/dist/aicore/ui/suggestioncontainer/aisuggestionstreamablecontentview.d.ts +30 -27
- package/dist/aicore/ui/suggestioncontainer/aiwebsourcesview.d.ts +24 -24
- package/dist/aicore/utils/abortabletimeout.d.ts +11 -11
- package/dist/aicore/utils/aitabids.d.ts +11 -0
- package/dist/aicore/utils/builddocumentsuggestionsmap.d.ts +30 -0
- package/dist/aicore/utils/buttonclasses.d.ts +17 -8
- package/dist/aicore/utils/cleanupstreamingartifacts.d.ts +12 -0
- package/dist/aicore/utils/common-translations.d.ts +6 -6
- package/dist/aicore/utils/contentparttranslationkeys.d.ts +27 -0
- package/dist/aicore/utils/createresizebutton.d.ts +8 -9
- package/dist/aicore/utils/createstartconversationbutton.d.ts +7 -8
- package/dist/aicore/utils/documentposition.d.ts +37 -37
- package/dist/aicore/utils/documentrange.d.ts +41 -41
- package/dist/aicore/utils/eventnames.d.ts +5 -5
- package/dist/aicore/utils/geteditorconfig.d.ts +107 -0
- package/dist/aicore/utils/geteditorsfromcontext.d.ts +18 -0
- package/dist/aicore/utils/getmodeldisplaymode.d.ts +21 -0
- package/dist/aicore/utils/getoperationsfordocumentsuggestions.d.ts +20 -0
- package/dist/aicore/utils/getrootinfo.d.ts +45 -0
- package/dist/aicore/utils/getsuggestionpartsfromreply.d.ts +24 -18
- package/dist/aicore/utils/htmlparser.d.ts +23 -16
- package/dist/aicore/utils/htmlstreamer.d.ts +79 -79
- package/dist/aicore/utils/inlineroot.d.ts +1 -0
- package/dist/aicore/utils/istrackchangesenabled.d.ts +23 -0
- package/dist/aicore/utils/markoperationsasai.d.ts +21 -0
- package/dist/aicore/utils/replyactions.d.ts +13 -0
- package/dist/aicore/utils/scrollmanager.d.ts +24 -23
- package/dist/aicore/utils/showaitab.d.ts +1 -0
- package/dist/aidocumentprocessing/aidocumentprocessinggateway.d.ts +110 -0
- package/dist/aidocumentprocessing/model/aidocumentprocessingrunresult.d.ts +19 -0
- package/dist/aieditorintegration/aieditorintegration.d.ts +42 -32
- package/dist/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +33 -34
- package/dist/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +12 -12
- package/dist/aiquickactions/aiquickactions.d.ts +303 -252
- package/dist/aiquickactions/aiquickactionscommand.d.ts +10 -10
- package/dist/aiquickactions/aiquickactionsediting.d.ts +22 -22
- package/dist/aiquickactions/aiquickactionsui.d.ts +131 -124
- package/dist/aiquickactions/ui/aiquickactionsbuttoncreator.d.ts +57 -57
- package/dist/aiquickactions/ui/aiquickactionsdropdowncontentview.d.ts +45 -45
- package/dist/aiquickactions/ui/aiquickactionsdropdowncreator.d.ts +59 -59
- package/dist/aiquickactions/ui/aiquickactionsfilteredlistview.d.ts +0 -4
- package/dist/aiquickactions/ui/balloon/aiactionsballoonview.d.ts +73 -136
- package/dist/aiquickactions/ui/dropdownmenubuttonwithhighlightview.d.ts +24 -24
- package/dist/aireviewcore/aireviewcorecheckregistry.d.ts +37 -0
- package/dist/aireviewcore/aireviewcorecontroller.d.ts +48 -23
- package/dist/aireviewcore/aireviewcoreediting.d.ts +296 -224
- package/dist/aireviewcore/aireviewcoreui.d.ts +109 -85
- package/dist/aireviewcore/model/aichecksinglerootresult.d.ts +22 -0
- package/dist/aireviewcore/model/aireviewcheck.d.ts +49 -49
- package/dist/aireviewcore/model/aireviewchecklist.d.ts +29 -28
- package/dist/aireviewcore/model/aireviewcheckresult.d.ts +36 -35
- package/dist/aireviewcore/model/aireviewcheckresultchange.d.ts +62 -50
- package/dist/aireviewcore/model/aireviewcheckrun.d.ts +174 -147
- package/dist/aireviewcore/model/aireviewsystemcheckrun.d.ts +16 -16
- package/dist/aireviewcore/types.d.ts +30 -24
- package/dist/aireviewcore/ui/aireviewcoreabstractchecklistview.d.ts +50 -0
- package/dist/aireviewcore/ui/aireviewcorechecklistitemresultview.d.ts +53 -76
- package/dist/aireviewcore/ui/aireviewcorecompletereviewdropdown.d.ts +29 -0
- package/dist/aireviewcore/ui/aireviewcorecustomcheckview.d.ts +38 -56
- package/dist/aireviewcore/ui/aireviewcorefinishreviewbuttonview.d.ts +8 -9
- package/dist/aireviewcore/ui/aireviewcoregeneralerrorview.d.ts +20 -20
- package/dist/aireviewcore/ui/aireviewcorenavigationpanelview.d.ts +169 -0
- package/dist/aireviewcore/ui/aireviewcoreprogressbarview.d.ts +32 -0
- package/dist/aireviewcore/ui/aireviewcorepromptinputview.d.ts +25 -25
- package/dist/aireviewcore/ui/aireviewcorereviewchecklistview.d.ts +42 -23
- package/dist/aireviewcore/ui/aireviewcorereviewcommandlistitemview.d.ts +49 -39
- package/dist/aireviewcore/ui/aireviewcorereviewcompletedview.d.ts +13 -14
- package/dist/aireviewcore/ui/aireviewcoreuicheckresultsview.d.ts +114 -87
- package/dist/aireviewcore/ui/aireviewcoreview.d.ts +54 -50
- package/dist/aireviewcore/ui/changeevents.d.ts +49 -0
- package/dist/aireviewcore/ui/form/aireviewcoreformdropdown.d.ts +16 -16
- package/dist/aireviewcore/ui/form/aireviewcoreformmanager.d.ts +12 -12
- package/dist/aireviewcore/utils/openleaveconfirmationdialog.d.ts +21 -0
- package/dist/aireviewcore/utils/reviewcontentpart.d.ts +25 -0
- package/dist/aireviewmode/aireviewcheckdefinitions.d.ts +12 -12
- package/dist/aireviewmode/aireviewgateway.d.ts +172 -0
- package/dist/aireviewmode/aireviewmode.d.ts +260 -126
- package/dist/aireviewmode/aireviewmodecheckregistry.d.ts +46 -0
- package/dist/aireviewmode/aireviewmodecontroller.d.ts +24 -17
- package/dist/aireviewmode/aireviewmodeui.d.ts +17 -17
- package/dist/aireviewmode/model/aireviewcheckcustom.d.ts +16 -16
- package/dist/aireviewmode/model/aireviewcheckextra.d.ts +35 -30
- package/dist/aireviewmode/model/aireviewcustomcheckrun.d.ts +18 -17
- package/dist/aireviewmode/model/aireviewextracheckrun.d.ts +15 -15
- package/dist/aireviewmode/model/aireviewmodechecklist.d.ts +22 -18
- package/dist/aireviewmode/ui/aireviewmodecheckresultsview.d.ts +41 -0
- package/dist/aisdk/dataidassigner.d.ts +20 -0
- package/dist/aisdk/documentchanges.d.ts +165 -0
- package/dist/aisdk/documentchangesutils.d.ts +15 -0
- package/dist/aisdk/documentcompare.d.ts +171 -0
- package/dist/aisdk/documentcompareutils.d.ts +16 -0
- package/dist/aisdk/documentsnapshot.d.ts +48 -0
- package/dist/aisdk/extractselectionfromhtml.d.ts +27 -0
- package/dist/aisdk/validateoperations.d.ts +43 -0
- package/dist/aitabs/aitabs.d.ts +104 -84
- package/dist/aitabs/aitabsmainview.d.ts +70 -46
- package/dist/aitabs/tabs/aitabsview.d.ts +191 -188
- package/dist/aitranslate/aitranslate.d.ts +165 -129
- package/dist/aitranslate/aitranslatecheckregistry.d.ts +27 -0
- package/dist/aitranslate/aitranslatecontroller.d.ts +18 -15
- package/dist/aitranslate/aitranslategateway.d.ts +89 -0
- package/dist/aitranslate/aitranslateui.d.ts +17 -18
- package/dist/aitranslate/model/aitranslatecheck.d.ts +12 -12
- package/dist/aitranslate/model/aitranslatechecklist.d.ts +11 -11
- package/dist/aitranslate/model/aitranslatecheckrun.d.ts +24 -23
- package/dist/aitranslate/ui/aitranslatechecklistview.d.ts +28 -7
- package/dist/aitranslate/ui/aitranslatecheckresultsview.d.ts +11 -11
- package/dist/augmentation.d.ts +79 -63
- package/dist/errors.d.ts +0 -4
- package/dist/errorsmap.d.ts +5 -5
- package/dist/index-content.css +0 -96
- package/dist/index-editor.css +3948 -3291
- package/dist/index.css +3959 -3307
- package/dist/index.d.ts +83 -59
- package/dist/index.js +19 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +32 -13
- package/dist/aichat/ui/controls/aichatcontrolsloaderview.d.ts +0 -12
- package/dist/aicore/ui/suggestioncontainer/aisuggestionloaderview.d.ts +0 -16
- package/dist/aicore/utils/geteditorfromcontext.d.ts +0 -19
- package/dist/aicore/utils/getoperationsfromreply.d.ts +0 -24
- package/dist/aiquickactions/ui/balloon/aiactionsballoondisclaimerview.d.ts +0 -17
- package/dist/aiquickactions/ui/balloon/aiactionsballoontoolbarview.d.ts +0 -37
- package/dist/aireviewcore/ui/aireviewcoreballoonsuggestionview.d.ts +0 -38
- package/dist/aitabs/tabs/tabbuttonview.d.ts +0 -47
- package/dist/aitabs/tabs/tabpanelview.d.ts +0 -44
package/dist/index.js
CHANGED
|
@@ -20,9 +20,22 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x5686f0,Command as _0x3a665b,ContextPlugin as _0x23f270,Editor as _0x5ca812}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x16addf,IconCheck as _0x4ab520,IconError as _0x90f260,IconSubmit as _0x177154,IconAIHistory as _0x41655b,IconMagicWand as _0x343811,IconRobotPencil as _0x98106a,IconMaximize as _0x5822e5,IconMinimize as _0x494a35,IconShowChangesOn as _0x135466,IconShowChangesOff as _0x3c0485,IconDocument as _0x448da1,IconBoxWithCross as _0x1dbb45,IconBoxWithCheck as _0x2d73d7,IconBoxWithMarker as _0x3c26bd,IconInfo as _0x11ec0d,IconWeb as _0x271520,IconCancel as _0x5ed072,IconSelection as _0xf81085,IconFileUpload as _0x5249ad,IconLink as _0x1e2b51,IconBulb as _0xeb7c36,IconAI as _0x348d31,IconPreviousArrow as _0x1607c0,IconDocumentOutline as _0x1c299b,IconLoupe as _0x10b46f,IconPaperClip as _0x5718be,IconBrowseFiles as _0x16f379,IconDropdownArrow as _0x4e78fd,IconStop as _0x1b062b,IconPlus as _0x37726c,IconAIChat as _0x2ea593,IconPin as _0x5e7c87,IconThreeHorizontalDots as _0x57c6c8,IconAIReview as _0x2e2f4a,IconAITranslate as _0x4d8ff7,IconAIAskAI as _0xbf82c1,IconThumbUp as _0x25b316,IconThumbDown as _0x42e1bc,IconChevronDown as _0x25b93f,IconChevronUp as _0x19d9ab,IconAIQuickActions as _0x15178f,IconAIChatCommands as _0x4ea6bb,IconAIImproveWriting as _0x3da124,IconAIContinueWriting as _0x382928,IconAIGrammarCheck as _0x2920e7,IconAIAdjustLength as _0x10b01a,IconAIChangeTone as _0x1aa706,IconAIOther as _0x47860a,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as It,first as At,logWarning as gt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as wt,insertToPriorityArray as Tt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as Rt,getConstrainedViewportRect as bt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as vt,View as Nt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x123337,FormHeaderView as _0x3e7902,HighlightedTextView as _0x2cc319,ViewCollection as _0x184ac3,FileDialogButtonView as _0x4509d1,InputTextView as _0x142293,SearchTextView as _0x1be4c1,ListItemButtonView as _0x1a80af,ButtonLabelWithHighlightView as _0x41ed25,DropdownMenuPanelPositioningFunctions as _0x16a65a,BalloonToolbar as _0x1397b8,FormRowView as _0xee19c6,TextareaView as _0x126012}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x53aae2,ClipboardMarkersUtils as _0x477206}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5a415e,ViewDataTransfer as _0x352cb4,ViewUpcastWriter as _0x4642be,Matcher as _0x442511,_DetachOperation as _0x43c2ab,_insertIntoModelNodeList as _0x126834,_removeFromModelNodeList as _0x164b6b,ModelRange as _0x1445f3,transformOperationSets as _0x27476f,ViewDowncastWriter as _0x4b9165,ModelDocumentFragment as _0xee8836,ModelPosition as _0x3c2be3,ModelTreeWalker as _0x46a368,MarkerOperation as _0x147dae,InsertOperation as _0x129783}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x58cc9d,escape as _0x19d831,cloneDeep as _0x4c306c,throttle as _0x121c0b,debounce as _0x3c2cd8,escapeRegExp as _0x118ed5}from'es-toolkit/compat';import{createParser as _0x3df424}from'eventsource-parser';import{CloudServices as _0x5dd200}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x56717f}from'htmlparser2';import{isTag as _0x4e8462,findOne as _0x4e94ee,getParent as _0xe83088,findAll as _0x2c9ab8,removeElement as _0x32f2bc,prepend as _0x51f634,prependChild as _0x59f22f,appendChild as _0x4c46bc,append as _0x5a70f4,find as _0x592842,isComment as _0x468d05,replaceElement as _0x118b57,getChildren as _0x55fdbd,textContent as _0x11c8f9}from'domutils';import ti from'dom-serializer';import{Document as _0x34e0db,Element as _0x4d1237,Text as _0x5a8104,cloneNode as _0x118fd9,isDocument as _0x40c3ff,isText as _0x31735e,NodeWithChildren as _0x507edc}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x3ceff7,MarkdownGfmMdToHtml as _0xc438b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0xec741 from'rehype-sanitize';import{fixElementSuggestionRange as _0x43b9ff,DocumentCompare as _0x53dd97,DATA_ID_MODEL_ATTRIBUTE as _0x4140c8,ConfirmMixin as _0x104e5b,getAllMarkersDomElementsSorted as _0x3b0cbb,SuggestionsConversion as _0x53f39c,DATA_ID_VIEW_ATTRIBUTE as _0x4b3396,getMarkerDomElement as _0x1e5795}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x2d4ba4 from'morphdom';import{diffArrays as _0x3e20ff}from'diff';const wi='_ungrouppedCommands';function Ti(_0x3317c4,_0x2d3608){const _0x3af402=(0x0,_0x2d3608['t'])('Other');return _0x3317c4['length']?'groupId'in _0x3317c4[0x0]?_0x3317c4:[{'groupId':wi,'groupLabel':_0x3af402,'order':0x1/0x0,'commands':_0x3317c4}]:[{'groupId':wi,'groupLabel':_0x3af402,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],Si='ai-ui';class AIAssistantEditing extends _0x5686f0{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c1201}=this,_0x574fca=['ck-fake-ai-selection'];_0x2c1201['config']['get']('ai.assistant.useTheme')&&_0x574fca['push']('ck-ai-assistant-ui_theme'),_0x2c1201['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Si,'view':{'classes':_0x574fca,'priority':0xc}}),_0x2c1201['conversion']['for']('editingDowncast')['markerToElement']({'model':Si,'view':(_0x17a595,{writer:_0x2a71eb})=>{if(!_0x17a595['markerRange']['isCollapsed'])return null;const _0x33b154=_0x2a71eb['createUIElement']('span');return _0x2a71eb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x33b154),_0x33b154;}});}['afterInit'](){!async function(_0x3feded){const _0x351f00=_0x3ddba5([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]),_0x588350=0x3dffc4e1,_0x49419c=0x3df84e89^_0x588350,_0x58ec64=window[_0x3ddba5([0x44,0x61,0x74,0x65])][_0x3ddba5([0x6e,0x6f,0x77])](),_0x42f2c7=_0x3feded[_0x3ddba5([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1148fe=new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23b63f=>{_0x42f2c7[_0x3ddba5([0x6f,0x6e,0x63,0x65])](_0x3ddba5([0x72,0x65,0x61,0x64,0x79]),_0x23b63f);}),_0x871dc5={[_0x3ddba5([0x6b,0x74,0x79])]:_0x3ddba5([0x45,0x43]),[_0x3ddba5([0x75,0x73,0x65])]:_0x3ddba5([0x73,0x69,0x67]),[_0x3ddba5([0x63,0x72,0x76])]:_0x3ddba5([0x50,0x2d,0x32,0x35,0x36]),[_0x3ddba5([0x78])]:_0x3ddba5([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]),[_0x3ddba5([0x79])]:_0x3ddba5([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]),[_0x3ddba5([0x61,0x6c,0x67])]:_0x3ddba5([0x45,0x53,0x32,0x35,0x36])},_0x1d53c3=_0x42f2c7[_0x3ddba5([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3ddba5([0x67,0x65,0x74])](_0x3ddba5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1c106d(){let _0x4c7d12,_0x322117=null,_0x42b061=null;try{if(_0x1d53c3==_0x3ddba5([0x47,0x50,0x4c]))return _0x3ddba5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4c7d12=_0x34a329(),!_0x4c7d12)return _0x3ddba5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4c7d12[_0x3ddba5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x42b061=_0x1abfd1(_0x4c7d12[_0x3ddba5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4c7d12[_0x3ddba5([0x6a,0x74,0x69])])),await _0x51dd3f()?_0x3f3b22()?_0x203e3b()?_0x3ddba5([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1b7486()?(_0x4c7d12[_0x3ddba5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3ddba5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x322117=_0x180ced(_0x3ddba5([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x323b7c()):_0x3ddba5([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3ddba5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3ddba5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3ddba5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x203e3b(){const _0x163066=[_0x3ddba5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3ddba5([0x74,0x72,0x69,0x61,0x6c])][_0x3ddba5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c7d12[_0x3ddba5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x58ec64/0x3e8:0xe10*_0x49419c;return _0x4c7d12[_0x3ddba5([0x65,0x78,0x70])]<_0x163066;}function _0x3f3b22(){const _0x493a8a=_0x4c7d12[_0x3ddba5([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x493a8a&&(!!_0x493a8a[_0x3ddba5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3ddba5([0x2a]))||!!_0x493a8a[_0x3ddba5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3ddba5([0x41,0x49])));}function _0x1b7486(){const _0x1796ba=_0x4c7d12[_0x3ddba5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1796ba||0x0==_0x1796ba[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x29d94b}=new URL(window[_0x3ddba5([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1796ba[_0x3ddba5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x29d94b))return!0x0;const _0x580092=_0x29d94b[_0x3ddba5([0x73,0x70,0x6c,0x69,0x74])](_0x3ddba5([0x2e]));return _0x1796ba[_0x3ddba5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4398ef=>_0x4398ef[_0x3ddba5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3ddba5([0x2a])))[_0x3ddba5([0x6d,0x61,0x70])](_0x12d367=>_0x12d367[_0x3ddba5([0x73,0x70,0x6c,0x69,0x74])](_0x3ddba5([0x2e])))[_0x3ddba5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x34315f=>_0x34315f[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x580092[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3ddba5([0x6d,0x61,0x70])](_0x3a98ea=>Array(_0x580092[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x3a98ea[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3ddba5([0x66,0x69,0x6c,0x6c])](_0x3a98ea[0x0]===_0x3ddba5([0x2a])?_0x3ddba5([0x2a]):'')[_0x3ddba5([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x3a98ea))[_0x3ddba5([0x73,0x6f,0x6d,0x65])](_0x15ccc4=>_0x580092[_0x3ddba5([0x65,0x76,0x65,0x72,0x79])]((_0x4872e5,_0x16e99f)=>_0x15ccc4[_0x16e99f]===_0x4872e5||_0x15ccc4[_0x16e99f]===_0x3ddba5([0x2a])));}function _0x323b7c(){return _0x322117&&_0x42b061?new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2be1a1,_0x44dd72)=>{_0x322117[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x2be1a1,_0x44dd72),_0x42b061[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x158ec1=>{_0x158ec1!=_0x3ddba5([0x56,0x61,0x6c,0x69,0x64])&&_0x2be1a1(_0x158ec1);},_0x44dd72);}):_0x322117||_0x42b061||_0x3ddba5([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1abfd1(_0x5a97a2,_0x1a92ec){return new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x581f38=>{if(_0x548651())return _0x581f38(_0x3ddba5([0x56,0x61,0x6c,0x69,0x64]));_0x14c2fd(),_0x42f2c7[_0x3ddba5([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3ddba5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4bfb6b=!0x1;const _0xaf908=ot();function _0x4ec93c(_0x238634){return!!_0x238634&&(typeof _0x238634===_0x3ddba5([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x238634===_0x3ddba5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x238634[_0x3ddba5([0x74,0x68,0x65,0x6e])]===_0x3ddba5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x238634[_0x3ddba5([0x63,0x61,0x74,0x63,0x68])]===_0x3ddba5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x57551b(_0xbecf2c){_0x769071(_0xbecf2c)[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x121dc1=>{if(!_0x121dc1||_0x121dc1[_0x3ddba5([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3ddba5([0x6f,0x6b]))return _0x3ddba5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4729a5(_0x597cf1(_0xaf908+_0x1a92ec))!=_0x121dc1[_0x3ddba5([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3ddba5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3ddba5([0x56,0x61,0x6c,0x69,0x64]);})[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x16e1d0=>(_0x1c62d7(),_0x16e1d0),()=>{const _0x111200=_0xe1e591();return null==_0x111200?(_0x1c62d7(),_0x3ddba5([0x56,0x61,0x6c,0x69,0x64])):_0x3ddba5(_0x58ec64-_0x111200>(0x19f340e1^_0x588350)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x581f38)[_0x3ddba5([0x63,0x61,0x74,0x63,0x68])](()=>{_0x581f38(_0x3ddba5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2bd5e1=0x3dc92a61^_0x588350;function _0x1c62d7(){const _0x42e5a7=_0x3ddba5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4729a5(_0x597cf1(_0x5a97a2)),_0x3abdab=_0x57cdee(_0x4729a5(window[_0x3ddba5([0x4d,0x61,0x74,0x68])][_0x3ddba5([0x63,0x65,0x69,0x6c])](_0x58ec64/_0x2bd5e1)));window[_0x3ddba5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3ddba5([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x42e5a7,_0x3abdab);}function _0xe1e591(){const _0x1c3e05=_0x3ddba5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4729a5(_0x597cf1(_0x5a97a2)),_0x395338=window[_0x3ddba5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3ddba5([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1c3e05);return _0x395338?window[_0x3ddba5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x57cdee(_0x395338),0x10)*_0x2bd5e1:null;}function _0x769071(_0x459ee6){return new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5cd89e,_0x56d7f6)=>{_0x459ee6[_0x3ddba5([0x74,0x68,0x65,0x6e])](_0x5cd89e,_0x56d7f6),window[_0x3ddba5([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x56d7f6,0x3dfe1021^_0x588350);});}}_0x42f2c7[_0x3ddba5([0x6f,0x6e])](_0x3ddba5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x210584,_0x13c9c9)=>{if(_0x13c9c9[0x0]!=_0x5a97a2)return _0x581f38(_0x3ddba5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x13c9c9[0x1]={..._0x13c9c9[0x1],[_0x3ddba5([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xaf908};},{[_0x3ddba5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3ddba5([0x68,0x69,0x67,0x68])}),_0x42f2c7[_0x3ddba5([0x6f,0x6e])](_0x3ddba5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x561916=>{_0x4ec93c(_0x561916[_0x3ddba5([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4bfb6b=!0x0,_0x57551b(_0x561916[_0x3ddba5([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3ddba5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3ddba5([0x6c,0x6f,0x77])}),_0x1148fe[_0x3ddba5([0x74,0x68,0x65,0x6e])](()=>{_0x4bfb6b||_0x581f38(_0x3ddba5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x548651(){return _0x42f2c7[_0x3ddba5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3ddba5([0x76,0x69,0x65,0x77])][_0x3ddba5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3ddba5([0x61,0x75,0x74,0x6f]);}function _0x14c2fd(){_0x42f2c7[_0x3ddba5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3ddba5([0x76,0x69,0x65,0x77])][_0x3ddba5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3ddba5([0x61,0x75,0x74,0x6f]);}}function _0x180ced(_0x3b3445){const _0x157367=[new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x410c1b=>setTimeout(_0x410c1b,0x3df6fa2d^_0x588350)),_0x1148fe[_0x3ddba5([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4eb100=>{let _0x34d12c=0x0;_0x42f2c7[_0x3ddba5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3ddba5([0x6f,0x6e])](_0x3ddba5([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4e7695,_0x192f07)=>{_0x192f07[0x0][_0x3ddba5([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x34d12c++,_0x34d12c==(0x3dffc109^_0x588350)&&(_0x4eb100(),_0x4e7695[_0x3ddba5([0x6f,0x66,0x66])]());});}))];return window[_0x3ddba5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3ddba5([0x72,0x61,0x63,0x65])](_0x157367)[_0x3ddba5([0x74,0x68,0x65,0x6e])](()=>_0x3b3445);}async function _0x1ca79e(){await _0x1148fe,_0x42f2c7[_0x3ddba5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3ddba5([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1cbe1d,_0x42f2c7[_0x3ddba5([0x6d,0x6f,0x64,0x65,0x6c])][_0x3ddba5([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1cbe1d,_0x42f2c7[_0x3ddba5([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3ddba5([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x6bb18f(_0x28cb0b){const _0x179200=_0x3e484f();_0x42f2c7[_0x179200]=_0x3ddba5([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x28cb0b,_0x28cb0b!=_0x3ddba5([0x56,0x61,0x6c,0x69,0x64])&&_0x1ca79e();}function _0x3e484f(){const _0xc068da=window[_0x3ddba5([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3ddba5([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3ddba5([0x6e,0x6f,0x77])]())[_0x3ddba5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3ddba5([0x2e]),'');let _0xc28308=_0x3ddba5([0x6e]);for(let _0x419d79=0x0;_0x419d79<_0xc068da[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x419d79+=0x2){let _0x5bd0fe=window[_0x3ddba5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc068da[_0x3ddba5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x419d79,_0x419d79+0x2));_0x5bd0fe>=_0x351f00[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5bd0fe-=_0x351f00[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xc28308+=_0x351f00[_0x5bd0fe];}return _0xc28308;}function _0x34a329(){const _0x58a307=_0x1d53c3[_0x3ddba5([0x73,0x70,0x6c,0x69,0x74])](_0x3ddba5([0x2e]));if(0x3!=_0x58a307[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2f985b(_0x58a307[0x1]);function _0x2f985b(_0x55a8f2){const _0x1ed764=_0xda10d9(_0x55a8f2);return _0x1ed764&&_0x53a639()?_0x1ed764:null;function _0x53a639(){const _0x205652=_0x1ed764[_0x3ddba5([0x6a,0x74,0x69])],_0x157702=window[_0x3ddba5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x205652[_0x3ddba5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x205652[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x10ba3c={..._0x1ed764,[_0x3ddba5([0x6a,0x74,0x69])]:_0x205652[_0x3ddba5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x205652[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x10ba3c[_0x3ddba5([0x76,0x63])],_0x597cf1(_0x10ba3c)==_0x157702;}}}async function _0x51dd3f(){let _0x3a2563=!0x0;try{const _0x27bdeb=_0x1d53c3[_0x3ddba5([0x73,0x70,0x6c,0x69,0x74])](_0x3ddba5([0x2e])),[_0x3dbff9,_0x360e9d,_0x35d404]=_0x27bdeb;return _0x187685(_0x3dbff9),await _0x6dcf74(_0x3dbff9,_0x360e9d,_0x35d404),_0x3a2563;}catch{return!0x1;}function _0x187685(_0x4496a4){const _0x4b1142=_0xda10d9(_0x4496a4);_0x4b1142&&_0x4b1142[_0x3ddba5([0x61,0x6c,0x67])]==_0x3ddba5([0x45,0x53,0x32,0x35,0x36])||(_0x3a2563=!0x1);}async function _0x6dcf74(_0x51008d,_0x48221d,_0x2acd31){const _0x209e09=window[_0x3ddba5([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3ddba5([0x66,0x72,0x6f,0x6d])](_0x2f660c(_0x2acd31),_0x5dc2da=>_0x5dc2da[_0x3ddba5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1a23b1=new window[(_0x3ddba5([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3ddba5([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x51008d+_0x3ddba5([0x2e])+_0x48221d),_0x2fc1bb=window[_0x3ddba5([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3ddba5([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2fc1bb)return;const _0x47c694=await _0x2fc1bb[_0x3ddba5([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3ddba5([0x6a,0x77,0x6b]),_0x871dc5,{[_0x3ddba5([0x6e,0x61,0x6d,0x65])]:_0x3ddba5([0x45,0x43,0x44,0x53,0x41]),[_0x3ddba5([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3ddba5([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3ddba5([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2fc1bb[_0x3ddba5([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3ddba5([0x6e,0x61,0x6d,0x65])]:_0x3ddba5([0x45,0x43,0x44,0x53,0x41]),[_0x3ddba5([0x68,0x61,0x73,0x68])]:{[_0x3ddba5([0x6e,0x61,0x6d,0x65])]:_0x3ddba5([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x47c694,_0x209e09,_0x1a23b1)||(_0x3a2563=!0x1);}}function _0xda10d9(_0xbaf213){return _0xbaf213[_0x3ddba5([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3ddba5([0x65,0x79]))?JSON[_0x3ddba5([0x70,0x61,0x72,0x73,0x65])](_0x2f660c(_0xbaf213)):null;}function _0x2f660c(_0x3012f6){return window[_0x3ddba5([0x61,0x74,0x6f,0x62])](_0x3012f6[_0x3ddba5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3ddba5([0x2b]))[_0x3ddba5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3ddba5([0x2f])));}function _0x597cf1(_0x3889ed){let _0x8727e0=0x1505;function _0x2d0d60(_0x1f1005){for(let _0x2c4906=0x0;_0x2c4906<_0x1f1005[_0x3ddba5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2c4906++){const _0x1a2555=_0x1f1005[_0x3ddba5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2c4906);_0x8727e0=(_0x8727e0<<0x5)+_0x8727e0+_0x1a2555,_0x8727e0&=_0x8727e0;}}function _0x43650c(_0x230df2){Array[_0x3ddba5([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x230df2)?_0x230df2[_0x3ddba5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x43650c):_0x230df2&&typeof _0x230df2==_0x3ddba5([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3ddba5([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x230df2)[_0x3ddba5([0x73,0x6f,0x72,0x74])]()[_0x3ddba5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x46f0a0,_0x9c2f7b])=>{_0x2d0d60(_0x46f0a0),_0x43650c(_0x9c2f7b);}):_0x2d0d60(window[_0x3ddba5([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x230df2));}return _0x43650c(_0x3889ed),_0x8727e0>>>0x0;}function _0x4729a5(_0x2e1e91){return _0x2e1e91[_0x3ddba5([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3ddba5([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3ddba5([0x30]));}function _0x57cdee(_0x43abd8){return _0x43abd8[_0x3ddba5([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3ddba5([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3ddba5([0x6a,0x6f,0x69,0x6e])]('');}function _0x1cbe1d(){}function _0x3ddba5(_0x40547b){return _0x40547b['map'](_0x19170c=>String['fromCharCode'](_0x19170c))['join']('');}_0x6bb18f(await _0x1c106d());}(this);}['showFakeVisualSelection'](){const _0x2555b8=this['editor']['model'];_0x2555b8['change'](_0x5b5811=>{const _0xeb7da2=_0x2555b8['document']['selection']['getRanges']();let _0xe5364e=0x0;for(const _0x6230f3 of _0xeb7da2){const _0x3c6241=Si+':'+_0xe5364e;if(_0x2555b8['markers']['has'](_0x3c6241))_0x5b5811['updateMarker'](_0x3c6241,{'range':_0x6230f3});else{if(_0x6230f3['start']['isAtEnd']){const _0x2b61f6=_0x6230f3['start']['getLastMatchingPosition'](({item:_0x26ef2e})=>!_0x2555b8['schema']['isContent'](_0x26ef2e),{'boundaries':_0x6230f3});_0x5b5811['addMarker'](_0x3c6241,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5b5811['createRange'](_0x2b61f6,_0x6230f3['end'])});}else _0x5b5811['addMarker'](_0x3c6241,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x6230f3});}_0xe5364e++;}});}['hideFakeVisualSelection'](){const _0x369b64=this['editor']['model'],_0x1168cc=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Si));_0x1168cc['length']&&_0x369b64['change'](_0x56b115=>{_0x1168cc['forEach'](_0x3722d9=>{_0x56b115['removeMarker'](_0x3722d9);});});}['insertContent'](_0x20f8df,_0x51ba4d){const _0x11e53a=this['_getAISelection'](),_0x372476=_0x51ba4d||_0x11e53a['getFirstRange']();this['editor']['model']['canEditAt'](_0x372476)&&this['editor']['model']['change'](_0x160079=>{this['hideFakeVisualSelection'](),_0x51ba4d||this['_resetContentOfSelectedTableCells'](_0x160079,_0x11e53a),this['_pasteHTMLUsingClipboard']({'insertAt':_0x372476,'writer':_0x160079,'html':_0x20f8df});});}['insertContentBelow'](_0x1f3fdb){const {model:_0x2f4634}=this['editor'],_0x3eff47=this['_getAISelection']();_0x2f4634['change'](()=>{const _0x222cb4=this['_prepareTableInsertBelowPosition'](_0x1f3fdb,_0x3eff47)||this['_getDefaultInsertBelowPosition'](_0x3eff47);this['insertContent'](_0x1f3fdb,_0x222cb4);});}['_getAISelection'](){const _0x2eda8b=this['editor']['model'],_0x35665b=Array['from'](_0x2eda8b['markers']['getMarkersGroup'](Si))['map'](_0xd8085=>_0xd8085['getRange']());return _0x2eda8b['createSelection'](_0x35665b);}['_pasteHTMLUsingClipboard']({writer:_0x1d4d18,html:_0x4e9a7d,insertAt:_0x13c945}){const {view:_0x53d295}=this['editor']['editing'],_0xbb6bc6=this['editor']['plugins']['get'](_0x53aae2),_0x3a78ca=new fi();_0x3a78ca['setData']('text/html',_0x4e9a7d);const _0x14c3b2=new ClipboardEvent('paste',{'clipboardData':_0x3a78ca}),_0x203979=new _0x5a415e(_0x53d295,_0x14c3b2,{'dataTransfer':new _0x352cb4(_0x3a78ca)});_0x1d4d18['setSelection'](_0x13c945);const _0x23f5a7=(_0x4b1b60,_0x43012e)=>{_0x43012e['resultRange']&&_0x1d4d18['setSelection'](_0x43012e['resultRange']);};_0xbb6bc6['once']('contentInsertion',_0x23f5a7,{'priority':'lowest'}),_0x53d295['document']['fire']('paste',_0x203979),_0xbb6bc6['off']('contentInsertion',_0x23f5a7);}['_getDefaultInsertBelowPosition'](_0x3c712e){const {model:_0x5dbf99}=this['editor'],_0x1a7409=Array['from'](_0x3c712e['getSelectedBlocks']());return _0x1a7409['length']?_0x5dbf99['createPositionAfter'](_0x1a7409['pop']()):_0x3c712e['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x47f634,_0x1c75a7){const {model:_0x1a1687,plugins:_0x1b795d}=this['editor'];if(_0x1b795d['has']('TableUtils')){const _0x47fa09=_0x1b795d['get']('TableUtils')['getSelectedTableCells'](_0x1c75a7);if(_0x47fa09['length']){const _0x1f40d5=this['_getTableRowCountFromContent'](_0x47f634),_0x233801=this['_createEmptyTableRows'](_0x47fa09,_0x1f40d5);return _0x1a1687['createPositionAt'](_0x233801,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3438e3){const _0x2bd1e4=this['editor']['plugins']['get']('TableUtils'),_0x5b65c6=this['editor']['data']['parse'](_0x3438e3),_0x2a1f26=Array['from'](_0x5b65c6['getChildren']())['filter'](_0x4f09b0=>_0x4f09b0['is']('element','table'));let _0x47bc9b=0x0;return _0x2a1f26['forEach'](_0x474357=>{_0x47bc9b+=_0x2bd1e4['getRows'](_0x474357);}),_0x47bc9b;}['_createEmptyTableRows'](_0x4affdd,_0x253d81){const _0x275444=this['editor']['plugins']['get']('TableUtils'),_0xc397bb=_0x275444['getRowIndexes'](_0x4affdd),_0xa06d54=_0x275444['getColumnIndexes'](_0x4affdd),_0x40bd5f=_0xc397bb['last']+0x1,_0x7abf97=_0xa06d54['first'],_0x17c7bc=_0x4affdd[0x0]['findAncestor']('table');for(let _0xd224d3=0x0;_0xd224d3<_0x253d81;_0xd224d3++)_0x275444['insertRows'](_0x17c7bc,{'at':_0x40bd5f});return _0x17c7bc['getChild'](_0x40bd5f)['getChild'](_0x7abf97);}['_resetContentOfSelectedTableCells'](_0x5112fc,_0x3fc0a){const {plugins:_0x2c19c1}=this['editor'],{model:_0xca24ae}=_0x5112fc;if(!_0x2c19c1['has']('TableUtils'))return;_0x2c19c1['get']('TableUtils')['getSelectedTableCells'](_0x3fc0a)['length']&&_0xca24ae['deleteContent'](_0x3fc0a);}}class AIAdapter extends _0x5686f0{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x5b6f19){super(_0x5b6f19),this['name']='AIRequestError';}}function Ri(_0x1eb0f0,_0x3c20a5,_0x19e617){const t=_0x1eb0f0['t'];switch(_0x3c20a5){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',_0x19e617);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x19e617);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'},_0x19e617);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_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3c20a5;}}class ShowAIAssistantCommand extends _0x3a665b{['_commandDefinitions'];constructor(_0x496001,_0x2b9056){super(_0x496001),this['_commandDefinitions']=_0x2b9056,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3aa470,_0x2e3234,_0x5afec9)=>{this['isEnabled']&&(this['enabledCommandsIds']=bi(this['_commandDefinitions'],_0x5afec9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x21b0ca,_0x30e0e4,_0x307384)=>{this['enabledCommandsIds']=_0x307384?bi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x543d1e=this['editor']['model'];this['_hasContext']=function(_0x2d8c1b){const _0x3c03a2=_0x2d8c1b['document']['selection'];return _0x3c03a2['isCollapsed']?0x0!==[..._0x3c03a2['getSelectedBlocks']()]['length']&&![..._0x3c03a2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2d8c1b['hasContent'](_0x3c03a2['getFirstRange']());}(_0x543d1e);const _0x48bd1d=_0x543d1e['document']['selection'],_0x360c5e=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x527f9f of _0x48bd1d['getRanges']())for(const _0x396749 of _0x527f9f['getItems']())if(_0x396749['is']('element')&&_0x360c5e['includes'](_0x396749['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3e2816='',_0x2f5e4f='',_0x315565='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x3e2816,_0x2f5e4f,_0x315565);}}function bi(_0x1a8fd6,_0x3884a5){const _0xa46c7e=new Set();for(const _0x21ef8d of _0x1a8fd6['values']())(_0x3884a5||!0x1===_0x21ef8d['requiresContent'])&&_0xa46c7e['add'](_0x21ef8d['id']);return Array['from'](_0xa46c7e);}const Oi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x115ae6,_0xd5a5f7,_0x4b5ddf){super(),this['editor']=_0x115ae6,this['textAdapter']=_0xd5a5f7,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4b5ddf,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x86a1dd,_0x2731fb,_0x5ebc79)=>{this['view']['value']=this['_sanitizeHTML'](_0x5ebc79);}),this['listenTo'](this['view'],'submitPrompt',(_0x27b040,_0x246121)=>{const _0x1fdde7=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x246121,_0x1fdde7,'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:_0x2d7615,query:_0x3015e4,htmlContent:_0x27a9d5,label:_0xc444de,mainActionLabel:_0x3e0e14}){this['view']['prompt']=_0xc444de,this['view']['mainAction']=_0x3e0e14,this['initialContext']=_0x27a9d5,_0x3015e4&&(this['view']['isRendered']?this['_handleQuery'](_0x3015e4,_0x27a9d5,_0x2d7615,_0xc444de):this['view']['once']('render',()=>{this['_handleQuery'](_0x3015e4,_0x27a9d5,_0x2d7615,_0xc444de);}));}['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'](_0x48748e,_0x3f2255,_0x4e4b40,_0x109af2){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3f2255,this['previousQuery']=_0x48748e,this['previousLabel']=_0x109af2||_0x48748e,this['previousActionId']=_0x4e4b40,new Promise(_0x34ba52=>{this['textAdapter']['makeRequest']({'query':_0x48748e,'context':_0x3f2255,'onData':_0x104f52=>{this['currentResponse']=_0x104f52,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4e4b40})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x150285=>{_0x150285 instanceof AIRequestError?this['view']['handleError'](_0x150285['message']):this['view']['handleError'](),_0x34ba52();})['finally'](()=>{this['stopProcessing'](),_0x34ba52();});});}['_parseAndNormalizeContent'](_0x58b576,_0x32a775=!0x1){const _0x3aeec3=Oi['exec'](_0x58b576);_0x58b576=_0x3aeec3?_0x58b576['substring'](_0x3aeec3[0x1]['length']):_0x58b576['length']<0x64&&!_0x32a775?'':this['_stripMarkdownSyntax'](_0x58b576);const _0x58ac72=this['_domParser']['parseFromString'](_0x58b576,'text/html');if(_0x3aeec3){const _0x463c89=Array['from'](_0x58ac72['body']['childNodes']);_0x463c89['reverse']();for(const _0x2f0c49 of _0x463c89){if(_0x2f0c49['nodeType']==Node['ELEMENT_NODE'])break;_0x2f0c49['remove']();}}const _0x25a419=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x58ac72['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x25a419);const _0xbc21f2=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x139a64=this['editor']['data']['toModel'](_0x25a419);return _0xbc21f2||_0x139a64['markers']['clear'](),this['editor']['data']['stringify'](_0x139a64);}['_normalizeResponseHeadings'](_0x91c70a){const _0x483cd9=new _0x4642be(this['editor']['editing']['view']['document']),_0x2f4a33=new _0x442511({'name':/^h[1-5]$/}),_0x240256=[];let _0x5e322c=!0x1;for(const _0x1ea183 of _0x91c70a)_0x1ea183['is']('element')&&_0x2f4a33['match'](_0x1ea183)&&(_0x240256['push'](_0x1ea183),'h1'==_0x1ea183['name']&&(_0x5e322c=!0x0));if(_0x5e322c){for(const _0x18d6a0 of _0x240256)_0x483cd9['rename']('h'+(parseInt(_0x18d6a0['name'][0x1])+0x1),_0x18d6a0);}}['_isH1TagSupportEnabled'](){const {data:_0x40d03d,editing:_0x34b2d8}=this['editor'],_0x4ffed3=_0x40d03d['htmlProcessor']['toView']('<h1></h1>'),_0x80c9a5=_0x40d03d['toView'](_0x40d03d['toModel'](_0x4ffed3));return!!_0x34b2d8['view']['domConverter']['viewToDom'](_0x80c9a5)['querySelector']('h1');}['_sanitizeHTML'](_0x426dc8){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x426dc8),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x27514a){const _0x3f80ea=_0x27514a['trim']();return _0x3f80ea['startsWith']('```html')?_0x3f80ea['endsWith']('```')?_0x3f80ea['substring'](0x7,_0x3f80ea['length']-0x3):_0x3f80ea['substring'](0x7):_0x27514a;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0x1ceada){super(_0x1ceada),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1d2e49=>Ri(_0x1ceada,'AI_'+_0x1d2e49['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0x1ceada,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0x1ceada,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0x1ceada,'Stop'));const _0x54cdba=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x54cdba['if']('isVisible','ck-hidden',_0x458f28=>!_0x458f28)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5aa77f,_0x39a1ab){const _0x5d9498=new vt(this['locale']);return _0x5d9498['set']({'label':_0x5aa77f,'class':_0x39a1ab||'','isVisible':!0x0,'withText':!0x0}),_0x5d9498;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x564413,_0xed1962=''){super(_0x564413),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3d5f0c=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x564413,_0xed1962),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3d5f0c['if']('isVisible','ck-hidden',_0x3f51dd=>!_0x3f51dd)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3d5f0c['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 _0x10aaa6=!0x1;this['on']('change:value',(_0x4c2683,_0x30f5d3,_0x3ef5b8)=>{const _0x2af46a=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3ef5b8),this['isProcessing']&&_0x2af46a&&!_0x10aaa6&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x8c1882,_0x2fd015,_0x3eca19)=>{_0x10aaa6=!0x1,_0x3eca19?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x10aaa6=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x10aaa6=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2df0ea=this['locale'],_0x22cf79=new vt(this['locale']),_0x5d866b='ck-ai-form__copy-button';return _0x22cf79['set']({'label':Ri(_0x2df0ea,'Copy'),'icon':_0x16addf,'class':_0x5d866b,'tooltip':!0x0}),_0x22cf79['bind']('isVisible')['to'](this,'value',_0x42483e=>!!_0x42483e),_0x22cf79['bind']('isEnabled')['to'](this,'isProcessing',_0x366cf3=>!_0x366cf3),_0x22cf79['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x22cf79['icon']=_0x4ab520,_0x22cf79['class']=_0x5d866b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x22cf79['icon']=_0x16addf,_0x22cf79['class']=_0x5d866b;},0x3e8);}),_0x22cf79;}['_copyHTMLToClipboard'](_0x2a0ef1){const {window:_0xc96a4d,document:_0x184847}=ct;if(_0xc96a4d['ClipboardItem']){const {Blob:_0x470f75,ClipboardItem:_0x489a05}=_0xc96a4d,_0x530a95=[new _0x489a05({'text/html':new _0x470f75([_0x2a0ef1['innerHTML']],{'type':'text/html'}),'text/plain':new _0x470f75([_0x2a0ef1['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x530a95);}else{const _0x1ee8af=_0x184847['createElement']('div');_0x1ee8af['style']['position']='absolute',_0x1ee8af['style']['left']='-9999px',_0x1ee8af['innerHTML']='<span>[</span>'+_0x2a0ef1['innerHTML']+'<span>]</span>',_0x184847['body']['appendChild'](_0x1ee8af);const _0xa3377c=_0x184847['createRange']();_0xa3377c['setStartAfter'](_0x1ee8af['firstElementChild']),_0xa3377c['setEndBefore'](_0x1ee8af['lastElementChild']);const _0x39913e=_0xc96a4d['getSelection']();_0x39913e['removeAllRanges'](),_0x39913e['addRange'](_0xa3377c),_0x184847['execCommand']('copy'),_0x1ee8af['remove']();}}}class ContentFieldView extends Nt{constructor(_0x52183b,_0x1bdc2f=''){super(_0x52183b),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1bdc2f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1d9ab6){this['element']['innerHTML']=_0x1d9ab6;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xd332ed=new Nt(),_0x4f7ae3=this['locale'],_0x11dcd7=new yt();return _0x11dcd7['isVisible']=!0x0,_0xd332ed['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x11dcd7,{'text':Ri(_0x4f7ae3,'AI\x20is\x20writing...')}]}),_0xd332ed['render'](),_0xd332ed;}}class AIFormErrorView extends Nt{constructor(_0x3ea01c,_0x3fb501=''){super(_0x3ea01c);const _0x375e2d=new xt(),_0x163e50=this['bindTemplate'];this['set']('text',_0x3fb501),_0x375e2d['content']=_0x90f260,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x375e2d,{'text':_0x163e50['to']('text')}]});}}class AIFormPromptView extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x39f708,_0x4eb239){super(_0x39f708,_0x4eb239),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',(_0x4a3c06,_0x34c05b)=>{_0x4a3c06['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x34c05b());});}['_createSubmitButton'](){const _0x5b2b72=new vt(this['locale']),_0x1bd132=this['locale'];return _0x5b2b72['set']({'icon':_0x177154,'label':Ri(_0x1bd132,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5b2b72['on']('execute',()=>{this['submit']();}),_0x5b2b72['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x48d0cd,_0x145c73)=>!_0x48d0cd&&_0x145c73),_0x5b2b72;}['_createShowHistoryButton'](){const _0x48e8da=new vt(this['locale']),_0xcebda2=this['resultsView'],_0x9b8f23=this['locale'];_0x48e8da['set']({'label':Ri(_0x9b8f23,'History'),'withText':!0x1,'icon':_0x41655b,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x48e8da['bind']('isOn')['to'](_0xcebda2,'isVisible'),_0x48e8da['bind']('isEnabled')['to'](this,'isEnabled'),_0x48e8da['on']('execute',()=>{_0xcebda2['isVisible']=!_0xcebda2['isVisible'],_0xcebda2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x381f54=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x58460e=new ut(this['queryView']['fieldView']['element']),_0x332940=_0x58460e['width'],_0x27068f='rtl'===_0x9b8f23['uiLanguageDirection']?'left':'right';_0x58460e['excludeScrollbarsAndBorders'](),_0x48e8da['element']['style'][_0x27068f]=_0x332940-_0x58460e['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x381f54),this['on']('render',_0x381f54),_0x48e8da;}['submit'](){const _0x103741=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x103741);}['focus'](_0x47270a){-0x1===_0x47270a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x409f9d){super(_0x409f9d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x409f9d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5cd9b2=0x0;for(const _0x2ef658 of this['items'])_0x5cd9b2+=_0x2ef658['items']['length'];return{'resultsCount':_0x5cd9b2,'totalItemsCount':_0x5cd9b2};}['_createClearHistoryButton'](){const _0x3c55ad=this['locale'],_0x1b206c=new vt(this['locale']);return _0x1b206c['set']({'label':'('+Ri(_0x3c55ad,'Clear')+')','withText':!0x0}),_0x1b206c['on']('execute',()=>this['fire']('clearHistory')),_0x1b206c;}}class AIHistoryListItemView extends Pt{constructor(_0x3cebcd){super();const _0x4fff68=new Ht(),_0x5eb9d9=new vt(this['locale'],_0x4fff68);this['children']['add'](_0x5eb9d9),_0x5eb9d9['set']({'label':_0x3cebcd['prompt'],'withText':!0x0}),_0x5eb9d9['on']('execute',()=>{this['fire']('execute',{'value':_0x58cc9d(_0x3cebcd['prompt'])});});}}const vi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4ae4f9,_0x5783ee)=>{const _0x4f5fe4=Ni(_0x5783ee['prompt']);for(const _0x1788df of this)if(_0x1788df!=_0x5783ee&&Ni(_0x1788df['prompt'])===_0x4f5fe4){this['remove'](_0x1788df);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2901b5=sessionStorage['getItem'](vi)||'[]';this['addMany'](JSON['parse'](_0x2901b5));}['_saveToSessionStorage'](){sessionStorage['setItem'](vi,JSON['stringify'](this['map'](_0x5be755=>_0x5be755)));}}function Ni(_0x51fab8){return _0x51fab8['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x302ce5,_0xfe45be,_0x5b0e2b=''){super(_0x302ce5),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x302ce5),this['contentArea']=new AIFormContentArea(_0x302ce5,_0x5b0e2b),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x4f2cc7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xfe45be],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4f2cc7['if']('isError','ck-hidden',_0x38c6ee=>!_0x38c6ee)]},'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'](_0xf7098c=0x1){-0x1===_0xf7098c?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 _0x43e1a6=this['locale'],_0x4934b4=new AIFormPromptView(_0x43e1a6,{'queryView':{'label':Ri(_0x43e1a6,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x43e1a6,'Empty\x20history'),'secondary':Ri(_0x43e1a6,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4934b4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3de22f,_0x4b9878)=>_0x3de22f&&!_0x4b9878),this['listenTo'](_0x4934b4,'submit',(_0x3c4102,_0x4f92d7)=>{this['prompt']=_0x4f92d7;const _0xd2aa4a=_0x19d831(_0x4f92d7);this['fire']('submitPrompt',_0xd2aa4a),_0x4f92d7['trim']()&&this['_promptHistory']['add']({'prompt':_0xd2aa4a},0x0);},{'priority':'high'}),_0x4934b4;}['_createHistoryView'](){const _0x41788a=new AIHistoryListView(this['locale']);return _0x41788a['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x41788a['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x41788a;}['_createToolbar'](){const _0x28ed91=new AIFormToolbarView(this['locale']);return _0x28ed91['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1de532,_0x3d4533,_0x5a9dce)=>_0x1de532&&!_0x3d4533&&!!_0x5a9dce),_0x28ed91['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x28ed91['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x528dc1,_0x10135b,_0x596a69)=>_0x528dc1&&!_0x10135b&&!!_0x596a69),_0x28ed91['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x28ed91['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2d8d9b,_0x5ae606)=>_0x2d8d9b&&!_0x5ae606),_0x28ed91['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x28ed91['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x28ed91['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x28ed91;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x485968=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x485968,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xdc23d8){const _0x4edb80=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xdc23d8||Ri(_0x4edb80,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const yi=globalThis['DataTransfer'];class AIAssistantUI extends _0x5686f0{['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[_0x477206,AIAssistantEditing,AIAdapter,Bt];}constructor(_0x2bb85a){super(_0x2bb85a),_0x2bb85a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2bb85a['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2bb85a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2bb85a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x25401c}=this;this['_aiAdapter']=_0x25401c['plugins']['get'](AIAdapter),this['_dialog']=_0x25401c['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xb0de08=new ShowAIAssistantCommand(_0x25401c,Array['from'](this['_commandDefinitions']['values']()));_0x25401c['commands']['add']('showAIAssistant',_0xb0de08),_0x25401c['ui']['componentFactory']['add']('aiCommands',_0x18447a=>{const _0x3cab3b=Gt(_0x18447a);return _0x3cab3b['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3cab3b['buttonView']['set']({'label':Ri(_0x18447a,'AI\x20Commands'),'icon':_0x343811,'tooltip':!0x0}),_0x3cab3b['on']('execute',_0x352630=>this['_onExecute'](_0x352630['source']['id'])),Ft(_0x3cab3b,_0x25401c['ui']['view']['body'],function(_0xe26117){const _0x5e1b81=Ti(_0xe26117['config']['get']('ai.assistant.commands'),_0xe26117['locale']),_0x4a8145=Li(_0xe26117,_0x5e1b81)['filter'](_0xf6e6ce=>_0xf6e6ce['commands']['length']);if(0x1===_0x4a8145['length'])return Li(_0xe26117,_0x4a8145[0x0]['commands'])['map'](_0x313f2f=>({'id':_0x313f2f['id'],'label':_0x313f2f['label']}));return _0x4a8145['map'](_0x4d817b=>{const {groupId:_0xc26b58,groupLabel:_0x1c7e86,commands:_0x1bd7e5}=_0x4d817b,_0x27543d=Li(_0xe26117,_0x1bd7e5)['map'](_0x3aa986=>({'id':_0x3aa986['id'],'label':_0x3aa986['label']}));return{'id':_0xc26b58,'menu':_0x1c7e86||_0xc26b58,'children':_0x27543d};});}(_0x25401c),{'ariaLabel':Ri(_0x18447a,'AI\x20Commands')}),_0x3cab3b['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xb0de08['on']('change:enabledCommandsIds',_0x31b554),_0x3cab3b['menuView']['once']('render',_0x31b554),_0x3cab3b;function _0x31b554(){_0x3cab3b['isEnabled']=_0xb0de08['enabledCommandsIds']['length']>0x0;for(const _0x39d9fe of _0x3cab3b['menuView']['buttons'])_0x39d9fe['isEnabled']=_0xb0de08['enabledCommandsIds']['includes'](_0x39d9fe['id']);}}),_0x25401c['ui']['componentFactory']['add']('menuBar:aiCommands',_0xe679e9=>{const _0x490a32=new Kt(_0xe679e9);_0x490a32['buttonView']['set']({'label':Ri(_0xe679e9,'AI\x20Commands'),'icon':_0x343811}),_0x490a32['bind']('isEnabled')['to'](_0xb0de08,'enabledCommandsIds',_0x3f5e25=>_0x3f5e25['length']>0x0);const _0x2960bf=Ti(_0x25401c['config']['get']('ai.assistant.commands'),_0xe679e9);return this['_populateMenuBarMenu'](_0xb0de08,_0x490a32,_0x2960bf,_0x2171ca=>this['_onExecute'](_0x2171ca)),_0x490a32;}),_0x25401c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x3c3c93=this['_createAIAssistantUIButton'](vt);return _0x3c3c93['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x3c3c93;}),_0x25401c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4d4a4e=this['_createAIAssistantUIButton'](Wt);return _0x4d4a4e['set']({'role':'menuitemcheckbox'}),_0x4d4a4e;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2d0c63=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5d98a5;for(const _0x22b292 in _0x2d0c63){const _0x2bbeaa=_0x22b292,_0x43736c=_0x2d0c63[_0x2bbeaa];if('aiLicenseKeyValid'==_0x43736c||'aiLicenseKeyInvalid'==_0x43736c||'aiLicenseKeyExpired'==_0x43736c||'aiLicenseKeyDomainLimit'==_0x43736c||'aiLicenseKeyNotAllowed'==_0x43736c||'aiLicenseKeyEvaluationLimit'==_0x43736c||'aiLicenseKeyUsageLimit'==_0x43736c){delete _0x2d0c63[_0x2bbeaa],_0x5d98a5=_0x43736c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x5d98a5&&_0x2d0c63['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4a2f5b='',_0xa42041='',_0x1e8311='custom'){const _0xd86635=this['editor'],_0x1a9a47=_0xd86635['editing']['view'],_0x4e5e0=_0xd86635['plugins']['get'](AIAssistantEditing),_0x219bff=_0xd86635['plugins']['get'](_0x477206);_0x4e5e0['showFakeVisualSelection']();const _0x2b7d63=new yi(),_0x9effcb=new ClipboardEvent('copy',{'clipboardData':_0x2b7d63}),_0x3e1f36=new _0x352cb4(_0x2b7d63),_0x372c8e=new _0x5a415e(_0x1a9a47,_0x9effcb,{'dataTransfer':_0x3e1f36});_0x219bff['_forceMarkersCopy']('comment',()=>{_0x1a9a47['document']['fire']('copy',_0x372c8e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0xd86635,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2bee87=_0x3e1f36['getData']('text/html');const _0x2b95f9=_0xd86635['model']['document']['selection'],_0x4e4662=Array['from'](_0x2b95f9['getRanges']());0x1===_0x4e4662['length']&&_0x4e4662[0x0]['isFlat']&&!_0x2b95f9['getSelectedElement']()&&''!==_0x2bee87['replace'](/ /g,'')['trim']()&&(_0x2bee87='<p>'+_0x2bee87+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1e8311,'query':_0x4a2f5b,'htmlContent':_0x2bee87,'label':_0xa42041,'mainActionLabel':ki[_0xd86635['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x98106a,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4e5e0['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x15b88f=new Map(),_0x3813c3=Ti(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x3bd685 of _0x3813c3)for(const _0x39002f of _0x3bd685['commands'])_0x15b88f['set'](_0x39002f['id'],{..._0x39002f,'groupId':_0x3bd685['groupId'],'groupLabel':_0x3bd685['groupLabel']||_0x3bd685['groupId']});return _0x15b88f;}['_createAIAssistantUIButton'](_0x1cea69){const _0x542998=this['editor'],_0x277452=_0x542998['commands']['get']('showAIAssistant'),_0x181945=new _0x1cea69(_0x542998['locale']);return _0x181945['set']({'label':Ri(_0x542998['locale'],'AI\x20Assistant'),'icon':_0x98106a,'isToggleable':!0x0}),_0x181945['bind']('isEnabled')['to'](_0x277452),_0x181945['bind']('isOn')['to'](this['_dialog'],'id',_0x1e1621=>'aiAssistant'===_0x1e1621),this['listenTo'](_0x181945,'execute',()=>{_0x181945['isOn']?this['hideUI']():_0x277452['execute']();}),_0x181945;}['_initView'](){const _0x271d99=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(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',()=>{_0x271d99['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x271d99['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4ad8c8,ui:{ariaLiveAnnouncer:_0x955aac}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xc3e6b2,_0x7cb1b9,_0x52c542)=>{const _0x25267f=this['_aiAssistantController']['currentContext'];_0x52c542?_0x955aac['announce'](Ri(_0x4ad8c8,'AI\x20is\x20writing')):_0x25267f&&_0x955aac['announce'](Ri(_0x4ad8c8,'Generated\x20content:\x20%0',_0x25267f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1a4297,_0xa69ea,_0x1bd0ba)=>{if(_0x1bd0ba){const _0x5a9383=this['_formView']['errorView']['text'];_0x955aac['announce'](Ri(_0x4ad8c8,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5a9383));}});}['_onExecute'](_0x1e2aa0){const _0x353b38=this['_commandDefinitions']['get'](_0x1e2aa0),_0x2f3a42=this['editor'],_0x7b5cbc=_0x2f3a42['model']['document']['selection'],_0x472cbd=_0x2f3a42['commands']['get']('showAIAssistant'),_0x706a68=_0x2f3a42['plugins']['get'](AIAssistantEditing),_0x2e8353=''+(_0x353b38['groupId']!==wi?_0x353b38['groupLabel']+':\x20':'')+_0x353b38['label'];if(!0x1!==_0x353b38['requiresContent']&&_0x7b5cbc['isCollapsed']){const _0x22428d=At(_0x7b5cbc['getSelectedBlocks']())||_0x2f3a42['model']['schema']['getLimitElement'](_0x7b5cbc);_0x2f3a42['model']['change'](_0x475e2e=>{_0x475e2e['setSelection'](_0x22428d,'in');});}_0x706a68['showFakeVisualSelection'](),_0x472cbd['execute'](_0x353b38['prompt'],_0x2e8353,'command:'+_0x1e2aa0);}['_populateMenuBarMenu'](_0x2f976f,_0x51e06f,_0x12beff,_0x1772d3){const _0x19f278=this['editor'],_0x548a5d=_0x19f278['locale'],_0x3b1048=new $t(_0x548a5d),_0x255de5=Li(_0x19f278,_0x12beff)['filter'](_0x137011=>_0x137011['commands']['length']);0x1===_0x255de5['length']?this['_getMenuBarGroupButtons']({'command':_0x2f976f,'commands':_0x255de5[0x0]['commands'],'parentMenuView':_0x51e06f,'onExecute':_0x1772d3})['forEach'](_0x53349c=>_0x3b1048['items']['add'](_0x53349c)):_0x255de5['forEach'](({groupId:_0x1d673e,groupLabel:_0x33ec3a,commands:_0x28344f})=>{const _0x2cb947=new qt(_0x548a5d,_0x51e06f),_0x49c385=new Kt(_0x548a5d),_0x593f24=new $t(_0x548a5d),_0x17a590=this['_getMenuBarGroupButtons']({'command':_0x2f976f,'commands':_0x28344f,'parentMenuView':_0x49c385,'onExecute':_0x1772d3});_0x49c385['buttonView']['set']({'label':_0x33ec3a||_0x1d673e}),_0x49c385['delegate']('execute')['to'](_0x51e06f),_0x593f24['items']['addMany'](_0x17a590),_0x49c385['panelView']['children']['add'](_0x593f24),_0x2cb947['children']['add'](_0x49c385),_0x3b1048['items']['add'](_0x2cb947);}),_0x51e06f['panelView']['children']['add'](_0x3b1048);}['_getMenuBarGroupButtons']({command:_0x57b9a6,commands:_0x4452b7,parentMenuView:_0x389c81,onExecute:_0xfb880e}){const _0x7e6d7=this['editor'],_0x54efe1=_0x7e6d7['locale'];return Li(_0x7e6d7,_0x4452b7)['map'](_0x281940=>{const _0x1a440f=new qt(_0x54efe1,_0x389c81),_0x3de280=new Wt(_0x54efe1);return _0x3de280['set']({'label':_0x281940['label']}),_0x3de280['delegate']('execute')['to'](_0x389c81),_0x3de280['on']('execute',()=>_0xfb880e(_0x281940['id'])),_0x3de280['bind']('isEnabled')['to'](_0x57b9a6,'enabledCommandsIds',_0x1cbdeb=>_0x1cbdeb['includes'](_0x281940['id'])),_0x1a440f['children']['add'](_0x3de280),_0x1a440f;});}}function xi(_0x4c9c4d,_0x3ab25e){return void 0x0!==_0x4c9c4d['order']&&void 0x0===_0x3ab25e['order']?0x1:void 0x0===_0x4c9c4d['order']&&void 0x0!==_0x3ab25e['order']?-0x1:void 0x0!==_0x4c9c4d['order']&&void 0x0!==_0x3ab25e['order']?_0x4c9c4d['order']-_0x3ab25e['order']:0x0;}function Li(_0x53a3d6,_0x2e7b9c){_0x2e7b9c['sort'](xi);const _0x1d913f={},_0x4ad75b=[];for(const _0x366e4c of _0x2e7b9c)if(void 0x0!==_0x366e4c['order']){if(_0x366e4c['order']in _0x1d913f)throw new at('ai-commands-config-order-collision',_0x53a3d6,{'conflictingDefinitions':[_0x366e4c,_0x1d913f[_0x366e4c['order']]]});_0x1d913f[_0x366e4c['order']]=_0x366e4c,_0x4ad75b['splice'](_0x366e4c['order'],0x0,_0x366e4c);}else _0x4ad75b['push'](_0x366e4c);return _0x4ad75b;}class AIAssistant extends _0x5686f0{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c667f){super(_0x3c667f);const _0x5173c8=_0x3c667f['config'],_0x3d4fdf=_0x3c667f['locale'];_0x5173c8['define']('ai.assistant.preserveComments',!0x0),_0x5173c8['define']('ai.assistant.commands',Di(_0x3d4fdf)),_0x5173c8['define']('ai.assistant.extraCommandGroups',[]),_0x5173c8['define']('ai.assistant.removeCommands',[]);let _0x229c1a=Ti(_0x5173c8['get']('ai.assistant.commands'),_0x3d4fdf);const _0x25722a=_0x5173c8['get']('ai.assistant.extraCommandGroups'),_0x1df400=_0x5173c8['get']('ai.assistant.removeCommands');_0x25722a['forEach'](_0x133603=>{const _0x5b727b=_0x229c1a['find'](_0x425636=>_0x425636['groupId']===_0x133603['groupId']);_0x5b727b?_0x5b727b['commands']=_0x5b727b['commands']['concat'](_0x133603['commands']):_0x229c1a['push'](_0x133603);}),_0x229c1a=_0x229c1a['filter'](_0x3721df=>!_0x1df400['includes'](_0x3721df['groupId'])),_0x229c1a['forEach'](_0x46c55c=>{_0x46c55c['commands']=_0x46c55c['commands']['filter'](_0x5a0c43=>!_0x1df400['includes'](_0x5a0c43['id']));}),_0x5173c8['set']('ai.assistant.commands',_0x229c1a);}}function Di(_0x103d5f){return[{'groupId':'editOrReview','groupLabel':Ri(_0x103d5f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x103d5f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x103d5f,'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':Ri(_0x103d5f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x103d5f,'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':Ri(_0x103d5f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x103d5f,'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':Ri(_0x103d5f,'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':Ri(_0x103d5f,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x103d5f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x103d5f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x103d5f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x103d5f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x103d5f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x103d5f,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x103d5f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x103d5f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x103d5f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x103d5f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x103d5f,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x103d5f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x103d5f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x103d5f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x103d5f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x103d5f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x103d5f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x103d5f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x103d5f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0x5686f0{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x39e488){super(_0x39e488),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x8c41e1){return this['sendRequest'](_0x8c41e1)['catch'](_0x2eff30=>{if(_0x2eff30 instanceof AIRequestError)return Promise['reject'](_0x2eff30);if('AbortError'==_0x2eff30['name'])return Promise['resolve']();throw console['error'](_0x2eff30),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x501dbe,_0xd0cacf){const _0x4de8ae=this['editor']['locale'],_0x101e1b={'Content-Type':'application/json'};if('object'==typeof _0x501dbe)Object['assign'](_0x101e1b,_0x501dbe);else{if(_0x501dbe)try{const _0x1f529a=await _0x501dbe(_0xd0cacf);Object['assign'](_0x101e1b,_0x1f529a);}catch{return Promise['reject'](new AIRequestError(Ri(_0x4de8ae,'AI_ERROR_GET_HEADERS')));}}return _0x101e1b;}async['_prepareRequestParameters'](_0x135c39,_0x5cba89){const _0x3be17a=this['editor']['locale'];if('object'==typeof _0x135c39)return _0x135c39;try{return await _0x135c39(_0x5cba89);}catch{return Promise['reject'](new AIRequestError(Ri(_0x3be17a,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xfd2e1a){super(_0xfd2e1a),_0xfd2e1a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xfd2e1a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0xfd2e1a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xfd2e1a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0xfd2e1a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0xfd2e1a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x577187,context:_0x5ce72d,onData:_0x357629,actionId:_0x3d1d63}){const _0x316206=this['editor']['locale'],_0x189a38=await this['prepareMessages'](_0x577187,_0x5ce72d,_0x3d1d63),_0x26bd40=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3d1d63),_0x1d6efc=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3d1d63),_0x1cc352={'messages':_0x189a38,..._0x1d6efc},_0x4d8761={'method':'POST','headers':_0x26bd40,'body':JSON['stringify'](_0x1cc352),'signal':this['abortController']['signal']},_0x6d1877=await fetch(this['_apiUrl'],_0x4d8761);if(_0x6d1877['ok'])return _0x1d6efc['stream']?await this['_readStreamableResponse'](_0x6d1877,_0x357629):await this['_readStaticResponse'](_0x6d1877,_0x357629),Promise['resolve']();{const _0x46c60b=await _0x6d1877['text']();return _0x46c60b['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Ri(_0x316206,'AI_ERROR_CONTEXT_LENGTH'))):_0x46c60b['includes']('Moderation')?Promise['reject'](new AIRequestError(Ri(_0x316206,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x46c60b));}}async['prepareMessages'](_0x116d04,_0x9643,_0x1e8487){let _0x3ac2c1,_0x451be1;return _0x9643?(_0x3ac2c1='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.',_0x451be1='Instruction:\x0a'+_0x116d04+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x9643):(_0x3ac2c1='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.',_0x451be1=_0x116d04),[{'role':'system','content':_0x3ac2c1},{'role':'user','content':_0x451be1}];}async['_readStreamableResponse'](_0x34ae6f,_0x39f454){const _0x11ab72=_0x34ae6f['body']['getReader'](),_0x237090=new TextDecoder();let _0xcf7835='',_0x21bd17='',_0x1b4f8b='',_0x28436a=!0x1;for(;!_0x28436a;){const {done:_0x3fb271,value:_0x49f9db}=await _0x11ab72['read'](),_0x2286e7=_0xcf7835+_0x237090['decode'](_0x49f9db);let _0x7e52a5='';_0x28436a=_0x3fb271;try{_0x7e52a5=this['_cleanUpData'](_0x2286e7),_0xcf7835='';}catch{_0xcf7835=_0x2286e7;continue;}_0x21bd17+=_0x7e52a5,!_0x28436a&&this['_isBufferIncomplete'](_0x21bd17)||_0x21bd17&&(_0x1b4f8b+=_0x21bd17,_0x21bd17='',_0x39f454(_0x1b4f8b));}return Promise['resolve']();}async['_readStaticResponse'](_0x46b54f,_0x33894d){return _0x33894d((await _0x46b54f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5ee30a){const _0x16ffe3=_0x5ee30a['split']('<')['length']!==_0x5ee30a['split']('>')['length'],_0x3849fe=_0x5ee30a['length']<0x1e;return _0x16ffe3&&_0x3849fe;}['_cleanUpData'](_0x5796eb){return _0x5796eb['split'](/\n(?![^{]*\})/g)['map'](_0x51cc46=>_0x51cc46['replace']('data:\x20',''))['filter'](_0x217014=>_0x217014&&_0x217014['length']>0x0&&'[DONE]'!==_0x217014)['map'](_0x3ad490=>{const {choices:_0x34f104}=JSON['parse'](_0x3ad490);if(_0x34f104[0x0]?.['delta']?.['content'])return _0x34f104[0x0]['delta']['content'];})['filter'](_0x454b29=>_0x454b29)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),gt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x5c105a){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends vt{constructor(_0x2c6f89,_0x1b8e9b={}){super(_0x2c6f89),this['isToggleable']=!0x0,this['set']('side',_0x1b8e9b['side']||'top');const _0x296df6=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x1b8e9b['class']||[]),_0x296df6['to']('side',_0x7ce0c9=>'ck-tab-button_'+_0x7ce0c9),_0x296df6['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x377b7a,_0x1abc4a={}){super(_0x377b7a);const _0x171855=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0x1abc4a['class']||[]),_0x171855['to']('class'),_0x171855['if']('isVisible','ck-hidden',_0x508bbb=>!_0x508bbb)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2c5d62,_0x411878={}){super(_0x2c5d62),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x411878['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x411878['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x1cfee4,_0x2c34e1)=>_0x1cfee4&&null!==_0x2c34e1);const _0x87699d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0x411878['class']||[]),_0x87699d['to']('side',_0x398f1f=>'ck-tabs_'+_0x398f1f),_0x87699d['to']('class'),_0x87699d['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x87699d['to']('activeTab',_0x286c37=>null===_0x286c37?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x87699d['to']('side',_0x365bd5=>'ck-tabs__buttons-container_'+_0x365bd5)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x87699d['to']('side',_0xc9d2fa=>'ck-tabs__panels-container_'+_0xc9d2fa)]},'children':this['panelViews']},...mt(_0x411878['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x18eaf4){const _0x3f9af9=this['_tabs']['get'](_0x18eaf4);return _0x3f9af9||null;}['addTab'](_0x119a21){const _0x36cc4b=this['_setupButton']({'id':_0x119a21['id'],'label':_0x119a21['buttonLabel'],'icon':_0x119a21['buttonIcon'],'order':_0x119a21['order']}),_0x437f57=new TabPanelView(this['locale']);return _0x437f57['render'](),_0x119a21['content']&&_0x437f57['children']['add'](_0x119a21['content']),this['panelViews']['add'](_0x437f57),this['_tabs']['set'](_0x119a21['id'],{'button':_0x36cc4b,'panel':_0x437f57,'order':void 0x0!==_0x119a21['order']?_0x119a21['order']:null}),this['fire']('addTab:'+_0x119a21['id'],{'id':_0x119a21['id'],'button':_0x36cc4b,'panel':_0x437f57}),null===this['activeTab']?this['activateTab'](_0x119a21['id']):this['_hidePanel'](_0x119a21['id']),{'button':_0x36cc4b,'panel':_0x437f57};}['activateTab'](_0x561968){if(null!==_0x561968&&!this['getTab'](_0x561968))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x561968});if(this['activeTab']===_0x561968)return;const _0x2d2e1d=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x561968,_0x561968&&this['_showPanel'](_0x561968),this['fire']('activateTab:'+_0x561968,{'newTab':_0x561968,'oldTab':_0x2d2e1d});}['toggleTabPanel'](_0x3c9bcb){if(!this['getTab'](_0x3c9bcb))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3c9bcb});this['activeTab']===_0x3c9bcb?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x3c9bcb);}['showTab'](_0x24c0db){if(!this['getTab'](_0x24c0db))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x24c0db});this['_showPanel'](_0x24c0db),this['_showButton'](_0x24c0db),this['fire']('show:'+_0x24c0db,_0x24c0db);}['hideTab'](_0x207d00){if(!this['getTab'](_0x207d00))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x207d00});const _0x2a7129=this['activeTab'];this['_hidePanel'](_0x207d00),this['_hideButton'](_0x207d00);const _0x1c3595=this['getTabIds']();_0x2a7129===_0x207d00&&_0x1c3595['length']>0x1&&this['activateTab'](_0x1c3595['find'](_0x3d5069=>_0x3d5069!==_0x207d00)),this['fire']('hide:'+_0x207d00,_0x207d00);}['_getPanel'](_0x2e2ea8){const _0x5aa033=this['_tabs']['get'](_0x2e2ea8);return _0x5aa033?_0x5aa033['panel']:null;}['_showPanel'](_0x1ed5c0){null!==this['activeTab']&&this['activeTab']!==_0x1ed5c0||this['_getPanel'](_0x1ed5c0)['show']();}['_hidePanel'](_0x2c5b0d){const _0x46bbf8=this['_getPanel'](_0x2c5b0d);_0x46bbf8['isVisible']&&(this['activeTab']===_0x2c5b0d&&(this['activeTab']=null),_0x46bbf8['hide']());}['_getButton'](_0x54b163){const _0xcc377e=this['_tabs']['get'](_0x54b163);return _0xcc377e?_0xcc377e['button']:null;}['_showButton'](_0x175b59){this['_getButton'](_0x175b59)['show']();}['_hideButton'](_0x2c78b6){this['_getButton'](_0x2c78b6)['hide']();}['_setupButton'](_0x3e7e10){const _0x167552=new TabButtonView(this['locale'],{'side':this['side']}),_0x92f697=this['buttonViews'];if(_0x167552['set']({'label':_0x3e7e10['label'],'icon':_0x3e7e10['icon'],'tooltip':!0x0,'withText':!0x0}),_0x167552['bind']('isOn')['to'](this,'activeTab',_0x7c70b1=>_0x7c70b1===_0x3e7e10['id']),_0x167552['bind']('side')['to'](this,'side'),_0x3e7e10['order']){const _0x3b60e6=[...this['_tabs']]['reduce']((_0x3dc489,_0x36d51e)=>{const _0x582cb8=_0x36d51e[0x0],{order:_0x1becfa}=_0x36d51e[0x1];return!_0x1becfa||_0x1becfa>_0x3e7e10['order']?_0x3dc489:_0x1becfa>=_0x3dc489['order']?{'id':_0x582cb8,'order':_0x1becfa}:_0x3dc489;},{'id':'','order':0x0}),_0x5c8ca1=_0x92f697['getIndex'](this['_getButton'](_0x3b60e6['id']));_0x92f697['add'](_0x167552,_0x5c8ca1+0x1);}else _0x92f697['add'](_0x167552);return _0x167552['on']('execute',()=>{this['toggleTabPanel'](_0x3e7e10['id']);}),_0x167552;}}const Vi=['overlay','sidebar','custom'],Pi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0xad84a4,_0x1cb377={}){super(_0xad84a4,_0x1cb377),this['set']('type',_0x1cb377['type']||'sidebar'),this['set']('side',_0x1cb377['side']||'right'),this['set']('isVisible',_0x1cb377['visibleByDefault']??!0x0);const _0x1cbf3d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1cbf3d['if']('type','ck-ai-tabs__overlay',_0x14a947=>'overlay'===_0x14a947),_0x1cbf3d['if']('type','ck-ai-tabs__sidebar',_0x227abb=>'sidebar'===_0x227abb),_0x1cbf3d['if']('isVisible','ck-hidden',_0x37013f=>!_0x37013f)]}}),this['buttonViews']['on']('add',(_0x5cb65f,_0x25caa8)=>{_0x25caa8['set']('withText',!0x1);});}}class AITabs extends _0x23f270{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2fc5e0){if(super(_0x2fc5e0),!this['context']['config']['get']('ai.container'))throw new at('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x564094=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x564094['showResizeButton']&&(this['showResizeButton']=_0x564094['showResizeButton']),'sidebar'!==_0x564094['type']&&'overlay'!==_0x564094['type']||_0x564094['side']&&(this['side']=_0x564094['side']),'sidebar'===_0x564094['type']){if(this['container']=_0x564094['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x564094['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x564094['visibleByDefault'],'collapsible':_0x564094['collapsible']}),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 _0x5ca812&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}['switchType'](_0x5064c9){if(_0x5064c9&&this['type']!==_0x5064c9){if(!Vi['includes'](_0x5064c9))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x5064c9;}}['switchSide'](_0x3f7e28){if(_0x3f7e28&&this['side']!==_0x3f7e28){if(!Pi['includes'](_0x3f7e28))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x3f7e28;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x23f270{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x5dd200];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x184ff4){super(_0x184ff4),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x3fc440=this['context']['plugins']['get'](_0x5dd200);if(!_0x3fc440['token'])throw new at('ai-missing-token',this);this['_token']=_0x3fc440['token'];}['startConversation'](_0x24b8ff,_0x42ad6d){const _0x1cdf1f=this['_sendApiRequest']('/conversations','POST',{'id':_0x24b8ff,'group':_0x42ad6d});return{'getConversation':async()=>(await _0x1cdf1f['request'])['json'](),'abortController':_0x1cdf1f['abortController']};}['queryAssistant']({message:_0x53fd0a,conversationId:_0x3324cf,parts:_0x3f0c06,capabilities:_0x5df35c,model:_0x951755,attributes:_0x1fbe55}){const _0x529a06={'prompt':_0x53fd0a,'content':_0x3f0c06,'model':_0x951755,..._0x5df35c&&{'capabilities':_0x5df35c},..._0x1fbe55&&{'attributes':_0x1fbe55}},_0x4425de=this['_sendApiRequest']('/conversations/'+_0x3324cf+'/messages','POST',_0x529a06);return{'getStream':async()=>{const _0x54ed75=(await _0x4425de['request'])['body'];return this['_getStreamReader'](_0x54ed75);},'abortController':_0x4425de['abortController']};}['executeCustomAction']({content:_0x126897,message:_0x57036f,model:_0x2e95fe,outputFormat:_0x3529b7}){const _0x474510={'content':[{'type':'text','content':_0x126897}],'prompt':_0x57036f,'model':_0x2e95fe,'outputFormat':_0x3529b7},_0x1aabb9=this['_sendApiRequest']('/actions/custom/calls','POST',_0x474510);return{'getStream':async()=>{const _0x5b508d=(await _0x1aabb9['request'])['body'];return this['_getStreamReader'](_0x5b508d);},'abortController':_0x1aabb9['abortController']};}['executeAction']({actionName:_0x4f5a75,content:_0x27144b,args:_0x317c9e}){const _0x6d4656={'content':[{'type':'text','content':_0x27144b}],'args':_0x317c9e},_0x3c68c4=this['_sendApiRequest']('/actions/system/'+_0x4f5a75+'/calls','POST',_0x6d4656);return{'getStream':async()=>{const _0x5a2cde=(await _0x3c68c4['request'])['body'];return this['_getStreamReader'](_0x5a2cde);},'abortController':_0x3c68c4['abortController']};}['uploadFile'](_0x4cdf01,_0x4ba827,_0x56848d){const _0x2f13f7=new FormData();_0x2f13f7['append']('file',_0x4ba827,_0x4ba827['name']),_0x56848d&&_0x2f13f7['append']('attributes',JSON['stringify'](_0x56848d));const _0x43d026=this['_sendApiRequest']('/conversations/'+_0x4cdf01+'/files','POST',_0x2f13f7);return{'getId':async()=>(await _0x43d026['request'])['json'](),'abortController':_0x43d026['abortController']};}['fetchDocument'](_0xb2427f,_0x3b222c){const _0x1cb590=this['_sendApiRequest']('/conversations/'+_0xb2427f+'/documents/'+_0x3b222c,'GET');return{'getDocument':async()=>(await _0x1cb590['request'])['json'](),'abortController':_0x1cb590['abortController']};}['uploadDocument'](_0x4a03fe,_0xc75557,_0xb0c7af){const _0x528cb4={'content':_0xc75557};_0xb0c7af&&(_0x528cb4['attributes']=_0xb0c7af);const _0x3db0dc=this['_sendApiRequest']('/conversations/'+_0x4a03fe+'/documents','POST',_0x528cb4);return{'getId':async()=>(await _0x3db0dc['request'])['json'](),'abortController':_0x3db0dc['abortController']};}['uploadDocuments'](_0x1a94ad,_0x43b2f7){const _0x1f10b8={'documents':_0x43b2f7['map'](_0x59ae40=>({'content':_0x59ae40['content'],'attributes':{'version':_0x59ae40['version'],'sessionId':_0x59ae40['sessionId'],'channelId':_0x59ae40['channelId'],'rootName':_0x59ae40['rootName'],'selections':_0x59ae40['selections']},...void 0x0!==_0x59ae40['name']?{'name':_0x59ae40['name']}:{},...void 0x0!==_0x59ae40['description']?{'description':_0x59ae40['description']}:{}}))},_0x253bdc=this['_sendApiRequest']('/conversations/'+_0x1a94ad+'/documents/batch','POST',_0x1f10b8);return{'getIds':async()=>(await _0x253bdc['request'])['json'](),'abortController':_0x253bdc['abortController']};}['fetchDocuments'](_0x3cc782,_0x5603e9){const _0x411afc=new URLSearchParams();_0x411afc['append']('documentIds',_0x5603e9['join'](','));const _0x519cd2=this['_sendApiRequest']('/conversations/'+_0x3cc782+'/documents/batch?'+_0x411afc['toString'](),'GET');return{'getDocuments':async()=>(await _0x519cd2['request'])['json'](),'abortController':_0x519cd2['abortController']};}['fetchConversations'](_0x19ab47,_0x27ce15={}){const _0x3b8cd9=new URLSearchParams();_0x3b8cd9['append']('group',_0x19ab47),_0x3b8cd9['append']('excludeEmpty',!0x1!==_0x27ce15['excludeEmpty']?'true':'false'),_0x3b8cd9['append']('limit',_0x27ce15['limit']?_0x27ce15['limit']['toString']():'100'),_0x3b8cd9['append']('sortBy',_0x27ce15['sortBy']?_0x27ce15['sortBy']:'createdAt'),_0x3b8cd9['append']('order',_0x27ce15['order']?_0x27ce15['order']:'desc');const _0x393730=this['_sendApiRequest']('/conversations?'+_0x3b8cd9['toString'](),'GET');return{'getConversations':async()=>{const _0x3b6b6b=await _0x393730['request'];return(await _0x3b6b6b['json']())['items'];},'abortController':_0x393730['abortController']};}['deleteConversation'](_0x256de7){const _0xfb4575=this['_sendApiRequest']('/conversations/'+_0x256de7,'DELETE');return{'execute':async()=>{await _0xfb4575['request'];},'abortController':_0xfb4575['abortController']};}['updateConversation'](_0x58c663,_0x3443c){const _0x3b4568=this['_sendApiRequest']('/conversations/'+_0x58c663,'PATCH',_0x3443c);return{'getResult':async()=>(await _0x3b4568['request'],_0x3443c),'abortController':_0x3b4568['abortController']};}['fetchConversation'](_0x318759){const _0x360b28=this['_sendApiRequest']('/conversations/'+_0x318759,'GET');return{'getConversation':async()=>(await _0x360b28['request'])['json'](),'abortController':_0x360b28['abortController']};}['fetchConversationMessages'](_0x4d16bf){const _0x307715=this['_sendApiRequest']('/conversations/'+_0x4d16bf+'/messages','GET');return{'getMessages':async()=>{const _0x507250=await _0x307715['request'];return(await _0x507250['json']())['items'];},'abortController':_0x307715['abortController']};}['uploadUrl'](_0x1fb937,_0x58a80a,_0x15712a){const _0x40697f=this['_sendApiRequest']('/conversations/'+_0x1fb937+'/web-resources','POST',{'url':_0x58a80a,'attributes':_0x15712a});return{'getId':async()=>(await _0x40697f['request'])['json'](),'abortController':_0x40697f['abortController']};}['getModels'](_0x281bc2='en'){const _0x53a0ef=new URLSearchParams();_0x53a0ef['append']('language',_0x281bc2);const _0x83ec9b='/models/1?'+_0x53a0ef['toString'](),_0xcc604a=this['_sendApiRequest'](_0x83ec9b,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0xcc604a['request'])['json'](),'abortController':_0xcc604a['abortController']};}['deleteFile'](_0x3f3ec6,_0x130591){const _0x2f587e=this['_sendApiRequest']('/conversations/'+_0x3f3ec6+'/files/'+_0x130591,'DELETE');return{'execute':async()=>{await _0x2f587e['request'];},'abortController':_0x2f587e['abortController']};}['deleteDocument'](_0x1ad6bc,_0x395675){const _0x5a43fc=this['_sendApiRequest']('/conversations/'+_0x1ad6bc+'/documents/'+_0x395675,'DELETE');return{'execute':async()=>{await _0x5a43fc['request'];},'abortController':_0x5a43fc['abortController']};}['deleteWebResource'](_0x36ce8c,_0x113488){const _0x176a7f=this['_sendApiRequest']('/conversations/'+_0x36ce8c+'/web-resources/'+_0x113488,'DELETE');return{'execute':async()=>{await _0x176a7f['request'];},'abortController':_0x176a7f['abortController']};}['callSystemReview']({reviewName:_0x108e9b,content:_0x12273e,args:_0x42a079}){const _0x2e6872=this['_sendApiRequest']('/reviews/system/'+_0x108e9b+'/calls','POST',{'content':[{'type':'text','content':_0x12273e}],'args':_0x42a079});return{'getStream':async()=>{const _0x455b41=(await _0x2e6872['request'])['body'];return this['_getStreamReader'](_0x455b41);},'abortController':_0x2e6872['abortController']};}['callCustomReview']({content:_0x4c9287,prompt:_0xde200f,model:_0x448d16}){const _0x454dd0=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x4c9287}],'prompt':_0xde200f,'model':_0x448d16});return{'getStream':async()=>{const _0x4e2a90=(await _0x454dd0['request'])['body'];return this['_getStreamReader'](_0x4e2a90);},'abortController':_0x454dd0['abortController']};}['upsertAIChatRating'](_0x25641c,_0x43e16b,_0x27cf76){const _0x4e88f9=this['_sendApiRequest']('/conversations/'+_0x25641c+'/messages/'+_0x43e16b+'/ratings','PUT',{'positiveCount':_0x27cf76['positiveCount'],'totalCount':_0x27cf76['totalCount'],'modificationId':_0x27cf76['modificationId']});return{'execute':async()=>{await _0x4e88f9['request'];},'abortController':_0x4e88f9['abortController']};}['upsertAIActionRating'](_0x1b2f34,_0x2e081a,_0x35d451){const _0x10abc7=this['_sendApiRequest']('/actions/system/'+_0x1b2f34+'/calls/'+_0x2e081a+'/ratings','PUT',{'positiveCount':_0x35d451['positiveCount'],'totalCount':_0x35d451['totalCount']});return{'execute':async()=>{await _0x10abc7['request'];},'abortController':_0x10abc7['abortController']};}['upsertCustomAIActionRating'](_0x27fb4c,_0x3340e3){const _0x47f61b=this['_sendApiRequest']('/actions/custom/calls/'+_0x27fb4c+'/ratings','PUT',{'positiveCount':_0x3340e3['positiveCount'],'totalCount':_0x3340e3['totalCount']});return{'execute':async()=>{await _0x47f61b['request'];},'abortController':_0x47f61b['abortController']};}['upsertAIReviewRating'](_0x252b23,_0x23681d,_0x3a1e47,_0x1e7e79){const _0x23ffa3=this['_sendApiRequest']('/reviews/system/'+_0x252b23+'/calls/'+_0x23681d+'/ratings','PUT',{'positiveCount':_0x3a1e47['positiveCount'],'totalCount':_0x3a1e47['totalCount'],'dataId':_0x1e7e79});return{'execute':async()=>{await _0x23ffa3['request'];},'abortController':_0x23ffa3['abortController']};}['upsertCustomAIReviewRating'](_0x28ba60,_0x70bc3f,_0x2566c8){const _0x3f340c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x28ba60+'/ratings','PUT',{'positiveCount':_0x70bc3f['positiveCount'],'totalCount':_0x70bc3f['totalCount'],'dataId':_0x2566c8});return{'execute':async()=>{await _0x3f340c['request'];},'abortController':_0x3f340c['abortController']};}['_sendApiRequest'](_0x2ef64e,_0x9208e0,_0x1965b3,_0x373ba5=!0x1){const _0x58ad39=new AbortController(),_0x3e6ee4=_0x373ba5?_0x9208e0+':'+_0x2ef64e:null;if(_0x3e6ee4){const _0x445f38=this['_responseCache']['get'](_0x3e6ee4);if(_0x445f38)return{'request':_0x445f38['then'](_0x592cce=>_0x592cce['clone']()),'abortController':_0x58ad39};}const _0x133a7e=_0x1965b3 instanceof FormData,_0x8dbc6a={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x1965b3&&!_0x133a7e&&(_0x8dbc6a['Content-Type']='application/json');const _0x2f8ca4={'method':_0x9208e0,'headers':_0x8dbc6a,'signal':_0x58ad39['signal']};_0x1965b3&&(_0x2f8ca4['body']=_0x133a7e?_0x1965b3:JSON['stringify'](_0x1965b3));const _0xaa1f5e=fetch(''+this['_apiUrl']+_0x2ef64e,_0x2f8ca4)['catch'](_0x46368e=>{_0x3e6ee4&&this['_responseCache']['delete'](_0x3e6ee4),this['_handleError'](_0x46368e);})['then'](_0x2dfc03=>_0x2dfc03['ok']?_0x2dfc03:_0x2dfc03['json']()['then'](_0x3aa3cb=>{throw _0x3e6ee4&&this['_responseCache']['delete'](_0x3e6ee4),{'url':this['_apiUrl'],'path':_0x2ef64e,'method':_0x9208e0,'body':_0x1965b3,'status':(_0x2dfc03||{})['status'],'statusText':(_0x2dfc03||{})['statusText'],'code':_0x3aa3cb['code'],'message':_0x3aa3cb['message'],'traceId':_0x3aa3cb['traceId']};}));return _0x3e6ee4&&this['_responseCache']['set'](_0x3e6ee4,_0xaa1f5e['then'](_0x5d624c=>_0x5d624c['clone']())),{'request':_0xaa1f5e,'abortController':_0x58ad39};}async*['_getStreamReader'](_0x1c0a3f){const _0x5a6080=[],_0x58c250=_0x1c0a3f['getReader'](),_0x24deb7=_0x3df424({'onError':_0x310629=>{this['_handleError'](_0x310629);},'onEvent':_0x2a3e99=>{_0x2a3e99['data']=JSON['parse'](_0x2a3e99['data']),_0x5a6080['push'](_0x2a3e99);}});try{let _0x32e5b5=!0x1;for(;!_0x32e5b5;){const {done:_0xb0566,value:_0x4e27e7}=await _0x58c250['read']();_0xb0566&&(_0x32e5b5=!0x0),_0x24deb7['feed'](this['_decoder']['decode'](_0x4e27e7,{'stream':!0x0})),yield*_0x5a6080,_0x5a6080['length']=0x0;}}catch(_0x24d9d5){this['_handleError'](_0x24d9d5);}finally{_0x58c250['releaseLock'](),_0x24deb7['reset']();}}['_handleError'](_0x23bb91){if(_0x23bb91 instanceof at)throw _0x23bb91;if(_0x23bb91 instanceof Error&&'AbortError'===_0x23bb91['name'])throw new at('ai-request-aborted',this,{'originalError':_0x23bb91});throw new at('ai-request-failed',this,{'originalError':_0x23bb91});}}function Hi(_0x536c7b,_0x1fd075,_0x5b025e){const t=_0x536c7b['t'];switch(_0x1fd075){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'},_0x5b025e);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x5b025e);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.'},_0x5b025e);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x5b025e);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR','string':'AI\x20is\x20preparing\x20a\x20response...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x5b025e);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x5b025e);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x5b025e);case'AI_CHAT_MODEL_SELECTOR_GROUP':return t({'id':'AI_CHAT_MODEL_SELECTOR_GROUP','string':'Models'});case'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP','string':'Select\x20a\x20model'});case'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP':return t({'id':'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP','string':'Start\x20a\x20new\x20conversation\x20to\x20change\x20the\x20model'});case'AI_CHAT_CAPABILITIES_YES':return t({'id':'AI_CHAT_CAPABILITIES_YES','string':'Yes'});case'AI_CHAT_CAPABILITIES_NO':return t({'id':'AI_CHAT_CAPABILITIES_NO','string':'No'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x5b025e);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.'},_0x5b025e);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.'},_0x5b025e);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.'},_0x5b025e);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'},_0x5b025e);case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x5b025e);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_ACCEPT_CHANGE':return t({'id':'AI_REVIEW_MODE_ACCEPT_CHANGE','string':'Accept'});case'AI_REVIEW_MODE_DISMISS_CHANGE':return t({'id':'AI_REVIEW_MODE_DISMISS_CHANGE','string':'Dismiss'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_CHECK_CUSTOM_TITLE':return t({'id':'AI_REVIEW_CHECK_CUSTOM_TITLE','string':'Custom\x20command'});case'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CUSTOM_DESCRIPTION','string':'Enter\x20a\x20custom\x20command\x20for\x20a\x20specific\x20review.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Proofread'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Check\x20the\x20text\x20for\x20errors\x20in\x20grammar,\x20spelling,\x20and\x20punctuation.'});case'AI_REVIEW_CHECK_CLARITY_TITLE':return t({'id':'AI_REVIEW_CHECK_CLARITY_TITLE','string':'Improve\x20clarity'});case'AI_REVIEW_CHECK_CLARITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CLARITY_DESCRIPTION','string':'Improve\x20the\x20logical\x20structure\x20and\x20precision\x20for\x20clearer\x20message.'});case'AI_REVIEW_CHECK_READABILITY_TITLE':return t({'id':'AI_REVIEW_CHECK_READABILITY_TITLE','string':'Improve\x20readability'});case'AI_REVIEW_CHECK_READABILITY_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_READABILITY_DESCRIPTION','string':'Adjust\x20sentence\x20structure\x20and\x20word\x20choice\x20for\x20an\x20easier\x20read.'});case'AI_REVIEW_CHECK_MAKE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TITLE','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_DESCRIPTION','string':'Shorten\x20or\x20lengthen\x20the\x20text\x20as\x20needed.'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_LABEL','string':'Adjust\x20length'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_LONGER','string':'Longer'});case'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER':return t({'id':'AI_REVIEW_CHECK_MAKE_OPTIONS_DATA_SHORTER','string':'Shorter'});case'AI_REVIEW_CHECK_MAKE_TONE_TITLE':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_TITLE','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_DESCRIPTION','string':'Modify\x20the\x20text\x20to\x20a\x20desired\x20tone\x20and\x20style.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE','string':'This\x20conversation\x20is\x20loaded\x20from\x20chat\x20history\x20from\x20a\x20previous\x20session,\x20so\x20you\x20can’t\x20apply,\x20reject,\x20or\x20suggest\x20changes.'});case'AI_SUGGESTION_DISABLED_FEED_MESSAGE':return t({'id':'AI_SUGGESTION_DISABLED_FEED_MESSAGE','string':'Actions\x20aren’t\x20available\x20for\x20changes\x20from\x20a\x20previous\x20session.'});default:return _0x1fd075;}}const Mi='ck-ai-button-primary',Ui='ck-ai-button-secondary',Bi='ck-ai-button-tertiary';function Gi(_0x4b09b8,_0x53e27d){const _0x250f69=new vt(_0x4b09b8),_0x31d70b=Hi(_0x4b09b8,'AI_TABS_LABEL_MINIMIZE'),_0x1da145=Hi(_0x4b09b8,'AI_TABS_LABEL_MAXIMIZE');return _0x250f69['set']({'withText':!0x1,'icon':_0x5822e5,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Bi}),_0x250f69['bind']('label')['to'](_0x53e27d,'isMaximized',_0xb10bb4=>_0xb10bb4?_0x31d70b:_0x1da145),_0x250f69['bind']('icon')['to'](_0x53e27d,'isMaximized',_0x1e6aa0=>_0x1e6aa0?_0x494a35:_0x5822e5),_0x250f69['bind']('isOn')['to'](_0x53e27d,'isMaximized'),_0x250f69['on']('execute',()=>{_0x53e27d['fire']('resizeTabs');}),_0x250f69;}function Fi(_0x564ef5){return _0x56717f(_0x564ef5);}function Ki(_0xfd8e9b){return ti(_0xfd8e9b);}function Wi(_0x1a5165,_0x542291,_0x20cc70){const _0x57cc11=null!==_0x542291?_0x4ba3ec=>_0x4ba3ec['attribs'][_0x1a5165]===_0x542291:_0x369359=>Boolean(_0x369359['attribs'][_0x1a5165]);return _0x4e94ee(_0x35f480=>_0x4e8462(_0x35f480)&&_0x57cc11(_0x35f480),_0x20cc70);}function Yi(_0x5a79c9,_0x3e80fa,_0x260db4){const _0x4f076f=null!==_0x3e80fa?_0x4e7958=>_0x4e7958['attribs'][_0x5a79c9]===_0x3e80fa:_0x5d31fc=>Boolean(_0x5d31fc['attribs'][_0x5a79c9]);return _0x2c9ab8(_0x555007=>_0x4e8462(_0x555007)&&_0x4f076f(_0x555007),_0x260db4);}function $i(_0x167c23,_0x4ff89a){return _0x167c23&&_0x4e8462(_0x167c23)?_0x167c23['attribs'][_0x4ff89a]:null;}function qi(_0x22c39c,_0x3ee3e3,_0x12edeb){_0x4e8462(_0x22c39c)&&(null===_0x12edeb?delete _0x22c39c['attribs'][_0x3ee3e3]:_0x22c39c['attribs'][_0x3ee3e3]=_0x12edeb);}function Qi(_0x451a8e,_0x5a3b36,_0x39639e){const _0x3d0dae=_0x5a3b36['cloneNode'](!0x0);'beforebegin'===_0x39639e?_0x51f634(_0x451a8e,_0x3d0dae):'afterbegin'===_0x39639e?_0x59f22f(_0x451a8e,_0x3d0dae):'beforeend'===_0x39639e?_0x4c46bc(_0x451a8e,_0x3d0dae):'afterend'===_0x39639e&&_0x5a70f4(_0x451a8e,_0x3d0dae);}function Xi(_0x5b6eaf){const _0x148419=[];let _0x399b74=_0x5b6eaf;for(;_0x399b74;)_0x399b74=_0xe83088(_0x399b74),_0x399b74&&_0x148419['push'](_0x399b74);return _0x148419;}function zi(_0x8d33ba){return _0x8d33ba['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ji(_0x480580){let _0x21a646=0x0;for(;_0x480580['parentNode'];)_0x480580=_0x480580['parentNode'],_0x21a646++;return _0x21a646;}function Ji(_0x311b16){const _0x2b227d=[];let _0x3685c3=_0x311b16['nextSibling'];for(;_0x3685c3;)_0x2b227d['push'](_0x3685c3),_0x3685c3=_0x3685c3['nextSibling'];_0x2b227d['forEach'](_0x3fc216=>{_0x32f2bc(_0x3fc216);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ht(){['_m2html'];constructor(){super();const _0x32ca41=Object['entries'](_0x3ceff7),_0x2f2c38=_0x32ca41['findIndex'](([_0x13b561])=>'rehypeDomRaw'===_0x13b561);if(-0x1===_0x2f2c38)throw new at('ai-response-parser-unable-to-set-up-parser');_0x32ca41['splice'](_0x2f2c38+0x1,0x0,['rehypeSanitize',_0xec741]),this['_m2html']=new _0xc438b({'plugins':Object['fromEntries'](_0x32ca41)});}['convertMarkdownToHTML'](_0x5c0f2b){const _0x192249=this['_m2html']['parse'](_0x5c0f2b);return this['parseAndNormalizeHTML'](_0x192249);}['parseAndNormalizeHTML'](_0x24cbc8){return this['_parseHTML'](_0x24cbc8);}['_parseHTML'](_0x844625){const _0x4dc3f1=Fi('<dummy>'+_0x844625['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4dc3f1['children']=_0x4dc3f1['children'][0x0]['children'],_0x4dc3f1;}}class AIResponseApplier extends/* #__PURE__ -- @preserve */
|
|
26
|
-
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x53a25f){super(),this['_generateUid']=_0x53a25f||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5cceee,_0x30d856,_0x2203fb){this['_uidCounter']=0x0;const _0x2c0227=_0x5cceee['cloneNode'](!0x0),_0x201f0d=_0x2c0227['childNodes'],_0x5e5b67=Array['from'](_0x201f0d)['filter'](_0x2efbb9=>!(0x3===_0x2efbb9['nodeType']&&''===Ki(_0x2efbb9)['trim']())),_0x382308=_0x5e5b67['length'],_0x4bc5b8=new Map();for(const _0x243c67 of _0x5e5b67)_0x243c67&&_0x4e8462(_0x243c67)&&void 0x0===_0x243c67['attribs']['data-id']&&qi(_0x243c67,'data-id','new-element');if(0x0===_0x30d856['childNodes']['length']){const _0x3dd293=[];return Yi('data-id','new-element',_0x2c0227)['forEach'](_0xde7aa6=>{const _0x2111ad=this['_generateUid']();qi(_0xde7aa6,'data-id',_0x2111ad),_0x3dd293['push'](_0x2111ad);}),this['_removeSpecialComments'](_0x2c0227),{'parsedContent':_0x2c0227,'newNodeIds':_0x3dd293,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x4bc5b8};}_0x2203fb&&_0x2203fb['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2c0227),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Yi('data-id',null,_0x30d856)['map'](_0xaccad5=>$i(_0xaccad5,'data-id'))['filter'](_0x30cf9e=>!!_0x30cf9e));let _0x2ea4a9=-0x1,_0x16fb72=!0x1;for(let _0x3489aa=0x0;_0x3489aa<_0x382308;_0x3489aa++){const _0x2c2560=_0x5e5b67[_0x3489aa],_0x3cce67=_0x5e5b67[_0x3489aa+0x1];if(this['_isNewNode'](_0x2c2560)){if(-0x1===_0x2ea4a9&&(_0x2ea4a9=_0x3489aa),this['_markWrappedElements'](_0x2c2560),!this['_isNewNode'](_0x3cce67)){const [_0x195ab1,_0x37ddda]=this['_findReferenceNode'](_0x2c2560,_0x16fb72,_0x30d856);if(_0x195ab1){const _0x3c9329=Array['from'](_0x5e5b67)['slice'](_0x2ea4a9,_0x3489aa+0x1),_0x1a2a09=$i(_0x195ab1,'data-id');if(this['_insertNodes'](_0x195ab1,_0x3c9329,_0x37ddda),_0x1a2a09)for(const _0x100a7b of _0x3c9329){const _0x22b6a4=$i(_0x100a7b,'data-id');_0x22b6a4&&_0x4bc5b8['set'](_0x22b6a4,_0x1a2a09);}_0x2ea4a9=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2c2560))_0x16fb72=!0x0;else{if(this['_isExistingNode'](_0x2c2560)){const _0x2f1594=$i(_0x2c2560,'data-id');if(_0x2f1594&&this['_existingDataIds']['has'](_0x2f1594)){const _0x4c2d6a=Wi('data-id',_0x2f1594,_0x30d856);this['_replaceNode'](_0x4c2d6a,_0x2c2560);}}else{if(this['_isDelNode'](_0x2c2560)){const _0x361040=this['_getNodeDataId'](_0x2c2560);!!Wi('data-id',_0x361040,_0x2c0227)||this['_touchedNodesState']['removedIds']['push'](_0x361040);}}}}}for(const _0x396577 of this['_touchedNodesState']['removedIds']){const _0x3d76cf=Wi('data-id',_0x396577,_0x30d856);_0x3d76cf&&this['_removeNode'](_0x3d76cf,_0x396577,_0x2203fb);}if(Yi('data-id','new-element',_0x30d856)['forEach'](_0x1b82ac=>{const _0x5869d0=this['_getUid'](_0x1b82ac);qi(_0x1b82ac,'data-id',_0x5869d0),this['_touchedNodesState']['newIds']['push'](_0x5869d0);}),this['_removeSpecialComments'](_0x30d856),_0x2203fb&&_0x2203fb['markUnstableElements']&&this['_markUnstableElements'](_0x30d856,_0x2203fb['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x30d856,_0x2203fb),_0x2203fb&&_0x2203fb['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x149204=Yi('data-id',this['_touchedNodesState']['lastTouchedId'],_0x30d856);let _0x34a795=_0x149204[_0x149204['length']-0x1];for(;_0x34a795;)Ji(_0x34a795),_0x34a795=_0x34a795['parentNode'];}return{'parsedContent':_0x30d856,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x4bc5b8};}['_insertNodes'](_0x5e3611,_0x30ca33,_0x42a18d){for(const _0xd318ba of _0x30ca33){const _0x29dc97=this['_getUid'](_0xd318ba);qi(_0xd318ba,'data-id',_0x29dc97),this['_touchedNodesState']['newIds']['push'](_0x29dc97),this['_touchedNodesState']['lastTouchedId']=_0x29dc97;}const _0xe97452='afterbegin'===_0x42a18d||'afterend'===_0x42a18d?_0x30ca33['reverse']():_0x30ca33;for(const _0x50245a of _0xe97452)Qi(_0x5e3611,_0x50245a,_0x42a18d);}['_replaceNode'](_0x385bf9,_0x3aed63){if(!_0x385bf9)return;if(_0x26be68=_0x3aed63,zi(Ki(_0x385bf9))===zi(Ki(_0x26be68)))return;var _0x26be68;const _0x482f51=this['_getUid'](_0x385bf9);qi(_0x3aed63,'data-id',_0x482f51),this['_touchedNodesState']['modifiedIds']['push'](_0x482f51),this['_touchedNodesState']['lastTouchedId']=_0x482f51,_0x118b57(_0x385bf9,_0x3aed63['cloneNode'](!0x0));}['_removeNode'](_0x3a17d3,_0x31fb99,_0x3ce3fc){if(_0x3ce3fc&&_0x3ce3fc['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x31fb99;const _0x4d3834=_0x3ce3fc['replaceRemovedWith']['cloneNode'](!0x0);qi(_0x4d3834,'data-id',_0x31fb99),qi(_0x4d3834,'data-removed','true'),_0x118b57(_0x3a17d3,_0x4d3834);}else _0x32f2bc(_0x3a17d3);}['_findReferenceNode'](_0x3d6f8b,_0x36f10e,_0x2c79ec){const _0x53f596=this['_findPrevElementWithDataId'](_0x3d6f8b,!0x1);if(_0x53f596){const _0x146732=this['_getNodeDataId'](_0x53f596),_0x5f1b15=Wi('data-id',_0x146732,_0x2c79ec);if(_0x5f1b15)return[_0x5f1b15,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x146732);}const _0x10ab1c=this['_findNextElementWithDataId'](_0x3d6f8b,!0x1);if(_0x10ab1c){const _0x472807=this['_getNodeDataId'](_0x10ab1c),_0x52dd57=Wi('data-id',_0x472807,_0x2c79ec);if(_0x52dd57)return[_0x52dd57,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x472807);}return _0x36f10e?_0x3d6f8b['nextSibling']?this['_findFallbackReferenceNode'](_0x3d6f8b,_0x2c79ec):[_0x2c79ec['childNodes'][_0x2c79ec['childNodes']['length']-0x1],'afterend']:[_0x2c79ec['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x4b19d5,_0x5af29d){const _0x314a3b=[],_0x1936e0=this['_findPrevElementWithDataId'](_0x4b19d5,!0x0);if(_0x1936e0){const _0x368c15=Wi('data-id',this['_getNodeDataId'](_0x1936e0),_0x5af29d);_0x368c15&&_0x314a3b['push']([_0x368c15,'afterend']);}const _0x15888c=this['_findNextElementWithDataId'](_0x4b19d5,!0x0);if(_0x15888c){const _0xc523fb=Wi('data-id',this['_getNodeDataId'](_0x15888c),_0x5af29d);_0xc523fb&&_0x314a3b['push']([_0xc523fb,'beforebegin']);}if(_0x314a3b['length']>0x1)return ji(_0x314a3b[0x0][0x0])<=ji(_0x314a3b[0x1][0x0])?_0x314a3b[0x0]:_0x314a3b[0x1];return 0x1===_0x314a3b['length']?_0x314a3b[0x0]:[_0x5af29d['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x4fceab,_0x17d1f9){let _0x51c82d=_0x4fceab['nextSibling'],_0xe4b9b4=null,_0x3a3a0d=!0x1;for(;_0x51c82d;){if(_0x468d05(_0x51c82d)){if(this['_isDelNode'](_0x51c82d)&&(_0xe4b9b4=_0x51c82d),this['_isExistingContentComment'](_0x51c82d)&&_0x17d1f9&&!_0x3a3a0d){_0x3a3a0d=!0x0,_0x51c82d=_0x51c82d['nextSibling'];continue;}break;}const _0x25f4df=$i(_0x51c82d,'data-id');if(_0x25f4df&&'new-element'!==_0x25f4df&&this['_existingDataIds']['has'](_0x25f4df)){_0xe4b9b4=_0x51c82d;break;}_0x51c82d=_0x51c82d['nextSibling'];}return _0xe4b9b4;}['_findPrevElementWithDataId'](_0x233bb1,_0x34602a){let _0x1f4dce=_0x233bb1['previousSibling'],_0x5b2a28=null,_0xe91231=!0x1;for(;_0x1f4dce;){if(_0x468d05(_0x1f4dce)){if(this['_isDelNode'](_0x1f4dce)&&(_0x5b2a28=_0x1f4dce),this['_isExistingContentComment'](_0x1f4dce)&&_0x34602a&&!_0xe91231){_0xe91231=!0x0,_0x1f4dce=_0x1f4dce['previousSibling'];continue;}break;}const _0x3d2b98=$i(_0x1f4dce,'data-id');if(_0x3d2b98&&'new-element'!==_0x3d2b98&&this['_existingDataIds']['has'](_0x3d2b98)){_0x5b2a28=_0x1f4dce;break;}_0x1f4dce=_0x1f4dce['previousSibling'];}return _0x5b2a28;}['_markWrappedElements'](_0x186ccf){_0x4e8462(_0x186ccf)&&Yi('data-id',null,_0x186ccf)['forEach'](_0x240bba=>{this['_isExistingNode'](_0x240bba)&&(qi(_0x240bba,'data-wrapped-id',$i(_0x240bba,'data-id')),qi(_0x240bba,'data-id',null));});}['_processWrappedElements'](_0x28ede0,_0x26fa07){Yi('data-wrapped-id',null,_0x28ede0)['forEach'](_0x1b8ce1=>{const _0x1297ac=$i(_0x1b8ce1,'data-wrapped-id');if($i(_0x1b8ce1,'data-unstable')||this['_hasUnstableParent'](_0x1b8ce1))return;const _0x35ac84=Wi('data-id',_0x1297ac,_0x28ede0);qi(_0x1b8ce1,'data-id',_0x1297ac),qi(_0x1b8ce1,'data-wrapped-id',null),_0x35ac84&&(this['_removeNode'](_0x35ac84,_0x1297ac,_0x26fa07),this['_touchedNodesState']['removedIds']['push'](_0x1297ac),this['_touchedNodesState']['lastTouchedId']=_0x1297ac);});}['_hasUnstableParent'](_0x3d5bfd){let _0x343f49=_0x3d5bfd['parentNode'];for(;_0x343f49;){if($i(_0x343f49,'data-unstable'))return!0x0;_0x343f49=_0x343f49['parentNode'];}return!0x1;}['_getNodeDataId'](_0x241548){if(!_0x241548)return null;if(_0x4e8462(_0x241548))return $i(_0x241548,'data-id');if(_0x468d05(_0x241548)){const _0x5a4ce6=Ki(_0x241548)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5a4ce6&&_0x5a4ce6[0x1])return _0x5a4ce6[0x1];}return null;}['_getUid'](_0x47f491){return this['_isExistingNode'](_0x47f491)?$i(_0x47f491,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x478d4d){(function(_0x30d2e1){return _0x592842(_0x239249=>_0x468d05(_0x239249),_0x30d2e1,!0x0,0x1/0x0);}(_0x478d4d)['filter'](_0xc721ed=>this['_isDelNode'](_0xc721ed)||this['_isExistingContentComment'](_0xc721ed))['forEach'](_0x365098=>{_0x32f2bc(_0x365098);}));}['_markLastTagElementUnstable'](_0x23623f){const _0x51738e=_0x23623f['childNodes'],_0x24cf1b=_0x51738e[_0x51738e['length']-0x1];_0x24cf1b&&_0x4e8462(_0x24cf1b)&&qi(_0x24cf1b,'data-unstable','true');}['_markUnstableElements'](_0x2f991e,_0x2455da){const _0xc1dbc3=Wi('data-unstable','true',_0x2f991e);if(!_0xc1dbc3)return;const _0x13779e=Xi(_0xc1dbc3)['slice'](0x0,-0x1),_0x5c122e=_0x13779e['length'];let _0x50521e=_0xc1dbc3;if(_0x5c122e>_0x2455da){let _0x5dca44=_0x5c122e,_0x49f653=null;for(;_0x5dca44>_0x2455da&&_0x5dca44>=0x0;)_0x5dca44--,_0x49f653=_0x13779e[_0x5dca44];_0x49f653&&(_0x50521e=_0x49f653,qi(_0xc1dbc3,'data-unstable',null),qi(_0x49f653,'data-unstable','true'));}else{if(_0x5c122e<_0x2455da){let _0x4de3bb=_0x5c122e,_0x3a48c5=_0xc1dbc3;for(;_0x4de3bb<_0x2455da;){const _0x418e0a=_0x3a48c5['childNodes']['filter'](_0xdf5d70=>_0x4e8462(_0xdf5d70));if(0x0===_0x418e0a['length'])break;_0x4de3bb++,_0x3a48c5=_0x418e0a[_0x418e0a['length']-0x1];}_0x3a48c5&&(_0x50521e=_0x3a48c5,qi(_0xc1dbc3,'data-unstable',null),qi(_0x3a48c5,'data-unstable','true'));}}let _0x4f953a=_0x50521e;for(;_0x4f953a;){for(;_0x4f953a['nextSibling'];)_0x4f953a=_0x4f953a['nextSibling'],_0x4e8462(_0x4f953a)&&qi(_0x4f953a,'data-unstable','true');_0x4f953a=_0x4f953a['parentNode'];}}['_isNewNode'](_0x1b9842){return Boolean('new-element'===$i(_0x1b9842,'data-id'));}['_isExistingNode'](_0x4227b0){return Boolean(($i(_0x4227b0,'data-id')||'')['length']>0x0&&'new-element'!==$i(_0x4227b0,'data-id'));}['_isDelNode'](_0x7c306f){return!!_0x7c306f&&Boolean(_0x468d05(_0x7c306f)&&Ki(_0x7c306f)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0xeca37b){return Boolean(_0x468d05(_0xeca37b)&&Ki(_0xeca37b)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Zi({editor:_0x3b0330,changeGroups:_0x550dfc,documentContextContent:_0x244be0,showDiff:_0x756c3,trimUnchanged:_0x5eae7e=!0x0}){return _0x550dfc['map'](_0x503d09=>{const _0x5d8e6a=new _0x34e0db([]),_0xd3f683=new _0x34e0db([]),_0x32a964=new Set();for(const _0x51984c of _0x503d09['changes'])'new'==_0x51984c['type']&&Yi('data-id',null,_0x51984c['node'])['forEach'](_0x59a0bb=>{_0x32a964['add']($i(_0x59a0bb,'data-id'));});for(const _0x131e27 of _0x503d09['changes'])if('removed'!=_0x131e27['type']?_0xd3f683['children']['push'](_0x131e27['node']['cloneNode'](!0x0)):_0x756c3||_0x32a964['has'](_0x131e27['id'])||_0xd3f683['children']['push'](_0x131e27['node']['cloneNode'](!0x0)),'new'!=_0x131e27['type']&&(_0x756c3||'removed'!=_0x131e27['type'])){const _0x3d3005=_0x4e94ee(_0x65a64d=>$i(_0x65a64d,'data-id')==_0x131e27['id'],_0x244be0,!0x0);_0x3d3005&&_0x5d8e6a['children']['push'](_0x3d3005['cloneNode'](!0x0));}const {content:_0x1cf58a,hasChanges:_0x3a90b1}=function(_0x2612fb,_0x62082f,_0x459469,_0x15a0f3,_0x40669c=!0x0){const _0x546f85=_0x2612fb['plugins']['get']('DocumentCompare'),_0x598f74=Ki(_0x62082f),_0x18d87c=Ki(_0x459469),_0x5e5d06=_0x2612fb['data']['parse'](_0x598f74,'$root'),_0x3a3c1a=_0x2612fb['model']['createPositionAt'](_0x5e5d06,0x0),_0x39f719=_0x546f85['getDiff'](_0x598f74,_0x18d87c,{'anchor':_0x3a3c1a,'markDeletions':_0x15a0f3,'targetEditor':_0x2612fb}),_0x4a237b=_0x39f719['getOperations']();if(0x0==_0x4a237b['length'])return{'content':_0x62082f['cloneNode'](!0x0),'hasChanges':!0x1};_0x15a0f3?function(_0x2c06eb,_0x3b9ad0,_0x32c114){if(0x0==_0x2c06eb['length'])return;const _0x2b91b3=_0x32c114['plugins']['get']('DocumentCompare'),_0x3f3895=_0x32c114['plugins']['get']('SuggestionsConversion');_0x32c114['model']['change'](_0x4ffe61=>{const _0x13244a=new Set();for(let _0x5a592a=0x0;_0x5a592a<_0x2c06eb['length'];_0x5a592a++){const _0x131bbf=_0x2c06eb[_0x5a592a];if(_0x131bbf['baseVersion']=null,_0x131bbf['isDocumentOperation']=!0x1,_0x2b91b3['isMarkedRemoveOperation'](_0x131bbf)){const _0x9cf1d6=_0x43b9ff(_0x131bbf['newRange'],_0x32c114['model']),_0x230c7a='suggestion:deletion:'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0x230c7a,_0x9cf1d6);}else switch(_0x131bbf['type']){case'rename':{if(_0x131bbf['oldName']==_0x131bbf['newName'])break;_0x4ffe61['batch']['addOperation'](_0x131bbf),_0x32c114['model']['applyOperation'](_0x131bbf);const _0x1fccad='$elementName',_0x349c18=_0x131bbf['position'],_0x5e20c6=_0x32c114['model']['createRange'](_0x349c18,_0x32c114['model']['createPositionAt'](_0x349c18['nodeAfter'],'end')),_0x3f5fcc='suggestion:attribute:'+_0x1fccad+':'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0x3f5fcc,_0x5e20c6);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x131bbf['oldValue']==_0x131bbf['newValue'])break;_0x4ffe61['batch']['addOperation'](_0x131bbf),_0x32c114['model']['applyOperation'](_0x131bbf);const _0x41bc95=_0x131bbf['key'];if(!_0x3f3895['isRegisteredAttribute'](_0x41bc95))break;const _0x1af45f=_0x43b9ff(_0x131bbf['range'],_0x32c114['model']),_0x49f770='suggestion:attribute:'+_0x41bc95+':'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0x49f770,_0x1af45f);break;}case'insert':{_0x4ffe61['batch']['addOperation'](_0x131bbf),_0x32c114['model']['applyOperation'](_0x131bbf);if(_0x2c06eb[_0x5a592a+0x1]&&'move'==_0x2c06eb[_0x5a592a+0x1]['type']){ts(_0x3b9ad0,_0x131bbf);break;}const _0x4c01d0=_0x131bbf['position'],_0x34b2b0=_0x131bbf['howMany'],_0xf03de4=_0x43b9ff(_0x32c114['model']['createRange'](_0x4c01d0,_0x4c01d0['getShiftedBy'](_0x34b2b0)),_0x32c114['model']),_0x321c43='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0x321c43,_0xf03de4);break;}case'split':{_0x4ffe61['batch']['addOperation'](_0x131bbf),_0x32c114['model']['applyOperation'](_0x131bbf);const _0x2650ec=_0x131bbf['splitPosition'],_0x70eaa=_0x131bbf['moveTargetPosition'],_0x1b4e1c=_0x32c114['model']['createRange'](_0x2650ec,_0x70eaa),_0xaaa674='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0xaaa674,_0x1b4e1c);break;}case'move':{_0x4ffe61['batch']['addOperation'](_0x131bbf),_0x32c114['model']['applyOperation'](_0x131bbf),_0x2c06eb[_0x5a592a-0x1]&&'insert'==_0x2c06eb[_0x5a592a-0x1]['type']&&ts(_0x3b9ad0,_0x131bbf);const _0x3623c6=_0x131bbf['getMovedRangeStart'](),_0x455a06=_0x131bbf['howMany'];for(let _0xbe513f=0x0;_0xbe513f<_0x455a06;_0xbe513f++){const _0x203e69=_0x3623c6['getShiftedBy'](_0xbe513f)['nodeAfter'];_0x13244a['add'](_0x203e69);}break;}case'remove':{const _0x226209=_0x131bbf['sourcePosition'],_0x363221=_0x131bbf['howMany'],_0x714d1b=new _0x43c2ab(_0x226209,_0x363221);_0x4ffe61['batch']['addOperation'](_0x714d1b),_0x32c114['model']['applyOperation'](_0x714d1b);break;}}}for(const _0x977640 of _0x13244a){const _0x263224=_0x32c114['model']['createRangeOn'](_0x977640),_0x162564='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x3b9ad0['markers']['set'](_0x162564,_0x43b9ff(_0x263224,_0x32c114['model']));}});}(_0x4a237b,_0x5e5d06,_0x2612fb):_0x2612fb['model']['change'](_0x30fffc=>{for(const _0x389755 of _0x4a237b)if('remove'==_0x389755['type']){const _0x89c3e9=_0x389755['sourcePosition'],_0x1156f3=_0x389755['howMany'],_0x278ee8=new _0x43c2ab(_0x89c3e9,_0x1156f3);_0x30fffc['batch']['addOperation'](_0x278ee8),_0x2612fb['model']['applyOperation'](_0x278ee8);}else{if('marker'==_0x389755['type']){const _0x493d53=_0x389755['name'],_0x2ac920=_0x389755['newRange'];null!==_0x2ac920?_0x5e5d06['markers']['set'](_0x493d53,_0x2ac920):_0x5e5d06['markers']['delete'](_0x493d53);}else _0x389755['baseVersion']=null,_0x389755['isDocumentOperation']=!0x1,_0x30fffc['batch']['addOperation'](_0x389755),_0x2612fb['model']['applyOperation'](_0x389755);}});if(_0x40669c){const _0x1f4b0b=es(_0x2612fb,_0x4a237b,_0x5e5d06);is(_0x2612fb['model'],_0x1f4b0b),function(_0x3c6767,_0xf5201f){const _0xca22cc=_0xf5201f['getFirstRange']()['start'];let _0x2aa91b=_0xf5201f['getFirstRange']()['end'];const _0x5b4c84=_0xca22cc['root'];(_0x2aa91b['textNode']||_0x2aa91b['nodeAfter']&&_0x2aa91b['nodeAfter']['is']('$text'))&&(_0x126834(_0x2aa91b,'...'),_0x2aa91b=_0x2aa91b['getShiftedBy'](0x3)),(_0xca22cc['textNode']||_0xca22cc['nodeBefore']&&_0xca22cc['nodeBefore']['is']('$text'))&&(_0x126834(_0xca22cc,'...'),function(_0x30e219,_0x32a86e,_0x50084b){for(let [_0x4d16ff,_0x1a70b6]of _0x30e219['markers']){const _0x60f8a0=_0x1a70b6['_getTransformedByInsertion'](_0x32a86e,_0x50084b,!0x1);_0x1a70b6=_0x60f8a0[0x0],_0x30e219['markers']['set'](_0x4d16ff,_0x1a70b6);}}(_0x5b4c84,_0xca22cc,0x3),_0xca22cc['parent']==_0x2aa91b['parent']&&(_0x2aa91b=_0x2aa91b['getShiftedBy'](0x3)));const _0x19ddcd=_0x3c6767['createRange'](_0x3c6767['createPositionAt'](_0x5b4c84,0x0),_0xca22cc),_0x34564d=_0x3c6767['createRange'](_0x2aa91b,_0x3c6767['createPositionAt'](_0x5b4c84,'end')),_0x4c28a6=[..._0x19ddcd['getMinimalFlatRanges'](),..._0x34564d['getMinimalFlatRanges']()];_0x4c28a6['reverse']();for(const _0x2a3243 of _0x4c28a6)_0x164b6b(_0x2a3243),ns(_0x5b4c84,_0x2a3243);}(_0x2612fb['model'],_0x1f4b0b);}const _0x39f276=_0x2612fb['data']['stringify'](_0x5e5d06,{'showSuggestionHighlights':!0x0});return{'content':Fi(_0x39f276),'hasChanges':!0x0};}(_0x3b0330,_0x5d8e6a,_0xd3f683,_0x756c3,_0x5eae7e);return{'type':_0x503d09['changes'][0x0]['type'],'index':_0x503d09['index'],'content':_0x1cf58a,'hasChanges':_0x3a90b1};});}function ts(_0x3753d8,_0x3996ae){for(const [_0x42cd61,_0x4f30b7]of _0x3753d8['markers']){const _0x382506=_0x1445f3['_createFromRanges'](_0x4f30b7['getTransformedByOperation'](_0x3996ae));_0x3753d8['markers']['set'](_0x42cd61,_0x382506);}}function es(_0x3d40f0,_0x18e8d0,_0x126c6a){const _0x3e69ef=_0x3d40f0['plugins']['get']('DocumentCompare');let _0x22ea05=_0x3d40f0['model']['createPositionAt'](_0x126c6a,Number['POSITIVE_INFINITY']),_0x280a4d=_0x3d40f0['model']['createPositionAt'](_0x126c6a,0x0);for(const _0x26d5a8 of _0x18e8d0){let _0x13eaa6,_0x447678;if(_0x3e69ef['isMarkedRemoveOperation'](_0x26d5a8))_0x13eaa6=_0x26d5a8['newRange']['start'],_0x447678=_0x26d5a8['newRange']['end'];else switch(_0x22ea05=_0x22ea05['getTransformedByOperation'](_0x26d5a8),_0x280a4d=_0x280a4d['getTransformedByOperation'](_0x26d5a8),_0x26d5a8['type']){case'rename':_0x13eaa6=_0x26d5a8['position'],_0x447678=_0x13eaa6['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x13eaa6=_0x26d5a8['range']['start'],_0x447678=_0x26d5a8['range']['end'];break;case'insert':_0x13eaa6=_0x26d5a8['position'],_0x447678=_0x13eaa6['getShiftedBy'](_0x26d5a8['howMany']);break;case'split':_0x13eaa6=_0x26d5a8['splitPosition'],_0x447678=_0x26d5a8['moveTargetPosition'];break;case'merge':{const _0x5af878=_0x26d5a8['targetPosition']['path']['slice'](0x0,-0x1);_0x13eaa6=_0x3d40f0['model']['createPositionFromPath'](_0x126c6a,_0x5af878),_0x447678=_0x13eaa6['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x4dafba=_0x26d5a8['howMany'],_0x1d3974=_0x26d5a8['sourcePosition']['_getTransformedByInsertion'](_0x26d5a8['targetPosition'],_0x4dafba),_0x43e45b=_0x26d5a8['getMovedRangeStart']();'remove'==_0x26d5a8['type']?(_0x13eaa6=_0x1d3974,_0x447678=_0x1d3974):(_0x13eaa6=_0x43e45b,_0x447678=_0x43e45b['getShiftedBy'](_0x4dafba));break;}}_0x13eaa6&&_0x13eaa6['isBefore'](_0x22ea05)&&(_0x22ea05=_0x13eaa6['clone'](),_0x22ea05['stickiness']='toNone'),_0x447678&&_0x447678['isAfter'](_0x280a4d)&&(_0x280a4d=_0x447678['clone'](),_0x280a4d['stickiness']='toNone');}return _0x3d40f0['model']['createSelection'](_0x3d40f0['model']['createRange'](_0x22ea05,_0x280a4d));}function is(_0x18fb79,_0x16b369){ss(_0x18fb79,_0x16b369,'forward');const _0x5f16ef=_0x16b369['getFirstRange']();_0x16b369['setTo']([]),_0x16b369['setTo'](_0x5f16ef,{'backward':!0x0}),ss(_0x18fb79,_0x16b369,'backward');}function ss(_0x4d9e75,_0x1ac05e,_0x15c0ef){let _0x23f966=0x14;for(;_0x23f966;){_0x4d9e75['modifySelection'](_0x1ac05e,{'unit':'word','direction':_0x15c0ef}),_0x23f966--;const _0x56cbb6=_0x1ac05e['focus']['forward'==_0x15c0ef?'nodeBefore':'nodeAfter'];if(_0x56cbb6&&_0x56cbb6['is']('element')&&_0x4d9e75['schema']['isBlock'](_0x56cbb6)&&_0x4d9e75['schema']['isObject'](_0x56cbb6))break;}}function ns(_0x1e4660,_0x2d9f6b){for(const [_0x4b6bb7,_0x5bc991]of _0x1e4660['markers']){const _0x170e9a=_0x5bc991['_getTransformedByDeletion'](_0x2d9f6b['start'],_0x2d9f6b['end']['offset']-_0x2d9f6b['start']['offset']);null!=_0x170e9a?_0x1e4660['markers']['set'](_0x4b6bb7,_0x170e9a):_0x1e4660['markers']['delete'](_0x4b6bb7);}}class AIReply extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x34e0db([]);['parsedMergedContent']=new _0x34e0db([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x38cc1e,content:_0x1f92f4='',isDone:_0x256041=!0x1,isComplete:_0x43de68,interactionId:_0x2a88ac,areActionsDisabled:_0x3cd630,isFromHistory:_0x29a005=!0x1,documentContextContent:_0xf51ac1,dataIdDocumentSources:_0x354d40,documentId:_0x3e89de,locale:_0x2dea17,id:_0x3ccf49}){super(),this['id']=_0x3ccf49||ot(),this['interactionId']=_0x2a88ac,this['type']=_0x38cc1e,this['areActionsDisabled']=!!_0x3cd630,this['locale']=_0x2dea17,this['dataIdDocumentSources']=_0x354d40,this['documentId']=_0x3e89de,this['isFromHistory']=_0x29a005,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=Fi(_0xf51ac1||''),this['set']('isDone',_0x256041),this['set']('isComplete',_0x43de68??_0x256041),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1f92f4);}['appendContent'](_0x331868){this['set']('content',this['content']+_0x331868);}['done'](_0x2f64e1=!0x0){this['isComplete']=_0x2f64e1,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x1745c3,_0x472c8f){this['changeGroups'][_0x1745c3]['state']=_0x472c8f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x1745c3,'state':_0x472c8f});}['getContentParts']({showDiff:_0x4e41a0,groupIndex:_0x13dce1,editor:_0x38fbba}){const _0xe60b1a=this['_getCachedContentParts'](_0x4e41a0,_0x13dce1);if(_0xe60b1a)return _0xe60b1a;let _0xf38e6d=[];if(void 0x0===_0x13dce1)_0xf38e6d=this['changeGroups'];else{const _0x1aa9a3=this['changeGroups']['find'](({index:_0x31bc7a})=>_0x31bc7a===_0x13dce1);if(!_0x1aa9a3)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x13dce1});_0xf38e6d=[_0x1aa9a3];}const _0x15cf63=Zi({'editor':_0x38fbba,'showDiff':_0x4e41a0,'changeGroups':_0xf38e6d,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4e41a0,_0x15cf63),_0x15cf63;}['_getCachedContentParts'](_0x1da017,_0x3cde0e){const _0x452300=_0x1da017?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x452300]['length'])return null;const _0x1c3a93=this['cachedSuggestionContentParts'][_0x452300];if(void 0x0===_0x3cde0e)return _0x1c3a93['length']>0x0&&_0x1c3a93['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1da017,null),null):_0x4c306c(_0x1c3a93);{const _0x4bb6c6=_0x1c3a93['find'](({index:_0x5e1e5a})=>_0x5e1e5a===_0x3cde0e);if(_0x4bb6c6)return[_0x4c306c(_0x4bb6c6)];}return null;}['_setCachedContentParts'](_0x1fef93,_0x24959c){const _0x4fa2d7=_0x1fef93?'withDiff':'withoutDiff';_0x24959c?_0x24959c['forEach'](_0x34b72c=>{const _0x2c48cf=this['cachedSuggestionContentParts'][_0x4fa2d7],_0x597f2f=_0x2c48cf['find'](({index:_0x4207b4})=>_0x4207b4===_0x34b72c['index']);if(_0x597f2f){const _0x5dbf10=_0x2c48cf['indexOf'](_0x597f2f);_0x2c48cf['splice'](_0x5dbf10,0x1,_0x34b72c);}else _0x2c48cf['push'](_0x34b72c);}):this['cachedSuggestionContentParts'][_0x4fa2d7]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x3a46bc=this['changeGroups'];this['updateChangeGroups']();const _0x69a02=this['_getDifferentChangeGroups'](_0x3a46bc,this['changeGroups']);(_0x69a02['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x69a02),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x2ef1de,_0x2dc734){const _0x2cd5c2=[];for(const _0xb05175 of _0x2dc734){const _0x53b84f=_0x2ef1de[_0xb05175['index']];_0x53b84f?_0x53b84f['changes']['length']!==_0xb05175['changes']['length']?_0x2cd5c2['push'](_0xb05175):_0x53b84f['changes']['forEach']((_0x4ffb76,_0x27376d)=>{const _0x4bc44c=_0xb05175['changes'][_0x27376d];_0x4ffb76['id']!==_0x4bc44c['id']&&_0x2cd5c2['push'](_0xb05175);}):_0x2cd5c2['push'](_0xb05175);}return _0x2cd5c2;}['updateChangeGroups'](){const _0x3fccf9=this['locale']?new _0x4d1237('p',{},[new _0x4d1237('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x5a8104(Hi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x54f195=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x3fccf9,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x54f195['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x54f195['parsedContent'],this['newNodeAnchorIds']=_0x54f195['newAnchorIds'];let _0x4bc20d=[];if(_0x2c9ab8(_0x369499=>{const _0x233dc6=$i(_0x369499,'data-id');if(!_0x233dc6||!_0x2d3f90(_0x233dc6))return!0x1;const _0x115e5d=[_0x369499,...Xi(_0x369499)]['at'](-0x2);if(_0x369499!=_0x115e5d){const _0x167138=$i(_0x115e5d,'data-id');_0x2d3f90(_0x167138)||(_0x4bc20d['push']({'node':_0x115e5d,'id':_0x167138,'type':'modified'}),_0x54f195['modifiedNodeIds']['push'](_0x167138));}else _0x54f195['modifiedNodeIds']['includes'](_0x233dc6)?_0x4bc20d['push']({'node':_0x369499,'type':'modified','id':_0x233dc6}):_0x54f195['newNodeIds']['includes'](_0x233dc6)?_0x4bc20d['push']({'node':_0x369499,'type':'new','id':_0x233dc6,'anchorId':$i(_0x369499['previousSibling'],'data-id')}):_0x4bc20d['push']({'node':_0x369499,'type':'removed','id':_0x233dc6});return!0x0;},this['parsedMergedContent']),_0x4bc20d=_0x4bc20d['filter'](({node:_0x403812})=>[...Xi(_0x403812),_0x403812]['every'](_0x1da2a4=>!$i(_0x1da2a4,'data-unstable'))),0x0==_0x4bc20d['length'])return;const _0x5338eb=[[_0x4bc20d[0x0]]];for(let _0x2b339f=0x1;_0x2b339f<_0x4bc20d['length'];_0x2b339f++){const _0x391a84=_0x5338eb[_0x5338eb['length']-0x1],_0x3356b4=_0x391a84[_0x391a84['length']-0x1];_0x4bc20d[_0x2b339f]['node']['previousSibling']==_0x3356b4['node']&&'modified'!=_0x4bc20d[_0x2b339f]['type']&&'modified'!=_0x3356b4['type']&&this['_isSameDocument'](_0x4bc20d[_0x2b339f]['node'],_0x3356b4['node'])?_0x391a84['push'](_0x4bc20d[_0x2b339f]):_0x5338eb['push']([_0x4bc20d[_0x2b339f]]);}for(const _0x4550d7 of _0x5338eb){const _0x520602=_0x4550d7[0x0],_0x2f564b=_0x4550d7[_0x4550d7['length']-0x1],_0x596cc2=_0x40c30b(_0x520602['node']['previousSibling']);_0x596cc2&&this['_isSameDocument'](_0x596cc2['node'],_0x520602['node'])&&_0x4550d7['unshift'](_0x596cc2);const _0x228c4a=_0x40c30b(_0x2f564b['node']['nextSibling']);_0x228c4a&&this['_isSameDocument'](_0x228c4a['node'],_0x2f564b['node'])&&_0x4550d7['push'](_0x228c4a);}function _0x2d3f90(_0x296f97){return _0x54f195['modifiedNodeIds']['includes'](_0x296f97)||_0x54f195['newNodeIds']['includes'](_0x296f97)||_0x54f195['removedNodeIds']['includes'](_0x296f97);}function _0x40c30b(_0x4a0a8a){if(_0x4a0a8a&&$i(_0x4a0a8a,'data-id')&&!$i(_0x4a0a8a,'data-unstable')){const _0x2ff72a=$i(_0x4a0a8a,'data-id');if(!_0x2d3f90(_0x2ff72a))return{'node':_0x4a0a8a,'type':'context','id':_0x2ff72a};}return null;}this['changeGroups']=_0x5338eb['map']((_0x15b8ba,_0xa3b854)=>({'changes':_0x15b8ba,'state':'pending','index':_0xa3b854}));}['_isSameDocument'](_0x179cae,_0x42e68a){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x276996=this['_resolveDocumentSource'](_0x179cae),_0x2c13a7=this['_resolveDocumentSource'](_0x42e68a);return!_0x276996||!_0x2c13a7||_0x276996['editor']===_0x2c13a7['editor']&&_0x276996['rootName']===_0x2c13a7['rootName'];}['_resolveDocumentSource'](_0x3a17f4){if(!_0x3a17f4||!this['dataIdDocumentSources'])return;const _0x354a1c=$i(_0x3a17f4,'data-id');if(_0x354a1c){const _0x13bc61=this['dataIdDocumentSources']['get'](_0x354a1c);if(_0x13bc61)return _0x13bc61;const _0x448b87=this['newNodeAnchorIds']['get'](_0x354a1c),_0x597c56=_0x448b87?this['dataIdDocumentSources']['get'](_0x448b87):void 0x0;if(_0x597c56)return _0x597c56;}for(let _0x5721f9=_0x3a17f4['previousSibling'];_0x5721f9;_0x5721f9=_0x5721f9['previousSibling']){const _0x296cee=$i(_0x5721f9,'data-id'),_0x2f0094=_0x296cee?this['dataIdDocumentSources']['get'](_0x296cee):void 0x0;if(_0x2f0094)return _0x2f0094;}for(let _0x44cc8d=_0x3a17f4['nextSibling'];_0x44cc8d;_0x44cc8d=_0x44cc8d['nextSibling']){const _0x16b3e1=$i(_0x44cc8d,'data-id'),_0x1f5e6f=_0x16b3e1?this['dataIdDocumentSources']['get'](_0x16b3e1):void 0x0;if(_0x1f5e6f)return _0x1f5e6f;}}}const rs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x458ca8,locale:_0x316d24}){super(),this['id']=ot(),this['connector']=_0x458ca8,this['isStopped']=!0x0,this['locale']=_0x316d24;}async['start'](){const _0x51c6b4=[];let _0x3bce26,_0xe2494e,_0x77ac9c,_0x314bef=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x5e14af=await this['currentRequest']['getStream']();for await(const _0x583bd6 of _0x5e14af){if(this['isStopped'])return;if('error'==_0x583bd6['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x583bd6['event']){case'message-metadata':this['messageId']=_0x583bd6['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x583bd6['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x583bd6['data']['conversationTitle'],!0x0);break;case'source':_0x51c6b4['push'](_0x583bd6['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x3bce26='modification-delta'==_0x583bd6['event']?'modification':'text',_0xe2494e='modification-delta'==_0x583bd6['event']?_0x583bd6['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x3bce26&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x583bd6['event']&&(this['currentReply']['documentId']=_0x583bd6['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x3bce26,'interactionId':this['id'],'id':_0xe2494e,...'modification-delta'==_0x583bd6['event']&&{'documentId':_0x583bd6['data']['documentId']}}),'modification'==_0x3bce26&&(this['currentReply']['sources']=_0x51c6b4['splice'](0x0))),this['currentReply']['appendContent'](_0x583bd6['data']['textDelta']);break;case'mcp-tool-result':_0x77ac9c=JSON['parse'](_0x583bd6['data']['result']),this['_handleToolResultData']({'toolName':_0x583bd6['data']['toolName'],'data':_0x77ac9c['data'],'attributes':_0x77ac9c['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x583bd6['data']['toolName'],'data':_0x583bd6['data']['data']});}}_0x314bef=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x51c6b4['length']>0x0&&(this['currentReply']['sources']=_0x51c6b4['splice'](0x0)),this['_finalizeInteraction'](_0x314bef),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x516228){return this['replies']['find'](_0x39d91a=>_0x39d91a['id']===_0x516228);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x31b234=>_0x31b234['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x27f60e){const _0x3d8683=new AIReply({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x27f60e});return this['replies']['push'](_0x3d8683),_0x3d8683['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x3d8683),_0x3d8683;}['setConversationTitle'](_0x512bc2,_0x41ad34=!0x1){this['fire']('setConversationTitle',_0x512bc2,_0x41ad34);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x574601){this['fire']('toolDataReceived',{'type':'result','toolName':_0x574601['toolName'],'data':structuredClone(_0x574601['data']||{}),'attributes':structuredClone(_0x574601['attributes']||{})},this);}['_handleToolNotificationData'](_0xc74975){this['fire']('toolDataReceived',{'type':'notification','toolName':_0xc74975['toolName'],'data':structuredClone(_0xc74975['data'])},this);}['_finalizeInteraction'](_0x4e6e50=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x4e6e50),this['currentRequest']=this['currentReply']=void 0x0;}}const os=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),as=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x1a715b,config:_0x4c3f12,ownerId:_0x576b61}){super(),this['_connector']=_0x1a715b,this['_config']=_0x4c3f12,this['_ownerId']=_0x576b61;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_documentSources']=new Map(),this['_dataIdToSource']=new Map(),this['_setAddContextOptionsDefaultState']();}['_getDocumentSource'](_0x3b8cad){if(_0x3b8cad)return this['_documentSources']['get'](_0x3b8cad);}['getSourceByDataId'](_0x54190e){if(_0x54190e)return this['_dataIdToSource']['get'](_0x54190e);}['_getDocumentContextSlice'](_0x3a9e21){const _0x1a12cd=this['_getDocumentSource'](_0x3a9e21);if(_0x1a12cd)return{'editor':_0x1a12cd['editor'],'rootName':_0x1a12cd['rootName'],'html':_0x1a12cd['content'],'version':_0x1a12cd['version']};}['getDocumentContextSliceByDataId'](_0xc13a68){const _0x2b6b29=this['getSourceByDataId'](_0xc13a68);return _0x2b6b29?this['_getDocumentContextSlice'](_0x2b6b29['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x1cabea){const _0x4808ec=await this['_createContextItemFromContent'](_0x1cabea);return this['_addToConversationContextItem'](_0x4808ec),'current-document'===_0x4808ec['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4808ec;}async['populateDocumentsFromMessage'](_0x409cce,_0x3c2c26){const _0x14ecb4=_0x409cce['filter'](_0x521134=>'document'===_0x521134['type']);if(0x0===_0x14ecb4['length'])return{'hasUnmatched':!0x1};if(0x1===_0x14ecb4['length'])return{'contextItem':await this['populateFromMessage'](_0x14ecb4[0x0]),'hasUnmatched':!0x1};const _0x32238f=_0x14ecb4['map'](_0x1309a6=>_0x1309a6['id']),_0x3fb661=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x32238f)['getDocuments'](),_0x4ac5f0=new Map(_0x3fb661['map'](_0x1ab652=>[_0x1ab652['id'],_0x1ab652]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x5e50ef=[];let _0x43a5c3=!0x1;for(const _0x35d815 of _0x14ecb4){const _0x5bdb1e=_0x4ac5f0['get'](_0x35d815['id']);if(!_0x5bdb1e)continue;const _0x1e9c61=this['_matchDocumentToRoot'](_0x5bdb1e,_0x3c2c26),_0x51515f=_0x3c2c26[0x0]&&this['_getFirstRoot'](_0x3c2c26[0x0]);_0x1e9c61||(_0x43a5c3=!0x0);const _0x300225=_0x1e9c61?.['editor']??_0x51515f?.['editor'],_0x10141a=_0x1e9c61?.['rootName']??_0x51515f?.['rootName'];if(_0x300225&&_0x10141a){const _0xec72b9={'editor':_0x300225,'rootName':_0x10141a,'content':_0x5bdb1e['content'],'version':_0x5bdb1e['attributes']?.['version']??0x0,'name':_0x5bdb1e['name'],'description':_0x5bdb1e['description']};this['_documentSources']['set'](_0x5bdb1e['id'],_0xec72b9);const _0x477757=Fi(_0x5bdb1e['content']);for(const _0x12d768 of _0x2c9ab8(_0x183635=>!!$i(_0x183635,'data-id'),_0x477757)){const _0x416652=$i(_0x12d768,'data-id');_0x416652&&this['_dataIdToSource']['set'](_0x416652,{..._0xec72b9,'documentId':_0x5bdb1e['id']});}}_0x5e50ef['push']({'id':_0x5bdb1e['id'],'content':_0x5bdb1e['content'],'version':_0x5bdb1e['attributes']?.['version']??0x0,'sessionId':_0x5bdb1e['attributes']?.['sessionId']??null,'selection':[]});}const _0x48fc54={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x5e50ef,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x48fc54),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x48fc54,'hasUnmatched':_0x43a5c3};}['_matchDocumentToRoot'](_0x56eaab,_0x22336e){const _0xa32533=_0x56eaab['attributes']?.['channelId'],_0x24526a=_0x56eaab['attributes']?.['rootName'];if(_0xa32533&&_0x24526a){for(const _0x27eb8a of _0x22336e)if(_0x27eb8a['config']['get']('collaboration.channelId')===_0xa32533){for(const _0x5eeb79 of _0x27eb8a['model']['document']['getRoots']())if('$graveyard'!==_0x5eeb79['rootName']&&_0x5eeb79['rootName']===_0x24526a)return{'editor':_0x27eb8a,'rootName':_0x5eeb79['rootName']};}}}['_getFirstRoot'](_0x21cddf){for(const _0x22076d of _0x21cddf['model']['document']['getRoots']())if('$graveyard'!==_0x22076d['rootName'])return{'editor':_0x21cddf,'rootName':_0x22076d['rootName']};}async['_createContextItemFromContent'](_0x3c91f1){if('document'===_0x3c91f1['type']){const _0x580b5d=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3c91f1['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3c91f1['type'],'content':_0x580b5d['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x580b5d['attributes']?.['version'],'sessionId':_0x580b5d['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x3c91f1['type'])return{'id':_0x3c91f1['id'],'uiId':_0x3c91f1['id'],'label':_0x3c91f1['data']?.['label']||_0x3c91f1['id'],'type':'mcp-tool-context','mcpServerName':_0x3c91f1['mcpServerName'],'toolName':_0x3c91f1['toolName'],'data':_0x3c91f1['data']||{}};return{'id':_0x3c91f1['id'],'uiId':_0x3c91f1['id'],'label':_0x3c91f1['attributes']?.['label']||_0x3c91f1['name']||_0x3c91f1['url']||_0x3c91f1['id'],'type':_0x3c91f1['type'],..._0x3c91f1?.['attributes']?.['resourceId']?{'resourceId':_0x3c91f1['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0xef7f0){const _0x2784d6=this['_pendingContextItems']['get'](_0xef7f0);_0x2784d6?.['isReadOnly']||this['_removeContextItem'](_0xef7f0);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3a8ebe of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3a8ebe['uiId']);const _0x142c23=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x142c23&&this['_addContextItem']({..._0x142c23,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3ea0b4){for(const _0x5c41ca of _0x3ea0b4['values']())this['_addToConversationContextItem'](_0x5c41ca);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'](_0x52b293){return Array['from'](_0x52b293['values']())['flatMap'](_0x9d4d77=>this['_mapContextItemToRequestData'](_0x9d4d77));}async['addFilesToContext'](_0xa5f386,_0x1e7009,_0x2cc46c='file'){const _0xbb7517='files-'+ot();this['_startUploadOperation'](_0xbb7517);try{await Promise['all'](_0xa5f386['map'](async _0x2fea4=>{const _0x4498b1='file-'+ot(),_0x4ef2d2=_0x19d831(_0x2fea4['name']);try{this['_addContextItem']({'type':_0x2cc46c,'label':_0x1e7009?.['label']||_0x4ef2d2,'uiId':_0x4498b1,'resourceId':_0x1e7009?.['resourceId']},!0x0);const _0x4df27b=this['_connector']['uploadFile'](this['_ownerId'],_0x2fea4,_0x1e7009);this['_ongoingUploads']['set'](_0x4498b1,_0x4df27b['abortController']);const {id:_0x24b2e9}=await _0x4df27b['getId']();this['_ongoingUploads']['delete'](_0x4498b1),this['_finishContextItemLoading']({'type':_0x2cc46c,'id':_0x24b2e9,'label':_0x1e7009?.['label']||_0x4ef2d2,'uiId':_0x4498b1,'resourceId':_0x1e7009?.['resourceId']},!0x1);}catch(_0x32f51c){this['_ongoingUploads']['delete'](_0x4498b1);if(!(_0x32f51c instanceof at&&_0x32f51c['message']['startsWith']('ai-request-aborted'))){const _0x1829f4=os['get'](_0x32f51c['code'])||'ai-chat-file-upload-failed',_0x48d8c4=new at(_0x1829f4,null,{'fileName':_0x4ef2d2,..._0x32f51c});_0x48d8c4['stack']=_0x32f51c['stack'],this['fire']('error',{'error':_0x48d8c4});}this['_removeContextItem'](_0x4498b1);}}));}finally{this['_finishUploadOperation'](_0xbb7517);}}['addCurrentDocumentToContext'](_0x2a941b){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x7acfc2={'type':'document','uiId':'current-document','label':_0x2a941b,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x7acfc2);}async['updateCurrentDocument'](_0x1b03b5,_0x11054d,_0x5474a8,_0x11c144,_0x42ace9,_0x29120f){const _0x358d82=this['_pendingContextItems']['get']('current-document');if(_0x358d82&&_0x1b03b5){_0x358d82['selection']=_0x29120f?_0x29120f['map'](_0x996d15=>({'start':_0x996d15['start'],'end':_0x996d15['end']})):[];try{if(_0x358d82['version']===_0x11054d)return;const {id:_0x33ae3e}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x1b03b5,{'version':_0x11054d,'sessionId':_0x5474a8,'channelId':_0x11c144,'rootName':_0x42ace9})['getId']();_0x358d82['id']=_0x33ae3e,_0x358d82['content']=_0x1b03b5,_0x358d82['version']=_0x11054d,_0x358d82['sessionId']=_0x5474a8;}catch(_0x4a804c){const _0x35a2a1=new at('ai-chat-document-upload-failed',null);_0x35a2a1['stack']=_0x4a804c['stack'],this['fire']('error',{'error':_0x35a2a1});}}}async['updateCurrentDocuments'](_0x188673){const _0x12ebdc=this['_pendingContextItems']['get']('current-document');if(!_0x12ebdc||!_0x188673['length']||_0x188673['every'](_0x190a71=>!_0x190a71['content']))return;_0x188673['length']>0x1&&_0x188673['some'](_0x263a1b=>!_0x263a1b['description'])&>('ai-chat-documents-missing-description');const _0x28c587=_0xe021fd=>_0xe021fd?_0xe021fd['map'](_0x2f04b3=>({'start':_0x2f04b3['start'],'end':_0x2f04b3['end']})):[],_0x3a3625=_0x12ebdc['documents']??[];if(_0x3a3625['length']===_0x188673['length']&&_0x188673['every']((_0x255100,_0x27f650)=>_0x3a3625[_0x27f650]?.['version']===_0x255100['version']))_0x12ebdc['documents']=_0x3a3625['map']((_0x2bf482,_0x31d50b)=>({..._0x2bf482,'selection':_0x28c587(_0x188673[_0x31d50b]['selections'])}));else try{const _0x2d6f53=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x188673)['getIds']();_0x12ebdc['documents']=_0x188673['map']((_0x1bd50f,_0x17f265)=>({'id':_0x2d6f53[_0x17f265]?.['id'],'content':_0x1bd50f['content'],'version':_0x1bd50f['version'],'sessionId':_0x1bd50f['sessionId'],'selection':_0x28c587(_0x1bd50f['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x1bc32b=0x0;_0x1bc32b<_0x188673['length'];_0x1bc32b++){const _0x3ba859=_0x2d6f53[_0x1bc32b]?.['id'],_0x41b3d4=_0x188673[_0x1bc32b];if(!_0x3ba859)continue;const _0x3aa64b={'editor':_0x41b3d4['editor'],'rootName':_0x41b3d4['rootName'],'content':_0x41b3d4['content'],'version':_0x41b3d4['version'],'name':_0x41b3d4['name'],'description':_0x41b3d4['description']};this['_documentSources']['set'](_0x3ba859,_0x3aa64b);const _0x21fc1e=Fi(_0x41b3d4['content']);for(const _0x5263d6 of _0x2c9ab8(_0x4db369=>!!$i(_0x4db369,'data-id'),_0x21fc1e)){const _0x359deb=$i(_0x5263d6,'data-id');_0x359deb&&this['_dataIdToSource']['set'](_0x359deb,{..._0x3aa64b,'documentId':_0x3ba859});}}_0x12ebdc['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x92b902){const _0x2ab8ab=new at('ai-chat-document-upload-failed',null);_0x2ab8ab['stack']=_0x92b902['stack'],this['fire']('error',{'error':_0x2ab8ab});}}['addSelectionToContext'](_0x2163ee){this['_addContextItem']({'type':'selection','label':_0x2163ee,'uiId':'selection','content':_0x2163ee});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0xd6f670,_0x2539b3){const _0x2d3ada='url-'+ot();this['_startUploadOperation'](_0x2d3ada);const _0x2ea7fc='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x2539b3?.['label']||_0xd6f670,'uiId':_0x2ea7fc,'resourceId':_0x2539b3?.['resourceId']},!0x0);const _0x4a0256=this['_connector']['uploadUrl'](this['_ownerId'],_0xd6f670,_0x2539b3);this['_ongoingUploads']['set'](_0x2ea7fc,_0x4a0256['abortController']);const {id:_0x4e0de5}=await _0x4a0256['getId']();this['_ongoingUploads']['delete'](_0x2ea7fc),this['_finishContextItemLoading']({'type':'web-resource','id':_0x4e0de5,'label':_0x2539b3?.['label']||_0xd6f670,'uiId':_0x2ea7fc,'resourceId':_0x2539b3?.['resourceId']},!0x1);}catch(_0x11d073){this['_ongoingUploads']['delete'](_0x2ea7fc),(_0x11d073['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0xd6f670,'originalError':_0x11d073}),'url':_0xd6f670}),this['_removeContextItem'](_0x2ea7fc));}finally{this['_finishUploadOperation'](_0x2d3ada);}}['addToolItemToContext'](_0x2d1827){_0x2d1827['id']=_0x2d1827['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x2d1827['uiId'],_0x2d1827),this['fire']('contextItemAdded',{'contextItem':_0x2d1827,'isLoading':!0x1});}async['loadSourceResources'](_0x376905,_0x4075cd,_0x178686){const _0x41098a=this['_addContextOptionsState']['sources']['find'](_0x2135bf=>_0x2135bf['id']===_0x376905);if(!_0x41098a)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x376905}),'sourceId':_0x376905}),[];try{const _0x981d56=(await _0x41098a['getResources'](_0x4075cd))['map'](_0x4d6b55=>{const _0x5ddae7=this['_isResourceInContext'](_0x4d6b55['id']);return{..._0x4d6b55,'isInContext':_0x5ddae7};});return _0x41098a['resources']=_0x981d56,this['fire']('sourceResourcesLoaded',{'sourceId':_0x376905,'source':_0x41098a,'resources':_0x981d56,'uid':_0x178686}),_0x981d56;}catch(_0x172ed7){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x376905,'originalError':_0x172ed7}),'sourceId':_0x376905,'sourceLabel':_0x41098a['label']}),[];}}async['addResourceToContext'](_0x139831,_0x39767f){if(this['_isResourceInContext'](_0x39767f['id']))return;let _0x892678=_0x39767f['data'];if(!_0x892678&&_0x139831['getData'])try{_0x892678=await _0x139831['getData'](_0x39767f['id']);}catch(_0x2522b4){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id'],'originalError':_0x2522b4}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});}if(_0x892678)switch(_0x39767f['type']){case'web-resource':if('string'!=typeof _0x892678)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id'],'expectedType':'string','actualType':typeof _0x892678}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});await this['addUrlToContext'](_0x892678,{'label':_0x39767f['label'],'resourceId':_0x39767f['id']});break;case'file':if(!(_0x892678 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id'],'expectedType':'File','actualType':typeof _0x892678}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});await this['addFilesToContext']([_0x892678],{'label':_0x39767f['label'],'resourceId':_0x39767f['id']});break;case'text':if('object'!=typeof _0x892678||!('content'in _0x892678)||!('type'in _0x892678))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x892678}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});_0x892678=AIChatContext['_convertTextResourceToFile'](_0x892678,_0x39767f['label']),await this['addFilesToContext']([_0x892678],{'label':_0x39767f['label'],'resourceId':_0x39767f['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id'],'resourceType':_0x39767f['type']}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']}),'resourceId':_0x39767f['id'],'sourceId':_0x139831['id']});}static['_convertTextResourceToFile'](_0x41cfc0,_0x34c8d6){switch(_0x41cfc0['type']){case'markdown':return new File([_0x41cfc0['content']],_0x34c8d6,{'type':'text/markdown'});case'html':return new File([_0x41cfc0['content']],_0x34c8d6,{'type':'text/html'});default:return new File([_0x41cfc0['content']],_0x34c8d6,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x37806b){switch(_0x37806b['type']){case'file':case'text':return[{'type':'file','id':_0x37806b['id']}];case'web-resource':return[{'type':'web-resource','id':_0x37806b['id']}];case'document':return _0x37806b['documents']?.['length']?_0x37806b['documents']['map'](_0x168767=>({'type':'document','id':_0x168767['id'],..._0x168767['selection']?.['length']&&{'selection':_0x168767['selection']}})):[{'type':'document','id':_0x37806b['id'],..._0x37806b['selection']?.['length']&&{'selection':_0x37806b['selection']}}];case'mcp-tool-context':{const _0x118a48=_0x37806b;return[{'type':'mcp-tool-context','mcpServerName':_0x118a48['mcpServerName'],'toolName':_0x118a48['toolName'],'data':{..._0x118a48['data'],'label':_0x118a48['label']||_0x118a48['data']?.['label']||_0x118a48['id']},'id':_0x118a48['id']}];}default:return[];}}['_addContextItem'](_0xd7e547,_0x436f60=!0x1){if(this['_pendingContextItems']['set'](_0xd7e547['uiId'],_0xd7e547),_0xd7e547['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xd7e547,'isLoading':_0x436f60}),'current-document'===_0xd7e547['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0xd7e547['resourceId']){const _0x3c1881=this['_findSourceIdsByResourceId'](_0xd7e547['resourceId']);_0x3c1881&&_0x3c1881['forEach'](_0x494322=>{this['_updateResourceInContextState'](_0x494322,_0xd7e547['resourceId'],!0x0);});}}['_removeContextItem'](_0x32d33a){const _0x6efdcd=this['_pendingContextItems']['get'](_0x32d33a),_0x5bb499=this['_ongoingUploads']['get'](_0x32d33a);if(_0x5bb499&&(_0x5bb499['abort'](),this['_ongoingUploads']['delete'](_0x32d33a)),_0x6efdcd?.['resourceId']){const _0x112c38=this['_findSourceIdsByResourceId'](_0x6efdcd['resourceId']);_0x112c38&&_0x112c38['forEach'](_0x4145c4=>{this['_updateResourceInContextState'](_0x4145c4,_0x6efdcd['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x32d33a),this['fire']('contextItemRemoved',{'uiId':_0x32d33a,'type':_0x6efdcd?.['type']}),'current-document'===_0x32d33a&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x1fe698,_0x29031c){if(this['_pendingContextItems']['has'](_0x1fe698['uiId'])&&(this['_pendingContextItems']['set'](_0x1fe698['uiId'],_0x1fe698),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1fe698,'isLoading':_0x29031c}),_0x1fe698['resourceId'])){const _0x2ebef0=this['_findSourceIdsByResourceId'](_0x1fe698['resourceId']);_0x2ebef0&&_0x2ebef0['forEach'](_0xeb0d23=>{this['_updateResourceInContextState'](_0xeb0d23,_0x1fe698['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0xeee21f){this['_conversationContextItems']['set'](_0xeee21f['uiId'],_0xeee21f);}['_setAddContextOptionsDefaultState'](){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x5a3c3f=>({..._0x5a3c3f,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x2c8302=>({..._0x2c8302,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x11a66e=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x11a66e,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x3d921a){for(const _0x14c3f3 of this['_pendingContextItems']['values']())if(_0x14c3f3['resourceId']===_0x3d921a)return!0x0;for(const _0xa8597b of this['_conversationContextItems']['values']())if(_0xa8597b['resourceId']===_0x3d921a)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x2c7c06){const _0x58d5d6=[];for(const _0x23565d of this['_addContextOptionsState']['sources']){_0x23565d['resources']['find'](_0x1326ea=>_0x1326ea['id']===_0x2c7c06)&&_0x58d5d6['push'](_0x23565d['id']);}return 0x0===_0x58d5d6['length']?null:_0x58d5d6;}['_updateResourceInContextState'](_0x206121,_0x172542,_0x4a00bc){const _0x20de0f=this['_addContextOptionsState']['sources']['find'](_0x18a387=>_0x18a387['id']===_0x206121);if(!_0x20de0f)return;const _0x2a502=_0x20de0f['resources']['find'](_0x128d0b=>_0x128d0b['id']===_0x172542);_0x2a502&&(_0x2a502['isInContext']=_0x4a00bc,this['fire']('resourceStateChanged',{'sourceId':_0x206121,'resourceId':_0x172542,'isInContext':_0x4a00bc}));}['_startUploadOperation'](_0x37b39c){this['_ongoingUploadOperations']['set'](_0x37b39c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x102a5e){this['_ongoingUploadOperations']['delete'](_0x102a5e),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const hs=['capabilitiesUpdated'];class AICapabilities extends Et(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0xfbdd3c){const _0x20e29e={};return _0xfbdd3c&&_0xfbdd3c['isWebSearchEnabled']&&(_0x20e29e['webSearch']={}),_0xfbdd3c&&_0xfbdd3c['isReasoningEnabled']&&(_0x20e29e['reasoning']={}),_0x20e29e;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4e5aa7){_0x4e5aa7!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4e5aa7,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3088a1){_0x3088a1!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3088a1,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x18bb3c){super(_0x18bb3c),this['conversationId']=_0x18bb3c['conversationId'],this['contextItems']=_0x18bb3c['contextItems'],this['capabilities']=_0x18bb3c['capabilities'],this['userMessage']=_0x18bb3c['userMessage'],this['model']=_0x18bb3c['model'],this['attributes']=_0x18bb3c['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x2c3151){const _0x569b79=this['getDocumentContext']();if(_0x569b79?.['documents']?.['length']){const _0x2342e6=_0x569b79['documents']['map'](_0x1855e3=>_0x1855e3['content']??'')['join']('');if(_0x2342e6)return super['createReply']({'documentContextContent':_0x2342e6,..._0x2c3151});}return super['createReply'](_0x2c3151);}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x5228e0){super(),this['options']=_0x5228e0,this['connector']=_0x5228e0['connector'],this['chatModels']=_0x5228e0['chatModels'],this['id']=_0x5228e0['conversationId'],this['isFromHistory']=_0x5228e0['isFromHistory'];}async['init'](_0x48150f){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x48150f,'ownerId':this['id']}),this['chatContext']['delegate'](...as)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...hs)['to'](this),this['chatCapabilities']['init']();const _0x5332f6=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5332f6});const _0x53ab1f=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x53ab1f&&await this['setModel'](_0x53ab1f);}catch(_0x559508){const _0x127e99=new at('ai-chat-conversation-init-failed',null,{'message':_0x559508['message']||_0x559508});_0x127e99['stack']=_0x559508['stack'],this['fire']('error',{'error':_0x127e99});}}async['start'](){if(this['isStarted'])throw new at('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new at('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x220d9f}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x220d9f,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x47feb3){const _0x275108=new at('ai-chat-conversation-start-failed',null,{'message':_0x47feb3['message'],'conversationId':this['id']});throw _0x275108['stack']=_0x47feb3['stack'],this['fire']('error',{'error':_0x275108}),_0x275108;}}async['load'](_0x38cf1f,_0x2ac4f7){try{const _0x57fde5=await this['connector']['fetchConversation'](_0x38cf1f)['getConversation'](),_0x48daad=await this['connector']['fetchConversationMessages'](_0x38cf1f)['getMessages'](),_0x5eb791=_0x48daad[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x57fde5['id'],'title'in _0x57fde5?this['fire']('setConversationTitle',_0x57fde5['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x3065f3=(await this['chatModels']['getAll']())['find'](_0x125056=>_0x125056['id']['toLowerCase']()===_0x5eb791['toLowerCase']());return this['selectedModel']=_0x3065f3,this['fire']('modelSelected',{'selectedModel':_0x3065f3,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x48daad,_0x2ac4f7,_0x5eb791),this['currentInteraction']=void 0x0,this;}catch(_0x193fae){const _0x509a8f=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x193fae['message'],'conversationId':_0x38cf1f});throw _0x509a8f['stack']=_0x193fae['stack'],this['fire']('error',{'error':_0x509a8f}),_0x509a8f;}}async['_processMessagesToInteractions'](_0x22def9,_0x4024f5,_0x24183d){let _0x172830,_0x299699=!0x1;for(const _0x504e3a of _0x22def9)if('user'===_0x504e3a['role']){const {contextItems:_0x368c59,hasUnmatched:_0xa772b}=await this['_extractContextItems'](_0x504e3a);_0x299699=_0xa772b;const _0x17ca7d={'isReasoningEnabled':Object['hasOwn'](_0x504e3a['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x504e3a['capabilities'],'webSearch')};_0x172830=this['createInteraction']({'userMessage':_0x504e3a['prompt'],'contextItems':_0x368c59,'capabilities':_0x17ca7d,'modelId':_0x24183d,'attributes':_0x504e3a['attributes']}),this['currentInteraction']=_0x172830,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x504e3a['role']&&_0x172830){const _0x32cb0b=[];for(const _0x1b8b88 of _0x504e3a['content'])switch(_0x1b8b88['type']){case'text':case'modification':{const _0x3cbce7=_0x172830['getDocumentContext'](),_0x49193a=(_0x3cbce7?.['documents']?.['length']?_0x3cbce7['documents']['some'](_0x59f3cf=>_0x59f3cf['sessionId']!==_0x4024f5):_0x3cbce7?.['sessionId']!==_0x4024f5)||_0x299699;_0x172830['currentReply']?.['type']!==_0x1b8b88['type']&&(_0x172830['currentReply']=_0x172830['createReply']({'type':_0x1b8b88['type'],'isDone':!0x0,'interactionId':_0x172830['id'],'areActionsDisabled':_0x49193a,'isFromHistory':!0x0}),_0x32cb0b['length']>0x0&&(_0x172830['currentReply']['sources']=_0x32cb0b['splice'](0x0))),_0x172830['currentReply']['appendContent'](_0x1b8b88['content']);break;}case'url':_0x32cb0b['push'](_0x1b8b88);break;case'mcp-tool-result':{const {data:_0x3e343e,attributes:_0x248b7e}=JSON['parse'](_0x1b8b88['content']);_0x172830['_handleToolResultData']({'toolName':_0x1b8b88['toolName'],'data':_0x3e343e,'attributes':_0x248b7e});break;}}}}}async['_extractContextItems'](_0x307ede){const _0x56518a=new Map();if(!_0x307ede['content'])return{'contextItems':_0x56518a,'hasUnmatched':!0x1};const _0x153682=this['_resolveEditors'](),{contextItem:_0x2494a0,hasUnmatched:_0x23cf53}=await this['chatContext']['populateDocumentsFromMessage'](_0x307ede['content'],_0x153682);_0x2494a0&&_0x56518a['set'](_0x2494a0['id'],_0x2494a0);for(const _0x104a54 of _0x307ede['content']){if('document'===_0x104a54['type'])continue;const _0x5101ec=await this['chatContext']['populateFromMessage'](_0x104a54);_0x5101ec&&_0x56518a['set'](_0x5101ec['id'],_0x5101ec);}return{'contextItems':_0x56518a,'hasUnmatched':_0x23cf53};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0xf4a5b5,attributes:_0x577f55}){if(!this['isStarted'])throw new at('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new at('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x278391=this['chatContext']['getPendingContextItems'](),_0x562125=this['chatCapabilities']['getCapabilitiesConfig'](),_0x728630=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xf4a5b5,'contextItems':_0x278391,'capabilities':_0x562125,'modelId':_0x728630,'attributes':_0x577f55}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x5ee95d){if(_0x5ee95d instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x5ee95d});else{const _0x1d20f4=os['get'](_0x5ee95d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x1d20f4,null,{'error':_0x5ee95d})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x27f90a,contextItems:_0x2ef20f,capabilities:_0x163798,modelId:_0x3844a9,attributes:_0x27ba2a}){const _0x5852e1=new AIChatInteraction({'userMessage':_0x27f90a,'contextItems':_0x2ef20f,'capabilities':_0x163798,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x3844a9,'attributes':_0x27ba2a});return _0x5852e1['delegate'](...rs)['to'](this),this['interactions']['push'](_0x5852e1),this['fire']('interactionCreated',_0x5852e1),_0x5852e1;}['getInteraction'](_0x794f39){return this['interactions']['find'](_0x204bac=>_0x204bac['id']===_0x794f39);}['removeInteraction'](_0x5a1a9e){const _0x3c9034=this['getInteraction'](_0x5a1a9e);_0x3c9034&&(_0x3c9034['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x3c9034),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x28158a){this['chatContext']['addCurrentDocumentToContext'](_0x28158a);}async['updateCurrentDocumentInContext']({content:_0xe9f449,version:_0x35bacc,sessionId:_0x1cab14,channelId:_0x255ceb,rootName:_0x57856f,selections:_0x1dd9f1}){await this['chatContext']['updateCurrentDocument'](_0xe9f449,_0x35bacc,_0x1cab14,_0x255ceb,_0x57856f,_0x1dd9f1);}async['updateCurrentDocumentsInContext'](_0xe598c6){await this['chatContext']['updateCurrentDocuments'](_0xe598c6);}['getSourceByDataId'](_0x3c789f){return this['chatContext']['getSourceByDataId'](_0x3c789f);}['getDocumentContextSliceByDataId'](_0x5c54ea){return this['chatContext']['getDocumentContextSliceByDataId'](_0x5c54ea);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x200c75){this['chatContext']['addSelectionToContext'](_0x200c75);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3eebaf){this['chatContext']['addFilesToContext'](_0x3eebaf);}['addUrlToContext'](_0x8e062c){this['chatContext']['addUrlToContext'](_0x8e062c);}['addToolItemToContext'](_0x4751){this['chatContext']['addToolItemToContext'](_0x4751);}['addResourceToContext'](_0x42083f,_0x4993ec){this['chatContext']['addResourceToContext'](_0x42083f,_0x4993ec);}['loadSourceResources'](_0x1a3c5a,_0x4061f2,_0x40aa86){return this['chatContext']['loadSourceResources'](_0x1a3c5a,_0x4061f2,_0x40aa86);}['removeFromContext'](_0x51223f){this['chatContext']['removeFromContext'](_0x51223f);}['setWebSearch'](_0x57cef7){this['chatCapabilities']['setWebSearch'](_0x57cef7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x32ddb2){this['chatCapabilities']['setReasoning'](_0x32ddb2);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1a7dbe){_0x1a7dbe?!0x1===await this['chatModels']['isAvailable'](_0x1a7dbe)&&(gt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1a7dbe}),_0x1a7dbe=(await this['chatModels']['getAvailableModels']())[0x0]):(gt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1a7dbe=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1a7dbe['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1a7dbe,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1a7dbe}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x222085,config:_0x34ca6a,locale:_0x92a93a}){super(),this['_connector']=_0x222085,this['_config']=_0x34ca6a,this['_locale']=_0x92a93a;}get['_availableModels'](){return this['_config']?.['displayedModels'];}get['_defaultModelId'](){return this['_config']?.['defaultModelId'];}async['getAll'](){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()),this['_modelsRequest'];}async['getAvailableModels'](){const _0x21092f=await this['getAll']();let _0x3bd251;return _0x3bd251=this['_availableModels']?this['_filterModels'](_0x21092f,this['_availableModels']):_0x21092f['filter'](_0xcbfd89=>_0xcbfd89['recommended']),_0x3bd251;}async['getModel'](_0x24a962){const _0x22d043=await this['getAll']();if(!_0x22d043['length'])return null;if(_0x24a962){const _0x5c59bb=this['_getModelById'](_0x22d043,_0x24a962);if(_0x5c59bb)return _0x5c59bb;gt('ai-chat-model-id-unrecognized',{'modelId':_0x24a962,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x180c09=await this['getAvailableModels']();if(!_0x180c09['length'])return null;if(this['_defaultModelId']){const _0x36f5b8=this['_getModelById'](_0x180c09,this['_defaultModelId']);if(_0x36f5b8)return _0x36f5b8;gt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x180c09[0x0]['id']});}return _0x180c09[0x0];}async['isAvailable'](_0x29676d){return(await this['getAvailableModels']())['some'](_0x2018cc=>_0x2018cc['name']===_0x29676d['name']&&_0x2018cc['provider']===_0x29676d['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x210d43=this['_locale']['uiLanguage']||'en',_0x130907=this['_connector']['getModels'](_0x210d43),_0x51524a=await _0x130907['list']();this['_modelList']=_0x51524a['items']['map'](_0x563ec4=>cs(_0x563ec4)?{..._0x563ec4,'name':Hi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x563ec4);}catch(_0x6b7392){throw Ct('ai-models-unable-to-retrieve',{'error':_0x6b7392}),_0x6b7392;}return[...this['_modelList']];}['_filterModels'](_0x195e9d,_0x247781){let _0x9da384;if(_0x247781){_0x9da384=[];const _0x3eb18b=new Set(),_0x382359='string'==typeof _0x247781?[_0x247781['toLocaleLowerCase']()]:_0x247781['map'](_0x15fb7f=>_0x15fb7f['toLocaleLowerCase']());for(const _0x4d8561 of _0x382359)for(const _0x285038 of _0x195e9d)!_0x3eb18b['has'](_0x285038['id'])&&this['_isMatchingFilter'](_0x285038,_0x4d8561)&&(_0x9da384['push'](_0x285038),_0x3eb18b['add'](_0x285038['id']));}else _0x9da384=_0x195e9d;return _0x9da384;}['_isMatchingFilter'](_0x170046,_0x507947){const _0x1bd7b5=_0x170046['id']['toLocaleLowerCase'](),_0x3ec792=_0x170046['name']['toLocaleLowerCase'](),_0x2d277e=_0x170046['provider']['toLocaleLowerCase']();return _0x1bd7b5===_0x507947||_0x3ec792===_0x507947||cs(_0x170046)&&'auto'===_0x507947||_0x2d277e===_0x507947||_0x1bd7b5['startsWith'](_0x507947);}['_getModelById'](_0x2343da,_0x469ab4){return _0x2343da['find'](_0x1e38ac=>cs(_0x1e38ac)&&'auto'===_0x469ab4?_0x1e38ac:_0x1e38ac['id']===_0x469ab4)||null;}}function cs(_0x3b1476){return _0x3b1476['id']['startsWith']('agent');}function ls(_0x1454e1){return _0x1454e1?_0x1454e1 instanceof _0x5ca812?[_0x1454e1]:_0x1454e1['editors']&&0x0!==_0x1454e1['editors']['length']?Array['from'](_0x1454e1['editors']):[]:[];}function us(_0x41ddee){const _0x5727d5=ls(_0x41ddee);if(!_0x5727d5['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x5727d5['length'])return _0x5727d5[0x0];const _0x4faa4a=_0x5727d5['find'](_0xd9efbf=>_0xd9efbf['ui']?.['focusTracker']?.['isFocused']);if(_0x4faa4a)return _0x4faa4a;const _0x1a17a3=function(_0x1de914){if(_0x1de914 instanceof _0x5ca812)return;const _0x32c394=_0x1de914;if(!_0x32c394['plugins']||!_0x32c394['plugins']['has']('AIEditing'))return;const _0x368faa=_0x32c394['plugins']['get']('AIEditing');return _0x368faa['getLastContentFocusedEditor']?.();}(_0x41ddee);return _0x1a17a3&&_0x5727d5['includes'](_0x1a17a3)?_0x1a17a3:_0x5727d5[0x0];}function ds(_0x4ab0b2){return us(_0x4ab0b2);}function _s({editor:_0x466a34,interaction:_0x11c9c1,reply:_0x5f0d0b,groups:_0x456bfa,transform:_0x5da98d,documentCompare:_0x348595,documentCompareOptions:_0x106dad,documentContextSlice:_0x8be79}){const _0x4144e9=_0x11c9c1['getDocumentContext']();if(!_0x4144e9)return[];const _0x549ed4=_0x5f0d0b['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0xd8b362}of _0x456bfa){const _0x3fd68d=_0xd8b362['filter'](_0x1b17b9=>'new'!=_0x1b17b9['type'])['map'](_0x1218ee=>Wi('data-id',_0x1218ee['id'],_0x549ed4)),_0x586d48=_0xd8b362['filter'](_0x1e9f5a=>'removed'!=_0x1e9f5a['type'])['map'](_0x4e6a75=>_0x4e6a75['node']['cloneNode'](!0x0));let _0x186c7b=null;if(_0x3fd68d['length']){_0x186c7b=_0x3fd68d[0x0]['previousSibling'];for(let _0x53a175=0x0;_0x53a175<_0x3fd68d['length'];_0x53a175++)_0x32f2bc(_0x3fd68d[_0x53a175]);}if(_0x586d48['length']){_0x186c7b||(_0xd8b362[0x0]['anchorId']?_0x186c7b=Wi('data-id',_0xd8b362[0x0]['anchorId'],_0x549ed4):(_0x186c7b=_0x586d48['shift'](),_0x59f22f(_0x549ed4,_0x186c7b)));for(let _0x124e6a=0x0;_0x124e6a<_0x586d48['length'];_0x124e6a++)_0x5a70f4(_0x186c7b,_0x586d48[_0x124e6a]),_0x186c7b=_0x586d48[_0x124e6a];}}let _0x590a45,_0xb80f4e,_0x399f6c,_0x7cffc2=_0x106dad;if(_0x8be79){_0x590a45=_0x8be79['html'],_0x399f6c=_0x8be79['version'],_0x7cffc2={..._0x106dad,'anchor':_0x8be79['rootName']};const _0x3a9ef3=new _0x34e0db([]),_0x46e9b7=_0x549ed4['children'],_0x1220b3=_0x5f0d0b['dataIdDocumentSources'],_0x20eec8=_0x5f0d0b['newNodeAnchorIds'],_0x211041=_0x8be79['editor'],_0x403f7f=_0x8be79['rootName'],_0x4bf6ff=new Array(_0x46e9b7['length']),_0x3cd1f5=_0x124abf=>_0x124abf?_0x124abf['editor']===_0x211041&&_0x124abf['rootName']===_0x403f7f:void 0x0;for(let _0xa18ac7=0x0;_0xa18ac7<_0x46e9b7['length'];_0xa18ac7++){const _0x1c5b79=$i(_0x46e9b7[_0xa18ac7],'data-id');if(!_0x1c5b79)continue;const _0x3ca368=_0x3cd1f5(_0x1220b3?.['get'](_0x1c5b79));if(void 0x0!==_0x3ca368){_0x4bf6ff[_0xa18ac7]=_0x3ca368;continue;}const _0x46ab95=_0x20eec8['get'](_0x1c5b79),_0x138cb4=_0x46ab95?_0x3cd1f5(_0x1220b3?.['get'](_0x46ab95)):void 0x0;void 0x0!==_0x138cb4&&(_0x4bf6ff[_0xa18ac7]=_0x138cb4);}for(let _0x2c1b01=0x0;_0x2c1b01<_0x46e9b7['length'];_0x2c1b01++)if(void 0x0===_0x4bf6ff[_0x2c1b01]){for(let _0x16cda7=_0x2c1b01-0x1;_0x16cda7>=0x0;_0x16cda7--)if(void 0x0!==_0x4bf6ff[_0x16cda7]){_0x4bf6ff[_0x2c1b01]=_0x4bf6ff[_0x16cda7];break;}if(void 0x0===_0x4bf6ff[_0x2c1b01]){for(let _0x3c6ee3=_0x2c1b01+0x1;_0x3c6ee3<_0x46e9b7['length'];_0x3c6ee3++)if(void 0x0!==_0x4bf6ff[_0x3c6ee3]){_0x4bf6ff[_0x2c1b01]=_0x4bf6ff[_0x3c6ee3];break;}}}for(let _0x397c4d=0x0;_0x397c4d<_0x46e9b7['length'];_0x397c4d++)_0x4bf6ff[_0x397c4d]&&_0x3a9ef3['children']['push'](_0x118fd9(_0x46e9b7[_0x397c4d],!0x0));_0xb80f4e=Ki(_0x3a9ef3);}else _0x590a45=_0x4144e9['content'],_0x399f6c=_0x4144e9['version'],_0xb80f4e=Ki(_0x549ed4);const _0xf20e54=_0x348595['getDiff'](_0x590a45,_0xb80f4e,{..._0x7cffc2,'targetEditor':_0x466a34})['getOperations']();if(_0x5da98d){const _0x453a5e=_0x466a34['model']['document']['history']['getOperations'](_0x399f6c),_0x1e07fc={'document':_0x466a34['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x27476f(_0xf20e54,_0x453a5e,_0x1e07fc)['operationsA'];}return _0xf20e54;}function Is(_0x2a9582,_0x2b8df2){if('marker'!=_0x2b8df2['type'])return;const _0x50e606=_0x2a9582['model']['markers']['get'](_0x2b8df2['name']);_0x50e606&&(_0x2b8df2['oldRange']=_0x50e606['getRange']());}class AIChatController extends _0x23f270{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[AIConnector,_0x53dd97];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0xc8d146=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0xdcd1e4,_0x58592a)=>{this['_handleUIUserMessage']({'message':_0x58592a});}),this['listenTo'](_0xc8d146['view'],'change:activeTab',(_0x3fe601,_0x75305c,_0x47c615)=>{'chat'!==_0x47c615&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x1a8bf6,_0x5a9da8)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x5a9da8));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x5807c9,_0xb75ba6)=>{this['activeConversation']?.['addUrlToContext'](_0xb75ba6);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x65b904,_0x161d1e)=>{_0x161d1e['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x37ba2f,_0x3b4be3)=>{this['activeConversation']?.['addResourceToContext'](_0x3b4be3['source'],_0x3b4be3['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2da00a,_0x25cc3d)=>{this['_removeFromContext'](_0x25cc3d);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1662e6,_0x2be99a)=>{this['activeConversation']?.['loadSourceResources'](_0x2be99a['sourceId'],_0x2be99a['query'],_0x2be99a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x45fea8,_0x9ca6a4)=>{this['activeConversation']?.['setModel'](_0x9ca6a4);}),this['listenTo'](this['_aiChatUi'],'like',(_0x41a574,{replyId:_0x3700a0})=>{console['log']('Liked\x20response',_0x3700a0);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4b7b8e,{replyId:_0x3b7d6a})=>{console['log']('Disliked\x20response',_0x3b7d6a);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3d894c,_0x254df5)=>{this['_insertSuggestion'](_0x254df5);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x49e6ee,{replyId:_0x4bf33a,partIndex:_0x4e9a1a})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4bf33a,_0x4e9a1a);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x557fd4,{replyId:_0x16f7a4,partIndex:_0x26f507})=>{const _0x400657=this['_getDocumentRangeForReplyChanges'](_0x16f7a4,_0x26f507);_0x400657&&'$graveyard'!=_0x400657['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x400657['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5f2636,_0xd12d30)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0xd12d30);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2219cd,{replyId:_0x4bb893,showDiff:_0x231a56})=>{const {reply:_0x3edbbb}=this['getInteractionAndReplyById'](_0x4bb893),_0x3d3eca=_0x3edbbb['getContentParts']({'showDiff':_0x231a56,'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3edbbb['id'],'parts':_0x3d3eca});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x51256c,{replyId:_0x340dc1,partIndex:_0x2d9326})=>{this['_rejectSuggestion']({'replyId':_0x340dc1,'partIndex':_0x2d9326}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x573420,_0x1cb3cc)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x1cb3cc);}),this['on']('replyCreated',(_0x11077a,_0x2843a0)=>{this['_addFeedItemReply'](_0x2843a0);});}async['afterInit'](){this['context']instanceof _0x5ca812?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2de6f4,_0x1efacb)=>{_0x1efacb['on']('ready',()=>{this['_integrateEditor'](_0x1efacb);});});const _0x4bc547=this['context']['config']['get']('ai.chat.initialConversation');let _0x2f858a=_0x4bc547;if('lastCreated'!=_0x4bc547||(_0x2f858a=await this['_getLastCreatedConversationId'](),_0x2f858a))return'new'==_0x2f858a?this['_startConversationSafely']():this['loadConversation'](_0x2f858a);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x550a02){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x550a02)['getConversation'](),await this['_startConversationSafely']({'id':_0x550a02}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x550a02,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x296655){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x550a02}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x296655}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x1ffe67){let _0x5a6725=null,_0x4f9fd6=null;this['on']('toolDataReceived',(_0x5d2253,_0x5b5cfc,_0x20addd)=>{_0x20addd['id']!==_0x5a6725&&(_0x5a6725=_0x20addd['id'],_0x4f9fd6=this['_getAIChatFeedAPI'](_0x20addd)),_0x1ffe67(_0x5b5cfc,_0x4f9fd6);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](Hi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x53a790=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x53a790),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x675739){await this['_startConversationSafely']({'modelId':_0x675739?.['modelId']});}async['sendMessage'](_0x52d8e4){await this['_handleUIUserMessage'](_0x52d8e4);}['getGroupId'](){const _0xb47994=this['context']['config']['get']('collaboration.channelId');if(!_0xb47994)throw new at('ai-missing-channel-id',this);return _0xb47994;}['_handleRemovedConversation'](_0x5b4feb){this['activeConversation']['id']===_0x5b4feb&&this['_startConversationSafely']();}['_insertSuggestion'](_0x4a209c){const _0x35d093=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x2e9676,interaction:_0xcf9259}=this['getInteractionAndReplyById'](_0x4a209c['replyId']),_0x2c7f3d=void 0x0!==_0x4a209c['partIndex']?[_0x2e9676['changeGroups'][_0x4a209c['partIndex']]]:_0x2e9676['changeGroups']['filter'](_0x3fd036=>'pending'==_0x3fd036['state']);for(const _0x572e9d of this['_groupChangesByTarget'](_0x2e9676,_0x2c7f3d)){const {target:_0xc06464,groups:_0x3cc461,groupsIndexes:_0x54d0fe,slice:_0x279614}=_0x572e9d;if(!_0xc06464['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x2f9432=this['_getDocumentRangeForReplyChanges'](_0x4a209c['replyId'],_0x54d0fe[0x0]);if(!_0x2f9432||'$graveyard'==_0x2f9432['range']['root']['rootName']){_0x54d0fe['forEach'](_0x2eda5b=>_0x2e9676['setChangeGroupState'](_0x2eda5b,'outdated'));continue;}_0x54d0fe['forEach'](_0x19bd79=>_0x2e9676['setChangeGroupState'](_0x19bd79,'accepted'));const _0x522aa4=_s({'editor':_0xc06464['editor'],'reply':_0x2e9676,'interaction':_0xcf9259,'groups':_0x3cc461,'transform':!0x0,'documentCompare':_0x35d093,'documentCompareOptions':{'anchor':_0x279614?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x279614});let _0x2c0cba;this['_scrollToSuggestionRange'](_0x2f9432['range'],!0x1,_0xc06464['editor']),_0xc06464['editor']['model']['change'](_0x34d09b=>{_0x2c0cba=_0x34d09b['batch'],_0xc06464['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x522aa4),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x2c0cba,{'interactionId':_0xcf9259['id'],'replyId':_0x2e9676['id'],'indexes':_0x54d0fe['slice']()});}this['_updateRatings'](_0x2e9676);}['_applySuggestion'](_0x3f8ecc){const _0x1c1c07=this['context']['plugins']['get'](_0x53dd97),{reply:_0x1c350a,interaction:_0x22fc46}=this['getInteractionAndReplyById'](_0x3f8ecc['replyId']),_0x3c08cf=void 0x0!==_0x3f8ecc['partIndex']?[_0x1c350a['changeGroups'][_0x3f8ecc['partIndex']]]:_0x1c350a['changeGroups']['filter'](_0x5dd279=>'pending'==_0x5dd279['state']);for(const _0x83dbb5 of this['_groupChangesByTarget'](_0x1c350a,_0x3c08cf)){const {target:_0x33dc4f,groups:_0x2ddca9,groupsIndexes:_0x341e10,slice:_0x28f2de}=_0x83dbb5,_0x2d6ff0=this['_getDocumentRangeForReplyChanges'](_0x3f8ecc['replyId'],_0x341e10[0x0]);if(!_0x2d6ff0||'$graveyard'==_0x2d6ff0['range']['root']['rootName']){_0x341e10['forEach'](_0x76a758=>_0x1c350a['setChangeGroupState'](_0x76a758,'outdated'));continue;}_0x341e10['forEach'](_0x4698a0=>_0x1c350a['setChangeGroupState'](_0x4698a0,'accepted'));const _0x52e7cc=_s({'editor':_0x33dc4f['editor'],'reply':_0x1c350a,'interaction':_0x22fc46,'groups':_0x2ddca9,'transform':!0x0,'documentCompare':_0x1c1c07,'documentCompareOptions':{'anchor':_0x28f2de?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x28f2de});let _0x633f9b;this['_scrollToSuggestionRange'](_0x2d6ff0['range'],!0x1,_0x33dc4f['editor']),_0x33dc4f['editor']['model']['change'](_0x5d2295=>{_0x633f9b=_0x5d2295['batch'];for(const _0x3f6716 of _0x52e7cc)_0x3f6716['baseVersion']=_0x33dc4f['editor']['model']['document']['version'],Is(_0x33dc4f['editor'],_0x3f6716),_0x5d2295['batch']['addOperation'](_0x3f6716),_0x33dc4f['editor']['model']['applyOperation'](_0x3f6716);}),this['_batchToChanges']['set'](_0x633f9b,{'interactionId':_0x22fc46['id'],'replyId':_0x1c350a['id'],'indexes':_0x341e10['slice']()});}this['_updateRatings'](_0x1c350a);}['_rejectSuggestion'](_0x490443){const {reply:_0x47ced9}=this['getInteractionAndReplyById'](_0x490443['replyId']);_0x47ced9['setChangeGroupState'](_0x490443['partIndex'],'rejected');}['_openBalloonFor'](_0x2b385c,_0x318f4b){if(!this['_aiChatBalloon'])return;const {reply:_0x208934}=this['getInteractionAndReplyById'](_0x2b385c),_0x201505=_0x208934['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});let _0x13b558,_0x56e5f6;if(void 0x0!==_0x318f4b?(_0x56e5f6=_0x201505['find'](_0x174f34=>_0x174f34['index']==_0x318f4b),_0x13b558=_0x56e5f6?.['index']):(_0x56e5f6=_0x201505[0x0],_0x13b558=_0x56e5f6['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x2b385c&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x13b558)return;const _0xbe245a=this['_getUserPresentableContentPartDocumentRange'](_0x2b385c,_0x208934,_0x56e5f6),_0x356d42=_0x208934['changeGroups']['find'](_0x339e9f=>_0x339e9f['index']==_0x13b558),_0x9283c6=_0x356d42?this['_resolveGroupTarget'](_0x208934,_0x356d42):null,_0x2aa77a=_0x9283c6?.['editor']??ds(this['context']),_0xb74bd5=_0x2aa77a['plugins']['has']('AIChatBalloon')?_0x2aa77a['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0xb74bd5&&this['_activeBalloon']['close'](),!_0xbe245a)return _0xb74bd5['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0xb74bd5,this['_currentPreviewedChangeGroup']={'replyId':_0x2b385c,'partIndex':_0x13b558},this['_scrollToSuggestionRange'](_0xbe245a,!0x0,_0x2aa77a);const _0x46bd7e=this['_getPresentableSiblingContentPartIndex'](_0x2b385c,_0x13b558,'next');_0xb74bd5['updateContent']({'part':_0x56e5f6,'renderingStrategy':'static'}),_0xb74bd5['open']({'index':_0x13b558,'title':Hi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x13b558+0x1)['toString']()),'showRotator':null!==_0x46bd7e,'ranges':[_0xbe245a],'areActionsDisabled':_0x208934['areActionsDisabled'],'targetEditor':_0x2aa77a}),_0xb74bd5['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x2b385c,_0x13b558),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2b385c,'index':_0x13b558,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x263b33,_0x595602,_0x556041){const {reply:_0x107b29}=this['getInteractionAndReplyById'](_0x263b33),_0x542022=_0x107b29['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});if(0x1==_0x542022['length'])return null;const _0x43aebd=_0x542022['findIndex'](_0x33ed85=>_0x33ed85['index']==_0x595602),_0x4efecf='next'==_0x556041?0x1:-0x1;let _0x5aed69=_0x542022['at']((_0x43aebd+_0x4efecf)%_0x542022['length'])['index'],_0x40fd2a=_0x542022[_0x5aed69];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x263b33,_0x107b29,_0x40fd2a);){if(_0x5aed69=_0x542022['at']((_0x5aed69+_0x4efecf)%_0x542022['length'])['index'],_0x5aed69===_0x43aebd)return null;_0x40fd2a=_0x542022[_0x5aed69];}return _0x5aed69;}['_getUserPresentableContentPartDocumentRange'](_0x18421f,_0x154f0e,_0x46fef6){const _0x229d0c=_0x154f0e['changeGroups'];if(!_0x46fef6['hasChanges'])return null;const _0x11c18d=_0x229d0c['find'](_0x158b89=>_0x158b89['index']==_0x46fef6['index']);if('pending'!==_0x11c18d?.['state'])return null;const _0x49cf62=this['_getDocumentRangeForReplyChanges'](_0x18421f,_0x46fef6['index']);if(!_0x49cf62)return _0x154f0e['setChangeGroupState'](_0x46fef6['index'],'outdated'),null;const {range:_0x57429e,currentIndex:_0x4edd09}=_0x49cf62;return'$graveyard'==_0x57429e['root']['rootName']?(_0x154f0e['setChangeGroupState'](_0x4edd09,'outdated'),null):_0x49cf62['range'];}['_getDocumentRangeForReplyChanges'](_0x58f9b0,_0x24858f){const {reply:_0xf26436}=this['getInteractionAndReplyById'](_0x58f9b0),_0x1cec26=_0xf26436['changeGroups']['filter'](_0x47c4f3=>'pending'==_0x47c4f3['state']),_0x415fe0=_0x1cec26['map'](_0x3a5275=>_0xf26436['changeGroups']['indexOf'](_0x3a5275));void 0x0===_0x24858f&&(_0x24858f=_0x415fe0[0x0]);const _0x35f20c=_0x415fe0['indexOf'](_0x24858f);if(-0x1==_0x35f20c)return null;const _0x39aa5c=_0x1cec26[_0x35f20c],_0x247028=this['_resolveGroupTarget'](_0xf26436,_0x39aa5c);if(!_0x247028)return null;const {editor:_0x3a7476,root:_0x2a4fb7,parsedDocumentContent:_0x5cec3e,serializedDocumentContent:_0xbd1f0b,version:_0x2ea9a7}=_0x247028,_0x5bcee2=new _0x34e0db([]),_0x14a052=new _0x34e0db([]);for(const _0x4cff96 of _0x39aa5c['changes']){const _0x5ba4c2=this['activeConversation']?.['getSourceByDataId'](_0x4cff96['id']);if((!_0x5ba4c2||_0x5ba4c2['editor']===_0x247028['editor']&&_0x5ba4c2['rootName']===_0x247028['root']['rootName'])&&('removed'!=_0x4cff96['type']&&_0x14a052['children']['push'](_0x4cff96['node']['cloneNode'](!0x0)),'new'!=_0x4cff96['type'])){const _0xbde07e=_0x4e94ee(_0x2dca16=>$i(_0x2dca16,'data-id')==_0x4cff96['id'],_0x5cec3e,!0x0);if(!_0xbde07e)return null;_0x5bcee2['children']['push'](_0xbde07e['cloneNode'](!0x0));}}if(0x0==_0x5bcee2['children']['length']){if(_0x39aa5c['changes'][0x0]['anchorId']){const _0x13e20e=Wi('data-id',_0x39aa5c['changes'][0x0]['anchorId'],_0x5cec3e);_0x5bcee2['children']['unshift'](_0x13e20e['cloneNode'](!0x0)),_0x14a052['children']['unshift'](_0x13e20e['cloneNode'](!0x0)),_0x13e20e['nextSibling']&&(_0x5bcee2['children']['push'](_0x13e20e['nextSibling']['cloneNode'](!0x0)),_0x14a052['children']['push'](_0x13e20e['nextSibling']['cloneNode'](!0x0)));}else{const _0xfca5a0=_0x5cec3e['children'][0x0];if(!_0xfca5a0)return null;_0x5bcee2['children']['push'](_0xfca5a0['cloneNode'](!0x0)),_0x14a052['children']['push'](_0xfca5a0['cloneNode'](!0x0));}}const _0x5177d8=_0x3a7476['data']['parse'](_0xbd1f0b),_0x1e3b12=Ki(_0x5bcee2),_0x25558c=_0x3a7476['data']['parse'](_0x1e3b12),_0x4e449d=_0x3a7476['data']['parse'](_0x1e3b12),_0x74ebd6=_0x3a7476['model']['createPositionAt'](_0x25558c,0x0),_0x527a41=Ki(_0x14a052),_0x1674e8={'targetEditor':_0x3a7476,'anchor':_0x74ebd6,'markDeletions':!0x1},_0x833e46=_0x3a7476['plugins']['get'](_0x53dd97)['getDiff'](_0x1e3b12,_0x527a41,_0x1674e8)['getOperations']();if(!_0x833e46['length'])return null;_0x3a7476['model']['change'](_0xdd47d7=>{for(const _0x6dc74a of _0x833e46)if('remove'==_0x6dc74a['type']){const _0x4a8b08=_0x6dc74a['sourcePosition'],_0x58b2d8=_0x6dc74a['howMany'],_0xa5a88c=new _0x43c2ab(_0x4a8b08,_0x58b2d8);_0xdd47d7['batch']['addOperation'](_0xa5a88c),_0x3a7476['model']['applyOperation'](_0xa5a88c);}else'marker'!==_0x6dc74a['type']&&(_0x6dc74a['baseVersion']=null,_0x6dc74a['isDocumentOperation']=!0x1,_0xdd47d7['batch']['addOperation'](_0x6dc74a),_0x3a7476['model']['applyOperation'](_0x6dc74a));});const _0x48500d=es(_0x3a7476,_0x833e46,_0x25558c);is(_0x3a7476['model'],_0x48500d);const _0x70bf80=_0x48500d['getFirstRange']()['start']['path']['slice'](),_0x36c12d=_0x48500d['getFirstRange']()['end']['path']['slice'](),_0x12bbf8=[];let _0x8e2bc4=_0x25558c,_0x38c1b5=_0x4e449d;for(let _0x1caeb1=0x0;_0x1caeb1<_0x36c12d['length'];_0x1caeb1++){const _0x251bbd=_0x8e2bc4['maxOffset']-_0x36c12d[_0x1caeb1];_0x12bbf8[_0x1caeb1]=_0x38c1b5['maxOffset']-_0x251bbd,_0x8e2bc4=_0x8e2bc4['getChildAtOffset'](_0x36c12d[_0x1caeb1]),_0x38c1b5=_0x38c1b5['getChildAtOffset'](_0x12bbf8[_0x1caeb1]);}const _0x43d949=_0x3a7476['model']['createRange'](_0x3a7476['model']['createPositionFromPath'](_0x4e449d,_0x70bf80),_0x3a7476['model']['createPositionFromPath'](_0x4e449d,_0x12bbf8)),_0x3c9644=_0x4e449d['getChild'](0x0)['getAttribute'](_0x4140c8),_0x3115d3=Array['from'](_0x5177d8['getChildren']())['find'](_0x4e0f22=>_0x4e0f22['getAttribute'](_0x4140c8)==_0x3c9644)['getPath'](),_0xf47489=_0x43d949['start']['path']['slice'](),_0x17d4ea=_0x43d949['end']['path']['slice']();_0xf47489[0x0]=_0x3115d3[0x0]+_0xf47489[0x0],_0x17d4ea[0x0]=_0x3115d3[0x0]+_0x17d4ea[0x0];let _0x110239=_0x3a7476['model']['createRange'](_0x3a7476['model']['createPositionFromPath'](_0x2a4fb7,_0xf47489),_0x3a7476['model']['createPositionFromPath'](_0x2a4fb7,_0x17d4ea));const _0xe58401=_0x3a7476['model']['document']['history']['getOperations'](_0x2ea9a7);for(const _0x401cf8 of _0xe58401)_0x110239=_0x1445f3['_createFromRanges'](_0x110239['getTransformedByOperation'](_0x401cf8));return{'range':_0x110239,'currentIndex':_0x24858f};}['_integrateEditorBalloon'](_0x37258c){if(!_0x37258c['plugins']['has']('AIChatBalloon'))return;const _0x4ba4fa=_0x37258c['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x4ba4fa)||(this['_wiredBalloons']['add'](_0x4ba4fa),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x4ba4fa),_0x4ba4fa['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x4ba4fa,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x427404,partIndex:_0x6fa1d2}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0xc8820c}=this['getInteractionAndReplyById'](_0x427404),_0xf5327f=_0xc8820c['changeGroups']['find'](_0x197196=>_0x197196['index']===_0x6fa1d2),_0x1c6822=_0xf5327f?this['_resolveGroupTarget'](_0xc8820c,_0xf5327f):null,_0x45a562=_0xc8820c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x6fa1d2,'editor':_0x1c6822?.['editor']??ds(this['context'])});(this['_activeBalloon']??_0x4ba4fa)['updateContent']({'part':_0x45a562[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x4ba4fa,'applySuggestion',()=>{const {replyId:_0x292654,partIndex:_0x1caeae}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x292654,'partIndex':_0x1caeae}),(this['_activeBalloon']??_0x4ba4fa)['setState']('accepted');}),this['listenTo'](_0x4ba4fa,'insertSuggestion',()=>{const {replyId:_0x3c36c2,partIndex:_0xa688e2}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3c36c2,'partIndex':_0xa688e2}),(this['_activeBalloon']??_0x4ba4fa)['setState']('accepted');}),this['listenTo'](_0x4ba4fa,'rejectSuggestion',()=>{const {replyId:_0x313382,partIndex:_0x2c58de}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x313382,'partIndex':_0x2c58de}),(this['_activeBalloon']??_0x4ba4fa)['setState']('rejected');}),this['listenTo'](_0x4ba4fa,'showNext',()=>{const {replyId:_0x47af5c,partIndex:_0x55144c}=this['_currentPreviewedChangeGroup'],_0x4b69c5=this['_getPresentableSiblingContentPartIndex'](_0x47af5c,_0x55144c,'next');null!==_0x4b69c5&&this['_openBalloonFor'](_0x47af5c,_0x4b69c5);}),this['listenTo'](_0x4ba4fa,'showPrevious',()=>{const {replyId:_0x4a72ff,partIndex:_0xdd797c}=this['_currentPreviewedChangeGroup'],_0x99333e=this['_getPresentableSiblingContentPartIndex'](_0x4a72ff,_0xdd797c,'previous');null!==_0x99333e&&this['_openBalloonFor'](_0x4a72ff,_0x99333e);}),this['listenTo'](_0x4ba4fa,'dialogClosed',(_0x54fd84,{id:_0x26bcc1})=>{if('aiChatBalloon'!==_0x26bcc1)return;const {replyId:_0x1ef2b7,partIndex:_0x4c3107}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1ef2b7,'index':_0x4c3107,'isActive':!0x1}),this['_activeBalloon']===_0x4ba4fa&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x5c047b){if(this['_integrateEditorBalloon'](_0x5c047b),_0x5c047b['plugins']['has']('Undo')){const _0x12d922=_0x5c047b['commands']['get']('undo'),_0x5cf2b6=_0x5c047b['commands']['get']('redo');this['listenTo'](_0x12d922,'revert',(_0x4f36bb,_0x595c43,_0xf55d)=>{const _0x31c106=this['_batchToChanges']['get'](_0x595c43);if(!_0x31c106)return;const _0x289ef4=this['activeConversation']['getInteraction'](_0x31c106['interactionId']),_0xb4ce77=_0x289ef4?.['getReply'](_0x31c106['replyId']);this['_batchToChanges']['delete'](_0x595c43),_0x289ef4&&_0xb4ce77&&(_0x31c106['indexes']['forEach'](_0x4f9648=>_0xb4ce77['setChangeGroupState'](_0x4f9648,'pending')),this['_batchToChanges']['set'](_0xf55d,_0x31c106));}),this['listenTo'](_0x5cf2b6,'revert',(_0x1ed3ce,_0xebaa5a,_0x100d8e)=>{const _0x296b8a=this['_batchToChanges']['get'](_0xebaa5a);if(!_0x296b8a)return;const _0x1eca5f=this['activeConversation']['getInteraction'](_0x296b8a['interactionId']),_0x1cd54c=_0x1eca5f?.['getReply'](_0x296b8a['replyId']);this['_batchToChanges']['delete'](_0xebaa5a),_0x1eca5f&&_0x1cd54c&&(_0x296b8a['indexes']['forEach'](_0xff6bb=>_0x1cd54c['setChangeGroupState'](_0xff6bb,'accepted')),this['_batchToChanges']['set'](_0x100d8e,_0x296b8a));});}const _0x447cb3=_0x5c047b['config']['get']('ai.chat.context');_0x447cb3['alwaysAddSelection']&&_0x447cb3['document']['enabled']&&this['listenTo'](_0x5c047b['model']['document']['selection'],'change:range',(_0x32bf28,_0x15c878)=>{if(!_0x15c878['directChange'])return;'chat'===_0x5c047b['plugins']['get']('AITabs')['view']['activeTab']&&(_0x5c047b['model']['hasContent'](_0x5c047b['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x3460a1=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x403fc7=await _0x3460a1['getConversations']();return _0x403fc7['length']?_0x403fc7[0x0]['id']:'new';}catch(_0x8f622a){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x8f622a})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x174fa3={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x174fa3);}catch(_0x1cc025){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x174fa3['id']||ot()}),console['error'](_0x1cc025),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x117334,modelId:_0x419801}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x256a20=_0x419801;_0x256a20||(_0x117334||!this['activeConversation']?_0x256a20=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x256a20=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x51d660=this['getGroupId'](),_0x81cbe5=_0x117334||ot();let _0x2f7d1e;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x256a20,'conversationId':_0x81cbe5,'group':_0x51d660,'getEditor':()=>ds(this['context']),'getEditors':()=>ls(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x117334}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x2a0874,_0x11e7af)=>{this['_aiChatUi']['createConversation'](_0x11e7af),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x117334||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x4ae6bd,_0x163cb6)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x163cb6['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x3fa617=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3fa617);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1574de=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1574de);}),this['activeConversation']['on']('webSearchFinished',(_0x3ae739,_0x1511b1)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1511b1,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x4d8103,_0x3f7606)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3f7606,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x1557b0,_0x30dea4)=>{this['_aiChatUi']['removeFeedInteraction'](_0x30dea4['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4be8b7,_0xff3047,_0x37144f)=>{this['_updateConversationTitle'](_0xff3047,_0x37144f);}),this['activeConversation']['on']('replyContentUpdated',async(_0x574321,_0x32c332)=>{void 0x0!==_0x2f7d1e&&_0x2f7d1e!==_0x32c332['id']&&this['_updateReplyContentThrottled']['flush'](),_0x2f7d1e=_0x32c332['id'],_0x32c332['isFromHistory']?await this['_updateReplyContent']({'reply':_0x32c332}):await this['_updateReplyContentThrottled']({'reply':_0x32c332});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x50a46e,{reply:_0x2edf60,index:_0x6d6eef,state:_0x2e37fd})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x2edf60['id'],'index':_0x6d6eef,'state':_0x2e37fd}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x2edf60['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x6d6eef&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x2e37fd);}),this['activeConversation']['on']('contextItemAdded',(_0x1f3c31,_0x4c1867)=>{if(this['_aiChatUi']['addContextItem'](_0x4c1867['contextItem'],_0x4c1867['isLoading']),'selection'===_0x4c1867['contextItem']['type']){const _0x1b4f3e=[...ds(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x1b4f3e,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1d15a2,_0x595b67)=>{this['_aiChatUi']['removeContextItem'](_0x595b67['uiId']),'current-document'==_0x595b67['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x595b67['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x544ee1,_0x2a4c2d)=>{this['_aiChatUi']['setContextItemLoading'](_0x2a4c2d['contextItem']['uiId'],_0x2a4c2d['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x10d636,_0x42f1f9)=>{this['_aiChatUi']['setConversationContext'](_0x42f1f9['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x57d5de,_0x22d082)=>{this['_aiChatUi']['setAddContextOptions'](_0x22d082['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3b10b9,_0x9d3bf6)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x9d3bf6['sourceId'],_0x9d3bf6['source'],_0x9d3bf6['resources'],_0x9d3bf6['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x3f94af,_0x478fd7)=>{this['_aiChatUi']['updateResourceState'](_0x478fd7['sourceId'],_0x478fd7['resourceId'],_0x478fd7['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x313e84,_0x249963)=>{this['_aiChatUi']['updateCapabilities'](_0x249963);}),this['activeConversation']['on']('modelSelected',async(_0x1145b8,_0x52302f)=>{const _0x27bd55=(await this['_aiChatModels']['getAll']())['find'](_0x4bbf5e=>_0x4bbf5e['id']===_0x52302f['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x27bd55,_0x52302f['isDisabled']);}),this['activeConversation']['on']('error',(_0x18bcd4,{error:_0xe469fc,interactionId:_0x27b965,fileName:_0x544f6a,url:_0x896bb7,sourceId:_0x478e6b,sourceLabel:_0x8b96b3})=>{const _0x52680a=_0x27b965?_0x27b965+':'+ot():ot();_0xe469fc['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Hi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x52680a}):_0xe469fc['message']['startsWith']('ai-chat-conversation-init-failed')||_0xe469fc['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x544f6a),'id':_0x52680a}):_0xe469fc['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x896bb7),'id':_0x52680a}):_0xe469fc['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x52680a}):_0xe469fc['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x52680a}):_0xe469fc['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x478e6b&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x478e6b),this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x8b96b3||'source'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x52680a}),this['_logError'](_0xe469fc)):_0xe469fc['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x52680a}),this['_logError'](_0xe469fc)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x52680a}),this['_logError'](_0xe469fc));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x117334||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x414270,attributes:_0x1fc60c}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x377a3f=await this['_aiEditing']['getDocumentData']();_0x377a3f['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x377a3f):await this['activeConversation']['updateCurrentDocumentInContext'](_0x377a3f[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x414270,'attributes':_0x1fc60c});}['_logError'](_0x40d687){Ct(_0x40d687['message']);}['_removeFromContext'](_0x5a8fa0){this['activeConversation']?.['removeFromContext'](_0x5a8fa0);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5a6698){const [_0x503528,_0x17f5f3]=_0x5a6698['split'](':'),_0x24bcda=this['activeConversation']['getInteraction'](_0x503528),_0x27dd64=_0x24bcda['getReply'](_0x17f5f3);return{'interaction':_0x24bcda,'reply':_0x27dd64};}['_resolveGroupTarget'](_0xa50645,_0xe85ff2){const _0x476b1a=[..._0xe85ff2['changes']['filter'](_0x2a71d4=>'context'!==_0x2a71d4['type']),..._0xe85ff2['changes']['filter'](_0xc3e932=>'context'===_0xc3e932['type'])];for(const _0x1ad64e of _0x476b1a){const _0x3f67ff=_0xa50645['newNodeAnchorIds']['get'](_0x1ad64e['id']),_0x5cddcd=this['activeConversation']?.['getSourceByDataId'](_0x1ad64e['id'])||this['activeConversation']?.['getSourceByDataId'](_0x3f67ff)||this['activeConversation']?.['getSourceByDataId'](_0x1ad64e['anchorId']??void 0x0);if(_0x5cddcd){if('destroyed'===_0x5cddcd['editor']['state'])return null;const _0x313426=_0x5cddcd['editor']['model']['document']['getRoot'](_0x5cddcd['rootName']);return _0x313426?{'editor':_0x5cddcd['editor'],'root':_0x313426,'parsedDocumentContent':Fi(_0x5cddcd['content']),'serializedDocumentContent':_0x5cddcd['content'],'version':_0x5cddcd['version']}:null;}}const _0x4922ef=ds(this['context']),_0x593595=this['activeConversation']['getInteraction'](_0xa50645['interactionId']),_0x23abbc=_0x593595?.['getDocumentContext']();return{'editor':_0x4922ef,'root':_0x4922ef['model']['document']['getRoot'](),'parsedDocumentContent':_0xa50645['documentContextContent'],'serializedDocumentContent':_0x23abbc?.['content'],'version':_0x23abbc?.['version']};}['_groupChangesByTarget'](_0x408ac6,_0x460086){const _0xafe110=new Map();for(const _0x2ba45b of _0x460086){const _0x3e6c89=this['_resolveGroupTarget'](_0x408ac6,_0x2ba45b);if(!_0x3e6c89)continue;const _0xce106b=(_0x3e6c89['editor']['id']||'e')+'|'+_0x3e6c89['root']['rootName'];let _0x58b5f7=_0xafe110['get'](_0xce106b);if(!_0x58b5f7){let _0x686b8f;for(const _0x18fd67 of[..._0x2ba45b['changes']['filter'](_0x2c9fc0=>'context'!==_0x2c9fc0['type']),..._0x2ba45b['changes']['filter'](_0xcd360=>'context'===_0xcd360['type'])])if(_0x686b8f=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x18fd67['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x408ac6['newNodeAnchorIds']['get'](_0x18fd67['id'])),_0x686b8f)break;_0x58b5f7={'target':{'editor':_0x3e6c89['editor'],'root':_0x3e6c89['root']},'slice':_0x686b8f,'groups':[],'groupsIndexes':[]},_0xafe110['set'](_0xce106b,_0x58b5f7);}_0x58b5f7['groups']['push'](_0x2ba45b),_0x58b5f7['groupsIndexes']['push'](_0x408ac6['changeGroups']['indexOf'](_0x2ba45b));}return Array['from'](_0xafe110['values']());}['_scrollToSuggestionRange'](_0x111a36,_0x43c2e5=!0x1,_0x43ed31){const _0x5c4ffe={'target':_0x43ed31['editing']['view']['domConverter']['viewRangeToDom'](_0x43ed31['editing']['mapper']['toViewRange'](_0x111a36)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x43c2e5};_0x43c2e5&&(_0x5c4ffe['alignToTop']=!0x0),wt(_0x5c4ffe);}['_updateConversationTitle'](_0x23ba4e,_0x157338=!0x1){this['_aiChatUi']['setConversationTitle'](_0x23ba4e||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x157338);}['_addFeedItemReply'](_0x395fe5){'text'===_0x395fe5['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x395fe5):this['_aiChatUi']['addFeedItemAISuggestion'](_0x395fe5);}async['_updateReplyContent']({reply:_0x10dde5,renderingStrategy:_0x5d6a40}){const {id:_0x276738,interactionId:_0xdd3e1d,isDone:_0x24d046,type:_0x3a8420,parsedContent:_0x5cc0cf}=_0x10dde5,_0x1abdec=_0xdd3e1d+':'+_0x276738;if('modification'===_0x3a8420){const _0x2e56ff=_0x10dde5['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1abdec,'parts':_0x2e56ff,'isDone':_0x24d046,'skipLoadingEffects':_0x10dde5['isFromHistory']});}else'text'===_0x3a8420&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1abdec,'parsedContent':_0x5cc0cf,'renderingStrategy':_0x5d6a40,'isDone':_0x24d046});_0x24d046&&_0x10dde5['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1abdec,_0x10dde5['sources']);}['_updateReplyContentThrottled']=_0x121c0b(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x15c259=this['activeConversation']?.['lastInteraction'];_0x15c259&&(_0x15c259['stop'](),this['_aiChatUi']['stopInteraction'](_0x15c259)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x254777=this['activeConversation']?.['lastInteraction'];if(_0x254777){for await(const _0x12bab7 of _0x254777['replies'])this['_aiChatUi']['hasFeedItem'](_0x12bab7['id'])||this['_addFeedItemReply'](_0x12bab7),await this['_updateReplyContent']({'reply':_0x12bab7,'renderingStrategy':'static'});}}['_updateRatings'](_0x135739){const _0x18461b={'positiveCount':_0x135739['changeGroups']['filter'](_0x32a473=>'accepted'===_0x32a473['state'])['length'],'totalCount':_0x135739['changeGroups']['length'],'modificationId':_0x135739['id']},_0xcf3b1c=this['activeConversation']['getInteraction'](_0x135739['interactionId'])['messageId'];_0xcf3b1c&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0xcf3b1c,_0x18461b);}['_getAIChatFeedAPI'](_0x453790){const _0x414c18=this['_aiChatUi'],_0x4e532f=()=>{_0x453790['resetWebSearchState'](),_0x453790['resetReasoningState'](),_0x414c18['clearLoadingMessage']();},_0x24fa35=()=>{_0x453790['currentReply']&&(_0x453790['currentReply']['done'](),_0x453790['currentReply']=void 0x0);};return{'insertTextReply':(_0x5a563d,_0x45d9ce)=>{_0x24fa35(),_0x4e532f();const _0xdd8350=_0x453790['currentReply']=_0x453790['createReply']({'type':'text','interactionId':_0x453790['id'],'content':_0x5a563d,'id':_0x45d9ce||ot()});return _0x24fa35(),_0xdd8350;},'insertCustomElement':async(_0x5103c5,_0x3fe8c3)=>(_0x24fa35(),_0x4e532f(),_0x414c18['addFeedItemCustomElement'](_0x5103c5,_0x3fe8c3||ot())),'setLoadingMessage':_0xa161d3=>{_0x414c18['setLoadingMessage'](_0xa161d3);},'clearLoadingMessage':()=>{_0x414c18['clearLoadingMessage']();}};}}const As='ai-selection',gs=['br'];class AIEditing extends _0x23f270{constructor(_0x1710de){super(_0x1710de),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}get['sessionId'](){if(!this['_sessionId']){const _0x35f79c=ls(this['context']),_0x4bb4ef=_0x35f79c['find'](_0x1fa0ce=>_0x1fa0ce['plugins']['has']('RealTimeCollaborationClient'))||_0x35f79c[0x0],_0x2c3939=_0x4bb4ef['plugins']['has']('RealTimeCollaborationClient')&&_0x4bb4ef['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x2c3939||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0xefe66b=ls(this['context']);if(!_0xefe66b['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x45f77a=[],_0x299fd7=new Set();for(const _0x2c495d of _0xefe66b){const _0x4feb9d=_0x2c495d['config']['get']('roots')||{};for(const _0x10779f of _0x2c495d['model']['document']['getRoots']()){if('$graveyard'===_0x10779f['rootName'])continue;const _0x37dfb4=await this['_getDocumentDataForEditorRoot'](_0x2c495d,_0x10779f,_0x299fd7),_0x298661=_0x4feb9d[_0x10779f['rootName']];let _0x123748;_0x298661?.['label']?_0x123748=_0x298661['label']:(gt('ai-document-root-missing-label',{'editor':_0x2c495d,'rootConfig':_0x298661}),_0x123748=_0x10779f['rootName']),_0x45f77a['push']({'editor':_0x2c495d,'rootName':_0x10779f['rootName'],'content':_0x37dfb4['content'],'version':_0x37dfb4['version'],'sessionId':this['sessionId'],'channelId':_0x2c495d['config']['get']('collaboration.channelId'),'selections':_0x37dfb4['selections'],'name':_0x123748,'description':_0x298661?.['description']});}}return _0x45f77a;}async['_getDocumentDataForEditorRoot'](_0x13fcf7,_0x2fa661,_0x2ffddb){const _0x2bfc7a=_0x13fcf7['data']['toView'](_0x2fa661,{'convertAiChatSelectionMarker':!0x0}),_0x208fc1=new _0x4b9165(_0x13fcf7['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x2bfc7a,_0x208fc1,_0x2ffddb);let _0x382c6d=await this['_getDocumentDataStringFromView'](_0x2bfc7a,_0x13fcf7);const _0x399a62=this['_getMarkersInDocumentOrder'](_0x13fcf7,_0x2fa661),_0x5bb59b=[];for(const _0x35fc3a of _0x399a62){const _0x4a24cf='<'+_0x35fc3a['name']+':start></'+_0x35fc3a['name']+':start>',_0xd6e017=_0x382c6d['indexOf'](_0x4a24cf);_0x382c6d=_0x382c6d['substring'](0x0,_0xd6e017)+_0x382c6d['substring'](_0xd6e017+_0x4a24cf['length']);const _0x3bcf74='<'+_0x35fc3a['name']+':end></'+_0x35fc3a['name']+':end>',_0x3a651b=_0x382c6d['indexOf'](_0x3bcf74);_0x382c6d=_0x382c6d['substring'](0x0,_0x3a651b)+_0x382c6d['substring'](_0x3a651b+_0x3bcf74['length']),_0x5bb59b['push']({'markerName':_0x35fc3a['name'],'start':_0xd6e017,'end':_0x3a651b,'htmlFragment':_0x382c6d['substring'](_0xd6e017,_0x3a651b)});}return{'content':_0x382c6d,'version':_0x13fcf7['model']['document']['version'],'selections':_0x5bb59b};}async['afterInit'](){this['context']instanceof _0x5ca812?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xd76274,_0x4c631e)=>{_0x4c631e['on']('ready',()=>{this['_integrateEditor'](_0x4c631e);});});}['_setOutputDataProcessor'](_0x42862f){this['_outputDataProcessor']=_0x42862f;}async['_getDocumentDataStringFromView'](_0x1b7e5c,_0x807a06){let _0x28fa97;if(this['_outputDataProcessor']){const _0x644e03=_0x807a06['data']['processor']['domConverter']['viewToDom'](_0x1b7e5c),_0x556e60=await this['_outputDataProcessor'](_0x644e03);_0x28fa97=_0x807a06['data']['processor']['htmlWriter']['getHtml'](_0x556e60);}else _0x28fa97=_0x807a06['data']['processor']['toData'](_0x1b7e5c);return _0x28fa97;}['_integrateEditor'](_0x5fb0d5){if(!_0x5fb0d5['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x5fb0d5);_0x5fb0d5['ui']['focusTracker']['on']('change:isFocused',(_0x3322f8,_0x193897,_0x23229e)=>{_0x23229e&&(this['_lastContentFocusedEditor']=_0x5fb0d5);}),_0x5fb0d5['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x5fb0d5&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x5fb0d5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':As,'view':({markerName:_0x2c389c})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x2c389c['split'](':')[0x1]],'priority':0xc})}),_0x5fb0d5['conversion']['for']('dataDowncast')['markerToElement']({'model':As+':context','view':(_0xe9606d,{writer:_0x1b7734,options:_0x1b9091})=>_0x1b9091['convertAiChatSelectionMarker']?_0x1b7734['createUIElement'](_0xe9606d['markerName']+':'+(_0xe9606d['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3fbc93){const _0x683c97=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x3fbc93);const _0x1cad92=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x683c97,_0x1cad92);}['hideFakeVisualSelection'](_0x5546b6){const _0x5341e7=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x5546b6);const _0x2d7d39=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5341e7,_0x2d7d39);}async['modelToDataWithIds'](_0x4aba89){const _0x41cf73=ds(this['context']),_0x35c8b3=_0x41cf73['data']['toView'](_0x4aba89),_0x53b93a=new _0x4b9165(_0x41cf73['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x35c8b3,_0x53b93a),this['_getDocumentDataStringFromView'](_0x35c8b3,_0x41cf73);}['_setDataIdsOnChildren'](_0x4939ae,_0x435fd4,_0xee2183=new Set()){let _0x47aa30=!0x1;for(const _0x597be6 of _0x4939ae['getChildren']()){if(!_0x597be6['is']('view:element')||gs['includes'](_0x597be6['name']))continue;const _0xebfb84=_0x597be6['is']('view:containerElement'),_0x542c40=_0x597be6['is']('view:emptyElement'),_0x5a34ac=this['_setDataIdsOnChildren'](_0x597be6,_0x435fd4,_0xee2183);if(_0x597be6['hasAttribute']('data-id')){_0x47aa30=!0x0,_0xee2183['add'](_0x597be6['getAttribute']('data-id'));continue;}(_0xebfb84||_0x542c40||_0x5a34ac)&&(_0x435fd4['setAttribute']('data-id',this['_nextDataId'](_0xee2183),_0x597be6),_0x47aa30=!0x0);}return _0x47aa30;}['_nextDataId'](_0x46da66){let _0x24387e;do{_0x24387e='';for(let _0x595571=0x0;_0x595571<0x4;_0x595571++)_0x24387e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x46da66['has'](_0x24387e));return _0x46da66['add'](_0x24387e),_0x24387e;}['getSelectionText'](){const {model:_0xe8e936}=ds(this['context']),_0x21dae9=_0xe8e936['document']['selection'],_0x41a0b=[],_0x2fa1da=Array['from'](_0x21dae9['getRanges']());_0x2fa1da['sort']((_0xe71621,_0x372bf3)=>_0xe71621['start']['isBefore'](_0x372bf3['start'])?-0x1:0x1);for(const _0x555888 of _0x2fa1da)for(const _0x2f58af of _0x555888['getItems']())_0x2f58af['is']('$textProxy')?_0x41a0b['push'](_0x2f58af['data']):_0x2f58af['is']('element')&&_0x41a0b['length']>0x0&&'\x20'!==_0x41a0b[_0x41a0b['length']-0x1]&&_0x41a0b['push']('\x20');return _0x41a0b['length']?'\x22'+_0x41a0b['join']('')['trim']()+'\x22':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x5b2974){for(let _0xd44fa7=0x0;_0xd44fa7<this['_fakeSelections']['length'];_0xd44fa7++)if(this['_fakeSelections'][_0xd44fa7]['id']==_0x5b2974)return void this['_fakeSelections']['splice'](_0xd44fa7,0x1);}['_addFakeSelection'](_0x413b78){this['_removeFakeSelectionById'](_0x413b78['id']),Tt(this['_fakeSelections'],_0x413b78);}['_refreshFakeSelection'](_0x31aaf8,_0x1262af){if(_0x31aaf8==_0x1262af)return;const _0x1f274d=_0x31aaf8?this['_getEditorForFakeSelection'](_0x31aaf8):null,_0x42b6de=_0x1262af?this['_getEditorForFakeSelection'](_0x1262af):null,_0x54db67=(_0x1c4a90,_0x3be55f)=>{const _0x5966e3=_0x3be55f['model']['markers']['getMarkersGroup'](As);for(const _0x4314ce of _0x5966e3)_0x1c4a90['removeMarker'](_0x4314ce);},_0xe40967=(_0x836a71,_0x3cc333,_0x18eca4)=>{const _0x14b133=_0x3cc333['model'];for(let _0x4afcd7=0x0;_0x4afcd7<_0x18eca4['ranges']['length'];_0x4afcd7++){let _0x2079d4=_0x18eca4['ranges'][_0x4afcd7];const _0x3d3864=As+':'+_0x18eca4['id']+':'+_0x4afcd7;if(_0x2079d4['start']['isAtEnd']){const _0x2cf6d7=_0x2079d4['start']['getLastMatchingPosition'](({item:_0x375b5a})=>!_0x14b133['schema']['isContent'](_0x375b5a),{'boundaries':_0x2079d4});_0x2079d4=_0x836a71['createRange'](_0x2cf6d7,_0x2079d4['end']);}_0x836a71['addMarker'](_0x3d3864,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2079d4});}};_0x1f274d&&_0x42b6de&&_0x1f274d===_0x42b6de&&_0x1262af?_0x1f274d['model']['change'](_0x45feae=>{_0x54db67(_0x45feae,_0x1f274d),_0xe40967(_0x45feae,_0x42b6de,_0x1262af);}):(_0x1f274d&&_0x1f274d['model']['change'](_0x4b9454=>_0x54db67(_0x4b9454,_0x1f274d)),_0x42b6de&&_0x1262af&&_0x42b6de['model']['change'](_0x587f3a=>_0xe40967(_0x587f3a,_0x42b6de,_0x1262af)));}['_getEditorForFakeSelection'](_0x3fcfda){if(!_0x3fcfda['ranges']['length'])return ds(this['context']);const _0x5840ed=_0x3fcfda['ranges'][0x0]['root']['document'];return ls(this['context'])['find'](_0x116709=>_0x116709['model']['document']===_0x5840ed)??ds(this['context']);}['_getMarkersInDocumentOrder'](_0x57a18e,_0x3f9340){const _0x3a127a=Array['from'](_0x57a18e['model']['markers']['getMarkersGroup'](As+':context'));return(_0x3f9340?_0x3a127a['filter'](_0x216a71=>{const _0x470108=_0x216a71['getRange']();return _0x470108&&_0x470108['root']['rootName']===_0x3f9340['rootName'];}):_0x3a127a)['sort']((_0x2eb91b,_0x3c9b5d)=>_0x2eb91b['getStart']()['isBefore'](_0x3c9b5d['getStart']())?-0x1:_0x2eb91b['getStart']()['isAfter'](_0x3c9b5d['getStart']())?0x1:0x0);}}const Cs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],ms=[...Cs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function ps(_0x2ead7f){const _0x8e0295=new AbortController();return{'promise':new Promise((_0x204bfd,_0x5af608)=>{const _0x55d0fa=setTimeout(_0x204bfd,_0x2ead7f);_0x8e0295['signal']['addEventListener']('abort',()=>{clearTimeout(_0x55d0fa),_0x5af608();});}),'abortController':_0x8e0295};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x3d9bc4){this['options']={'delay':_0x3d9bc4?.['delay']??0xa,'textNodeStyle':_0x3d9bc4?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x282c8a,targetElement:_0x3d2810,abortSignal:_0x1eaaea}){this['isStreaming']&&this['stop'](),_0x1eaaea?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x118fd9(_0x282c8a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x4c4053=0x0;_0x4c4053<this['currentIndex'];_0x4c4053++)this['nodesList'][_0x4c4053]['shouldBeStreamed']=!0x0;do{const _0x1f2d91=Date['now'](),_0x574874=this['nodesList'][this['currentIndex']],_0x5f0fb2=_0x1f2d91-this['lastUpdateTime'];if(_0x574874){_0x574874['shouldBeStreamed']=!0x0;let _0x36c16a=_0x574874['parent'];for(;_0x36c16a;)_0x36c16a['shouldBeStreamed']=!0x0,_0x36c16a=_0x36c16a['parent'];}if(_0x5f0fb2<this['options']['delay'])try{const {promise:_0x53ec51,abortController:_0xbe7fc7}=ps(this['options']['delay']-_0x5f0fb2);this['timeoutAbortController']=_0xbe7fc7,await _0x53ec51;}catch(_0x35ae85){return;}_0x2d4ba4(_0x3d2810,'<'+_0x3d2810['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3d2810['tagName']+'>',{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}['reset'](){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}['cleanUpAnimations']({targetElement:_0x4c458e}){Array['from'](_0x4c458e['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x20e9e0=>{_0x20e9e0['replaceWith'](_0x20e9e0['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x5658f1){let _0x325497='';if(function(_0x100c9c){return _0x40c3ff(_0x100c9c);}(_0x5658f1)){for(const _0x148002 of _0x5658f1['children'])_0x325497+=this['renderNode'](_0x148002);}else{if(Ts(_0x5658f1)){if(!_0x5658f1['shouldBeStreamed'])return'';const _0x1d0b2d=_0x5658f1,_0x5bde4b=Object['entries'](_0x1d0b2d['attribs'])['map'](([_0x315a83,_0x2f9479])=>_0x315a83+'=\x22'+_0x2f9479+'\x22')['join']('\x20');_0x325497+='<'+_0x1d0b2d['tagName']+(_0x5bde4b?'\x20'+_0x5bde4b:'')+'>';for(const _0x2c0920 of _0x55fdbd(_0x1d0b2d))_0x325497+=this['renderNode'](_0x2c0920);_0x325497+='</'+_0x1d0b2d['tagName']+'>';}else{if(!ws(_0x5658f1))return'';if(!_0x5658f1['shouldBeStreamed'])return'';!function(_0x5149de){if(!_0x5149de['parent']||!Ts(_0x5149de['parent']))return!0x1;if(!Es['includes'](_0x5149de['parent']['tagName']))return!0x1;return!_0x11c8f9(_0x5149de)['match'](/^\s*[<>]\s*$/);}(_0x5658f1)?_0x325497+=ti(_0x5658f1):_0x325497+=ti(new _0x4d1237('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x5658f1]));}}return _0x325497;}['getParsedDocumentNodeList'](){const _0x155b08=[];return function(_0xf7cc8b,_0x3fed30){const _0x3642d0=_0x5696c0=>{if(_0x3fed30(_0x5696c0),_0x5696c0 instanceof _0x507edc)for(let _0x30cb8a=0x0;_0x30cb8a<_0x5696c0['children']['length'];_0x30cb8a++){const _0x366101=_0x5696c0['children'][_0x30cb8a];_0x3642d0(_0x366101);}};for(let _0x1b47ca=0x0;_0x1b47ca<_0xf7cc8b['children']['length'];_0x1b47ca++)_0x3642d0(_0xf7cc8b['children'][_0x1b47ca]);}(this['document'],_0x350223=>{if(ws(_0x350223)){const _0x43942d=this['splitTextNodeIntoWordNodes'](_0x350223);_0x43942d['length']&&_0x155b08['push'](..._0x43942d);}_0x350223['isWordSplitSource']||_0x350223['isWordSplitResult']||_0x155b08['push'](_0x350223);}),_0x155b08;}['splitTextNodeIntoWordNodes'](_0x2bb35a){if(_0x2bb35a['isWordSplitSource']||_0x2bb35a['isWordSplitResult'])return[];const _0x48ea3b=_0x11c8f9(_0x2bb35a)['match'](/(?:\s*\S+\s*)/g),_0x312b52=[];if(_0x48ea3b&&_0x48ea3b['length']>0x1){for(const _0x1a2c75 of _0x48ea3b){const _0xb45cce=new _0x5a8104(_0x1a2c75);_0xb45cce['isWordSplitResult']=!0x0,_0x51f634(_0x2bb35a,_0xb45cce),_0x312b52['push'](_0xb45cce);}_0x2bb35a['isWordSplitSource']=!0x0,_0x32f2bc(_0x2bb35a);}return _0x312b52;}}const Es=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ws(_0x4ddba6){return _0x31735e(_0x4ddba6);}function Ts(_0x50aa77){return _0x4e8462(_0x50aa77);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x906718){super();const _0xccafee=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x906718,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xccafee['if']('isDone','ck-ai-chat__feed__item_done'),_0xccafee['if']('isVisible','ck-hidden',_0x20c60c=>!_0x20c60c),'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'](_0xc0e11f=>{_0xc0e11f['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x3873fc,_0x25ff6c,_0x3b99af){await this['htmlStreamer']['stream']({'document':_0x3873fc,'targetElement':_0x25ff6c,'abortSignal':_0x3b99af});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0xae8adf,_0x1cb467){super(_0xae8adf),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0xae8adf),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Bi,'label':Hi(_0xae8adf,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1cb467['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3db343=>_0x3db343?_0x135466:_0x3c0485),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x26b8f1=new xt();_0x26b8f1['content']=_0x448da1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1cb467['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x26b8f1,{'tag':'span','children':[Hi(_0xae8adf,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends vt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const fs={'accepted':_0x2d73d7,'rejected':_0x1dbb45,'outdated':_0x1dbb45};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x345d0e){super(_0x345d0e);const _0x549134=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x549134['to']('state',_0x24700d=>'ck-ai-suggestion__content-part-state_'+_0x24700d),_0x549134['if']('isVisible','ck-hidden',_0x9e74dd=>!_0x9e74dd)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x549134['to']('state',_0x2e0040=>{switch(_0x2e0040){case'accepted':return Hi(_0x345d0e,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Hi(_0x345d0e,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Hi(_0x345d0e,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x348304){this['state']=_0x348304;}}class StateIconView extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=fs[this['state']],this['on']('change:state',()=>{this['content']=fs[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x29b023,_0x4d4ca2,_0xed1621){super(_0x29b023);const _0x46765d=Boolean(_0xed1621);this['set']('isEnabled',!_0x46765d),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x85ff86=[];if(_0x46765d){const _0x9f1ccc=new vt(_0x29b023);_0x9f1ccc['set']({'label':Hi(_0x29b023,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x11ec0d}),_0x9f1ccc['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x85ff86['push'](_0x9f1ccc);}else{_0x4d4ca2['includes']('applySuggestion')&&(this['_applyButton']=new vt(_0x29b023),this['_applyButton']['set']({'label':Hi(_0x29b023,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2d73d7}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x85ff86['push'](this['_applyButton'])),_0x4d4ca2['includes']('insertSuggestion')&&(this['_suggestButton']=new vt(_0x29b023),this['_suggestButton']['set']({'label':Hi(_0x29b023,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3c26bd}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x85ff86['push'](this['_suggestButton']));const _0x19d4a2=new vt(_0x29b023);_0x19d4a2['set']({'label':Hi(_0x29b023,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1dbb45}),_0x19d4a2['bind']('isEnabled')['to'](this),_0x19d4a2['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x85ff86['push'](_0x19d4a2);}this['items']['addMany'](_0x85ff86);const _0x24c9cc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x24c9cc['if']('isVisible','ck-hidden',_0x4bc2f4=>!_0x4bc2f4)]}});}['setButtonsVisibility']({showApplyButton:_0x1bcbc7,showSuggestButton:_0x6d6ad6}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x1bcbc7),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x6d6ad6);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x15b36a,{part:_0x2f844e,uiIndex:_0x5b9265,availableActions:_0x5686a9,areActionsDisabled:_0x5ab0c7}){super(_0x15b36a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x15b36a,_0x5686a9,_0x5ab0c7),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2f844e['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2f844e['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2f844e['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x15b36a),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x15b36a,_0x5b9265),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x36e109,_0x339dd3,_0xe7cd6d,_0x53a471)=>{'pending'===_0x53a471?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xe7cd6d?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xe7cd6d),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x47d97a,_0x21b1a7){super(_0x47d97a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Hi(_0x47d97a,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x21b1a7['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x308813){super(_0x308813),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x1f0624,renderingStrategy:_0x1a1d5a,abortSignal:_0x2ae4b9}){'streaming'===_0x1a1d5a?await this['htmlStreamer']['stream']({'document':_0x1f0624['content'],'targetElement':this['element'],'abortSignal':_0x2ae4b9}):_0x2d4ba4(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x1f0624['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x530cef,{part:_0x38291b,uiIndex:_0x28cdcc,areActionsDisabled:_0x1d4efb,availableActions:_0x4634a0}){super(_0x530cef);const _0x1dc6d6=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x4f9f38=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1d4efb;};this['on']('change:state',_0x4f9f38),this['on']('change:isDone',_0x4f9f38),_0x4f9f38(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x530cef,{'part':_0x38291b,'uiIndex':_0x28cdcc,'availableActions':_0x4634a0,'areActionsDisabled':_0x1d4efb}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Cs)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x530cef),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x1dc6d6['to']('state',_0x2cb17=>'ck-ai-suggestion__body__content-part_'+_0x2cb17),_0x1dc6d6['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x1dc6d6['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x1dc6d6['if']('isVisible','ck-hidden',_0x1c62ad=>!_0x1c62ad)]},'children':this['_children'],'on':{'mouseenter':_0x1dc6d6['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x38291b['index']});}),'mouseleave':_0x1dc6d6['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x38291b['index']});}),'click':_0x1dc6d6['to'](_0x231355=>{const _0x4af1cf=_0x231355['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4af1cf)&&this['fire']('showChangeInText',{'index':_0x38291b['index']});})}});}async['updateContent']({part:_0x342282,showUnchangedParts:_0x4bc293=!0x1,abortSignal:_0x5e79ee}){this['partDefinition']=_0x342282,this['isVisible']=this['partDefinition']['hasChanges']||_0x4bc293,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x342282,'renderingStrategy':'static','abortSignal':_0x5e79ee});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x321063,_0x4d4416){super(_0x321063),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3268a7=>!_0x3268a7)]},'children':this['_createSkeletonItems'](_0x4d4416)});}['_createSkeletonItems'](_0x298c5c){const _0x5c1ffa=['ck','ck-ai-skeleton__item'];return _0x298c5c['map'](_0x67c418=>{let _0x1634aa='';switch(_0x67c418['attributes']['align']){case'right':_0x1634aa='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1634aa='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1634aa='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x67c418['tag'],'attributes':{'class':[..._0x5c1ffa,_0x67c418['attributes']['class']?_0x67c418['attributes']['class']:''],'style':'width:\x20'+_0x67c418['attributes']['width']+';\x20height:\x20'+_0x67c418['attributes']['height']+';'+_0x1634aa}};});}}const Ss={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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':Rs(0x5,'100%','44px','right'),'aiChatResources':Rs(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 Rs(_0x183ea2,_0x26ca43,_0x4371b8,_0x3613ef){return new Array(_0x183ea2)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x26ca43,'height':_0x4371b8,'align':_0x3613ef}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x3f2d09){const _0x36a02c=this['createTask'](_0x3f2d09);return this['queue']['push'](_0x36a02c),this['_processQueue'](),_0x36a02c['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(_0x4843b9=>{this['once']('_queueEmpty',()=>{_0x4843b9();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x3d06dc=this['queue']['shift']();try{await _0x3d06dc['callback'](this['_abortController']['signal']),_0x3d06dc['resolve']();}catch(_0x15e2aa){_0x3d06dc['reject'](_0x15e2aa);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xf4871){let _0x400fae,_0x52bec1;const _0x4f220c=new Promise((_0x3d3268,_0x506191)=>{_0x400fae=_0x3d3268,_0x52bec1=_0x506191;});return{'callback':_0xf4871,'resolve':_0x400fae,'reject':_0x52bec1,'completePromise':_0x4f220c};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x10f7fa){super(_0x10f7fa),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x10f7fa['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3cc0e5){this['element']['innerHTML']=_0x3cc0e5;}}const bs=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3b10ac,_0x5d0e68=[...bs],_0x185c71){super(_0x3b10ac);const _0x51d80a=this['bindTemplate'],_0x45e0d5=Boolean(_0x185c71);if(this['set']('isEnabled',!_0x45e0d5),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x45e0d5){const _0x3c25af=new vt(_0x3b10ac);_0x3c25af['set']({'label':Hi(_0x3b10ac,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x11ec0d}),_0x3c25af['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x4282c0=new Nt(_0x3b10ac);_0x4282c0['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Hi(_0x3b10ac,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3c25af]}]}),this['children']['add'](_0x4282c0);}else this['_applyChangesButton']=new vt(_0x3b10ac),this['_applyChangesButton']['set']({'label':Hi(_0x3b10ac,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5d0e68['includes']('applySuggestion'),'class':Mi}),this['_insertSuggestionsButton']=new vt(_0x3b10ac),this['_insertSuggestionsButton']['set']({'label':Hi(_0x3b10ac,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5d0e68['includes']('insertSuggestion'),'class':Ui}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4916e2=>{_0x4916e2['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']]);this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x51d80a['if']('isVisible','ck-hidden',_0x411247=>!_0x411247)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x1c51cf){this['isVisible']=_0x1c51cf;}['_switchButtonLabelsPlurality'](_0x229d87){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x229d87?(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0xe41136,_0x2723db){super(_0xe41136),this['bodyCollection']=_0x2723db,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',_0x1fab2d=>!_0x1fab2d)]},'children':this['children']});const _0x35d2f3=new Nt(this['locale']),_0x21010c=new xt();_0x21010c['content']=_0x271520,_0x35d2f3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x21010c,{'tag':'span','children':[{'text':Hi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x35d2f3),this['_setupBalloonPanel'](_0xe41136);}['addSource'](_0x5ce506){this['children']['add'](new AIWebSourceView(this['locale'],_0x5ce506,this['balloonPanelView']));}['_setupBalloonPanel'](_0x5b7fef){this['balloonPanelView']=new Xt(_0x5b7fef),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends vt{['balloonPanelView'];['source'];constructor(_0x23bc97,_0x387406,_0x446361){super(_0x23bc97),this['source']=_0x387406,this['balloonPanelView']=_0x446361,this['set']({'label':_0x387406['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x1f3048=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x1f3048['to'](()=>{window['open'](_0x387406['url'],'_blank');}),'mouseenter':_0x1f3048['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x1f3048['to'](()=>{this['_hideTooltip']();})}}),_0x387406['favicon']){const _0x3aafcb=new Nt(_0x23bc97);_0x3aafcb['setTemplate']({'tag':'img','attributes':{'src':_0x387406['favicon']||_0x271520,'alt':_0x387406['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3aafcb);}else this['set']('icon',_0x271520);}['_createTooltipContentView'](_0x5560be,_0x55341d){const _0x3c408a=new Nt(_0x5560be),_0x2b0492=[];let _0x3cbf30;_0x55341d?.['favicon']?(_0x3cbf30=new Nt(_0x5560be),_0x3cbf30['setTemplate']({'tag':'img','attributes':{'src':_0x55341d['favicon'],'alt':_0x55341d['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x3cbf30=new xt(),_0x3cbf30['content']=_0x271520,_0x3cbf30['extendTemplate']({'attributes':{'alt':_0x55341d['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x2b0492['push'](_0x3cbf30);const _0x174115=new Nt(_0x5560be);_0x174115['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x55341d['url']},'children':[{'text':new URL(_0x55341d['url'])?.['hostname']}]}),_0x2b0492['push'](_0x174115);const _0x43b88f=new Nt(_0x5560be);_0x43b88f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x2b0492});const _0x281501=new Nt(_0x5560be);return _0x281501['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x55341d['title']['length']>0x190?_0x55341d['title']['substring'](0x0,0x190)+'...':_0x55341d['title']}]}),_0x3c408a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x43b88f,_0x281501]}),_0x3c408a;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouthEast']],'limiter':document['querySelector']('.ck-ai-chat')}),this['balloonPanelView']['show']();}['_hideTooltip'](){this['balloonPanelView']['hide']();}['_updateTooltipContent'](){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x4d3e88=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x4d3e88);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x3c2cd8(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x353ead,_0x39b50b){super(_0x353ead);const {areActionsDisabled:_0x1913ca,showUnchangedParts:_0x5ed599,availableActions:_0x542ef2}=_0x39b50b;this['_areActionsDisabled']=_0x1913ca,this['_showUnchangedParts']=_0x5ed599,this['_availableActions']=_0x542ef2,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x353ead,Ss['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Hi(_0x353ead,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x353ead,_0x39b50b['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0x39b50b['bodyCollection']),_0x39b50b['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Cs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x987948=>_0x987948 instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0x3c4d0c,abortSignal:_0x273e0b,skipLoadingEffects:_0x40dd24}){this['_cachedContentParts']['length']?_0x3c4d0c['forEach'](_0x2f94e1=>{const _0x17a0f6=this['_cachedContentParts']['findIndex'](_0x2d7481=>_0x2d7481['index']==_0x2f94e1['index']);-0x1===_0x17a0f6?this['_cachedContentParts']['push'](_0x2f94e1):this['_cachedContentParts'][_0x17a0f6]=_0x2f94e1;}):this['_cachedContentParts']=_0x3c4d0c;const _0x2d00a6=this['_showUnchangedParts']?_0x3c4d0c:_0x3c4d0c['filter'](_0xc2ff3f=>_0xc2ff3f['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2d00a6['length']>0x1),_0x40dd24&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x3fe898 of _0x2d00a6)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x111c25=>{let _0x2142bb=this['getPartView'](_0x3fe898['index']);if(!_0x2142bb){if(_0x2142bb=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x3fe898,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2142bb['delegate'](...Cs)['to'](this),!_0x40dd24&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x111c25),_0x111c25['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x2142bb,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x40dd24||this['_showSkeletonDebounced']();}await _0x2142bb['updateContent']({'part':_0x3fe898,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x111c25}),_0x2142bb['markAsDone']();});return _0x273e0b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x51f98e,_0x21e033){const _0x2d7142=this['getPartView'](_0x51f98e);_0x2d7142&&(_0x2d7142['state']=_0x21e033),this['hasPendingParts']='pending'==_0x21e033||this['_contentPartViews']['some'](_0x1ca184=>'pending'==_0x1ca184['state']);}['setPartActive'](_0x239856,_0x3abeaa){if(!0x1===_0x239856){for(const _0x3fe639 of this['_contentPartViews'])_0x3fe639['isActive']=!0x1;}else{const _0x20c15b=this['getPartView'](_0x239856);_0x20c15b&&(_0x20c15b['isActive']=_0x3abeaa);}}['updateSources'](_0x59e24c){_0x59e24c['forEach'](_0x1ac236=>this['_sourcesView']['addSource'](_0x1ac236)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x437333){return this['_contentPartViews']['find'](_0x5dff14=>_0x5dff14['partDefinition']['index']==_0x437333)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x37a79d=!this['_cachedContentParts']['find'](({hasChanges:_0x5e4f84})=>_0x5e4f84),_0x19b6b6=!!this['_cachedContentParts']['find'](({hasChanges:_0x4aaa19})=>!_0x4aaa19);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x19b6b6,_0x37a79d?this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x15bc25=>_0x15bc25['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x4c92cc){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x5b3120=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x5b3120>0x0){const {promise:_0x465e57,abortController:_0xe7123f}=ps(_0x5b3120);_0x4c92cc?.['addEventListener']('abort',()=>_0xe7123f['abort']()),await _0x465e57['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x3be455=>_0x3be455['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x279cf6,_0x19ea5b,_0xd2ae2d){super(_0x279cf6);const {showDiff:_0x4e08a9,areActionsDisabled:_0x4dbbe0,showUnchangedParts:_0x53f4c6,availableActions:_0x543488}=_0x19ea5b;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x279cf6,{'showDiff':_0x4e08a9}),this['headerView']['on']('toggleShowChanges',(_0x55f2b6,_0x2a9d4b)=>{this['areChangesVisible']=_0x2a9d4b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2a9d4b['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x279cf6,{'areActionsDisabled':_0x4dbbe0,'showUnchangedParts':!!_0x53f4c6,'availableActions':_0x543488,'bodyCollection':_0xd2ae2d}),this['bodyView']['delegate'](...Cs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x49dd09){await this['bodyView']['updateContentParts'](_0x49dd09);}['updateSources'](_0xc94903){this['bodyView']['updateSources'](_0xc94903);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x22345f,_0x563297,_0x13f28b){super(_0x563297),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x22345f,{'showDiff':_0x563297['showDiff'],'areActionsDisabled':_0x563297['areActionsDisabled'],'availableActions':_0x563297['availableActions']},_0x13f28b),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x3467e8,_0x4a9dae)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4a9dae['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x22d732,{index:_0x1a54b8})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1a54b8});}),this['containerView']['on']('applySuggestion',(_0x3f81e8,{index:_0x411791}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x411791});}),this['containerView']['on']('insertSuggestion',(_0x4de0a9,{index:_0x3e7638}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e7638});}),this['containerView']['on']('rejectSuggestion',(_0x55dcdf,{index:_0x31efd7})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x31efd7});}),this['containerView']['on']('mouseOverSuggestion',(_0x208b83,{index:_0x1cdaa2})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1cdaa2});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1729b5,{index:_0x3fdcc5})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3fdcc5});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x431799){await this['containerView']['updateContent'](_0x431799);}['updatePartState'](_0x39c8ce,_0x2d1528){this['containerView']['bodyView']['updatePartState'](_0x39c8ce,_0x2d1528);}['setPartActive'](_0x4d153c,_0x3cebbb){!0x1===_0x4d153c?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4d153c,_0x3cebbb);}['updateSources'](_0x45278a){this['containerView']['updateSources'](_0x45278a);}['getPartView'](_0x40de1b){return this['containerView']['bodyView']['getPartView'](_0x40de1b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x5986a2,_0x2d9550,_0x168bb7){super(_0x2d9550),this['_bodyCollection']=_0x168bb7,this['locale']=_0x5986a2,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Fi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x30c303,renderingStrategy:_0x1878e8,abortSignal:_0x5164fe}){'streaming'===_0x1878e8?await this['streamIntoElement'](_0x30c303,this['replyContainer']['element'],_0x5164fe):this['replyContainer']['element']['innerHTML']=ti(_0x30c303);}['updateSources'](_0x36af6b){const _0x18f46e=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x18f46e['children']['addMany'](_0x36af6b['map'](_0x32c83e=>new AIWebSourceView(this['locale'],_0x32c83e,_0x18f46e['balloonPanelView']))),_0x18f46e['isVisible']=!0x0,this['children']['add'](_0x18f46e);}}class AISpinnerView extends yt{constructor(_0x505c44=void 0x0){super();const _0x185470=_0x505c44?'ck-ai-spinner_'+_0x505c44:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x185470]}});}}const Os={'file':_0x5249ad,'document':_0x448da1,'web-resource':_0x1e2b51,'text':_0x5249ad,'selection':_0xf81085,'mcp-tool-context':_0x448da1},ks='ck-ai-chat-context-chip',vs='ck-ai-chat-context-chip_wide',Ns='ck-ai-chat-context-chip_document',ys='ck-ai-chat-context-chip__label',xs='ck-ai-chat-context-chip__type-icon',Ls='ck-ai-chat-context-controls__chip-tooltip',Ds='n';class AIChatContextItemButtonView extends vt{constructor(_0x950098,_0x34a45d,_0x2d0a07,_0x182d12,_0x29b113=!0x1){super(_0x950098),this['_isAnimationOnEnterEnabled']=_0x182d12,this['_initializeProperties'](_0x34a45d,_0x2d0a07,_0x29b113),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'](_0x1e4cb8,_0x355e72,_0x2c6b74){this['set']('label',_0x1e4cb8['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1e4cb8['type']),this['set']('id',_0x1e4cb8['uiId']),this['set']('readonly',_0x355e72),this['set']('isLoading',_0x2c6b74);}['_setupTemplate'](){const _0xe52a7=this['_createIconView'](),_0x28335a=this['_createRemoveButton'](),_0x54af32=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x54af32),'children':this['_createTemplateChildren'](_0xe52a7,_0x28335a,_0x54af32)});}['_createTemplateAttributes'](_0x9e786d){return{'class':[ks,_0x9e786d['if']('itemType',Ns,_0x3c5e35=>'document'==_0x3c5e35),_0x9e786d['if']('itemType',vs,_0x31f6f0=>'selection'==_0x31f6f0)],'data-cke-tooltip-text':_0x9e786d['to']('label',Vs),'data-cke-tooltip-position':Ds,'data-cke-tooltip-class':Ls};}['_createTemplateChildren'](_0x4c8710,_0x519cd5,_0x18d21a){const _0x25b2ae=this['_createLabelElement'](_0x18d21a),_0x2e9778=this['_createLoaderIcon']();return this['readonly']?[_0x4c8710,_0x25b2ae]:[_0x4c8710,_0x2e9778,_0x25b2ae,_0x519cd5];}['_createLabelElement'](_0x571003){return{'tag':'span','attributes':{'class':ys},'children':[{'text':_0x571003['to']('label')}]};}['_createRemoveButton'](){const _0x296d43=new vt(this['locale']);return _0x296d43['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5ed072}),this['_setupRemoveButtonEvent'](_0x296d43),_0x296d43;}['_setupRemoveButtonEvent'](_0x4e800c){_0x4e800c['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x4e5c3e=this['bindTemplate'],_0x7a09d0=new xt();return _0x7a09d0['content']=Os[this['itemType']],_0x7a09d0['extendTemplate']({'attributes':{'class':[xs,_0x4e5c3e['if']('isLoading','ck-hidden',_0x1b3d62=>_0x1b3d62)]}}),_0x7a09d0;}['_handleAnimationEndOnce'](_0x2661eb,_0x472c57){if(!_0x2661eb)return;const _0x3c92d6=()=>{_0x472c57(),_0x2661eb['removeEventListener']('animationend',_0x3c92d6),_0x2661eb['removeEventListener']('webkitAnimationEnd',_0x3c92d6);};_0x2661eb['addEventListener']('animationend',_0x3c92d6),_0x2661eb['addEventListener']('webkitAnimationEnd',_0x3c92d6);}['_createLoaderIcon'](){const _0x27693f=new AISpinnerView('small');return _0x27693f['bind']('isVisible')['to'](this,'isLoading',_0xbfc1c4=>_0xbfc1c4),_0x27693f;}}function Vs(_0x25ed73){if(!_0x25ed73)return _0x25ed73;if(_0x25ed73['length']<=0x78)return _0x25ed73;const _0x4dce8f=_0x25ed73['slice'](0x0,0x78),_0x13d56f=_0x4dce8f['lastIndexOf']('\x20');return(_0x13d56f>0x0?_0x4dce8f['slice'](0x0,_0x13d56f):_0x4dce8f)+'…';}const Ps={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Hs='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x61d290,_0x478941,_0x254c90,_0x194a51,_0x5828ef){this['_locale']=_0x61d290,this['_visibleChips']=_0x478941,this['_config']={...Ps,..._0x254c90,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x254c90['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x194a51,this['_parentView']=_0x5828ef||null;}['setContainerElement'](_0x181dae){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x181dae,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 _0xd01583=[...this['_visibleChips'],...this['_overflowChips']],_0x37499f=this['_createCalculationContainer'](),_0x445ba6=this['_calculateOverflowInContainer'](_0x37499f,_0xd01583),_0x47572c=_0x37499f['_ancestorsToRestore'];_0x47572c&&this['_restoreAncestorVisibility'](_0x47572c),_0x37499f['remove'](),this['_applyOverflowResults'](_0xd01583,_0x445ba6);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x35e406=new vt(this['_locale']);_0x35e406['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xa8652=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xa8652['push'](this['_config']['cssClasses']['controlsButton']),_0x35e406['extendTemplate']({'attributes':{'class':_0xa8652}}),_0x35e406;}['_createShowMoreBalloonPanelView'](){const _0x4a989d=new Xt(this['_locale']);return _0x4a989d['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4a989d),_0x4a989d;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5ea2a5=>{_0x5ea2a5['disableAnimationOnEnter']();});const _0x2646cf=new Nt(this['_locale']);_0x2646cf['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2646cf);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x276197=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x276197?'':'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'](_0x5e1351){const _0x5e3d3a=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x1e09ea=this['_containerElement']?.['classList'];if(_0x1e09ea){const _0x1a85a0=_0x1e09ea[0x0]||'',_0x3f94ec=_0x5e1351['querySelector']('.'+_0x1a85a0),_0x3e15c9=_0x5e1351['querySelector'](_0x5e3d3a);return _0x3f94ec||_0x3e15c9||_0x5e1351;}return _0x5e1351['querySelector'](_0x5e3d3a)||_0x5e1351;}['_calculateContainerWidth'](){const _0x3cbe3f=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3cbe3f)return Hs;const _0x5900b3=window['getComputedStyle'](_0x3cbe3f)['width'];if('auto'===_0x5900b3||'0px'===_0x5900b3||!_0x5900b3){const _0x23aa2c=_0x3cbe3f['parentElement'];if(_0x23aa2c){const _0x32fe71=window['getComputedStyle'](_0x23aa2c);return'auto'!==_0x32fe71['width']?_0x32fe71['width']:Hs;}return Hs;}return _0x5900b3;}['_applyCalculationStyles'](_0x4ef190,_0x59ff93){this['_config']['cssClasses']['calculationContainer']&&_0x4ef190['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4ef190['style']['width']=_0x59ff93,_0x4ef190['style']['position']='absolute',_0x4ef190['style']['top']='-9999px',_0x4ef190['style']['left']='-9999px',_0x4ef190['style']['opacity']='0',_0x4ef190['style']['pointerEvents']='none',_0x4ef190['style']['zIndex']='-1',_0x4ef190['style']['visibility']='visible\x20!important',_0x4ef190['style']['display']='block\x20!important',_0x4ef190['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1e3c8c){_0x1e3c8c['forEach'](({element:_0x3caf6b,originalDisplay:_0x217ff3,originalVisibility:_0x571cda})=>{_0x3caf6b['style']['display']=_0x217ff3,_0x3caf6b['style']['visibility']=_0x571cda;});}['_makeAncestorsVisible'](_0x56745e){const _0x3dfce7=[];let _0x38dbe9=_0x56745e;for(;_0x38dbe9&&_0x38dbe9!==document['body'];){const _0x59b38c=window['getComputedStyle'](_0x38dbe9);'none'!==_0x59b38c['display']&&'hidden'!==_0x59b38c['visibility']||(_0x3dfce7['push']({'element':_0x38dbe9,'originalDisplay':_0x38dbe9['style']['display'],'originalVisibility':_0x38dbe9['style']['visibility']}),_0x38dbe9['style']['display']='block',_0x38dbe9['style']['visibility']='visible'),_0x38dbe9=_0x38dbe9['parentElement'];}return _0x3dfce7;}['_createContainerElements'](){let _0x58d3c5,_0xfe29db;return this['_parentView']?.['element']?(_0x58d3c5=this['_parentView']['element']['cloneNode'](!0x0),_0xfe29db=this['_findTargetContainer'](_0x58d3c5)):(_0x58d3c5=document['createElement']('div'),_0xfe29db=_0x58d3c5),{'calculationContainer':_0x58d3c5,'targetContainer':_0xfe29db};}['_createCalculationContainer'](){const {calculationContainer:_0x323a8,targetContainer:_0x42db4e}=this['_createContainerElements'](),_0x28eb34=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x323a8,_0x28eb34);const _0x34d509=this['_parentView']?.['element']||this['_containerElement'],_0x1d2692=_0x34d509?.['parentElement'];_0x1d2692?_0x1d2692['appendChild'](_0x323a8):document['body']['appendChild'](_0x323a8),_0x323a8['_targetContainer']=_0x42db4e;const _0x46ceec=this['_makeAncestorsVisible'](_0x1d2692||null);return _0x323a8['offsetWidth'],_0x323a8['_ancestorsToRestore']=_0x46ceec,_0x323a8;}['_calculateOverflowInContainer'](_0xde5d57,_0x5b57a6){const _0x21aba7=_0xde5d57['_targetContainer']||_0xde5d57,_0x35a385=[],{rowCount:_0xb2fce7}=this['_renderChipsAndCountRows'](_0x21aba7,_0x5b57a6);if(_0xb2fce7<=this['_config']['maxVisibleRows'])return _0x35a385;const _0x171ea5=_0x5b57a6['slice']();for(;_0x171ea5['length']>0x0;){if(this['_testButtonFit'](_0xde5d57,_0x21aba7,_0x171ea5)){const _0x2e0094=_0x5b57a6['filter'](_0x510c65=>!_0x171ea5['includes'](_0x510c65));_0x35a385['push'](..._0x2e0094);break;}if(!_0x171ea5['pop']())break;}return _0x35a385;}['_renderChipsAndCountRows'](_0xf380b9,_0x1ac2ba){_0xf380b9['innerHTML']='',_0x1ac2ba['forEach'](_0x10afdc=>{if(_0x10afdc['element']){const _0x54fe02=_0x10afdc['element']['cloneNode'](!0x0);_0xf380b9['appendChild'](_0x54fe02);}}),_0xf380b9['offsetWidth'];const _0x4083d7=_0xf380b9['children'],_0x197a62=[];return Array['from'](_0x4083d7)['forEach'](_0x5c339c=>{const _0x2ea8a9=_0x5c339c['getBoundingClientRect']()['top'];_0x197a62['some'](_0xe5ae13=>Math['abs'](_0xe5ae13-_0x2ea8a9)<this['_config']['rowDetectionTolerance'])||_0x197a62['push'](_0x2ea8a9);}),{'rowCount':_0x197a62['length']};}['_createMockButton'](){const _0x4f3a46=document['createElement']('button');return _0x4f3a46['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4f3a46['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x4f3a46['textContent']='+\x201',_0x4f3a46;}['_testButtonFit'](_0x4ccb08,_0x116da7,_0x3da7cb){this['_renderChipsAndCountRows'](_0x116da7,_0x3da7cb);const _0x5a65ef=this['_createMockButton']();_0x4ccb08['appendChild'](_0x5a65ef),_0x4ccb08['offsetWidth'];const _0x24b028=[..._0x116da7['children'],_0x5a65ef],_0x3425e6=[];_0x24b028['forEach'](_0xb05ca2=>{const _0x23a943=_0xb05ca2['getBoundingClientRect']()['top'];_0x3425e6['some'](_0x33c210=>Math['abs'](_0x33c210-_0x23a943)<this['_config']['rowDetectionTolerance'])||_0x3425e6['push'](_0x23a943);});const _0x2180eb=_0x3425e6['length'];return _0x5a65ef['remove'](),_0x2180eb<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x465f74,_0x1ff7f2){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x465f74['forEach'](_0x57dfb6=>{_0x1ff7f2['includes'](_0x57dfb6)?this['_overflowChips']['add'](_0x57dfb6):this['_visibleChips']['add'](_0x57dfb6);});}['_updateOverflowUI'](_0x4cd324){if(_0x4cd324>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4cd324>0x0&&this['_showMoreButtonView']){const _0x1cca50=''+this['_config']['showMoreLabelPrefix']+(_0x4cd324<0x63?_0x4cd324:'99');this['_showMoreButtonView']['label']=_0x1cca50;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x2f1411,_0x21055f){this['_distributeChips'](_0x2f1411,_0x21055f),this['_updateOverflowUI'](_0x21055f['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x4524c7=>{_0x4524c7[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 _0x12e695=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x12e695['width']||0x0===_0x12e695['height'])return!0x1;const _0x21a9c2=window['innerHeight']||document['documentElement']['clientHeight'],_0x22a19f=window['innerWidth']||document['documentElement']['clientWidth'],_0x52c5fa=0xc8;return _0x12e695['bottom']>=-0xc8&&_0x12e695['top']<=_0x21a9c2+_0x52c5fa&&_0x12e695['right']>=-0xc8&&_0x12e695['left']<=_0x22a19f+_0x52c5fa;}}const Ms='ck-ai-chat__feed__context-chips',Us='ck-ai-chat-context-chips-wrapper',Bs='ck-ai-chat-context-chips-wrapper-balloon',Gs='ck-ai-chat-controls-button',Fs='ck-ai-chat-controls_context_show-more-button',Ks='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2d0532,_0x3cc2db,_0x5bb0d2){super(_0x2d0532),this['_bodyCollection']=_0x5bb0d2,this['_createContextChips'](_0x3cc2db);const _0x17f9a1={'cssClasses':{'showMoreButton':Fs+'\x20'+Bi,'showMoreBalloon':Ks,'overflowContainer':Bs,'controlsButton':Gs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x2d0532,this['_contextChips'],_0x17f9a1,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ms,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Us},'children':this['_contextChips']}]});}['render'](){super['render']();const _0xe525cf=this['element']['querySelector']('.'+Us);_0xe525cf&&(this['_overflowManager']['setContainerElement'](_0xe525cf),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x9806d4){for(const _0x5689cf of _0x9806d4){const _0x2ffe12=new AIChatContextItemButtonView(this['locale'],_0x5689cf,!0x0,!0x1);this['_contextChips']['add'](_0x2ffe12);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3412b7,_0x1826fb,_0x97cf7){super(_0x1826fb),this['_locale']=_0x3412b7,this['_bodyCollection']=_0x97cf7,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 AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x3a1f89=>!_0x3a1f89['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x18f1ea,_0x55f1cb){super(_0x55f1cb);const {isWebSearchEnabled:_0x243dee,isReasoningEnabled:_0x588d3f}=_0x55f1cb['capabilities'],_0x14593c=[];let _0x37e22c='';_0x243dee&&_0x588d3f?(_0x37e22c=Hi(_0x18f1ea,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x14593c['push'](Ws(_0x271520)),_0x14593c['push'](Ws(_0xeb7c36))):_0x243dee?(_0x37e22c=Hi(_0x18f1ea,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x14593c['push'](Ws(_0x271520))):_0x588d3f&&(_0x37e22c=Hi(_0x18f1ea,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x14593c['push'](Ws(_0xeb7c36))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x37e22c?'':'ck-hidden']}});const _0x2a3b6a=new Nt();_0x2a3b6a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x14593c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x37e22c]}]}),this['children']['add'](_0x2a3b6a),this['capabilities']=_0x55f1cb['capabilities'];}}function Ws(_0x40efa3){const _0x3e13fc=new xt();return _0x3e13fc['content']=_0x40efa3,_0x3e13fc;}const Ys=['wheel','touchstart','pointerdown','keydown'],$s=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0xf99596){this['element']=_0xf99596,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x5a0400 of Ys){const _0x3659a9='keydown'!==_0x5a0400;this['element']['addEventListener'](_0x5a0400,this['_onUserEvent']['bind'](this),{'passive':_0x3659a9,'signal':this['abortController']['signal']});}}['start']({smooth:_0x3c2b9e=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x3c2b9e?'smooth':'auto',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'](_0x566d2a){if(this['isRunning']){if('keydown'===_0x566d2a['type']){const _0x56726a=_0x566d2a['key'];if(!$s['includes'](_0x56726a))return;}_0x566d2a instanceof WheelEvent?_0x566d2a['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xc422b8,scrollHeight:_0x2275bf,clientHeight:_0x3579fe}=this['element'];return _0x2275bf-_0xc422b8-_0x3579fe<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x5527e0){super(_0x5527e0),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x2afa80,_0xc6c807){super(_0x2afa80),this['_bodyCollection']=_0xc6c807,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ms)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x376c69,_0x227711){let _0x1845c3;return'ai-reply'===_0x376c69?_0x1845c3=new AIChatFeedReplyItemView(this['locale'],_0x227711,this['_bodyCollection']):'ai-suggestion-reply'===_0x376c69?(_0x1845c3=new AIChatFeedSuggestionItemView(this['locale'],_0x227711,this['_bodyCollection']),_0x1845c3['bind']('isTrackChangesOn')['to'](this)):_0x1845c3='user-message'===_0x376c69?new AIChatFeedUserMessageItemView(this['locale'],_0x227711,this['_bodyCollection']):'interaction-header'===_0x376c69?new AIChatFeedInteractionHeaderView(this['locale'],_0x227711):'custom-element'===_0x376c69?new AIChatFeedCustomElementView(_0x227711):new AIChatFeedErrorItemView(_0x227711),this['children']['add'](_0x1845c3),_0x1845c3;}async['updateReplyItem']({id:_0x30091a,parsedContent:_0x3c8366,renderingStrategy:_0x18d0a2,abortSignal:_0x25f36c}){const _0x2e17a5=this['getItemById'](_0x30091a);if(!(_0x2e17a5 instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2e17a5,'id':_0x30091a,'parsedContent':_0x3c8366});await _0x2e17a5['updateContent']({'parsedContent':_0x3c8366,'renderingStrategy':_0x18d0a2,'abortSignal':_0x25f36c});}async['updateWebSources'](_0x19ee7f,_0x4ecf8c){const _0x29691a=this['getItemById'](_0x19ee7f);if(_0x29691a instanceof AIChatFeedSuggestionItemView)_0x29691a['updateSources'](_0x4ecf8c);else{if(!(_0x29691a instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x29691a,'id':_0x19ee7f,'sources':_0x4ecf8c});_0x29691a['updateSources'](_0x4ecf8c);}}async['updateSuggestionItem']({id:_0x2e95c,parts:_0xd4175f,abortSignal:_0xd5e0cd,skipLoadingEffects:_0x12e5fe}){const _0x3951de=this['getItemById'](_0x2e95c);if(!(_0x3951de instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x3951de,'id':_0x2e95c,'parts':_0xd4175f});await _0x3951de['updateContent']({'parts':_0xd4175f,'abortSignal':_0xd5e0cd,'skipLoadingEffects':_0x12e5fe});}['updateSuggestionPartState']({id:_0x19852f,index:_0x235cc2,state:_0x2553fc}){const _0x50fec9=this['getItemById'](_0x19852f);if(!(_0x50fec9 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x19852f});_0x50fec9['updatePartState'](_0x235cc2,_0x2553fc);}['setSuggestionPartActive']({id:_0x39ba6b,index:_0xb8b960,isActive:_0x31db54}){const _0x26153e=this['getItemById'](_0x39ba6b);if(!(_0x26153e instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x39ba6b});this['children']['filter'](_0xb1b53f=>_0xb1b53f instanceof AIChatFeedSuggestionItemView)['forEach'](_0x41de41=>{_0x41de41['setPartActive'](!0x1);}),_0x26153e['setPartActive'](_0xb8b960,_0x31db54);}['markItemAsDone'](_0x1ab930){this['getItemById'](_0x1ab930)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5ebdaa=>_0x5ebdaa['options']['id']);}['removeItem'](_0x40de3b){this['children']['remove'](this['getItemById'](_0x40de3b));}['hasItem'](_0x3215b2){return!!this['children']['find'](_0x4b22e0=>_0x4b22e0['options']['id']['includes'](_0x3215b2));}['scrollToSuggestion'](_0x7125f7,_0x293d97){const _0xc1f2c3=this['getItemById'](_0x7125f7);if(!(_0xc1f2c3 instanceof AIChatFeedSuggestionItemView))return void gt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x7125f7,'partIndex':_0x293d97});const _0x301308=_0xc1f2c3['getPartView'](_0x293d97);_0x301308?ft(_0x301308['element'],0x14,this['element']['parentElement'],!0x0,!0x0):gt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x7125f7,'partIndex':_0x293d97});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2bd63f=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2bd63f,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x69ccdc=new AISkeletonView(this['locale'],Ss['aiFeed']);return _0x69ccdc['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x69ccdc;}['_createFeedItems'](){const _0x4e35e1=new Nt(this['locale']);return _0x4e35e1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4e35e1;}['_createFeedLoader'](){const _0x41cc03=new Nt(this['locale']);return _0x41cc03['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x34c4d3=>!_0x34c4d3)]},'children':this['_createLoaderChildren']()}),_0x41cc03;}['_createLoaderChildren'](){const _0x34a7b1=new AISpinnerView();return _0x34a7b1['isVisible']=!0x0,[_0x34a7b1,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4f6667){const _0x18021c=this['children']['find'](_0x15ca9a=>_0x15ca9a['options']['id']['includes'](_0x4f6667));if(!_0x18021c)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x4f6667});return _0x18021c;}['setLoadingMessage'](_0x1274aa){this['set']('loadingMessage',_0x1274aa);}['toggleLoadingSkeleton'](_0xbaaa45){this['set']('isLoadingSkeletonVisible',_0xbaaa45);}['startAutoScroll'](_0x9bf273={}){this['scrollManager']['start'](_0x9bf273);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x1451a7=0x0;for(const _0x3052a0 of this['items'])_0x1451a7+=_0x3052a0['items']['length'];return{'resultsCount':_0x1451a7,'totalItemsCount':_0x1451a7};}}const qs='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x27d929,_0x25930e){super(_0x27d929,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x27d929),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x25930e,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['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',(_0x1a2f4b,_0x51c585)=>!_0x1a2f4b&&!_0x51c585),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2f46ff,_0x543a1b)=>{this['isUploadInProgress']||this['isEmpty']||_0x2f46ff['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x543a1b());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x4dc563=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x4dc563)return this['queryView']['errorText']=Hi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x48c3fb=_0x19d831(_0x4dc563);this['fire']('sendUserMessage',_0x48c3fb),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xb9f7cb){this['queryView']['fieldView']['set']('placeholder',_0xb9f7cb);}['focus'](_0x2c3636=!0x1){super['focus'](),_0x2c3636&&(this['element']['classList']['contains'](qs)||(this['element']['classList']['add'](qs),setTimeout(()=>{this['element']['classList']['remove'](qs);},0x320)));}['_createSubmitButton'](){const _0x2dc748=new vt(this['locale']);return _0x2dc748['set']({'icon':_0x177154,'label':Hi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Mi,'isEnabled':!0x1}),_0x2dc748['on']('execute',()=>{this['submit']();}),_0x2dc748;}['setIsUploadInProgress'](_0x505026){this['isUploadInProgress']=_0x505026;}['_setUpAddContextButtonPositioning'](){const _0x21745d=this['locale'],_0x178e37=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x590ef7=new ut(this['queryView']['fieldView']['element']),_0x4d57a1=new ut(this['_addContextButtonView']['element']),_0x291517=_0x590ef7['width'],_0x2ae9f4='rtl'===_0x21745d['uiLanguageDirection']?'right':'left';_0x590ef7['excludeScrollbarsAndBorders']();const _0x4adb82=_0x291517-_0x590ef7['width']+0x1;this['_addContextButtonView']['element']['style'][_0x2ae9f4]='calc('+(_0x291517-_0x4d57a1['width']-_0x4adb82)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x178e37),this['on']('render',()=>{_0x178e37(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x178e37();});});}}const Qs='ck-ai-chat__prompt-capabilities',Xs='ck-ai-chat-controls-button',zs='ck-ai-chat-controls-button--commands',js='ck-ai-chat-controls__model-selection',Js='ck-ai-chat-controls__model-selection__item-name',Zs='ck-ai-chat-controls__model-selection__item-description',tn='ck-ai-chat-controls__model-selection__item-capabilities',en='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x234556){super(_0x234556),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelDisplayMode','selector'),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',null),this['set']('activeModelName',null),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelNameView']=this['_createModelNameView'](),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['_commandsButton']=this['_createCommandsButton'](),this['_modelSelectionDropdown']['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5b3003=>'selector'===_0x5b3003),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x53032f=>_0x53032f?this['_modelSelectionDropdown']['buttonView']['label']:Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x40354b=>_0x40354b),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5995cb=>_0x5995cb),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3d1ea1=>Hi(this['locale'],_0x3d1ea1?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x103d57=>_0x103d57),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5caa03=>Hi(this['locale'],_0x5caa03?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qs]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x4601fe,_0x4a0ac7){if(_0x4a0ac7)this['set']('modelDisplayMode','hidden');else{const _0x3c1bb8=0x1===_0x4601fe['length'];this['set']('modelDisplayMode',_0x3c1bb8?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x4601fe?.['length'])for(const _0x3e9b21 of _0x4601fe){const _0xb83cfe=new Jt({'label':_0x3e9b21['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3e9b21['id'],'model':_0x3e9b21});_0xb83cfe['bind']('isOn')['to'](this,'activeModelId',_0x58572d=>_0x58572d===_0x3e9b21['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xb83cfe,'labelView':new sn(this['locale'],_0x3e9b21)});}}['setWebSearch'](_0xac9b7e){this['set']('webSearchActive',_0xac9b7e);}['setReasoning'](_0x139934){this['set']('reasoningActive',_0x139934);}['setModel'](_0x1810e4){if(!_0x1810e4)return;this['activeModelId']=_0x1810e4['id'],this['activeModelName']=_0x1810e4['name']||_0x1810e4['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x1810e4['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x1810e4['name']);const _0x29612f=_0x1810e4['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x29612f),this['_webSearchButton']['set']('isVisible',_0x29612f);const _0x1572ba=_0x1810e4['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1572ba),this['_reasoningButton']['set']('isVisible',_0x1572ba);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x228784){this['set']('modelSelectorEnabled',!0x1),_0x228784&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x56ac48=new vt();return _0x56ac48['set']({'label':Hi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x271520,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x56ac48['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x56ac48;}['_createReasoningButton'](){const _0x489d90=new vt();return _0x489d90['set']({'label':Hi(this['locale'],'AI_CHAT_REASONING'),'icon':_0xeb7c36,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x489d90['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x489d90;}['_createCommandsButton'](){const _0x4258da=new vt();return _0x4258da['set']({'label':Hi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x348d31,'withText':!0x0,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltip':Hi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':en}),_0x4258da['extendTemplate']({'attributes':{'class':[zs]}}),_0x4258da['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4258da;}['_createModelSelectionDropdown'](){const _0x4fedd7=Gt(this['locale']);return _0x4fedd7['set']({'panelPosition':'ne','class':[js]}),_0x4fedd7['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':en,'class':Bi}),this['listenTo'](_0x4fedd7,'execute',_0x13ff32=>{this['fire']('selectModel',_0x13ff32['source']['model']);}),_0x4fedd7;}['_createModelNameView'](){const _0x4636a2=new nn(this['locale']);return _0x4636a2['bind']('text')['to'](this,'activeModelName',_0x205f15=>_0x205f15??''),_0x4636a2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x156edf=>'name'===_0x156edf),_0x4636a2;}}let sn=class ModelButtonLabelView extends Ht{constructor(_0x2ced18,_0x444985){super();const _0x3cf6a0=this['bindTemplate'],_0x4a8d04=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3cf6a0['to']('style'),'id':_0x3cf6a0['to']('id')},'children':[{'tag':'div','attributes':{'class':[Js]},'children':[{'text':_0x3cf6a0['to']('text')}]},{'tag':'div','attributes':{'class':[Zs]},'children':[{'tag':'span','children':[{'text':_0x444985['description']}]}]},{'tag':'div','attributes':{'class':[tn]},'children':_0x4a8d04}]}),_0x4a8d04['addMany'](this['_getCapabilityParts'](_0x2ced18,_0x271520,'AI_CHAT_SEARCH_WEB',_0x444985['capabilities']['webSearch']?.['enabled']??!0x1)),_0x4a8d04['addMany'](this['_getCapabilityParts'](_0x2ced18,_0xeb7c36,'AI_CHAT_REASONING',_0x444985['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x47df0c,_0x5cc783,_0x39d830,_0x52478a){const _0xb65507=new xt();_0xb65507['content']=_0x5cc783;const _0x5cff76=new Nt(_0x47df0c);_0x5cff76['setTemplate']({'tag':'span','children':[{'text':Hi(_0x47df0c,_0x39d830)+':\x20'}]});const _0x5e2476=new Nt(_0x47df0c);return _0x5e2476['setTemplate']({'tag':'span','children':[{'text':Hi(_0x47df0c,_0x52478a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xb65507,_0x5cff76,_0x5e2476];}},nn=class ModelNameView extends Nt{constructor(_0x37eff4){super(_0x37eff4),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1a55e4=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1a55e4['if']('isVisible','ck-hidden',_0x25001e=>!_0x25001e)]},'children':[{'text':_0x1a55e4['to']('text')}]});}};const rn='ck-ai-chat-context-controls__url-form',on='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x1399ed){super(_0x1399ed),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x2af54e=>{this['focusTracker']['add'](_0x2af54e['element']),this['keystrokes']['listenTo'](_0x2af54e['element']);}),Zt({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x43639e){this['urlInputField']['errorText']=_0x43639e,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x29c362=new vt(this['locale']);return _0x29c362['set']({'icon':_0x1607c0,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5c86fa,_0x2ed63f,_0x1f27e6)=>{_0x29c362['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x1f27e6?'':'\x20ck-hidden')]});}),_0x29c362;}['_createUrlInputField'](){const _0x321dd5=new te(this['locale'],_0x123337);return _0x321dd5['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x321dd5['fieldView']['set']({'placeholder':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x321dd5;}['_createConfirmButton'](){const _0x32cc17=new vt(this['locale']);return _0x32cc17['set']({'icon':_0x4ab520,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x32cc17;}['_setupTemplate'](){const _0x450790=new _0x3e7902(this['locale'],{'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x450790['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':rn,'tabindex':'-1'},'children':[_0x450790,{'tag':'div','attributes':{'class':on},'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',_0x31b84c=>{_0x31b84c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x145135,_0xa7f302)=>{this['clear'](),this['fire']('cancel'),_0xa7f302();});}['_handleSubmit'](){const _0x4b9a42=this['getValue']()['trim']();_0x4b9a42?this['_isValidUrl'](_0x4b9a42)?(this['clearError'](),this['fire']('submitUrl',_0x4b9a42)):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4deef0=this['getValue']()['trim'](),_0x519137=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4deef0['length']>0x0&&!_0x519137;}['_isValidUrl'](_0x32cc01){try{return!!new URL(_0x32cc01);}catch{return!0x1;}}}const an='ck-ai-chat-resources__item',hn='ck-ai-chat-resources__item--in-context',cn='ck-ai-chat-resources__item-title',ln='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x40116e,_0x25927e){super(_0x40116e),this['resource']=_0x25927e,this['set']('isInContext',!!_0x25927e['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x47630a){if(_0x47630a['isInContext'])return _0x4ab520;switch(_0x47630a['type']){case'document':return _0x448da1;case'web-resource':return _0x1e2b51;case'file':case'text':return _0x5249ad;default:return _0x1c299b;}}['highlightText'](_0x212bfe){if(!_0x212bfe||''===_0x212bfe['trim']())return void this['_titleView']['highlightText'](null);const _0x25e130=new RegExp(_0x118ed5(_0x212bfe),'gi');this['_titleView']['highlightText'](_0x25e130);}['updateResourceState'](_0x1a32c2){this['resource']['isInContext']=_0x1a32c2,this['isInContext']=_0x1a32c2,this['_updateIcon']();}['_createTitleView'](){const _0x462032=new _0x2cc319();return _0x462032['text']=this['resource']['label'],_0x462032['extendTemplate']({'tag':'span','attributes':{'class':[cn]}}),_0x462032;}['_createIconView'](){const _0x2feaab=new xt();return _0x2feaab['content']=this['getResourceIcon'](this['resource']),_0x2feaab;}['_setupTemplate'](){const _0x53c4be=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[an,_0x53c4be['if']('isVisible','ck-hidden',_0x4c06a0=>!_0x4c06a0),_0x53c4be['if']('isInContext',hn)]},'children':[{'tag':'div','attributes':{'class':[ln]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x53c4be['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const un='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0xe05a9a,_0x2cf4bd){super(_0xe05a9a),this['_source']=_0x2cf4bd,this['extendTemplate']({'attributes':{'class':[un]}});}['setResources'](_0x5c6cb7,_0x5ca2b2){this['items']['clear']();let _0x47bb7d=_0x5c6cb7;if(this['_source']['useDefaultFiltering']&&_0x5ca2b2&&''!==_0x5ca2b2['trim']()){const _0xbb90ea=new RegExp(_0x5ca2b2['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x47bb7d=_0x5c6cb7['filter'](_0x120934=>_0xbb90ea['test'](_0x120934['label']));}for(const _0x1819b4 of _0x47bb7d){const _0xb0f898=new AIChatResourceListItemView(this['locale'],_0x1819b4);_0xb0f898['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1819b4);}),this['items']['add'](_0xb0f898);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5ca2b2);}['highlightText'](_0x286d02){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4d51d9=>{_0x4d51d9['highlightText'](_0x286d02);});}['updateResourceState'](_0x1ed831,_0x143924){for(const _0x449fc5 of this['items']){const _0x135279=_0x449fc5;_0x135279['resource']['id']===_0x1ed831&&_0x135279['updateResourceState'](_0x143924);}}['_handleResourceSelection'](_0x2606b4,_0x30eeee){this['fire']('addResourceToContext',{'source':_0x2606b4,'resource':_0x30eeee});}}class AIChatContextResourcesSearchInputView extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x43d107){const t=_0x43d107['t'],_0x3a0c41={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x123337,'label':Hi(_0x43d107,'AI_CHAT_SEARCH_RESOURCES')};super(_0x43d107,_0x3a0c41['creator']),this['label']=_0x3a0c41['label'],this['_viewConfig']=_0x3a0c41,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x43d107,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x44d659){this['fire']('search',_0x44d659);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x10b46f,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x5c9425,t){this['resetButtonView']=new vt(_0x5c9425),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5ed072,'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',_0x74915b=>!_0x74915b),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 AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x17788e,_0x21a9f8){super(_0x17788e),this['_source']=_0x21a9f8['source'],this['_searchInputVisibleFrom']=_0x21a9f8['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x184ac3([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0x2e91e2=new Nt(this['locale']);return _0x2e91e2['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x378408,_0x56ff96)=>{this['loadResources'](_0x56ff96),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x56ff96);}),_0x2e91e2;}['_createResourcesListView'](){const _0x56a728=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x56a728['delegate']('addResourceToContext')['to'](this),_0x56a728['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x56a728;}['_createSkeletonView'](){const _0x13b7fd=new AISkeletonView(this['locale'],Ss['aiChatResources']);return _0x13b7fd['bind']('isVisible')['to'](this,'isLoading'),_0x13b7fd;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x391fa){const _0x472736=ot();this['_latestLoadResourcesUid']=_0x472736,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x391fa,'uid':_0x472736}),this['isLoading']=!0x0;}['setResources'](_0x4ae5cf,_0x56f455){if(_0x56f455&&_0x56f455!==this['_latestLoadResourcesUid'])return;const _0x5a8155=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x4ae5cf,_0x5a8155),_0x4ae5cf['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x557d59,_0x3cd384){this['_resourcesListView']['updateResourceState'](_0x557d59,_0x3cd384);}}const dn='ck-ai-chat-context-controls__source-balloon-panel',_n='ck-button-icon\x20ck-button-back',In='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x3b95f6,_0x5da052,_0x3fc6e4){this['_locale']=_0x3b95f6,this['_bodyCollection']=_0x5da052,this['_config']=_0x3fc6e4;}['showSourceResourcesBalloon']({source:_0x3a98d0,withBackButton:_0x36006e}){let _0x1acb8d=this['_sourceResourceBalloons']['get'](_0x3a98d0['id']);_0x1acb8d||(_0x1acb8d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x3a98d0['id'],_0x1acb8d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1acb8d)),this['_addSourceResourceContent']({'balloonPanel':_0x1acb8d,'source':_0x3a98d0,'withBackButton':_0x36006e}),_0x1acb8d['show']();const _0x1ab6ba=this['_config']['getTargetElement']();_0x1ab6ba&&_0x1acb8d['pin']({'target':_0x1ab6ba,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5a4874,_0x16cab6,_0x2deed9){const _0x4b14e2=this['_sourceResourceBalloons']['get'](_0x5a4874);if(!_0x4b14e2)return;const _0x51c74a=this['_getResourcesViewFromBalloon'](_0x4b14e2);_0x51c74a&&(_0x51c74a['setResources'](_0x16cab6,_0x2deed9),_0x51c74a['once']('change:isLoading',()=>{_0x4b14e2['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x316e06){const _0x13e7d3=this['_sourceResourceBalloons']['get'](_0x316e06);_0x13e7d3&&requestAnimationFrame(()=>{_0x13e7d3['hide'](),this['_sourceResourceBalloons']['delete'](_0x316e06),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4d6ca6 of this['_sourceResourceBalloons']['values']())if(_0x4d6ca6['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0xa14c87,_0x184609,_0x18a24f){const _0x1dc962=this['_sourceResourceBalloons']['get'](_0xa14c87);if(!_0x1dc962||!_0x1dc962['isVisible'])return;const _0x190fcf=this['_config']['getTargetElement']();if(!_0x190fcf)return;_0x1dc962['pin']({'target':_0x190fcf,'limiter':this['_config']['getLimiterElement']()});const _0x2edf9a=this['_getResourcesViewFromBalloon'](_0x1dc962);_0x2edf9a&&_0x2edf9a['updateResourceState'](_0x184609,_0x18a24f);}['destroy'](){for(const _0x401d75 of this['_sourceResourceBalloons']['values']())_0x401d75['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xbd530=new Xt(this['_locale']);return _0xbd530['extendTemplate']({'attributes':{'class':dn}}),this['_bodyCollection']['add'](_0xbd530),_0xbd530;}['_addSourceResourceContent']({balloonPanel:_0xaf94fb,source:_0x414212,withBackButton:_0x2943f1}){_0xaf94fb['content']['clear']();const _0x2eef26=this['_createBalloonHeader']({'balloonPanel':_0xaf94fb,'source':_0x414212,'withBackButton':_0x2943f1});_0xaf94fb['content']['add'](_0x2eef26);const _0xe6e3ec=this['_createBalloonResourcesView'](_0x414212);_0xaf94fb['content']['add'](_0xe6e3ec);}['_createBalloonHeader']({balloonPanel:_0xb9dca0,source:_0x2f7f56,withBackButton:_0x4e1cbd}){const _0x1c8da6=new _0x3e7902(this['_locale'],{'label':_0x2f7f56['label'],'class':In});return _0x4e1cbd&&_0x1c8da6['children']['add'](this['_createBackButton'](_0xb9dca0),0x0),_0x1c8da6;}['_createBackButton'](_0x1d1d2a){const _0x33af41=new vt(this['_locale']);return _0x33af41['set']({'icon':_0x1607c0,'tooltip':Hi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_n}),_0x33af41['on']('execute',()=>{_0x1d1d2a['hide'](),this['_config']['onBackToContext']();}),_0x33af41;}['_createBalloonResourcesView'](_0xda9a7a){const _0xf21f95=new AIChatContextResourcesView(this['_locale'],{'source':_0xda9a7a,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0xf21f95['on']('loadSourceResources',(_0x5aa97a,_0x5d38f3)=>{this['_config']['onLoadSourceResources'](_0x5d38f3);}),_0xf21f95['on']('addResourceToContext',(_0xac9b54,_0xd72f6e)=>{this['_config']['onResourceSelected'](_0xd72f6e['source'],_0xd72f6e['resource']),this['closeSourceResourceBalloon'](_0xda9a7a['id']);}),_0xf21f95;}['_getResourcesViewFromBalloon'](_0x5720d2){const _0x86392a=_0x5720d2['content']['get'](0x1);return _0x86392a instanceof AIChatContextResourcesView?_0x86392a:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3fd579){zt({'emitter':_0x3fd579,'contextElements':[_0x3fd579['element']],'callback':()=>{_0x3fd579['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3fd579['isVisible']});}}const An=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],gn='ck-ai-chat-context-controls',Cn='ck-ai-chat-context-controls__pending-contexts',mn='ck-ai-chat-context-controls__add-context-balloon-panel',pn='ck-ai-chat-context-controls__add-context-button',En='ck-ai-chat-context-controls__url-balloon-panel',wn='ck-ai-chat-context-controls__balloon-button',Tn='ck-ai-chat-context-controls__balloon-button-source',fn='ck-ai-chat-controls-button',Sn='ck-ai-chat-context-chips-wrapper-balloon',Rn='ck-ai-chat-controls_context_show-more-button',bn='ck-ai-chat-context-controls__show-more-balloon-panel',On='ck-ai-chat',kn=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1cb278,_0x2ba44d){super(_0x1cb278),this['bodyCollection']=_0x2ba44d['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1cb278),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1cb278),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1cb278),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1cb278,_0x2ba44d);const _0x59c13d={'cssClasses':{'showMoreButton':Rn+'\x20'+Bi,'showMoreBalloon':bn,'overflowContainer':Sn,'controlsButton':fn}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x1cb278,this['_currentContextsChips'],_0x59c13d,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'](_0xffaeb7,_0x3faa1e){const _0x44669e=this['_createContextButton'](_0xffaeb7,'current',!0x0,_0x3faa1e);this['_addContextToCollection'](_0x44669e,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x196b10){this['_removeContextFromCollection'](_0x196b10,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x196b10,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4677cc,_0x200d4b){let _0x487e1b=this['_currentContextsChips']['find'](_0x5c884d=>_0x5c884d['id']===_0x4677cc);_0x487e1b||(_0x487e1b=this['_overflowManager']['overflowChips']['find'](_0x517d54=>_0x517d54['id']===_0x4677cc)),_0x487e1b&&(_0x487e1b['isLoading']=_0x200d4b);}['setConversationContext'](_0x26f000){this['_conversationContextsChips']['clear']();for(const _0x32a51d of _0x26f000){const _0x5a5caa=this['_createContextButton'](_0x32a51d,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x5a5caa,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x343f2b,_0x42bf97,_0x5ccac3){this['_resourcesBalloonView']['updateResourceState'](_0x343f2b,_0x42bf97,_0x5ccac3);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x5467e4,withBackButton:_0x245a01}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5467e4,'withBackButton':_0x245a01}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x356d9e,_0x3acd7f,_0x44c7bc,_0x4fdd1c){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x356d9e,_0x44c7bc,_0x4fdd1c);}['closeSourceResourceBalloon'](_0x142438){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x142438),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x461b3d){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x461b3d),this['_setAddContextButtonEnabled'](_0x461b3d);}['_setAddContextButtonEnabled'](_0x32b3e8){const _0x3f66ba=!_0x32b3e8['document']['isHidden']&&_0x32b3e8['document']['enabled'],_0x332472=_0x32b3e8['urls']['enabled'],_0x29b656=_0x32b3e8['files']['enabled'],_0x1ea182=_0x32b3e8['sources']['length']>0x0,_0x541f88=_0x32b3e8['customItems']&&_0x32b3e8['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x3f66ba||_0x332472||_0x29b656||_0x1ea182||_0x541f88;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[gn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Cn},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5ebb03){const _0x520618=new vt(_0x5ebb03);return _0x520618['set']({'label':Hi(_0x5ebb03,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':fn+'\x20'+pn+'\x20'+Bi,'icon':_0x5718be,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x520618;}['_createAddContextBalloonPanelView'](_0x185d83){return this['_createBaseBalloonPanel'](_0x185d83,mn);}['_createUrlBalloonPanelView'](_0x49a7fb){const _0x3e9248=this['_createBaseBalloonPanel'](_0x49a7fb,En);return this['_addUrlContent'](_0x3e9248,_0x49a7fb),_0x3e9248;}['_createResourcesBalloonView'](_0x4e2487,_0x1e7d9d){const _0x5d440f={'searchInputVisibleFrom':_0x1e7d9d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});},'onResourceSelected':(_0x41fa7e,_0xa20132)=>{this['fire']('addResourceToContext',{'source':_0x41fa7e,'resource':_0xa20132});},'onLoadSourceResources':_0x1d25a3=>{this['fire']('loadSourceResources',_0x1d25a3);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x4e2487,_0x1e7d9d['bodyCollection'],_0x5d440f);}['_getLimiterElement'](){return this['element']?.['closest']('.'+On)||document['body'];}['_createBaseBalloonPanel'](_0xc3fbb0,_0x1b9d76){const _0xd356c2=new Xt(_0xc3fbb0);return _0xd356c2['extendTemplate']({'attributes':{'class':_0x1b9d76}}),this['bodyCollection']['add'](_0xd356c2),_0xd356c2;}['_setBalloonPanelContent'](_0x2fc140,_0x463fb1,_0x2cce21){if(_0x2fc140['content']['clear'](),!_0x2cce21['document']['isHidden']&&_0x2cce21['document']['enabled']){const _0x344f48=this['_createBalloonButton'](_0x463fb1,{'label':Hi(_0x463fb1,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x448da1});_0x344f48['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x2fc140['content']['add'](_0x344f48);}if(_0x2cce21['urls']['enabled']){const _0x29593c=this['_createBalloonButton'](_0x463fb1,{'label':Hi(_0x463fb1,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x1e2b51});_0x29593c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_urlInputView']['focus']();}),_0x2fc140['content']['add'](_0x29593c);}if(_0x2cce21['files']['enabled']){const _0x22e10b=new _0x4509d1(_0x463fb1);_0x22e10b['set']({'label':Hi(_0x463fb1,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x16f379,'withText':!0x0,'tooltip':!0x0,'class':wn,'allowMultipleFiles':!0x0}),_0x22e10b['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x22e10b['on']('done',(_0x520bd2,_0x1e9d22)=>{this['fire']('addFileToContext',_0x1e9d22);}),_0x22e10b['tooltip']=!0x0,_0x2fc140['content']['add'](_0x22e10b);}for(const _0x158926 of _0x2cce21['sources']){const _0x2d7119=this['_createBalloonButton'](_0x463fb1,{'label':_0x158926['label'],'icon':_0x158926['icon']||_0x1c299b,'type':'source'});_0x2fc140['content']['add'](_0x2d7119),_0x2d7119['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x158926,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2e7b14 of _0x2cce21['customItems']||[]){const _0x599af3=this['_createBalloonButton'](_0x463fb1,{'label':_0x2e7b14['label'],'icon':_0x2e7b14['icon']||_0x1c299b,'type':'customItem'});_0x2fc140['content']['add'](_0x599af3),_0x599af3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2e7b14);});}this['_hasExactlyOneSource']=0x1===_0x2fc140['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x10ad27,_0x5e7b72){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x5e7b72),this['_urlInputView']['on']('submitUrl',(_0x3e4320,_0x1b5ac3)=>{this['_handleUrlSubmit'](_0x1b5ac3);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});}),_0x10ad27['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x368514,_0x4a309a){const _0x17a4f6='source'===_0x4a309a['type']?new SourcesBalloonButtonView(_0x368514):new vt(_0x368514);return _0x17a4f6['set']({'label':_0x4a309a['label'],'icon':_0x4a309a['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':wn}),_0x17a4f6;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x57daa5){const _0x4b69d1=this['_addContextBalloonConfig'];_0x4b69d1['buttonView']['isOn']=_0x57daa5,_0x57daa5?_0x4b69d1['balloonView']['show']():_0x4b69d1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x2fae7b,buttonView:_0x285ad8,hideMethod:_0x46cdd1}=this['_addContextBalloonConfig'];zt({'emitter':_0x2fae7b,'contextElements':[_0x2fae7b['element'],_0x285ad8['element']],'callback':()=>{_0x46cdd1();},'activator':()=>_0x285ad8['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1c9768,_0x369a6d,_0x26af15=!0x1,_0x2bdb53=!0x1){const _0x2fa173='conversation'===_0x369a6d||!0x0===_0x1c9768['isReadOnly'],_0x4dc83f=new AIChatContextItemButtonView(this['locale'],_0x1c9768,_0x2fa173,_0x26af15,_0x2bdb53);return _0x2fa173||_0x4dc83f['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4dc83f['id']);}),_0x4dc83f;}['_addContextToCollection'](_0x285089,_0x2ec60e){_0x2ec60e['add'](_0x285089,0x0);}['_removeContextFromCollection'](_0x18f80b,_0x1fb5cd){const _0x2d98cb=_0x1fb5cd['find'](_0x4c9e73=>_0x4c9e73['id']===_0x18f80b);_0x2d98cb&&_0x1fb5cd['remove'](_0x2d98cb);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x21a0a6){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x21a0a6);}}class SourcesBalloonButtonView extends vt{['arrowView'];constructor(_0x36b8dd){super(_0x36b8dd),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Tn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x248275=new xt();return _0x248275['content']=_0x4e78fd,_0x248275['extendTemplate']({'attributes':{'class':Tn+'__arrow'}}),_0x248275;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x424e6d){super(_0x424e6d),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 _0x5e2c1b=new vt(this['locale']);return _0x5e2c1b['set']({'label':Hi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Ui+'\x20ck-ai-button-stop-generating','icon':_0x1b062b}),_0x5e2c1b['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5e2c1b;}['_createLoaderView'](){const _0x457e93=new Nt(this['locale']);return _0x457e93['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':Hi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x457e93;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x22a47c,_0x56ea02){super(_0x22a47c),this['_contextPanelView']=this['_createContextPanelView'](_0x22a47c,{'bodyCollection':_0x56ea02['bodyCollection'],'searchInputVisibleFrom':_0x56ea02['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x22a47c),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x22a47c),this['_loaderView']=this['_createLoaderView'](_0x22a47c),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x22a47c),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'](...An)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x76c960=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x76c960['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x76c960['if']('isLoading','ck-hidden',_0x4238ce=>_0x4238ce||!this['isModelAvailable']),_0x76c960['if']('isModelAvailable','ck-hidden',_0x112e20=>!_0x112e20||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x76c960['if']('isLoading','ck-hidden',_0x5e20e2=>!_0x5e20e2)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x76c960['if']('isModelAvailable','ck-hidden',_0x2003cc=>_0x2003cc)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x322a6d,_0x4273f5){return new AIChatContextPanelView(_0x322a6d,_0x4273f5);}['_createPromptInputView'](_0x6bc6b1){return new AIChatPromptInputView(_0x6bc6b1,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4d4e66){return new AIChatPromptCapabilitiesView(_0x4d4e66);}['_createLoaderView'](_0x1dad9b){return new AIChatControlsLoaderView(_0x1dad9b);}['_createModelUnavailableMessageView'](_0x39f6fe){const _0x38140c=new AIChatModelUnavailableMessageView(_0x39f6fe);return _0x38140c['delegate']('startConversation')['to'](this),_0x38140c;}['_handlePromptInputFocus'](_0x11b29e,_0x49e8c2,_0x1e7e06){_0x1e7e06?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x27ed4c,_0x3e8ad7){this['_contextPanelView']['addContextItem'](_0x27ed4c,_0x3e8ad7);}['removeContextItem'](_0x23ebf3){this['_contextPanelView']['removeContextItem'](_0x23ebf3);}['setContextItemLoading'](_0x55b4fd,_0x11b798){this['_contextPanelView']['setContextItemLoading'](_0x55b4fd,_0x11b798);}['setIsUploadInProgress'](_0x1b2787){this['_promptInputView']['setIsUploadInProgress'](_0x1b2787);}['setConversationContext'](_0x286024){this['_contextPanelView']['setConversationContext'](_0x286024);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5ecbe8,_0x44ee0f,_0x219733){this['_contextPanelView']['updateResourceState'](_0x5ecbe8,_0x44ee0f,_0x219733);}['setWebSearch'](_0x4a2def){this['_promptCapabilitiesView']['setWebSearch'](_0x4a2def);}['setReasoning'](_0x5ef077){this['_promptCapabilitiesView']['setReasoning'](_0x5ef077);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x3b76c9){this['_contextPanelView']['setAddContextOptions'](_0x3b76c9);}['setInputPlaceholder'](_0x332bce){this['_promptInputView']['setPlaceholderText'](_0x332bce);}['setModelList'](_0x127ce3,_0x4457c7){this['_promptCapabilitiesView']['setModelList'](_0x127ce3,_0x4457c7);}['setModel'](_0x2bfba0){_0x2bfba0?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2bfba0)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x497751){this['_promptCapabilitiesView']['disableModelSelector'](_0x497751);}['populateSourceResourceBalloon'](_0x752bd2,_0xf989f4,_0x198c61,_0x5090ab){this['_contextPanelView']['populateSourceResourceBalloon'](_0x752bd2,_0xf989f4,_0x198c61,_0x5090ab);}['closeSourceResourceBalloon'](_0x42abc7){this['_contextPanelView']['closeSourceResourceBalloon'](_0x42abc7);}['focusPromptInput'](_0xfd323f=!0x1){this['_promptInputView']['focus'](_0xfd323f);}['setPromptInputValue'](_0x5aacfc){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x5aacfc;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0x29e53d){super(_0x29e53d);const _0x44082e=new vt(_0x29e53d);_0x44082e['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x44082e['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x44082e]}]});}}class AIHeaderView extends _0x3e7902{['resizeButton'];constructor(_0xb600a8,_0x4cb618){super(_0xb600a8,{'label':_0x4cb618['label'],'class':'ck-ai-header\x20'+_0x4cb618['class'],'icon':_0x4cb618['icon']}),this['set']('isMaximized',!0x1),_0x4cb618['content']&&this['children']['add'](_0x4cb618['content']),_0x4cb618['showResizeButton']&&(this['resizeButton']=Gi(_0xb600a8,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x4d22be){super(_0x4d22be),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Hi(_0x4d22be,'AI_DISCLAIMER_TEXT')}]}]});}}function vn(_0x1dff23,_0x57be2b){const _0x4659ee=new vt(_0x1dff23);return _0x4659ee['set']({'label':Hi(_0x1dff23,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x37726c,'class':'ck-ai-chat__start-conversation\x20'+Ui}),_0x4659ee['on']('execute',()=>{_0x57be2b['fire']('startConversation');}),_0x4659ee;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1396f0,_0x4a6889){super(_0x1396f0),this['_bodyCollection']=new Qt(_0x1396f0),this['_bodyCollection']['attachToDom']();const _0x137e38=vn(_0x1396f0,this);this['chatHeader']=new AIHeaderView(_0x1396f0,{'label':Hi(_0x1396f0,'AI_CHAT_HEADING'),'icon':_0x2ea593,'class':'ck-ai-header_chat','content':_0x137e38,'showResizeButton':_0x4a6889['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x1396f0,this['_bodyCollection']),this['chatFeed']['delegate'](...ms)['to'](this),this['chatControls']=new AIChatControlsView(_0x1396f0,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4a6889['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ms)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x1396f0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1396f0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x2a7998,_0x1ff50b,_0xf5062,_0x530fc8){this['chatControls']['populateSourceResourceBalloon'](_0x2a7998,_0x1ff50b,_0xf5062,_0x530fc8);}['closeSourceResourceBalloon'](_0x948496){this['chatControls']['closeSourceResourceBalloon'](_0x948496);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x23f270{static get['requires'](){return[AITabs];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x240339){super(_0x240339);const _0x318c4d=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x318c4d['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x318c4d),this['_view']['delegate'](...ms)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2e82c2,{showDiff:_0x131e22})=>{this['showDiff']=_0x131e22;}),_0x318c4d['view']['addTab']({'id':'chat','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x2ea593,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x318c4d['view'],'isMaximized',_0x252bab=>_0x252bab),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x9a5bf6=>_0x9a5bf6),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4b1ab4){const _0x4d4fc8=this['context']['config']['get']('ai.chat.welcomeMessage')??Hi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x4b1ab4['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4d4fc8}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x2c5e92,staticMessage:_0x5825dc}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2c5e92,'initialContent':'<p>'+_0x5825dc+'</p>'});});}async['addFeedItemUserMessage'](_0x39508c){const _0x3e3490=_0x39508c['attributes']?.['displayedPrompt']||_0x39508c['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x39508c['contextItems']['values']()),'initialContent':'<p>'+_0x3e3490+'</p>','id':_0x39508c['id']});});}async['addFeedItemError']({errorMessage:_0x4ed352,id:_0x54be1f}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4ed352+'</p>','id':_0x54be1f});});}async['addFeedItemAIReply'](_0x207998){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x207998['interactionId']+':'+_0x207998['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x2124ed){const _0x11141=ds(this['context']);let _0x219a97=_0x11141['config']['get']('ai.availableReplyActions')||[...bs];if(_0x11141['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2dfbcc=_0x11141['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2dfbcc,'value');}}else _0x219a97=_0x219a97['filter'](_0x2bb4c5=>'insertSuggestion'!=_0x2bb4c5);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2124ed['interactionId']+':'+_0x2124ed['id'],'areActionsDisabled':_0x2124ed['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x219a97}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x54790e,_0x29f179){return this['_promiseQueue']['enqueue'](async()=>{const _0x53b216=this['_view']['chatFeed']['children']['last'];if(_0x53b216 instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x53b216),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x54790e['id'],'capabilities':{'isWebSearchEnabled':_0x53b216['capabilities']['isWebSearchEnabled']||_0x29f179['isWebSearchEnabled'],'isReasoningEnabled':_0x53b216['capabilities']['isReasoningEnabled']||_0x29f179['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x54790e['id'],'capabilities':_0x29f179});});}async['addFeedItemCustomElement'](_0x489987,_0xafb73c){let _0x406417;return await this['_promiseQueue']['enqueue'](async()=>{_0x406417=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x489987,'id':_0xafb73c});}),_0x406417;}['removeFeedItem'](_0xb98ce7){this['_view']['chatFeed']['removeItem'](_0xb98ce7);}['hasFeedItem'](_0xd49f00){return this['_view']['chatFeed']['hasItem'](_0xd49f00);}['updateFeedInteractionHeader'](_0x401466){const _0x34affc=this['_view']['chatFeed']['children']['find'](_0x5a3531=>_0x5a3531['options']['id']==_0x401466['id']&&_0x5a3531 instanceof AIChatFeedInteractionHeaderView);_0x34affc&&_0x34affc['set']('isVisible',_0x401466['isVisible']);}async['updateFeedItemAIReplyContent'](_0x44af0c){const _0x30632b=_0x44af0c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x6e6cef=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x44af0c,'abortSignal':_0x6e6cef,'renderingStrategy':_0x30632b}),_0x44af0c['isDone']&&this['markFeedItemAsDone'](_0x44af0c['id']);});}['updateFeedItemAIReplySources'](_0x206773,_0x1f426b){this['_view']['chatFeed']['updateWebSources'](_0x206773,_0x1f426b);}async['updateFeedItemAIReplySuggestionContent'](_0x2e751c){return this['_promiseQueue']['enqueue'](async _0x3fc8bb=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x2e751c,'abortSignal':_0x3fc8bb}),_0x2e751c['isDone']&&this['markFeedItemAsDone'](_0x2e751c['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1f7d69){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1f7d69);}['setFeedItemAIReplySuggestionPartActive'](_0x892ec){this['_view']['chatFeed']['setSuggestionPartActive'](_0x892ec);}['markFeedItemAsDone'](_0x3fe749){this['_view']['chatFeed']['markItemAsDone'](_0x3fe749);}['removeFeedInteraction'](_0x62e76d){this['_view']['chatFeed']['getItemIds']()['filter'](_0x1260b0=>_0x1260b0['startsWith'](_0x62e76d))['forEach'](_0xfdff1f=>this['_view']['chatFeed']['removeItem'](_0xfdff1f));}['startInteraction'](){const _0x1dd44d=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1dd44d),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x314abe){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x48e757=>_0x48e757['startsWith'](_0x314abe['id']))['forEach'](_0x2f65f6=>this['markFeedItemAsDone'](_0x2f65f6)),this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x433ca9,_0x116c0d){this['_view']['chatControls']['addContextItem'](_0x433ca9,_0x116c0d);}['removeContextItem'](_0x2cfc52){this['_view']['chatControls']['removeContextItem'](_0x2cfc52);}['setContextItemLoading'](_0xa99ef0,_0xd2f6af){this['_view']['chatControls']['setContextItemLoading'](_0xa99ef0,_0xd2f6af);}['setIsUploadInProgress'](_0x41e131){this['_view']['chatControls']['setIsUploadInProgress'](_0x41e131);}['setConversationContext'](_0x55c2ea){this['_view']['chatControls']['setConversationContext'](_0x55c2ea);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x58b145,_0x105f70,_0x39b471){this['_view']['chatControls']['updateResourceState'](_0x58b145,_0x105f70,_0x39b471);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x1934b6){this['_view']['chatControls']['setAddContextOptions'](_0x1934b6);}['updateCapabilities'](_0x118f3c){this['_view']['chatControls']['setWebSearch'](_0x118f3c['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x118f3c['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x118f3c));}['setSelectedModel'](_0x3e0d9c,_0x54bd55){this['_view']['chatControls']['setModel'](_0x3e0d9c),_0x54bd55&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x47e80b){this['feedItemRenderingStrategy']=_0x47e80b;}['toggleLoadingSkeleton'](_0x1fa1e1){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1fa1e1);}['resetConversationTitle'](){this['setConversationTitle'](Hi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x27342f,_0x142e1a=!0x1){if(_0x142e1a&&!Rt()&&_0x27342f['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x27342f);this['_view']['chatHeader']['label']=_0x27342f;}['setLoadingMessage'](_0x2c62ed){this['_view']['chatFeed']['setLoadingMessage'](_0x2c62ed);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x2db7ba){let _0x1a307f=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2db7ba[_0x1a307f],_0x1a307f++,_0x1a307f===_0x2db7ba['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x2c63d6){return _0x2c63d6['isWebSearchEnabled']&&_0x2c63d6['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2c63d6['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2c63d6['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2a0eb2){return _0x2a0eb2?_0x2a0eb2['isWebSearchEnabled']&&_0x2a0eb2['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2a0eb2['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2a0eb2['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x2741ef,_0x44220a,_0x3067e3,_0x5f4012){this['_view']['populateSourceResourceBalloon'](_0x2741ef,_0x44220a,_0x3067e3,_0x5f4012);}['closeSourceResourceBalloon'](_0x47878c){this['_view']['closeSourceResourceBalloon'](_0x47878c);}['setPromptInputValue'](_0x5282d7){this['_view']['chatControls']['setPromptInputValue'](_0x5282d7);}['focusPromptInput'](_0x263c96=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x263c96);}['scrollFeedToSuggestion'](_0x5e89cd,_0x416846){this['_view']['chatFeed']['scrollToSuggestion'](_0x5e89cd,_0x416846);}['startAutoScroll'](_0x3c3fc7={}){this['_view']['chatFeed']['startAutoScroll'](_0x3c3fc7);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0xc09c9a,_0x4649c7){super(_0xc09c9a),this['sections']=_0x4649c7,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x15e2d3){let _0x2abd22=0x0,_0xb7a9c7=0x0;for(const _0x543a69 of this['sections']){const {resultsCount:_0x197f23,totalItemsCount:_0x41c013}=_0x543a69['filter'](_0x15e2d3);_0x2abd22+=_0x197f23,_0xb7a9c7+=_0x41c013;}return{'resultsCount':_0x2abd22,'totalItemsCount':_0xb7a9c7};}}class AIChatHistoryListView extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1be180,{title:_0xd9b032,items:_0x1eb41a}){super(_0x1be180);const _0x24760d=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0xd9b032,this['itemsViews']=_0x1eb41a;const _0x30c53b=new Nt(_0x1be180);_0x30c53b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1be180),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x24760d['if']('isVisible','ck-hidden',_0x48d13d=>!_0x48d13d)]},'children':[_0x30c53b,this['_itemsListView']]});}['filter'](_0x9e6a0e){const _0x1680ea=this['itemsViews']['length'];let _0x53be0f=0x0;for(const _0x4062c0 of this['itemsViews']){if(_0x9e6a0e){const _0x1839fe=_0x4062c0['isMatching'](_0x9e6a0e);_0x4062c0['isVisible']=!!_0x1839fe,_0x4062c0['highlightText'](_0x9e6a0e);}else _0x4062c0['isVisible']=!0x0,_0x4062c0['highlightText'](null);_0x4062c0['isVisible']&&_0x53be0f++;}return this['isVisible']=_0x53be0f>0x0,{'resultsCount':_0x53be0f,'totalItemsCount':_0x1680ea};}['getItem'](_0x1fac15){return this['itemsViews']['find'](_0x10a500=>_0x10a500['id']===_0x1fac15);}['removeItem'](_0x37d4dd){const _0x3840cb=this['itemsViews']['indexOf'](_0x37d4dd);-0x1!==_0x3840cb&&(this['itemsViews']['splice'](_0x3840cb,0x1),this['_itemsListView']['items']['remove'](_0x37d4dd));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x104e5b(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x2b4f2c,_0x57c02e){super(_0x2b4f2c);const _0x5917fa=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x57c02e['pinned']),this['set']('loadingState',null),this['set']('title',_0x57c02e['title']),this['id']=_0x57c02e['id'];const {createdAt:_0x383b67,active:_0x33726f=!0x1}=_0x57c02e;this['_titleView']=new _0x2cc319(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x19d831(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4dadd7=this['_createCheckView'](),_0x50df65=this['_createPinButtonView'](_0x2b4f2c),_0x4622cc=this['_createMenuDropdownView'](),_0x3dc689=this['_createEditInputView'](_0x2b4f2c),_0x486d17=this['_createAcceptEditButtonView'](_0x2b4f2c,_0x3dc689),_0x32cd90=this['_createCancelEditButtonView'](_0x2b4f2c);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x50df65),this['actions']['add'](_0x4622cc),this['on']('change:isEdit',(_0x337fcb,_0x364018,_0x2c6737)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2c6737?(this['actions']['add'](_0x486d17),this['actions']['add'](_0x32cd90),this['mainContent']['add'](_0x3dc689),_0x3dc689['element']['value']=this['title']||'',_0x3dc689['element']['focus']()):(this['actions']['add'](_0x50df65),this['actions']['add'](_0x4622cc),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x33726f?'ck-ai-chat-history__item--active':'',_0x5917fa['if']('isVisible','ck-hidden',_0x358eec=>!_0x358eec),_0x5917fa['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',_0x5917fa['if']('loadingState','ck-hidden',_0x54768e=>!!_0x54768e)]},'children':_0x33726f?[_0x4dadd7]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5917fa['if']('loadingState','ck-hidden',_0x166045=>!_0x166045)]},'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-container',_0x5917fa['if']('loadingState','ck-hidden',_0x208883=>!!_0x208883)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5917fa['if']('loadingState','ck-hidden',_0x329f0b=>!_0x329f0b)]},'children':[{'text':_0x5917fa['to']('loadingState',_0x563d67=>_0x563d67?Hi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x563d67]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x383b67]}]},{'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'](_0xd29cb9){this['set']('title',_0xd29cb9);}['updateLoadingState'](_0x331ff7,_0x3b8002){this['set']('loadingState',_0x3b8002?_0x331ff7:null);}['_createCheckView'](){const _0x295737=new xt();return _0x295737['set']({'content':_0x4ab520}),_0x295737;}['_createPinButtonView'](_0x175592){const _0x10cc42=new vt(_0x175592);return _0x10cc42['set']({'label':Hi(_0x175592,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5e7c87,'withText':!0x1,'tooltip':!0x0}),_0x10cc42['bind']('isOn')['to'](this,'pinned'),_0x10cc42['on']('execute',()=>{const _0x4bbbb8=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4bbbb8});}),_0x10cc42;}['_createMenuDropdownView'](){const _0x59c59a=Gt(this['locale']),_0x4c4d8d=_0x59c59a['panelView']['children'];_0x59c59a['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x57c6c8}),_0x59c59a['panelPosition']='sw';const _0x4d2db0=new vt(this['locale']);_0x4d2db0['label']=Hi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4d2db0['withText']=!0x0,_0x4d2db0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x146857=new vt(this['locale']);_0x146857['label']=Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x146857['withText']=!0x0,_0x146857['on']('execute',()=>{this['showConfirm'](Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3b558d=new Dt(this['locale']),_0x14aeae=new Pt(this['locale']);_0x14aeae['children']['add'](_0x4d2db0);const _0x4e6890=new Pt(this['locale']);return _0x4e6890['children']['add'](_0x146857),_0x3b558d['items']['addMany']([_0x14aeae,_0x4e6890]),_0x4c4d8d['add'](_0x3b558d),_0x59c59a;}['_createEditInputView'](_0x30b890){const _0x47340d=new _0x142293(_0x30b890),_0x4ee838=_0x47340d['bindTemplate'];return _0x47340d['extendTemplate']({'on':{'keydown':_0x4ee838['to'](_0x4ebfd6=>{'Enter'==_0x4ebfd6['key']&&this['_commitEditInputValue'](_0x47340d);})}}),_0x47340d;}['_createAcceptEditButtonView'](_0x514f30,_0x215945){const _0x5ca316=new vt(_0x514f30);return _0x5ca316['set']({'icon':_0x4ab520,'withText':!0x1,'tooltip':Hi(_0x514f30,'AI_CHAT_HISTORY_ACCEPT')}),_0x5ca316['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5ca316['on']('execute',()=>{this['_commitEditInputValue'](_0x215945);}),_0x5ca316;}['_commitEditInputValue'](_0x3883cb){const _0x2f9f40=_0x3883cb['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2f9f40});}['_createCancelEditButtonView'](_0x2aff26){const _0x17d434=new vt(_0x2aff26);return _0x17d434['set']({'icon':_0x5ed072,'withText':!0x1,'tooltip':Hi(_0x2aff26,'AI_CHAT_HISTORY_CANCEL')}),_0x17d434['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x17d434['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x17d434;}['_createSpinnerView'](){const _0x4c57db=new AISpinnerView('tiny');return _0x4c57db['isVisible']=!0x0,_0x4c57db;}['isMatching'](_0x369d30){return'string'==typeof this['title']&&this['title']['match'](_0x369d30)?{'title':!0x0}:null;}['highlightText'](_0x536635){this['_titleView']['highlightText'](_0x536635);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x5b625d,_0x314ecc){super(_0x5b625d),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x2322fb=vn(_0x5b625d,this);this['headerView']=new AIHeaderView(_0x5b625d,{'label':Hi(_0x5b625d,'AI_CHAT_HISTORY_HEADING'),'icon':_0x41655b,'class':'ck-ai-header_history','content':_0x2322fb,'showResizeButton':_0x314ecc}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x5b625d,[]),this['sectionsView']['delegate'](...Nn)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x5bd72d=>!_0x5bd72d)]}}),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':[this['headerView'],{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}['_createSearchView'](){const _0x5755d6=new _0x1be4c1(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5baac5=>Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5baac5),'secondary':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4fec59=this['_createErrorView']();return _0x4fec59['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x9c198b=>!_0x9c198b)]}}),_0x5755d6['on']('render',()=>{_0x5755d6['children']['add'](_0x4fec59,0x1);}),_0x5755d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x57acfd=>!_0x57acfd)]}}),_0x5755d6;}['_createSkeletonView'](){const _0x484149=new AISkeletonView(this['locale'],Ss['aiHistory']);return _0x484149['bind']('isVisible')['to'](this,'isLoading'),_0x484149;}['_createErrorView'](){const _0x2c8aff=new Nt(this['locale']),_0x4ae134=new vt(this['locale']);_0x4ae134['set']({'withText':!0x1,'icon':_0x5ed072,'class':'ck-ai-notification_error__dismiss-button'}),_0x4ae134['bind']('isVisible')['to'](this,'hasItems',_0x43c2ae=>!!_0x43c2ae),_0x4ae134['on']('execute',()=>{this['errorMessage']='';});const _0x2bb15d=this['bindTemplate'];return _0x2c8aff['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2bb15d['to']('errorMessage')}]},_0x4ae134]}),_0x2c8aff;}['_createEmptyStateView'](){const _0x1f7ec5=new Nt(this['locale']);return _0x1f7ec5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1462a3=>!_0x1462a3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Hi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x1f7ec5;}['_createListItemViews'](_0x32495a,_0x12d35c){const _0x13d181=[];for(const _0x9691da of _0x32495a){const _0x1bba99=new AIChatHistoryListItemView(_0x12d35c,_0x9691da);_0x1bba99['delegate'](...Nn)['to'](this),_0x13d181['push'](_0x1bba99);}return _0x13d181;}['updateHistoryItemsWithCategories'](_0x1b65f0){const _0x5056b2=this['locale']||'en',_0x5cdf33=[];for(const _0x558764 of _0x1b65f0){const _0x3559bd=this['_createListItemViews'](_0x558764['items'],_0x5056b2);_0x5cdf33['push'](new AIChatHistoryListView(_0x5056b2,{'title':_0x558764['title'],'items':_0x3559bd}));}this['sectionsView']['sections']=_0x5cdf33,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5cdf33),this['hasItems']=_0x1b65f0['some'](_0x23d61c=>_0x23d61c['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x406888){for(const _0x3cefff of this['sectionsView']['sections']){const _0x3edb29=_0x3cefff['getItem'](_0x406888);if(_0x3edb29){if(_0x3cefff['removeItem'](_0x3edb29),0x0===_0x3cefff['itemsViews']['length']){const _0x4c8e7d=this['sectionsView']['sections']['indexOf'](_0x3cefff);-0x1!==_0x4c8e7d&&(this['sectionsView']['sections']['splice'](_0x4c8e7d,0x1),this['sectionsView']['items']['remove'](_0x3cefff));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x20d71c,_0xb65951){for(const _0x15acd1 of this['sectionsView']['sections']){const _0x378b8a=_0x15acd1['getItem'](_0x20d71c);if(_0x378b8a){_0x378b8a['updateTitle'](_0xb65951);break;}}}['updateItemLoadingState'](_0x4738cc,_0x2f9533,_0x4c10e8){for(const _0x16d378 of this['sectionsView']['sections']){const _0x15f44e=_0x16d378['getItem'](_0x4738cc);if(_0x15f44e){_0x15f44e['updateLoadingState'](_0x2f9533,_0x4c10e8);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x21217a=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x21217a);}}}const Nn=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x23f270{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ad4fb){super(_0x1ad4fb);const _0x2c15a4=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x2c15a4['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x2c15a4),this['_historyView']['delegate'](...Nn)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x2c15a4['view'],'isMaximized',_0x1e9d01=>_0x1e9d01),_0x2c15a4['view']['addTab']({'id':'history','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x41655b,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x10d7f5){this['_historyView']['removeHistoryItem'](_0x10d7f5);}['updateItems'](_0x458a90){this['_historyView']['updateHistoryItemsWithCategories'](_0x458a90);}['updateItemTitle'](_0x45678e,_0x5e0770){this['_historyView']['updateItemTitle'](_0x45678e,_0x5e0770);}['updateItemLoadingState'](_0x36e5c3,_0x537cee,_0x52f184){this['_historyView']['updateItemLoadingState'](_0x36e5c3,_0x537cee,_0x52f184);}['setLoadingSkeleton'](_0x354311){this['_historyView']['isLoading']=_0x354311;}['showError'](_0x3a15de){this['_historyView']['errorMessage']=_0x3a15de;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ht(){['id'];['createdAt'];constructor({id:_0x2f9038,title:_0x3ea617,createdAt:_0x17056e,updatedAt:_0x4ae6d7,pinned:_0x121d15}){super(),this['id']=_0x2f9038,this['createdAt']=new Date(_0x17056e),this['set']('title',_0x3ea617),this['set']('updatedAt',_0x4ae6d7?new Date(_0x4ae6d7):null),this['set']('pinned',_0x121d15||!0x1);}['updateTitle'](_0x1643e4){this['set']('title',_0x1643e4),this['updatedAt']=new Date();}['updatePinned'](_0x407fcf){this['set']('pinned',_0x407fcf),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x56100e,group:_0x45a976}){super(),this['connector']=_0x56100e,this['group']=_0x45a976;}async['init'](){try{const _0x448337=this['connector']['fetchConversations'](this['group']),_0x1b4e1f=await _0x448337['getConversations']();this['loadItems'](_0x1b4e1f);}catch(_0x2b4d53){this['fire']('error',{'error':_0x2b4d53,'operation':'init'});}}['addItem'](_0x25d6eb){this['items']['push'](_0x25d6eb);}async['removeItem'](_0x4e3ca5){const _0x497996=this['items']['findIndex'](_0x3c7d07=>_0x3c7d07['id']===_0x4e3ca5);if(-0x1===_0x497996)return!0x1;try{return await this['connector']['deleteConversation'](_0x4e3ca5)['execute'](),this['items']['splice'](_0x497996,0x1),this['fire']('itemRemoved',{'itemId':_0x4e3ca5}),!0x0;}catch(_0x288674){return this['fire']('error',{'error':_0x288674,'operation':'removeItem','itemId':_0x4e3ca5}),!0x1;}}['getItem'](_0x45084a){return this['items']['find'](_0x28522f=>_0x28522f['id']===_0x45084a);}async['updateItemTitle'](_0x485c6e,_0x57c244){const _0x5ac402=this['getItem'](_0x485c6e);if(!_0x5ac402)return!0x1;try{return await this['connector']['updateConversation'](_0x485c6e,{'title':_0x57c244})['getResult'](),_0x5ac402['updateTitle'](_0x57c244),this['fire']('itemUpdated',{'itemId':_0x485c6e,'updates':{'title':_0x57c244}}),!0x0;}catch(_0x4b0a73){return this['fire']('error',{'error':_0x4b0a73,'operation':'updateItemTitle','itemId':_0x485c6e}),!0x1;}}async['updateItemPinned'](_0x1364ce,_0x426dcb){const _0x342025=this['getItem'](_0x1364ce);if(!_0x342025)return!0x1;try{return await this['connector']['updateConversation'](_0x1364ce,{'pinned':_0x426dcb})['getResult'](),_0x342025['updatePinned'](_0x426dcb),this['fire']('itemUpdated',{'itemId':_0x1364ce,'updates':{'pinned':_0x426dcb}}),!0x0;}catch(_0x1cd891){return this['fire']('error',{'error':_0x1cd891,'operation':'updateItemPinned','itemId':_0x1364ce}),!0x1;}}['loadItems'](_0x107c2d){try{this['items']=[],_0x107c2d['map'](_0x2542f2=>{this['addItem'](new AIChatHistoryItem(_0x2542f2));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x67b595){this['fire']('error',{'error':_0x67b595,'operation':'loadItems'});}}['getItems'](_0x33ef24={}){const _0x164700=void 0x0!==_0x33ef24['pinned']&&_0x33ef24['pinned'],_0x4255c9=_0x33ef24['from']?new Date(_0x33ef24['from']['getFullYear'](),_0x33ef24['from']['getMonth'](),_0x33ef24['from']['getDate']()):null,_0x52c075=_0x33ef24['to']?new Date(_0x33ef24['to']['getFullYear'](),_0x33ef24['to']['getMonth'](),_0x33ef24['to']['getDate']()):null;return this['items']['filter'](_0x4cdb2d=>{if(_0x4cdb2d['pinned']!==_0x164700)return!0x1;if(_0x52c075){const _0x163d42=new Date(_0x4cdb2d['createdAt']['getFullYear'](),_0x4cdb2d['createdAt']['getMonth'](),_0x4cdb2d['createdAt']['getDate']());return _0x4255c9?_0x4255c9['getTime']()===_0x52c075['getTime']()?_0x163d42['getTime']()===_0x4255c9['getTime']():_0x163d42<_0x52c075&&_0x163d42>=_0x4255c9:_0x163d42<_0x52c075;}return!0x0;});}}class AIChatHistoryController extends _0x23f270{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x4fec01=this['context']['plugins']['get'](AITabs);try{const _0x449776=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x449776}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x9a0cbc,_0x4148bf)=>{this['_setItemLoading'](_0x4148bf['id'],'remove'),this['_handleRemove'](_0x4148bf['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x50e7f0,_0x4deb30)=>{this['_setItemLoading'](_0x4deb30['id'],'rename'),this['_handleEditTitle'](_0x4deb30['id'],_0x4deb30['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2bfba,_0x4ef1f0)=>{void 0x0!==_0x4ef1f0['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4ef1f0['itemId'],_0x4ef1f0['updates']['title']),void 0x0!==_0x4ef1f0['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4ef1f0['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x148335,_0x11f2b9)=>{this['_aiChatController']['_handleRemovedConversation'](_0x11f2b9['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x11f2b9['itemId']),this['_clearItemLoading'](_0x11f2b9['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x4191e7,_0x492d7b)=>{this['_handleHistoryErrorUI'](_0x492d7b['error'],_0x492d7b['operation'],_0x492d7b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5733a8,_0x4be143)=>{this['_handleSelectConversation'](_0x4be143['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x9840c6,_0x4b5a53)=>{const _0x361ef7=_0x4b5a53['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4b5a53['id'],_0x361ef7),this['_handleTogglePin'](_0x4b5a53['id'],_0x4b5a53['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x4fec01['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4fec01['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0xcb7c82){this['_handleHistoryErrorUI'](_0xcb7c82,'init');}}async['_handleEditTitle'](_0x1f6ac2,_0x39a67e){await this['history']['updateItemTitle'](_0x1f6ac2,_0x39a67e);}async['_handleTogglePin'](_0x55a54e,_0x46e6bd){await this['history']['updateItemPinned'](_0x55a54e,_0x46e6bd);}async['_handleRemove'](_0x1925f3){await this['history']['removeItem'](_0x1925f3);}async['_handleSelectConversation'](_0x45b1e4){await this['_aiChatController']['loadConversation'](_0x45b1e4);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x56318d=this['_aiChatController']['activeConversation']?.['id'],_0x2cfd72=this['_getCategorizedItems']()['map'](_0x11e929=>({'title':_0x11e929['title'],'items':_0x11e929['items']['map'](_0xa654f5=>({'id':_0xa654f5['id'],'title':_0xa654f5['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xa654f5['createdAt'])['toLocaleDateString'](),'active':_0xa654f5['id']===_0x56318d,'pinned':_0xa654f5['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2cfd72);}['_setItemLoading'](_0x140b26,_0x20bc68){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x140b26,_0x20bc68,!0x0);}['_clearItemLoading'](_0x58c544){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x58c544,null,!0x1);}['_handleHistoryErrorUI'](_0x529db0,_0x31e88e,_0x2b376e){const _0x22f4de=this['_generateErrorMessage'](_0x31e88e,_0x2b376e);this['_aiChatHistoryUi']['showError'](_0x22f4de),_0x2b376e&&this['_clearItemLoading'](_0x2b376e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x432b03,_0x1c7547){const _0x426a41=_0x1c7547?this['history']['getItem'](_0x1c7547):null,_0x1d5d10=_0x426a41?.['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x432b03){case'updateItemTitle':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1d5d10);case'updateItemPinned':{const _0x3f6700=Hi(this['context']['locale'],_0x426a41?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x3f6700,_0x1d5d10]);}case'removeItem':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1d5d10);case'init':case'loadItems':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0xcaeeb=new Date(),_0x2ab12a=new Date(_0xcaeeb['getFullYear'](),_0xcaeeb['getMonth'](),_0xcaeeb['getDate']()),_0x2c620c=new Date(_0x2ab12a);_0x2c620c['setDate'](_0x2c620c['getDate']()-0x1);const _0x917089=new Date(_0x2ab12a);_0x917089['setDate'](_0x917089['getDate']()-0xe);const _0x42bb1d=this['history']['getItems']({'pinned':!0x0}),_0x4bbb21=this['history']['getItems']({'from':_0x2ab12a,'to':_0x2ab12a}),_0x41a7d3=this['history']['getItems']({'from':_0x2c620c,'to':_0x2c620c}),_0x51f6d6=this['history']['getItems']({'from':_0x917089,'to':_0x2c620c}),_0x59bb7c=this['history']['getItems']({'to':_0x917089}),_0x465533=[];return _0x42bb1d['length']>0x0&&_0x465533['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x42bb1d}),_0x4bbb21['length']>0x0&&_0x465533['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4bbb21}),_0x41a7d3['length']>0x0&&_0x465533['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x41a7d3}),_0x51f6d6['length']>0x0&&_0x465533['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x51f6d6}),_0x59bb7c['length']>0x0&&_0x465533['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x59bb7c}),_0x465533;}}class AIChatHistory extends _0x23f270{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x23f270{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c5533){super(_0x2c5533),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends vt{['id'];constructor(_0x2711fe,_0x15fb10){super(_0x2711fe);const {id:_0xf0e69b,type:_0x45a204,icon:_0x397394}=_0x15fb10;this['id']=_0xf0e69b,this['set']({'label':_0x15fb10['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x15fb10['id']}}),_0x397394?this['icon']=_0x397394:'chat'===_0x45a204?this['icon']=_0x2ea593:'review'===_0x45a204?this['icon']=_0x2e2f4a:'translate'===_0x45a204&&(this['icon']=_0x4d8ff7);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x2622e5,_0x4620dd){super(_0x2622e5);const _0x3e7f89=_0x4620dd['map'](_0x2145d2=>{const _0x25f225=new Pt(this['locale']),_0x3066ae=new AIChatShortcutView(this['locale'],_0x2145d2);return _0x25f225['children']['add'](_0x3066ae),_0x3066ae['delegate']('execute')['to'](this),_0x25f225;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x3e7f89),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const yn='chat-shortcuts';class AIChatShortcuts extends _0x23f270{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x5d3c4c=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x5d3c4c['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x5d3c4c,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x83933b=['chat','review','translate'];this['_shortcuts']['forEach'](_0x4e70f8=>{let _0x5912e9=!0x0;if(_0x4e70f8['id']&&_0x4e70f8['label']&&_0x83933b['includes'](_0x4e70f8['type'])?'chat'===_0x4e70f8['type']&&(_0x5912e9='string'==typeof _0x4e70f8['prompt']):_0x5912e9=!0x1,!_0x5912e9)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4e70f8});});}['_injectShortcuts'](){const _0x246d3c=this['context']['plugins']['get'](AIChatUI);this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x246d3c['addFeedItemCustomElement'](this['_shortcutsView']['element'],yn),this['_shortcutsView']['on']('execute',_0x35c6ee=>{const _0xde0882=_0x35c6ee['source']['id'];this['_executeShortcut'](_0xde0882);});}['_removeShortcuts'](){const _0x4c5741=this['context']['plugins']['get'](AIChatUI);_0x4c5741['hasFeedItem'](yn)&&_0x4c5741['removeFeedItem'](yn),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x574bcd){const _0x1654dc=this['_shortcuts']['find'](_0x1cf48d=>_0x1cf48d['id']===_0x574bcd),_0x4541b9=_0x1654dc['type'];'chat'===_0x4541b9?this['_runChatShortcut'](_0x1654dc):'review'===_0x4541b9?_0x1654dc['commandId']?this['_runReviewShortcut'](_0x1654dc):this['_switchTab']('reviewMode'):'translate'===_0x4541b9&&(_0x1654dc['language']?this['_runTranslateShortcut'](_0x1654dc):this['_switchTab']('translate'));}['_switchTab'](_0xb26941){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xb26941});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xb26941);}async['_runChatShortcut']({prompt:_0x5055fa,draftMode:_0x27bdb7,useWebSearch:_0x549c86=!0x1,useReasoning:_0x6269e6=!0x1,model:_0x87937}){const _0x4a36d2=this['context']['plugins']['get']('AIChatController'),_0x1a6daf=_0x4a36d2['activeConversation'];let _0x2b5edb;_0x2b5edb=_0x87937?await _0x1a6daf['chatModels']['getModel'](_0x87937):await _0x1a6daf['chatModels']['getDefault'](),_0x2b5edb&&await _0x1a6daf['setModel'](_0x2b5edb),_0x1a6daf['setWebSearch'](_0x549c86),_0x1a6daf['setReasoning'](_0x6269e6),_0x4a36d2['addCurrentDocumentToChatContext'](),_0x27bdb7?(this['_aiChatUI']['setPromptInputValue'](_0x5055fa),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x4a36d2['sendMessage']({'message':_0x5055fa});}['_runReviewShortcut']({commandId:_0x5408d1,model:_0x426f31,prompt:_0x46bdaa,params:_0x2be2d0}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x56cc67={'id':_0x5408d1,'isCustom':'custom'===_0x5408d1};_0x426f31&&_0x46bdaa&&(_0x56cc67['args']={'model':_0x426f31,'prompt':_0x46bdaa}),_0x2be2d0&&(_0x56cc67['params']=_0x2be2d0),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x56cc67);}['_runTranslateShortcut']({language:_0x263d7c}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new at('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x263d7c,'args':{'language':_0x263d7c}});}}class ToggleAICommand extends _0x3a665b{constructor(_0x4d13a7){super(_0x4d13a7);const _0x1a5623=_0x4d13a7['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1a5623,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x2537f3=this['editor']['plugins']['get']('AITabs')['view'];_0x2537f3['isVisible']=!_0x2537f3['isVisible'];}}class AIToggleButtonUI extends _0x5686f0{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1f2a54=this['editor'];_0x1f2a54['commands']['add']('toggleAi',new ToggleAICommand(_0x1f2a54)),_0x1f2a54['ui']['componentFactory']['add']('toggleAi',()=>{const _0x4f80c5=this['_createAIUIButton'](vt);return _0x4f80c5['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x4f80c5;}),_0x1f2a54['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x37d726=this['_createAIUIButton'](Wt);return _0x37d726['set']({'role':'menuitemcheckbox'}),_0x37d726;});}['_createAIUIButton'](_0x508b2c){const _0x15b47d=this['editor'],_0x3d0f0e=_0x15b47d['commands']['get']('toggleAi'),_0x5b9c74=new _0x508b2c(_0x15b47d['locale']);return _0x5b9c74['set']({'label':Hi(_0x15b47d['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0xbf82c1,'isToggleable':!0x0}),_0x5b9c74['bind']('isEnabled')['to'](_0x3d0f0e),_0x5b9c74['bind']('isOn')['to'](_0x3d0f0e,'value',_0x1b4cb1=>!!_0x1b4cb1),this['listenTo'](_0x5b9c74,'execute',()=>{_0x3d0f0e['execute']();}),_0x5b9c74;}}const xn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x296f50){super(_0x296f50),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x567bdd){this['showError'](_0x567bdd);}['showError'](_0x24e780){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x24e780,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0xbf0097=new Nt(this['locale']),_0x511b9d=new Nt(this['locale']);return _0x511b9d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0xbf0097['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x540cfd=>!_0x540cfd)]},'children':[_0x511b9d]}),_0xbf0097;}}const Ln=0xa;class AIBalloon extends _0x23f270{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??ds(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x2b133c){const {id:_0x3a7543}=this['_currentConfig']??{};this['_currentConfig']=_0x2b133c;const {id:_0x10d086}=this['_currentConfig'];this['isOpen']&&_0x3a7543===_0x10d086?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x540982=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x540982['isOpen']&&this['_currentConfig']&&_0x540982['id']===this['_currentConfig']['id']&&_0x540982['hide']();}['_updateDialog'](){const _0x3e44af=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x59c888,title:_0x47c6fc}=this['_currentConfig'];_0x3e44af['view']?.['headerView']&&(_0x3e44af['view']['headerView']['label']=_0x47c6fc,_0x3e44af['view']['headerView']['iconView']&&_0x59c888&&(_0x3e44af['view']['headerView']['iconView']['content']=_0x59c888)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x3e44af['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x23b3e6=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x425e23,title:_0x427434,icon:_0x136daa,class:_0x1d715a,mainView:_0x1e2a67}=this['_currentConfig'];_0x1e2a67['delegate'](...xn)['to'](this),_0x23b3e6['show']({'title':_0x427434,'icon':_0x136daa,'hasCloseButton':!0x0,'id':_0x425e23,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x1d715a||''),'content':_0x1e2a67,'onShow':_0x4d59f7=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x4d59f7['view']?.['updatePosition']();const _0x58980f=this['_getSelectionElements']();_0x58980f&&_0x58980f[0x0]&&wt({'target':_0x58980f[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x4d59f7['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x425e23});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x425e23}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xbc5d5f,_0x388e6e){if(!_0x388e6e){const _0x5ece34=this['_getTargetRootDomRect']();if(!_0x5ece34)return null;_0x388e6e=_0x5ece34;}const _0x40b5dc=this['_getSelectionElements']();if(!_0x40b5dc||0x0===_0x40b5dc['length'])return{'left':Math['round'](_0x388e6e['left']+_0x388e6e['width']/0x2-_0xbc5d5f['width']/0x2),'top':Math['round'](_0x388e6e['top']+_0x388e6e['height']/0x2-_0xbc5d5f['height']/0x2)};const _0xe924c2=Math['round'](_0x388e6e['left']+_0x388e6e['width']/0x2-_0xbc5d5f['width']/0x2),_0x510764=_0x40b5dc['map'](_0x465e8f=>new ut(_0x465e8f)),_0xa4b7c=_0xbc5d5f['height'];return{'left':_0xe924c2,'top':this['_calculateOptimalTopPosition'](_0x510764,_0xa4b7c,_0x388e6e)};}['_calculateOptimalTopPosition'](_0x2c2017,_0x6f408,_0x142b93){const _0x3f82f1=new ut(ct['window']),_0x1858cd=_0x2c2017['map'](_0x2c3316=>_0x2c3316['getVisible']())['filter'](_0x10921c=>_0x10921c),_0x1931be=ut['getBoundingRect'](_0x1858cd);if(!_0x1931be)return Math['round'](_0x142b93['top']+_0x142b93['height']/0x2);const _0x239ef6=_0x3f82f1['getIntersection'](_0x1931be);if(!_0x239ef6)return Math['round'](_0x142b93['top']+_0x142b93['height']/0x2);const _0x7c22cc=_0x142b93['getVisible'](),_0x2b9176=_0x7c22cc&&_0x1931be['height']>_0x7c22cc['height'],_0x36d8cd=_0x239ef6['top'],_0x109091=_0x239ef6['bottom'];if(_0x2b9176){const _0x32c288=(_0x7c22cc||_0x3f82f1)['height']/0x2-_0x6f408/0x2,_0x239056=_0x36d8cd-Ln-_0x142b93['top'],_0x2baf86=_0x142b93['bottom']-_0x109091-Ln;return _0x239056>=_0x6f408?Math['max'](Ln,_0x36d8cd-_0x6f408-Ln):_0x2baf86>=_0x6f408?_0x109091+Ln:Math['max'](Ln,_0x32c288);}const _0x1c6e58=_0x36d8cd-_0x6f408,_0x1d64fd=_0x142b93['bottom']-_0x109091-Ln,_0x585332=_0x36d8cd-Ln-_0x142b93['top'];let _0x1722eb;if(_0x1d64fd>=_0x6f408)_0x1722eb=_0x109091+Ln;else{if(_0x585332>=_0x6f408)_0x1722eb=_0x1c6e58-Ln;else _0x1722eb=_0x36d8cd+_0x1931be['height']/0x2-_0x6f408/0x2;}return _0x1722eb;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5b097f=this['_getTargetEditor']();this['listenTo'](_0x5b097f['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5ca8ac,data:{newRange:_0xacae63}}of _0x5b097f['model']['document']['differ']['getChangedMarkers']())if(_0x5ca8ac['startsWith'](As+':')&&(_0xacae63&&(_0xacae63['start']['isEqual'](_0xacae63['end'])||'$graveyard'==_0xacae63['root']['rootName'])||null==_0xacae63)){const _0xe4153=Hi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xe4153),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x3bcfbd=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3bcfbd['model']['document']);}['_getSelectionElements'](){const _0x148cf8=this['_getTargetEditor']();return _0x3b0cbb(_0x148cf8['editing'],[..._0x148cf8['model']['markers']['getMarkersGroup']('ai-selection'),..._0x148cf8['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x332f6b=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x332f6b)return null;const _0x9dc8f8=this['_getTargetEditor'](),_0x29e5d4=_0x9dc8f8['editing']['view']['document']['getRoot'](_0x332f6b['rootName']);if(!_0x29e5d4)return null;const _0xce1652=_0x9dc8f8['editing']['view']['domConverter']['mapViewToDom'](_0x29e5d4);return _0xce1652&&_0xce1652 instanceof HTMLElement?new ut(_0xce1652):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x1b7d93,_0x2a69e7={}){super(_0x1b7d93),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2a69e7};const _0x11f434=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x11f434?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}['toggleShowChangesEnabled'](_0x3f314e){this['showChangesButton']['isEnabled']=_0x3f314e;}['_setupRatingButtons'](){this['likeButton']=new vt(this['locale']),this['likeButton']['set']({'icon':_0x25b316,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Bi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new vt(this['locale']),this['dislikeButton']['set']({'icon':_0x42e1bc,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Bi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new vt(this['locale']),this['copyButton']['set']({'icon':_0x16addf,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Bi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x4a6945=new xt();_0x4a6945['set']({'content':_0x4ab520}),_0x4a6945['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+Bi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Bi;},0x7d0);}),this['copyButton']['children']['add'](_0x4a6945);}['_setupShowChangesButton'](){this['showChangesButton']=new vt(this['locale']),this['showChangesButton']['set']({'icon':_0x3c0485,'label':Hi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Bi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0xcdf3ab=>_0xcdf3ab?_0x135466:_0x3c0485),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x5d8fca,_0x41ae1e){super(_0x5d8fca);const _0x54f688=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x41ae1e,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x5d8fca),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x5d8fca,_0x41ae1e['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x41ae1e),this['_stateView']=new AISuggestionContentPartStateView(_0x5d8fca),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x5d8fca,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x5d8fca,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x14a45b,_0x2c5c11,_0x58c87e,_0x2ff0fa)=>{let _0x448002,_0x4ff88b;'pending'===_0x2ff0fa?(_0x448002=this['_partToolbarView'],_0x4ff88b=this['_stateView']):(_0x448002=this['_stateView'],_0x4ff88b=this['_partToolbarView']),this['_stateView']['setState'](_0x58c87e),_0x448002['isVisible']=!0x1,_0x4ff88b['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x54f688['to']('_state',_0x1e2c10=>'ck-ai-chat-balloon-main_state_'+_0x1e2c10)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x41ae1e);});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_partToolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_partToolbarView'],this['_miniToolbarView']]);}['destroy'](){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}['focusLast'](){this['focusCycler']['focusLast']();}async['updateContent'](_0xcf4188){_0xcf4188?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0xcf4188);}['setState'](_0xe7da){this['_state']=_0xe7da;}['showError'](_0x48601c){super['showError'](_0x48601c),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5bf953){super['showBlockingError'](_0x5bf953),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x1f4baa){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x1f4baa;}['togglePartToolbarEnabled'](_0x1eb07b){this['_partToolbarView']['isEnabled']=_0x1eb07b;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x396920,showSuggestButton:_0x30d010}){_0x396920=_0x396920&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x30d010=_0x30d010&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x396920,'showSuggestButton':_0x30d010});}['_createNextButtonView'](){const _0x382a71=new vt(this['locale']);return _0x382a71['set']({'icon':_0x25b93f,'label':Hi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x382a71['on']('execute',()=>{this['fire']('showNext');}),_0x382a71;}['_createPreviousButtonView'](){const _0x5f5d29=new vt(this['locale']);return _0x5f5d29['set']({'icon':_0x19d9ab,'label':Hi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x5f5d29['on']('execute',()=>{this['fire']('showPrevious');}),_0x5f5d29;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x3a5291,_0xc310f6){super(_0x3a5291),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0xc310f6});}}class AIChatBalloon extends _0x5686f0{static get['requires'](){return[Bt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x359371){super(_0x359371),this['set']('showDiff',!0x1);}['open'](_0x4428a8){const _0x13bcd6=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x13bcd6['plugins']['get']('AIBalloon')['open']({..._0x4428a8,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x4428a8['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x4428a8['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x886269){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x886269);}['setState'](_0x595c01){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x595c01);}['_createChatBalloonView'](){const _0x4eba95=this['editor'],_0x16ee36=_0x4eba95['plugins']['get']('AIBalloon'),_0xc6dd5=_0x4eba95['commands']['get']('trackChanges');let _0x3e2c34=_0x4eba95['config']['get']('ai.availableReplyActions')||[...bs];_0x4eba95['plugins']['has']('TrackChanges')||(_0x3e2c34=_0x3e2c34['filter'](_0x1ade39=>'insertSuggestion'!=_0x1ade39));const _0x531fc0=new AIChatBalloonView(_0x4eba95['locale'],{'availableActions':_0x3e2c34,'showApplyButton':!0x0,'showSuggestButton':!!_0xc6dd5});return _0x531fc0['bind']('showDiff')['to'](this),_0x531fc0['delegate'](...Cs)['to'](this),_0x531fc0['delegate']('showPrevious','showNext')['to'](this),_0x16ee36['delegate']('dialogClosed')['to'](this),_0x531fc0['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x531fc0['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x531fc0['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0xc6dd5&&_0x531fc0['bind']('isTrackChangesOn')['to'](_0xc6dd5,'value'),_0x531fc0['render'](),_0x531fc0;}['_toggleRotatorButtonsInDialogHeader'](_0x54011d){const _0x2400cf=this['editor'],_0x2c53db=_0x2400cf['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x54011d),_0x2c53db['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2c53db['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2400cf['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2c53db['remove'](this['_chatBalloonView']['previousButtonView']),_0x2c53db['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x5686f0{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x53f39c];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Dn(_0x5740b3){const {editor:_0x30f874,action:_0x528cdb,withText:_0x44b376=!0x1,withIcon:_0x342346=!0x0,isInDropdown:_0x5dae9d=!0x0,shouldPreventFocus:_0x2eecc6=!0x1}=_0x5740b3;return()=>{const _0x3370e7=_0x30f874['locale'],_0x1c254e=new vt(_0x3370e7),_0x4a35ed=_0x1c254e['bindTemplate'];_0x5dae9d&&_0x1c254e['extendTemplate']({'on':{'mouseenter':_0x4a35ed['to'](()=>{_0x2eecc6&&_0x2eecc6()||_0x1c254e['focus']();})}});const _0x14d377=_0x528cdb['icon']??_0x528cdb['parent']?.['icon'];return _0x1c254e['set']({'label':_0x528cdb['label'],'withText':_0x44b376,'role':'menuitem','icon':_0x342346?_0x14d377??_0x15178f:void 0x0,'tooltip':!_0x44b376,'class':'ck-ai-quick-actions-button','isEnabled':_0x528cdb['isEnabled']}),_0x1c254e['on']('execute',()=>{_0x30f874['editing']['view']['focus'](),_0x30f874['commands']['execute']('aiQuickAction',_0x528cdb);}),_0x1c254e;};}class DropdownMenuButtonWithHighlightView extends _0x1a80af{['arrowView'];constructor(_0x44ac96,_0x1d10b8){super(_0x44ac96,_0x1d10b8);const _0x2a79cc=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x21df78=>String(_0x21df78)),'data-cke-tooltip-disabled':_0x2a79cc['to']('isOn')},'on':{'mouseenter':_0x2a79cc['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x493fc9=new xt();return _0x493fc9['content']=_0x4e78fd,_0x493fc9['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x493fc9;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x307844,_0x3d461b,_0x575ab5){super(_0x307844),this['_allListItems']=_0x3d461b,this['_allSearchableItems']=_0x575ab5;}['filter'](_0x4323e1){if(!_0x4323e1)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x47a32e=_0x4323e1['source']['toLowerCase']()['trim'](),_0x5edc3e=this['_allSearchableItems']['filter'](_0x466400=>(_0x466400['groupLabel']?_0x466400['label']+'\x20('+_0x466400['groupLabel']+')':_0x466400['label'])['toLowerCase']()['includes'](_0x47a32e));return this['items']['clear'](),this['items']['addMany'](_0x5edc3e['sort']((_0xfd0f7,_0x4ba55e)=>{const _0x192982=_0xfd0f7['groupLabel'],_0x511a20=_0x4ba55e['groupLabel'];return _0x192982||_0x511a20?_0x192982?0x1:-0x1:0x0;})['map'](_0x12acc6=>_0x12acc6['item'])),this['_highlightQuery'](_0x47a32e,_0x5edc3e),{'resultsCount':_0x5edc3e['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x50f829,_0x15cf78){if(!_0x50f829)return;const _0x1d0583=new RegExp(_0x118ed5(_0x50f829),'gi');_0x15cf78['forEach'](_0x520732=>{_0x520732['highlightViews']&&_0x520732['highlightViews']['forEach'](_0x48a4ac=>{'function'==typeof _0x48a4ac['highlightText']&&_0x48a4ac['highlightText'](_0x1d0583);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x30c63f=>{_0x30c63f['highlightViews']&&_0x30c63f['highlightViews']['forEach'](_0x718807=>{'function'==typeof _0x718807['highlightText']&&_0x718807['highlightText'](null);});});}}const Vn='menu',Pn='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0xe34866,_0x1e7b69,_0x30c6d7,_0x2e1121,_0x191738=!0x1){const _0x519fc6=_0xe34866['locale'];super(_0x519fc6),this['_bodyCollection']=_0x2e1121,this['_hasSearch']=_0x191738;const _0x40a10=this['_createListItems'](_0xe34866,_0x1e7b69,_0x30c6d7);this['optionsListView']=new AIQuickActionsFilteredListView(_0x519fc6,_0x40a10,this['_allSearchableItems']),this['optionsListView']['role']=Vn,this['optionsListView']['items']['addMany'](_0x40a10),this['focusTracker']=new _t(),this['keystrokes']=new It(),_0x191738&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x40a10,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x191738&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x33d883=_0x191738&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x184ac3(_0x33d883),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x519fc6['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1be4c1(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3967ca=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3967ca);}['_createListItems'](_0x18d7ca,_0x80db2e,_0xd2604a){const _0x78a576=new _0x184ac3();return _0x80db2e['forEach'](_0x1b5ca2=>{if('actions'in _0x1b5ca2){const {listItem:_0x5018e7}=this['_createActionGroupButton'](_0x18d7ca,_0x1b5ca2,_0xd2604a);_0x78a576['add'](_0x5018e7),_0x1b5ca2['actions']['forEach'](_0x34b3e0=>{this['_createActionButton'](_0x18d7ca,_0x34b3e0,_0x1b5ca2['label'],_0x1b5ca2['icon']);const {listItem:_0x56b90c,highlightViews:_0x229503}=this['_createSearchResultActionButton'](_0x18d7ca,_0x34b3e0,_0x1b5ca2['label'],_0x1b5ca2['icon']);this['_allSearchableItems']['push']({'item':_0x56b90c,'label':_0x34b3e0['label'],'groupLabel':_0x1b5ca2['label'],'highlightViews':_0x229503});});}else{const {listItem:_0x1bfaa6}=this['_createActionButton'](_0x18d7ca,_0x1b5ca2);_0x78a576['add'](_0x1bfaa6);const _0x173792=_0x1bfaa6['children']['first'];if(_0x173792){const {listItem:_0x303359,highlightViews:_0x4cacfe}=this['_createSearchResultActionButton'](_0x18d7ca,_0x1b5ca2);this['_allSearchableItems']['push']({'item':_0x303359,'label':_0x173792['label']||'','highlightViews':_0x4cacfe});}}}),_0x78a576;}['_createActionButton'](_0x58bbd1,_0x42e8d2,_0x1f4c60,_0x5089be){const _0x167e88=new Pt(this['locale']);if(_0x1f4c60&&_0x5089be){const _0x3a4234=new vt(this['locale']),_0x4562fe=_0x3a4234['bindTemplate'],_0x2e955b=new _0x2cc319();_0x2e955b['text']=_0x42e8d2['label'];const _0x2f6be8=new _0x2cc319();_0x2f6be8['text']=_0x1f4c60;const _0x2e7b1e=new xt();_0x2e7b1e['content']=_0x5089be,_0x2e7b1e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x32cef2=new Nt(this['locale']);_0x32cef2['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x14a07c=new Nt(this['locale']);return _0x14a07c['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3a4234['set']({'label':_0x42e8d2['label']+'\x20('+_0x1f4c60+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3a4234['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x2e955b,_0x32cef2,_0x2e7b1e,_0x2f6be8,_0x14a07c],'on':{'mouseenter':_0x4562fe['to'](()=>{this['_isSearchFocused']()||_0x3a4234['focus']();}),'click':_0x4562fe['to'](()=>{_0x3a4234['fire']('execute');})}}),_0x3a4234['on']('execute',()=>{_0x58bbd1['editing']['view']['focus'](),_0x58bbd1['commands']['execute']('aiQuickAction',_0x42e8d2);}),_0x167e88['children']['add'](_0x3a4234),{'listItem':_0x167e88,'highlightViews':[_0x2e955b,_0x2f6be8]};}{const _0x520aa0=new _0x41ed25(),_0x392424=new vt(this['locale'],_0x520aa0),_0x1b2491=_0x392424['bindTemplate'],_0x17a501=_0x42e8d2['icon']??_0x42e8d2['parent']?.['icon'],_0x47bf85=void 0x0!==_0x42e8d2['icon'];return _0x392424['set']({'label':_0x42e8d2['label'],'withText':!0x0,'role':'menuitem','icon':_0x47bf85?_0x17a501??_0x15178f:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x392424['extendTemplate']({'on':{'mouseenter':_0x1b2491['to'](()=>{this['_isSearchFocused']()||_0x392424['focus']();})}}),_0x392424['on']('execute',()=>{_0x58bbd1['editing']['view']['focus'](),_0x58bbd1['commands']['execute']('aiQuickAction',_0x42e8d2);}),_0x167e88['children']['add'](_0x392424),{'listItem':_0x167e88,'highlightViews':[_0x520aa0]};}}['_createSearchResultActionButton'](_0x28a962,_0x17345a,_0x261af5,_0x4c2754){return _0x261af5&&_0x4c2754?this['_createSearchResultGroupedActionButton'](_0x28a962,_0x17345a,_0x261af5,_0x4c2754):this['_createSearchResultIndividualActionButton'](_0x28a962,_0x17345a);}['_createSearchResultGroupedActionButton'](_0xdc7895,_0x45986f,_0x164249,_0x3fdb1d){const _0x216ec8=new Pt(this['locale']),_0x10fd92=new vt(this['locale']),_0x1bcf97=_0x10fd92['bindTemplate'],{view:_0x384190,highlightView:_0x3f3c7f}=this['_createSearchResultGroupRow'](_0x164249,_0x3fdb1d),{view:_0x765f27,highlightView:_0x5f06e7}=this['_createSearchResultActionRow'](_0x45986f['label']),_0x178c6c=this['_createSearchResultContentView'](_0x384190,_0x765f27);return _0x10fd92['set']({'label':_0x45986f['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1}),_0x10fd92['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x178c6c],'on':{'mouseenter':_0x1bcf97['to'](()=>{this['_isSearchFocused']()||_0x10fd92['focus']();}),'click':_0x1bcf97['to'](()=>{this['_handleSearchResultButtonClick'](_0x10fd92);})}}),this['_setupActionButtonExecution'](_0x10fd92,_0xdc7895,_0x45986f),_0x216ec8['children']['add'](_0x10fd92),{'listItem':_0x216ec8,'highlightViews':[_0x3f3c7f,_0x5f06e7]};}['_createSearchResultIndividualActionButton'](_0x8267fc,_0x273684){const _0x4bd528=new Pt(this['locale']),_0x5f38ee=new _0x41ed25(),_0x3c3393=new vt(this['locale'],_0x5f38ee),_0x41fc99=_0x3c3393['bindTemplate'];return _0x3c3393['set']({'label':_0x273684['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x3c3393['extendTemplate']({'on':{'mouseenter':_0x41fc99['to'](()=>{this['_isSearchFocused']()||_0x3c3393['focus']();})}}),this['_setupActionButtonExecution'](_0x3c3393,_0x8267fc,_0x273684),_0x4bd528['children']['add'](_0x3c3393),{'listItem':_0x4bd528,'highlightViews':[_0x5f38ee]};}['_createSearchResultGroupRow'](_0xbcb694,_0x23c909){const _0x2bff3a=new Nt(this['locale']),_0x5701a2=new xt();_0x5701a2['content']=_0x23c909,_0x5701a2['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3445ca=new _0x2cc319();return _0x3445ca['text']=_0xbcb694,_0x2bff3a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5701a2,_0x3445ca]}),{'view':_0x2bff3a,'highlightView':_0x3445ca};}['_createSearchResultActionRow'](_0x5a2a36){const _0x23d42f=new Nt(this['locale']),_0x3be05d=new _0x2cc319();return _0x3be05d['text']=_0x5a2a36,_0x23d42f['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3be05d]}),{'view':_0x23d42f,'highlightView':_0x3be05d};}['_createSearchResultContentView'](_0x3f8b9b,_0x1d9971){const _0x463cac=new Nt(this['locale']);return _0x463cac['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3f8b9b,_0x1d9971]}),_0x463cac;}['_setupActionButtonExecution'](_0x1ff7db,_0x589f1b,_0x570b3b){_0x1ff7db['on']('execute',()=>{_0x589f1b['editing']['view']['focus'](),_0x589f1b['commands']['execute']('aiQuickAction',_0x570b3b);});}['_createActionGroupButton'](_0x9c83ec,_0x463129,_0x5435c1){const _0x19345f=new Pt(this['locale']),_0x2dcf3b=new _0x41ed25(),_0x2c001e=new DropdownMenuButtonWithHighlightView(this['locale'],_0x2dcf3b),_0x3af358=_0x2c001e['bindTemplate'],_0x5d57a9=this['_getPanelKeystroke'](_0x5435c1),_0x31680b=this['_createGroupActionsList'](_0x9c83ec,_0x463129['actions'],_0x5435c1);_0x2c001e['set']({'label':_0x463129['label'],'withText':!0x0,'role':Pn,'icon':_0x463129['icon']??_0x15178f,'isEnabled':_0x463129['actions']['some'](_0x446916=>_0x446916['isEnabled'])}),_0x2c001e['extendTemplate']({'on':{'mouseenter':_0x3af358['to'](()=>{this['_isSearchFocused']()||_0x2c001e['focus']();})}});const _0x195084=new Xt(this['locale']);return _0x195084['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x3af358['to'](_0x2f9350=>{this['_handlePanelKeydown'](_0x2f9350,_0x5d57a9,_0x2c001e,_0x195084);})}}),_0x2c001e['bind']('isOn')['to'](_0x195084,'isVisible'),this['_bodyCollection']['add'](_0x195084),_0x195084['content']['add'](_0x31680b),this['_setupGroupMenuBehavior'](_0x2c001e,_0x195084),_0x19345f['children']['add'](_0x2c001e),{'listItem':_0x19345f,'highlightView':_0x2dcf3b};}['_createGroupActionsList'](_0x4ce50c,_0x58e611,_0x5d1d13){const _0xeee480=new Dt(this['locale']);return _0xeee480['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x58e611['forEach'](_0x1b11a0=>{const _0x128ce4=new Pt(this['locale']),_0x15c177=Dn({'editor':_0x4ce50c,'action':_0x1b11a0,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x128ce4['children']['add'](_0x15c177),_0x5d1d13['focusTracker']['add'](_0x15c177),_0xeee480['items']['add'](_0x128ce4);}),_0xeee480;}['_setupGroupMenuBehavior'](_0x2f8d83,_0x2ad09d){const _0x34c50d=_0x2f8d83['bindTemplate'],_0x43bca3=this['_getButtonKeystroke'](_0x2f8d83);_0x2f8d83['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x34c50d['to'](()=>{this['_showNestedPanel'](_0x2ad09d,_0x2f8d83);}),'mouseleave':_0x34c50d['to'](_0x40e17c=>{const _0x2c38d7=_0x40e17c['relatedTarget'];this['_isMovingToNestedMenu'](_0x2c38d7,_0x2ad09d)||this['_hideNestedPanel'](_0x2ad09d);}),'keydown':_0x34c50d['to'](_0x40b213=>{_0x40b213['key']==_0x43bca3&&(this['_showNestedPanel'](_0x2ad09d,_0x2f8d83),_0x2ad09d['content']['get'](0x0)['focus']());})}}),_0x2ad09d['on']('render',()=>{_0x2ad09d['element']?.['addEventListener']('mouseleave',_0x4a3fa5=>{const _0x54e563=_0x4a3fa5['relatedTarget'];_0x2f8d83['element']?.['contains'](_0x54e563)||this['_isMovingToNestedMenu'](_0x54e563,_0x2ad09d)||this['_hideNestedPanel'](_0x2ad09d);});});}['_showNestedPanel'](_0x21ce17,_0x53b444){this['_openNestedPanels']['forEach'](_0x5508d1=>{_0x5508d1!==_0x21ce17&&_0x5508d1['isVisible']&&_0x5508d1['hide']();}),_0x21ce17['show'](),_0x21ce17['pin']({'positions':[_0x16a65a['eastSouth']],'target':_0x53b444['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x21ce17);}['_hideNestedPanel'](_0x3e0619){_0x3e0619['hide'](),this['_openNestedPanels']['delete'](_0x3e0619);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0xef818e=>_0xef818e['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x237360,_0x24ac57){if(!_0x237360)return!0x1;if(_0x24ac57['element']?.['contains'](_0x237360))return!0x0;const _0x3b49b1=_0x237360;return _0x3b49b1['closest']&&(null!==_0x3b49b1['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3b49b1['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3b49b1['closest']('.ck-ai-quick-actions-group-button'));}['resetSearch'](){this['_searchTextView']&&this['_searchTextView']['reset']();}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}['_getPanelKeystroke'](_0x7b1c19){return'rtl'===_0x7b1c19['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x2f8450){return'rtl'===_0x2f8450['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x56e64f,_0x3904b5,_0x10e987,_0x1227f8){_0x56e64f['key']==_0x3904b5&&(_0x10e987['focus'](),this['_hideNestedPanel'](_0x1227f8));}['_handleSearchResultButtonClick'](_0x2b7639){_0x2b7639['fire']('execute');}}function Hn(_0x4feb05){const {editor:_0x70d6f9,content:_0x9bc839,buttonDefinition:_0x43b155,bodyCollection:_0x4f6ade,hasSearch:_0x6db618=!0x1}=_0x4feb05;return()=>{const _0x2a4fad=_0x70d6f9['locale'],_0x42763c=_0x70d6f9['commands']['get']('aiQuickAction'),_0x3b78fc=Gt(_0x2a4fad);_0x3b78fc['bind']('isEnabled')['to'](_0x42763c),_0x3b78fc['buttonView']['set']({'icon':_0x43b155['icon']??_0x15178f,'label':_0x43b155['label'],'tooltip':!0x0}),_0x3b78fc['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x41199c=new AIQuickActionsDropdownContentView(_0x70d6f9,_0x9bc839,_0x3b78fc,_0x4f6ade,_0x6db618);return _0x3b78fc['panelView']['children']['add'](_0x41199c),_0x6db618&&_0x3b78fc['on']('change:isOpen',(_0x1db5a6,_0x221523,_0x34ccac)=>{if(_0x34ccac){if(_0x70d6f9['plugins']['has']('AIEditing')){const _0x53d3ce=_0x70d6f9['plugins']['get'](AIEditing),_0x3398a6=_0x70d6f9['model']['document']['selection'],_0x45fa35=Array['from'](_0x3398a6['getRanges']());_0x45fa35['length']>0x0&&_0x53d3ce['showFakeVisualSelection']({'ranges':_0x45fa35,'id':'quick-action','priority':0x14});}}else _0x70d6f9['plugins']['has']('AIEditing')&&_0x70d6f9['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x41199c['resetSearch']();}),_0x3b78fc;};}const Mn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Un='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Bn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Gn=/* #__PURE__ -- @preserve */
|
|
28
|
-
((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0x5686f0{static get['requires'](){return[_0x1397b8,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x57c520=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x57c520),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x262bed){return function(_0x4c0222){const _0x112528=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4c0222['uiLanguage']),_0x56c781=_0x112528||'English',_0x23e73f=[{'id':'ask-ai','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x4ea6bb},{'id':'chat-commands','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x4ea6bb,'actions':[{'id':'explain','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Hi(_0x4c0222,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Mn['replace']('%0',_0x56c781),'type':'chat'},{'id':'summarize','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Hi(_0x4c0222,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Un['replace']('%0',_0x56c781),'type':'chat'},{'id':'highlight-key-points','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Hi(_0x4c0222,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bn['replace']('%0',_0x56c781),'type':'chat'}]},{'id':'improve-writing','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x3da124},{'id':'continue','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x382928},{'id':'fix-grammar','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x2920e7},{'id':'adjust-length','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x10b01a,'actions':[{'id':'make-shorter','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x1aa706,'actions':[{'id':'make-tone-casual','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x4d8ff7,'actions':[{'id':'translate-to-english','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Hi(_0x4c0222,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x47860a,'actions':[]}];return _0x23e73f;}(_0x262bed);}async['_getDefaultAndCustomActions'](){const _0x22802c=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x30ed0a=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x36c501,_0x549fd8=[];try{const _0x2b8c2e=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x549fd8=await _0x2b8c2e['getAll'](),_0x36c501=(await _0x2b8c2e['getDefault']())?.['id'];}catch(_0xb44da0){const _0x536518=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xb44da0});Ct(_0x536518['message']);}finally{const _0x415f8b=_0x30ed0a['map'](_0x593df9=>({..._0x593df9,'type':'chat'===_0x593df9['type']?'chat':'action','model':'chat'!==_0x593df9['type']?_0x593df9['model']||_0x36c501:_0x593df9['model'],'icon':void 0x0}));_0x22802c['find'](_0x39297b=>'other'===_0x39297b['id'])['actions']['push'](..._0x415f8b),_0x22802c['forEach'](_0x9ee46c=>{if('actions'in _0x9ee46c)_0x9ee46c['actions']['forEach'](_0x168339=>{if(_0x168339['isEnabled']=!!_0x549fd8['find'](_0x478435=>_0x478435['id']===_0x168339['model'])||void 0x0===_0x168339['model'],!_0x168339['isEnabled']){const _0x3e6fa3=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x168339['id'],'modelId':_0x168339['model']});Ct(_0x3e6fa3['message']);}});else{if(_0x9ee46c['isEnabled']=!!_0x549fd8['find'](_0x31c0ae=>_0x31c0ae['id']===_0x9ee46c['model'])||void 0x0===_0x9ee46c['model'],!_0x9ee46c['isEnabled']){const _0x23c8cb=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x9ee46c['id'],'modelId':_0x9ee46c['model']});Ct(_0x23c8cb['message']);}}});}return _0x22802c;}['_initializeQuickActionsComponentsAndCommands'](){const _0x46d16a=new Qt(this['editor']['locale']);_0x46d16a['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x46d16a),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x46d16a);}['_initializeQuickActionsDropdown'](_0x4a283c){const _0x1e8ee6=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Hn({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x15178f,'label':Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x4a283c,'hasSearch':_0x1e8ee6}));}['_prepareQuickActionsDefinition'](_0x5ab370){this['_quickActionsDefinition']=_0x5ab370['map'](_0x45a965=>{if('actions'in _0x45a965){const _0x486e6f=_0x45a965;return{..._0x486e6f,'actions':_0x486e6f['actions']['map'](_0x1083b0=>{const {actions:_0x464160,..._0x1144d4}=_0x486e6f;return{..._0x1083b0,'parent':_0x1144d4};})['filter'](_0x250202=>this['_shouldIncludeAction'](_0x250202))};}return _0x45a965;})['filter'](_0x588df8=>'actions'in _0x588df8?_0x588df8['actions']['length']>0x0:this['_shouldIncludeAction'](_0x588df8));}['_shouldIncludeAction'](_0x273eb1){const _0x442d4d=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Gn[_0x273eb1['type']])&&!_0x442d4d['includes'](_0x273eb1['id'])&&!('chat'===_0x273eb1['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x13cdfc){this['_quickActionsDefinition']['forEach'](_0x5d3514=>{if('actions'in _0x5d3514){const _0xdd2cc4=Hn({'editor':this['editor'],'content':_0x5d3514['actions'],'buttonDefinition':_0x5d3514,'bodyCollection':_0x13cdfc});this['editor']['ui']['componentFactory']['add'](_0x5d3514['id'],_0xdd2cc4),_0x5d3514['actions']['forEach'](_0x50b04f=>{const _0x35f205=Dn({'editor':this['editor'],'action':_0x50b04f});this['editor']['ui']['componentFactory']['add'](_0x50b04f['id'],_0x35f205);});}else{const _0x25d970=Dn({'editor':this['editor'],'action':_0x5d3514,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5d3514['id'],_0x25d970);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5c3939=>{const _0xb3a897=this['editor']['commands']['get']('aiQuickAction'),_0x142d68=new Kt(_0x5c3939),_0x28991f=Hi(_0x5c3939,'AI_QUICK_ACTIONS_HEADING');_0x142d68['buttonView']['set']({'label':_0x28991f,'icon':_0x15178f});const _0x27b855=new $t(_0x5c3939);return _0x27b855['set']({'ariaLabel':_0x28991f,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x42b42a=>{if('actions'in _0x42b42a){const _0x220b39=_0x42b42a,_0x4da48e=new qt(_0x5c3939,_0x142d68),_0x55d867=new Kt(_0x5c3939),_0x47ebea=new $t(_0x5c3939);_0x55d867['buttonView']['set']({'label':_0x220b39['label'],'icon':_0x220b39['icon']}),_0x220b39['actions']['forEach'](_0x4be1ed=>{const _0x3b3dee=new qt(_0x5c3939,_0x55d867),_0x6adb2=new Wt(_0x5c3939);_0x6adb2['set']({'label':_0x4be1ed['label'],'icon':_0x4be1ed['icon'],'role':'menuitem','isEnabled':_0x4be1ed['isEnabled']}),_0x6adb2['on']('execute',()=>{this['_executeQuickAction'](_0x4be1ed);}),_0x6adb2['delegate']('execute')['to'](_0x55d867),_0x3b3dee['children']['add'](_0x6adb2),_0x47ebea['items']['add'](_0x3b3dee);}),_0x55d867['panelView']['children']['add'](_0x47ebea),_0x4da48e['children']['add'](_0x55d867),_0x27b855['items']['add'](_0x4da48e);}else{const _0x3435a3=_0x42b42a,_0x1bec63=new qt(_0x5c3939,_0x142d68),_0xb50041=new Wt(_0x5c3939);_0xb50041['set']({'label':_0x3435a3['label'],'icon':_0x3435a3['icon'],'role':'menuitem','isEnabled':_0x3435a3['isEnabled']}),_0xb50041['on']('execute',()=>{this['_executeQuickAction'](_0x3435a3);}),_0xb50041['delegate']('execute')['to'](_0x142d68),_0x1bec63['children']['add'](_0xb50041),_0x27b855['items']['add'](_0x1bec63);}}),(Object['values'](Gn)['some'](_0x57a7f2=>this['editor']['plugins']['has'](_0x57a7f2))?_0x142d68['bind']('isEnabled')['to'](_0xb3a897):_0x142d68['set']({'isEnabled':!0x1}),_0x142d68['panelView']['children']['add'](_0x27b855),_0x142d68);});}['_executeQuickAction'](_0x326a83){const _0x1009be=this['editor'];_0x1009be['editing']['view']['focus'](),_0x1009be['commands']['execute']('aiQuickAction',_0x326a83);const _0x9a0ea9=_0x1009be['ui']['view']['menuBarView'];_0x9a0ea9&&_0x9a0ea9['close']&&_0x9a0ea9['close']();}}class AIQuickActionsCommand extends _0x3a665b{['execute'](_0x34ea70){switch(this['_expandSelectionIfCollapsed'](),_0x34ea70['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x5c2611=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5c2611});}this['_handleAIChatAction'](_0x34ea70);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0xe070b4=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xe070b4});}this['_handleAIActionsAction'](_0x34ea70);}}async['_handleAIChatAction'](_0x52fda5){const _0x21d8ab=this['editor']['plugins']['get']('AIChatController'),_0x202cfd=this['editor']['plugins']['get']('AITabs')['view'];if(_0x202cfd['isVisible']||(_0x202cfd['isVisible']=!0x0),'chat'!==_0x202cfd['activeTab']&&_0x202cfd['activateTab']('chat'),'ask-ai'===_0x52fda5['id'])_0x21d8ab['removeSelectionFromChatContext'](),_0x21d8ab['addSelectionToChatContext'](),_0x21d8ab['focusPromptInput']();else await _0x21d8ab['startConversation']({'modelId':_0x52fda5['model']}),_0x21d8ab['removeSelectionFromChatContext'](),_0x21d8ab['addSelectionToChatContext'](),_0x21d8ab['focusPromptInput'](),await _0x21d8ab['sendMessage']({'message':_0x52fda5['prompt']||_0x52fda5['displayedPrompt']||_0x52fda5['label'],'attributes':{'quickActionData':{'id':_0x52fda5['id']},'displayedPrompt':_0x52fda5['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x29c2a9=this['editor'],_0x133dba=_0x29c2a9['model']['document']['selection'];if(!_0x133dba['isCollapsed'])return;const _0xf9c67a=At(_0x133dba['getSelectedBlocks']())||_0x29c2a9['model']['schema']['getLimitElement'](_0x133dba);_0x29c2a9['model']['change'](_0xb61017=>{_0xb61017['setSelection'](_0xf9c67a,'in');});}['_handleAIActionsActionLabel'](_0x28d9f3){return _0x28d9f3['parent']?.['label']&&'other'!==_0x28d9f3['parent']?.['id']?_0x28d9f3['parent']['label']+':\x20'+_0x28d9f3['label']:_0x28d9f3['label'];}async['_handleAIActionsAction'](_0x3c4381){const _0x371034=this['editor']['plugins']['get']('AIActions'),_0x47ae19=_0x3c4381['prompt']?{'userMessage':_0x3c4381['prompt'],'model':_0x3c4381['model']}:{'actionName':_0x3c4381['actionName']||_0x3c4381['id'],'args':_0x3c4381['args']},_0x3e4a50=this['_handleAIActionsActionLabel'](_0x3c4381);await _0x371034['executeAction'](_0x47ae19,_0x3e4a50,_0x3c4381['icon']);}}class AIQuickActionsEditing extends _0x5686f0{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3b3469=this['editor'],_0xec171a=new AIQuickActionsCommand(this['editor']);if(_0x3b3469['commands']['add']('aiQuickAction',_0xec171a),_0x3b3469['plugins']['has']('AIChat')){const _0x547d2c=this['editor']['plugins']['get']('AIChatController');_0x3b3469['model']['document']['selection']['on']('change:range',(_0x51f44f,_0x4e26eb)=>{_0x4e26eb['directChange']&&_0x547d2c['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4cfe1d=this['documentContextContent']['children']['map'](_0x129576=>({'node':_0x129576,'id':$i(_0x129576,'data-id')})),_0x198c7b=this['parsedMergedContent']['children']['map'](_0x45521d=>({'node':_0x45521d,'id':$i(_0x45521d,'data-id')||ot()})),_0x392da4=_0x3e20ff(_0x4cfe1d,_0x198c7b,{'comparator':(_0x13528a,_0x4db7c8)=>_0x13528a['id']==_0x4db7c8['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x392da4['length']&&_0x392da4[_0x392da4['length']-0x1]['removed'];)_0x392da4['pop']();}const _0x2623df=_0x392da4['map'](_0x1b57c4=>{const _0x4c4a59=_0x1b57c4['added']?'new':_0x1b57c4['removed']?'removed':'modified';return{'node':_0x1b57c4['value'][0x0]['node'],'type':_0x4c4a59,'id':_0x1b57c4['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2623df,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x3a609f,_0x55f00d){return _0x55f00d;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x5abbd7){super(_0x5abbd7),this['content']=_0x5abbd7['content'],this['version']=_0x5abbd7['version'],this['actionName']=_0x5abbd7['actionName'],this['args']=_0x5abbd7['args'],this['userMessage']=_0x5abbd7['userMessage'],this['model']=_0x5abbd7['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x289a67){const _0x2e1e14=new AIActionsReply({'locale':this['locale'],'documentContextContent':this['content'],..._0x289a67});return this['replies']['push'](_0x2e1e14),_0x2e1e14['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x2e1e14),_0x2e1e14;}}class AIActionsBalloonToolbarView extends kt{constructor(_0x2baaf6,_0x515fa2=!0x0,_0x5f213f=!0x0){super(_0x2baaf6),this['set']('isEnabled',!0x1),_0x515fa2&&(this['applyButton']=this['_createButton'](Hi(_0x2baaf6,'AI_BALLOON_APPLY_BUTTON'),Mi),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x5f213f&&(this['suggestButton']=this['_createButton'](Hi(_0x2baaf6,'AI_BALLOON_SUGGEST_BUTTON'),_0x515fa2?Ui:Mi),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x515fa2,'showSuggestButton':_0x5f213f}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x368168,showSuggestButton:_0x4f8161}){this['applyButton']&&(this['applyButton']['isVisible']=_0x368168),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x4f8161);}['_createButton'](_0x187e12,_0xc64a21){const _0x542250=new vt(this['locale']);return _0x542250['set']({'label':_0x187e12,'class':_0xc64a21,'isVisible':!0x0,'withText':!0x0}),_0x542250;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x5bfa3d){super(_0x5bfa3d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Hi(_0x5bfa3d,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0x26219f){super(_0x26219f),this['set']('isVisible',!0x0);const _0x1d343f=new AISpinnerView('small');_0x1d343f['isVisible']=!0x0;const _0x1e8cb2=new Nt(this['locale']);_0x1e8cb2['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Hi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x24a33b=>!_0x24a33b)]},'children':[_0x1d343f,_0x1e8cb2]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x1686bc,_0x8d9730){super(_0x1686bc),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x8d9730,this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x184ac3(),this['_addContentWrapper'](_0x8d9730),this['_addDisclaimerView'](),this['_addToolbar'](_0x8d9730),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main']},'children':this['_dialogContent']}),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x8d9730);});}['render'](){super['render']();for(const _0xc7d7b1 of this['_focusables'])this['_focusTracker']['add'](_0xc7d7b1['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0xbe5acf){-0x1===_0xbe5acf?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x9dbb5e){this['_isLoading']=_0x9dbb5e;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x57b6a7){super['showError'](_0x57b6a7),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1f0392){super['showBlockingError'](_0x1f0392),this['setErrorState']();}['addMiniToolbarItem'](_0x260d7e){this['_miniToolbarView']['items']['has'](_0x260d7e)||this['_miniToolbarView']['items']['add'](_0x260d7e);}['removeMiniToolbarItem'](_0x1649e9){this['_miniToolbarView']['items']['has'](_0x1649e9)&&this['_miniToolbarView']['items']['remove'](_0x1649e9);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1e6fab,showSuggestButton:_0x2acea1}){_0x1e6fab=_0x1e6fab&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2acea1=_0x2acea1&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1e6fab,'showSuggestButton':_0x2acea1});}async['updateContent'](_0x3abfde){await this['_streamableContentView']['update'](_0x3abfde);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x29bc75){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x29bc75['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x3e3e39,showSuggestButton:_0x4714d9}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x3e3e39,_0x4714d9),this['_toolbarView']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['_toolbarView']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x41063a,_0x550ab5,_0x2afe1a)=>!(_0x41063a||_0x550ab5||_0x2afe1a)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x3e3e39,'showSuggestButton':_0x4714d9}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0xbd35df){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0xbd35df),this['_miniToolbarView']['delegate'](...Cs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x42ba7a,_0x3e7e38)=>!(_0x42ba7a||_0x3e7e38)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3487cd=new vt(this['locale']),_0x2e7bb6=new vt(this['locale']),_0x5c7a94=new AIActionsBalloonNavigationCounterView(this['locale']),_0x279209=new vt(this['locale']);_0x3487cd['set']({'icon':tt,'label':Hi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Bi}),_0x2e7bb6['set']({'icon':_0x1607c0,'tooltip':Hi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Bi}),_0x279209['set']({'icon':et,'tooltip':Hi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Bi}),_0x3487cd['bind']('isEnabled')['to'](this,'isBusy',_0x5d81b2=>!_0x5d81b2),_0x3487cd['on']('execute',()=>{this['fire']('tryAgain');}),_0x2e7bb6['bind']('isEnabled')['to'](this,'isBusy',_0x9c04eb=>!_0x9c04eb),_0x2e7bb6['on']('execute',()=>{this['fire']('showPrevious');}),_0x279209['bind']('isEnabled')['to'](this,'isBusy',_0xf2ca2a=>!_0xf2ca2a),_0x279209['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2e7bb6,this['_navigationCounter']=_0x5c7a94,this['_navigationNextButton']=_0x279209,this['_navigationTryAgainButton']=_0x3487cd;}['updateMiniToolbarButtons'](_0x37123e,_0x92f639){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x25b2ee=_0x37123e>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x25b2ee){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x19aa5a=_0x37123e-_0x92f639;this['_navigationCounter']['setInteractionCount'](_0x19aa5a+'/'+_0x37123e),this['_navigationPreviousButton']['isEnabled']=_0x92f639<_0x37123e-0x1,this['_navigationNextButton']['isEnabled']=_0x92f639>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}['disableMiniToolbarButtons'](){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}['startAutoScroll'](){this['_initializeScrollManager'](),this['_scrollManager']&&this['_scrollManager']['start']();}['stopAutoScroll'](){this['_scrollManager']&&this['_scrollManager']['stop']();}['toggleIsLoading'](_0x402e5c){this['_isLoading']=_0x402e5c;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x16a791=this['_getScrollableElement']();_0x16a791&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0x16a791));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x54710d){super(_0x54710d);const _0x3d5e83=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x3d5e83['to']('interactionCount')}]});}['setInteractionCount'](_0x21a953){this['set']('interactionCount',_0x21a953);}}class AIActions extends _0x5686f0{static get['requires'](){return[AIConnector,Bt,AIEditing,AIBalloon,_0x53dd97];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x53190e){super(_0x53190e),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x3f2efb,_0x176b30,_0x26a68e){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x27f200,anchorData:_0x301c46,root:_0x4f3a72}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x3f2efb,_0x27f200,_0x301c46,_0x4f3a72,_0x176b30,_0x26a68e);}}const {modelFragment:_0x3dd295,anchorData:_0x304d69,root:_0x36f77a}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x3f2efb,_0x3dd295,_0x304d69,_0x36f77a,_0x176b30,_0x26a68e);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x1ebd58=this['editor']['plugins']['has']('TrackChanges');let _0xd5ae9=this['editor']['config']['get']('ai.availableReplyActions')||[...bs];_0x1ebd58||(_0xd5ae9=_0xd5ae9['filter'](_0x4479b6=>'insertSuggestion'!=_0x4479b6));const _0x577a5=this['editor']['commands']['get']('trackChanges'),_0x569a14=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x1ebd58,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xd5ae9});return _0x569a14['bind']('isBusy')['to'](this),_0x577a5&&_0x569a14['bind']('isTrackChangesOn')['to'](_0x577a5,'value'),_0x569a14['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x569a14['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x569a14['on']('showNext',()=>{this['_navigateToNext']();}),_0x569a14;}['_getExecuteDataRegular'](){const _0x334009=this['editor']['model']['document']['selection'],_0xf1f12=_0x334009['getFirstRange']()['start']['root'];if(_0x334009['isCollapsed']){const _0x3878f8=At(_0x334009['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x334009);this['editor']['model']['change'](_0x14f3d0=>{_0x14f3d0['setSelection'](_0x3878f8,'in');});}const _0x2464e2=_0x334009['getFirstRange'](),_0x548571=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x334009),_0x2464e2['start'],_0x2464e2['end']);this['_copyMarkersToFragment'](_0x548571,_0x334009,{'isTableSelection':!0x1});const _0x176a69=_0x334009['getFirstRange']()['start'],_0x51781c=new Map();let _0x317fe6=_0x548571;for(let _0x272e33=0x0;_0x272e33<_0x176a69['path']['length'];_0x272e33++)_0x51781c['set'](_0x317fe6,_0x176a69['path'][_0x272e33]),_0x317fe6=_0x317fe6['getChild'](0x0);return{'modelFragment':_0x548571,'anchorData':_0x51781c,'root':_0xf1f12};}['_getExecuteDataInTable'](){const _0x174311=this['editor']['model']['document']['selection'],_0xdf6a54=this['editor']['plugins']['get']('TableSelection'),_0x278689=_0x174311['getFirstRange']()['start']['root'],_0x636b54=_0xdf6a54['getSelectionAsFragment'](),_0x183498=_0x174311['getFirstRange']()['start']['parent']['parent'],_0x20ae3e=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x183498),this['editor']['model']['createPositionAfter'](_0x183498)),_0x393242=this['_wrapWithCommonAncestors'](_0x636b54,_0x20ae3e['start'],_0x20ae3e['end']);this['_copyMarkersToFragment'](_0x393242,_0x174311,{'isTableSelection':!0x0});const _0x26bd5d=_0x174311['getFirstRange']()['start'],_0x5cb474=new Map();let _0x5ed694=_0x393242;for(let _0x116abb=0x0;_0x116abb<_0x26bd5d['path']['length'];_0x116abb++)if(_0x5cb474['set'](_0x5ed694,_0x26bd5d['path'][_0x116abb]),_0x116abb<_0x26bd5d['path']['length']-0x1)_0x5ed694=_0x5ed694['getChild'](0x0);else{let _0x1a6229=_0x5ed694['nextSibling'];for(;_0x1a6229;)_0x5cb474['set'](_0x1a6229,_0x26bd5d['path'][_0x116abb]),_0x1a6229=_0x1a6229['nextSibling'];}return{'modelFragment':_0x393242,'anchorData':_0x5cb474,'root':_0x278689};}async['_executeAction'](_0x2d1f2b,_0x43a026,_0x1dcd1f,_0x4290ac,_0x28b23e,_0x1638fb){const _0x368054=this['editor']['plugins']['get'](AIEditing),_0x485aff=this['editor']['plugins']['get'](AIBalloon),_0xdd777c=this['editor']['model']['document']['selection'],_0x4e4ef9=await _0x368054['modelToDataWithIds'](_0x43a026),_0x442f26=this['editor']['model']['document']['version'],_0x5a2ccb=[..._0xdd777c['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x485aff['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x28b23e,'icon':_0x1638fb||_0x15178f,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5a2ccb,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x485aff),this['_interactionParams']={'action':_0x2d1f2b,'content':_0x4e4ef9,'version':_0x442f26,'aiBalloon':_0x485aff,'modelFragment':_0x43a026,'anchorData':_0x1dcd1f,'root':_0x4290ac},this['_setupApplyListeners'](),this['listenTo'](_0x485aff,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x485aff,'dialogClosed',(_0x30789e,{id:_0x2401bf})=>{if('aiActionsBalloon'===_0x2401bf){for(const _0x198e37 of this['_interactions']){if(0x0===_0x198e37['replies']['length']||_0x198e37['stoppedExplicitly'])continue;const _0x3a85e9=_0x198e37['replies'][_0x198e37['replies']['length']-0x1],_0x2b7147=_0x3a85e9['changeGroups'][0x0];_0x2b7147&&'pending'===_0x2b7147['state']&&_0x3a85e9['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x485aff);}}),this['_createInteraction'](_0x4e4ef9,_0x442f26,_0x485aff,_0x2d1f2b);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x4990de,anchorData:_0x11b1eb,root:_0x30e342}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x4990de,_0x11b1eb,_0x30e342,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x4990de,_0x11b1eb,_0x30e342,!0x0);});}['_wrapWithCommonAncestors'](_0x12c28a,_0xdcfd25,_0x2203f2){const _0x297377=this['editor']['model']['createRange'](_0xdcfd25,_0x2203f2)['getCommonAncestor'](),_0x39c89e=_0x297377['is']('documentFragment')?[]:_0x297377['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x39c89e['length']){const _0x2fc92c=_0x39c89e['map'](_0x2878e2=>_0x2878e2['_clone'](!0x1));for(let _0x227ede=0x1;_0x227ede<_0x2fc92c['length'];_0x227ede++)_0x2fc92c[_0x227ede-0x1]['_appendChild'](_0x2fc92c[_0x227ede]);return _0x2fc92c[_0x2fc92c['length']-0x1]['_appendChild'](_0x12c28a),new _0xee8836(_0x2fc92c[0x0]);}return _0x12c28a;}['_copyMarkersToFragment'](_0x4e4068,_0x45e3c3,_0x359f6a={'isTableSelection':!0x1}){const _0x21d067=this['editor']['model'],_0x45773f=Array['from'](_0x45e3c3['getRanges']()),_0x54d6c1=_0x45e3c3['getFirstRange']()['start'];for(const _0x36617d of _0x21d067['markers']){if(_0x36617d['name']['startsWith'](As)||!_0x36617d['affectsData'])continue;const _0x3c0551=_0x36617d['getRange']();if(!_0x45773f['some'](_0x59595a=>_0x59595a['containsRange'](_0x3c0551,!0x0)))continue;const _0x1c4b78=this['_regularCalculateMarkerPath'](_0x3c0551['start'],_0x54d6c1,_0x359f6a['isTableSelection']),_0x11330a=this['_regularCalculateMarkerPath'](_0x3c0551['end'],_0x54d6c1,_0x359f6a['isTableSelection']),_0x3ee5a2=_0x21d067['createPositionFromPath'](_0x4e4068,_0x1c4b78),_0xcb6237=_0x21d067['createPositionFromPath'](_0x4e4068,_0x11330a);if(!_0x3ee5a2['isEqual'](_0xcb6237)){const _0x5b5c7e=_0x21d067['createRange'](_0x3ee5a2,_0xcb6237);_0x4e4068['markers']['set'](_0x36617d['name'],_0x5b5c7e);}}}['_regularCalculateMarkerPath'](_0x3cc812,_0x5c8b7f,_0x1e55c8=!0x1){const _0x4e20e9=[..._0x3cc812['path']['slice']()];for(let _0x204819=0x0;_0x204819<Math['max'](_0x5c8b7f['path']['length'],_0x3cc812['path']['length']);_0x204819++){const _0x1d611a=_0x5c8b7f['path'][_0x204819]||0x0,_0x40d29f=(_0x3cc812['path'][_0x204819]||0x0)-_0x1d611a;if(_0x4e20e9[_0x204819]=_0x40d29f,0x0!==_0x40d29f&&!_0x1e55c8)break;}return _0x4e20e9;}async['_createInteraction'](_0x159c4e,_0x35fb78,_0x41f6,_0x277369){const _0x354e0f=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x277369,'content':_0x159c4e,'version':_0x35fb78,'aiBalloon':_0x41f6,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x3ba002=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x354e0f['locale'],'content':_0x159c4e,'version':_0x35fb78,..._0x277369});this['_interactions']['push'](_0x3ba002);const _0x3a416b=(_0x520e42,_0xba7740=!0x1,_0x24791a='streaming')=>this['_promiseQueue']['enqueue'](async _0x1a702c=>{try{const _0x437a1b=Zi({'editor':_0x354e0f,'changeGroups':_0x520e42['changeGroups'],'documentContextContent':_0x520e42['documentContextContent'],'showDiff':_0xba7740,'trimUnchanged':!0x1});_0x437a1b['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x437a1b[0x0],'renderingStrategy':_0x24791a,'abortSignal':_0x1a702c});}catch(_0x4f21c4){if(this['_isAbortError'](_0x4f21c4))return;throw _0x4f21c4;}});_0x3ba002['on']('replyCreated',(_0x386970,_0x2de0fc)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x3a416b(_0x2de0fc)['catch'](_0x1e5a24=>{this['_isAbortError'](_0x1e5a24)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x1e5a24),this['_setErrorState'](_0x3ba002));});}),_0x3ba002['on']('replyContentUpdated',(_0x55d5f6,_0x333d75)=>{_0x3a416b(_0x333d75)['catch'](_0x7b2a1f=>{this['_isAbortError'](_0x7b2a1f)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x7b2a1f),this['_setErrorState'](_0x3ba002));});}),_0x3ba002['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x536943){this['_isAbortError'](_0x536943)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x536943),this['_setErrorState'](_0x3ba002));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x33b772,{showDiff:_0x936de6})=>{try{this['_balloonShowDiff']=_0x936de6;const _0x554a2e=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x554a2e&&await _0x3a416b(_0x554a2e,_0x936de6,'static');}catch(_0x5de353){this['_isAbortError'](_0x5de353)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x5de353),this['_setErrorState'](_0x3ba002));}}),_0x3ba002['on']('replyChangeGroupStateUpdated',()=>{const _0x12ecbb={'positiveCount':_0x3ba002['replies']['reduce']((_0x2d440f,_0x346a66)=>_0x2d440f+_0x346a66['changeGroups']['filter'](_0x50e773=>'accepted'===_0x50e773['state'])['length'],0x0),'totalCount':_0x3ba002['replies']['reduce']((_0x358ca5,_0x494bc7)=>_0x358ca5+_0x494bc7['changeGroups']['length'],0x0)},_0x5656dd=_0x3ba002['actionCallId'],_0x3dff1a=_0x3ba002['actionName'];_0x3dff1a?this['_aiConnector']['upsertAIActionRating'](_0x3dff1a,_0x5656dd,_0x12ecbb):this['_aiConnector']['upsertCustomAIActionRating'](_0x5656dd,_0x12ecbb);}),this['_setLoadingState']();try{const _0x1d90ef=await _0x3ba002['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1d90ef;}catch(_0x437876){if(this['_isAbortError'](_0x437876))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x3ba002);}}['_applyChanges'](_0x46177f,_0x39dae9,_0x3f8b11,_0x52c4e1){const _0x26930a=this['editor'];if(_0x52c4e1&&!_0x26930a['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x239e48=this['editor']['plugins']['get'](_0x53dd97),_0x2c86f7=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2c86f7||!_0x2c86f7['replies']['length'])return;const _0x328354=_0x2c86f7['replies'][_0x2c86f7['replies']['length']-0x1],_0x48893d=_0x328354['changeGroups'];_0x328354['setChangeGroupState'](0x0,'accepted');let _0x4366c2=_s({'editor':_0x26930a,'reply':_0x328354,'interaction':_0x2c86f7,'groups':_0x48893d,'transform':!0x1,'documentCompare':_0x239e48,'documentCompareOptions':{'anchor':_0x26930a['model']['createPositionAt'](_0x46177f,0x0),'markDeletions':_0x52c4e1}});_0x4366c2=this['_filterOperationsOutsideRange'](_0x4366c2,_0x39dae9);for(const _0x3636cd of _0x4366c2)this['_anchorOperation'](_0x39dae9,_0x3636cd,_0x3f8b11);const _0x544532=_0x2c86f7['getDocumentContext']()['version'],_0x25b30c=_0x26930a['model']['document']['history']['getOperations'](_0x544532),_0x41c53a={'document':_0x26930a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x411ab9=_0x27476f(_0x4366c2,_0x25b30c,_0x41c53a)['operationsA'];_0x26930a['model']['change'](_0x1f5c83=>{if(_0x1f5c83['setSelection'](_0x26930a['model']['document']['selection']['focus']),_0x52c4e1)_0x26930a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x411ab9);else{for(const _0x69bf50 of _0x411ab9)_0x69bf50['baseVersion']=_0x26930a['model']['document']['version'],Is(_0x26930a,_0x69bf50),_0x1f5c83['batch']['addOperation'](_0x69bf50),_0x26930a['model']['applyOperation'](_0x69bf50);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0xfef603,_0x330438){return _0xfef603['filter'](_0x1f468b=>{if('rename'==_0x1f468b['type']){const _0x22df6d=_0x1f468b['position']['nodeAfter'];return!_0x330438['has'](_0x22df6d);}if(_0x1f468b['type']['indexOf']('Attribute')>-0x1){const _0x1b5c57=_0x1f468b['range']['start']['nodeAfter'];return!_0x330438['has'](_0x1b5c57);}return!0x0;});}['_anchorOperation'](_0x9b2706,_0x46ad09,_0x28a6f6){const _0x326f7f=_0x46ad09['clone']();for(const _0x3fac9e in _0x46ad09){const _0x50d982=_0x46ad09[_0x3fac9e];_0x50d982 instanceof _0x1445f3?_0x46ad09[_0x3fac9e]=new _0x1445f3(_0x8d3448(_0x50d982['start']),_0x8d3448(_0x50d982['end'])):_0x50d982 instanceof _0x3c2be3&&(_0x46ad09[_0x3fac9e]=_0x8d3448(_0x50d982));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x326f7f['type'])){if(_0x326f7f['isDocumentOperation']=!0x1,_0x326f7f['baseVersion']=null,'remove'==_0x326f7f['type']){const _0x297cdd=_0x326f7f['sourcePosition'],_0x28a891=_0x326f7f['howMany'];new _0x43c2ab(_0x297cdd,_0x28a891)['_execute']();}else _0x326f7f['_execute']();}function _0x8d3448(_0x4ad28d){if('$graveyard'==_0x4ad28d['root']['rootName'])return _0x4ad28d;const _0x7c8f86=[];let _0x121cb8=_0x4ad28d['root'];for(let _0x1032b8=0x0;_0x1032b8<_0x4ad28d['path']['length'];_0x1032b8++){const _0x147e62=_0x9b2706['get'](_0x121cb8)||0x0;_0x7c8f86[_0x1032b8]=_0x4ad28d['path'][_0x1032b8]+_0x147e62,_0x121cb8=_0x121cb8['getChildAtOffset'](_0x4ad28d['path'][_0x1032b8]);}return new _0x3c2be3(_0x28a6f6,_0x7c8f86,_0x4ad28d['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x3548c4,content:_0x2a0767,version:_0x3e36af,aiBalloon:_0x55051c}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['showLoader'](),this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x2a0767,_0x3e36af,_0x55051c,_0x3548c4)['catch'](_0x42846f=>{this['_isAbortError'](_0x42846f)||console['error']('Error\x20refreshing\x20interaction:',_0x42846f);});}['_isAbortError'](_0x534059){return!!_0x534059['message']&&_0x534059['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x5e2b8a=this['_interactions']['length'];this['_currentInteractionIndex']<_0x5e2b8a-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5a4aa5){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5a4aa5;const _0x13f409=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x13f409)return;if(_0x13f409['hasError'])return this['_setErrorState'](_0x13f409),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x13f409['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x1134d7=_0x13f409['replies'][_0x13f409['replies']['length']-0x1];if(_0x1134d7){const _0x51df0c=this['editor'];try{const _0x483a69=Zi({'editor':_0x51df0c,'changeGroups':_0x1134d7['changeGroups'],'documentContextContent':_0x1134d7['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xb25f23=>setTimeout(_0xb25f23,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x483a69[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x279898){this['_isAbortError'](_0x279898)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x279898);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0xd984f2){const _0x2d1ccc=Hi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x2d1ccc),_0xd984f2['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x5686f0{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41246a){super(_0x41246a),_0x41246a['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x2b44af,_0x4ed7b8){super(_0x2b44af),this['id']=_0x4ed7b8,this['set']('status','pending'),this['set']('changeId',_0x4ed7b8),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x33e94d,_0x3ca0f0)=>{_0x3ca0f0&&_0x3ca0f0['target']&&'A'===_0x3ca0f0['target']['tagName']&&_0x3ca0f0['preventDefault'](),this['fire']('activateChange',{'id':_0x4ed7b8,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4ed7b8,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4ed7b8,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x5359ad=new Nt(this['locale']);return _0x5359ad['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response',this['bindTemplate']['if']('showDiff','ck-hidden',_0x53237a=>!_0x53237a)]}}),_0x5359ad;}['_createAcceptButtonView'](){const _0x5843=new vt(this['locale']);return _0x5843['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5843['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1947ef=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x1947ef['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x2c0f4e=>'pending'!==_0x2c0f4e&&'accepted'!==_0x2c0f4e),this['bindTemplate']['if']('status',Ui,_0x4238c4=>'pending'===_0x4238c4),this['bindTemplate']['if']('status',Bi,_0x35bf6b=>'pending'!==_0x35bf6b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x469a47=>'accepted'===_0x469a47)]}}),this['on']('change:status',(_0x396e3a,_0x364db6,_0x32e09e)=>{_0x5843['isEnabled']='pending'===_0x32e09e,'accepted'===_0x32e09e&&(_0x5843['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5843['icon']=_0x4ab520);}),_0x5843;}['_createDismissButtonView'](){const _0x2552f8=new vt(this['locale']);return _0x2552f8['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x2552f8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d4672=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x5d4672['stopPropagation']();})},'attributes':{'class':[Bi,this['bindTemplate']['if']('status','ck-hidden',_0x283c89=>'pending'!==_0x283c89&&'rejected'!==_0x283c89),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x2f0933=>'pending'===_0x2f0933),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2e0d2a=>'rejected'===_0x2e0d2a)]}}),this['on']('change:status',(_0x4a8e77,_0x291545,_0x5d7476)=>{_0x2552f8['isEnabled']='pending'===_0x5d7476,'rejected'===_0x5d7476&&(_0x2552f8['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x2552f8['icon']=_0x5ed072);}),_0x2552f8;}['_createInfoButtonView'](){const _0x3e85d1=new vt(this['locale']);return _0x3e85d1['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x11ec0d,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Bi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x3e85d1['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3b014b=>_0x3b014b),_0x3e85d1['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3e85d1;}['_createOutdatedButtonView'](){const _0xf2b4da=new vt(this['locale']);return _0xf2b4da['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0xf2b4da['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2106fd=>'outdated'!==_0x2106fd)],'disabled':'disabled'}}),_0xf2b4da;}}class AIReviewCoreBalloonSuggestionItemView extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x36fdc5,_0x154eb5){super(_0x36fdc5),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['set']('isDiffActive',!0x1),this['content']['add'](this['_createContentView']()),_0x154eb5['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x5766aa){this['resultItemView']['changeId']=_0x5766aa['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x5766aa['contentDiffed'];}['showBalloon'](_0x2dcff1,_0x3a2a34,_0x264eb1,_0x5b98ee,_0x49eb68,_0x259f5e){const _0x393416=_0x3a2a34();if(!_0x393416)return;this['updateContent'](_0x2dcff1),this['show']();const _0x14c1ea=Array['from'](_0x393416['getClientRects']())['reverse'](),_0x2fb3d1=this['_getPointedRectIndexFromEvent'](_0x264eb1,_0x14c1ea),_0x37b541=_0x14c1ea[_0x2fb3d1??0x0];'click'===_0x5b98ee?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x3a2a34(),_0x2fb3d1,_0x2dcff1['id'],_0x49eb68,_0x259f5e)||_0x37b541})):'hover'===_0x5b98ee&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x3a2a34(),_0x2fb3d1,_0x2dcff1['id'])||_0x37b541}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1a5ed2=[this['element']];return this['_pinnedTargetElement']&&_0x1a5ed2['push'](this['_pinnedTargetElement']),_0x1a5ed2;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4cc092=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4cc092['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-balloon-panel-suggestion',this['bindTemplate']['if']('isDiffActive','ck-ai_review-balloon-panel-suggestion_diff-active')]},'children':[{'tag':'p','attributes':{'class':['ck-ai_review__suggestion-text']},'children':[this['resultItemView']]}]}),_0x4cc092;}['_getBestRectPositionOnClick'](_0x3d66ea,_0x1bf38f,_0x447751,_0x29f30e,_0x1deea6){if(!_0x3d66ea)return null;const _0x5cc594=this['position']['replace']('arrow_',''),_0xca405b=Array['from'](_0x3d66ea['getClientRects']());let _0x48f63d,_0x211ec3=_0xca405b['reverse']();return void 0x0!==_0x1bf38f&&this['_isPinnedRectVisible'](_0x211ec3[_0x1bf38f],_0x29f30e,_0x1deea6)?(_0x48f63d=_0x211ec3[_0x1bf38f],this['_pinnedRectIndex']=_0x1bf38f):this['_isPinnedRectVisible'](_0x211ec3[0x0],_0x29f30e,_0x1deea6)&&void 0x0===_0x1bf38f?_0x48f63d=_0x211ec3[0x0]:(_0x211ec3='s'==_0x5cc594[0x0]?[..._0xca405b]['reverse']():_0xca405b,_0x211ec3['forEach'](_0x495f55=>{this['_isPinnedRectVisible'](_0x495f55,_0x29f30e,_0x1deea6)&&(_0x48f63d=_0x495f55);})),this['_pinnedTargetChangeId']=_0x447751,this['_pinnedTargetElement']=_0x3d66ea,_0x48f63d||_0x3d66ea['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x53f3de,_0x3ba30b,_0x3c6686){if(!_0x53f3de)return null;const _0x591a1d=Array['from'](_0x53f3de['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x3ba30b&&this['_pinnedTargetChangeId']!==_0x3c6686)return this['_pinnedRectIndex']=_0x3ba30b,this['_pinnedTargetElement']=_0x53f3de,this['_pinnedTargetChangeId']=_0x3c6686,_0x591a1d[_0x3ba30b];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3c6686){if(_0x53f3de!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x591a1d[this['_pinnedRectIndex']];}return void 0x0!==_0x3ba30b&&this['_pinnedTargetChangeId']!==_0x3c6686?(this['_pinnedRectIndex']=_0x3ba30b,this['_pinnedTargetElement']=_0x53f3de,this['_pinnedTargetChangeId']=_0x3c6686,_0x591a1d[_0x3ba30b]):_0x53f3de['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x15593e,_0x1934bc){if(_0x15593e)for(let _0x49178f=0x0;_0x49178f<_0x1934bc['length'];_0x49178f++){const _0x3549c2=_0x1934bc[_0x49178f];if(_0x15593e['clientX']>=_0x3549c2['left']-0x3&&_0x15593e['clientX']<=_0x3549c2['right']+0x3&&_0x15593e['clientY']>=_0x3549c2['top']-0x3&&_0x15593e['clientY']<=_0x3549c2['bottom']+0x3)return _0x49178f;}}['_isPinnedRectVisible'](_0x45b0c7,_0x3b714d,_0x2e20c7){const _0xce4e8c=new ut(_0x45b0c7),_0x418578=_0x3b714d||document['documentElement'],_0x328867=_0xce4e8c['getIntersection'](bt(_0x2e20c7)),_0x5d9ff5=new ut(_0x418578)['getIntersection'](_0xce4e8c);return!!(_0x328867&&_0x5d9ff5&&_0xce4e8c['width']>0x0);}}const Fn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x23f270{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1eebb8){super(_0x1eebb8),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Fn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x215e81=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x215e81);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x37eed6){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x4d7878=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x37eed6,_0x4d7878);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5184a5){_0x5184a5&&('error-general'!==_0x5184a5['status']?'error-chunk'!==_0x5184a5['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x19234a){this['_mainView']['addCheckRunResult'](_0x19234a);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2571b2){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2571b2??Hi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x52f385,_0x33c926){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x52f385,_0x33c926);}['setActiveStateInResults'](_0x48822d){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3849de=>{_0x3849de['id']===_0x48822d&&_0x3849de['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x49ec0c=>_0x49ec0c['setItemAsInactive']());}['updateChangeState'](_0x3f8b99,_0x437ee4){'accepted'===_0x437ee4||'rejected'===_0x437ee4||'outdated'===_0x437ee4?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3f8b99,_0x437ee4):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3f8b99,_0x437ee4);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1e7b17,_0x2ef5e4,_0x477700,_0x25a8f8,_0x4c9454,_0x297ab6){this['_balloonSuggestionView']['showBalloon'](_0x1e7b17,_0x2ef5e4,_0x477700,_0x25a8f8,_0x4c9454,_0x297ab6);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x5f3e2f){const _0x1742d5=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x42d901=>_0x42d901['id']===_0x5f3e2f);return _0x1742d5?_0x1742d5['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0x3ab633){super(_0x3ab633),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x20d26c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x20d26c['if']('isVisible','ck-hidden',_0x40f3a0=>!_0x40f3a0)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x20d26c['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x47bde9,_0x28a7d0){super(_0x47bde9),this['reviewCoreHeader']=_0x28a7d0['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0x47bde9),this['reviewCheckListView']=_0x28a7d0['list'],this['reviewCheckListView']['delegate'](...Fn)['to'](this),this['reviewCheckResultsView']=_0x28a7d0['results'],this['reviewCheckResultsView']['delegate'](...Fn)['to'](this),this['reviewCompletedView']=_0x28a7d0['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView']]});}['showReviewCheckListView'](){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}['showReviewCheckResultsView'](){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}['addCheckRunResult'](_0x308528){this['reviewCheckResultsView']['addResult'](_0x308528),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x936679){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x936679;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends vt{constructor(_0x5a66a8,_0x3a0b2){super(_0x3a0b2),this['set']({'label':_0x5a66a8,'withText':!0x0,'class':Mi}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Pt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x589f25,_0x21cdf4){super(_0x589f25),this['_contents']=_0x21cdf4,this['_resultViews']=new _0x184ac3(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x589f25),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1);const _0x7593da=this['_createCombinedSkeletonLoader'](),_0x42e474=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x42e474['if']('isLoading','ck-ai_review__check-run_loading',_0x4a821c=>_0x4a821c),_0x42e474['if']('isResultReady','ck-ai_review__check-run_ready',_0x5a5dcf=>_0x5a5dcf),_0x42e474['if']('isVisible','ck-hidden',_0x1c7e8c=>!_0x1c7e8c)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x7593da,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0xe839de){const _0x2150a5=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0xe839de['id']);_0x2150a5['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2150a5),_0x2150a5['resultResponseView']['element']['innerHTML']=_0xe839de['contentDiffed'];}['hideResult'](_0x3ff8b7,_0x11eafd){if('pending'===_0x11eafd)return;const _0x4d0459=this['_resultViews']['find'](_0x18bf21=>_0x18bf21['id']===_0x3ff8b7);_0x4d0459&&(_0x4d0459['status']=_0x11eafd,_0x4d0459['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x3dceaa,_0x519437){if('pending'!==_0x519437)return;const _0x54bf95=this['_resultViews']['find'](_0x8ce40f=>_0x8ce40f['id']===_0x3dceaa);_0x54bf95&&(_0x54bf95['status']=_0x519437,_0x54bf95['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x80326f,_0x2147d3){this['headerTitle']=_0x80326f,this['headerSubtitle']=_0x2147d3||'';}['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 AISkeletonView(this['locale'],Ss['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x312b29=new Nt(this['locale']),_0x56549a=[];for(let _0x25f7b4=0x0;_0x25f7b4<0x10;_0x25f7b4++){const _0x53b081=this['_createSkeletonLoader']();_0x53b081['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x56549a['push'](_0x53b081);}return _0x312b29['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3ba449=>!_0x3ba449)]},'children':_0x56549a}),_0x312b29;}['_createResultsBodyView'](){const _0x13bbdc=new Nt(this['locale']);return _0x13bbdc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x295500=>_0x295500)]},'children':this['_resultViews']}),_0x13bbdc;}['_createErrorView'](){const _0x6ff4db=new Nt(this['locale']),_0x2cb189=new vt(this['locale']),t=this['locale']['t'];return _0x6ff4db['delegate']('retryReview')['to'](this),_0x2cb189['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ui+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2cb189['on']('execute',()=>{this['fire']('retryReview');}),_0x6ff4db['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x528717=>!_0x528717),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xd3457=>'chunk'===_0xd3457)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0xe9215e=>'chunk'===_0xe9215e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3c6c67=>'general'!==_0x3c6c67)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x67e17b=>'chunk'!==_0x67e17b)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2cb189]}),_0x6ff4db;}['_createCancelButtonView'](){const _0x5b7655=new vt(this['locale']);return _0x5b7655['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ui+'\x20ck-ai-button-stop-generating'],'icon':_0x1b062b}),_0x5b7655['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x33af23=>_0x33af23),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x330e79=>_0x330e79)]}}),_0x5b7655['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5b7655;}['_createToggleDiffButtonView'](){const _0x27395a=new vt(this['locale']);_0x27395a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x27395a['bind']('isEnabled')['to'](this,'isError',_0x287af7=>!_0x287af7),_0x27395a['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3f499b=>!_0x3f499b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4b3edf=>_0x4b3edf)]}});const _0x13f493=Hi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x11adbb=Hi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x27395a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x53fb5a=>_0x53fb5a),_0x27395a['bind']('icon')['to'](this,'isToggleDiffOn',_0x5e44d9=>_0x5e44d9?st:nt),_0x27395a['bind']('label')['to'](this,'isToggleDiffOn',_0x156a4e=>_0x156a4e?_0x13f493:_0x11adbb),_0x27395a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x27395a;}['_createAcceptAllButtonView'](){const _0x1cdcb9=new vt(this['locale']);return _0x1cdcb9['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1cdcb9['bind']('isEnabled')['to'](this,'isError',_0x2de6ba=>!_0x2de6ba),_0x1cdcb9['extendTemplate']({'attributes':{'class':[Mi,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56b048=>!_0x56b048),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x54a5dc=>_0x54a5dc)]}}),_0x1cdcb9['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1cdcb9;}['_createExitReviewButtonView'](){const _0x1ab011=new vt(this['locale']);return _0x1ab011['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1ab011['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x20eff0=>!_0x20eff0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5a4600=>_0x5a4600)]}}),_0x1ab011['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1ab011;}['_createResultHeaderView'](){const _0x3e89ad=new Nt(this['locale']),_0x3d7da5=this['_createTitleView']();return _0x3e89ad['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4623e2=>_0x4623e2)]},'children':[_0x3d7da5,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3e89ad;}['_createTitleView'](){const _0x3e1669=new Nt(this['locale']),_0xa91514=new AISpinnerView();return _0xa91514['bind']('isVisible')['to'](this,'isResultReady',_0x34e08a=>!_0x34e08a),_0x3e1669['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xa91514,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x112b16=>_0x112b16)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3151e7=>!_0x3151e7)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x3e1669;}['_createFinishReviewButtonView'](){const _0x17d5f8=new AIReviewCoreFinishReviewButtonView(Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x17d5f8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x35bc31=>!_0x35bc31)]}}),_0x17d5f8['delegate']('finishReview')['to'](this),_0x17d5f8;}}class AIReviewCoreReviewCompletedView extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x476894,_0x98e982){super(_0x476894),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x98e982['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x98e982['headerText']);const _0x48f046=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x48f046['if']('isVisible','ck-hidden',_0x354970=>!_0x354970)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x98e982['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x519c0c){const _0x3507cb=new AIReviewCoreFinishReviewButtonView(_0x519c0c,this['locale']);return _0x3507cb['delegate']('finishReview')['to'](this),_0x3507cb;}['_createResultHeaderView'](_0x14b900){const _0x216277=new Nt(this['locale']);return _0x216277['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x14b900}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x216277;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2dfa6a,_0x1a9bb7){super(_0x2dfa6a),this['_defaultValue']=_0x1a9bb7['default']||(_0x1a9bb7['data']['length']>0x0?_0x1a9bb7['data'][0x0]['id']:''),this['_defaultLabel']=_0x1a9bb7['data']['find'](_0xa18ba6=>_0xa18ba6['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x59adbc=this['_prepareListOptions'](_0x1a9bb7['data']);jt(this['_dropdownView'],_0x59adbc,{'role':'menu','ariaLabel':_0x1a9bb7['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x39888e=>{_0x39888e['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x482664=>{this['formValue']=_0x482664['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x482664['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x4c1bc0=[]){const _0xa8816b=new dt();this['resetToDefault']();for(const _0x55047e of _0x4c1bc0){const _0x60d265=new Jt({'label':_0x55047e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x55047e['id'],'model':_0x55047e});_0x60d265['bind']('isOn')['to'](this,'formValue',_0x4eb20f=>_0x4eb20f===_0x60d265['id']);const _0x35fad7={'type':'button','model':_0x60d265};_0xa8816b['add'](_0x35fad7);}return _0xa8816b;}}class AIReviewCoreFormManagerView extends Pt{['_formItem']=null;constructor(_0x383f02,_0x173820,_0x2cf849){super(_0x383f02),this['argsKey']=_0x173820?.['argsKey'];if('dropdown'===_0x173820['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x173820);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x228643=new _0xee19c6(this['locale'],{'children':[this['_formItem']],'class':[_0x2cf849?'ck-form__row_with-submit':'']});_0x2cf849&&_0x228643['children']['add'](_0x2cf849),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x228643]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x126012{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3a1bb3){super(_0x3a1bb3),this['set']('isEmpty',!0x0),this['keystrokes']=new It(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new _t();['keystrokes']=new It();['focusCycler'];['_focusables']=new _0x184ac3();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x248027,_0x87c60f,_0x32e1c3=!0x1){super(_0x248027),this['_check']=_0x87c60f,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x87c60f['defaultModel']?_0x87c60f['defaultModel']['id']:'',this['_defaultLabel']=_0x87c60f['defaultModel']?_0x87c60f['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new AIReviewCorePromptInputView(_0x248027)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x32e1c3),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0xee19c6(this['locale'],{'children':[this['promptInputView']]}),new _0xee19c6(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x41fdf4,_0x414968)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x414968()):_0x414968();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x37ce82=>{this['_focusables']['add'](_0x37ce82),this['focusTracker']['add'](_0x37ce82['element']);}),this['keystrokes']['listenTo'](this['element']));}get['modelDefaultValue'](){return this['_defaultValue'];}get['modelDefaultLabel'](){return this['_defaultLabel'];}['resetToDefault'](){this['prompt']='',this['modelId']=this['modelDefaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['modelDefaultLabel'],this['resetFormValidationStatus']();}['resetFormValidationStatus'](){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x14d3d4 of this['_getFormValidators']()){const _0x297f8c=_0x14d3d4();if(_0x297f8c)return this['promptInputView']['errorText']=_0x297f8c,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Hi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x179ccb=new vt(this['locale']),t=this['locale']['t'];return _0x179ccb['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x179ccb['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x179ccb;}['_createCancelButtonView'](){const _0x4735bf=new vt(this['locale']),t=this['locale']['t'];return _0x4735bf['set']({'label':t('Cancel'),'withText':!0x0,'class':Bi}),_0x4735bf['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x469266=>{_0x469266['stopPropagation']();})}}),_0x4735bf['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x4735bf;}['_setModelList'](_0x30d182){this['_modelSelectionDropdownItems']['clear']();const _0x7c1ef1=this['_check']['models'];if(_0x30d182)this['set']('modelDisplayMode','hidden');else{const _0x1bbeab=0x1===_0x7c1ef1['length'];this['set']('modelDisplayMode',_0x1bbeab?'name':'selector');}if(this['resetToDefault'](),_0x7c1ef1?.['length']){0x1===_0x7c1ef1['length']&&this['set']('activeModelName',_0x7c1ef1[0x0]['name']||_0x7c1ef1[0x0]['id']);for(const _0x2c6726 of _0x7c1ef1){const _0x520a53=new Jt({'label':_0x2c6726['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2c6726['id'],'model':_0x2c6726});_0x520a53['bind']('isOn')['to'](this,'modelId',_0x48d6bd=>_0x48d6bd===_0x2c6726['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x520a53,'labelView':new ModelButtonLabelView(this['locale'],_0x2c6726)});}}}['_createModelSelectionDropdown'](){const _0x30f528=Gt(this['locale']);return _0x30f528['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x30f528['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Bi}),_0x30f528['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1e8175=>'selector'===_0x1e8175),this['listenTo'](_0x30f528,'execute',_0x284c75=>{this['modelId']=_0x284c75['source']['model']['id'],_0x30f528['buttonView']['label']=_0x284c75['source']['label'];}),_0x30f528;}['_createModelNameView'](){const _0x4aecb8=new ModelNameView(this['locale']);return _0x4aecb8['bind']('text')['to'](this,'activeModelName',_0x4dc505=>_0x4dc505??''),_0x4aecb8['bind']('isVisible')['to'](this,'modelDisplayMode',_0xd57a57=>'name'===_0xd57a57),_0x4aecb8;}['_createActionsFooterView'](){const _0x2499b5=new Nt(this['locale']);return _0x2499b5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0x2499b5;}}class ModelNameView extends Nt{constructor(_0x5e833e){super(_0x5e833e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5a0daf=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x5a0daf['if']('isVisible','ck-hidden',_0xfb6846=>!_0xfb6846)]},'children':[{'text':_0x5a0daf['to']('text')}]});}}class ModelButtonLabelView extends Ht{constructor(_0x520c1e,_0x257db9){super();const _0x544924=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x544924['to']('style'),'id':_0x544924['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x544924['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x257db9['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Pt{['_formItemsCollection']=new _0x184ac3();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x56509c,_0x37ac5e,_0x30302e,_0x27c605=!0x1){super(_0x56509c),this['_hideModels']=_0x27c605,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x37ac5e['isParameterized']);const _0x456ce3=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x75637d=>_0x75637d),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x265f3e=>_0x265f3e)],'style':{'--ck-ai-review-check-list-item-index':_0x30302e}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0x37ac5e['title']}]},_0x456ce3]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x37ac5e['description']?[{'text':_0x37ac5e['description']}]:[]}]}]},..._0x37ac5e['isParameterized']?[this['_createParameterizedView'](_0x37ac5e)]:[],...'custom'===_0x37ac5e['id']?[this['_createCustomView'](_0x37ac5e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x37ac5e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x37ac5e['id'],'args':_0x37ac5e['useArgs']?_0x37ac5e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x2a2215=>{_0x2a2215['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4be1b0=new xt();return _0x4be1b0['content']=rt,_0x4be1b0['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x4be1b0;}['_createParameterizedView'](_0x2b73af){const _0x42a317=new Nt(),_0x18acf1=this['_createFormView'](_0x2b73af);return _0x42a317['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x50ac90=>!_0x50ac90)]},'children':[_0x18acf1]}),_0x42a317;}['_createFormView'](_0x1c0e31){const _0x3d1bc2=new Nt(),_0x295ba6=Array['isArray'](_0x1c0e31['options'])?_0x1c0e31['options']:[],_0x7755b9=new vt(this['locale']),t=this['locale']['t'];_0x7755b9['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x7755b9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2a21ae=>{_0x2a21ae['stopPropagation']();})}}),_0x7755b9['on']('execute',()=>{const _0x17f0ae=[],_0x247e1b={};this['_formItemsCollection']['forEach'](_0x38421c=>{_0x17f0ae['push'](_0x38421c['value']),_0x1c0e31['useArgs']&&_0x1c0e31['options']&&(_0x247e1b[_0x38421c['argsKey']]=_0x38421c['value']);}),this['fire']('runReviewCheck',{'id':_0x1c0e31['id'],'params':_0x17f0ae['length']?_0x17f0ae:void 0x0,'args':Object['keys'](_0x247e1b)['length']?_0x247e1b:void 0x0});});const _0x44152d=_0x295ba6['length'];return _0x295ba6['forEach']((_0x52ed5e,_0x27215b)=>{const _0x3e4e68=_0x27215b===_0x44152d-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x52ed5e,_0x3e4e68?_0x7755b9:null));}),_0x3d1bc2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x3d1bc2;}['_createCustomView'](_0x29b1c8,_0x2e696c=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x29b1c8,_0x2e696c),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x4dde6f=>!_0x4dde6f)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x16650b,_0x41f8d5,_0x3a5e12)=>{_0x3a5e12||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Pt{['_checkViews'];constructor(_0x379c90){super(_0x379c90),this['_checkViews']=new _0x184ac3(),this['_setupTemplate']();}['setChecks'](_0x527712,_0x1395cf=!0x1){this['_checkViews']['clear']();for(const [_0x23d2b9,_0x44a371]of _0x527712['entries']()){const _0x3547cc=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x44a371,_0x23d2b9,_0x1395cf);_0x3547cc['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3547cc);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x104af1 of this['_checkViews'])_0x104af1 instanceof AIReviewCoreReviewCommandListItemView&&_0x104af1['resetToDefault']();}['_setupTemplate'](){const _0x2acb56=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2acb56['if']('isVisible','ck-hidden',_0x4046f9=>!_0x4046f9)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x98f6bb=this['context']['plugins']['get']('AITabs'),_0x1a754b=this['context']['locale'],_0x5ae508=new AIHeaderView(_0x1a754b,{'label':Hi(_0x1a754b,'AI_REVIEW_MODE'),'icon':_0x2e2f4a,'class':'ck-ai-header_review','showResizeButton':_0x98f6bb['showResizeButton']});return _0x5ae508['delegate']('resizeTabs')['to'](_0x98f6bb),_0x5ae508['bind']('isMaximized')['to'](_0x98f6bb['view'],'isMaximized',_0x178f5d=>_0x178f5d),new AIReviewCoreView(this['context']['locale'],{'header':_0x5ae508,'list':new AIReviewCoreReviewCheckListView(_0x1a754b),'results':new AIReviewCoreUICheckResultsView(_0x1a754b,{'generalErrorText':Hi(_0x1a754b,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x1a754b,{'headerText':Hi(_0x1a754b,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Hi(_0x1a754b,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x1a754b,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x268741=this['context']['plugins']['get']('AITabs');_0x268741['view']['on']('activateTab',(_0x51989f,{newTab:_0x44449b,oldTab:_0x3a7146})=>{'reviewMode'===_0x44449b?this['fire']('getReviewCheckList'):'reviewMode'===_0x3a7146&&this['fire']('leaveReview');}),_0x268741['view']['addTab']({'id':'reviewMode','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2e2f4a,'order':0x0,'content':this['_mainView']});}}const Kn='review-',Wn=['softBreak'];class AIReviewCoreEditing extends _0x23f270{static get['requires'](){return[_0x53dd97,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x517344){super(_0x517344),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x46fea7=_0x252e66=>this['_scheduleAttachReviewEditingToEditor'](_0x252e66);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x5ca812)return void _0x46fea7(this['context']);const _0x3838eb=this['context'];for(const _0x2d1097 of _0x3838eb['editors'])_0x46fea7(_0x2d1097);this['listenTo'](_0x3838eb['editors'],'add',(_0x123f62,_0xe00bf5)=>{_0x46fea7(_0xe00bf5);}),this['listenTo'](_0x3838eb['editors'],'remove',(_0x357195,_0x1cd03a)=>{for(const [_0x16178e,_0x550989]of this['_markers'])_0x550989['editor']===_0x1cd03a&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x16178e,'changeId':_0x550989['groupId']}),this['_markers']['delete'](_0x16178e));});}['_scheduleAttachReviewEditingToEditor'](_0x575280){const _0x5df2bf=()=>{'destroyed'!==_0x575280['state']&&_0x575280['conversion']&&this['_attachReviewEditingToEditor'](_0x575280);};if('ready'===_0x575280['state'])return void _0x5df2bf();const _0x11a555=()=>{this['stopListening'](_0x575280,'ready',_0x11a555),_0x5df2bf();};this['listenTo'](_0x575280,'ready',_0x11a555);}['_attachReviewEditingToEditor'](_0x158a04){this['_reviewEditingAttachedEditors']['has'](_0x158a04)||(_0x158a04['conversion']['for']('editingDowncast')['markerToElement']({'model':Kn+'insert','view':(_0x4aa32a,{writer:_0x4b24ac})=>{const _0xbdf745=this['_markers']['get'](_0x4aa32a['markerName']),_0x3067ca={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0xbdf745?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x4aa32a['markerName']};return _0x4b24ac['createUIElement']('span',_0x3067ca,function(_0x5afa6e){const _0x487f4a=this['toDomElement'](_0x5afa6e);return _0x487f4a['innerHTML']=_0xbdf745?.['content']?.['asString']||'',_0x487f4a;});}}),_0x158a04['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-only','view':_0x13b17e=>{const _0x151b79=this['_markers']['get'](_0x13b17e['markerName']),_0x47d422=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x151b79?.['id']||'')&&_0x47d422['push']('ck-ai_review__change_active'),{'classes':_0x47d422,'attributes':{'data-marker-id':_0x13b17e['markerName']}};}}),_0x158a04['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-context','view':_0x2c37c2=>{const _0x27afca=this['_markers']['get'](_0x2c37c2['markerName']),_0x21666a=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x27afca?.['id']||'')&&_0x21666a['push']('ck-ai_review__change_active'),{'classes':_0x21666a,'attributes':{'data-marker-id':_0x2c37c2['markerName']}};}}),_0x158a04['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-text','view':_0xc394b3=>{const _0x334771=this['_markers']['get'](_0xc394b3['markerName']),_0x5d7da2=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x334771?.['id']||'')&&_0x5d7da2['push']('ck-ai_review__change_active'),{'classes':_0x5d7da2,'attributes':{'data-marker-id':_0xc394b3['markerName']}};}}),_0x158a04['conversion']['for']('dataDowncast')['markerToElement']({'model':Kn+'suggestion-context','view':(_0x45587f,{writer:_0x31195b})=>_0x31195b['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x45587f['isOpening']?'start':'end')})}),_0x158a04['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4140c8,'view':_0x4b3396}),this['_updateMouseMarkerInteractionListeners'](_0x158a04),this['listenTo'](_0x158a04,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x158a04),{'priority':'lowest'}),this['listenTo'](_0x158a04,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x158a04),{'priority':'lowest'}),_0x158a04['model']['document']['registerPostFixer'](_0x1e43c4=>this['_validateMarkers'](_0x158a04,_0x1e43c4)),_0x158a04['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x158a04)),this['_reviewEditingAttachedEditors']['add'](_0x158a04));}['_updateMouseMarkerInteractionListeners'](_0x57751c){let _0xeb7cb3=this['_boundEditables']['get'](_0x57751c);_0xeb7cb3||(_0xeb7cb3=new Map(),this['_boundEditables']['set'](_0x57751c,_0xeb7cb3));const _0x110560=new Set(_0x57751c['ui']['getEditableElementsNames']());for(const _0xf9e7e of _0x110560){if(_0xeb7cb3['has'](_0xf9e7e))continue;const _0x2943bd=_0x57751c['ui']['getEditableElement'](_0xf9e7e);_0xeb7cb3['set'](_0xf9e7e,_0x2943bd),this['_attachMouseMarkerInteractionListeners'](_0x2943bd);}for(const [_0x1441f9,_0x41e099]of _0xeb7cb3)_0x110560['has'](_0x1441f9)||(_0xeb7cb3['delete'](_0x1441f9),this['_domEmitter']['stopListening'](_0x41e099));}['_attachMouseMarkerInteractionListeners'](_0x2a36de){this['_domEmitter']['listenTo'](_0x2a36de,'mouseup',(_0x2738dc,_0x172ed1)=>{const _0x81db44=_0x172ed1['target'],_0x1f269f=this['_findMarkerElement'](_0x81db44);if(!_0x1f269f)return;const _0x3dc26a=_0x1f269f['getAttribute']('data-marker-id'),_0x16c38c=_0x3dc26a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x3dc26a,'changeId':_0x16c38c,'markerElement':()=>this['_findMarkerElementById'](_0x3dc26a),'domEvent':_0x172ed1});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x2a36de,'mouseover',(_0x4d31e4,_0x197a45)=>{const _0x499f8b=_0x197a45['target'],_0x8996d7=_0x197a45['relatedTarget'];let _0x541bb4=this['_findMarkerElement'](_0x499f8b);if(!_0x541bb4&&_0x8996d7&&(_0x541bb4=this['_findMarkerElement'](_0x8996d7)),!_0x541bb4)return;const _0x388136=_0x541bb4['getAttribute']('data-marker-id'),_0x5bf9a1=_0x388136['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x5bf9a1,'markerElement':()=>this['_findMarkerElementById'](_0x388136),'domEvent':_0x197a45});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x3c2cd8((_0x6008ca,_0x1727bb)=>{const _0x2d78c9=_0x1727bb['target'];if(this['_findMarkerElement'](_0x2d78c9))return;_0x2d78c9['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x38b677=this['context']['plugins']['get']('AIEditing'),_0xab6fa=ls(this['context']);if(!_0xab6fa['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x1d35e6=new Set(),_0x1b2c1b=[],_0x475611=new Map();for(const _0x5ef90e of _0xab6fa)for(const _0x51ee1e of _0x5ef90e['model']['document']['getRoots']()){if('$graveyard'===_0x51ee1e['rootName'])continue;const _0x100ee0=this['_buildDocumentDataSliceForRoot'](_0x5ef90e,_0x51ee1e,_0x38b677,_0x1d35e6);_0x1b2c1b['push'](_0x100ee0['content']);for(const [_0x4d1f26,_0x340a76]of _0x100ee0['elements'])_0x475611['set'](_0x4d1f26,_0x340a76);}return{'elements':_0x475611,'content':_0x1b2c1b['join']('')};}['_buildDocumentDataSliceForRoot'](_0x749158,_0x1beb20,_0x2dc597,_0x3c5be9){const _0x2428f7=_0x749158['model'],_0x1d93b5=new _0xee8836();for(const _0x59d6ac of _0x1beb20['getChildren']())_0x1d93b5['_appendChild'](_0x59d6ac['_clone'](!0x0));for(const _0x1ee21d of _0x2428f7['markers']){const _0x403e56=_0x1ee21d['getRange']();_0x403e56&&_0x403e56['root']['rootName']===_0x1beb20['rootName']&&_0x1d93b5['markers']['set'](_0x1ee21d['name'],this['_changeRangeOwnerDocument'](_0x403e56['clone'](),_0x1d93b5));}const _0x4c5c27=new Map(),_0x2927ec=_0x2428f7['document']['version'],_0x462ce0=new _0x46a368({'ignoreElementEnd':!0x0,'startPosition':_0x2428f7['createPositionAt'](_0x1d93b5,0x0)});for(const {item:_0x5828bc}of _0x462ce0){if(!_0x5828bc['is']('$textProxy'))continue;const _0x32da60=_0x5828bc['parent'];if(!_0x32da60||!_0x32da60['is']('element'))continue;const _0x7259c7=this['_upsertDataId'](_0x32da60,()=>_0x2dc597['_nextDataId'](_0x3c5be9));_0x3c5be9['add'](_0x7259c7);for(const _0x3b093 of _0x32da60['getChildren']())_0x3b093['is']('element')&&(_0x3b093['name']&&Wn['includes'](_0x3b093['name'])||_0x3c5be9['add'](this['_upsertDataId'](_0x3b093,()=>_0x2dc597['_nextDataId'](_0x3c5be9))));let _0x5bdb12=_0x32da60;for(;_0x5bdb12['parent']&&!_0x5bdb12['parent']['is']('documentFragment');)_0x5bdb12=_0x5bdb12['parent'],_0x5bdb12['hasAttribute'](_0x4140c8)&&_0x5bdb12['_removeAttribute'](_0x4140c8);_0x4c5c27['set'](_0x7259c7,{'editor':_0x749158,'rootName':_0x1beb20['rootName'],'path':_0x32da60['getPath'](),'documentVersion':_0x2927ec,'getContent':this['_createGetContentUsingDataIdFn'](_0x5bdb12['_clone'](!0x0),_0x7259c7,_0x749158['data'])}),_0x462ce0['jumpTo'](_0x2428f7['createPositionAfter'](_0x32da60));}return{'content':_0x749158['data']['processor']['toData'](_0x749158['data']['toView'](_0x1d93b5)),'elements':_0x4c5c27};}['diffContent'](_0xb9c2fd,_0x9860dc,_0x1d8d2c,_0x3f630c=!0x1){const _0x56663a=[],_0x192c3a=_0xb9c2fd['data']['parse'](_0x1d8d2c,'$documentFragment'),_0x102b03=_0xb9c2fd['data']['parse'](_0x9860dc,'$documentFragment'),_0x3d54b3=_0xb9c2fd['model']['createPositionAt'](_0x102b03,0x0);if(this['_haveSingleTopLevelElement'](_0x192c3a)){if(!this['_hasSameTopLevelElement'](_0x102b03,_0x192c3a))return _0x56663a;}else{const _0x504618=_0xb9c2fd['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x102b03,_0x504618)||!this['_haveOnlyInlineContent'](_0x192c3a,_0x504618))return _0x56663a;}const _0x5e4cfe=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x9860dc,_0x1d8d2c,{'targetEditor':_0xb9c2fd,'anchor':_0x3d54b3,'markDeletions':!0x0})['getOperations']()['filter'](_0x1fdb49=>'insert'===_0x1fdb49['type']||'marker'===_0x1fdb49['type']&&_0x1fdb49['name']['startsWith']('$markedRemove')),_0x234f70=this['_groupAdjacentOperations'](_0x5e4cfe),_0x36bf44=[];if(_0x3f630c){if(_0x234f70['length']){const _0x1904cb=_0x234f70[0x0]['operations'][0x0],_0x2c4dc7='insert'===_0x1904cb['type']?_0x1904cb['position']:_0x1904cb['newRange']['start'],_0x33ee35=this['_getPositionLimitingRange'](_0x2c4dc7,_0xb9c2fd,'inside'),_0xd7a96c=_0x33ee35?_0x192c3a['getChild'](0x0)['getChildren']():_0x192c3a['getChildren'](),_0x1080e9=_0x33ee35||_0xb9c2fd['model']['createRangeIn'](_0x102b03),_0x304064=[new _0x147dae('$markedRemove:synthetic'+ot(),null,_0x1080e9,_0xb9c2fd['model']['document']['model']['markers'],!0x0,_0xb9c2fd['model']['document']['version']+0x1),new _0x129783(_0x1080e9['end'],_0xd7a96c,_0xb9c2fd['model']['document']['version']+0x2)];_0x36bf44['push']({'operations':_0x304064,'operationsIsolated':_0x304064,'groupOffset':0x0});}}else _0x36bf44['push'](..._0x234f70);let _0x15d71d=0x0;return _0xb9c2fd['model']['change'](_0x5c6f20=>{for(let _0x17861d=0x0;_0x17861d<_0x36bf44['length'];_0x17861d++){const _0x5c1077=_0x36bf44[_0x17861d],_0x22d810=_0x5c6f20['createDocumentFragment']();for(const _0x35e74a of _0x102b03['getChildren']())_0x5c6f20['append'](_0x35e74a['_clone'](!0x0),_0x22d810);for(const _0x3c1818 of _0x5c1077['operationsIsolated'])if('insert'===_0x3c1818['type']){const _0x13e23a=_0x3c1818;_0x13e23a['baseVersion']=null,_0x13e23a['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x13e23a,_0x22d810),_0x5c6f20['batch']['addOperation'](_0x3c1818),_0xb9c2fd['model']['applyOperation'](_0x3c1818);const _0x491268='suggestion:insertion:id:authorId:'+_0x15d71d++,_0x5084d7=_0xb9c2fd['model']['createRange'](_0x13e23a['position'],_0x13e23a['position']['getShiftedBy'](_0x13e23a['howMany']));_0x22d810['markers']['set'](_0x491268,_0x5084d7);}else{if('marker'===_0x3c1818['type']&&_0x3c1818['name']['startsWith']('$markedRemove')){const _0x54f5b5=_0x3c1818,_0x4b223f='suggestion:deletion:id:authorId:'+_0x15d71d++;this['_changeOperationOwnerDocument'](_0x54f5b5,_0x22d810),_0x22d810['markers']['set'](_0x4b223f,_0x54f5b5['newRange']);}}if(_0x3f630c)_0x56663a['push']({..._0x5c1077,'context':this['_createGetContentFn'](_0x102b03,_0xb9c2fd['data']),'content':this['_createGetContentFn'](_0x102b03,_0xb9c2fd['data'])});else{const _0x47eb0a=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5c1077['operationsIsolated'][0x0]),_0x22d810),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5c1077['operationsIsolated'][_0x5c1077['operationsIsolated']['length']-0x1]),_0x22d810),_0xb9c2fd);_0x22d810['markers']['set'](Kn+'suggestion-context',new _0x1445f3(_0x47eb0a['start'],_0x47eb0a['end'])),_0x56663a['push']({..._0x5c1077,'context':this['_createGetContextFn'](_0x22d810,_0xb9c2fd['data'],{'ellipsisBefore':_0x47eb0a['hasContentBefore'],'ellipsisAfter':_0x47eb0a['hasContentAfter']}),'content':this['_createGetContentFn'](_0x22d810,_0xb9c2fd['data'])});}}}),_0x56663a;}['markChangePositionInEditorContent'](_0x56d91e,_0x3dba08){if(!_0x56d91e['length'])return;const _0x32d413=_0x56d91e[0x0]['parent']['id'],_0x14adb7=_0x3dba08['elements']['get'](_0x32d413);if(!_0x14adb7)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x32d413);const _0x27e2b4=_0x14adb7['path'],_0x4af0ba=_0x14adb7['editor'],_0x2b527b=_0x4af0ba['model']['document']['getRoot'](_0x14adb7['rootName']);if(!_0x2b527b)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x14adb7['rootName']);const _0x6da33f=_0x4af0ba['model']['document']['history']['getOperations'](_0x14adb7['documentVersion']),_0x136acf=[];for(const _0x408f0d of _0x56d91e){const _0x1c8be0=_0x408f0d['operationsIsolated']['map'](_0x5f228c=>this['_translateOperationToEditorContent'](_0x5f228c,_0x27e2b4,_0x2b527b));if(!_0x1c8be0||!_0x1c8be0['length'])continue;const _0xf50451=_0x1c8be0['every'](_0x1a9fd3=>'marker'===_0x1a9fd3['type']&&_0x1a9fd3['name']['startsWith']('$markedRemove')),_0x52cab6={'document':_0x4af0ba['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x19cb12=_0x27476f(_0x1c8be0,_0x6da33f,_0x52cab6)['operationsA'];for(const _0xbfefa5 of _0x19cb12)if('insert'===_0xbfefa5['type']){const _0x21dfe3=_0xbfefa5,_0x43a07f=_0x21dfe3['nodes'];_0x4af0ba['model']['change'](_0x3a539a=>{const _0x11a557=_0x3a539a['createDocumentFragment']();for(const _0x7c3724 of _0x43a07f)_0x3a539a['append'](_0x7c3724['_clone'](!0x0),_0x11a557);_0x136acf['push']({'start':_0x21dfe3['position'],'end':_0x21dfe3['position'],'type':'insert','groupId':_0x408f0d['id'],'content':{'asString':this['_createGetContentFn'](_0x11a557,_0x4af0ba['data'])(),'asFragment':_0x11a557}});});}else{if('marker'===_0xbfefa5['type']&&_0xbfefa5['name']['startsWith']('$markedRemove')){const _0x49ac45=_0xbfefa5;let _0x4e648e='remove-text';if(_0xf50451){const _0x4fa6d2=this['_findAdjacentContextDistance'](_0x49ac45['newRange']['start'],'backward',_0x4af0ba['model']['schema']),_0x3a5782=this['_findAdjacentContextDistance'](_0x49ac45['newRange']['end'],'forward',_0x4af0ba['model']['schema']);if(_0x4fa6d2||_0x3a5782){const _0x326e1b=_0x49ac45['newRange']['start']['getShiftedBy'](-_0x4fa6d2),_0x291b13=_0x49ac45['newRange']['end']['getShiftedBy'](_0x3a5782);_0x136acf['push']({'start':_0x326e1b,'end':_0x291b13,'groupId':_0x408f0d['id'],'type':'remove-context'});}else _0x4e648e='remove-only';}_0x136acf['push']({'start':_0x49ac45['newRange']['start'],'end':_0x49ac45['newRange']['end'],'groupId':_0x408f0d['id'],'type':_0x4e648e});}}}this['_insertMarkers'](_0x136acf,_0x4af0ba);}['clearAllMarkers'](){const _0x266418=new Map();for(const _0x204429 of this['_markers']['keys']()){const _0x10d0d5=this['_markers']['get'](_0x204429);_0x10d0d5?.['editor']&&(_0x266418['has'](_0x10d0d5['editor'])||_0x266418['set'](_0x10d0d5['editor'],[]),_0x266418['get'](_0x10d0d5['editor'])['push'](_0x204429));}for(const [_0x35231f,_0x32c695]of _0x266418)_0x35231f['model']['change'](_0x32537a=>{for(const _0x36062c of _0x32c695)_0x35231f['model']['markers']['get'](_0x36062c)&&_0x32537a['removeMarker'](_0x36062c);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x11f546 of ls(this['context']))_0x11f546['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x13b50c of ls(this['context']))_0x13b50c['disableReadOnlyMode']('ai-review');}['applyChange'](_0xc095fb){const _0x5d5419=_0xc095fb['map'](_0x4209cd=>this['_getMarkersDataForGroup'](_0x4209cd))['flat'](),_0x542e36=new Map();for(const _0x577834 of _0x5d5419)_0x542e36['has'](_0x577834['editor'])||_0x542e36['set'](_0x577834['editor'],[]),_0x542e36['get'](_0x577834['editor'])['push'](_0x577834);for(const [_0x16ac6c,_0x2f0de5]of _0x542e36){const _0x329551=_0x16ac6c['model'];_0x329551['change'](_0xf16ea5=>{for(const _0x193995 of _0x2f0de5){const _0x2ead8c=_0x16ac6c['model']['markers']['get'](_0x193995['id']);if(_0x2ead8c){if('insert'===_0x193995['type']){if(!_0x193995['content'])continue;_0x329551['insertContent'](_0x193995['content']['asFragment']||null,_0x2ead8c['getRange']()['start']);}else'remove-text'!==_0x193995['type']&&'remove-only'!==_0x193995['type']||_0x329551['deleteContent'](_0x329551['createSelection'](_0x2ead8c['getRange']()));_0xf16ea5['removeMarker'](_0x193995['id']),this['_markers']['delete'](_0x193995['id']);}}});}}['rejectChange'](_0x191f14){const _0x179dc2=this['_getMarkersDataForGroup'](_0x191f14),_0x2d4dcf=new Map();for(const _0x575516 of _0x179dc2)_0x2d4dcf['has'](_0x575516['editor'])||_0x2d4dcf['set'](_0x575516['editor'],[]),_0x2d4dcf['get'](_0x575516['editor'])['push'](_0x575516);for(const [_0x2937a6,_0x2f424d]of _0x2d4dcf)_0x2937a6['model']['change'](_0x260fa5=>{for(const _0x379f36 of _0x2f424d)_0x260fa5['removeMarker'](_0x379f36['id']),this['_markers']['delete'](_0x379f36['id']);});}['getEditor'](){return ds(this['context']);}['getEditors'](){return ls(this['context']);}['getEditorForChange'](_0x576c73){const _0x25d419=this['_getMarkersDataForGroup'](_0x576c73);return _0x25d419[0x0]?.['editor'];}['getMarkerElementForChange'](_0x5791a6){const _0x47c70f=Array['from'](this['_markers']['values']())['filter'](_0x19f50e=>_0x19f50e['groupId']===_0x5791a6);if(!_0x47c70f['length'])return null;const _0x58fa30=0x1===_0x47c70f['length']?_0x47c70f[0x0]:this['_sortMarkers'](_0x47c70f)[0x0],_0xf0abf7=_0x58fa30['editor']['model']['markers']['get'](_0x58fa30['id']);if(!_0xf0abf7)return null;return{'modelRange':_0xf0abf7['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x58fa30['id'])};}['getContentElementForChange'](_0x2fe5f3){const _0x34451b=Array['from'](this['_markers']['values']())['filter'](_0x1e96d1=>_0x1e96d1['groupId']===_0x2fe5f3);if(!_0x34451b['length'])return null;const _0x1227e4=0x1===_0x34451b['length']?_0x34451b[0x0]:this['_sortMarkers'](_0x34451b)[0x0],_0xab70b5=_0x1227e4['editor'],_0x4d5ff1=_0xab70b5['model']['markers']['get'](_0x1227e4['id']);if(!_0x4d5ff1)return null;const _0x11c468=_0x4d5ff1['getRange'](),_0x5794bc=_0xab70b5['editing']['view']['getDomRoot'](_0x11c468['root']['rootName'])||_0xab70b5['editing']['view']['getDomRoot']();if(!_0x5794bc||!_0x11c468)return null;let _0x266818=_0x11c468['start']['parent'];for(;_0x266818['parent']&&'$root'!==_0x266818['parent']['name'];)_0x266818=_0x266818['parent'];if(!_0x266818||!_0x266818['name'])return null;const _0x4834c1=_0x5794bc['querySelector']('[data-marker-id=\x22'+_0x1227e4['id']+'\x22]');if(!_0x4834c1)return null;let _0x53e006=null;_0xab70b5['model']['change'](_0x43e4d2=>{_0x53e006=_0x43e4d2['createDocumentFragment'](),_0x43e4d2['append'](_0x266818['_clone'](!0x0),_0x53e006);});const _0x49af2a=_0xab70b5['data']['toView'](_0x53e006)['getChild'](0x0);return _0x4834c1['closest'](_0x49af2a['name']);}['reactivateMarkers'](_0x4b7d45){const _0x39531c=this['_getMarkersDataForGroup'](_0x4b7d45);if(!_0x39531c['length'])return;const _0x2015dd=Array['from'](this['_activeMarkers'])['sort'](),_0x141030=Array['from'](new Set(_0x39531c['map'](_0x543b4e=>_0x543b4e['id'])))['sort']();_0x2015dd['join']('|')!==_0x141030['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4b7d45));}['setMarkersInElementAsActive'](_0x14b7eb){const _0x13815d=this['_getMarkersDataForGroup'](_0x14b7eb);if(!_0x13815d['length'])return;const _0x35b8b8=_0x13815d[0x0]['editor'],_0x2accac=new Set(_0x13815d['map'](_0x3baca0=>_0x3baca0['id'])),_0x3381c6=Array['from'](_0x2accac['values']())['map'](_0x139f4e=>_0x35b8b8['model']['markers']['get'](_0x139f4e))['filter'](_0x41c65f=>!!_0x41c65f);_0x2accac['forEach'](_0x1bc47b=>{this['_activeMarkers']['add'](_0x1bc47b);}),_0x35b8b8['model']['change'](()=>{_0x3381c6['forEach'](_0x44f8e5=>{_0x35b8b8['editing']['reconvertMarker'](_0x44f8e5);});});}['setAllMarkersAsInactive'](){const _0x3b49c8=Array['from'](this['_activeMarkers']);if(!_0x3b49c8['length'])return;this['_activeMarkers']['clear']();const _0x349f2e=new Map();for(const _0x276d4b of _0x3b49c8){const _0x2345ed=this['_markers']['get'](_0x276d4b);if(!_0x2345ed)continue;const _0x5838f3=_0x2345ed['editor'],_0x4ba6fa=_0x5838f3['model']['markers']['get'](_0x276d4b);_0x4ba6fa&&(_0x349f2e['has'](_0x5838f3)||_0x349f2e['set'](_0x5838f3,[]),_0x349f2e['get'](_0x5838f3)['push'](_0x4ba6fa));}for(const [_0x3ec137,_0x29ebfb]of _0x349f2e)_0x3ec137['model']['change'](()=>{_0x29ebfb['forEach'](_0x4619cd=>{_0x3ec137['editing']['reconvertMarker'](_0x4619cd);});});}['_getPositionLimitingRange'](_0x55011e,_0x2f30d5,_0x593dfd='outside'){if(!_0x55011e)return null;let _0x453956=_0x55011e['parent'];for(;_0x453956&&_0x453956['parent']&&'$root'!==_0x453956['parent']['name']&&!_0x2f30d5['model']['schema']['isLimit'](_0x453956)&&!_0x2f30d5['model']['schema']['isBlock'](_0x453956);)_0x453956=_0x453956['parent'];if(!_0x453956||!_0x453956['name']||'$root'===_0x453956['name'])return null;let _0x14eb04=null;return _0x2f30d5['model']['change'](_0x451361=>{_0x14eb04='inside'===_0x593dfd?_0x451361['createRangeIn'](_0x453956):_0x451361['createRangeOn'](_0x453956);}),_0x14eb04;}['_validateMarkers'](_0x23b755,_0x2df971){const _0x416f3b=Array['from'](this['_markers']['keys']()),_0x1591b3=new Map();for(const _0x2452ce of _0x416f3b){const _0x1d0b6a=_0x23b755['model']['markers']['get'](_0x2452ce);if(!_0x1d0b6a)continue;const _0x447d64=_0x1d0b6a['getStart']()['root']['rootName']+':'+_0x1d0b6a['getStart']()['path'][0x0];_0x1591b3['has'](_0x447d64)||_0x1591b3['set'](_0x447d64,[]),_0x1591b3['get'](_0x447d64)['push'](_0x1d0b6a);}const _0x4950f5=new Set();for(const _0x54588a of _0x23b755['model']['document']['differ']['getChanges']()){let _0x448543='',_0x3fe320=null;if('insert'===_0x54588a['type'])_0x3fe320=new _0x1445f3(_0x54588a['position'],_0x54588a['position']['getShiftedBy'](_0x54588a['length'])),_0x448543=_0x54588a['position']['root']['rootName']+':'+_0x54588a['position']['path'][0x0];else{if('remove'!==_0x54588a['type'])continue;_0x3fe320=new _0x1445f3(_0x54588a['position']),_0x448543=_0x54588a['position']['root']['rootName']+':'+_0x54588a['position']['path'][0x0];}const _0x494545=_0x1591b3['get'](_0x448543)||[];if(_0x494545['length']){for(const _0x4f0e1f of _0x494545)if(_0x3fe320['root']['rootName']===_0x4f0e1f['getRange']()['root']['rootName']&&('insert'!==_0x54588a['type']||!_0x3fe320['containsRange'](_0x4f0e1f['getRange']()))&&(_0x3fe320['isIntersecting'](_0x4f0e1f['getRange']())||_0x3fe320['start']['isTouching'](_0x4f0e1f['getRange']()['end'])||_0x3fe320['end']['isTouching'](_0x4f0e1f['getRange']()['start']))){const _0x51c85a=this['_parseMarkerName'](_0x4f0e1f['name']);Array['from'](this['_markers']['values']())['filter'](_0x8988f9=>_0x8988f9['groupId']===_0x51c85a['groupId'])['forEach'](_0x33df6c=>_0x4950f5['add'](_0x33df6c['id']));}}}if(_0x4950f5['size']){for(const _0xacbb1b of _0x4950f5)_0x2df971['removeMarker'](_0xacbb1b);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x362c7a){for(const {name:_0x25e787,data:_0x5c5961}of _0x362c7a['model']['document']['differ']['getChangedMarkers']()){if(!_0x25e787['startsWith'](Kn))continue;const _0x197c47=_0x5c5961['oldRange'],_0x4e4b99=_0x5c5961['newRange'],_0x253fb4=_0x197c47&&'$graveyard'===_0x197c47['root']['rootName'],_0x48a8c2=_0x4e4b99&&'$graveyard'===_0x4e4b99['root']['rootName'];if(_0x253fb4&&_0x48a8c2)continue;const _0x25d16f=this['_parseMarkerName'](_0x25e787);this['_markers']['get'](_0x25e787)&&(_0x48a8c2||!_0x4e4b99?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x25e787,'changeId':_0x25d16f['groupId']}):_0x253fb4&&_0x4e4b99&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x25e787,'changeId':_0x25d16f['groupId']}));}}['_parseMarkerName'](_0x53fa70){const _0x1a9e61=_0x53fa70['split'](':'),_0x414200=(_0x1a9e61[0x1]||'')['split']('_');return{'prefix':_0x1a9e61[0x0],'groupId':_0x414200[0x0],'suffix':_0x414200[0x1]};}['_translateOperationToEditorContent'](_0x301c10,_0xc30c80,_0x393822){if('insert'===_0x301c10['type']){const _0x7c78b=_0x301c10;return new _0x129783(this['_changePosition'](_0xc30c80['concat'](_0x7c78b['position']['offset']),_0x393822),_0x7c78b['nodes'],_0x7c78b['baseVersion']);}if('marker'===_0x301c10['type']&&_0x301c10['name']['startsWith']('$markedRemove')){const _0x37f26e=_0x301c10;return new _0x147dae(_0x37f26e['name'],_0x37f26e['oldRange'],this['_changeRange'](_0x37f26e['newRange'],_0xc30c80['concat'](_0x37f26e['newRange']['start']['offset']),_0xc30c80['concat'](_0x37f26e['newRange']['end']['offset']),_0x393822),_0x37f26e['_markers'],_0x37f26e['affectsData'],_0x37f26e['baseVersion']);}return _0x301c10;}['_groupAdjacentOperations'](_0xeada83){if(!_0xeada83['length'])return[];const _0x57da89=[];let _0x5e9be9=0x0,_0x878815=0x0,_0x5d7028=[];for(let _0x19432c=0x0;_0x19432c<=_0xeada83['length'];_0x19432c++){const _0x2f2c43=_0xeada83[_0x19432c],_0x2cdf8f=_0xeada83[_0x19432c-0x1];!_0x2f2c43||_0x2cdf8f&&!this['_getOperationEnd'](_0x2cdf8f)['isTouching'](this['_getOperationStart'](_0x2f2c43))?(_0x57da89['push']({'operations':_0x5d7028,'operationsIsolated':_0x5d7028['map'](_0x1030d0=>this['_shiftOperation'](_0x1030d0['clone'](),-_0x878815)),'groupOffset':_0x5e9be9}),_0x5d7028=_0x2f2c43?[_0x2f2c43]:[],_0x878815+=_0x5e9be9,_0x5e9be9=0x0):_0x5d7028['push'](_0x2f2c43),_0x2f2c43&&'insert'===_0x2f2c43['type']&&(_0x5e9be9+=_0x2f2c43['howMany']);}return _0x57da89;}['_findAdjacentContextDistance'](_0x4df32a,_0x23bd9e,_0x992e5c,_0x12dd31=0x1){const _0x4bf6bd=new _0x46a368({'startPosition':_0x4df32a,'direction':_0x23bd9e});let _0x3289bc=0x0;for(let _0x3eaa79=0x0;_0x3eaa79<_0x12dd31;_0x3eaa79++){let _0x140bab=0x0,_0x43a7b7=!0x1,_0x3acd76='forward'===_0x23bd9e?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3a3659}of _0x4bf6bd)if(_0x3a3659['is']('$textProxy')){const _0x287334=_0x3acd76['exec'](_0x3a3659['data']);if(_0x287334&&_0x287334['length']){if(_0x140bab+='forward'===_0x23bd9e?_0x287334['index']+_0x287334[0x0]['length']:_0x3a3659['data']['length']-_0x287334['index'],_0x287334[0x0]['length']!==_0x3a3659['data']['length'])break;_0x43a7b7=!0x0,_0x3acd76='forward'===_0x23bd9e?/^\w+/:/\w+$/;}else{if(_0x43a7b7)break;_0x140bab+=_0x3a3659['offsetSize'];}}else{if(_0x3a3659['is']('element')){_0x992e5c['isInline'](_0x3a3659)&&!_0x43a7b7&&(_0x140bab+=0x1);break;}}_0x3289bc+=_0x140bab,_0x4bf6bd['jumpTo'](_0x4df32a['getShiftedBy']('forward'===_0x23bd9e?_0x3289bc:-_0x3289bc));}return _0x3289bc;}['_getChangeContext'](_0x2dd8be,_0x21f195,_0x47ba5b){const _0x22e590=_0x47ba5b['model']['schema'],_0x37c79b=this['_findAdjacentContextDistance'](_0x2dd8be,'backward',_0x22e590,0x6),_0x944789=this['_findAdjacentContextDistance'](_0x21f195,'forward',_0x22e590,0x6),_0x2a54ac=_0x2dd8be['getShiftedBy'](-_0x37c79b),_0x3c04b7=_0x21f195['getShiftedBy'](_0x944789);return{'start':_0x2a54ac,'end':_0x3c04b7,'hasContentBefore':!_0x2a54ac['isAtStart'],'hasContentAfter':!_0x3c04b7['isAtEnd']};}['_insertMarkers'](_0x4c7f79,_0x3730e6){const _0x3010cb=this['context']['plugins']['get']('AIEditing'),_0x1d18ca=new Set();_0x3730e6['model']['change'](_0x29e056=>{for(const _0xa9ba2c of _0x4c7f79){const _0x5afc51=''+Kn+_0xa9ba2c['type']+':'+_0xa9ba2c['groupId']+'_'+_0x3010cb['_nextDataId'](_0x1d18ca);this['_markers']['set'](_0x5afc51,{'id':_0x5afc51,'groupId':_0xa9ba2c['groupId'],'type':_0xa9ba2c['type'],'content':_0xa9ba2c['content'],'editor':_0x3730e6}),_0x29e056['addMarker'](_0x5afc51,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29e056['createRange'](_0xa9ba2c['start'],_0xa9ba2c['end'])});}});}['_createGetContextFn'](_0x12ff5d,_0x1d34ef,_0x2cd5d5){let _0x598eda='';return()=>{if(!_0x598eda){const _0x16a045=_0x1d34ef['toView'](_0x12ff5d,{'showSuggestionHighlights':!0x0});let _0x39cf86=_0x16a045['getChild'](0x0);if(_0x39cf86['is']('containerElement')||(_0x39cf86=_0x16a045),!_0x39cf86)return'';let _0x568ec1=!0x1;const _0x7284b7=[];for(const _0x11b990 of _0x39cf86['getChildren']())_0x11b990['is']('element','span')&&_0x11b990['hasClass']('ck-ai_review-marker_context-end')&&(_0x568ec1=!0x1),_0x568ec1&&_0x7284b7['push'](_0x11b990),_0x11b990['is']('element','span')&&_0x11b990['hasClass']('ck-ai_review-marker_context-start')&&(_0x568ec1=!0x0);_0x39cf86['_removeChildren'](0x0,_0x39cf86['childCount']),_0x2cd5d5?.['ellipsisBefore']&&_0x39cf86['_appendChild']('…'),_0x39cf86['_appendChild'](_0x7284b7),_0x2cd5d5?.['ellipsisAfter']&&_0x39cf86['_appendChild']('…');const _0x2e5b89=_0x1d34ef['htmlProcessor']['domConverter']['viewToDom'](_0x16a045),_0x5b091e=_0x1d34ef['htmlProcessor']['htmlWriter']['getHtml'](_0x2e5b89);_0x598eda=_0x5b091e;}return _0x598eda;};}['_createGetContentFn'](_0x1b5872,_0x33853a){let _0x552594='';return()=>(_0x552594||(_0x552594=_0x33853a['stringify'](_0x1b5872,{'showSuggestionHighlights':!0x0})),_0x552594);}['_createGetContentUsingDataIdFn'](_0x109bb7,_0x9f7c0e,_0x20fd50){let _0x326263='';return()=>{if(!_0x326263){const _0x4b085e=_0x20fd50['toView'](new _0xee8836(_0x109bb7)),_0x530736=_0x20fd50['htmlProcessor']['domConverter']['viewToDom'](_0x4b085e)['querySelector']('[data-id=\x22'+_0x9f7c0e+'\x22]');_0x326263=_0x530736?.['outerHTML']||'';}return _0x326263;};}['_findMarkerElement'](_0x24ede8,_0x2061a1=0x5){let _0x3782c6=_0x24ede8,_0x5e9366=null;for(let _0x81160c=0x0;_0x81160c<_0x2061a1&&_0x3782c6;_0x81160c++){if(!_0x3782c6['className']){_0x3782c6=_0x3782c6['parentElement'];continue;}if(!(''+_0x3782c6['className'])['includes']('ck-ai_review-marker_')){_0x3782c6=_0x3782c6['parentElement'];continue;}if(!_0x3782c6['getAttribute']('data-marker-id'))break;_0x5e9366=_0x3782c6;break;}return _0x5e9366;}['_findMarkerElementById'](_0x5b6d08){const _0x1775d8=this['_markers']['get'](_0x5b6d08),_0x392bce=_0x1775d8?.['editor']??ds(this['context']),_0x4eef91=_0x392bce['model']['markers']['get'](_0x5b6d08);return _0x4eef91?_0x1e5795(_0x392bce['editing'],_0x4eef91):null;}['_getMarkersDataForGroup'](_0x2233e7){return Array['from'](this['_markers']['values']())['filter'](_0x19006c=>_0x19006c['groupId']===_0x2233e7);}['_getOperationStart'](_0x562820){return'insert'===_0x562820['type']?_0x562820['position']:_0x562820['newRange']['start'];}['_getOperationEnd'](_0x49daf2,_0x3a8b13=!0x1){return'insert'===_0x49daf2['type']?_0x3a8b13?_0x49daf2['position']:_0x49daf2['position']['getShiftedBy'](_0x49daf2['howMany']):_0x49daf2['newRange']['end'];}['_shiftOperation'](_0x1494fc,_0x59e656){return'insert'===_0x1494fc['type']?_0x1494fc['position']=_0x1494fc['position']['getShiftedBy'](_0x59e656):'marker'===_0x1494fc['type']&&_0x1494fc['newRange']&&(_0x1494fc['newRange']=new _0x1445f3(_0x1494fc['newRange']['start']['getShiftedBy'](_0x59e656),_0x1494fc['newRange']['end']['getShiftedBy'](_0x59e656))),_0x1494fc;}['_changeOperationOwnerDocument'](_0x1ea808,_0x556bf2){'insert'===_0x1ea808['type']?_0x1ea808['position']=this['_changePositionOwnerDocument'](_0x1ea808['position'],_0x556bf2):'marker'===_0x1ea808['type']&&_0x1ea808['newRange']&&(_0x1ea808['newRange']=this['_changeRangeOwnerDocument'](_0x1ea808['newRange'],_0x556bf2));}['_changePositionOwnerDocument'](_0x147c46,_0x35b4b6){return new _0x3c2be3(_0x35b4b6,_0x147c46['path']);}['_changeRangeOwnerDocument'](_0x14bf4d,_0x1094f0){return new _0x1445f3(this['_changePositionOwnerDocument'](_0x14bf4d['start'],_0x1094f0),this['_changePositionOwnerDocument'](_0x14bf4d['end'],_0x1094f0));}['_changePosition'](_0x14856d,_0x3134f4){return new _0x3c2be3(_0x3134f4,[..._0x14856d]);}['_changeRange'](_0x465078,_0x161c92,_0x40ef13,_0x3f37a0){return new _0x1445f3(this['_changePosition'](_0x161c92,_0x3f37a0),this['_changePosition'](_0x40ef13,_0x3f37a0));}['_sortMarkers'](_0x48dd7c){const _0x1cd173=_0x59732f=>{switch(_0x59732f){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x48dd7c['sort']((_0x45395a,_0x148789)=>_0x1cd173(_0x45395a['type'])-_0x1cd173(_0x148789['type']));}['_hasSameTopLevelElement'](_0x24af52,_0x39d3f2){const _0x468176=_0x24af52['getChild'](0x0),_0xb59a14=_0x39d3f2['getChild'](0x0);return!(!_0x468176||!_0xb59a14)&&((!_0x468176['is']('element')||!_0xb59a14['is']('element')||_0x468176['name']===_0xb59a14['name'])&&!(_0x468176['is']('element')&&!_0xb59a14['is']('element')||!_0x468176['is']('element')&&_0xb59a14['is']('element')));}['_haveSingleTopLevelElement'](_0x5379b3){return 0x1===_0x5379b3['childCount'];}['_haveOnlyInlineContent'](_0x46e8d5,_0x535a18){for(const _0x14ec8e of _0x46e8d5['getChildren']())if(_0x14ec8e['is']('element')&&!_0x535a18['isInline'](_0x14ec8e))return!0x1;return!0x0;}['_upsertDataId'](_0x2de0d0,_0x2bc6c0){let _0xad42db=_0x2de0d0['getAttribute'](_0x4140c8);return _0xad42db||(_0xad42db=_0x2bc6c0(),_0x2de0d0['_setAttribute'](_0x4140c8,_0xad42db)),_0xad42db;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5d5821,contentNew:_0x4ffd1f,contentInitial:_0x41e1e6,documentVersion:_0x2d1258}){super(),this['id']=_0x5d5821,this['contentNew']=_0x4ffd1f,this['contentInitial']=_0x41e1e6,this['documentVersion']=_0x2d1258;}}class AIReviewCheckResultChange extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2d3708,_0x4d3c25,_0x34846c){super(),this['id']=_0x2d3708,this['parent']=_0x34846c,this['_data']=_0x4d3c25,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class AIReviewCheckRun extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x5b2293,_0x27ef11,_0x1918c4,_0x51936a,_0x5e064a){super(),this['_sourceCheck']=_0x27ef11,this['_documentData']=_0x5b2293,this['_aiConnector']=_0x1918c4,this['_reviewParams']=_0x51936a,this['_reviewArgs']=_0x5e064a,this['on']('change:status',(_0x34c77c,_0x1557b6,_0x53afae)=>{'aborted'==_0x53afae&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x53afae,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get['documentData'](){return this['_documentData'];}get['processedResultsCount'](){return this['_results']['size'];}get['title'](){return this['_sourceCheck']['title'];}get['subTitle'](){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get['hasModifications'](){return!this['_changes']['every'](_0x287a61=>'pending'===_0x287a61['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x493caf){this['_documentData']=_0x493caf;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xaa7e0b=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1df10c of _0xaa7e0b)'unmodified'!==_0x1df10c['data']['operation']&&('error'!==_0x1df10c['data']['operation']?'review-metadata'!==_0x1df10c['event']?this['_addReviewCheckResult'](_0x1df10c['data']['dataId'],_0x1df10c['data']['textDelta']):this['callId']=_0x1df10c['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x29d0ef){this['_currentError']=_0x29d0ef,_0x29d0ef instanceof Error&&_0x29d0ef['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'](_0x2c7e8c,_0x4afcb5){const _0x5a903e=this['_results']['get'](_0x2c7e8c);if(!_0x5a903e)return;if(0x0===_0x4afcb5['length'])return;const _0xca95e3=[];_0x4afcb5['forEach']((_0x39347c,_0xeac9cd)=>{const _0x37037f=new AIReviewCheckResultChange(_0x5a903e['id']+'-'+_0xeac9cd,_0x39347c,_0x5a903e);_0x37037f['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x37037f,'status':_0x37037f['status']});}),_0x37037f['on']('change:isActivated',()=>{_0x37037f['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x37037f}):this['fire']('reviewCheckResultDeactivated',{'change':_0x37037f});}),this['_changes']['push'](_0x37037f),_0xca95e3['push'](_0x37037f);}),this['fire']('reviewCheckResultReady',{'changes':_0xca95e3,'result':_0x5a903e,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x42da3d){const _0x4dae9d=this['_changes']['find'](_0x45a184=>_0x45a184['id']===_0x42da3d);return!(!_0x4dae9d||'pending'!==_0x4dae9d['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x2ad88f=>!0x0===_0x2ad88f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x364ffe=>'pending'===_0x364ffe['status']);}['getChangeById'](_0xdab352){return this['_changes']['find'](_0x36be8c=>_0x36be8c['id']===_0xdab352);}['markAllChangesAsAccepted'](){for(const _0x547a63 of this['_changes'])'pending'===_0x547a63['status']&&(_0x547a63['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x14ccbe){const _0x2cee04=this['_changes']['find'](_0x3025cd=>_0x3025cd['id']===_0x14ccbe);_0x2cee04&&'pending'===_0x2cee04['status']&&(_0x2cee04['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1940bf){const _0x13b6cd=this['_changes']['find'](_0x1a7252=>_0x1a7252['id']===_0x1940bf);_0x13b6cd&&'pending'===_0x13b6cd['status']&&(_0x13b6cd['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x45f19e){const _0x28aac3=this['_changes']['find'](_0x4fb47c=>_0x4fb47c['id']===_0x45f19e);_0x28aac3&&'pending'===_0x28aac3['status']&&(_0x28aac3['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3fbbb3){const _0x4630f8=this['_changes']['find'](_0x40c554=>_0x40c554['id']===_0x3fbbb3);_0x4630f8&&'outdated'===_0x4630f8['status']&&(_0x4630f8['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x149556){this['_changes']['filter'](_0x3ba350=>_0x3ba350['isActivated']&&_0x3ba350['id']!==_0x149556)['forEach'](_0x22cdb5=>{_0x22cdb5['isActivated']=!0x1;});const _0x3db267=this['_changes']['find'](_0x208e23=>_0x208e23['id']===_0x149556);_0x3db267&&'pending'===_0x3db267['status']&&(_0x3db267['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x352e81=>_0x352e81['isActivated'])['forEach'](_0x16a5ac=>{_0x16a5ac['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x54c548){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0xaf1be7;if(_0x54c548){const _0x3a8fd3=this['_changes']['find'](_0x33456c=>_0x33456c['id']===_0x54c548);if(_0x3a8fd3&&_0x3a8fd3['isRated'])return;_0x3a8fd3&&(_0xaf1be7=_0x3a8fd3['parent']['id'],_0x3a8fd3['isRated']=!0x0);}const _0x3d535a={'positiveCount':this['_changes']['filter'](_0x401c0b=>'accepted'===_0x401c0b['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3d535a,this['callId'],_0xaf1be7);}['_addReviewCheckResult'](_0x54c50b,_0x57d01c){const _0x1f14f6=this['_documentData']['elements']['get'](_0x54c50b);if(!_0x1f14f6)return;const _0x220c11=_0x1f14f6['getContent']();if(_0x220c11===_0x57d01c)return;const _0x323073=new AIReviewCheckResult({'id':_0x54c50b,'contentInitial':_0x220c11,'contentNew':_0x57d01c,'documentVersion':_0x1f14f6['documentVersion']});this['_results']['set'](_0x323073['id'],_0x323073),this['fire']('reviewCheckResultAdded',{'result':_0x323073,'source':this,'editor':_0x1f14f6['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x400ee6=>'pending'===_0x400ee6['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x5a87e0=>'pending'===_0x5a87e0['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x139db1=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x30c355=0x0;_0x30c355<this['_reviewParams']['length'];_0x30c355++){if(!this['_reviewParams'][_0x30c355]||!this['_sourceCheck']['options'][_0x30c355])continue;const _0x42827b=this['_sourceCheck']['options'][_0x30c355],_0x2d68a6=_0x42827b['data']?.['find'](_0x50a740=>_0x50a740['id']===this['_reviewParams'][_0x30c355]);_0x2d68a6&&_0x139db1['push'](_0x2d68a6['label']);}return _0x139db1['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2adb88,_0x1544d3,_0xc7e362){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x1544d3,_0x2adb88,_0xc7e362);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x23f270{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[AIConnector];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x29cd0e,_0x5a23d6)=>{const _0x14b4b5=this['_aiReviewCheckList']['getCheckById'](_0x5a23d6['id']);if(_0x14b4b5){this['_onReviewCheckRun'](_0x5a23d6),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5a23d6,_0x14b4b5),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x12f15e,_0x3b2846)=>{switch(_0x3b2846['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x3b2846);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new at('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new at('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x3b2846['status']&&'error-chunk'!==_0x3b2846['status']&&'error-general'!==_0x3b2846['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x46583c,_0x33464a)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x45bb81=this['_diffContent'](_0x33464a['editor'],_0x33464a['result']['contentInitial'],_0x33464a['result']['contentNew']);_0x33464a['source']['addResultChanges'](_0x33464a['result']['id'],_0x45bb81);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xd3fdf2,_0x2df2b6)=>{for(const _0xffba12 of _0x2df2b6['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xffba12);this['_markChangePositionInEditorContent'](_0x2df2b6['changes'],_0x2df2b6['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x422f02,_0x2c5c52)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x2c5c52['change']['id'],_0x2c5c52['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x59d9c0,_0x1f790e)=>{this['_onReviewCheckResultActivated'](_0x1f790e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x49142a){_0x49142a instanceof Error&&_0x49142a['message']['includes']('ai-request-aborted')||(_0x49142a instanceof at?this['_logError'](_0x49142a):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x49142a)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x5a23d6['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3a89f5=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3a89f5['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x3a89f5['map'](_0x5b6cc8=>_0x5b6cc8['id']));const _0x478dff=this['_currentReviewCheckRun'];_0x478dff['markAllChangesAsAccepted'](),_0x478dff['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1a2870,_0x4221c4)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4221c4['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4221c4['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4221c4['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4221c4['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x33efbd,_0x5481d7)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5481d7['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5481d7['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5481d7['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5481d7['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x51b56e,_0x1af9e7)=>{this['_onActivateChange'](_0x1af9e7);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3ecd0,_0x56e059)=>{this['_onDeactivateChange'](_0x56e059);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xb7b3a4,_0x429b03)=>{this['_onChangeMarkerClicked'](_0xb7b3a4,_0x429b03);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x24f417,_0x1f6cf0)=>{this['_onChangeMarkerHovered'](_0x24f417,_0x1f6cf0);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x406aaa,_0x3ef153)=>{this['_onChangeMarkerRemoved'](_0x406aaa,_0x3ef153);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5eb6ff,_0x54c4f8)=>{this['_onChangeMarkerRestored'](_0x5eb6ff,_0x54c4f8);});}['_createReviewCheckRun'](_0x3340a4,_0x5da09b){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5da09b,this['_aiConnector'],_0x3340a4['params'],_0x3340a4['args']);}['_onChangeMarkerRemoved'](_0x3c6003,_0x30d36f){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x30d36f['changeId']);}['_onChangeMarkerRestored'](_0x21cfd5,_0x406b10){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x406b10['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x227e4b=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x227e4b&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x1915c6 of this['_aiReviewCoreEditing']['getEditors']())_0x1915c6['editing']['view']['change'](_0x2a18e8=>{for(const _0x1187a8 of _0x1915c6['editing']['view']['document']['getRoots']())_0x2a18e8['removeClass']('ck-ai_review-diff',_0x1187a8),_0x2a18e8['removeClass']('ck-ai_review-highlights',_0x1187a8),_0x2a18e8['removeClass']('ck-ai-translate-mode-content',_0x1187a8);});}['_getTranslationWithDefault'](_0x4d74fe,_0x322fd8){const _0x4c2937=Hi(this['context']['locale'],_0x4d74fe);return _0x4c2937===_0x4d74fe?_0x322fd8:_0x4c2937;}['_logError'](_0x144ebb,_0x51bb3c=!0x1){Ct(_0x144ebb['message']),_0x51bb3c||(_0x144ebb['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x168c12){if('content'===this['_changeActivationSource']){const _0x4aff6f=this['_aiReviewCoreUi']['getChangeElement'](_0x168c12);_0x4aff6f&&ft(_0x4aff6f['closest']('.ck-ai_review__check-run-result')||_0x4aff6f);}else{if('panel'===this['_changeActivationSource']){const _0x2fee05=this['_getChangeContentElement'](_0x168c12);if(!_0x2fee05)return;wt({'target':_0x2fee05,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Yn=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x446d31){this['id']=_0x446d31['id'],this['commandId']=_0x446d31['commandId'],this['title']=_0x446d31['title'],this['description']=_0x446d31['description'],this['isParameterized']=_0x446d31['isParameterized'],this['useArgs']=_0x446d31['useArgs'],this['options']=_0x446d31['options'],this['args']=_0x446d31['args'];}}class AIReviewCheckList extends ht(){['_checks']=[];['setupChecks'](_0x785555){this['_checks']=_0x785555['map'](_0x423cb0=>new AIReviewCheck(_0x423cb0));}get['checks'](){return this['_checks'];}['getCheckById'](_0x4cf1f1){return this['checks']['find'](_0x493a36=>_0x493a36['id']===_0x4cf1f1);}['removeCheckById'](_0x20a256){this['_checks']=this['_checks']['filter'](_0x3a7fb5=>_0x3a7fb5['id']!==_0x20a256);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0xbd46d9,_0x2e3265,_0x4516e0){super(_0xbd46d9),this['_models']=_0x2e3265,this['_defaultModel']=_0x4516e0;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x40e2b0,_0xcb477b,_0x120d55){super(_0x40e2b0),this['prompt']=_0x40e2b0['prompt'],this['model']=_0x40e2b0['model'],this['model']?this['_defaultModel']=_0xcb477b['find'](_0x1a948d=>_0x1a948d['id']===this['model'])||null:this['_defaultModel']=_0x120d55;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x3b12ef,_0x283319,_0x4a65d2){super(),this['_allModels']=_0x3b12ef,this['_recommendedModels']=_0x283319,this['_defaultModel']=_0x4a65d2;}['setupChecks'](_0x10e6ac){this['_checks']=_0x10e6ac['map'](_0x3300e9=>!0x0===_0x3300e9['isExtra']?new AIReviewCheckExtra(_0x3300e9,this['_allModels'],this['_defaultModel']):'custom'===_0x3300e9['id']?new AIReviewCheckCustom(_0x3300e9,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x3300e9));}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0xf91911,_0x3246ef,_0x1ea23d,_0x2f8b90,_0x10ec05){super(_0x1ea23d,_0x2f8b90,_0x10ec05),this['_prompt']=_0xf91911,this['_model']=_0x3246ef;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x190032,_0x4408ad,_0x5352cf){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4408ad,_0x190032,_0x5352cf);}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x74dd98){this['_prompt']=_0x74dd98;}set['model'](_0x2724b4){this['_model']=_0x2724b4;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x294271){super(_0x294271),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Yn['map'](_0x5af8e0=>_0x5af8e0['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x4450b9,_0xfa0ecb)=>{this['_isDiffOn']=_0xfa0ecb['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x17053a,_0x521631){return _0x17053a['isCustom']?new AIReviewCustomCheckRun(_0x17053a['args']['prompt'],_0x17053a['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x521631,this['_aiConnector']):_0x521631['isExtra']?new AIReviewExtraCheckRun(_0x521631['prompt'],_0x521631['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x521631,this['_aiConnector']):new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x521631,this['_aiConnector'],_0x17053a['params'],_0x17053a['args']);}['_onReviewCheckResultActivated'](_0x2e92b1){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2e92b1['change']['id']),this['_scrollToChange'](_0x2e92b1['change']['id']);const _0x4c706c=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2e92b1['change']['id']);if(!_0x4c706c)return;const _0x107541=this['_aiReviewCoreEditing']['getEditorForChange'](_0x2e92b1['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2e92b1['change'],()=>_0x4c706c['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x107541,_0x4c706c['modelRange']['root']['rootName']),_0x107541?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2e92b1['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x14eeec){this['_currentReviewCheckRun']&&'click'===_0x14eeec['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x14eeec['id']));}['_onDeactivateChange'](_0x3795fe){this['_currentReviewCheckRun']&&'balloon'===_0x3795fe['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1cf85f,_0x16f4f7){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x16f4f7['changeId']);const _0x5b732b=this['_currentReviewCheckRun']['getChangeById'](_0x16f4f7['changeId']);if(!_0x5b732b)return;const _0x63d29=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x16f4f7['changeId']),_0x2fcbd3=this['_aiReviewCoreEditing']['getEditorForChange'](_0x16f4f7['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5b732b,_0x16f4f7['markerElement'],_0x16f4f7['domEvent'],'click',this['_getBalloonDomRoot'](_0x2fcbd3,_0x63d29?.['modelRange']['root']['rootName']),_0x2fcbd3?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x546a42,_0x1cede2){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3f9aec=this['_currentReviewCheckRun']['getChangeById'](_0x1cede2['changeId']);if(!_0x3f9aec)return;const _0x5ce6e8=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1cede2['changeId']),_0x301b09=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1cede2['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3f9aec,_0x1cede2['markerElement'],_0x1cede2['domEvent'],'hover',this['_getBalloonDomRoot'](_0x301b09,_0x5ce6e8?.['modelRange']['root']['rootName']),_0x301b09?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x1ca405){const _0x52237f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1ca405);return _0x52237f?_0x52237f['getElement']():null;}['_markChangePositionInEditorContent'](_0x378bd0,_0x225865){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x378bd0,_0x225865);}['_diffContent'](_0xf337f5,_0x4c0241,_0xf4df14){return this['_aiReviewCoreEditing']['diffContent'](_0xf337f5,_0x4c0241,_0xf4df14,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x2ece81){_0x2ece81?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x3d4c1a of this['_aiReviewCoreEditing']['getEditors']())_0x3d4c1a['editing']['view']['change'](_0x1b4b3a=>{for(const _0x4212b0 of _0x3d4c1a['editing']['view']['document']['getRoots']()){for(const _0x34ca35 of _0x4212b0['getClassNames']())_0x34ca35['startsWith']('ck-ai_review-')&&_0x1b4b3a['removeClass'](_0x34ca35,_0x4212b0);_0x1b4b3a['addClass'](_0x2ece81?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4212b0);}});}['_getBalloonDomRoot'](_0xf7f3a,_0x51d1ba){const _0x4d8ae4=_0xf7f3a['editing']['view'];if(_0x51d1ba){const _0x481ae9=_0x4d8ae4['getDomRoot'](_0x51d1ba);if(_0x481ae9)return _0x481ae9;}return _0x4d8ae4['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x9bea96=[...Yn,...this['_getExtraChecks']()],_0x57b875=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x57b875,_0x9bea96);let _0x58da03=_0x9bea96;this['_hasDefaultAvailableCommands']||(_0x58da03=_0x57b875['map'](_0x12bf67=>_0x9bea96['find'](_0xab7a8e=>_0xab7a8e['id']===_0x12bf67))['filter'](_0x44116b=>!!_0x44116b)),_0x58da03=_0x58da03['map'](_0x363e29=>_0x363e29['isExtra']?_0x363e29:this['_translateReviewCheck'](_0x363e29));const _0x18bc2e=_0x58da03['some'](_0x4ee66e=>_0x4ee66e['isExtra']||'custom'===_0x4ee66e['id']);let _0x238998=[],_0x43028d=[],_0x3cb7d9=null;if(_0x18bc2e){const _0x33986f=await this['_getModels']();_0x238998=_0x33986f['all'],_0x43028d=_0x33986f['recommended'],_0x3cb7d9=_0x33986f['default'];}const _0x579bce=new AIReviewModeCheckList(_0x238998,_0x43028d,_0x3cb7d9);return _0x579bce['setupChecks'](_0x58da03),_0x18bc2e&&this['_filterChecksWithMissingModel'](_0x579bce),_0x579bce;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x1d5173=>({'id':_0x1d5173['id'],'commandId':_0x1d5173['id'],'title':_0x1d5173['label'],'description':_0x1d5173['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x1d5173['prompt'],'model':_0x1d5173['model']}));}['_logErrorForNonExistentChecks'](_0x3ee5df,_0x3b9a19){const _0x42248e=_0x3ee5df['filter'](_0x11bc1b=>!_0x3b9a19['some'](_0x465271=>_0x465271['id']===_0x11bc1b));_0x42248e['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x42248e['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5b9c4e=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5b9c4e['getAll'](),'recommended':await _0x5b9c4e['getAvailableModels'](),'default':await _0x5b9c4e['getDefault']()};}catch(_0xcdc25){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0xcdc25)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x13915e){const _0x236e0e='AI_REVIEW_CHECK_'+_0x13915e['id']['toUpperCase']()['replaceAll']('-','_'),_0xb2a458={..._0x13915e,'title':this['_getTranslationWithDefault'](_0x236e0e+'_TITLE',_0x13915e['title']),'description':this['_getTranslationWithDefault'](_0x236e0e+'_DESCRIPTION',_0x13915e['description'])};return _0x13915e['options']&&(_0xb2a458['options']=_0x13915e['options']['map'](_0x118b8e=>({..._0x118b8e,'label':this['_getTranslationWithDefault'](_0x236e0e+'_OPTIONS_LABEL',_0x118b8e['label']||''),'data':_0x118b8e['data']?_0x118b8e['data']['map'](_0x3ec516=>({..._0x3ec516,'label':this['_getTranslationWithDefault'](_0x236e0e+'_OPTIONS_DATA_'+_0x3ec516['id']['toUpperCase'](),_0x3ec516['label'])})):void 0x0}))),_0xb2a458;}['_filterChecksWithMissingModel'](_0x291d13){const _0x216869=[];_0x291d13['checks']['forEach'](_0xd5061b=>{(_0xd5061b instanceof AIReviewCheckExtra&&!_0xd5061b['defaultModel']||_0xd5061b instanceof AIReviewCheckCustom&&!_0xd5061b['models']['length'])&&_0x216869['push'](_0xd5061b['id']);}),_0x216869['length']&&_0x216869['forEach'](_0x23c8f7=>{_0x291d13['removeCheckById'](_0x23c8f7),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x23c8f7}),!0x0);});}}class AIReviewMode extends _0x23f270{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0x3cde84){this['_checks']=_0x3cde84['map'](_0x42fd63=>new AITranslateCheck(_0x42fd63));}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x524e97,_0x5211df,_0x57b83b,_0x22c7e2,_0x5dc6f7,_0x108307){super(_0x524e97,_0x5211df,_0x57b83b,_0x5dc6f7,_0x108307),this['_title']=_0x22c7e2;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}constructor(_0x1d103e){super(_0x1d103e),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x358b9a,_0x320878){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x320878,this['_aiConnector'],Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x358b9a['params'],_0x358b9a['args']);}['_onReviewCheckResultActivated'](_0x44a472){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x44a472['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x44a472['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x15dbeb){this['_currentReviewCheckRun']&&('hover'===_0x15dbeb['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x15dbeb['id'])),'click'===_0x15dbeb['uiInteraction']&&this['_scrollToChange'](_0x15dbeb['id']));}['_onDeactivateChange'](_0x16892c){this['_currentReviewCheckRun']&&'panel'===_0x16892c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1351ac,_0x4d54a2){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4d54a2['changeId']),this['_scrollToChange'](_0x4d54a2['changeId']));}['_onChangeMarkerHovered'](_0xb7c6f3,_0x495596){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x495596['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x495596['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x5d8468){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x5d8468);}['_markChangePositionInEditorContent'](_0x1c9ad4,_0x28f1e2){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1c9ad4,_0x28f1e2);}['_diffContent'](_0x4fd0fe,_0x4d815b,_0x1a4b08){return this['_aiReviewCoreEditing']['diffContent'](_0x4fd0fe,_0x4d815b,_0x1a4b08,!0x0);}['_onReviewCheckRun'](){for(const _0x1ab74e of this['_aiReviewCoreEditing']['getEditors']())_0x1ab74e['editing']['view']['change'](_0x48a1e3=>{for(const _0x241bd6 of _0x1ab74e['editing']['view']['document']['getRoots']())_0x48a1e3['addClass']('ck-ai-translate-mode-content',_0x241bd6);});}async['_getChecksList'](){const _0x313174=[],_0xf14732=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x506828 of _0xf14732)_0x313174['push']({'title':_0x506828['label'],'id':_0x506828['id'],'commandId':_0x506828['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x506828['id']}});const _0x219c82=new AITranslateCheckList();return _0x219c82['setupChecks'](this['_translateChecks'](_0x313174)),_0x219c82;}['_translateChecks'](_0x3cbbf9){return _0x3cbbf9['map'](_0x2188cb=>{const _0x1f0f43='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x2188cb['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x2188cb,'title':this['_getTranslationWithDefault'](_0x1f0f43,_0x2188cb['title'])};});}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x7062e1,_0x203893){super(_0x7062e1,_0x203893),this['on']('set:isLoading',(_0x445591,_0x339065,_0x1ee1f7)=>{_0x1ee1f7&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x3b2cf7,_0x2eb352,_0x55675b)=>{_0x55675b&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x42f17a=super['_createAcceptAllButtonView']();return _0x42f17a['set']('label',Hi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x42f17a;}['_createExitReviewButtonView'](){const _0x29fe96=super['_createExitReviewButtonView']();return _0x29fe96['set']('label',Hi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x29fe96;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x2adc9d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x2adc9d['if']('isVisible','ck-hidden',_0x469a80=>!_0x469a80)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2adc9d['if']('isVisible','ck-hidden',_0x53e016=>!_0x53e016)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x69ec37=this['context']['plugins']['get']('AITabs'),_0x3b5a23=this['context']['locale'],_0x559ba8=new AIHeaderView(_0x3b5a23,{'label':Hi(_0x3b5a23,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4d8ff7,'class':'ck-ai-header_review-translate','showResizeButton':_0x69ec37['showResizeButton']});_0x559ba8['delegate']('resizeTabs')['to'](_0x69ec37),_0x559ba8['bind']('isMaximized')['to'](_0x69ec37['view'],'isMaximized',_0x5e3d2d=>_0x5e3d2d);const _0x2070f8=new AIReviewCoreView(_0x3b5a23,{'header':_0x559ba8,'list':new AITranslateCheckListView(_0x3b5a23),'results':new AITranslateCheckResultsView(_0x3b5a23,{'generalErrorText':Hi(_0x3b5a23,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x3b5a23,{'headerText':Hi(_0x3b5a23,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Hi(_0x3b5a23,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x3b5a23,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2070f8['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2070f8;}['registerTab'](){const _0xe659dd=this['context']['plugins']['get']('AITabs');_0xe659dd['view']['on']('activateTab',(_0x3760f7,{newTab:_0x293dc3,oldTab:_0x135738})=>{'translate'===_0x293dc3?this['fire']('getReviewCheckList'):'translate'===_0x135738&&this['fire']('leaveReview');}),_0xe659dd['view']['addTab']({'id':'translate','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4d8ff7,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x23f270{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Gi as createResizeButton,Di as getDefaultAICommands};
|
|
23
|
+
import{Command as _0x3f0a57,ContextPlugin as _0x4cd5fc,Editor as _0x553634,Plugin as _0x158c3f,rootAcceptsBlocks as _0x598751}from'@ckeditor/ckeditor5-core';import{IconAIAdjustLength as _0x435456,IconAIAskAI as _0x4745fe,IconAIChangeTone as _0x59af22,IconAIChat as _0x2024d5,IconAIChatCommands as _0x1e0a0c,IconAIContinueWriting as _0x21f936,IconAIGrammarCheck as _0x2315ac,IconAIHistory as _0x23e734,IconAIImproveWriting as _0x6ea41f,IconAIOther as _0xd0155a,IconAIQuickActions as _0x957fd2,IconAIReview as _0x2c00e7,IconAITranslate as _0x46b415,IconBoxWithCheck as _0x4e0bfc,IconBoxWithCross as _0x28a335,IconBoxWithMarker as _0x32dbd8,IconBrowseFiles as _0x43cd6e,IconBulb as _0x44fd08,IconCancel as _0x29be46,IconCheck as _0x42448e,IconChevronDown as _0xcedfde,IconChevronLeft as _0x33c89a,IconChevronRight as _0x4273a3,IconChevronUp as _0x6b5523,IconCopy as _0x21a060,IconDocument as _0x5e85dd,IconDocumentOutline as _0x1052b8,IconDropdownArrow as _0x4e5c52,IconError as _0x1797f9,IconEye as _0x508a5c,IconEyeCrossedOut as _0x41fd30,IconFileUpload as _0x105dd2,IconImage as _0x3c70a7,IconInfo as _0x14d28a,IconLink as _0x3bcbd8,IconLock as _0x61b11,IconLoupe as _0x432e10,IconMagicWand as _0x3e186b,IconMaximize as _0x1ab7e1,IconMinimize as _0x2a01f5,IconOutdated as _0x230d59,IconPaperClip as _0x4245d8,IconPencil as _0x4e1016,IconPin as _0x5ad74f,IconPlus as _0x293553,IconPreviousArrow as _0x9f5b9e,IconRefresh as _0x34fe5e,IconRemove as _0x173e6f,IconRevisionHistory as tt,IconRobotPencil as et,IconSelection as it,IconShowChangesOff as st,IconShowChangesOn as nt,IconStop as rt,IconStopCircle as ot,IconSubmit as at,IconThreeHorizontalDots as ht,IconThumbDown as ct,IconThumbUp as lt,IconWeb as ut}from'@ckeditor/ckeditor5-icons';import{CKEditorError as dt,Collection as _t,DomEmitterMixin as gt,EmitterMixin as It,EventInfo as At,FocusTracker as Et,KeystrokeHandler as pt,ObservableMixin as mt,Rect as Tt,ResizeObserver as wt,ShadowRootRegistry as Ct,_isMotionReduced as ft,containsNode as Rt,decodeLicenseKey as bt,findClosestScrollableAncestor as St,first as Ot,getActiveElement as vt,getConstrainedViewportRect as yt,getElementFromPoint as Nt,getLayoutParentElement as kt,getOverlayMountRoot as xt,getParentElement as Lt,getParentNode as Dt,getSelection as Pt,getShadowRoots as Mt,global as Vt,insertToPriorityArray as Ht,isFeatureBlockedByLicenseKey as Ut,isVisible as Bt,listenToShadowRoots as Gt,logError as Wt,logWarning as Ft,priorities as Kt,scrollAncestorsToShowTarget as $t,scrollViewportToShowTarget as Yt,toArray as qt,trustedHtml as Qt,uid as Xt,version as zt}from'@ckeditor/ckeditor5-utils';import{AutocompleteView as jt,BalloonPanelView as Jt,BalloonToolbar as Zt,ButtonLabelView as te,ButtonLabelWithHighlightView as _0x4bbfbe,ButtonView as _0x1a9216,Dialog as _0x3fa2e4,DialogViewPosition as _0x4abac9,DropdownMenuPanelPositioningFunctions as _0x592d61,FileDialogListItemButtonView as _0x193b34,FocusCycler as _0x17323b,FormHeaderView as _0x105865,FormRowView as _0x57ecc8,HighlightedTextView as _0x2d3d45,IconView as _0x5e3c18,InputTextView as _0x3a21ad,LabeledFieldView as _0x187ed8,ListItemButtonView as _0x4bbb4c,ListItemGroupView as _0x340eed,ListItemView as _0xf665cb,ListView as _0x4e6fd6,MenuBarMenuListItemButtonView as _0x410c15,MenuBarMenuListItemView as _0x5d5b51,MenuBarMenuListView as _0x1969ff,MenuBarMenuView as _0x5e7fd5,OverlayHost as _0x5c12c0,SearchTextView as _0x2750eb,SpinnerView as _0x407319,TabButtonView as _0x5207ba,TabPanelView as _0x224963,Template as _0x4e263f,TextareaView as _0x1e334c,ToolbarView as _0x20288e,UIModel as _0x13bdb1,View as _0x2df458,ViewCollection as _0x15c4c2,addListToDropdown as _0x34e876,addMenuToDropdown as _0x318cd1,clickOutsideHandler as _0x314252,createDropdown as _0x4c754a,createLabeledInputText as _0x31f20c,createLabeledTextarea as _0x3e1b5a,submitHandler as _0x32c7ed}from'@ckeditor/ckeditor5-ui';import{ClipboardMarkersUtils as _0x5aeead,ClipboardPipeline as _0x438fad}from'@ckeditor/ckeditor5-clipboard';import{AttributeOperation as _0x3d87a4,InsertOperation as _0x38210e,MarkerOperation as _0x2070bd,Matcher as _0x3c66f4,MergeOperation as _0xfcd33f,ModelDocumentFragment as _0x1f9306,ModelPosition as _0x265910,ModelRange as _0x3aaa22,ModelText as _0x55e0d0,ModelTreeWalker as _0x3d1b58,MoveOperation as _0x155687,RenameOperation as _0x127e1f,RootAttributeOperation as ti,RootOperation as _0x285c43,SplitOperation as _0xe7e0e0,ViewDataTransfer as _0x416400,ViewDocumentDomEventData as _0x594118,ViewDowncastWriter as _0x1cc48b,ViewUpcastWriter as _0x1617d1,_DetachOperation as _0x500e5d,_insertIntoModelNodeList as _0x53f0c6,_removeFromModelNodeList as _0x3922ec,transformOperationSets as _0x3e782f}from'@ckeditor/ckeditor5-engine';import{cloneDeep as _0x30d267,debounce as _0x2fd977,escape as _0x369484,escapeRegExp as _0x3df188,isElement as _0x106ca2,omit as _0x35ebf4,throttle as _0x467982,unescape as _0x2e6a78}from'es-toolkit/compat';import{createParser as _0x252d62}from'eventsource-parser';import{CloudServices as _0x1e4e62}from'@ckeditor/ckeditor5-cloud-services';import{parseDocument as _0x15b430}from'htmlparser2';import{append as _0x4fa086,appendChild as _0x4e05c7,find as _0x55659d,findAll as _0x457f76,findOne as _0x1b0303,getChildren as _0x4fdaaa,getParent as _0x294335,isComment as _0x1800e7,isTag as _0x58049c,prepend as _0x1e83fe,prependChild as _0x18efcf,removeElement as _0x15340f,replaceElement as _0x418ed2,textContent as _0x42359b}from'domutils';import _0x24a162 from'dom-serializer';import{Document as _0x47233a,Element as _0x3cf04b,NodeWithChildren as _0x2ba83d,Text as _0x3978f9,cloneNode as _0x950ff,isDocument as _0x2388bd,isText as _0x4f3ed2}from'domhandler';import{diffArrays as _0x3874b5}from'diff';import{ConfirmMixin as _0x15c985,PillView as _0x286f6b,SuggestionsConversion as _0x33c035,fixElementSuggestionRange as _0x236d37,getAllMarkersDomElementsSorted as _0x4337d7,getMarkerDomElement as _0x4e2022,hashObject as _0xab9059,isInvalidAttributeOperation as _0x3463ba,isPointerStillOver as _0x299f8c,reRootOperation as ts,splitSuggestionMarkerName as _0x3940d0}from'@ckeditor/ckeditor5-collaboration-core';import{MarkdownGfmMdToHtml as _0x329971,MarkdownGfmMdToHtmlDefaultPlugins as _0x229e08}from'@ckeditor/ckeditor5-markdown-gfm';import _0x100e8b from'rehype-sanitize';import _0x163546 from'morphdom';const os='_ungrouppedCommands';function as(_0x37b73b,_0x372318){const _0x3a08da=(0x0,_0x372318['t'])('Other');return _0x37b73b['length']?'groupId'in _0x37b73b[0x0]?_0x37b73b:[{'groupId':os,'groupLabel':_0x3a08da,'order':0x1/0x0,'commands':_0x37b73b}]:[{'groupId':os,'groupLabel':_0x3a08da,'order':0x1/0x0,'commands':[]}];}const hs=globalThis['DataTransfer'],cs='ai-ui';var ls=class extends _0x158c3f{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const {editor:_0x3fdc90}=this;_0x3fdc90['conversion']['for']('editingDowncast')['markerToHighlight']({'model':cs,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x3fdc90['conversion']['for']('editingDowncast')['markerToElement']({'model':cs,'view':(_0x146158,{writer:_0x5b1a9e})=>{if(!_0x146158['markerRange']['isCollapsed'])return null;const _0x21c802=_0x5b1a9e['createUIElement']('span');return _0x5b1a9e['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x21c802),_0x21c802;}});}afterInit(){this['_blockIfRemovedByLicenseKey'](),async function(_0x17343c){const _0x3e276e='nA7yurgOHbZvDplRkJscdICm86oPWx92f1qF0LaSX3NGwTMK4jVtYUBQi5zheE',_0x5ab890=0x79710,_0x111f6a={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0xf900da(_0x5dc9d9){const _0x49fa9e=new window['Promise'](_0x276559=>{_0x5dc9d9['once']('ready',_0x276559);}),_0x360ec9=window['Date']['now'](),_0x2c842d=_0x5dc9d9['config']['get']('licenseKey');async function _0x4e75f7(){let _0x3db1ac,_0x5e932a=null,_0x2f2d8f=null;try{return'GPL'==_0x2c842d?'NotAllowed':(_0x3db1ac=_0x2f353f(),_0x3db1ac?(_0x3db1ac['usageEndpoint']&&(_0x2f2d8f=_0x509a9e(_0x3db1ac['usageEndpoint'],_0x3db1ac['jti'])),await _0x2bcd7b()?_0x444b7e()?_0x257564()?'Expired':_0x46163f()?('evaluation'==_0x3db1ac['licenseType']&&(_0x5e932a=_0x2ee05f('EvaluationLimit')),await _0x1dc69b()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x257564(){const _0x7d2d2a=['evaluation','trial']['includes'](_0x3db1ac['licenseType'])?_0x360ec9/0x3e8:0xe10*_0x5ab890;return _0x3db1ac['exp']<_0x7d2d2a;}function _0x444b7e(){const _0x44f1c4=_0x3db1ac['features'];return!!_0x44f1c4&&(!!_0x44f1c4['includes']('*')||!!_0x44f1c4['includes']('AI'));}function _0x46163f(){const _0x1d91cc=_0x3db1ac['licensedHosts'];if(!_0x1d91cc||0x0==_0x1d91cc['length'])return!0x0;const {hostname:_0x4cd3f6}=new URL(window['location']['href']);if(_0x1d91cc['includes'](_0x4cd3f6))return!0x0;const _0xbed7ca=_0x4cd3f6['split']('.');return _0x1d91cc['filter'](_0x19f1ff=>_0x19f1ff['includes']('*'))['map'](_0x58bda3=>_0x58bda3['split']('.'))['filter'](_0x1a1f89=>_0x1a1f89['length']<=_0xbed7ca['length'])['map'](_0x27e6d5=>Array(_0xbed7ca['length']-_0x27e6d5['length'])['fill']('*'===_0x27e6d5[0x0]?'*':'')['concat'](_0x27e6d5))['some'](_0x49922d=>_0xbed7ca['every']((_0x2a46e2,_0x535f1e)=>_0x49922d[_0x535f1e]===_0x2a46e2||'*'===_0x49922d[_0x535f1e]));}function _0x1dc69b(){return _0x5e932a&&_0x2f2d8f?new window['Promise']((_0xbe078b,_0x52f415)=>{_0x5e932a['then'](_0xbe078b,_0x52f415),_0x2f2d8f['then'](_0x366e48=>{'Valid'!=_0x366e48&&_0xbe078b(_0x366e48);},_0x52f415);}):_0x5e932a||_0x2f2d8f||'Valid';}}function _0x509a9e(_0x39f7ff,_0x54b3f2){return new window['Promise'](_0x2c8bb2=>{if(_0x1b70a6())return _0x2c8bb2('Valid');_0x40f6d8(),_0x5dc9d9['decorate']('_sendUsageRequest');let _0x963eaf=!0x1;const _0x595347=Xt();function _0x215173(_0xbc351){return!!_0xbc351&&('object'==typeof _0xbc351||'function'==typeof _0xbc351)&&'function'==typeof _0xbc351['then']&&'function'==typeof _0xbc351['catch'];}function _0xee8e62(_0x2eb94e){_0x5c8fc4(_0x2eb94e)['then'](_0x29bad4=>_0x29bad4&&'ok'==_0x29bad4['status']?_0xfee174(_0x2c57d7(_0x595347+_0x54b3f2))!=_0x29bad4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x116aa8=>(_0x4f6b52(),_0x116aa8),()=>{const _0x573368=_0x495ce0();return null==_0x573368?(_0x4f6b52(),'Valid'):_0x360ec9-_0x573368>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2c8bb2)['catch'](()=>{_0x2c8bb2('UsageLimit');});const _0x13261e=0x36ee80;function _0x4f6b52(){const _0x427bd8='llct-'+_0xfee174(_0x2c57d7(_0x39f7ff)),_0xfb41fa=_0x3d8723(_0xfee174(window['Math']['ceil'](_0x360ec9/_0x13261e)));window['localStorage']['setItem'](_0x427bd8,_0xfb41fa);}function _0x495ce0(){const _0x4b1d7c='llct-'+_0xfee174(_0x2c57d7(_0x39f7ff)),_0x408a76=window['localStorage']['getItem'](_0x4b1d7c);return _0x408a76?window['parseInt'](_0x3d8723(_0x408a76),0x10)*_0x13261e:null;}function _0x5c8fc4(_0x11297e){return new window['Promise']((_0x2010d9,_0x57549d)=>{_0x11297e['then'](_0x2010d9,_0x57549d),window['setTimeout'](_0x57549d,0x1d4c0);});}}_0x5dc9d9['on']('_sendUsageRequest',(_0xb99de1,_0xe792bd)=>{if(_0xe792bd[0x0]!=_0x39f7ff)return _0x2c8bb2('UsageLimit');_0xe792bd[0x1]={..._0xe792bd[0x1],'requestId':_0x595347};},{'priority':'high'}),_0x5dc9d9['on']('_sendUsageRequest',_0x4491da=>{_0x215173(_0x4491da['return'])&&(_0x963eaf=!0x0,_0xee8e62(_0x4491da['return']));},{'priority':'low'}),_0x49fa9e['then'](()=>{_0x963eaf||_0x2c8bb2('UsageLimit');});});function _0x1b70a6(){return'auto'==_0x5dc9d9['editing']['view']['_overlayModeHint'];}function _0x40f6d8(){_0x5dc9d9['editing']['view']['_overlayModeHint']='auto';}}function _0x2ee05f(_0x448e00){const _0x232b40=[new window['Promise'](_0x38c2e1=>setTimeout(_0x38c2e1,0x93ecc)),_0x49fa9e['then'](()=>new window['Promise'](_0x31832f=>{let _0x2c29c4=0x0;_0x5dc9d9['model']['on']('applyOperation',(_0x12e1c8,_0x38e211)=>{_0x38e211[0x0]['isDocumentOperation']&&_0x2c29c4++,0x5e8==_0x2c29c4&&(_0x31832f(),_0x12e1c8['off']());});}))];return window['Promise']['race'](_0x232b40)['then'](()=>_0x448e00);}async function _0x50a84f(){await _0x49fa9e,_0x5dc9d9['model']['change']=_0x37b587,_0x5dc9d9['model']['enqueueChange']=_0x37b587,_0x5dc9d9['enableReadOnlyMode']('model');}function _0x29419a(_0x2e8355){const _0x2c2560=_0xc2d05c();_0x5dc9d9[_0x2c2560]='aiLicenseKey'+_0x2e8355,'Valid'!=_0x2e8355&&_0x50a84f();}function _0xc2d05c(){const _0x3f4635=window['String'](window['performance']['now']())['replace']('.','');let _0x30e2ae='n';for(let _0x3e7cfb=0x0;_0x3e7cfb<_0x3f4635['length'];_0x3e7cfb+=0x2){let _0x3628ed=window['parseInt'](_0x3f4635['substring'](_0x3e7cfb,_0x3e7cfb+0x2));_0x3628ed>=0x3e&&(_0x3628ed-=0x3e),_0x30e2ae+=_0x3e276e[_0x3628ed];}return _0x30e2ae;}function _0x2f353f(){const _0x26cfdc=_0x2c842d['split']('.');if(0x3!=_0x26cfdc['length'])return null;return _0x2e2624(_0x26cfdc[0x1]);function _0x2e2624(_0x4a1404){const _0x45edac=_0x3b260c(_0x4a1404);return _0x45edac&&_0x559cf0()?_0x45edac:null;function _0x559cf0(){const _0x547f91=_0x45edac['jti'],_0x26bc54=window['parseInt'](_0x547f91['substring'](_0x547f91['length']-0x8),0x10),_0x10c5be={..._0x45edac,'jti':_0x547f91['substring'](0x0,_0x547f91['length']-0x8)};return delete _0x10c5be['vc'],_0x2c57d7(_0x10c5be)==_0x26bc54;}}}async function _0x2bcd7b(){let _0xb5a00d=!0x0;try{const [_0x3a78c1,_0x35af3c,_0x2d106b]=_0x2c842d['split']('.');return _0x5b2aeb(_0x3a78c1),await _0xbda98c(_0x3a78c1,_0x35af3c,_0x2d106b),_0xb5a00d;}catch{return!0x1;}function _0x5b2aeb(_0x5ae1e9){const _0x3f07a9=_0x3b260c(_0x5ae1e9);_0x3f07a9&&'ES256'==_0x3f07a9['alg']||(_0xb5a00d=!0x1);}async function _0xbda98c(_0x1b7045,_0x327ce2,_0x418bda){const _0x8367dd=window['Uint8Array']['from'](_0x46438b(_0x418bda),_0x5940bd=>_0x5940bd['charCodeAt'](0x0)),_0x421acf=new window['TextEncoder']()['encode'](_0x1b7045+'.'+_0x327ce2),_0x4a2d7f=window['crypto']['subtle'];if(!_0x4a2d7f)return;const _0x819f74=await _0x4a2d7f['importKey']('jwk',_0x111f6a,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4a2d7f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x819f74,_0x8367dd,_0x421acf)||(_0xb5a00d=!0x1);}}function _0x3b260c(_0x4be376){return _0x4be376['startsWith']('ey')?JSON['parse'](_0x46438b(_0x4be376)):null;}function _0x46438b(_0x11d621){return window['atob'](_0x11d621['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2c57d7(_0x214ac1){let _0xc8ab5=0x1505;function _0x5e9a9c(_0x92ae5b){for(let _0x1dd925=0x0;_0x1dd925<_0x92ae5b['length'];_0x1dd925++){const _0x5a8f91=_0x92ae5b['charCodeAt'](_0x1dd925);_0xc8ab5=(_0xc8ab5<<0x5)+_0xc8ab5+_0x5a8f91,_0xc8ab5&=_0xc8ab5;}}function _0x16f422(_0x58f474){Array['isArray'](_0x58f474)?_0x58f474['forEach'](_0x16f422):_0x58f474&&'object'==typeof _0x58f474?Object['entries'](_0x58f474)['sort']()['forEach'](([_0x4c54d0,_0x21c304])=>{_0x5e9a9c(_0x4c54d0),_0x16f422(_0x21c304);}):_0x5e9a9c(window['String'](_0x58f474));}return _0x16f422(_0x214ac1),_0xc8ab5>>>0x0;}function _0xfee174(_0x2f1de1){return _0x2f1de1['toString'](0x10)['padStart'](0x8,'0');}function _0x3d8723(_0x396178){return _0x396178['split']('')['reverse']()['join']('');}function _0x37b587(){}_0x29419a(await _0x4e75f7());}_0xf900da(_0x17343c['editor']);}(this);}['_blockIfRemovedByLicenseKey'](){const _0x59b6fd=this['editor'],_0x12c1bc=bt(_0x59b6fd['config']['get']('licenseKey'));_0x12c1bc&&Ut(_0x12c1bc,'AI')&&(_0x59b6fd['enableReadOnlyMode'](Symbol('invalidLicense')),_0x59b6fd['_showLicenseError']('featureNotAllowed','AIAssistant'));}showFakeVisualSelection(){const _0xd222d=this['editor']['model'];_0xd222d['change'](_0x2dbad8=>{const _0x103863=_0xd222d['document']['selection']['getRanges']();let _0x48c489=0x0;for(const _0x5ca77f of _0x103863){const _0x43e75e=cs+':'+_0x48c489;if(_0xd222d['markers']['has'](_0x43e75e))_0x2dbad8['updateMarker'](_0x43e75e,{'range':_0x5ca77f});else{if(_0x5ca77f['start']['isAtEnd']){const _0x1a9e30=_0x5ca77f['start']['getLastMatchingPosition'](({item:_0x3aab72})=>!_0xd222d['schema']['isContent'](_0x3aab72),{'boundaries':_0x5ca77f});_0x2dbad8['addMarker'](_0x43e75e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2dbad8['createRange'](_0x1a9e30,_0x5ca77f['end'])});}else _0x2dbad8['addMarker'](_0x43e75e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5ca77f});}_0x48c489++;}});}hideFakeVisualSelection(){const _0x398e0d=this['editor']['model'],_0x33c876=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](cs));_0x33c876['length']&&_0x398e0d['change'](_0xd6310b=>{_0x33c876['forEach'](_0x6781f0=>{_0xd6310b['removeMarker'](_0x6781f0);});});}insertContent(_0x20295d,_0x17c478){const _0x580a49=this['_getAISelection'](),_0x634de2=_0x17c478||_0x580a49['getFirstRange']();this['editor']['model']['canEditAt'](_0x634de2)&&this['editor']['model']['change'](_0x51f901=>{this['hideFakeVisualSelection'](),_0x17c478||this['_resetContentOfSelectedTableCells'](_0x51f901,_0x580a49),this['_pasteHTMLUsingClipboard']({'insertAt':_0x634de2,'writer':_0x51f901,'html':_0x20295d});});}insertContentBelow(_0x539649){const {model:_0x111b5e}=this['editor'],_0x51fec1=this['_getAISelection']();_0x111b5e['change'](()=>{const _0x30b929=this['_prepareTableInsertBelowPosition'](_0x539649,_0x51fec1)||this['_getDefaultInsertBelowPosition'](_0x51fec1);this['insertContent'](_0x539649,_0x30b929);});}_getAISelection(){const _0x4c399a=this['editor']['model'],_0x3029d4=Array['from'](_0x4c399a['markers']['getMarkersGroup'](cs))['map'](_0x9586ca=>_0x9586ca['getRange']());return _0x4c399a['createSelection'](_0x3029d4);}_pasteHTMLUsingClipboard({writer:_0x202fd5,html:_0x4aa633,insertAt:_0x18524c}){const {view:_0x7c2a7f}=this['editor']['editing'],_0x38c046=this['editor']['plugins']['get'](_0x438fad),_0xe4ba8a=new hs();_0xe4ba8a['setData']('text/html',_0x4aa633);const _0x3abc82=new ClipboardEvent('paste',{'clipboardData':_0xe4ba8a}),_0x3c0680=new _0x594118(_0x7c2a7f,_0x3abc82,{'dataTransfer':new _0x416400(_0xe4ba8a)});_0x202fd5['setSelection'](_0x18524c);const _0x12ea5b=(_0x1af68c,_0x10faf4)=>{_0x10faf4['resultRange']&&_0x202fd5['setSelection'](_0x10faf4['resultRange']);};_0x38c046['once']('contentInsertion',_0x12ea5b,{'priority':'lowest'}),_0x7c2a7f['document']['fire']('paste',_0x3c0680),_0x38c046['off']('contentInsertion',_0x12ea5b);}_getDefaultInsertBelowPosition(_0x1edef6){const {model:_0x191be1}=this['editor'],_0x4579d9=Array['from'](_0x1edef6['getSelectedBlocks']());return _0x4579d9['length']?_0x191be1['createPositionAfter'](_0x4579d9['pop']()):_0x1edef6['getLastPosition']();}_prepareTableInsertBelowPosition(_0x30473b,_0x4829e6){const {model:_0x33fb4e,plugins:_0x19438c}=this['editor'];if(_0x19438c['has']('TableUtils')){const _0x41c5d1=_0x19438c['get']('TableUtils')['getSelectedTableCells'](_0x4829e6);if(_0x41c5d1['length']){const _0x10af28=this['_getTableRowCountFromContent'](_0x30473b),_0x42656e=this['_createEmptyTableRows'](_0x41c5d1,_0x10af28);return _0x33fb4e['createPositionAt'](_0x42656e,0x0);}}return null;}_getTableRowCountFromContent(_0x51b0bc){const _0x4fb462=this['editor']['plugins']['get']('TableUtils'),_0x120c06=this['editor']['data']['parse'](_0x51b0bc,'$documentFragment'),_0x2d1b61=Array['from'](_0x120c06['getChildren']())['filter'](_0x5feca4=>_0x5feca4['is']('element','table'));let _0x4dc58f=0x0;return _0x2d1b61['forEach'](_0x109b00=>{_0x4dc58f+=_0x4fb462['getRows'](_0x109b00);}),_0x4dc58f;}_createEmptyTableRows(_0x790186,_0x44f09e){const _0x1367b3=this['editor']['plugins']['get']('TableUtils'),_0x1adb4b=_0x1367b3['getRowIndexes'](_0x790186),_0x15fac7=_0x1367b3['getColumnIndexes'](_0x790186),_0x4596c3=_0x1adb4b['last']+0x1,_0x489d32=_0x15fac7['first'],_0x8d78d2=_0x790186[0x0]['findAncestor']('table');for(let _0x1e0cab=0x0;_0x1e0cab<_0x44f09e;_0x1e0cab++)_0x1367b3['insertRows'](_0x8d78d2,{'at':_0x4596c3});return _0x8d78d2['getChild'](_0x4596c3)['getChild'](_0x489d32);}_resetContentOfSelectedTableCells(_0x5b4fd8,_0x35388b){const {plugins:_0x1e5bf9}=this['editor'],{model:_0x364f20}=_0x5b4fd8;_0x1e5bf9['has']('TableUtils')&&_0x1e5bf9['get']('TableUtils')['getSelectedTableCells'](_0x35388b)['length']&&_0x364f20['deleteContent'](_0x35388b);}},us=class extends _0x158c3f{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){if(!this['textAdapter'])throw new dt('aiadapter-text-adapter-not-set',null);}},ds=class extends Error{constructor(_0xd638bd){super(_0xd638bd),this['name']='AIRequestError';}};function _s(_0xf8c6a1,_0x2c8721,_0x56e35b){const t=_0xf8c6a1['t'];switch(_0x2c8721){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',_0x56e35b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x56e35b);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'},_0x56e35b);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_AWS_NOT_SUPPORTED':return t({'id':'AI_ERROR_AWS_NOT_SUPPORTED','string':'The\x20AWS\x20integration\x20is\x20no\x20longer\x20supported.\x20Please\x20contact\x20the\x20support.'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x2c8721;}}var gs=class extends _0x3f0a57{_commandDefinitions;constructor(_0x5f3852,_0x145fc1){super(_0x5f3852),this['_commandDefinitions']=_0x145fc1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4c5e0f,_0xecc934,_0x316d83)=>{this['isEnabled']&&(this['enabledCommandsIds']=Is(this['_commandDefinitions'],_0x316d83));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5b5e28,_0x5ca57e,_0x59d206)=>{this['enabledCommandsIds']=_0x59d206?Is(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x4c2bb0=this['editor']['model'];this['_hasContext']=function(_0xc5a901){const _0x13a02a=_0xc5a901['document']['selection'];return _0x13a02a['isCollapsed']?0x0!==[..._0x13a02a['getSelectedBlocks']()]['length']&&![..._0x13a02a['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xc5a901['hasContent'](_0x13a02a['getFirstRange']());}(_0x4c2bb0);const _0x17ab13=_0x4c2bb0['document']['selection'],_0x3ef741=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x4cf06e of _0x17ab13['getRanges']())for(const _0x141284 of _0x4cf06e['getItems']())if(_0x141284['is']('element')&&_0x3ef741['includes'](_0x141284['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}execute(_0x5a9a7a='',_0x1724e4='',_0x478430='custom'){this['editor']['plugins']['get'](xs)['showUI'](_0x5a9a7a,_0x1724e4,_0x478430);}};function Is(_0x203638,_0x4f45a8){const _0x49ad96=new Set();for(const _0x3b8dbd of _0x203638['values']())(_0x4f45a8||!0x1===_0x3b8dbd['requiresContent'])&&_0x49ad96['add'](_0x3b8dbd['id']);return Array['from'](_0x49ad96);}const As=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is'),Es=/* #__PURE__ -- @preserve */
|
|
24
|
+
mt();var ps=class extends Es{editor;textAdapter;['view'];_sanitizationContainer;['_domParser'];['_xmlSerializer'];constructor(_0x378d91,_0x13bb32,_0x388108){super(),this['editor']=_0x378d91,this['textAdapter']=_0x13bb32,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x388108,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x141d48,_0x5bf4d6,_0x928e18)=>{this['view']['value']=this['_sanitizeHTML'](_0x928e18);}),this['listenTo'](this['view'],'submitPrompt',(_0x57a648,_0x5222f7)=>{const _0x10a478=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5222f7,_0x10a478,'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:_0x11dbda,query:_0x3de517,htmlContent:_0x70d15f,label:_0x365925,mainActionLabel:_0x471a98}){this['view']['prompt']=_0x365925,this['view']['mainAction']=_0x471a98,this['initialContext']=_0x70d15f,_0x3de517&&(this['view']['isRendered']?this['_handleQuery'](_0x3de517,_0x70d15f,_0x11dbda,_0x365925):this['view']['once']('render',()=>{this['_handleQuery'](_0x3de517,_0x70d15f,_0x11dbda,_0x365925);}));}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'](_0x2bcca0,_0x3c30f5,_0xe5baf9,_0x2b7e9b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3c30f5,this['previousQuery']=_0x2bcca0,this['previousLabel']=_0x2b7e9b||_0x2bcca0,this['previousActionId']=_0xe5baf9,new Promise(_0x28c3e1=>{this['textAdapter']['makeRequest']({'query':_0x2bcca0,'context':_0x3c30f5,'onData':_0x5c00c1=>{this['currentResponse']=_0x5c00c1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xe5baf9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2223f2=>{_0x2223f2 instanceof ds?this['view']['handleError'](_0x2223f2['message']):this['view']['handleError'](),_0x28c3e1();})['finally'](()=>{this['stopProcessing'](),_0x28c3e1();});});}_parseAndNormalizeContent(_0x55d67c,_0x3be582=!0x1){const _0x464dee=As['exec'](_0x55d67c);_0x55d67c=_0x464dee?_0x55d67c['substring'](_0x464dee[0x1]['length']):_0x55d67c['length']<0x64&&!_0x3be582?'':this['_stripMarkdownSyntax'](_0x55d67c);const _0x33e3da=this['_domParser']['parseFromString'](Qt(_0x55d67c),'text/html');if(_0x464dee){const _0x42e57d=Array['from'](_0x33e3da['body']['childNodes']);_0x42e57d['reverse']();for(const _0x1a2fb3 of _0x42e57d){if(_0x1a2fb3['nodeType']==Node['ELEMENT_NODE'])break;_0x1a2fb3['remove']();}}const _0x2cea9b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x33e3da['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2cea9b);const _0x26dcba=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x144072=this['editor']['data']['toModel'](_0x2cea9b);return _0x26dcba||_0x144072['markers']['clear'](),this['editor']['data']['stringify'](_0x144072);}['_normalizeResponseHeadings'](_0x305e59){const _0x1d69c9=new _0x1617d1(this['editor']['editing']['view']['document']),_0x286fb5=new _0x3c66f4({'name':/^h[1-5]$/}),_0x4b864b=[];let _0x28ec16=!0x1;for(const _0x29ebea of _0x305e59)_0x29ebea['is']('element')&&_0x286fb5['match'](_0x29ebea)&&(_0x4b864b['push'](_0x29ebea),'h1'==_0x29ebea['name']&&(_0x28ec16=!0x0));if(_0x28ec16){for(const _0x12e54f of _0x4b864b)_0x1d69c9['rename']('h'+(parseInt(_0x12e54f['name'][0x1])+0x1),_0x12e54f);}}_isH1TagSupportEnabled(){const {data:_0x2a4976,editing:_0x1cbf52}=this['editor'],_0x5ec119=_0x2a4976['htmlProcessor']['toView']('<h1></h1>'),_0xc213db=_0x2a4976['toView'](_0x2a4976['toModel'](_0x5ec119));return!!_0x1cbf52['view']['domConverter']['viewToDom'](_0xc213db)['querySelector']('h1');}_sanitizeHTML(_0x3d2a9c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3d2a9c),this['_sanitizationContainer']['innerHTML'];}_stripMarkdownSyntax(_0x307d48){const _0x2a619b=_0x307d48['trim']();return _0x2a619b['startsWith']('```html')?_0x2a619b['endsWith']('```')?_0x2a619b['substring'](0x7,_0x2a619b['length']-0x3):_0x2a619b['substring'](0x7):_0x307d48;}};const ms={'REPLACE':'replace','INSERT':'insert'};var Ts=class extends _0x20288e{constructor(_0x2ad8a9){super(_0x2ad8a9),this['set']('isVisible',!0x1),this['set']('mainAction',ms['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x36fa94=>_s(_0x2ad8a9,'AI_'+_0x36fa94['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](_s(_0x2ad8a9,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](_s(_0x2ad8a9,'Try\x20again')),this['stopButton']=this['_createButton'](_s(_0x2ad8a9,'Stop'));const _0x93b9d4=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x93b9d4['if']('isVisible','ck-hidden',_0x568a32=>!_0x568a32)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}_createButton(_0x1a7962,_0xc81814){const _0x4f28dc=new _0x1a9216(this['locale']);return _0x4f28dc['set']({'label':_0x1a7962,'class':_0xc81814||'','isVisible':!0x0,'withText':!0x0}),_0x4f28dc;}},ws=class extends _0x2df458{contentFieldView;copyButtonView;constructor(_0x301a9c,_0x13f09f=''){super(_0x301a9c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x460cfd=this['bindTemplate'];this['contentFieldView']=new Cs(_0x301a9c,_0x13f09f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x460cfd['if']('isVisible','ck-hidden',_0x1e79d5=>!_0x1e79d5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x460cfd['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 _0x36b07c=!0x1;this['on']('change:value',(_0x32c0ba,_0x5dd602,_0x2c497e)=>{const _0x497906=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c497e),this['isProcessing']&&_0x497906&&!_0x36b07c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3f4a62,_0x2c76d8,_0x19c659)=>{_0x36b07c=!0x1,_0x19c659?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x36b07c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x36b07c=!0x0;});}['focus'](){this['element']['focus']();}_createCopyButton(){const _0x24ff26=this['locale'],_0x244d43=new _0x1a9216(this['locale']),_0x17ffdc='ck-ai-form__copy-button';return _0x244d43['set']({'label':_s(_0x24ff26,'Copy'),'icon':_0x21a060,'class':_0x17ffdc,'tooltip':!0x0}),_0x244d43['bind']('isVisible')['to'](this,'value',_0x24734f=>!!_0x24734f),_0x244d43['bind']('isEnabled')['to'](this,'isProcessing',_0x15044a=>!_0x15044a),_0x244d43['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x244d43['icon']=_0x42448e,_0x244d43['class']=_0x17ffdc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x244d43['icon']=_0x21a060,_0x244d43['class']=_0x17ffdc;},0x3e8);}),_0x244d43;}['_copyHTMLToClipboard'](_0x2622ba){const {window:_0x31a2ee,document:_0xcf1b1a}=Vt;if(_0x31a2ee['ClipboardItem']){const {Blob:_0x1b2238,ClipboardItem:_0xb3827f}=_0x31a2ee,_0x290c10=[new _0xb3827f({'text/html':new _0x1b2238([_0x2622ba['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1b2238([_0x2622ba['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x290c10);}else{const _0xe83ad1=_0xcf1b1a['createElement']('div');_0xe83ad1['style']['position']='absolute',_0xe83ad1['style']['left']='-9999px',_0xe83ad1['innerHTML']=Qt('<span>[</span>'+_0x2622ba['innerHTML']+'<span>]</span>'),_0xcf1b1a['body']['appendChild'](_0xe83ad1);const _0x5ab63c=_0xcf1b1a['createRange']();_0x5ab63c['setStartAfter'](_0xe83ad1['firstElementChild']),_0x5ab63c['setEndBefore'](_0xe83ad1['lastElementChild']);const _0x7b0bb3=_0x31a2ee['getSelection']();_0x7b0bb3['removeAllRanges'](),_0x7b0bb3['addRange'](_0x5ab63c),_0xcf1b1a['execCommand']('copy'),_0xe83ad1['remove']();}}},Cs=class extends _0x2df458{constructor(_0x2f7756,_0x18e9ed=''){super(_0x2f7756),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x18e9ed,'ck-reset_all-excluded','ck-ai-form__content-field']}});}setContent(_0x25f511){this['element']['innerHTML']=Qt(_0x25f511||'');}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}_createLoader(){const _0x457c91=new _0x2df458(),_0x31c782=this['locale'],_0x531ebf=new _0x407319();return _0x531ebf['isVisible']=!0x0,_0x457c91['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x531ebf,{'text':_s(_0x31c782,'AI\x20is\x20writing...')}]}),_0x457c91['render'](),_0x457c91;}},fs=class extends _0x2df458{constructor(_0xa20cbc,_0x548efb=''){super(_0xa20cbc);const _0x3cce3d=new _0x5e3c18(),_0x4216eb=this['bindTemplate'];this['set']('text',_0x548efb),_0x3cce3d['content']=_0x1797f9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3cce3d,{'text':_0x4216eb['to']('text')}]});}},Rs=class extends jt{submitButtonView;showHistoryButtonView;constructor(_0x164617,_0x47d0e3){super(_0x164617,_0x47d0e3),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',(_0x174b7e,_0x3b8aa9)=>{_0x174b7e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3b8aa9());});}_createSubmitButton(){const _0x308771=new _0x1a9216(this['locale']),_0x282cae=this['locale'];return _0x308771['set']({'icon':at,'label':_s(_0x282cae,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x308771['on']('execute',()=>{this['submit']();}),_0x308771['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4b6fc9,_0x237a1d)=>!_0x4b6fc9&&_0x237a1d),_0x308771;}_createShowHistoryButton(){const _0x594d03=new _0x1a9216(this['locale']),_0x826579=this['resultsView'],_0x24c390=this['locale'];_0x594d03['set']({'label':_s(_0x24c390,'History'),'withText':!0x1,'icon':_0x23e734,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x594d03['bind']('isOn')['to'](_0x826579,'isVisible'),_0x594d03['bind']('isEnabled')['to'](this,'isEnabled'),_0x594d03['on']('execute',()=>{_0x826579['isVisible']=!_0x826579['isVisible'],_0x826579['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x230978=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0xe77469=new Tt(this['queryView']['fieldView']['element']),_0x15ee8f=_0xe77469['width'],_0x856771='rtl'===_0x24c390['uiLanguageDirection']?'left':'right';_0xe77469['excludeScrollbarsAndBorders'](),_0x594d03['element']['style'][_0x856771]=_0x15ee8f-_0xe77469['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x230978),this['on']('render',_0x230978),_0x594d03;}submit(){const _0x137c86=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x137c86);}['focus'](_0x440b45){-0x1===_0x440b45?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}},bs=class extends _0x4e6fd6{historyGroupView;clearHistoryButton;constructor(_0xcf27bf){super(_0xcf27bf),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x340eed(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=_s(_0xcf27bf,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}filter(){let _0x489252=0x0;for(const _0x3f4eb3 of this['items'])_0x489252+=_0x3f4eb3['items']['length'];return{'resultsCount':_0x489252,'totalItemsCount':_0x489252};}_createClearHistoryButton(){const _0x28d2b7=this['locale'],_0x248d9f=new _0x1a9216(this['locale']);return _0x248d9f['set']({'label':'('+_s(_0x28d2b7,'Clear')+')','withText':!0x0}),_0x248d9f['on']('execute',()=>this['fire']('clearHistory')),_0x248d9f;}},Ss=class extends _0xf665cb{constructor(_0x3e3e52){super();const _0x465419=new te(),_0xcd4ea6=new _0x1a9216(this['locale'],_0x465419);this['children']['add'](_0xcd4ea6),_0xcd4ea6['set']({'label':_0x3e3e52['prompt'],'withText':!0x0}),_0xcd4ea6['on']('execute',()=>{this['fire']('execute',{'value':_0x2e6a78(_0x3e3e52['prompt'])});});}};const Os='CKEditor/AIFormView/PromptHistory';var vs=class extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x533cfa,_0x21bcbb)=>{const _0x23a26c=ys(_0x21bcbb['prompt']);for(const _0x346f3a of this)if(_0x346f3a!=_0x21bcbb&&ys(_0x346f3a['prompt'])===_0x23a26c){this['remove'](_0x346f3a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}_loadFromSessionStorage(){const _0x17e897=sessionStorage['getItem'](Os)||'[]';this['addMany'](JSON['parse'](_0x17e897));}_saveToSessionStorage(){sessionStorage['setItem'](Os,JSON['stringify'](this['map'](_0x2fe141=>_0x2fe141)));}};function ys(_0x2fa1b6){return _0x2fa1b6['toLowerCase']()['trim']();}var Ns=class extends _0x2df458{['focusTracker'];keystrokes;contentArea;toolbar;promptView;['errorView'];['_focusables'];['focusCycler'];_promptHistory;constructor(_0x2573a2,_0x407a08,_0x3a8aca=''){super(_0x2573a2),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ms['REPLACE']),this['_promptHistory']=new vs(),this['errorView']=new fs(_0x2573a2),this['contentArea']=new ws(_0x2573a2,_0x3a8aca),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 Et(),this['keystrokes']=new pt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x17323b({'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 _0x33a448=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x407a08],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x33a448['if']('isError','ck-hidden',_0x4343ef=>!_0x4343ef)]},'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'](_0x258b47=0x1){-0x1===_0x258b47?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 _0xfa027b=this['locale'],_0x52cac6=new Rs(_0xfa027b,{'queryView':{'label':_s(_0xfa027b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3e1b5a,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_s(_0xfa027b,'Empty\x20history'),'secondary':_s(_0xfa027b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x52cac6['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x35caf6,_0xbf0d05)=>_0x35caf6&&!_0xbf0d05),this['listenTo'](_0x52cac6,'submit',(_0x1446f8,_0x20ac40)=>{this['prompt']=_0x20ac40;const _0x379785=_0x369484(_0x20ac40);this['fire']('submitPrompt',_0x379785),_0x20ac40['trim']()&&this['_promptHistory']['add']({'prompt':_0x379785},0x0);},{'priority':'high'}),_0x52cac6;}_createHistoryView(){const _0x3d82f6=new bs(this['locale']);return _0x3d82f6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ss),_0x3d82f6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d82f6;}_createToolbar(){const _0x1532df=new Ts(this['locale']);return _0x1532df['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19340e,_0x232db2,_0x10dd30)=>_0x19340e&&!_0x232db2&&!!_0x10dd30),_0x1532df['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1532df['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2abaa6,_0xb001ea,_0x66c06)=>_0x2abaa6&&!_0xb001ea&&!!_0x66c06),_0x1532df['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1532df['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x56c457,_0x30eaff)=>_0x56c457&&!_0x30eaff),_0x1532df['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1532df['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1532df['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1532df;}startProcessing(){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1922cc=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=_s(_0x1922cc,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x45e5ae){const _0x1b50ba=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x45e5ae||_s(_0x1b50ba,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}};const ks=globalThis['DataTransfer'];var xs=class extends _0x158c3f{['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[_0x5aeead,ls,us,_0x3fa2e4];}constructor(_0x494daf){super(_0x494daf),_0x494daf['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x494daf['config']['define']('ai.assistant.contentAreaCssClass',''),this['_uiCssClasses']='ck-ai-assistant-ui\x20ck-ai-assistant-ui_theme';}init(){const {editor:_0x409b4e}=this;this['_aiAdapter']=_0x409b4e['plugins']['get'](us),this['_dialog']=_0x409b4e['plugins']['get'](_0x3fa2e4),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2d6bd0=new gs(_0x409b4e,Array['from'](this['_commandDefinitions']['values']()));_0x409b4e['commands']['add']('showAIAssistant',_0x2d6bd0),_0x409b4e['ui']['componentFactory']['add']('aiCommands',_0x2a0b83=>{const _0x12754d=_0x4c754a(_0x2a0b83);return _0x12754d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x12754d['buttonView']['set']({'label':_s(_0x2a0b83,'AI\x20Commands'),'icon':_0x3e186b,'tooltip':!0x0}),_0x12754d['on']('execute',_0x157b7a=>this['_onExecute'](_0x157b7a['source']['id'])),_0x318cd1(_0x12754d,_0x409b4e['ui']['view']['body'],function(_0x289020){const _0x5e17e3=Ds(_0x289020,as(_0x289020['config']['get']('ai.assistant.commands'),_0x289020['locale']))['filter'](_0x170d7d=>_0x170d7d['commands']['length']);return 0x1===_0x5e17e3['length']?Ds(_0x289020,_0x5e17e3[0x0]['commands'])['map'](_0x481a03=>({'id':_0x481a03['id'],'label':_0x481a03['label']})):_0x5e17e3['map'](_0x4c93fe=>{const {groupId:_0x3e539f,groupLabel:_0x2f6ace,commands:_0x18ae59}=_0x4c93fe,_0xa471e7=Ds(_0x289020,_0x18ae59)['map'](_0x16f482=>({'id':_0x16f482['id'],'label':_0x16f482['label']}));return{'id':_0x3e539f,'menu':_0x2f6ace||_0x3e539f,'children':_0xa471e7};});}(_0x409b4e),{'ariaLabel':_s(_0x2a0b83,'AI\x20Commands')}),_0x12754d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2d6bd0['on']('change:enabledCommandsIds',_0x6c4675),_0x12754d['menuView']['once']('render',_0x6c4675),_0x12754d;function _0x6c4675(){_0x12754d['isEnabled']=_0x2d6bd0['enabledCommandsIds']['length']>0x0;for(const _0xd0445d of _0x12754d['menuView']['buttons'])_0xd0445d['isEnabled']=_0x2d6bd0['enabledCommandsIds']['includes'](_0xd0445d['id']);}}),_0x409b4e['ui']['componentFactory']['add']('menuBar:aiCommands',_0xc66edf=>{const _0x484c5d=new _0x5e7fd5(_0xc66edf);_0x484c5d['buttonView']['set']({'label':_s(_0xc66edf,'AI\x20Commands'),'icon':_0x3e186b}),_0x484c5d['bind']('isEnabled')['to'](_0x2d6bd0,'enabledCommandsIds',_0x506d08=>_0x506d08['length']>0x0);const _0x79f01=as(_0x409b4e['config']['get']('ai.assistant.commands'),_0xc66edf);return this['_populateMenuBarMenu'](_0x2d6bd0,_0x484c5d,_0x79f01,_0x4573d0=>this['_onExecute'](_0x4573d0)),_0x484c5d;}),_0x409b4e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x232324=this['_createAIAssistantUIButton'](_0x1a9216);return _0x232324['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x232324;}),_0x409b4e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2b8554=this['_createAIAssistantUIButton'](_0x410c15);return _0x2b8554['set']({'role':'menuitemcheckbox'}),_0x2b8554;}),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x1a6dda=[this['editor']];for(const _0x18b9ed of _0x1a6dda){let _0x29a330;for(const _0x27b391 in _0x18b9ed){const _0x1c8a22=_0x27b391,_0x5aafde=_0x18b9ed[_0x1c8a22];if('aiLicenseKeyValid'==_0x5aafde||'aiLicenseKeyInvalid'==_0x5aafde||'aiLicenseKeyExpired'==_0x5aafde||'aiLicenseKeyDomainLimit'==_0x5aafde||'aiLicenseKeyNotAllowed'==_0x5aafde||'aiLicenseKeyEvaluationLimit'==_0x5aafde||'aiLicenseKeyUsageLimit'==_0x5aafde){delete _0x18b9ed[_0x1c8a22],_0x29a330=_0x5aafde,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x29a330&&_0x18b9ed['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x29a330&&_0x18b9ed['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x29a330&&_0x18b9ed['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x29a330&&_0x18b9ed['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x558879='',_0x54be9='',_0x2abef8='custom'){const _0xb2cbdf=this['editor'],_0xf81755=_0xb2cbdf['editing']['view'],_0xda9e70=_0xb2cbdf['plugins']['get'](ls),_0x598b6b=_0xb2cbdf['plugins']['get'](_0x5aeead);_0xda9e70['showFakeVisualSelection']();const _0x4ec770=new ks(),_0x5295bf=new ClipboardEvent('copy',{'clipboardData':_0x4ec770}),_0x382362=new _0x416400(_0x4ec770),_0x4016ca=new _0x594118(_0xf81755,_0x5295bf,{'dataTransfer':_0x382362});_0x598b6b['_forceMarkersCopy']('comment',()=>{_0xf81755['document']['fire']('copy',_0x4016ca);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new ps(_0xb2cbdf,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x45c7e8=_0x382362['getData']('text/html');const _0x3d7cef=_0xb2cbdf['model']['document']['selection'],_0x2db778=Array['from'](_0x3d7cef['getRanges']());0x1===_0x2db778['length']&&_0x2db778[0x0]['isFlat']&&!_0x3d7cef['getSelectedElement']()&&''!==_0x45c7e8['replace'](/ /g,'')['trim']()&&(_0x45c7e8='<p>'+_0x45c7e8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2abef8,'query':_0x558879,'htmlContent':_0x45c7e8,'label':_0x54be9,'mainActionLabel':ms[_0xb2cbdf['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','title':_s(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4abac9['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xda9e70['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}_getResolvedCommandsDefinitions(){const _0x57d34d=new Map(),_0x5a0af6=as(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x28ea0f of _0x5a0af6)for(const _0x22baa0 of _0x28ea0f['commands'])_0x57d34d['set'](_0x22baa0['id'],{..._0x22baa0,'groupId':_0x28ea0f['groupId'],'groupLabel':_0x28ea0f['groupLabel']||_0x28ea0f['groupId']});return _0x57d34d;}_createAIAssistantUIButton(_0x4feb16){const _0x2a5580=this['editor'],_0x1da424=_0x2a5580['commands']['get']('showAIAssistant'),_0x4f0b3e=new _0x4feb16(_0x2a5580['locale']);return _0x4f0b3e['set']({'label':_s(_0x2a5580['locale'],'AI\x20Assistant'),'icon':et,'isToggleable':!0x0}),_0x4f0b3e['bind']('isEnabled')['to'](_0x1da424),_0x4f0b3e['bind']('isOn')['to'](this['_dialog'],'id',_0x39cff4=>'aiAssistant'===_0x39cff4),this['listenTo'](_0x4f0b3e,'execute',()=>{_0x4f0b3e['isOn']?this['hideUI']():_0x1da424['execute']();}),_0x4f0b3e;}_initView(){const _0x7c4658=this['editor']['plugins']['get'](ls);this['_formView']=new Ns(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',()=>{_0x7c4658['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x7c4658['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}_initAriaAiStatusChangeAnnouncements(){const {locale:_0x1d1b70,ui:{ariaLiveAnnouncer:_0x1a2684}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xb90f27,_0x4dd1da,_0x3ad404)=>{const _0x42acf5=this['_aiAssistantController']['currentContext'];_0x3ad404?_0x1a2684['announce'](_s(_0x1d1b70,'AI\x20is\x20writing')):_0x42acf5&&_0x1a2684['announce'](_s(_0x1d1b70,'Generated\x20content:\x20%0',_0x42acf5),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x44a3ce,_0x3ed813,_0x301a40)=>{if(_0x301a40){const _0x3b73bd=this['_formView']['errorView']['text'];_0x1a2684['announce'](_s(_0x1d1b70,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b73bd));}});}_onExecute(_0x561543){const _0x275fd8=this['_commandDefinitions']['get'](_0x561543),_0x40bc70=this['editor'],_0x28417c=_0x40bc70['model']['document']['selection'],_0x59f834=_0x40bc70['commands']['get']('showAIAssistant'),_0x1ebb24=_0x40bc70['plugins']['get'](ls),_0x3bcd4d=''+('_ungrouppedCommands'!==_0x275fd8['groupId']?_0x275fd8['groupLabel']+':\x20':'')+_0x275fd8['label'];if(!0x1!==_0x275fd8['requiresContent']&&_0x28417c['isCollapsed']){const _0x35e157=Ot(_0x28417c['getSelectedBlocks']())||_0x40bc70['model']['schema']['getLimitElement'](_0x28417c);_0x40bc70['model']['change'](_0x3dfb9b=>{_0x3dfb9b['setSelection'](_0x35e157,'in');});}_0x1ebb24['showFakeVisualSelection'](),_0x59f834['execute'](_0x275fd8['prompt'],_0x3bcd4d,'command:'+_0x561543);}_populateMenuBarMenu(_0x423acb,_0x21db37,_0x5aedb7,_0x8bffe5){const _0x5b53fe=this['editor'],_0x3c2a99=_0x5b53fe['locale'],_0xdf31a4=new _0x1969ff(_0x3c2a99),_0x15982c=Ds(_0x5b53fe,_0x5aedb7)['filter'](_0x5eecf9=>_0x5eecf9['commands']['length']);0x1===_0x15982c['length']?this['_getMenuBarGroupButtons']({'command':_0x423acb,'commands':_0x15982c[0x0]['commands'],'parentMenuView':_0x21db37,'onExecute':_0x8bffe5})['forEach'](_0x300c65=>_0xdf31a4['items']['add'](_0x300c65)):_0x15982c['forEach'](({groupId:_0x15307c,groupLabel:_0xebaa65,commands:_0x2014f1})=>{const _0x5be023=new _0x5d5b51(_0x3c2a99,_0x21db37),_0x508c90=new _0x5e7fd5(_0x3c2a99),_0x24f993=new _0x1969ff(_0x3c2a99),_0x3a51af=this['_getMenuBarGroupButtons']({'command':_0x423acb,'commands':_0x2014f1,'parentMenuView':_0x508c90,'onExecute':_0x8bffe5});_0x508c90['buttonView']['set']({'label':_0xebaa65||_0x15307c}),_0x508c90['delegate']('execute')['to'](_0x21db37),_0x24f993['items']['addMany'](_0x3a51af),_0x508c90['panelView']['children']['add'](_0x24f993),_0x5be023['children']['add'](_0x508c90),_0xdf31a4['items']['add'](_0x5be023);}),_0x21db37['panelView']['children']['add'](_0xdf31a4);}_getMenuBarGroupButtons({command:_0x3f10ac,commands:_0x366918,parentMenuView:_0x30fc66,onExecute:_0x4e603f}){const _0x39e4b8=this['editor'],_0x134c82=_0x39e4b8['locale'];return Ds(_0x39e4b8,_0x366918)['map'](_0x4857e2=>{const _0x3141eb=new _0x5d5b51(_0x134c82,_0x30fc66),_0x5a8991=new _0x410c15(_0x134c82);return _0x5a8991['set']({'label':_0x4857e2['label']}),_0x5a8991['delegate']('execute')['to'](_0x30fc66),_0x5a8991['on']('execute',()=>_0x4e603f(_0x4857e2['id'])),_0x5a8991['bind']('isEnabled')['to'](_0x3f10ac,'enabledCommandsIds',_0x91670e=>_0x91670e['includes'](_0x4857e2['id'])),_0x3141eb['children']['add'](_0x5a8991),_0x3141eb;});}};function Ls(_0x511d5e,_0x1fac0c){return void 0x0!==_0x511d5e['order']&&void 0x0===_0x1fac0c['order']?0x1:void 0x0===_0x511d5e['order']&&void 0x0!==_0x1fac0c['order']?-0x1:void 0x0!==_0x511d5e['order']&&void 0x0!==_0x1fac0c['order']?_0x511d5e['order']-_0x1fac0c['order']:0x0;}function Ds(_0x5885e4,_0x44eb79){_0x44eb79['sort'](Ls);const _0x3b2b47={},_0x419bcc=[];for(const _0x2910ea of _0x44eb79)if(void 0x0!==_0x2910ea['order']){if(_0x2910ea['order']in _0x3b2b47)throw new dt('ai-commands-config-order-collision',_0x5885e4,{'conflictingDefinitions':[_0x2910ea,_0x3b2b47[_0x2910ea['order']]]});_0x3b2b47[_0x2910ea['order']]=_0x2910ea,_0x419bcc['splice'](_0x2910ea['order'],0x0,_0x2910ea);}else _0x419bcc['push'](_0x2910ea);return _0x419bcc;}var Ps=class extends _0x158c3f{static get requires(){return[xs,ls];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36005e){super(_0x36005e);const _0x59ab92=_0x36005e['config'],_0x235657=_0x36005e['locale'];_0x59ab92['define']('ai.assistant.preserveComments',!0x0),_0x59ab92['define']('ai.assistant.commands',Ms(_0x235657)),_0x59ab92['define']('ai.assistant.extraCommandGroups',[]),_0x59ab92['define']('ai.assistant.removeCommands',[]);let _0x691891=as(_0x59ab92['get']('ai.assistant.commands'),_0x235657);const _0x244ce7=_0x59ab92['get']('ai.assistant.extraCommandGroups'),_0x22d6cb=_0x59ab92['get']('ai.assistant.removeCommands');_0x244ce7['forEach'](_0x2f626b=>{const _0x532a90=_0x691891['find'](_0x151653=>_0x151653['groupId']===_0x2f626b['groupId']);_0x532a90?_0x532a90['commands']=_0x532a90['commands']['concat'](_0x2f626b['commands']):_0x691891['push'](_0x2f626b);}),_0x691891=_0x691891['filter'](_0x5b7784=>!_0x22d6cb['includes'](_0x5b7784['groupId'])),_0x691891['forEach'](_0x2bda4e=>{_0x2bda4e['commands']=_0x2bda4e['commands']['filter'](_0x39d3ee=>!_0x22d6cb['includes'](_0x39d3ee['id']));}),_0x59ab92['set']('ai.assistant.commands',_0x691891);}};function Ms(_0x456e90){return[{'groupId':'editOrReview','groupLabel':_s(_0x456e90,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':_s(_0x456e90,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':_s(_0x456e90,'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':_s(_0x456e90,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':_s(_0x456e90,'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':_s(_0x456e90,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':_s(_0x456e90,'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':_s(_0x456e90,'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':_s(_0x456e90,'Change\x20tone'),'commands':[{'id':'professional','label':_s(_0x456e90,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':_s(_0x456e90,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':_s(_0x456e90,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':_s(_0x456e90,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':_s(_0x456e90,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':_s(_0x456e90,'Change\x20style'),'commands':[{'id':'business','label':_s(_0x456e90,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':_s(_0x456e90,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':_s(_0x456e90,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':_s(_0x456e90,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':_s(_0x456e90,'Translate'),'commands':[{'id':'translateEnglish','label':_s(_0x456e90,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':_s(_0x456e90,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':_s(_0x456e90,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':_s(_0x456e90,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':_s(_0x456e90,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':_s(_0x456e90,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':_s(_0x456e90,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':_s(_0x456e90,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}var Vs=class extends _0x158c3f{abortController;static get requires(){return[us];}constructor(_0x5db1c2){super(_0x5db1c2),this['abortController']=new AbortController();}init(){this['editor']['plugins']['get'](us)['textAdapter']=this;}abort(){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async makeRequest(_0x582c34){return this['sendRequest'](_0x582c34)['catch'](_0x5dfef9=>{if(_0x5dfef9 instanceof ds)return Promise['reject'](_0x5dfef9);if('AbortError'==_0x5dfef9['name'])return Promise['resolve']();throw console['error'](_0x5dfef9),new dt('aitextadapter-send-request-failed',null);});}async _prepareRequestHeaders(_0xa97514,_0x3727eb){const _0x348ae7=this['editor']['locale'],_0x485cd5={'Content-Type':'application/json'};if('object'==typeof _0xa97514)Object['assign'](_0x485cd5,_0xa97514);else{if(_0xa97514)try{const _0x1a6881=await _0xa97514(_0x3727eb);Object['assign'](_0x485cd5,_0x1a6881);}catch{return Promise['reject'](new ds(_s(_0x348ae7,'AI_ERROR_GET_HEADERS')));}}return _0x485cd5;}async _prepareRequestParameters(_0x348965,_0x1ea1b1){const _0x753317=this['editor']['locale'];if('object'==typeof _0x348965)return _0x348965;try{return await _0x348965(_0x1ea1b1);}catch{return Promise['reject'](new ds(_s(_0x753317,'AI_ERROR_GET_PARAMETERS')));}}},Hs=class extends Vs{['_apiUrl'];_requestHeaders;_requestParameters;static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x6f205d){super(_0x6f205d),_0x6f205d['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x6f205d['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x6f205d['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async sendRequest({query:_0x469aba,context:_0x59b0bf,onData:_0x139946,actionId:_0x521bf9}){const _0x10c48d=this['editor']['locale'],_0x181a43=await this['prepareMessages'](_0x469aba,_0x59b0bf,_0x521bf9),_0x2fdc41=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x521bf9),_0x449321=await this['_prepareRequestParameters'](this['_requestParameters'],_0x521bf9),_0x5d92b6={'messages':_0x181a43,..._0x449321},_0x1d2167={'method':'POST','headers':_0x2fdc41,'body':JSON['stringify'](_0x5d92b6),'signal':this['abortController']['signal']},_0x35b541=await fetch(this['_apiUrl'],_0x1d2167);if(_0x35b541['ok'])return _0x449321['stream']?await this['_readStreamableResponse'](_0x35b541,_0x139946):await this['_readStaticResponse'](_0x35b541,_0x139946),Promise['resolve']();{const _0x88952b=await _0x35b541['text']();return _0x88952b['includes']('context_length_exceeded')?Promise['reject'](new ds(_s(_0x10c48d,'AI_ERROR_CONTEXT_LENGTH'))):_0x88952b['includes']('Moderation')?Promise['reject'](new ds(_s(_0x10c48d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x88952b));}}async['prepareMessages'](_0x1dbd5d,_0x1996bd,_0x350595){let _0x51d34d,_0x3926b0;return _0x1996bd?(_0x51d34d='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.',_0x3926b0='Instruction:\x0a'+_0x1dbd5d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1996bd):(_0x51d34d='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.',_0x3926b0=_0x1dbd5d),[{'role':'system','content':_0x51d34d},{'role':'user','content':_0x3926b0}];}async _readStreamableResponse(_0x262dd2,_0x145c00){const _0x56ef34=_0x262dd2['body']['getReader'](),_0xf096e=new TextDecoder();let _0x50dc9d='',_0x461722='',_0x5c79bc='',_0x41d914=!0x1;for(;!_0x41d914;){const {done:_0x2d48b8,value:_0x5f2dde}=await _0x56ef34['read'](),_0x509986=_0x50dc9d+_0xf096e['decode'](_0x5f2dde);let _0x3d4f5b;_0x41d914=_0x2d48b8;try{_0x3d4f5b=this['_cleanUpData'](_0x509986),_0x50dc9d='';}catch{_0x50dc9d=_0x509986;continue;}_0x461722+=_0x3d4f5b,!_0x41d914&&this['_isBufferIncomplete'](_0x461722)||_0x461722&&(_0x5c79bc+=_0x461722,_0x461722='',_0x145c00(_0x5c79bc));}return Promise['resolve']();}async _readStaticResponse(_0x4f0fa1,_0x32d62a){return _0x32d62a((await _0x4f0fa1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}_isBufferIncomplete(_0x11d28c){const _0x16200d=_0x11d28c['split']('<')['length']!==_0x11d28c['split']('>')['length'],_0x14c86e=_0x11d28c['length']<0x1e;return _0x16200d&&_0x14c86e;}_cleanUpData(_0x10ca54){return _0x10ca54['split'](/\n(?![^{]*\})/g)['map'](_0x22407d=>_0x22407d['replace']('data:\x20',''))['filter'](_0x2db431=>_0x2db431&&_0x2db431['length']>0x0&&'[DONE]'!==_0x2db431)['map'](_0x47a1f3=>{const {choices:_0x40cfde}=JSON['parse'](_0x47a1f3);if(_0x40cfde[0x0]?.['delta']?.['content'])return _0x40cfde[0x0]['delta']['content'];})['filter'](_0x1fb05d=>_0x1fb05d)['join']('');}},Us=class extends Vs{static get['pluginName'](){return'AWSTextAdapter';}init(){super['init'](),Ft('ai-aws-adapter-not-supported');}async sendRequest(_0x9dbe9d){throw Wt('ai-aws-adapter-not-supported'),new ds(_s(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}},Bs=class extends _0x2df458{buttonViews=this['createCollection']();['panelViews']=this['createCollection']();_tabs=new Map();constructor(_0x41ce68,_0xaca26={}){super(_0x41ce68),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0xaca26['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0xaca26['collapsible']||!0x1),this['set']('isCollapsed',!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'isCollapsed',(_0x5d22fd,_0x2c9688)=>_0x5d22fd&&!_0x2c9688);const _0x36e982=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...qt(_0xaca26['class']||[]),_0x36e982['to']('side',_0x35be04=>'ck-tabs_'+_0x35be04),_0x36e982['to']('class'),_0x36e982['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x36e982['if']('isCollapsed','ck-ai-tabs_collapsed')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x36e982['to']('side',_0x1d1b6f=>'ck-tabs__buttons-container_'+_0x1d1b6f)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x36e982['to']('side',_0xe7cd52=>'ck-tabs__panels-container_'+_0xe7cd52)]},'children':this['panelViews']},...qt(_0xaca26['children']||[])]});}getTabIds(){return[...this['_tabs']['keys']()];}getTab(_0x37f2d9){const _0x3a2ed5=this['_tabs']['get'](_0x37f2d9);return _0x3a2ed5||null;}['addTab'](_0x405c53){const _0x24d100=this['_setupButton']({'id':_0x405c53['id'],'label':_0x405c53['buttonLabel'],'icon':_0x405c53['buttonIcon'],'order':_0x405c53['order']}),_0x539479=new _0x224963(this['locale']);return _0x539479['render'](),_0x405c53['content']&&_0x539479['children']['add'](_0x405c53['content']),this['panelViews']['add'](_0x539479),this['_tabs']['set'](_0x405c53['id'],{'button':_0x24d100,'panel':_0x539479,'order':void 0x0!==_0x405c53['order']?_0x405c53['order']:null}),this['fire']('addTab:'+_0x405c53['id'],{'id':_0x405c53['id'],'button':_0x24d100,'panel':_0x539479}),null===this['activeTab']?this['_activateTab'](_0x405c53['id']):this['_hidePanel'](_0x405c53['id']),{'button':_0x24d100,'panel':_0x539479};}activateTab(_0x132006){this['_activateTab'](_0x132006);}_activateTab(_0x34ace2){if(null!==_0x34ace2&&!this['getTab'](_0x34ace2))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x34ace2});if(this['isCollapsed']=!0x1,this['activeTab']===_0x34ace2)return;const _0x229e1f=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x34ace2,_0x34ace2&&this['_showPanel'](_0x34ace2),this['fire']('activateTab:'+_0x34ace2,{'newTab':_0x34ace2,'oldTab':_0x229e1f});}toggleTabPanel(_0x4ebd34){this['activeTab']===_0x4ebd34?this['collapsible']&&(this['isCollapsed']=!this['isCollapsed']):this['activateTab'](_0x4ebd34);}['showTab'](_0xacd990){if(!this['getTab'](_0xacd990))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xacd990});this['_showPanel'](_0xacd990),this['_showButton'](_0xacd990),this['fire']('show:'+_0xacd990,_0xacd990);}['hideTab'](_0xa31b2e){if(!this['getTab'](_0xa31b2e))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xa31b2e});const _0x7f5177=this['activeTab'];this['_hidePanel'](_0xa31b2e),this['_hideButton'](_0xa31b2e);const _0x35c097=this['getTabIds']();_0x7f5177===_0xa31b2e&&_0x35c097['length']>0x1&&this['_activateTab'](_0x35c097['find'](_0xb9863d=>_0xb9863d!==_0xa31b2e)),this['fire']('hide:'+_0xa31b2e,_0xa31b2e);}_getPanel(_0x5d257c){const _0x210cf6=this['_tabs']['get'](_0x5d257c);return _0x210cf6?_0x210cf6['panel']:null;}['_showPanel'](_0x1f9074){null!==this['activeTab']&&this['activeTab']!==_0x1f9074||this['_getPanel'](_0x1f9074)['show']();}['_hidePanel'](_0x351ef0){const _0x170740=this['_getPanel'](_0x351ef0);_0x170740['isVisible']&&(this['activeTab']===_0x351ef0&&(this['activeTab']=null),_0x170740['hide']());}_getButton(_0x14180a){const _0x125a61=this['_tabs']['get'](_0x14180a);return _0x125a61?_0x125a61['button']:null;}_showButton(_0x3bc286){this['_getButton'](_0x3bc286)['show']();}_hideButton(_0xf9b6b8){this['_getButton'](_0xf9b6b8)['hide']();}_setupButton(_0x5d93cb){const _0xa2d1cf=new _0x5207ba(this['locale'],{'side':this['side']}),_0x5e63be=this['buttonViews'];if(_0xa2d1cf['set']({'label':_0x5d93cb['label'],'icon':_0x5d93cb['icon'],'tooltip':!0x0,'withText':!0x0}),_0xa2d1cf['bind']('isOn')['to'](this,'activeTab',this,'isCollapsed',(_0x4d8164,_0x4daaad)=>_0x4d8164===_0x5d93cb['id']&&!_0x4daaad),_0xa2d1cf['bind']('side')['to'](this,'side'),_0x5d93cb['order']){const _0x5528bf=[...this['_tabs']]['reduce']((_0x16a243,_0x5663fb)=>{const _0x17ebbc=_0x5663fb[0x0],{order:_0xfe0374}=_0x5663fb[0x1];return!_0xfe0374||_0xfe0374>_0x5d93cb['order']?_0x16a243:_0xfe0374>=_0x16a243['order']?{'id':_0x17ebbc,'order':_0xfe0374}:_0x16a243;},{'id':'','order':0x0}),_0x27d25e=_0x5e63be['getIndex'](this['_getButton'](_0x5528bf['id']));_0x5e63be['add'](_0xa2d1cf,_0x27d25e+0x1);}else _0x5e63be['add'](_0xa2d1cf);return _0xa2d1cf['on']('execute',()=>{this['toggleTabPanel'](_0x5d93cb['id']);}),_0xa2d1cf;}};const Gs=['overlay','sidebar','custom'],Ws=['left','right'];var Fs=class extends Bs{constructor(_0x5051a3,_0x49f85e={}){super(_0x5051a3,_0x49f85e),this['set']('type',_0x49f85e['type']||'sidebar'),this['set']('side',_0x49f85e['side']||'right'),this['set']('isVisible',_0x49f85e['visibleByDefault']??!0x0);const _0xb99908=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0xb99908['if']('type','ck-ai-tabs__overlay',_0x55eb6e=>'overlay'===_0x55eb6e),_0xb99908['if']('type','ck-ai-tabs__sidebar',_0x4dd47c=>'sidebar'===_0x4dd47c),_0xb99908['if']('isVisible','ck-hidden',_0x390855=>!_0x390855)]}}),this['buttonViews']['on']('add',(_0x16db7f,_0x510b3d)=>{_0x510b3d['set']('withText',!0x1);});}activateTab(_0x331109){const {eventInfo:_0x37984f}=this['_fireBeforeActivateTab'](_0x331109);return!_0x37984f['stop']['called']&&(this['_finalizeActivateTab'](_0x331109),!0x0);}async activateTabAwaitingConfirmation(_0xf3d954){const {eventInfo:_0x5b7a55,activationConfirmed:_0x319f7e}=this['_fireBeforeActivateTab'](_0xf3d954,!0x0);return!(_0x5b7a55['stop']['called']&&!await _0x319f7e)&&(this['_finalizeActivateTab'](_0xf3d954),!0x0);}forceActivateTab(_0x5e7802){this['_finalizeActivateTab'](_0x5e7802);}_finalizeActivateTab(_0x24f671){super['activateTab'](_0x24f671);}_fireBeforeActivateTab(_0x3abc4a,_0xe91477=!0x1){if(null!==_0x3abc4a&&!this['getTab'](_0x3abc4a))throw new dt('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3abc4a});const _0x4c1b5f=this['activeTab'],_0x432eb4=new At(this,'beforeActivateTab');let _0x3dcdd2=()=>{};const _0x2295f2=new Promise(_0x15960a=>{_0x3dcdd2=_0x15960a;}),_0x2b6431={'newTab':_0x3abc4a,'oldTab':_0x4c1b5f};return _0xe91477&&(_0x2b6431['resolveActivation']=_0x3dcdd2),this['fire'](_0x432eb4,_0x2b6431),{'eventInfo':_0x432eb4,'activationConfirmed':_0x2295f2};}},Ks=class extends _0x4cd5fc{['view'];get bodyCollection(){return this['_overlayHost']['bodyCollection'];}_sidebarElement=null;_overlayHost;showResizeButton=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x502df5){if(super(_0x502df5),!this['context']['config']['get']('ai.container'))throw new dt('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x42a480=this['context']['config']['get']('ai.container');if(this['set']('side','right'),this['set']('container',null),void 0x0!==_0x42a480['showResizeButton']&&(this['showResizeButton']=_0x42a480['showResizeButton']),'sidebar'!==_0x42a480['type']&&'overlay'!==_0x42a480['type']||_0x42a480['side']&&(this['side']=_0x42a480['side']),'sidebar'===_0x42a480['type']){if(this['set']('type','sidebar'),this['_sidebarElement']=_0x42a480['element'],!_0x42a480['element'])throw new dt('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x42a480['type']?this['set']('type','overlay'):this['set']('type','custom');this['view']=new Fs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x42a480['visibleByDefault'],'collapsible':_0x42a480['collapsible']}),this['view']['render'](),this['view']['bind']('side')['to'](this,'side'),this['view']['bind']('type')['to'](this,'type'),this['_overlayHost']=new _0x5c12c0(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayMountTarget'](),'resolveInlineContainer':()=>this['container']}),this['bodyCollection']['bodyCollectionContainer']['classList']['add']('ck-ai-body'),this['_refreshContainer'](),this['_mountView'](),this['on']('change:container',()=>this['_mountView']()),this['on']('change:type',()=>this['_refreshContainer']()),this['on']('change:side',()=>this['_overlayHost']['sync']()),this['context']['editors']?this['listenTo'](this['context']['editors'],'add',(_0x1fbbc6,_0x2d0c79)=>this['_refreshContainerWhenReady'](_0x2d0c79)):this['context']instanceof _0x553634&&this['_refreshContainerWhenReady'](this['context']),this['context']instanceof _0x553634&&this['context']['ui']['focusTracker']['add'](this['view']['element']),this['listenTo'](this,'resizeTabs',()=>{this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);});}_refreshContainer(){if('sidebar'===this['type'])this['_sidebarElement']&&(this['container']=this['_sidebarElement']);else{if('overlay'===this['type']){const _0x1f1323=this['_configuredOverlayContainer'];if(_0x1f1323)return void(this['container']=_0x1f1323);for(const _0x91068c of this['_editors'])if('ready'===_0x91068c['state']){for(const _0x26513b of _0x91068c['editing']['view']['domRoots']['values']())if(_0x26513b['isConnected'])return void(this['container']=xt(_0x26513b));}this['container']=document['body'];}}}_refreshContainerWhenReady(_0x3919cb){this['listenTo'](_0x3919cb,'ready',()=>{'overlay'!==this['type']||this['container']&&this['container']!==document['body']||this['_refreshContainer'](),this['_overlayHost']['sync']();});}_mountView(){const _0x4b228a=this['view']['element'];'custom'!==this['type']&&this['container']&&Dt(_0x4b228a)!==this['container']&&this['container']['appendChild'](_0x4b228a),this['_overlayHost']['sync']();}_resolveOverlayMountTarget(){return this['_configuredOverlayContainer']?this['_configuredOverlayContainer']:this['container']?xt(this['container']):document['body'];}get _configuredOverlayContainer(){return this['_getConfiguredContainer']('ai.overlayContainer')||this['_getConfiguredContainer']('ui.overlayContainer');}_getConfiguredContainer(_0x347121){const _0x1ff5d9=this['context']['config']['get'](_0x347121);if(_0x1ff5d9)return _0x1ff5d9;for(const _0x54f7a7 of this['_editors']){const _0x1e998c=_0x54f7a7['config']['get'](_0x347121);if(_0x1e998c)return _0x1e998c;}return null;}get _editors(){return this['context']['editors']||(this['context']instanceof _0x553634?[this['context']]:[]);}switchType(_0xab090){if(_0xab090&&this['type']!==_0xab090){if(!Gs['includes'](_0xab090))throw new dt('ai-tabs-unsupported-ui-type');this['type']=_0xab090;}}switchSide(_0x1ff345){if(_0x1ff345&&this['side']!==_0x1ff345){if(!Ws['includes'](_0x1ff345))throw new dt('ai-tabs-unsupported-ui-side');this['side']=_0x1ff345;}}destroy(){super['destroy'](),this['_overlayHost']['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}},$s=class extends _0x4cd5fc{['_apiUrl'];get['_apiUrlV11'](){return this['_apiUrl']['replace'](/\/v1$/,'/v1.1');}_token;['_decoder'];static get requires(){return[_0x1e4e62];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c276c){if(super(_0x1c276c),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl')['replace'](/\/+$/,''),!this['_apiUrl']['endsWith']('/v1'))throw new dt('ai-service-url-invalid-version',this,{'serviceUrl':this['_apiUrl']});this['_token']=null,this['_decoder']=new TextDecoder();}init(){const _0x57f5b9=this['context']['plugins']['get'](_0x1e4e62);if(!_0x57f5b9['token'])throw new dt('ai-missing-token',this);this['_token']=_0x57f5b9['token'];}_getExtraHttpHeaders(){const _0x4fac73=this['context']['config']['get']('ai.extraHttpHeaders'),_0x1805be='function'==typeof _0x4fac73?_0x4fac73():_0x4fac73;if(Array['isArray'](_0x1805be)&&_0x1805be['length'])return Object['fromEntries'](_0x1805be['map'](({domain:_0x285c15,headers:_0x2d2aa2})=>[_0x285c15,_0x2d2aa2]));}startConversation(_0x37c04e,_0x218798){const _0x17107f=this['_sendApiRequest']('/conversations','POST',{'id':_0x37c04e,'group':_0x218798});return{'getConversation':async()=>(await _0x17107f['request'])['json'](),'abortController':_0x17107f['abortController']};}queryAssistant({message:_0x432b58,conversationId:_0x396ad6,parts:_0x479336,capabilities:_0x114ad8,model:_0x1fa243,attributes:_0x42ce20}){const _0x2f7946=this['_getExtraHttpHeaders'](),_0xb0ea2d={..._0x432b58&&{'prompt':_0x432b58},'content':_0x479336,'model':_0x1fa243,..._0x114ad8&&{'capabilities':_0x114ad8},..._0x42ce20&&{'attributes':_0x42ce20},..._0x2f7946&&{'extraHttpHeaders':_0x2f7946}},_0x1d46fa=this['_sendApiRequest']('/conversations/'+_0x396ad6+'/messages','POST',_0xb0ea2d,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x26d000=(await _0x1d46fa['request'])['body'];return this['_getStreamReader'](_0x26d000);},'abortController':_0x1d46fa['abortController']};}executeCustomAction({content:_0x534ccf,message:_0x268f59,model:_0x23a90c,outputFormat:_0x2c170f,contexts:_0x37c88a}){const _0x3378e0={'content':[{'type':'text','content':_0x534ccf}],..._0x268f59&&{'prompt':_0x268f59},'model':_0x23a90c,'outputFormat':_0x2c170f,...Ys(_0x37c88a)},_0x17ccbe=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3378e0);return{'getStream':async()=>{const _0x45d184=(await _0x17ccbe['request'])['body'];return this['_getStreamReader'](_0x45d184);},'abortController':_0x17ccbe['abortController']};}executeAction({actionName:_0x156586,content:_0x593a3f,args:_0x731209,contexts:_0xed543b}){const _0x5f01c6={'content':[{'type':'text','content':_0x593a3f}],'args':_0x731209,...Ys(_0xed543b)},_0x3586ba=this['_sendApiRequest']('/actions/system/'+_0x156586+'/calls','POST',_0x5f01c6);return{'getStream':async()=>{const _0xa0575a=(await _0x3586ba['request'])['body'];return this['_getStreamReader'](_0xa0575a);},'abortController':_0x3586ba['abortController']};}['uploadFile'](_0x468690,_0x277db6,_0xa0ea5){const _0x4f7daf=new FormData();_0x4f7daf['append']('file',_0x277db6,_0x277db6['name']),_0xa0ea5&&_0x4f7daf['append']('attributes',JSON['stringify'](_0xa0ea5));const _0xb315db=this['_sendApiRequest']('/conversations/'+_0x468690+'/files','POST',_0x4f7daf);return{'getId':async()=>(await _0xb315db['request'])['json'](),'abortController':_0xb315db['abortController']};}uploadDocuments(_0x4cf4d7,_0x261458){const _0x79c517={'documents':_0x261458['map'](_0x2c4348=>({'content':_0x2c4348['content'],'attributes':{'version':_0x2c4348['version'],'sessionId':_0x2c4348['sessionId'],'channelId':_0x2c4348['channelId'],'rootName':_0x2c4348['rootName'],'selections':_0x2c4348['selections']},...void 0x0!==_0x2c4348['name']?{'name':_0x2c4348['name']}:{},...void 0x0!==_0x2c4348['description']?{'description':_0x2c4348['description']}:{}}))},_0x1123b0=this['_sendApiRequest']('/conversations/'+_0x4cf4d7+'/documents/batch','POST',_0x79c517);return{'getIds':async()=>(await _0x1123b0['request'])['json'](),'abortController':_0x1123b0['abortController']};}fetchDocuments(_0x1ea157,_0x34751d){const _0x3c1ed9=new URLSearchParams();_0x3c1ed9['append']('documentIds',_0x34751d['join'](','));const _0x187f40=this['_sendApiRequest']('/conversations/'+_0x1ea157+'/documents/batch?'+_0x3c1ed9['toString'](),'GET');return{'getDocuments':async()=>(await _0x187f40['request'])['json'](),'abortController':_0x187f40['abortController']};}fetchConversations(_0x4fd8ed,_0x5698e9={}){const _0x2d952a=new URLSearchParams();_0x2d952a['append']('group',_0x4fd8ed),_0x2d952a['append']('excludeEmpty',!0x1!==_0x5698e9['excludeEmpty']?'true':'false'),_0x2d952a['append']('limit',_0x5698e9['limit']?_0x5698e9['limit']['toString']():0x64['toString']()),_0x2d952a['append']('sortBy',_0x5698e9['sortBy']?_0x5698e9['sortBy']:'createdAt'),_0x2d952a['append']('order',_0x5698e9['order']?_0x5698e9['order']:'desc');const _0x4b0faa=this['_sendApiRequest']('/conversations?'+_0x2d952a['toString'](),'GET');return{'getConversations':async()=>(await(await _0x4b0faa['request'])['json']())['items'],'abortController':_0x4b0faa['abortController']};}deleteConversation(_0x422380){const _0xc79d20=this['_sendApiRequest']('/conversations/'+_0x422380,'DELETE');return{'execute':async()=>{await _0xc79d20['request'];},'abortController':_0xc79d20['abortController']};}updateConversation(_0x23bd7a,_0x83a3e3){const _0xbbf2aa=this['_sendApiRequest']('/conversations/'+_0x23bd7a,'PATCH',_0x83a3e3);return{'getResult':async()=>(await _0xbbf2aa['request'],_0x83a3e3),'abortController':_0xbbf2aa['abortController']};}fetchConversation(_0x522b85){const _0x35207c=this['_sendApiRequest']('/conversations/'+_0x522b85,'GET');return{'getConversation':async()=>(await _0x35207c['request'])['json'](),'abortController':_0x35207c['abortController']};}fetchConversationMessages(_0x3741cb){const _0x339d64=this['_sendApiRequest']('/conversations/'+_0x3741cb+'/messages','GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getMessages':async()=>(await(await _0x339d64['request'])['json']())['items'],'abortController':_0x339d64['abortController']};}['uploadUrl'](_0x2bd95d,_0x245ea4,_0x18bca5){const _0x41d270=this['_sendApiRequest']('/conversations/'+_0x2bd95d+'/web-resources','POST',{'url':_0x245ea4,'attributes':_0x18bca5});return{'getId':async()=>(await _0x41d270['request'])['json'](),'abortController':_0x41d270['abortController']};}getModels(_0x4ffa08='en'){const _0x3d59f5=new URLSearchParams();_0x3d59f5['append']('language',_0x4ffa08);const _0xa68a0a='/models/1?'+_0x3d59f5['toString'](),_0x1bb655=this['_sendApiRequest'](_0xa68a0a,'GET');return{'list':async()=>await(await _0x1bb655['request'])['json'](),'abortController':_0x1bb655['abortController']};}listContexts(_0x1bc4d6={}){const _0x60a8f6=new URLSearchParams();_0x60a8f6['append']('limit',_0x1bc4d6['limit']?_0x1bc4d6['limit']['toString']():0x64['toString']()),_0x1bc4d6['cursor']&&_0x60a8f6['append']('cursor',_0x1bc4d6['cursor']),_0x1bc4d6['order']&&_0x60a8f6['append']('order',_0x1bc4d6['order']);const _0x4fc6a3=this['_sendApiRequest']('/contexts?'+_0x60a8f6['toString'](),'GET');return{'getContexts':async()=>(await(await _0x4fc6a3['request'])['json']())['items'],'abortController':_0x4fc6a3['abortController']};}deleteFile(_0x5d6651,_0x32a320){const _0x22c84e=this['_sendApiRequest']('/conversations/'+_0x5d6651+'/files/'+_0x32a320,'DELETE');return{'execute':async()=>{await _0x22c84e['request'];},'abortController':_0x22c84e['abortController']};}deleteDocument(_0xcb3e47,_0x4fe554){const _0x20f53f=this['_sendApiRequest']('/conversations/'+_0xcb3e47+'/documents/'+_0x4fe554,'DELETE');return{'execute':async()=>{await _0x20f53f['request'];},'abortController':_0x20f53f['abortController']};}deleteWebResource(_0x3f193c,_0x32d4f3){const _0x245639=this['_sendApiRequest']('/conversations/'+_0x3f193c+'/web-resources/'+_0x32d4f3,'DELETE');return{'execute':async()=>{await _0x245639['request'];},'abortController':_0x245639['abortController']};}cancelStream(_0x20fe5c,_0x3cbc8c){const _0x1462ee=this['_sendApiRequest']('/conversations/'+_0x20fe5c+'/messages/'+_0x3cbc8c+'/stream','DELETE',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'execute':async()=>{await _0x1462ee['request'];},'abortController':_0x1462ee['abortController']};}resumeStream(_0x39dd13,_0x106f73,_0x532b9b='0-0'){const _0x18467d=new URLSearchParams({'lastEventId':_0x532b9b}),_0x36b274=this['_sendApiRequest']('/conversations/'+_0x39dd13+'/messages/'+_0x106f73+'/stream?'+_0x18467d['toString'](),'GET',void 0x0,{'apiUrl':this['_apiUrlV11']});return{'getStream':async()=>{const _0x401b52=await _0x36b274['request'];return this['_getStreamReader'](_0x401b52['body']);},'abortController':_0x36b274['abortController']};}callSystemReview({reviewName:_0x26399e,content:_0x935cbc,args:_0x31c7ea,contexts:_0x150d16}){const _0x4de882=this['_sendApiRequest']('/reviews/system/'+_0x26399e+'/calls','POST',{'content':[{'type':'text','content':_0x935cbc}],'args':_0x31c7ea,...Ys(_0x150d16)});return{'getStream':async()=>{const _0x9eee7c=(await _0x4de882['request'])['body'];return this['_getStreamReader'](_0x9eee7c);},'abortController':_0x4de882['abortController']};}processDocument({content:_0x44676d,prompt:_0x54d732,model:_0x5f29d1,capabilities:_0x3881ac,contexts:_0x27981d}){const _0x2b6205=this['_getExtraHttpHeaders'](),_0x2b8182=this['_sendApiRequest']('/documents/process','POST',{'content':_0x44676d,'prompt':_0x54d732,'model':_0x5f29d1,..._0x3881ac&&{'capabilities':_0x3881ac},...Ys(_0x27981d),..._0x2b6205&&{'extraHttpHeaders':_0x2b6205}});return{'getResult':async()=>(await _0x2b8182['request'])['json'](),'abortController':_0x2b8182['abortController']};}callCustomReview({content:_0x494e7c,prompt:_0x5b54a6,model:_0x54392f,contexts:_0x4f2ba9}){const _0x382709=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x494e7c}],..._0x5b54a6&&{'prompt':_0x5b54a6},'model':_0x54392f,...Ys(_0x4f2ba9)});return{'getStream':async()=>{const _0x40c6d2=(await _0x382709['request'])['body'];return this['_getStreamReader'](_0x40c6d2);},'abortController':_0x382709['abortController']};}upsertAIChatRating(_0x13f11d,_0x8a36bc,_0x34a237){const _0x58369c=this['_sendApiRequest']('/conversations/'+_0x13f11d+'/messages/'+_0x8a36bc+'/ratings','PUT',{'positiveCount':_0x34a237['positiveCount'],'totalCount':_0x34a237['totalCount'],'modificationId':_0x34a237['modificationId']});return{'execute':async()=>{await _0x58369c['request'];},'abortController':_0x58369c['abortController']};}upsertAIActionRating(_0xff4f50,_0x12f7b9,_0x5232c1){const _0x1c09d1=this['_sendApiRequest']('/actions/system/'+_0xff4f50+'/calls/'+_0x12f7b9+'/ratings','PUT',{'positiveCount':_0x5232c1['positiveCount'],'totalCount':_0x5232c1['totalCount']});return{'execute':async()=>{await _0x1c09d1['request'];},'abortController':_0x1c09d1['abortController']};}upsertCustomAIActionRating(_0x2e225e,_0x279eeb){const _0x2d8eba=this['_sendApiRequest']('/actions/custom/calls/'+_0x2e225e+'/ratings','PUT',{'positiveCount':_0x279eeb['positiveCount'],'totalCount':_0x279eeb['totalCount']});return{'execute':async()=>{await _0x2d8eba['request'];},'abortController':_0x2d8eba['abortController']};}upsertAIReviewRating(_0x41db74,_0x5ec85f,_0x3b21f7,_0x40ab4a){const _0x195f04=this['_sendApiRequest']('/reviews/system/'+_0x41db74+'/calls/'+_0x5ec85f+'/ratings','PUT',{'positiveCount':_0x3b21f7['positiveCount'],'totalCount':_0x3b21f7['totalCount'],'dataId':_0x40ab4a});return{'execute':async()=>{await _0x195f04['request'];},'abortController':_0x195f04['abortController']};}upsertCustomAIReviewRating(_0x17ce47,_0x4a78ae,_0x1e3894){const _0x1e4af2=this['_sendApiRequest']('/reviews/custom/calls/'+_0x17ce47+'/ratings','PUT',{'positiveCount':_0x4a78ae['positiveCount'],'totalCount':_0x4a78ae['totalCount'],'dataId':_0x1e3894});return{'execute':async()=>{await _0x1e4af2['request'];},'abortController':_0x1e4af2['abortController']};}_sendApiRequest(_0x2f1e9a,_0x201ba4,_0x1832ef,_0x589dee={}){const {apiUrl:_0x4fecbe=this['_apiUrl']}=_0x589dee,_0x35fada=new AbortController(),_0x127cff=_0x1832ef instanceof FormData,_0x64a124={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':zt};_0x1832ef&&!_0x127cff&&(_0x64a124['Content-Type']='application/json');const _0x588e2a={'method':_0x201ba4,'headers':_0x64a124,'signal':_0x35fada['signal']};return _0x1832ef&&(_0x588e2a['body']=_0x127cff?_0x1832ef:JSON['stringify'](_0x1832ef)),{'request':fetch(''+_0x4fecbe+_0x2f1e9a,_0x588e2a)['catch'](_0x4f4605=>{this['_handleError'](_0x4f4605);})['then'](_0x342adb=>_0x342adb['ok']?_0x342adb:_0x342adb['json']()['then'](_0x287bb3=>{throw{'url':_0x4fecbe,'path':_0x2f1e9a,'method':_0x201ba4,'body':_0x1832ef,'status':(_0x342adb||{})['status'],'statusText':(_0x342adb||{})['statusText'],'code':_0x287bb3['code'],'message':_0x287bb3['message'],'traceId':_0x287bb3['traceId'],'data':_0x287bb3['data']};})),'abortController':_0x35fada};}async *_getStreamReader(_0x50e1a8){const _0x3eb948=[],_0xfc5327=_0x50e1a8['getReader'](),_0x1aa70e=_0x252d62({'onError':_0x5eb535=>{this['_handleError'](_0x5eb535);},'onEvent':_0x3b7da1=>{_0x3b7da1['data']=JSON['parse'](_0x3b7da1['data']),_0x3eb948['push'](_0x3b7da1);}});try{let _0x542cbf=!0x1;for(;!_0x542cbf;){const {done:_0x34a4d5,value:_0x920fea}=await _0xfc5327['read']();_0x34a4d5&&(_0x542cbf=!0x0),_0x1aa70e['feed'](this['_decoder']['decode'](_0x920fea,{'stream':!0x0})),yield*_0x3eb948,_0x3eb948['length']=0x0;}}catch(_0x14ee51){this['_handleError'](_0x14ee51);}finally{_0xfc5327['releaseLock'](),_0x1aa70e['reset']();}}['_handleError'](_0x2b3084){if(_0x2b3084 instanceof dt)throw _0x2b3084;if(_0x2b3084 instanceof Error&&'AbortError'===_0x2b3084['name'])throw new dt('ai-request-aborted',this,{'originalError':_0x2b3084});throw new dt('ai-request-failed',this,{'originalError':_0x2b3084});}};function Ys(_0x112866){return _0x112866?.['length']?{'contexts':_0x112866}:{};}function qs(_0x570297,_0x3ecb7d,_0x235b88){const t=_0x570297['t'];switch(_0x3ecb7d){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'},_0x235b88);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});case'AI_SUGGESTION_CONTENT_PART_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_OUTDATED','string':'Change\x20is\x20outdated'});case'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED':return t({'id':'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED','string':'Change\x20is\x20already\x20applied'});case'AI_SUGGESTION_CONTENT_PART_APPLY':return t({'id':'AI_SUGGESTION_CONTENT_PART_APPLY','string':'Apply\x20change'});case'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','string':'Add\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_REJECT':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECT','string':'Reject\x20change'});case'AI_SUGGESTION_CONTENT_PART_REMOVED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REMOVED','string':'Removed\x20content.\x20Use\x20\x22Show\x20details\x22\x20to\x20learn\x20more.'});case'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','string':'Approved'});case'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','string':'Rejected'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED','string':'Outdated'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','string':'Created\x20for\x20content\x20that\x20no\x20longer\x20exists.'});case'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP':return t({'id':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP','string':'Created\x20for\x20a\x20previous\x20version\x20of\x20the\x20document\x20and\x20can\x20no\x20longer\x20be\x20applied.'});case'AI_DISCLAIMER_TEXT':return t({'id':'AI_DISCLAIMER_TEXT','string':'AI\x20can\x20make\x20mistakes.\x20Please\x20double-check\x20responses.'});case'AI_TABS_LABEL_MAXIMIZE':return t({'id':'AI_TABS_LABEL_MAXIMIZE','string':'Maximize'});case'AI_TABS_LABEL_MINIMIZE':return t({'id':'AI_TABS_LABEL_MINIMIZE','string':'Minimize'});case'AI_CHAT_HEADING':return t({'id':'AI_CHAT_HEADING','string':'Chat'});case'AI_CHAT_SOURCES_HEADER':return t({'id':'AI_CHAT_SOURCES_HEADER','string':'Sources'});case'AI_CHAT_UNTITLED_CONVERSATION':return t({'id':'AI_CHAT_UNTITLED_CONVERSATION','string':'Untitled\x20conversation'});case'AI_CHAT_LABEL_NEW_CHAT':return t({'id':'AI_CHAT_LABEL_NEW_CHAT','string':'New\x20chat'});case'AI_CHAT_STOP_GENERATING':return t({'id':'AI_CHAT_STOP_GENERATING','string':'Stop\x20generating'});case'AI_CHAT_IS_WRITING':return t({'id':'AI_CHAT_IS_WRITING','string':'AI\x20is\x20writing...'});case'AI_CHAT_PROMPT_EMPTY_ERROR':return t({'id':'AI_CHAT_PROMPT_EMPTY_ERROR','string':'This\x20field\x20cannot\x20be\x20empty.'});case'AI_CHAT_LABEL_SUBMIT':return t({'id':'AI_CHAT_LABEL_SUBMIT','string':'Submit'});case'AI_CHAT_WELCOME_MESSAGE':return t({'id':'AI_CHAT_WELCOME_MESSAGE','string':'Hi!\x20I\x20can\x20help\x20you\x20draft,\x20rewrite,\x20and\x20improve\x20your\x20text,\x20explore\x20ideas,\x20research\x20topics,\x20and\x20solve\x20problems.\x20How\x20can\x20I\x20help\x20right\x20now?'});case'AI_CHAT_ABORTED_MESSAGE':return t({'id':'AI_CHAT_ABORTED_MESSAGE','string':'Response\x20stopped.'});case'AI_CHAT_GENERIC_ERROR':return t({'id':'AI_CHAT_GENERIC_ERROR','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_START_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_START_CONVERSATION','string':'Unable\x20to\x20start\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION':return t({'id':'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION','string':'Unable\x20to\x20load\x20chosen\x20conversation.\x20Please\x20make\x20sure\x20you\x20are\x20online\x20and\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE','string':'Failed\x20to\x20upload\x20files:\x20%0.\x20Please\x20try\x20again.'},_0x235b88);case'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED':return t({'id':'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED','string':'Folders\x20cannot\x20be\x20added\x20to\x20the\x20chat.\x20Try\x20adding\x20individual\x20files\x20instead.'});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.'},_0x235b88);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_PASTED_TEXT_NAME':return t({'id':'AI_CHAT_CONTEXT_PASTED_TEXT_NAME','string':'Pasted\x20Text'});case'AI_CHAT_DROP_ZONE_HINT':return t({'id':'AI_CHAT_DROP_ZONE_HINT','string':'Drop\x20files\x20here\x20to\x20add\x20to\x20the\x20chat'});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_LIBRARY_LABEL':return t({'id':'AI_CHAT_CONTEXT_LIBRARY_LABEL','string':'Context\x20library'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_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.'},_0x235b88);case'AI_CHAT_CONTEXT_INVALID_DATA':return t({'id':'AI_CHAT_CONTEXT_INVALID_DATA','string':'Invalid\x20context\x20data\x20type\x20for\x20the\x20selected\x20resource.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE','string':'Unsupported\x20resource\x20type.\x20Only\x20files\x20and\x20URLs\x20are\x20supported.'});case'AI_CHAT_CONTEXT_URL_EMPTY_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_EMPTY_ERROR','string':'URL\x20cannot\x20be\x20empty.'});case'AI_CHAT_CONTEXT_URL_INVALID_ERROR':return t({'id':'AI_CHAT_CONTEXT_URL_INVALID_ERROR','string':'Please\x20enter\x20a\x20valid\x20URL.'});case'AI_CHAT_INVALID_REQUEST':return t({'id':'AI_CHAT_INVALID_REQUEST','string':'Something\x20went\x20wrong\x20while\x20processing\x20your\x20request.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE':return t({'id':'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE','string':'The\x20file\x20type\x20is\x20not\x20supported.\x20Please\x20upload\x20a\x20different\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_LARGE':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_LARGE','string':'The\x20file\x20is\x20too\x20large.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES':return t({'id':'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES','string':'The\x20file\x20has\x20too\x20many\x20pages.\x20Please\x20upload\x20a\x20file\x20with\x20fewer\x20pages.'});case'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED':return t({'id':'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED','string':'The\x20form\x20data\x20size\x20limits\x20are\x20exceeded.\x20Please\x20upload\x20a\x20smaller\x20file.'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH','string':'AI\x20is\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_REASONING','string':'AI\x20is\x20using\x20reasoning\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING','string':'AI\x20is\x20using\x20reasoning\x20and\x20searching\x20the\x20web\x20to\x20provide\x20the\x20most\x20accurate\x20answer...'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH','string':'Scanned\x20the\x20internet\x20for\x20insights'});case'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING','string':'AI\x20used\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING':return t({'id':'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING','string':'AI\x20used\x20search\x20and\x20reasoning\x20to\x20improve\x20the\x20response'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR','string':'Ask\x20AI\x20anything...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH','string':'Ask\x20AI\x20anything\x20(web\x20search\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING','string':'Ask\x20AI\x20anything\x20(reasoning\x20enabled)...'});case'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING':return t({'id':'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING','string':'Ask\x20AI\x20anything\x20(web\x20search\x20and\x20reasoning\x20enabled)...'});case'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL','string':'Suggest\x20all'},_0x235b88);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x235b88);case'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL','string':'Apply\x20all'});case'AI_CHAT_SUGGESTION_ACTION_APPLY':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY','string':'Apply'});case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x235b88);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_MODEL_UNAVAILABLE_MESSAGE_TEXT':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT','string':'The\x20selected\x20model\x20is\x20no\x20longer\x20available,\x20so\x20you\x20cannot\x20continue\x20this\x20conversation.\x20Please\x20'});case'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON':return t({'id':'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON','string':'start\x20a\x20new\x20one.'});case'AI_CHAT_CONTEXT_SOURCES_LABEL':return t({'id':'AI_CHAT_CONTEXT_SOURCES_LABEL','string':'Sources'});case'AI_CHAT_HISTORY_HEADING':return t({'id':'AI_CHAT_HISTORY_HEADING','string':'Chat\x20History'});case'AI_CHAT_HISTORY_SEARCH_LABEL':return t({'id':'AI_CHAT_HISTORY_SEARCH_LABEL','string':'Search\x20history'});case'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY':return t({'id':'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','string':'No\x20chats\x20were\x20found\x20matching\x20\x22%0\x22.'},_0x235b88);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.'},_0x235b88);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.'},_0x235b88);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.'},_0x235b88);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_CHAT_BALLOON_HEADER_TITLE':return t({'id':'AI_CHAT_BALLOON_HEADER_TITLE','string':'Change\x20%0\x20of\x20%1'},_0x235b88);case'AI_BALLOON_REJECT_BUTTON':return t({'id':'AI_BALLOON_REJECT_BUTTON','string':'Reject'});case'AI_BALLOON_APPLY_BUTTON':return t({'id':'AI_BALLOON_APPLY_BUTTON','string':'Apply'});case'AI_BALLOON_SUGGEST_BUTTON':return t({'id':'AI_BALLOON_SUGGEST_BUTTON','string':'Suggest'});case'AI_BALLOON_NEXT_LABEL':return t({'id':'AI_BALLOON_NEXT_LABEL','string':'Next'});case'AI_BALLOON_PREVIOUS_LABEL':return t({'id':'AI_BALLOON_PREVIOUS_LABEL','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'This\x20change\x20is\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20of\x20the\x20changes\x20are\x20not\x20supported\x20by\x20the\x20editor\x20and\x20can\x27t\x20be\x20previewed\x20or\x20applied.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_ACTIONS_PREVIOUS_INTERACTION':return t({'id':'AI_ACTIONS_PREVIOUS_INTERACTION','string':'Previous'});case'AI_ACTIONS_NEXT_INTERACTION':return t({'id':'AI_ACTIONS_NEXT_INTERACTION','string':'Next'});case'AI_MODEL_NAME_AUTO':return t({'id':'AI_MODEL_NAME_AUTO','string':'Auto'});case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});case'AI_QUICK_ACTIONS_SEARCH':return t({'id':'AI_QUICK_ACTIONS_SEARCH','string':'Search\x20AI\x20commands'});case'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND','string':'No\x20AI\x20commands\x20found'});case'AI_QUICK_ACTIONS_ASK_AI':return t({'id':'AI_QUICK_ACTIONS_ASK_AI','string':'Ask\x20AI'});case'AI_QUICK_ACTIONS_CHAT_COMMANDS':return t({'id':'AI_QUICK_ACTIONS_CHAT_COMMANDS','string':'Chat\x20commands'});case'AI_QUICK_ACTIONS_IMPROVE_WRITING':return t({'id':'AI_QUICK_ACTIONS_IMPROVE_WRITING','string':'Improve\x20writing'});case'AI_QUICK_ACTIONS_CONTINUE_WRITING':return t({'id':'AI_QUICK_ACTIONS_CONTINUE_WRITING','string':'Continue\x20writing'});case'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING':return t({'id':'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING','string':'Fix\x20grammar\x20&\x20spelling'});case'AI_QUICK_ACTIONS_ADJUST_LENGTH':return t({'id':'AI_QUICK_ACTIONS_ADJUST_LENGTH','string':'Adjust\x20length'});case'AI_QUICK_ACTIONS_CHANGE_TONE':return t({'id':'AI_QUICK_ACTIONS_CHANGE_TONE','string':'Change\x20tone'});case'AI_QUICK_ACTIONS_TRANSLATE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE','string':'Translate'});case'AI_QUICK_ACTIONS_EXPLAIN':return t({'id':'AI_QUICK_ACTIONS_EXPLAIN','string':'Explain'});case'AI_QUICK_ACTIONS_SUMMARIZE':return t({'id':'AI_QUICK_ACTIONS_SUMMARIZE','string':'Summarize'});case'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS':return t({'id':'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS','string':'Highlight\x20key\x20points'});case'AI_QUICK_ACTIONS_MAKE_SHORTER':return t({'id':'AI_QUICK_ACTIONS_MAKE_SHORTER','string':'Make\x20shorter'});case'AI_QUICK_ACTIONS_MAKE_LONGER':return t({'id':'AI_QUICK_ACTIONS_MAKE_LONGER','string':'Make\x20longer'});case'AI_QUICK_ACTIONS_MORE_CASUAL':return t({'id':'AI_QUICK_ACTIONS_MORE_CASUAL','string':'More\x20casual'});case'AI_QUICK_ACTIONS_MORE_DIRECT':return t({'id':'AI_QUICK_ACTIONS_MORE_DIRECT','string':'More\x20direct'});case'AI_QUICK_ACTIONS_MORE_FRIENDLY':return t({'id':'AI_QUICK_ACTIONS_MORE_FRIENDLY','string':'More\x20friendly'});case'AI_QUICK_ACTIONS_MORE_CONFIDENT':return t({'id':'AI_QUICK_ACTIONS_MORE_CONFIDENT','string':'More\x20confident'});case'AI_QUICK_ACTIONS_MORE_PROFESSIONAL':return t({'id':'AI_QUICK_ACTIONS_MORE_PROFESSIONAL','string':'More\x20professional'});case'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT':return t({'id':'AI_QUICK_ACTIONS_ADJUST_BASED_ON_DOCUMENT','string':'Adjust\x20based\x20on\x20the\x20rest\x20of\x20the\x20document'});case'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH','string':'English'});case'AI_QUICK_ACTIONS_TRANSLATE_CHINESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_QUICK_ACTIONS_TRANSLATE_FRENCH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_FRENCH','string':'French'});case'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE','string':'Japanese'});case'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE','string':'Portuguese'});case'AI_QUICK_ACTIONS_TRANSLATE_KOREAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_KOREAN','string':'Korean'});case'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN','string':'Italian'});case'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN','string':'Russian'});case'AI_QUICK_ACTIONS_TRANSLATE_SPANISH':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_SPANISH','string':'Spanish'});case'AI_QUICK_ACTIONS_TRANSLATE_GERMAN':return t({'id':'AI_QUICK_ACTIONS_TRANSLATE_GERMAN','string':'German'});case'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x235b88);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});case'AI_ACTIONS_GENERIC_ERROR':return t({'id':'AI_ACTIONS_GENERIC_ERROR','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20response.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_BALLOON_SELECTION_REMOVED_ERROR':return t({'id':'AI_BALLOON_SELECTION_REMOVED_ERROR','string':'Changes\x20cannot\x20be\x20applied.\x20The\x20original\x20content\x20no\x20longer\x20exists.'});case'AI_REVIEW_MODE_STOP_GENERATING':return t({'id':'AI_REVIEW_MODE_STOP_GENERATING','string':'Stop\x20generating'});case'AI_REVIEW_MODE_HIDE_CHANGES':return t({'id':'AI_REVIEW_MODE_HIDE_CHANGES','string':'Hide\x20changes'});case'AI_REVIEW_MODE_SHOW_CHANGES':return t({'id':'AI_REVIEW_MODE_SHOW_CHANGES','string':'Show\x20changes'});case'AI_REVIEW_MODE_ACCEPT_ALL':return t({'id':'AI_REVIEW_MODE_ACCEPT_ALL','string':'Accept\x20all'});case'AI_REVIEW_MODE_REJECT_ALL':return t({'id':'AI_REVIEW_MODE_REJECT_ALL','string':'Reject\x20all'});case'AI_REVIEW_MODE_ACCEPT_REMAINING':return t({'id':'AI_REVIEW_MODE_ACCEPT_REMAINING','string':'Accept\x20remaining'});case'AI_REVIEW_MODE_REJECT_REMAINING':return t({'id':'AI_REVIEW_MODE_REJECT_REMAINING','string':'Reject\x20remaining'});case'AI_REVIEW_MODE_EXIT_REVIEW':return t({'id':'AI_REVIEW_MODE_EXIT_REVIEW','string':'Exit\x20review'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20review\x20after\x20exiting.'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Review\x20Mode'});case'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Review\x20Mode'});case'AI_REVIEW_MODE_PROGRESS':return t({'id':'AI_REVIEW_MODE_PROGRESS','string':'%0\x20of\x20%1\x20reviewed'},_0x235b88);case'AI_REVIEW_MODE_CONTENT_PART_TITLE':return t({'id':'AI_REVIEW_MODE_CONTENT_PART_TITLE','string':'Review\x20%0'},_0x235b88);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_SUGGEST_CHANGE':return t({'id':'AI_REVIEW_MODE_SUGGEST_CHANGE','string':'Suggest'});case'AI_REVIEW_MODE_LEARN_MORE':return t({'id':'AI_REVIEW_MODE_LEARN_MORE','string':'Learn\x20more'});case'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE','string':'Review\x20Mode\x20-\x20editor\x20is\x20read-only'});case'AI_REVIEW_MODE_NAVIGATION_COUNTER':return t({'id':'AI_REVIEW_MODE_NAVIGATION_COUNTER','string':'Review\x20%0\x20of\x20%1'},_0x235b88);case'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE','string':'Previous\x20change'});case'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE':return t({'id':'AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE','string':'Next\x20change'});case'AI_REVIEW_MODE_COMPLETED_TEXT':return t({'id':'AI_REVIEW_MODE_COMPLETED_TEXT','string':'There\x27s\x20nothing\x20left\x20to\x20review.'});case'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT':return t({'id':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20changes\x20to\x20suggest.'});case'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL','string':'Finish\x20Review'});case'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE':return t({'id':'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE','string':'Review\x20complete.\x20Finish\x20when\x20ready.'});case'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE':return t({'id':'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE','string':'AI\x20Review\x20initialized\x20with\x20errors.\x20Some\x20features\x20may\x20not\x20be\x20available\x20or\x20work\x20properly.'});case'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20the\x20whole\x20review\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE':return t({'id':'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE','string':'Not\x20everything\x20went\x20through,\x20but\x20the\x20completed\x20items\x20are\x20listed\x20below.'});case'AI_REVIEW_MODE':return t({'id':'AI_REVIEW_MODE','string':'Review'});case'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR':return t({'id':'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR','string':'Prompt\x20must\x20not\x20be\x20empty'});case'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL':return t({'id':'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL','string':'Review'});case'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER':return t({'id':'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER','string':'Describe\x20how\x20you\x20want\x20to\x20review\x20the\x20content'});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':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.'});case'AI_REVIEW_CHECK_CORRECTNESS_TITLE':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_TITLE','string':'Check\x20correctness'});case'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_CORRECTNESS_DESCRIPTION','string':'Verify\x20grammar,\x20spelling,\x20and\x20style'});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':'Remove\x20redundant\x20phrases,\x20simplify\x20wording,\x20and\x20suggest\x20active\x20voice.'});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':'Simplify\x20complex\x20sentences\x20and\x20highlight\x20formatting\x20that\x20makes\x20text\x20harder\x20to\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':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs'});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':'Make\x20your\x20writing\x20more\x20consistent\x20and\x20adapt\x20its\x20tone\x20to\x20match\x20the\x20intended\x20audience.'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_LABEL','string':'Adjust\x20tone\x20and\x20style'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CASUAL','string':'Casual'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_DIRECT','string':'Direct'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_FRIENDLY','string':'Friendly'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_CONFIDENT','string':'Confident'});case'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL':return t({'id':'AI_REVIEW_CHECK_MAKE_TONE_OPTIONS_DATA_PROFESSIONAL','string':'Professional'});case'AI_REVIEW_CHECK_TRANSLATE_TITLE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_TITLE','string':'Translate'});case'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_DESCRIPTION','string':'Translate\x20the\x20text\x20into\x20another\x20language.'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_LABEL','string':'Select\x20language'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ENGLISH','string':'English'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_SPANISH','string':'Spanish'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_FRENCH','string':'French'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_GERMAN','string':'German'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_CHINESE','string':'Chinese\x20(Simplified)'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_JAPANESE','string':'Japanese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_RUSSIAN','string':'Russian'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_PORTUGUESE','string':'Portuguese'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_KOREAN','string':'Korean'});case'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN':return t({'id':'AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_ITALIAN','string':'Italian'});case'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','string':'Accepted'});case'AI_REVIEW_MODE_CHECK_STATUS_REJECTED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','string':'Dismissed'});case'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED':return t({'id':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED','string':'Outdated'});case'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED','string':'Select\x20and\x20run\x20review'});case'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED':return t({'id':'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED','string':'Customize\x20and\x20run\x20review'});case'AI_REVIEW_MODE_COMPLETE_REVIEW':return t({'id':'AI_REVIEW_MODE_COMPLETE_REVIEW','string':'Complete'});case'AI_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});case'AI_TRANSLATE_ACCEPT_ALL':return t({'id':'AI_TRANSLATE_ACCEPT_ALL','string':'Accept\x20translation'});case'AI_TRANSLATE_FINISH_HEADER_TITLE':return t({'id':'AI_TRANSLATE_FINISH_HEADER_TITLE','string':'Translation\x20complete.\x20Finish\x20when\x20ready.'});case'AI_TRANSLATE_EMPTY_RESULTS_TEXT':return t({'id':'AI_TRANSLATE_EMPTY_RESULTS_TEXT','string':'There\x20are\x20no\x20translations\x20to\x20review.'});case'AI_TRANSLATE_FINISH_BUTTON_LABEL':return t({'id':'AI_TRANSLATE_FINISH_BUTTON_LABEL','string':'Finish\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE','string':'Content\x20Translation'});case'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION':return t({'id':'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION','string':'A\x20dedicated\x20mode\x20for\x20translating\x20the\x20entire\x20text.'});case'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE','string':'Translating\x20to'});case'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE':return t({'id':'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE','string':'Translated\x20to'});case'AI_TRANSLATE_GENERAL_ERROR_MESSAGE':return t({'id':'AI_TRANSLATE_GENERAL_ERROR_MESSAGE','string':'Sorry,\x20we\x20couldn\x27t\x20generate\x20translations\x20properly.\x20Please\x20try\x20again\x20in\x20a\x20moment.'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE','string':'Exit\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT','string':'You\x20can\x27t\x20continue\x20this\x20translation\x20after\x20exiting.'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON','string':'Stay\x20in\x20Translation\x20Mode'});case'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON':return t({'id':'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON','string':'Exit\x20Translation\x20Mode'});default:return _0x3ecb7d;}}const Qs=/* #__PURE__ -- @preserve */
|
|
25
|
+
It();var Xs=class extends Qs{_connector;['_config'];['_locale'];_modelList=[];_modelsRequest=null;constructor({connector:_0x506d7a,config:_0x36c88b,locale:_0x4bdac9}){super(),this['_connector']=_0x506d7a,this['_config']=_0x36c88b,this['_locale']=_0x4bdac9;}get['_availableModels'](){const _0x2dbef5=qt(this['_config']?.['displayedModels']??[])['filter'](_0x1f7ca8=>_0x1f7ca8['trim']());return _0x2dbef5['length']?_0x2dbef5:void 0x0;}get _defaultModelId(){return this['_config']?.['defaultModelId'];}async getAllModels(){return this['_modelsRequest']||(this['_modelsRequest']=this['_retrieveModels']()['catch'](_0x4715ce=>{throw this['_modelsRequest']=null,_0x4715ce;})),this['_modelsRequest'];}async getAvailableModels(){const _0x1a726d=await this['getAllModels']();let _0x4619da;return _0x4619da=this['_availableModels']?this['_filterModels'](_0x1a726d,this['_availableModels']):_0x1a726d['filter'](_0x245502=>_0x245502['recommended']),_0x4619da;}async['resolveModel'](_0x431a2d){const _0x4956c0=await this['getAllModels']();if(!_0x4956c0['length'])return null;if(_0x431a2d){const _0x11959a=this['_getModelById'](_0x4956c0,_0x431a2d);if(_0x11959a)return _0x11959a;Ft('ai-chat-model-id-unrecognized',{'modelId':_0x431a2d,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async getDefault(){const _0x40827d=await this['getAvailableModels']();if(!_0x40827d['length'])return null;if(this['_defaultModelId']){const _0x276109=this['_getModelById'](_0x40827d,this['_defaultModelId']);if(_0x276109)return _0x276109;Ft('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x40827d[0x0]['id']});}return _0x40827d[0x0];}async['isAvailable'](_0x3f0db3){return(await this['getAvailableModels']())['some'](_0x1d96c4=>_0x1d96c4['name']===_0x3f0db3['name']&&_0x1d96c4['provider']===_0x3f0db3['provider']);}async getModel(_0x211c8c){const _0x35e8fc=await this['getAllModels']();return this['_getModelById'](_0x35e8fc,_0x211c8c)||null;}async _retrieveModels(){if(!this['_modelList']['length']){const _0x257767=this['_locale']['uiLanguage']||'en',_0x46b525=await this['_connector']['getModels'](_0x257767)['list']();this['_modelList']=_0x46b525['items']['map'](_0x2b55da=>zs(_0x2b55da)?{..._0x2b55da,'name':qs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x2b55da);}return[...this['_modelList']];}_filterModels(_0x458592,_0xc5713c){let _0x5979ce;if(_0xc5713c){_0x5979ce=[];const _0x417a77=new Set(),_0x14d9e3='string'==typeof _0xc5713c?[_0xc5713c['toLocaleLowerCase']()]:_0xc5713c['map'](_0xb145dd=>_0xb145dd['toLocaleLowerCase']());for(const _0x40df85 of _0x14d9e3)for(const _0x319d39 of _0x458592)!_0x417a77['has'](_0x319d39['id'])&&this['_isMatchingFilter'](_0x319d39,_0x40df85)&&(_0x5979ce['push'](_0x319d39),_0x417a77['add'](_0x319d39['id']));}else _0x5979ce=_0x458592;return _0x5979ce;}_isMatchingFilter(_0x322845,_0x19eaf8){const _0x3f7242=_0x322845['id']['toLocaleLowerCase'](),_0x4aa1a6=_0x322845['name']['toLocaleLowerCase'](),_0xe4aff8=_0x322845['provider']['toLocaleLowerCase']();return _0x3f7242===_0x19eaf8||_0x4aa1a6===_0x19eaf8||zs(_0x322845)&&'auto'===_0x19eaf8||_0xe4aff8===_0x19eaf8||_0x3f7242['startsWith'](_0x19eaf8);}_getModelById(_0x181518,_0x11be44){return _0x181518['find'](_0x107e87=>zs(_0x107e87)&&'auto'===_0x11be44?_0x107e87:_0x107e87['id']===_0x11be44)||null;}};function zs(_0x48aeab){return _0x48aeab['id']['startsWith']('agent');}var js=class{_connector;_defaultContext;_contextsRequest=null;constructor({connector:_0x5e9f60,defaultContext:_0x568742}){this['_connector']=_0x5e9f60,this['_defaultContext']=_0x568742;}async getAllContexts(){return this['_contextsRequest']||(this['_contextsRequest']=this['_connector']['listContexts']()['getContexts']()['catch'](_0x364962=>{throw this['_contextsRequest']=null,_0x364962;})),[...await this['_contextsRequest']];}async getAvailableContexts(){const _0x34e21b=await this['getAllContexts'](),_0x218f3d=new Set((this['_defaultContext']??[])['map'](_0x10690f=>_0x10690f['id']));return _0x34e21b['filter'](_0x22fd9b=>!_0x218f3d['has'](_0x22fd9b['id']));}resolveContext({feature:_0x3d982c,ids:_0x1434ff=[],extraContexts:_0x37655c=[],idScopedOnly:_0x2e733a=!0x1,context:_0x373c52}){const _0x4cdd65=this['_resolveDefaultContext'](_0x3d982c,_0x1434ff,_0x2e733a);return _0x373c52['addDefaultContext']([..._0x4cdd65,..._0x37655c]),_0x373c52;}_resolveDefaultContext(_0x223eba,_0x501abf,_0x116748=!0x1){if(!this['_defaultContext'])return[];const _0x2d15aa=[];for(const _0xaa4602 of this['_defaultContext'])this['_entryAppliesToFeature'](_0xaa4602['features'],_0x223eba,_0x501abf)&&(_0x116748&&this['_entryAppliesToFeature'](_0xaa4602['features'],_0x223eba,[])||_0x2d15aa['push'](this['_toContextRef'](_0xaa4602)));return _0x2d15aa;}_toContextRef(_0x2a878c){return'promptId'in _0x2a878c?{'id':_0x2a878c['id'],'promptId':_0x2a878c['promptId']}:'fileId'in _0x2a878c?{'id':_0x2a878c['id'],'fileId':_0x2a878c['fileId']}:{'id':_0x2a878c['id']};}_entryAppliesToFeature(_0x214bbe,_0x580586,_0x2d6251){if(!_0x214bbe)return!0x0;const _0x38a0fc=_0x214bbe[_0x580586];return!!_0x38a0fc&&(!0x0===_0x38a0fc||_0x2d6251['some'](_0xd366c=>_0x38a0fc['test'](_0xd366c)));}},Js=class extends _0x4cd5fc{['models'];contextLibrary;static get['pluginName'](){return'AICore';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$s];}init(){const _0x47ca6d=this['context']['plugins']['get']($s);this['models']=new Xs({'connector':_0x47ca6d,'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']}),this['contextLibrary']=new js({'connector':_0x47ca6d,'defaultContext':this['context']['config']['get']('ai.defaultContext')});}};function Zs(_0x4725ec){return _0x4725ec?_0x4725ec instanceof _0x553634?[_0x4725ec]:_0x4725ec['editors']&&0x0!==_0x4725ec['editors']['length']?Array['from'](_0x4725ec['editors']):[]:[];}function tn(_0x116ba3){const _0x1f6835=Zs(_0x116ba3);if(!_0x1f6835['length'])throw new dt('ai-get-editor-from-context-no-editor');if(0x1===_0x1f6835['length'])return _0x1f6835[0x0];const _0x25ac1e=_0x1f6835['find'](_0x205a19=>_0x205a19['ui']?.['focusTracker']?.['isFocused']);if(_0x25ac1e)return _0x25ac1e;const _0x12397d=function(_0x13df9c){if(_0x13df9c instanceof _0x553634)return;const _0x22d636=_0x13df9c;if(!_0x22d636['plugins']||!_0x22d636['plugins']['has']('AIEditing'))return;return _0x22d636['plugins']['get']('AIEditing')['getLastContentFocusedEditor']?.();}(_0x116ba3);return _0x12397d&&_0x1f6835['includes'](_0x12397d)?_0x12397d:_0x1f6835[0x0];}function en(_0x18166f,_0xb27a14){return _0x15b430(_0x18166f,_0xb27a14);}function sn(_0x49171f,_0x232fa1){return _0x24a162(_0x49171f,_0x232fa1);}function nn(_0x491907,_0x52227e,_0x30b65f){const _0x22efa4=null!==_0x52227e?_0xa29066=>_0xa29066['attribs'][_0x491907]===_0x52227e:_0xb3d5dd=>Boolean(_0xb3d5dd['attribs'][_0x491907]);return _0x1b0303(_0x84f263=>_0x58049c(_0x84f263)&&_0x22efa4(_0x84f263),_0x30b65f);}function rn(_0x37f1ff,_0x52d5f8,_0x319c60){const _0x46a754=null!==_0x52d5f8?_0x237992=>_0x237992['attribs'][_0x37f1ff]===_0x52d5f8:_0x1e0787=>Boolean(_0x1e0787['attribs'][_0x37f1ff]);return _0x457f76(_0x17285f=>_0x58049c(_0x17285f)&&_0x46a754(_0x17285f),_0x319c60);}function on(_0x3aa4cf){return _0x457f76(_0xf47214=>_0x58049c(_0xf47214)&&function(_0xfefb02){const _0x12096d=_0xfefb02['toLowerCase']();return'script'===_0x12096d||'style'===_0x12096d||_0x12096d['includes']('-');}(_0xf47214['name']),_0x3aa4cf);}const an=['comment-start','comment-end','suggestion-start','suggestion-end'];function hn(_0x2c3291){return _0x58049c(_0x2c3291)&&an['includes'](_0x2c3291['name']['toLowerCase']());}function cn(_0x5b43ff){return _0x55659d(_0x5c3f62=>_0x1800e7(_0x5c3f62),_0x5b43ff,!0x0,0x1/0x0);}function ln(_0x1e6338,_0x34f2a7){return _0x1e6338&&_0x58049c(_0x1e6338)?_0x1e6338['attribs'][_0x34f2a7]:null;}function un(_0x4be30b,_0x15ffcd,_0x5982f7){_0x58049c(_0x4be30b)&&(null===_0x5982f7?delete _0x4be30b['attribs'][_0x15ffcd]:_0x4be30b['attribs'][_0x15ffcd]=_0x5982f7);}function dn(_0x40476e,_0xac9c8b,_0xef324f){const _0x4a6659=_0xac9c8b['cloneNode'](!0x0);'beforebegin'===_0xef324f?_0x1e83fe(_0x40476e,_0x4a6659):'afterbegin'===_0xef324f?_0x18efcf(_0x40476e,_0x4a6659):'beforeend'===_0xef324f?_0x4e05c7(_0x40476e,_0x4a6659):'afterend'===_0xef324f&&_0x4fa086(_0x40476e,_0x4a6659);}function _n(_0x20bf45){const _0x42d02c=[];let _0x123dff=_0x20bf45;for(;_0x123dff;)_0x123dff=_0x294335(_0x123dff),_0x123dff&&_0x42d02c['push'](_0x123dff);return _0x42d02c;}function gn(_0x32c18f){return _0x32c18f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function In(_0x54dac2){let _0x29f982=0x0;for(;_0x54dac2['parentNode'];)_0x54dac2=_0x54dac2['parentNode'],_0x29f982++;return _0x29f982;}function An(_0x3df40e){const _0xfc447b=[];let _0x52ce3e=_0x3df40e['nextSibling'];for(;_0x52ce3e;)_0xfc447b['push'](_0x52ce3e),_0x52ce3e=_0x52ce3e['nextSibling'];_0xfc447b['forEach'](_0x4abaf9=>{_0x15340f(_0x4abaf9);});}function En(_0x5d3dd2,_0x2623c8){return!!_0x5d3dd2['model']['document']['getRoot'](_0x2623c8)&&!_0x598751(_0x5d3dd2,_0x2623c8);}function pn(_0x3b119e,_0x87d1ad){return'<p\x20data-id=\x22'+_0x87d1ad+'\x22>'+_0x3b119e+'</p>';}function mn(_0xc71faf){return'p'===_0xc71faf['name']['toLowerCase']()&&Boolean(_0xc71faf['attribs']['data-id']);}function Tn(_0x5abaa5){const _0x48e9df=en(_0x5abaa5)['children']['filter'](_0x58049c);return 0x1===_0x48e9df['length']&&mn(_0x48e9df[0x0])?_0x48e9df[0x0]['children']['map'](_0x35248e=>sn(_0x35248e))['join'](''):_0x5abaa5;}function wn(_0x74c616,_0x3e3922){const _0x355dc1=function(_0x5cc73a){const _0x229f5d=_0x5cc73a['children']['filter'](_0x58049c);return 0x1===_0x229f5d['length']&&mn(_0x229f5d[0x0])?_0x229f5d[0x0]['children']:_0x5cc73a['children'];}(_0x3e3922),{blockElements:_0x4c43e4}=_0x74c616['editing']['view']['domConverter'],_0x53f3d3=_0x23e273=>_0x23e273['some'](_0x181100=>_0x58049c(_0x181100)&&('p'!==_0x181100['name']['toLowerCase']()&&_0x4c43e4['includes'](_0x181100['name']['toLowerCase']())||_0x53f3d3(_0x181100['children'])));if(_0x53f3d3(_0x355dc1))return!0x1;const _0x27c51d=_0x355dc1['map'](_0x5449d5=>sn(_0x5449d5))['join'](''),_0x452ceb=_0x74c616['data']['parse'](_0x27c51d,'$root'),{schema:_0x3a69c4}=_0x74c616['model'];let _0x260281=0x0;for(const {item:_0x399196}of _0x74c616['model']['createRangeIn'](_0x452ceb))if(_0x399196['is']('element')&&_0x3a69c4['isBlock'](_0x399196)&&(++_0x260281>0x1||'paragraph'!==_0x399196['name']))return!0x1;return!0x0;}function Cn(_0x39453f,_0x2d21b6){const _0x42dce9=_0x2d21b6['filter'](_0x5b1dc1=>'new'!=_0x5b1dc1['type'])['map'](_0x46b811=>nn('data-id',_0x46b811['id'],_0x39453f))['filter'](_0x1e52b4=>null!==_0x1e52b4),_0x58bd5d=_0x2d21b6['filter'](_0x2df4dd=>'removed'!=_0x2df4dd['type'])['map'](_0x4ba684=>_0x4ba684['node']['cloneNode'](!0x0));let _0x2d2c1b=null;if(_0x42dce9['length']){_0x2d2c1b=_0x42dce9[0x0]['previousSibling'];for(let _0x458e10=0x0;_0x458e10<_0x42dce9['length'];_0x458e10++)_0x15340f(_0x42dce9[_0x458e10]);}if(_0x58bd5d['length']){_0x2d2c1b||(_0x2d21b6[0x0]['anchorId']?_0x2d2c1b=nn('data-id',_0x2d21b6[0x0]['anchorId'],_0x39453f):(_0x2d2c1b=_0x58bd5d['shift'](),_0x18efcf(_0x39453f,_0x2d2c1b)));for(let _0x4f5c64=0x0;_0x4f5c64<_0x58bd5d['length'];_0x4f5c64++)_0x4fa086(_0x2d2c1b,_0x58bd5d[_0x4f5c64]),_0x2d2c1b=_0x58bd5d[_0x4f5c64];}}function fn(_0x3ee2cb,_0x16b63a){const _0x5f44a0=new Set();for(const _0x24722f of _0x3ee2cb){if(!_0x24722f['editor']||'destroyed'===_0x24722f['editor']['state']||!En(_0x24722f['editor'],_0x24722f['rootName']))continue;const _0x55c606=_0x16b63a['get'](_0x24722f['documentId']);let _0x55b963;_0x55c606?(_0x55b963=_0x55c606['cloneNode'](!0x0),Cn(_0x55b963,_0x24722f['changes'])):_0x55b963=new _0x47233a(_0x24722f['changes']['filter'](_0xafbd0f=>'removed'!=_0xafbd0f['type'])['map'](_0x104eeb=>_0x104eeb['node']['cloneNode'](!0x0))),wn(_0x24722f['editor'],_0x55b963)||_0x5f44a0['add'](_0x24722f['index']);}return _0x5f44a0;}function Rn(_0x4b1deb,_0x1d209e,_0x285439,_0x4cf99a){return En(_0x4b1deb,_0x1d209e)?wn(_0x4b1deb,en(_0x4cf99a))?{'before':Tn(_0x285439),'after':Tn(_0x4cf99a)}:null:{'before':_0x285439,'after':_0x4cf99a};}function bn(_0x99effb,_0xa91e2f){return{'isInline':En(_0x99effb,_0xa91e2f),'hostElement':Sn(_0x99effb,_0xa91e2f)};}function Sn(_0x5ada15,_0x48a505){const _0x539a26=On(_0x5ada15['config']['get']('roots')?.[_0x48a505]?.['element']);if(_0x539a26)return _0x539a26;const _0x232558=_0x5ada15['model']['document']['getRoot'](_0x48a505)?.['getAttribute']('$rootEditableOptions');return On(_0x232558?.['element'])||'div';}function On(_0x29ab2c){if(_0x29ab2c)return'string'==typeof _0x29ab2c?_0x29ab2c['toLowerCase']():_0x106ca2(_0x29ab2c)?_0x29ab2c['tagName']['toLowerCase']():_0x29ab2c['name']?.['toLowerCase']();}function vn(_0x38d98a,_0x48ad17){return _0x35ebf4(_0x38d98a,_0x48ad17);}function yn(_0x29b44c,_0x2a5dae){return _0x29b44c['map'](_0x31cbe8=>null!==_0x31cbe8&&'object'==typeof _0x31cbe8?vn(_0x31cbe8,_0x2a5dae):_0x31cbe8);}function Nn(_0x13a254){return _0x13a254 instanceof RegExp?String(_0x13a254):Array['isArray'](_0x13a254)?_0x13a254['map'](_0x1fa4e2=>Nn(_0x1fa4e2)):null!==_0x13a254&&'object'==typeof _0x13a254?Object['fromEntries'](Object['entries'](_0x13a254)['map'](([_0x4c052b,_0x46c3ff])=>[_0x4c052b,Nn(_0x46c3ff)])):_0x13a254;}const kn=[['BlockQuoteEditing','blockQuote'],['BoldEditing','bold'],['BookmarkEditing','bookmark'],['CodeEditing','code'],['HorizontalLineEditing','horizontalLine'],['HtmlEmbedEditing','htmlEmbed'],['ItalicEditing','italic'],['MathType','math'],['PageBreakEditing','pageBreak'],['Paragraph','paragraph'],['StandardEditingModeEditing','restrictedEditing'],['StrikethroughEditing','strikethrough'],['SubscriptEditing','subscript'],['SuperscriptEditing','superscript'],['TableOfContentsEditing','tableOfContents'],['Title','title'],['TodoListEditing','todoList'],['UnderlineEditing','underline']];function xn(_0x16219f,_0xda1634='main'){const _0x464a38={'editorVersion':zt,'rootType':bn(_0x16219f,_0xda1634)};if(_0x16219f['plugins']['has']('AlignmentEditing')&&(_0x464a38['alignment']=_0x16219f['config']['get']('alignment')),_0x16219f['plugins']['has']('CodeBlockEditing')&&(_0x464a38['codeBlock']=_0x16219f['config']['get']('codeBlock')),_0x16219f['plugins']['has']('FontBackgroundColorEditing')&&(_0x464a38['fontBackgroundColor']=vn(_0x16219f['config']['get']('fontBackgroundColor'),['documentColors','columns','colorPicker'])),_0x16219f['plugins']['has']('FontColorEditing')&&(_0x464a38['fontColor']=vn(_0x16219f['config']['get']('fontColor'),['documentColors','columns','colorPicker'])),_0x16219f['plugins']['has']('FontFamilyEditing')&&(_0x464a38['fontFamily']=_0x16219f['config']['get']('fontFamily'),_0x464a38['fontFamily']&&_0x464a38['fontFamily']['options']&&(_0x464a38['fontFamily']['options']=yn(_0x464a38['fontFamily']['options'],['model','upcastAlso']))),_0x16219f['plugins']['has']('FontSizeEditing')&&(_0x464a38['fontSize']=_0x16219f['config']['get']('fontSize'),_0x464a38['fontSize']&&_0x464a38['fontSize']['options']&&(_0x464a38['fontSize']['options']=yn(_0x464a38['fontSize']['options'],['upcastAlso']))),_0x16219f['plugins']['has']('FootnotesEditing')){const _0x19eaf2=_0x16219f['config']['get']('footnotes')??{};_0x19eaf2['footnotesProperties']&&'object'==typeof _0x19eaf2['footnotesProperties']&&(_0x19eaf2['footnotesProperties']=vn(_0x19eaf2['footnotesProperties'],['toolbar','listStyles'])),_0x464a38['footnotes']=_0x19eaf2;}if(_0x16219f['plugins']['has']('GeneralHtmlSupport')){const _0x50805f=_0x16219f['config']['get']('htmlSupport');_0x50805f&&(_0x464a38['htmlSupport']=Nn(vn(_0x50805f,['preserveEmptyBlocksInEditingView','htmlIframeSandbox','fullPage'])));}if(_0x16219f['plugins']['has']('HeadingEditing')&&(_0x464a38['heading']=_0x16219f['config']['get']('heading'),_0x464a38['heading']&&_0x464a38['heading']['options']&&(_0x464a38['heading']['options']=yn(_0x464a38['heading']['options'],['model','icon','class','converterPriority','upcastAlso']))),_0x16219f['plugins']['has']('HighlightEditing')&&(_0x464a38['highlight']=_0x16219f['config']['get']('highlight'),_0x464a38['highlight']&&_0x464a38['highlight']['options']&&(_0x464a38['highlight']['options']=yn(_0x464a38['highlight']['options'],['model','color']))),_0x16219f['plugins']['has']('ImageBlockEditing')||_0x16219f['plugins']['has']('ImageInlineEditing')){const _0x3adfa7=vn(_0x16219f['config']['get']('image'),['toolbar','upload','insert','resizeOptions']);_0x16219f['plugins']['has']('ImageResizeEditing')||delete _0x3adfa7['resizeUnit'],_0x16219f['plugins']['has']('ImageStyleEditing')?_0x3adfa7['styles']?.['options']&&(_0x3adfa7['styles']['options']=yn(_0x3adfa7['styles']['options'],['icon'])):delete _0x3adfa7['styles'],_0x464a38['image']=_0x3adfa7;}if(_0x16219f['plugins']['has']('IndentBlock')&&(_0x464a38['indentBlock']=_0x16219f['config']['get']('indentBlock')),_0x16219f['plugins']['has']('LineHeightEditing')&&(_0x464a38['lineHeight']=_0x16219f['config']['get']('lineHeight'),_0x464a38['lineHeight']&&(delete _0x464a38['lineHeight']['supportAllValues'],_0x464a38['lineHeight']['options']&&(_0x464a38['lineHeight']['options']=yn(_0x464a38['lineHeight']['options'],['model'])))),_0x16219f['plugins']['has']('LinkEditing')&&(_0x464a38['link']=vn(_0x16219f['config']['get']('link'),['toolbar'])),_0x16219f['plugins']['has']('ListEditing')){const _0x49897f=_0x16219f['config']['get']('list')??{};delete _0x49897f['enableListItemMarkerFormatting'],_0x16219f['plugins']['has']('ListPropertiesEditing')?_0x49897f['properties']&&_0x49897f['properties']['styles']&&'object'==typeof _0x49897f['properties']['styles']&&(_0x49897f['properties']['styles']=vn(_0x49897f['properties']['styles'],['listStyleTypes'])):delete _0x49897f['properties'],_0x464a38['list']=_0x49897f;}if(_0x16219f['plugins']['has']('MediaEmbedEditing')&&(_0x464a38['mediaEmbed']=_0x16219f['config']['get']('mediaEmbed'),_0x464a38['mediaEmbed']&&(delete _0x464a38['mediaEmbed']['toolbar'],_0x16219f['plugins']['has']('MediaEmbedResizeEditing')?_0x464a38['mediaEmbed']['resizeOptions']&&(_0x464a38['mediaEmbed']['resizeOptions']=_0x464a38['mediaEmbed']['resizeOptions']['map'](_0x594398=>vn(_0x594398,['icon','label']))):delete _0x464a38['mediaEmbed']['resizeOptions'],_0x16219f['plugins']['has']('MediaEmbedStyleEditing')?_0x464a38['mediaEmbed']['styles']&&_0x464a38['mediaEmbed']['styles']['options']&&(_0x464a38['mediaEmbed']['styles']['options']=yn(_0x464a38['mediaEmbed']['styles']['options'],['icon','title'])):delete _0x464a38['mediaEmbed']['styles'])),_0x16219f['plugins']['has']('MultiLevelListEditing')&&(_0x464a38['listMultiLevel']=_0x16219f['config']['get']('listMultiLevel')??{}),_0x16219f['plugins']['has']('MentionEditing')){const _0x23054d=vn(_0x16219f['config']['get']('mention'),['commitKeys','dropdownLimit']);_0x23054d['feeds']&&(_0x23054d['feeds']=_0x23054d['feeds']['map'](_0x1b4516=>vn(_0x1b4516,['minimumCharacters','itemRenderer','dropdownLimit']))),_0x464a38['mention']=_0x23054d;}if(_0x16219f['plugins']['has']('MergeFieldsEditing')){const _0x58eaea=vn(_0x16219f['config']['get']('mergeFields'),['previewModes','initialPreviewMode','previewHtmlValues','sanitizeHtml']);Array['isArray'](_0x58eaea['definitions'])&&(_0x58eaea['definitions']=_0x58eaea['definitions']['map'](_0x1ce705=>'groupId'in _0x1ce705?(Array['isArray'](_0x1ce705['definitions'])&&(_0x1ce705['definitions']=_0x1ce705['definitions']['map'](_0x8f3ec3=>vn(_0x8f3ec3,['defaultValue']))),_0x1ce705):vn(_0x1ce705,['defaultValue']))),_0x464a38['mergeFields']=_0x58eaea;}if(_0x16219f['plugins']['has']('ShiftEnter')&&(_0x464a38['shiftEnter']={}),_0x16219f['plugins']['has']('StyleEditing')&&(_0x464a38['style']=_0x16219f['config']['get']('style')),_0x16219f['plugins']['has']('TableEditing')){const _0x1781b6=vn(_0x16219f['config']['get']('table'),['contentToolbar','tableToolbar','showHiddenBorders']);_0x16219f['plugins']['has']('TablePropertiesEditing')?_0x1781b6['tableProperties']&&'object'==typeof _0x1781b6['tableProperties']&&(_0x1781b6['tableProperties']=vn(_0x1781b6['tableProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1781b6['tableProperties'],_0x16219f['plugins']['has']('TableCellPropertiesEditing')?_0x1781b6['tableCellProperties']&&'object'==typeof _0x1781b6['tableCellProperties']&&(_0x1781b6['tableCellProperties']=vn(_0x1781b6['tableCellProperties'],['colorPicker','borderColors','backgroundColors'])):delete _0x1781b6['tableCellProperties'],_0x16219f['plugins']['has']('TableLayoutEditing')?_0x1781b6['tableLayout']||(_0x1781b6['tableLayout']={}):delete _0x1781b6['tableLayout'],_0x16219f['plugins']['has']('TableCaptionEditing')?_0x1781b6['tableCaption']||(_0x1781b6['tableCaption']={}):delete _0x1781b6['tableCaption'],_0x464a38['table']=_0x1781b6;}_0x16219f['plugins']['has']('TextPartLanguageEditing')&&(_0x464a38['textPartLanguage']=_0x16219f['config']['get']('language.textPartLanguage'));for(const [_0x2a3ad6,_0x281b30]of kn)_0x16219f['plugins']['has'](_0x2a3ad6)&&(_0x464a38[_0x281b30]={});return _0x464a38;}const Ln='ai-selection',Dn=['br'];var Pn=class extends _0x4cd5fc{constructor(_0x1d29bb){super(_0x1d29bb),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}_outputDataProcessor;_fakeSelections=[];_sessionIdByEditor=new WeakMap();_lastContentFocusedEditor;static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}getLastContentFocusedEditor(){return this['_lastContentFocusedEditor'];}getSessionId(_0x1c5a3f){let _0x1e6f03=this['_sessionIdByEditor']['get'](_0x1c5a3f);return _0x1e6f03||(_0x1e6f03=_0x1c5a3f['plugins']['has']('RealTimeCollaborationClient')&&_0x1c5a3f['plugins']['get']('RealTimeCollaborationClient')['sessionId']||Xt(),this['_sessionIdByEditor']['set'](_0x1c5a3f,_0x1e6f03)),_0x1e6f03;}async getDocumentData(_0x2c57bf){const _0x18a97b=Zs(this['context']),_0x17a5f9=[],_0x54909b=new Set();for(const _0xef5a06 of _0x18a97b){if(_0x2c57bf&&!_0x2c57bf['has'](_0xef5a06['config']['get']('collaboration.channelId')))continue;const _0x17f19b=_0xef5a06['config']['get']('roots')||{},_0x1a6ddc=this['_getEditorSelectionSignature'](_0xef5a06),_0x2e5cbd=_0xef5a06['config']['get']('collaboration.channelId'),_0x51d163=this['getSessionId'](_0xef5a06);for(const _0x1efc34 of _0xef5a06['model']['document']['getRoots']()){if('$graveyard'===_0x1efc34['rootName'])continue;const _0x50ca0b=await this['_getDocumentDataForEditorRoot'](_0xef5a06,_0x1efc34,_0x54909b),_0xe3b2f3=_0x17f19b[_0x1efc34['rootName']],_0x1c5585=_0x1efc34['getAttribute']('$description')??_0xe3b2f3?.['description'];let _0x741692=_0x1efc34['getAttribute']('$title')??_0xe3b2f3?.['title'];_0x741692||(_0x741692=_0x1efc34['getAttribute']('$rootEditableOptions')?.['label']??_0xe3b2f3?.['label']),_0x741692||(Ft('ai-document-root-missing-title',{'editor':_0xef5a06,'rootName':_0x1efc34['rootName']}),_0x741692=_0x1efc34['rootName']),_0x17a5f9['push']({'editor':_0xef5a06,'rootName':_0x1efc34['rootName'],'content':_0x50ca0b['content'],'version':_0x50ca0b['version'],'sessionId':_0x51d163,'channelId':_0x2e5cbd,'selections':_0x50ca0b['selections'],'selectionSignature':_0x1a6ddc,'editorConfig':xn(_0xef5a06,_0x1efc34['rootName']),'name':_0x741692,'description':_0x1c5585});}}return _0x17a5f9;}getEditorsVersions(){const _0x4b2d56=Zs(this['context']),_0x5b6c01=new Map();for(const _0x3f5fe2 of _0x4b2d56){const _0x1e4b89=_0x3f5fe2['config']['get']('collaboration.channelId');_0x5b6c01['set'](_0x1e4b89,_0x3f5fe2['model']['document']['version']);}return _0x5b6c01;}getEditorsSelections(){const _0x28db3c=Zs(this['context']),_0x3a8625=new Map();for(const _0xd05256 of _0x28db3c){const _0x593020=_0xd05256['config']['get']('collaboration.channelId'),_0x49f3c4=this['_getEditorSelectionSignature'](_0xd05256);_0x3a8625['set'](_0x593020,_0x49f3c4);}return _0x3a8625;}_getEditorSelectionSignature(_0x31d035){return this['_getMarkersInDocumentOrder'](_0x31d035)['map'](_0x712b23=>{const _0x48c6ca=_0x712b23['getRange']();return _0x48c6ca['root']['rootName']+':'+_0x48c6ca['start']['path']['join']('.')+'-'+_0x48c6ca['end']['path']['join']('.');})['join']('|');}async _getDocumentDataForEditorRoot(_0x162b81,_0x37fd8b,_0x1a729a){const _0x3b84c2=_0x162b81['data']['toView'](_0x37fd8b,{'convertAiChatSelectionMarker':!0x0}),_0xb1d062=new _0x1cc48b(_0x162b81['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3b84c2,_0xb1d062,_0x1a729a);let _0x21b7a6=await this['_getDocumentDataStringFromView'](_0x3b84c2,_0x162b81);En(_0x162b81,_0x37fd8b['rootName'])&&(_0x21b7a6=pn(_0x21b7a6,this['_nextDataId'](_0x1a729a)));const _0x54ae84=this['_getMarkersInDocumentOrder'](_0x162b81,_0x37fd8b),_0x581e41=[];for(const _0x543591 of _0x54ae84){const _0x30e008='<'+_0x543591['name']+':start></'+_0x543591['name']+':start>',_0x180dc5=_0x21b7a6['indexOf'](_0x30e008);_0x21b7a6=_0x21b7a6['substring'](0x0,_0x180dc5)+_0x21b7a6['substring'](_0x180dc5+_0x30e008['length']);const _0x14931a='<'+_0x543591['name']+':end></'+_0x543591['name']+':end>',_0x4421bb=_0x21b7a6['indexOf'](_0x14931a);_0x21b7a6=_0x21b7a6['substring'](0x0,_0x4421bb)+_0x21b7a6['substring'](_0x4421bb+_0x14931a['length']),_0x581e41['push']({'markerName':_0x543591['name'],'start':_0x180dc5,'end':_0x4421bb,'htmlFragment':_0x21b7a6['substring'](_0x180dc5,_0x4421bb)});}return{'content':_0x21b7a6,'version':_0x162b81['model']['document']['version'],'selections':_0x581e41};}afterInit(){this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5b8e28,_0xc56bfb)=>{_0xc56bfb['on']('ready',()=>{this['_integrateEditor'](_0xc56bfb);});});}_setOutputDataProcessor(_0x3962e9){this['_outputDataProcessor']=_0x3962e9;}async _getDocumentDataStringFromView(_0x47f177,_0x2b7ed5){let _0x493783;if(this['_outputDataProcessor']){const _0xf74448=_0x2b7ed5['data']['processor']['domConverter']['viewToDom'](_0x47f177),_0x58c3a3=await this['_outputDataProcessor'](_0xf74448);_0x493783=_0x2b7ed5['data']['processor']['htmlWriter']['getHtml'](_0x58c3a3);}else _0x493783=_0x2b7ed5['data']['processor']['toData'](_0x47f177);return _0x493783;}_integrateEditor(_0x103cd7){if(!_0x103cd7['config']['get']('collaboration.channelId'))throw new dt('ai-missing-channel-id',_0x103cd7);_0x103cd7['ui']['focusTracker']['on']('change:isFocused',(_0x2861b2,_0x41264b,_0x3783e5)=>{_0x3783e5&&(this['_lastContentFocusedEditor']=_0x103cd7);}),_0x103cd7['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x103cd7&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x103cd7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ln,'view':({markerName:_0x2cefa3})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x2cefa3['split'](':')[0x1]],'priority':0xc})}),_0x103cd7['conversion']['for']('dataDowncast')['markerToElement']({'model':Ln+':context','view':(_0x297d1c,{writer:_0x97ed83,options:_0x58fe14})=>_0x58fe14['convertAiChatSelectionMarker']?_0x97ed83['createUIElement'](_0x297d1c['markerName']+':'+(_0x297d1c['isOpening']?'start':'end')):null});}showFakeVisualSelection(_0xa649bd){const _0x5c2d8b=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0xa649bd);const _0x135a87=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5c2d8b,_0x135a87);}hideFakeVisualSelection(_0x1770c4){const _0x49b1e8=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x1770c4);const _0x53c9f5=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x49b1e8,_0x53c9f5);}async modelToDataWithIds(_0x102e0a,_0x3e270c,_0x1c42ea){const _0xd8df18=_0x3e270c['data']['toView'](_0x102e0a),_0x3fa09f=new _0x1cc48b(_0x3e270c['editing']['view']['document']),_0x9e1668=new Set();this['_setDataIdsOnChildren'](_0xd8df18,_0x3fa09f,_0x9e1668);const _0xd7959d=await this['_getDocumentDataStringFromView'](_0xd8df18,_0x3e270c);return _0x1c42ea&&En(_0x3e270c,_0x1c42ea)?pn(_0xd7959d,this['_nextDataId'](_0x9e1668)):_0xd7959d;}_setDataIdsOnChildren(_0x46f89f,_0x47edfe,_0x1b81aa=new Set()){let _0x8a3add=!0x1;for(const _0x560236 of _0x46f89f['getChildren']()){if(!_0x560236['is']('view:element')||Dn['includes'](_0x560236['name']))continue;const _0x52f2a3=_0x560236['is']('view:containerElement'),_0x40ea11=_0x560236['is']('view:emptyElement'),_0x522b98=_0x560236['is']('view:rawElement'),_0x2d5a5c=this['_setDataIdsOnChildren'](_0x560236,_0x47edfe,_0x1b81aa);_0x560236['hasAttribute']('data-id')?(_0x8a3add=!0x0,_0x1b81aa['add'](_0x560236['getAttribute']('data-id'))):(_0x52f2a3||_0x40ea11||_0x522b98||_0x2d5a5c)&&(_0x47edfe['setAttribute']('data-id',this['_nextDataId'](_0x1b81aa),_0x560236),_0x8a3add=!0x0);}return _0x8a3add;}_nextDataId(_0x575163){let _0x460c0d;do{_0x460c0d='';for(let _0x753e3b=0x0;_0x753e3b<0x4;_0x753e3b++)_0x460c0d+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x575163['has'](_0x460c0d));return _0x575163['add'](_0x460c0d),_0x460c0d;}getSelectionText(_0x4e2e6a){const _0x5ae4f6=(_0x4e2e6a?_0x4e2e6a['model']:tn(this['context'])['model'])['document']['selection'],_0x37ac2e=[],_0x294207=Array['from'](_0x5ae4f6['getRanges']());_0x294207['sort']((_0x37e87e,_0x59a94d)=>_0x37e87e['start']['isBefore'](_0x59a94d['start'])?-0x1:0x1);for(const _0x28a4fe of _0x294207)for(const _0x4e886f of _0x28a4fe['getItems']())_0x4e886f['is']('$textProxy')?_0x37ac2e['push'](_0x4e886f['data']):_0x4e886f['is']('element')&&_0x37ac2e['length']>0x0&&'\x20'!==_0x37ac2e[_0x37ac2e['length']-0x1]&&_0x37ac2e['push']('\x20');return _0x37ac2e['length']?'\x22'+_0x37ac2e['join']('')['trim']()+'\x22':qs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}_removeFakeSelectionById(_0x2c1f13){for(let _0x1fbecb=0x0;_0x1fbecb<this['_fakeSelections']['length'];_0x1fbecb++)if(this['_fakeSelections'][_0x1fbecb]['id']==_0x2c1f13)return void this['_fakeSelections']['splice'](_0x1fbecb,0x1);}_addFakeSelection(_0x26f773){this['_removeFakeSelectionById'](_0x26f773['id']),Ht(this['_fakeSelections'],_0x26f773);}_refreshFakeSelection(_0x153164,_0x5a760a){if(_0x153164==_0x5a760a)return;const _0x2fde9b=_0x153164?_0x153164['editor']:null,_0x14ddd8=_0x5a760a?_0x5a760a['editor']:null,_0xa50d43=(_0x3da611,_0x50e5b3)=>{const _0x2d0dc8=_0x50e5b3['model']['markers']['getMarkersGroup'](Ln);for(const _0x4b6ccb of _0x2d0dc8)_0x3da611['removeMarker'](_0x4b6ccb);},_0x3b94c8=(_0x269e9b,_0x3cdad0,_0x5e78b4)=>{const _0xf1bedf=_0x3cdad0['model'];for(let _0x4af06c=0x0;_0x4af06c<_0x5e78b4['ranges']['length'];_0x4af06c++){let _0x2c111d=_0x5e78b4['ranges'][_0x4af06c];const _0x4ffc3a=Ln+':'+_0x5e78b4['id']+':'+_0x4af06c;if(_0x2c111d['start']['isAtEnd']){const _0x3b5c62=_0x2c111d['start']['getLastMatchingPosition'](({item:_0x12c6aa})=>!_0xf1bedf['schema']['isContent'](_0x12c6aa),{'boundaries':_0x2c111d});_0x2c111d=_0x269e9b['createRange'](_0x3b5c62,_0x2c111d['end']);}_0x269e9b['addMarker'](_0x4ffc3a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2c111d});}};_0x2fde9b&&_0x14ddd8&&_0x2fde9b===_0x14ddd8&&_0x5a760a?_0x2fde9b['model']['change'](_0x5bb86e=>{_0xa50d43(_0x5bb86e,_0x2fde9b),_0x3b94c8(_0x5bb86e,_0x14ddd8,_0x5a760a);}):(_0x2fde9b&&_0x2fde9b['model']['change'](_0x57c004=>_0xa50d43(_0x57c004,_0x2fde9b)),_0x14ddd8&&_0x5a760a&&_0x14ddd8['model']['change'](_0x413ec3=>_0x3b94c8(_0x413ec3,_0x14ddd8,_0x5a760a)));}_getMarkersInDocumentOrder(_0x1f15bf,_0x3c306c){const _0x14ae2d=Array['from'](_0x1f15bf['model']['markers']['getMarkersGroup'](Ln+':context'));return(_0x3c306c?_0x14ae2d['filter'](_0x4626ef=>{const _0x4a1ad9=_0x4626ef['getRange']();return _0x4a1ad9&&_0x4a1ad9['root']['rootName']===_0x3c306c['rootName'];}):_0x14ae2d)['sort']((_0x62ec9,_0x60940c)=>_0x62ec9['getStart']()['isBefore'](_0x60940c['getStart']())?-0x1:_0x62ec9['getStart']()['isAfter'](_0x60940c['getStart']())?0x1:0x0);}},Mn=class extends _0x4cd5fc{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentChangesUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['context']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x41d249=this['context'],_0x183cf6=_0x41d249['editors']||[_0x41d249],_0x5eec46=!_0x41d249['editors'];for(const _0x1e3a0a of _0x183cf6){let _0x129978;for(const _0x53861d in _0x1e3a0a){const _0x33023f=_0x53861d,_0x30f243=_0x1e3a0a[_0x33023f];if('documentChangesLicenseKeyValid'==_0x30f243||'documentChangesLicenseKeyInvalid'==_0x30f243||'documentChangesLicenseKeyExpired'==_0x30f243||'documentChangesLicenseKeyDomainLimit'==_0x30f243||'documentChangesLicenseKeyNotAllowed'==_0x30f243||'documentChangesLicenseKeyEvaluationLimit'==_0x30f243||'documentChangesLicenseKeyUsageLimit'==_0x30f243){delete _0x1e3a0a[_0x33023f],_0x129978=_0x30f243,_0x5eec46&&(clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0);break;}}'documentChangesLicenseKeyInvalid'==_0x129978&&_0x1e3a0a['_showLicenseError']('invalid'),'documentChangesLicenseKeyExpired'==_0x129978&&_0x1e3a0a['_showLicenseError']('expired'),'documentChangesLicenseKeyDomainLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('domainLimit'),'documentChangesLicenseKeyNotAllowed'==_0x129978&&_0x1e3a0a['_showLicenseError']('featureNotAllowed','DocumentChanges'),'documentChangesLicenseKeyEvaluationLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('evaluationLimit'),'documentChangesLicenseKeyUsageLimit'==_0x129978&&_0x1e3a0a['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Vn='$elementId',Hn='data-id';var Un=class extends _0x4cd5fc{static get['pluginName'](){return'DocumentChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[Mn];}async init(){!async function(_0x1100d1){const _0x589196='EMDS3dsLoJY0nbe9cmlCrXyaZ8zpPqN6jxThf7gwBi2KFOVUWRAG14HQIkut5v',_0xc10c0d=0x79710,_0x277882={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x9c90d2(_0x556136){const _0x5f129e=window['Promise']['resolve'](_0x556136),_0x25e5ab=window['Date']['now'](),_0x4dfb14=_0x556136['config']['get']('licenseKey');async function _0x3f4d1a(){let _0xe833a9,_0x181ccd=null,_0x42b208=null;try{return'GPL'==_0x4dfb14?'NotAllowed':(_0xe833a9=_0x529658(),_0xe833a9?(_0xe833a9['usageEndpoint']&&(_0x42b208=_0x4cdd61(_0xe833a9['usageEndpoint'],_0xe833a9['jti'])),await _0x2fe7f3()?_0x27e409()?_0xddc7c4()?'Expired':_0x3463be()?('evaluation'==_0xe833a9['licenseType']&&(_0x181ccd=_0x327913('EvaluationLimit')),await _0x3e74f8()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0xddc7c4(){const _0x474d05=['evaluation','trial']['includes'](_0xe833a9['licenseType'])?_0x25e5ab/0x3e8:0xe10*_0xc10c0d;return _0xe833a9['exp']<_0x474d05;}function _0x27e409(){const _0x51165c=_0xe833a9['features'];return!!_0x51165c&&(!!_0x51165c['includes']('*')||(!!_0x51165c['includes']('DIFF')||(!!_0x51165c['includes']('ET')||!!_0x51165c['includes']('CKAI'))));}function _0x3463be(){const _0xf3c878=_0xe833a9['licensedHosts'];if(!_0xf3c878||0x0==_0xf3c878['length'])return!0x0;const {hostname:_0x2e891a}=new URL(window['location']['href']);if(_0xf3c878['includes'](_0x2e891a))return!0x0;const _0x585e=_0x2e891a['split']('.');return _0xf3c878['filter'](_0x379676=>_0x379676['includes']('*'))['map'](_0x134dfe=>_0x134dfe['split']('.'))['filter'](_0x3ab565=>_0x3ab565['length']<=_0x585e['length'])['map'](_0x3c3d27=>Array(_0x585e['length']-_0x3c3d27['length'])['fill']('*'===_0x3c3d27[0x0]?'*':'')['concat'](_0x3c3d27))['some'](_0x5a465b=>_0x585e['every']((_0x48d489,_0x1cab8f)=>_0x5a465b[_0x1cab8f]===_0x48d489||'*'===_0x5a465b[_0x1cab8f]));}function _0x3e74f8(){return _0x181ccd&&_0x42b208?new window['Promise']((_0x3091db,_0x510d6a)=>{_0x181ccd['then'](_0x3091db,_0x510d6a),_0x42b208['then'](_0x4d5ed0=>{'Valid'!=_0x4d5ed0&&_0x3091db(_0x4d5ed0);},_0x510d6a);}):_0x181ccd||_0x42b208||'Valid';}}function _0x4cdd61(_0x474a1d,_0x1fcf98){return new window['Promise'](_0x17c7b7=>{if(_0x128a0a())return _0x17c7b7('Valid');_0x108e8f(),_0x556136['decorate']('_sendUsageRequest');let _0x436d6c=!0x1;const _0x12c36a=Xt();function _0x212461(_0x10d272){return!!_0x10d272&&('object'==typeof _0x10d272||'function'==typeof _0x10d272)&&'function'==typeof _0x10d272['then']&&'function'==typeof _0x10d272['catch'];}function _0x125cda(_0x1f897c){_0x15ef28(_0x1f897c)['then'](_0x3cc0b1=>_0x3cc0b1&&'ok'==_0x3cc0b1['status']?_0x213950(_0x51d7a5(_0x12c36a+_0x1fcf98))!=_0x3cc0b1['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x280041=>(_0x58941b(),_0x280041),()=>{const _0x5bac14=_0x305bd0();return null==_0x5bac14?(_0x58941b(),'Valid'):_0x25e5ab-_0x5bac14>0x240c8400?'UsageLimit':'Valid';})['then'](_0x17c7b7)['catch'](()=>{_0x17c7b7('UsageLimit');});const _0x1c399d=0x36ee80;function _0x58941b(){const _0x4bb446='llct-'+_0x213950(_0x51d7a5(_0x474a1d)),_0x55fc6a=_0x39999e(_0x213950(window['Math']['ceil'](_0x25e5ab/_0x1c399d)));window['localStorage']['setItem'](_0x4bb446,_0x55fc6a);}function _0x305bd0(){const _0xe345c6='llct-'+_0x213950(_0x51d7a5(_0x474a1d)),_0x1e1c1c=window['localStorage']['getItem'](_0xe345c6);return _0x1e1c1c?window['parseInt'](_0x39999e(_0x1e1c1c),0x10)*_0x1c399d:null;}function _0x15ef28(_0x109107){return new window['Promise']((_0x442c50,_0x5a143a)=>{_0x109107['then'](_0x442c50,_0x5a143a),window['setTimeout'](_0x5a143a,0x1d4c0);});}}_0x556136['on']('_sendUsageRequest',(_0x26e7c4,_0x20d244)=>{if(_0x20d244[0x0]!=_0x474a1d)return _0x17c7b7('UsageLimit');_0x20d244[0x1]={..._0x20d244[0x1],'requestId':_0x12c36a};},{'priority':'high'}),_0x556136['on']('_sendUsageRequest',_0xa2a94f=>{_0x212461(_0xa2a94f['return'])&&(_0x436d6c=!0x0,_0x125cda(_0xa2a94f['return']));},{'priority':'low'}),_0x5f129e['then'](()=>{_0x436d6c||_0x17c7b7('UsageLimit');});});function _0x128a0a(){return'auto'==_0x556136['editing']['view']['_overlayModeHint'];}function _0x108e8f(){_0x556136['editing']['view']['_overlayModeHint']='auto';}}function _0x327913(_0x209aee){const _0x4b2d17=[new window['Promise'](_0x556a10=>setTimeout(_0x556a10,0x93ecc)),_0x5f129e['then'](()=>new window['Promise'](_0x44798e=>{let _0x511e21=0x0;_0x556136['model']['on']('applyOperation',(_0x239f5c,_0x222423)=>{_0x222423[0x0]['isDocumentOperation']&&_0x511e21++,0x5e8==_0x511e21&&(_0x44798e(),_0x239f5c['off']());});}))];return window['Promise']['race'](_0x4b2d17)['then'](()=>_0x209aee);}async function _0x6e0a1e(){await _0x5f129e,_0x1100d1['getDiff']=_0x19178e,_0x1100d1['_createDiff']=_0x19178e,_0x556136['model']['change']=_0x19178e,_0x556136['model']['enqueueChange']=_0x19178e,_0x556136['enableReadOnlyMode']('model');}function _0x101ef2(_0x548e4b){const _0xd94492=_0x3ac9e3();_0x556136[_0xd94492]='documentChangesLicenseKey'+_0x548e4b,'Valid'!=_0x548e4b&&_0x6e0a1e();}function _0x3ac9e3(){const _0x37ef98=window['String'](window['performance']['now']())['replace']('.','');let _0x5527dc='E';for(let _0x18981c=0x0;_0x18981c<_0x37ef98['length'];_0x18981c+=0x2){let _0x16f58a=window['parseInt'](_0x37ef98['substring'](_0x18981c,_0x18981c+0x2));_0x16f58a>=0x3e&&(_0x16f58a-=0x3e),_0x5527dc+=_0x589196[_0x16f58a];}return _0x5527dc;}function _0x529658(){const _0x5c1f53=_0x4dfb14['split']('.');if(0x3!=_0x5c1f53['length'])return null;return _0x2d578(_0x5c1f53[0x1]);function _0x2d578(_0x11a4f8){const _0x2025e6=_0x4fd8bd(_0x11a4f8);return _0x2025e6&&_0x59b1b9()?_0x2025e6:null;function _0x59b1b9(){const _0x109b3a=_0x2025e6['jti'],_0x5a429c=window['parseInt'](_0x109b3a['substring'](_0x109b3a['length']-0x8),0x10),_0x64a184={..._0x2025e6,'jti':_0x109b3a['substring'](0x0,_0x109b3a['length']-0x8)};return delete _0x64a184['vc'],_0x51d7a5(_0x64a184)==_0x5a429c;}}}async function _0x2fe7f3(){let _0x5adb23=!0x0;try{const [_0x44b5b7,_0x2c7229,_0x3fe86d]=_0x4dfb14['split']('.');return _0x1045ee(_0x44b5b7),await _0x324f4c(_0x44b5b7,_0x2c7229,_0x3fe86d),_0x5adb23;}catch{return!0x1;}function _0x1045ee(_0x46f019){const _0x36db49=_0x4fd8bd(_0x46f019);_0x36db49&&'ES256'==_0x36db49['alg']||(_0x5adb23=!0x1);}async function _0x324f4c(_0x91c330,_0x47b6c1,_0x1b67dd){const _0x4b506d=window['Uint8Array']['from'](_0x3d9265(_0x1b67dd),_0x2eb6dd=>_0x2eb6dd['charCodeAt'](0x0)),_0x23220e=new window['TextEncoder']()['encode'](_0x91c330+'.'+_0x47b6c1),_0x9076f7=window['crypto']['subtle'];if(!_0x9076f7)return;const _0x4356e6=await _0x9076f7['importKey']('jwk',_0x277882,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x9076f7['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4356e6,_0x4b506d,_0x23220e)||(_0x5adb23=!0x1);}}function _0x4fd8bd(_0x2c6f01){return _0x2c6f01['startsWith']('ey')?JSON['parse'](_0x3d9265(_0x2c6f01)):null;}function _0x3d9265(_0x3a881e){return window['atob'](_0x3a881e['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x51d7a5(_0x5fd8f3){let _0x52619d=0x1505;function _0x16689d(_0x1717da){for(let _0x30c303=0x0;_0x30c303<_0x1717da['length'];_0x30c303++){const _0x4d041f=_0x1717da['charCodeAt'](_0x30c303);_0x52619d=(_0x52619d<<0x5)+_0x52619d+_0x4d041f,_0x52619d&=_0x52619d;}}function _0x571e1c(_0x4aa8b4){Array['isArray'](_0x4aa8b4)?_0x4aa8b4['forEach'](_0x571e1c):_0x4aa8b4&&'object'==typeof _0x4aa8b4?Object['entries'](_0x4aa8b4)['sort']()['forEach'](([_0x15e122,_0x1a1da1])=>{_0x16689d(_0x15e122),_0x571e1c(_0x1a1da1);}):_0x16689d(window['String'](_0x4aa8b4));}return _0x571e1c(_0x5fd8f3),_0x52619d>>>0x0;}function _0x213950(_0x4480fc){return _0x4480fc['toString'](0x10)['padStart'](0x8,'0');}function _0x39999e(_0x57b8b0){return _0x57b8b0['split']('')['reverse']()['join']('');}function _0x19178e(){}_0x101ef2(await _0x3f4d1a());}const _0xdb1ea1=_0x1100d1['context'],_0x12c48e=_0xdb1ea1['editors'];_0x12c48e?(_0x12c48e['forEach'](_0x4c4e5a),_0x1100d1['listenTo'](_0x12c48e,'add',(_0x37e592,_0x2b18c0)=>_0x4c4e5a(_0x2b18c0),{'priority':'highest'})):_0x4c4e5a(_0xdb1ea1);function _0x4c4e5a(_0x14fd56){_0x14fd56['once']('ready',()=>_0x9c90d2(_0x14fd56),{'priority':'highest'});}}(this),this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x23da75,_0x306bb9)=>{_0x306bb9['on']('ready',()=>{this['_integrateEditor'](_0x306bb9);});});}get editor(){if(this['context']instanceof _0x553634)return this['context'];{const _0x5f5b67=this['context']['editors']['first'];if(!_0x5f5b67)throw new dt('documentchanges-no-editor',this);return _0x5f5b67;}}getDiff(_0x36c346,_0x230ea7,_0x146668={'anchor':'main','markDeletions':!0x1}){return this['_createDiff'](_0x36c346,_0x230ea7,_0x146668)['getOperations']();}_getDiffWithOperationsData(_0x401d17,_0x4d8f52,_0x3af1f0={'anchor':'main','markDeletions':!0x1}){const _0x4312da=this['_createDiff'](_0x401d17,_0x4d8f52,_0x3af1f0);return{'operationsData':_0x4312da['getOperationsData'](),'operations':_0x4312da['getOperations']()};}_createDiff(_0x32d877,_0x2a4f4d,_0x1a26ce){const _0x2d934e=_0x1a26ce['targetEditor']||this['editor'],_0xf91de7=_0x1a26ce['anchor']??'main';let _0x2d7add,_0x352cbe;if('string'==typeof _0xf91de7){const _0x331028=_0x2d934e['model']['document']['getRoot'](_0xf91de7);if(!_0x331028)throw new dt('documentchanges-compare-no-root',this,{'anchor':_0xf91de7});_0x2d7add=_0x331028,_0x352cbe=_0x2d934e['model']['createPositionAt'](_0x331028,0x0);}else _0x2d7add=_0xf91de7['clone'](),_0x352cbe=_0xf91de7['clone']();const _0x47844f=_0x2d934e['data']['parse'](_0x32d877,_0x2d7add),_0x2f715a=_0x2d934e['data']['parse'](_0x2a4f4d,_0x2d7add);return new Bn({'editor':_0x2d934e,'before':_0x47844f,'after':_0x2f715a,'options':{'anchor':_0x352cbe,'markDeletions':_0x1a26ce['markDeletions']}});}isMarkedRemoveOperation(_0x4dacdd){return'marker'==_0x4dacdd['type']&&_0x4dacdd['name']['startsWith']('$markedRemove');}applyOperations(_0x35f8d9,_0xf397f8){const _0x18727f=_0x35f8d9['model'];for(const _0xfdfece of _0xf397f8)_0x3463ba(_0xfdfece)||(_0xfdfece instanceof _0x155687?_0x35f8d9['_addOperationForAffectedMarkers']('move',_0x3aaa22['_createFromPositionAndShift'](_0xfdfece['sourcePosition'],_0xfdfece['howMany'])):_0xfdfece instanceof _0xfcd33f?_0x35f8d9['_addOperationForAffectedMarkers']('merge',_0xfdfece['deletionPosition']):_0xfdfece instanceof _0x2070bd&&this['_fixMarkerOperationOldRange'](_0x18727f,_0xfdfece),_0xfdfece['baseVersion']=_0x18727f['document']['version'],_0x35f8d9['batch']['addOperation'](_0xfdfece),_0x18727f['applyOperation'](_0xfdfece));}_fixMarkerOperationOldRange(_0x1e1889,_0x2ce126){const _0x2c6e68=_0x1e1889['markers']['get'](_0x2ce126['name']);_0x2c6e68&&(_0x2ce126['oldRange']=_0x2c6e68['getRange']());}_integrateEditor(_0xf60f31){_0xf60f31['conversion']['for']('upcast')['add'](_0x4b7103=>{_0x4b7103['on']('element',(_0x326dcd,_0x264cb9,_0x1d7127)=>{if(_0x264cb9['modelRange']&&_0x1d7127['consumable']['consume'](_0x264cb9['viewItem'],{'attributes':'data-id'}))for(const _0x182779 of _0x264cb9['modelRange']['getItems']({'shallow':!0x0})){if(_0x182779['is']('$textProxy'))continue;const _0x57bc36=_0x264cb9['viewItem']['getAttribute'](Hn);_0x57bc36&&_0x1d7127['writer']['setAttribute'](Vn,_0x57bc36,_0x182779);}},{'priority':Kt['low']+0x1});}),_0xf60f31['model']['schema']['addAttributeCheck'](()=>!0x0,Vn);}},Bn=class{_editor;_diffItems=[];_markDeletions;['_anchor'];_operationsData=[];_path=[0x0];_parents=[];_splitPostponedData=new Map();constructor({editor:_0x2c2ba8,before:_0x5882ad,after:_0xe81f0c,options:_0x4e968c}){this['_editor']=_0x2c2ba8,this['_markDeletions']=!!_0x4e968c['markDeletions'],this['_anchor']=_0x4e968c['anchor'];const _0x3c8037=this['_tokenizeModel'](_0x5882ad),_0x5642e6=this['_tokenizeModel'](_0xe81f0c);this['_diffItems']=this['_diffModelTokens'](_0x3c8037,_0x5642e6),this['_calculateOperationsData'](),this['_markDeletions']||this['_calculateMarkersOperationsData'](_0x5882ad['markers'],_0xe81f0c['markers']);}getOperationsData(){return this['_operationsData'];}getOperations(){const _0x48f7be=this['_editor']['model']['document'],_0x4c1638=[];let _0x15e093=_0x48f7be['version'];for(const _0xc46730 of this['getOperationsData']())switch(_0xc46730['type']){case'attribute':{const _0x44536b=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x4152a4=_0x44536b['getShiftedBy'](_0xc46730['howMany']),_0x365cbb=new _0x3aaa22(_0x44536b,_0x4152a4),_0x1e5802=JSON['parse'](_0xc46730['oldValue']),_0x3ee886=JSON['parse'](_0xc46730['newValue']);_0x4c1638['push'](new _0x3d87a4(_0x365cbb,_0xc46730['key'],_0x1e5802,_0x3ee886,_0x15e093++));break;}case'insert':{const _0x5819cf=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x15a881=this['_makeModelFromTokens'](_0xc46730['tokens']);_0x4c1638['push'](new _0x38210e(_0x5819cf,_0x15a881,_0x15e093++));break;}case'remove':{const _0x1af0fc=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0xf02227=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0x155687(_0x1af0fc,_0xc46730['howMany'],_0xf02227,_0x15e093++));break;}case'rename':{const _0x40d45c=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']);_0x4c1638['push'](new _0x127e1f(_0x40d45c,_0xc46730['oldName'],_0xc46730['newName'],_0x15e093++));break;}case'split':{const _0x5d896f=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']),_0x1e6b48=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['path']['slice'](0x0,-0x1));_0x1e6b48['offset']++,_0x4c1638['push'](new _0xe7e0e0(_0x5d896f,Number['NEGATIVE_INFINITY'],_0x1e6b48,null,_0x15e093++));break;}case'merge':{const _0x18ebd2=_0xc46730['path']['slice'](),_0x22af14=_0x18ebd2['slice'](0x0,-0x1);_0x22af14[_0x22af14['length']-0x1]++,_0x22af14['push'](0x0);const _0x20e74b=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x22af14),_0x494be3=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x18ebd2),_0x37cc1c=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0xfcd33f(_0x20e74b,Number['NEGATIVE_INFINITY'],_0x494be3,_0x37cc1c,_0x15e093++));break;}case'marker':case'markedRemove':{let _0x480eec=null;if(_0xc46730['range']){const _0x568333=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['start']),_0x414728=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['end']);_0x480eec=new _0x3aaa22(_0x568333,_0x414728);}const _0xf3a9fb='marker'==_0xc46730['type']?_0xc46730['name']:'$markedRemove:'+Xt();_0x4c1638['push'](new _0x2070bd(_0xf3a9fb,null,_0x480eec,_0x48f7be['model']['markers'],!0x0,_0x15e093++));break;}case'unwrap':{const _0x313d17=_0xc46730['path']['slice']();_0x313d17['push'](0x0);const _0x4b02e1=_0xc46730['path']['slice'](),_0x6ae20e=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x313d17),_0x1d4118=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x4b02e1),_0xac4df6=new _0x265910(_0x48f7be['graveyard'],[0x0]);_0x4c1638['push'](new _0x155687(_0x6ae20e,_0xc46730['howMany'],_0x1d4118,_0x15e093++)),_0x4c1638['push'](new _0x155687(_0x1d4118['getShiftedBy'](_0xc46730['howMany']),0x1,_0xac4df6,_0x15e093++));break;}case'wrap':{const _0x401ad3=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['start']),_0x4df10c=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0xc46730['range']['end']),_0x936b94=_0xc46730['token']['element']['_clone'](!0x1);_0x936b94['_removeAttribute'](Vn);const _0x324db7=_0xc46730['range']['end']['slice']();_0x324db7['push'](0x0);const _0x55372a=this['_getPositionFromAnchorAndPath'](this['_anchor'],_0x324db7);_0x4c1638['push'](new _0x38210e(_0x4df10c,_0x936b94,_0x15e093++)),_0x4c1638['push'](new _0x155687(_0x401ad3,_0x4df10c['offset']-_0x401ad3['offset'],_0x55372a,_0x15e093++));break;}}return _0x4c1638;}_tokenizeModel(_0xfb4d4e){const _0x6b8925=[],_0x7897=_0x3aaa22['_createIn'](_0xfb4d4e),_0xabc606=new _0x3d1b58({'boundaries':_0x7897});let _0x23b2b0='',_0x12f99a=null;const _0x330f82=[''],_0x24beb8=new Map();for(const _0x1f6356 of _0xabc606)if('elementStart'==_0x1f6356['type']||'elementEnd'==_0x1f6356['type']){let _0x2d4f99=_0x330f82[0x0];''!==_0x23b2b0&&(_0x6b8925['push'](...this['_makeTokensFromTextByWords'](_0x23b2b0,_0x12f99a,_0x2d4f99)),_0x23b2b0='');const _0xb4c082=_0x1f6356['item'];let _0x4247c6;_0xb4c082['getAttribute']('$elementId')?_0x4247c6=_0xb4c082['getAttribute'](Vn):'elementStart'==_0x1f6356['type']?(_0x4247c6=Wn(_0xb4c082),_0x24beb8['set'](_0xb4c082,_0x4247c6)):_0x4247c6=_0x24beb8['get'](_0xb4c082);const _0x49b5b6=this['_getElementCategory'](_0xb4c082);'solid'==_0x49b5b6&&('elementStart'==_0x1f6356['type']?(_0x2d4f99=_0x4247c6,_0x330f82['unshift'](_0x2d4f99)):_0x330f82['shift']());const _0x4d9808={'type':'element','element':_0xb4c082,'elementId':_0x4247c6,'category':_0x49b5b6,'isStart':'elementStart'==_0x1f6356['type'],'limitId':_0x2d4f99};_0x6b8925['push'](_0x4d9808);}else''==_0x23b2b0&&(_0x12f99a=_0x1f6356['previousPosition']['clone']()),_0x23b2b0+=_0x1f6356['item']['data'];return''!==_0x23b2b0&&_0x6b8925['push'](...this['_makeTokensFromTextByWords'](_0x23b2b0,_0x12f99a,_0x330f82[0x0])),_0x6b8925;}_makeTokensFromTextByWords(_0x28a1c8,_0x529130,_0x144ef1){const _0x26efdb=_0x28a1c8['matchAll'](/(\s)/g),_0x2efbff=Array['from'](_0x26efdb)['map'](_0x3b7265=>_0x3b7265['index']);_0x2efbff['push'](_0x28a1c8['length']),0x0==_0x2efbff[0x0]&&_0x2efbff['shift']();const _0x30ca99=[],_0x107fd2=_0x529130['parent'];let _0x1fd824=0x0,_0x212005=_0x529130['offset'];for(let _0x753dc3=0x0;_0x753dc3<_0x2efbff['length'];_0x753dc3++)_0x30ca99['push']({'type':'text','data':_0x28a1c8['slice'](_0x1fd824,_0x2efbff[_0x753dc3]),'parent':_0x107fd2,'offset':_0x212005,'limitId':_0x144ef1}),_0x1fd824=_0x2efbff[_0x753dc3],_0x212005=_0x529130['offset']+_0x2efbff[_0x753dc3];return _0x30ca99;}_getElementCategory(_0x89889b){const _0x274134=this['_editor']['model']['schema'];return _0x274134['isLimit'](_0x89889b)||_0x274134['isContent'](_0x89889b)||_0x274134['isInline'](_0x89889b)?'solid':_0x274134['isBlock'](_0x89889b)?'block':function(_0x5b4522,_0x240c82){const _0x134121=_0x5b4522['parent'];if(!_0x134121||_0x134121['is']('documentFragment'))return!0x1;if(_0x240c82['checkChild'](_0x134121,'$text'))return!0x1;for(const _0x5a73c7 of _0x5b4522['getChildren']())if(_0x5a73c7['is']('$text'))return!0x0;return!0x1;}(_0x89889b,_0x274134)?'solid':'container';}['_diffModelTokens'](_0x38e0b4,_0x3962c9){const _0x116715=_0x3874b5(_0x38e0b4,_0x3962c9,{'comparator':Gn});this['_handleUnclosedBlockOpeningTags'](_0x116715);const _0x1c6863=_0x116715['flatMap'](_0x343f8f=>{const _0x463f5d=_0x343f8f['added']?'added':_0x343f8f['removed']?'removed':'unchanged';return _0x343f8f['value']['map'](_0x26b341=>({'token':_0x26b341,'change':_0x463f5d}));});let _0x2f9643=0x0;for(const _0x2ec466 of _0x1c6863)'added'!=_0x2ec466['change']&&('unchanged'==_0x2ec466['change']&&(_0x2ec466['before']=_0x38e0b4[_0x2f9643]),_0x2f9643++);return _0x1c6863;}['_handleUnclosedBlockOpeningTags'](_0x3070ec){for(let _0x10f7ef=0x0;_0x10f7ef<_0x3070ec['length']-0x1;_0x10f7ef++)if(_0x3070ec[_0x10f7ef]['removed']&&_0x3070ec[_0x10f7ef+0x1]['added']){const _0x466a24=this['_findUnclosedBlockOpeningToken'](_0x3070ec[_0x10f7ef]['value']);if(null!==_0x466a24){const _0x9a3432=this['_findUnclosedBlockOpeningToken'](_0x3070ec[_0x10f7ef+0x1]['value']),_0x2c1a2a=_0x3070ec[_0x10f7ef]['value']['splice'](_0x466a24),_0x184edc=_0x3070ec[_0x10f7ef+0x1]['value']['splice'](_0x9a3432),_0x3eab49=[_0x184edc['shift']()];_0x2c1a2a['shift']();const _0x483b3e={'value':_0x2c1a2a,'removed':!0x0},_0x398566={'value':_0x184edc,'added':!0x0},_0x5d1008={'value':_0x3eab49};_0x3070ec['splice'](_0x10f7ef+0x2,0x0,_0x5d1008,_0x483b3e,_0x398566);}}}['_findUnclosedBlockOpeningToken'](_0x22a17f){let _0x335bae=0x0,_0x54bdab=-0x1;for(let _0x16f9dc=0x0;_0x16f9dc<_0x22a17f['length'];_0x16f9dc++){const _0x566987=_0x22a17f[_0x16f9dc];'element'==_0x566987['type']&&'block'==_0x566987['category']&&(_0x335bae+=_0x566987['isStart']?0x1:-0x1,_0x566987['isStart']&&(_0x54bdab=_0x16f9dc));}return 0x0===_0x335bae?null:_0x54bdab;}_calculateOperationsData(){this['_handleUnwraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x25daa7=0x0;_0x25daa7<this['_diffItems']['length'];_0x25daa7++){const _0x19300a=this['_diffItems'][_0x25daa7]['change'],_0x31e51c=[];_0x31e51c['push'](this['_diffItems'][_0x25daa7]);let _0x40c262=_0x25daa7+0x1;for(;this['_diffItems'][_0x40c262]&&this['_diffItems'][_0x40c262]['change']==_0x19300a;)_0x31e51c['push'](this['_diffItems'][_0x40c262]),_0x40c262++,_0x25daa7++;const _0x2fdd41=_0x31e51c['map'](_0x529fab=>_0x529fab['token']);if('unchanged'==_0x19300a)_0x31e51c['map'](_0x401007=>_0x401007['before'])['forEach'](_0x48ecc9=>this['_traverseOverItem'](_0x48ecc9));else{if('removed'==_0x19300a){if(this['_markDeletions']){const _0x3afcea=this['_path']['slice']();_0x2fdd41['forEach'](_0x475a77=>this['_traverseOverItem'](_0x475a77));const _0x39fafc=this['_path']['slice']();this['_operationsData']['push']({'type':'markedRemove','range':{'start':_0x3afcea,'end':_0x39fafc}});}else this['_handleChanged'](_0x2fdd41,!0x0,this['_path']['slice']());}else{const _0x1e38ac=_0x2fdd41['filter'](_0x1f42cf=>'element'!=_0x1f42cf['type']||'container'!=_0x1f42cf['category']);this['_handleChanged'](_0x1e38ac,!0x1,this['_path']);}}}this['_handleWraps'](),this['_path']=[0x0],this['_parents']=[];for(let _0x1447d0=0x0;_0x1447d0<this['_diffItems']['length'];_0x1447d0++){const _0x4fe418=this['_diffItems'][_0x1447d0]['change'],_0xccec5c=[];_0xccec5c['push'](this['_diffItems'][_0x1447d0]);let _0x2335f0=_0x1447d0+0x1;for(;this['_diffItems'][_0x2335f0]&&this['_diffItems'][_0x2335f0]['change']==_0x4fe418;)_0xccec5c['push'](this['_diffItems'][_0x2335f0]),_0x2335f0++,_0x1447d0++;const _0xfa4670=_0xccec5c['map'](_0x4f283f=>_0x4f283f['token']);if('unchanged'==_0x4fe418){const _0x2d4373=_0xccec5c['map'](_0x3ba46a=>_0x3ba46a['before']);this['_handleUnchanged'](_0x2d4373,_0xfa4670);}else('added'==_0x4fe418||this['_markDeletions'])&&_0xfa4670['forEach'](_0x48d3bb=>{'element'==_0x48d3bb['type']&&_0x48d3bb['isStart']&&this['_splitPostponedData']['has'](_0x48d3bb['element'])&&this['_handleSplitPostponedData'](_0x48d3bb['element'],this['_path']),this['_traverseOverItem'](_0x48d3bb);});}}_handleSplitPostponedData(_0x5f26aa,_0x3a215e){const _0x26c583=this['_splitPostponedData']['get'](_0x5f26aa);for(const _0x30bec1 of _0x26c583)'rename'==_0x30bec1['type']?this['_operationsData']['push']({'type':'rename','path':_0x3a215e['slice'](),'oldName':_0x30bec1['oldValue'],'newName':_0x5f26aa['name']}):this['_operationsData']['push']({'type':'attribute','path':_0x3a215e['slice'](),'howMany':0x1,'key':_0x30bec1['key'],'oldValue':_0x30bec1['oldValue'],'newValue':JSON['stringify'](_0x5f26aa['getAttribute'](_0x30bec1['key'])??null)});}_calculateMarkersOperationsData(_0x265720,_0x1ca7ff){const _0x46961e={};for(const [_0x55da93]of _0x265720)_0x46961e[_0x55da93]=null;for(const [_0x1b1e17,_0x1dd997]of _0x1ca7ff)_0x46961e[_0x1b1e17]=_0x1dd997;const _0x4b7fd1=Object['entries'](_0x46961e)['map'](([_0x5f08ee,_0x574b4d])=>({'type':'marker','name':_0x5f08ee,'range':_0x574b4d?{'start':_0x574b4d['start']['path']['slice'](),'end':_0x574b4d['end']['path']['slice']()}:null}));this['_operationsData']['push'](..._0x4b7fd1);}['_handleUnwraps'](){const _0x185243=new Map(),_0x5215bd=[],_0x2073f3=[0x0];let _0x165ce2=this['_diffItems']['length']+0x1;for(let _0x58621f=this['_diffItems']['length']-0x1;_0x58621f>=0x0;_0x58621f--){const {token:_0x4502bd,before:_0x564351,change:_0x4b7e72}=this['_diffItems'][_0x58621f];if('removed'!=_0x4b7e72&&(_0x165ce2=_0x58621f),'element'!=_0x4502bd['type']||'container'!=_0x4502bd['category']||'added'==_0x4b7e72)continue;const _0xff4949=_0x564351?_0x564351['element']:_0x4502bd['element'];if(_0x4502bd['isStart']){const _0x6d9c09=_0x185243['get'](_0xff4949),_0xf4f1b7=this['_diffItems'][_0x6d9c09];('removed'==_0x4b7e72||'removed'==_0xf4f1b7['change'])&&_0x165ce2<_0x6d9c09&&(this['_operationsData']['push']({'type':'unwrap','path':_0xff4949['getPath'](),'howMany':_0xff4949['maxOffset']+_0x2073f3[0x0]}),_0x2073f3['shift'](),_0x2073f3[0x0]+=_0xff4949['maxOffset']-0x1,_0x5215bd['push'](_0x58621f),_0x5215bd['push'](_0x6d9c09));}else _0x185243['set'](_0xff4949,_0x58621f),_0x2073f3['unshift'](0x0);}_0x5215bd['sort']((_0x591758,_0x46cec5)=>_0x46cec5-_0x591758),_0x5215bd['forEach'](_0x3ecfaf=>{const _0x288e01=this['_diffItems'][_0x3ecfaf];'removed'==_0x288e01['change']?this['_diffItems']['splice'](_0x3ecfaf,0x1):(_0x288e01['change']='added',delete _0x288e01['before']);});}['_handleWraps'](){this['_path']=[0x0],this['_parents']=[];const _0xfe0eb4=[];for(let _0x4ac691=0x0;_0x4ac691<this['_diffItems']['length'];_0x4ac691++){const {change:_0x43b44c,token:_0x41449a}=this['_diffItems'][_0x4ac691];if('added'==_0x43b44c&&'element'==_0x41449a['type']&&'container'==_0x41449a['category']){if(_0x41449a['isStart'])_0xfe0eb4['push'](this['_path']['slice']());else{if(!_0x41449a['isStart']){const _0x2de2db=_0xfe0eb4['pop']();this['_operationsData']['push']({'type':'wrap','range':{'start':_0x2de2db,'end':this['_path']['slice']()},'token':_0x41449a}),this['_path'][this['_path']['length']-0x1]=_0x2de2db[this['_path']['length']-0x1]+0x1;}}}else('removed'!=_0x43b44c||this['_markDeletions'])&&this['_traverseOverItem'](_0x41449a);}}['_handleUnchanged'](_0x3adea4,_0x4a872f){for(let _0x4ea866=0x0;_0x4ea866<_0x3adea4['length'];_0x4ea866++){const _0x257ea3=_0x3adea4[_0x4ea866];if('element'==_0x257ea3['type']&&_0x257ea3['isStart']){const _0x4a73c4=_0x4a872f[_0x4ea866];'block'==_0x257ea3['category']&&this['_handleElementRename'](_0x257ea3['element'],_0x4a73c4['element'],this['_path']),this['_handleElementAttributeChanges'](_0x257ea3['element'],_0x4a73c4['element'],this['_path']),this['_path']['push'](0x0),this['_parents']['push'](_0x4a73c4);}else{if('element'!=_0x257ea3['type']||_0x257ea3['isStart']){if('text'==_0x257ea3['type']){const _0x135adf=this['_path']['slice'](),_0x4243a4=[],_0x14f5b0=[];for(;_0x3adea4[_0x4ea866]&&'text'==_0x3adea4[_0x4ea866]['type'];)_0x4243a4['push'](_0x3adea4[_0x4ea866]),_0x14f5b0['push'](_0x4a872f[_0x4ea866]),this['_path'][this['_path']['length']-0x1]+=_0x3adea4[_0x4ea866]['data']['length'],_0x4ea866++;_0x4ea866--,this['_handleTextAttributeChanges'](_0x4243a4,_0x14f5b0,_0x135adf);}}else this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']();}}}['_handleChanged'](_0x3f2f3e,_0x361a66,_0x3de69f){const _0x49f26a=[],_0x203079=[],_0x56466d=_0x3de69f['slice']();let _0x3f36ad=this['_parents']['length']-0x1;for(let _0x49dd87=0x0;_0x49dd87<_0x3f2f3e['length'];_0x49dd87++){const _0x293f0c=_0x3f2f3e[_0x49dd87],_0x5582a9=_0x3de69f['slice']();'element'!=_0x293f0c['type']||_0x293f0c['isStart']?'element'==_0x293f0c['type']&&_0x293f0c['isStart']?(_0x3de69f['push'](0x0),_0x3f36ad++,_0x203079['push']({'before':_0x5582a9,'after':_0x3de69f['slice'](),'index':_0x49dd87})):_0x3de69f[_0x3de69f['length']-0x1]+=_0x293f0c['data']['length']:(_0x3de69f['pop'](),_0x3de69f[_0x3de69f['length']-0x1]++,_0x3f36ad--,_0x203079['length']?_0x203079['pop']():_0x49f26a['push']({'before':_0x5582a9,'after':_0x3de69f['slice'](),'index':_0x49dd87}));}if(_0x203079['length']!==_0x49f26a['length'])throw new dt('model-diff-incorrect-matching-and-closing-tags',null,{'tokens':_0x3f2f3e,'isRemove':_0x361a66});const _0x4933f0=[{'after':_0x56466d['slice'](),'index':-0x1},..._0x49f26a,..._0x203079,{'before':_0x3de69f['slice'](),'index':_0x3f2f3e['length']}];if(_0x361a66){for(let _0x423f94=_0x4933f0['length']-0x1;_0x423f94>=0x1;_0x423f94--){const _0x5e2ef0=_0x4933f0[_0x423f94-0x1]['after'],_0x1a2cdc=_0x4933f0[_0x423f94]['before'],_0x3d96f6=_0x1a2cdc[_0x1a2cdc['length']-0x1]-_0x5e2ef0[_0x5e2ef0['length']-0x1];_0x3d96f6&&(this['_operationsData']['push']({'type':'remove','path':_0x5e2ef0,'howMany':_0x3d96f6}),_0x1a2cdc[_0x1a2cdc['length']-0x1]-=_0x3d96f6);}for(const {before:_0x1c7525}of _0x49f26a)this['_operationsData']['push']({'type':'merge','path':_0x1c7525});}else for(let _0x35bb49=0x0;_0x35bb49<_0x4933f0['length']-0x1;_0x35bb49++){const _0x4bff8e=_0x4933f0[_0x35bb49]['after'],_0x59cec7=_0x4933f0[_0x35bb49+0x1]['before'],_0x7cb3f8=_0x4933f0[_0x35bb49]['index']+0x1,_0x10ba5f=_0x4933f0[_0x35bb49+0x1]['index'];if(_0x7cb3f8!==_0x10ba5f&&this['_operationsData']['push']({'type':'insert','path':_0x4bff8e,'tokens':_0x3f2f3e['slice'](_0x7cb3f8,_0x10ba5f)}),_0x35bb49<_0x49f26a['length']){this['_operationsData']['push']({'type':'split','path':_0x59cec7});const _0x1628bc=_0x3f2f3e[_0x203079[_0x203079['length']-0x1-_0x35bb49]['index']],_0x1c4e59=this['_parents'][_0x3f36ad]['element'];_0x1c4e59['name']!=_0x1628bc['element']['name']&&this['_addSplitPostponedData'](_0x1628bc['element'],{'type':'rename','oldValue':_0x1c4e59['name']});const _0x4a0c29=this['_getAttributeChanges'](_0x1c4e59['getAttributes'](),_0x1628bc['element']['getAttributes']());for(const _0x2e0dfd in _0x4a0c29){const _0x9c4356=_0x4a0c29[_0x2e0dfd]['oldValue'];this['_addSplitPostponedData'](_0x1628bc['element'],{'type':'attribute','key':_0x2e0dfd,'oldValue':_0x9c4356});}}}}_addSplitPostponedData(_0x32be8b,_0x477564){const _0x344d94=this['_splitPostponedData']['get'](_0x32be8b)||[];_0x344d94['push'](_0x477564),this['_splitPostponedData']['set'](_0x32be8b,_0x344d94);}_traverseOverItem(_0x3c531d){'element'==_0x3c531d['type']&&_0x3c531d['isStart']?(this['_path']['push'](0x0),this['_parents']['push'](_0x3c531d)):'element'!=_0x3c531d['type']||_0x3c531d['isStart']?'text'==_0x3c531d['type']&&(this['_path'][this['_path']['length']-0x1]+=_0x3c531d['data']['length']):(this['_path']['pop'](),this['_path'][this['_path']['length']-0x1]++,this['_parents']['pop']());}_handleElementRename(_0x2e3ebc,_0x38b5f9,_0x5bc90b){_0x2e3ebc['name']!=_0x38b5f9['name']&&this['_operationsData']['push']({'type':'rename','path':_0x5bc90b['slice'](),'oldName':_0x2e3ebc['name'],'newName':_0x38b5f9['name']});}_handleElementAttributeChanges(_0x19af09,_0xea59f5,_0x5d6ae0){const _0x3ebf2d=this['_getAttributeChanges'](_0x19af09['getAttributes'](),_0xea59f5['getAttributes']());for(const _0x26b8a9 in _0x3ebf2d){const {oldValue:_0x3a5cda,newValue:_0x3559e6}=_0x3ebf2d[_0x26b8a9];this['_operationsData']['push']({'type':'attribute','path':_0x5d6ae0['slice'](),'howMany':0x1,'key':_0x26b8a9,'oldValue':_0x3a5cda,'newValue':_0x3559e6});}}_handleTextAttributeChanges(_0x19c2eb,_0x1cf0ec,_0xfc6f09){const _0x50fd80=this['_operationsData'],_0x59870f=_0x19c2eb[0x0]['parent'],_0x5a9bec=_0x19c2eb[0x0]['offset'],_0x449619=_0x1cf0ec[0x0]['parent'],_0xa7a778=_0x1cf0ec[0x0]['offset'],_0x3bb6c4=_0x19c2eb['reduce']((_0x331f48,_0xe362b)=>_0x331f48+_0xe362b['data']['length'],0x0),_0x394f44=this['_getAttrsForOffsets'](_0x59870f,_0x5a9bec,_0x3bb6c4),_0x2b7517=this['_getAttrsForOffsets'](_0x449619,_0xa7a778,_0x3bb6c4),_0x35eb0f={};for(let _0x109c3d=0x0;_0x109c3d<_0x3bb6c4;_0x109c3d++){const _0x4df471=_0x394f44[_0x5a9bec+_0x109c3d],_0x54195d=_0x2b7517[_0xa7a778+_0x109c3d],_0x4e4498=this['_getAttributeChanges'](_0x4df471,_0x54195d);for(const _0x26c71d in _0x35eb0f)_0x4e4498[_0x26c71d]||_0x4bb53c(_0x26c71d);for(const _0x3c078a in _0x4e4498){const {oldValue:_0x4b1b89,newValue:_0x162732}=_0x4e4498[_0x3c078a],_0x1336a2=_0x35eb0f[_0x3c078a];_0x1336a2?_0x1336a2['oldValue']==_0x4b1b89&&_0x1336a2['newValue']==_0x162732?_0x1336a2['length']++:(_0x4bb53c(_0x3c078a),_0x35eb0f[_0x3c078a]={'oldValue':_0x4b1b89,'newValue':_0x162732,'start':_0x109c3d,'length':0x1}):_0x35eb0f[_0x3c078a]={'oldValue':_0x4b1b89,'newValue':_0x162732,'start':_0x109c3d,'length':0x1};}}for(const _0x2f84f1 in _0x35eb0f)_0x4bb53c(_0x2f84f1);function _0x4bb53c(_0x490db3){const _0x1768c4=_0x35eb0f[_0x490db3],_0x597fd1=_0xfc6f09['slice']();_0x597fd1[_0x597fd1['length']-0x1]+=_0x1768c4['start'],_0x50fd80['push']({'type':'attribute','path':_0x597fd1,'howMany':_0x1768c4['length'],'key':_0x490db3,'oldValue':_0x1768c4['oldValue'],'newValue':_0x1768c4['newValue']}),delete _0x35eb0f[_0x490db3];}}_getAttributeChanges(_0x2b9606,_0x3e07ab){const _0x235055={};for(const [_0x39c3c2,_0x112b75]of _0x2b9606)_0x235055[_0x39c3c2]={'oldValue':JSON['stringify'](_0x112b75),'newValue':'null'};for(const [_0x455b2f,_0xb264e9]of _0x3e07ab){const _0x12b6e0=JSON['stringify'](_0xb264e9);_0x235055[_0x455b2f]?_0x235055[_0x455b2f]['oldValue']==_0x12b6e0?delete _0x235055[_0x455b2f]:_0x235055[_0x455b2f]['newValue']=_0x12b6e0:_0x235055[_0x455b2f]={'oldValue':'null','newValue':_0x12b6e0};}return delete _0x235055[Vn],_0x235055;}_getAttrsForOffsets(_0x6b13f2,_0x1c5bdd,_0x372541){const _0x6264ef=new Array(_0x1c5bdd+_0x372541);let _0xee81ab=_0x6b13f2['getChildAtOffset'](_0x1c5bdd),_0x13d8ec=_0xee81ab['startOffset'];for(;_0xee81ab&&_0x13d8ec<_0x1c5bdd+_0x372541;){const _0x1cb924=Array['from'](_0xee81ab['getAttributes']());_0x6264ef['fill'](_0x1cb924,_0x13d8ec,_0x13d8ec+_0xee81ab['offsetSize']),_0x13d8ec+=_0xee81ab['offsetSize'],_0xee81ab=_0xee81ab['nextSibling'];}return _0x6264ef;}_getPositionFromAnchorAndPath(_0x5e77c4,_0x33489c){const _0x3449a6=[..._0x5e77c4['path']['slice'](0x0,-0x1),_0x5e77c4['offset']+_0x33489c[0x0],..._0x33489c['slice'](0x1)];return new _0x265910(_0x5e77c4['root'],_0x3449a6);}['_makeModelFromTokens'](_0xce8a48){const _0x3f5d37=[];let _0x551f12=null;for(const _0x2492db of _0xce8a48)if('element'!=_0x2492db['type']||_0x2492db['isStart']||_0x551f12!=_0x2492db['element']){if(!_0x551f12){if('text'==_0x2492db['type']){const _0x37c066=_0x265910['_createAt'](_0x2492db['parent'],_0x2492db['offset']),_0x3c0b1b=_0x3aaa22['_createFromPositionAndShift'](_0x37c066,_0x2492db['data']['length']),_0x35c225=Array['from'](_0x3c0b1b['getItems']())['map'](_0x2d4fed=>new _0x55e0d0(_0x2d4fed['data'],_0x2d4fed['getAttributes']()));_0x3f5d37['push'](..._0x35c225);}else{_0x551f12=_0x2492db['element'];const _0x255f48=_0x2492db['element']['_clone'](!0x0);_0x255f48['_removeAttribute'](Vn);for(const _0x4b929c of this['_editor']['model']['createRangeIn'](_0x255f48)['getItems']())_0x4b929c['is']('element')&&_0x4b929c['_removeAttribute'](Vn);_0x3f5d37['push'](_0x255f48);}}}else _0x551f12=null;return _0x3f5d37;}};function Gn(_0x3f9f04,_0x1a42f5){return _0x3f9f04['type']===_0x1a42f5['type']&&(_0x3f9f04['limitId']===_0x1a42f5['limitId']&&('text'==_0x3f9f04['type']?_0x3f9f04['data']==_0x1a42f5['data']:function(_0x4d56ff,_0x1fec98){if(_0x4d56ff['isStart']!=_0x1fec98['isStart'])return!0x1;if(_0x4d56ff['isStart']&&_0x4d56ff['elementId']!=_0x1fec98['elementId'])return!0x1;if(_0x4d56ff['category']!=_0x1fec98['category'])return!0x1;if('block'==_0x4d56ff['category'])return!0x0;if('container'==_0x4d56ff['category']&&_0x4d56ff['elementId']!=_0x1fec98['elementId'])return!0x1;return _0x4d56ff['element']['name']==_0x1fec98['element']['name'];}(_0x3f9f04,_0x1a42f5)));}function Wn(_0x3ea4eb){return _0xab9059({'name':_0x3ea4eb['name'],...Object['fromEntries'](_0x3ea4eb['getAttributes']())});}const Fn=/* #__PURE__ -- @preserve */
|
|
26
|
+
mt();var Kn=class extends Fn{_generateUid;_uidCounter=0x0;_touchedNodesState={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null,'rescuedNewIds':new Set()};_existingDataIds=new Set();_referencedExistingIds=new Set();constructor(_0x11c429){super(),this['_generateUid']=_0x11c429||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x3b02f6,_0x3593d3,_0x1f47fa){this['_uidCounter']=0x0;const _0x3a6318=_0x3b02f6['cloneNode'](!0x0);qn(_0x3593d3,_0x3a6318);const _0x1795f2=_0x3a6318['childNodes'],_0x557c82=Array['from'](_0x1795f2)['filter'](_0x58a605=>!(0x3===_0x58a605['nodeType']&&''===sn(_0x58a605)['trim']())),_0x17752d=_0x557c82['length'];this['_existingDataIds']=new Set(rn('data-id',null,_0x3593d3)['map'](_0x270d05=>ln(_0x270d05,'data-id'))['filter'](_0x2b0415=>!!_0x2b0415));for(const _0x5eeac9 of _0x557c82)_0x5eeac9&&_0x58049c(_0x5eeac9)&&void 0x0===_0x5eeac9['attribs']['data-id']&&un(_0x5eeac9,'data-id','new-element');if(rn('data-id',null,_0x3a6318)['forEach'](_0x106afa=>{const _0x2b0109=ln(_0x106afa,'data-id');'new-element'===_0x2b0109||this['_existingDataIds']['has'](_0x2b0109)||un(_0x106afa,'data-id','new-element');}),0x0===_0x3593d3['childNodes']['length']){const _0x2e1c2a=[];return rn('data-id','new-element',_0x3a6318)['forEach'](_0x27166a=>{const _0x15afe0=this['_generateUid']();un(_0x27166a,'data-id',_0x15afe0),_0x2e1c2a['push'](_0x15afe0);}),this['_removeSpecialComments'](_0x3a6318),{'parsedContent':_0x3a6318,'newNodeIds':_0x2e1c2a,'modifiedNodeIds':[],'removedNodeIds':[]};}this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_touchedNodesState']['rescuedNewIds']=new Set(),this['_referencedExistingIds']=new Set();let _0x112741=-0x1,_0xab7786=!0x1;for(let _0x43267d=0x0;_0x43267d<_0x17752d;_0x43267d++){const _0x35aec1=_0x557c82[_0x43267d],_0x5b1680=_0x557c82[_0x43267d+0x1];if(this['_isNewNode'](_0x35aec1)){if(-0x1===_0x112741&&(_0x112741=_0x43267d),this['_markWrappedElements'](_0x35aec1),!this['_isNewNode'](_0x5b1680)){const [_0x1cb356,_0x2e1c28]=this['_findReferenceNode'](_0x35aec1,_0xab7786,_0x3593d3);if(_0x1cb356){const _0x193bea=Array['from'](_0x557c82)['slice'](_0x112741,_0x43267d+0x1);this['_insertNodes'](_0x1cb356,_0x193bea,_0x2e1c28),_0x112741=-0x1;}}}else{if(this['_isExistingContentComment'](_0x35aec1))_0xab7786=!0x0;else{if(this['_isExistingNode'](_0x35aec1)){const _0x1ad4eb=ln(_0x35aec1,'data-id');if(_0x1ad4eb&&this['_existingDataIds']['has'](_0x1ad4eb)){this['_referencedExistingIds']['add'](_0x1ad4eb);const _0x13abae=nn('data-id',_0x1ad4eb,_0x3593d3);this['_replaceNode'](_0x13abae,_0x35aec1);}}else{if($n(_0x35aec1)){const _0x1a1dea=Yn(_0x35aec1);nn('data-id',_0x1a1dea,_0x3a6318)||this['_touchedNodesState']['removedIds']['push'](_0x1a1dea);}}}}}for(const _0x2ced6f of this['_touchedNodesState']['removedIds']){const _0x2639af=nn('data-id',_0x2ced6f,_0x3593d3);_0x2639af&&(this['_rescueUnwrappedElements'](_0x2639af),this['_removeNode'](_0x2639af,_0x2ced6f,_0x1f47fa));}if(rn('data-id','new-element',_0x3593d3)['forEach'](_0x47e636=>{const _0x36f961=this['_getUid'](_0x47e636);un(_0x47e636,'data-id',_0x36f961),this['_touchedNodesState']['newIds']['push'](_0x36f961);}),this['_removeSpecialComments'](_0x3593d3),_0x1f47fa&&_0x1f47fa['cutAfterUnstable']){const _0x1308ea=this['_findLastConfirmationPoint'](_0x557c82),_0xb8396c=this['_getLastStableElement'](_0x3593d3,_0x1308ea);this['_markUnstableElements'](_0x3593d3,_0xb8396c);}if(this['_processWrappedElements'](_0x3593d3,_0x1f47fa),_0x1f47fa&&_0x1f47fa['cutAfterUnstable']&&this['_touchedNodesState']['lastTouchedId']){const _0x543ad8=rn('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3593d3);let _0xabc7d9=_0x543ad8[_0x543ad8['length']-0x1];for(;_0xabc7d9;)An(_0xabc7d9),_0xabc7d9=_0xabc7d9['parentNode'];}return{'parsedContent':_0x3593d3,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}_insertNodes(_0x504515,_0x532c7f,_0x484e6c){for(const _0x38152e of _0x532c7f){const _0x1adfda=this['_getUid'](_0x38152e);un(_0x38152e,'data-id',_0x1adfda),this['_touchedNodesState']['newIds']['push'](_0x1adfda),this['_touchedNodesState']['lastTouchedId']=_0x1adfda;}const _0x3a4b46='afterbegin'===_0x484e6c||'afterend'===_0x484e6c?_0x532c7f['reverse']():_0x532c7f;for(const _0x37b798 of _0x3a4b46)dn(_0x504515,_0x37b798,_0x484e6c);}['_replaceNode'](_0x43c374,_0x586867){if(!_0x43c374)return;if(_0x1fb64d=_0x586867,gn(sn(_0x43c374))===gn(sn(_0x1fb64d)))return;var _0x1fb64d;const _0x4589a5=ln(_0x43c374,'data-id');this['_touchedNodesState']['modifiedIds']['push'](_0x4589a5),this['_touchedNodesState']['lastTouchedId']=_0x4589a5,_0x418ed2(_0x43c374,_0x586867['cloneNode'](!0x0));}['_removeNode'](_0x1be261,_0x87da17,_0x1be224){if(_0x1be224&&_0x1be224['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x87da17;const _0x4fc393=_0x1be224['replaceRemovedWith']['cloneNode'](!0x0);un(_0x4fc393,'data-id',_0x87da17),un(_0x4fc393,'data-removed','true'),_0x418ed2(_0x1be261,_0x4fc393);}else _0x15340f(_0x1be261);}['_findReferenceNode'](_0x4869b9,_0xa85397,_0xb9fd5f){const _0x42f96e=this['_findPrevElementWithDataId'](_0x4869b9,!0x1);if(_0x42f96e){const _0x48d52b=Yn(_0x42f96e),_0x42ee62=nn('data-id',_0x48d52b,_0xb9fd5f);if(_0x42ee62)return[_0x42ee62,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x48d52b);}const _0x42b9cb=this['_findNextElementWithDataId'](_0x4869b9,!0x1);if(_0x42b9cb){const _0x185b19=Yn(_0x42b9cb),_0x71e3a3=nn('data-id',_0x185b19,_0xb9fd5f);if(_0x71e3a3)return[_0x71e3a3,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x185b19);}return _0xa85397?_0x4869b9['nextSibling']?this['_findFallbackReferenceNode'](_0x4869b9,_0xb9fd5f):[_0xb9fd5f['childNodes'][_0xb9fd5f['childNodes']['length']-0x1],'afterend']:[_0xb9fd5f['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3c0d32,_0x2e1059){const _0x3652b1=[],_0x1bb190=this['_findPrevElementWithDataId'](_0x3c0d32,!0x0);if(_0x1bb190){const _0x21ba25=nn('data-id',Yn(_0x1bb190),_0x2e1059);_0x21ba25&&_0x3652b1['push']([_0x21ba25,'afterend']);}const _0x58453d=this['_findNextElementWithDataId'](_0x3c0d32,!0x0);if(_0x58453d){const _0x1038e6=nn('data-id',Yn(_0x58453d),_0x2e1059);_0x1038e6&&_0x3652b1['push']([_0x1038e6,'beforebegin']);}return _0x3652b1['length']>0x1?In(_0x3652b1[0x0][0x0])<=In(_0x3652b1[0x1][0x0])?_0x3652b1[0x0]:_0x3652b1[0x1]:0x1===_0x3652b1['length']?_0x3652b1[0x0]:[_0x2e1059['lastChild'],'afterend'];}_findNextElementWithDataId(_0x2de6cd,_0x32c84e){let _0x45edc2=_0x2de6cd['nextSibling'],_0x5cacdd=null,_0x52c30f=!0x1;for(;_0x45edc2;){if(_0x1800e7(_0x45edc2)){if($n(_0x45edc2)&&(_0x5cacdd=_0x45edc2),this['_isExistingContentComment'](_0x45edc2)&&_0x32c84e&&!_0x52c30f){_0x52c30f=!0x0,_0x45edc2=_0x45edc2['nextSibling'];continue;}break;}const _0x14d353=ln(_0x45edc2,'data-id');if(_0x14d353&&'new-element'!==_0x14d353&&this['_existingDataIds']['has'](_0x14d353)){_0x5cacdd=_0x45edc2;break;}_0x45edc2=_0x45edc2['nextSibling'];}return _0x5cacdd;}_findPrevElementWithDataId(_0x5da110,_0x42b098){let _0x42ad00=_0x5da110['previousSibling'],_0x5347f4=null,_0x536a93=!0x1;for(;_0x42ad00;){if(_0x1800e7(_0x42ad00)){if($n(_0x42ad00)&&(_0x5347f4=_0x42ad00),this['_isExistingContentComment'](_0x42ad00)&&_0x42b098&&!_0x536a93){_0x536a93=!0x0,_0x42ad00=_0x42ad00['previousSibling'];continue;}break;}const _0x50a7fc=ln(_0x42ad00,'data-id');if(_0x50a7fc&&'new-element'!==_0x50a7fc&&this['_existingDataIds']['has'](_0x50a7fc)){_0x5347f4=_0x42ad00;break;}_0x42ad00=_0x42ad00['previousSibling'];}return _0x5347f4;}_markWrappedElements(_0x3c7d7a){_0x58049c(_0x3c7d7a)&&rn('data-id',null,_0x3c7d7a)['forEach'](_0x599315=>{this['_isExistingNode'](_0x599315)&&(un(_0x599315,'data-wrapped-id',ln(_0x599315,'data-id')),un(_0x599315,'data-id',null));});}_processWrappedElements(_0x1e4442,_0x4cb388){rn('data-wrapped-id',null,_0x1e4442)['forEach'](_0x5123e6=>{const _0x3fbc91=ln(_0x5123e6,'data-wrapped-id');if(this['_hasUnstableParent'](_0x5123e6))return;const _0x2b0d10=nn('data-id',_0x3fbc91,_0x1e4442);un(_0x5123e6,'data-id',_0x3fbc91),_0x2b0d10&&(this['_removeNode'](_0x2b0d10,_0x3fbc91,_0x4cb388),this['_touchedNodesState']['removedIds']['push'](_0x3fbc91),this['_touchedNodesState']['lastTouchedId']=_0x3fbc91);});}_hasUnstableParent(_0x1e143a){let _0x244de2=_0x1e143a['parentNode'];for(;_0x244de2;){if(ln(_0x244de2,'data-unstable'))return!0x0;_0x244de2=_0x244de2['parentNode'];}return!0x1;}_rescueUnwrappedElements(_0x465094){const _0x1b6fde=new Set(this['_touchedNodesState']['removedIds']),_0x59b091=new Set(this['_touchedNodesState']['newIds']);rn('data-id',null,_0x465094)['forEach'](_0x546371=>{const _0x40d85b=ln(_0x546371,'data-id'),_0x2f5917=!!_0x40d85b&&this['_referencedExistingIds']['has'](_0x40d85b),_0x1afdd2=!!_0x40d85b&&_0x59b091['has'](_0x40d85b);if(!_0x40d85b||!_0x2f5917&&!_0x1afdd2)return;if(_0x1b6fde['has'](_0x40d85b))return;let _0x23e374=_0x546371['parentNode'],_0x43e42a=!0x1;for(;_0x23e374;){if(_0x23e374===_0x465094){_0x43e42a=!0x0;break;}const _0x359c46=ln(_0x23e374,'data-id');if(_0x359c46&&(this['_referencedExistingIds']['has'](_0x359c46)||_0x59b091['has'](_0x359c46)))return;_0x23e374=_0x23e374['parentNode'];}if(_0x43e42a){if(_0x1e83fe(_0x465094,_0x546371),_0x2f5917){const _0x2d0e97=this['_generateUid'](),_0x361c0b=this['_touchedNodesState']['modifiedIds']['indexOf'](_0x40d85b);-0x1!==_0x361c0b&&this['_touchedNodesState']['modifiedIds']['splice'](_0x361c0b,0x1),un(_0x546371,'data-unwrapped-id',_0x40d85b),un(_0x546371,'data-id',_0x2d0e97),this['_touchedNodesState']['newIds']['push'](_0x2d0e97),this['_touchedNodesState']['rescuedNewIds']['add'](_0x2d0e97),this['_touchedNodesState']['lastTouchedId']=_0x2d0e97;}else this['_touchedNodesState']['rescuedNewIds']['add'](_0x40d85b),this['_touchedNodesState']['lastTouchedId']=_0x40d85b;}});}_getUid(_0x1b22c0){return this['_isExistingNode'](_0x1b22c0)?ln(_0x1b22c0,'data-id'):this['_generateUid']();}_removeSpecialComments(_0x15609c){cn(_0x15609c)['filter'](_0x42134e=>$n(_0x42134e)||this['_isExistingContentComment'](_0x42134e))['forEach'](_0x5dc819=>{_0x15340f(_0x5dc819);});}_findLastConfirmationPoint(_0x3cf68d){let _0x6d74d8=null,_0x13cf43=null,_0x4068c9=null,_0x3c00b3=null;const _0x59bb76=_0x573d91=>{_0x573d91&&(_0x6d74d8=_0x573d91),_0x4068c9=null,_0x3c00b3=null;};for(let _0x4f49df=0x0;_0x4f49df<_0x3cf68d['length'];_0x4f49df++){const _0x205cf9=_0x3cf68d[_0x4f49df];if(this['_isExistingContentComment'](_0x205cf9)){_0x59bb76(_0x13cf43);continue;}if(_0x58049c(_0x205cf9)){const _0x44cd0b=ln(_0x205cf9,'data-id'),_0x204c8a=_0x4f49df===_0x3cf68d['length']-0x1;if(_0x44cd0b&&'new-element'!==_0x44cd0b&&this['_touchedNodesState']['modifiedIds']['includes'](_0x44cd0b)&&!_0x204c8a){_0x59bb76(_0x44cd0b),_0x13cf43=_0x44cd0b;continue;}}let _0x86ca94;const _0x4e363b=Yn(_0x205cf9);if(_0x4e363b&&this['_touchedNodesState']['rescuedNewIds']['has'](_0x4e363b))_0x13cf43=_0x4e363b;else{if(_0x4e363b&&this['_touchedNodesState']['newIds']['includes'](_0x4e363b))_0x86ca94='N';else{if(!$n(_0x205cf9))continue;_0x86ca94='R';}_0x86ca94===_0x3c00b3||null===_0x3c00b3?_0x3c00b3=_0x86ca94:null!==_0x4068c9?(_0x59bb76(_0x13cf43),_0x3c00b3=_0x86ca94):(_0x4068c9=_0x3c00b3,_0x3c00b3=_0x86ca94),_0x13cf43=_0x4e363b;}}const _0x147d9f=_0x3cf68d[_0x3cf68d['length']-0x1];return _0x147d9f&&!_0x58049c(_0x147d9f)&&!$n(_0x147d9f)&&_0x13cf43&&_0x59bb76(_0x13cf43),_0x6d74d8;}_getLastStableElement(_0x14fdba,_0x25f5fb){if(!_0x25f5fb)return null;const _0x394c25=nn('data-id',_0x25f5fb,_0x14fdba);if(!_0x394c25)return null;const _0xb912a8=[_0x394c25,..._n(_0x394c25)]['at'](-0x2);if(_0xb912a8===_0x394c25)return _0x394c25;let _0x217737=_0xb912a8['previousSibling'];for(;_0x217737&&!_0x58049c(_0x217737);)_0x217737=_0x217737['previousSibling'];return _0x217737;}_markUnstableElements(_0x49c71a,_0x10aec7){const _0x1b0eb4=new Set([...this['_touchedNodesState']['newIds'],...this['_touchedNodesState']['modifiedIds'],...this['_touchedNodesState']['removedIds']]);let _0xa130ec=_0x10aec7?_0x10aec7['nextSibling']:_0x49c71a['firstChild'];for(;_0xa130ec;)_0x58049c(_0xa130ec)&&(_0x1b0eb4['has'](ln(_0xa130ec,'data-id'))||rn('data-id',null,_0xa130ec)['some'](_0x261f13=>_0x1b0eb4['has'](ln(_0x261f13,'data-id'))))&&un(_0xa130ec,'data-unstable','true'),_0xa130ec=_0xa130ec['nextSibling'];}['_isNewNode'](_0x4978b2){return Boolean('new-element'===ln(_0x4978b2,'data-id'));}_isExistingNode(_0x19b79f){return Boolean((ln(_0x19b79f,'data-id')||'')['length']>0x0&&'new-element'!==ln(_0x19b79f,'data-id'));}_isExistingContentComment(_0x581ea1){return Boolean(_0x1800e7(_0x581ea1)&&sn(_0x581ea1)['match'](/\s*existing[\s*-](content|document)\s*/g));}};function $n(_0x14836e){return!!_0x14836e&&Boolean(_0x1800e7(_0x14836e)&&sn(_0x14836e)['match'](/removed[\s*-]data-id="[^"]+"/));}function Yn(_0x4aeb64){if(!_0x4aeb64)return null;if(_0x58049c(_0x4aeb64))return ln(_0x4aeb64,'data-id')??null;if(_0x1800e7(_0x4aeb64)){const _0x2be61f=sn(_0x4aeb64)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2be61f&&_0x2be61f[0x1])return _0x2be61f[0x1];}return null;}function qn(_0xd21c93,_0x52aef4){const _0x46bfac=new Map();for(const _0x13d1f7 of on(_0xd21c93))hn(_0x13d1f7)||_0x46bfac['set'](ln(_0x13d1f7,'data-id'),_0x13d1f7);const _0x5d4abd=new Set();for(const _0x1fd9f of on(_0x52aef4)){if(hn(_0x1fd9f))continue;const _0x329cdd=ln(_0x1fd9f,'data-id'),_0x46c55d=_0x329cdd?_0x46bfac['get'](_0x329cdd):void 0x0;_0x46c55d?(_0x418ed2(_0x1fd9f,_0x950ff(_0x46c55d,!0x0)),_0x5d4abd['add'](_0x329cdd)):_0x15340f(_0x1fd9f);}for(const _0x5bfb72 of cn(_0x52aef4))$n(_0x5bfb72)&&_0x46bfac['has'](Yn(_0x5bfb72))&&_0x15340f(_0x5bfb72);const _0x218bfc=new Set(rn('data-id',null,_0x52aef4)['map'](_0x15b3de=>ln(_0x15b3de,'data-id')));for(const [_0x56b061,_0x3b512c]of _0x46bfac){if(_0x5d4abd['has'](_0x56b061))continue;let _0x261f8d=_0x3b512c['parent'],_0x37a9d2=null;for(;_0x261f8d&&_0x58049c(_0x261f8d);){const _0x7af257=ln(_0x261f8d,'data-id');if(_0x7af257&&_0x218bfc['has'](_0x7af257)){_0x37a9d2=_0x7af257;break;}_0x261f8d=_0x261f8d['parent'];}if(!_0x37a9d2)continue;const _0x11fc92=nn('data-id',_0x37a9d2,_0x52aef4);_0x11fc92&&_0x4e05c7(_0x11fc92,_0x950ff(_0x3b512c,!0x0));}}const Qn=/* #__PURE__ -- @preserve */
|
|
27
|
+
mt();var Xn=class extends Qn{_m2html;constructor(){super();const _0x49bccd=Object['entries'](_0x229e08),_0x35c5ac=_0x49bccd['findIndex'](([_0x29e1d0])=>'rehypeDomRaw'===_0x29e1d0);if(-0x1===_0x35c5ac)throw new dt('ai-response-parser-unable-to-set-up-parser');_0x49bccd['splice'](_0x35c5ac+0x1,0x0,['rehypeSanitize',_0x100e8b]),this['_m2html']=new _0x329971({'plugins':Object['fromEntries'](_0x49bccd)});}convertMarkdownToHTML(_0x56895f){const _0x524fb5=this['_m2html']['parse'](_0x56895f);return this['parseAndNormalizeHTML'](_0x524fb5);}['parseAndNormalizeHTML'](_0x181254){return this['_parseHTML'](_0x181254);}['_parseHTML'](_0x3caf64){const _0x3eb3a6=en('<dummy>'+_0x3caf64['replace'](/<[^>]*?$/g,'')+'</dummy>');return zn(_0x3eb3a6),_0x3eb3a6['children']=_0x3eb3a6['children'][0x0]['children'],_0x3eb3a6;}};function zn(_0x1f1075){for(const _0xa688f9 of _0x1f1075['children'])_0x58049c(_0xa688f9)?'pre'!==_0xa688f9['name']&&zn(_0xa688f9):_0x4f3ed2(_0xa688f9)&&(_0xa688f9['data']=_0xa688f9['data']['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/[ \t\r\f\v]+/g,'\x20'));}function jn(_0x2c1726,_0x371244){for(const _0x68e72c of _0x2c1726)'noop'!==_0x68e72c['type']&&(_0x68e72c['_aiSource']=_0x371244);}var Jn=class extends _0x4cd5fc{static get['pluginName'](){return'AIGateway';}static get requires(){return[Un,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['apply'](_0x2131df,_0x17a15){const {applyMethod:_0x161f9a,roots:_0xc02351}=_0x17a15,_0x8093bf='suggest'===_0x161f9a;if(_0x2131df['error']||!_0x2131df['results']['length'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x2131df['status']});if(_0xc02351){if(0x0===_0xc02351['length'])throw new dt('ai-gateway-apply-empty-roots',this);for(const {channelId:_0x9525c1,rootName:_0x4df28c}of _0xc02351)if(!_0x2131df['results']['some'](_0x4429c7=>_0x4429c7['channelId']===_0x9525c1&&_0x4429c7['rootName']===_0x4df28c))throw new dt('ai-gateway-apply-root-not-found',this,{'channelId':_0x9525c1,'rootName':_0x4df28c});}const _0x35a1fd=_0x2131df['results']['reduce']((_0x2e5ac7,_0x5dc5be)=>{if(_0xc02351&&!_0xc02351['some'](_0x2aa25c=>_0x2aa25c['channelId']===_0x5dc5be['channelId']&&_0x2aa25c['rootName']===_0x5dc5be['rootName']))return _0x2e5ac7;if('completed'!==_0x5dc5be['status'])throw new dt('ai-gateway-apply-invalid-status',this,{'status':_0x5dc5be['status'],'channelId':_0x5dc5be['channelId'],'rootName':_0x5dc5be['rootName']});if(_0x8093bf&&!_0x5dc5be['editor']['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',this,{'channelId':_0x5dc5be['channelId'],'rootName':_0x5dc5be['rootName']});let _0x4afdf5=_0x2e5ac7['get'](_0x5dc5be['editor']);return _0x4afdf5||(_0x4afdf5=[],_0x2e5ac7['set'](_0x5dc5be['editor'],_0x4afdf5)),_0x4afdf5['push'](_0x5dc5be),_0x2e5ac7;},new Map()),_0x1b9794=this['context']['plugins']['get'](Un);for(const [_0x43167d,_0x373fd6]of _0x35a1fd){const _0x16ee84=_0x373fd6['map'](_0x42dd3d=>{const _0x293a2f=_0x43167d['model']['createPositionAt'](_0x43167d['model']['document']['getRoot'](_0x42dd3d['rootName']),0x0),_0x1bd9d6=Rn(_0x43167d,_0x42dd3d['rootName'],_0x42dd3d['contentRawOld'],_0x42dd3d['contentRawNew']);if(!_0x1bd9d6)return _0x42dd3d['droppedUnsupportedInlineChange']=!0x0,null;const _0x192198=_0x1b9794['getDiff'](_0x1bd9d6['before'],_0x1bd9d6['after'],{'anchor':_0x293a2f,'markDeletions':_0x8093bf,'targetEditor':_0x43167d}),_0x3fe00b=_0x43167d['model']['document']['history']['getOperations'](_0x42dd3d['documentVersion']),_0xe8a2e2={'document':_0x43167d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5660ca=_0x3e782f(_0x192198,_0x3fe00b,_0xe8a2e2)['operationsA'];return jn(_0x5660ca,_0x17a15['aiSource']??'api'),_0x5660ca;});_0x43167d['model']['change'](_0x3bb4e1=>{for(const _0x57f5be of _0x16ee84)_0x57f5be&&(_0x8093bf?_0x43167d['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x57f5be):_0x1b9794['applyOperations'](_0x3bb4e1,_0x57f5be));});}}mergeChangesIntoContent(_0x5610a5,_0x1bbdbf){const _0x48a9b2=new Xn(),_0x2937d7=new Kn();let _0x529711=_0x48a9b2['parseAndNormalizeHTML'](_0x1bbdbf);for(const _0x497189 of _0x5610a5)try{const _0x18177b=_0x48a9b2['parseAndNormalizeHTML'](_0x497189['content']);_0x529711=_0x2937d7['merge'](_0x18177b,_0x529711,{'cutAfterUnstable':!0x1,'replaceRemovedWith':void 0x0})['parsedContent'];}catch(_0x5c3823){throw new dt('ai-gateway-merge-failed',this,{..._0x497189},_0x5c3823);}return _0x529711;}};const Zn=/* #__PURE__ -- @preserve */
|
|
28
|
+
It(),tr=['capabilitiesUpdated'];var er=class extends Zn{['_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(_0x945945){const _0x4afa54={};if(!_0x945945)return _0x4afa54;('isWebSearchEnabled'in _0x945945?_0x945945['isWebSearchEnabled']:_0x945945['webSearch'])&&(_0x4afa54['webSearch']={});const _0x407f53='isReasoningEnabled'in _0x945945?_0x945945['isReasoningEnabled']:_0x945945['reasoning'];return _0x407f53&&(_0x4afa54['reasoning']='string'==typeof _0x407f53?{'level':_0x407f53}:{}),_0x4afa54;}toggleWebSearch(){this['setWebSearch'](!this['_isWebSearchEnabled']);}toggleReasoning(){this['setReasoning'](!this['_isReasoningEnabled']);}setWebSearch(_0x3a4601){_0x3a4601!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x3a4601,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}setReasoning(_0x547aa){_0x547aa!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x547aa,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}};const ir='defaultContextIds',sr=/* #__PURE__ -- @preserve */
|
|
29
|
+
mt();var nr=class AIContext extends sr{['_refs'];constructor(_0x78bf82=[]){super(),this['_refs']=[..._0x78bf82];}get['refs'](){return[...this['_refs']];}get isEmpty(){return 0x0===this['_refs']['length'];}cloneWith(..._0x11f268){return new AIContext([...this['_refs'],..._0x11f268]);}addDefaultContext(_0x50aadb){this['_refs']=[...this['_refs'],..._0x50aadb];}toRequestParts(_0x15f29f=[]){return[...this['toRequestContexts'](),..._0x15f29f];}toRequestContexts(){return this['_refs']['map'](_0x55ae7d=>({..._0x55ae7d,'type':'context'}));}toMessageAttributes(_0x21b1f5){return this['isEmpty']?_0x21b1f5:{..._0x21b1f5,[ir]:[...new Set(this['_refs']['map'](_0x291174=>_0x291174['id']))]};}static getDefaultContextIds(_0x3d102b){const _0x96180c=_0x3d102b&&_0x3d102b[ir];return new Set(Array['isArray'](_0x96180c)?_0x96180c:[]);}};function rr(_0x5ee8cc,_0x573af2,_0x1cdb04,_0x19a281){if(_0x5ee8cc instanceof dt)return _0x5ee8cc;const _0x5975db=_0x5ee8cc?.['data'],_0x10d93a=void 0x0!==_0x5975db?{..._0x19a281,'backendData':_0x5975db}:_0x19a281;return new dt(_0x573af2,_0x1cdb04,_0x10d93a,_0x5ee8cc);}var or=class{_editor;_rootName;['_channelId'];['_sessionId'];_documentVersion;_contentRawOld;_contentRawNew;['_error'];_isAborted=!0x1;_droppedUnsupportedInlineChange=!0x1;constructor(_0x459d63){this['_editor']=_0x459d63['editor'],this['_rootName']=_0x459d63['rootName'],this['_channelId']=_0x459d63['channelId'],this['_sessionId']=_0x459d63['sessionId'];}get status(){return this['_error']?'error':this['_isAborted']?'aborted':void 0x0!==this['_contentRawNew']?'completed':'initialized';}get editor(){return this['_editor'];}get rootName(){return this['_rootName'];}get['channelId'](){return this['_channelId'];}get['sessionId'](){return this['_sessionId'];}get documentVersion(){return this['_documentVersion'];}set documentVersion(_0x4ba82d){this['_documentVersion']=_0x4ba82d;}get contentRawOld(){return this['_contentRawOld'];}set contentRawOld(_0x12b8c3){this['_contentRawOld']=_0x12b8c3;}get contentRawNew(){return this['_contentRawNew'];}set contentRawNew(_0x5968c3){this['_contentRawNew']=_0x5968c3;}get contentOld(){return this['_dropDataIds'](this['_contentRawOld']||'');}get contentNew(){return this['_dropDataIds'](this['_contentRawNew']||'');}get['error'](){return this['_error'];}set['error'](_0x4758dd){this['_error']=_0x4758dd;}get droppedUnsupportedInlineChange(){return this['_droppedUnsupportedInlineChange'];}set droppedUnsupportedInlineChange(_0x437e5c){this['_droppedUnsupportedInlineChange']=_0x437e5c;}abort(){this['_isAborted']=!0x0;}_dropDataIds(_0x76b682){return _0x76b682['replace'](/ data-id="[a-z0-9]+"/g,'');}},ar=class extends or{['_summary']='';get['summary'](){return this['_summary'];}set['summary'](_0x4f4bbc){this['_summary']=_0x4f4bbc;}},hr=class{_results;constructor(_0x28f15e=[]){this['_results']=_0x28f15e;}_status='initialized';['_error'];abort(){'error'!==this['_status']&&(this['_status']='aborted');}get status(){return this['_status'];}set status(_0x4bde10){this['_status']=_0x4bde10;}get['error'](){return this['_error'];}set['error'](_0x40bcbc){this['_status']='error',this['_error']=_0x40bcbc;}get results(){return this['_results'];}addResult(..._0x3f64e5){this['_results']['push'](..._0x3f64e5);}},cr=class extends _0x4cd5fc{static get['pluginName'](){return'AIDocumentProcessingGateway';}static get requires(){return[$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async processDocument(_0x4787bb,_0x505ad6){if(!_0x4787bb)throw new dt('ai-documentprocessinggateway-missing-prompt',this);const _0x4fc6d5=await this['context']['plugins']['get'](Pn)['getDocumentData'](),_0x5546a7=_0x505ad6['roots'];if(0x0===(_0x5546a7??_0x4fc6d5)['length'])throw new dt('ai-documentprocessinggateway-empty-roots',this);if(_0x5546a7){for(const _0xaf1191 of _0x5546a7)if(!_0x4fc6d5['some'](_0x3be5c3=>_0x3be5c3['rootName']===_0xaf1191['rootName']&&_0x3be5c3['channelId']===_0xaf1191['channelId']))throw new dt('ai-documentprocessinggateway-root-not-found',this,{'channelId':_0xaf1191['channelId'],'rootName':_0xaf1191['rootName']});}const _0x2720b3=_0x5546a7?_0x4fc6d5['filter'](_0x1a239e=>_0x5546a7['some'](_0x41566a=>_0x41566a['rootName']===_0x1a239e['rootName']&&_0x41566a['channelId']===_0x1a239e['channelId'])):_0x4fc6d5,_0x4547b4=[],_0x2ed2ae=[];for(const _0x143352 of _0x2720b3){const _0xdc05ee={'editor':_0x143352['editor'],'rootName':_0x143352['rootName'],'sessionId':_0x143352['sessionId'],'channelId':_0x143352['channelId'],'contentRawOld':_0x143352['content'],'documentVersion':_0x143352['version']};_0x4547b4['push'](_0xdc05ee),_0x2ed2ae['push']({'type':'document','content':_0xdc05ee['contentRawOld']});}const _0x433bc1=this['context']['plugins']['get']('AIConnector')['processDocument']({'content':_0x2ed2ae,'prompt':_0x4787bb,'model':_0x505ad6['model'],'capabilities':er['getCapabilitiesRequestData'](_0x505ad6['capabilities']),'contexts':new nr(_0x505ad6['contexts'])['toRequestContexts']()});let _0xa225f0;if(_0x505ad6?.['signal']){_0x505ad6['signal']['aborted']&&_0x433bc1['abortController']['abort']();const _0x35ef7f=_0x505ad6['signal'],_0x3d193e=()=>_0x433bc1['abortController']['abort']();_0x35ef7f['addEventListener']('abort',_0x3d193e),_0xa225f0=()=>_0x35ef7f['removeEventListener']('abort',_0x3d193e);}const _0xaed141=new hr();let _0x5da672=[];try{if(_0x5da672=(await _0x433bc1['getResult']())['documents'],!(_0x5da672&&_0x5da672['length']>0x0))throw new dt('ai-documentprocessinggateway-empty-reply',this);if(_0x5da672['length']!==_0x2ed2ae['length'])throw new dt('ai-documentprocessinggateway-reply-count-mismatch',this,{'expected':_0x2ed2ae['length'],'received':_0x5da672['length']});const _0x57b5fd=_0x5da672['findIndex'](({document:_0x59406d})=>!_0x59406d['length']);if(-0x1!==_0x57b5fd){const _0x2208cf=_0x4547b4[_0x57b5fd];throw new dt('ai-documentprocessinggateway-empty-root-content',this,{'channelId':_0x2208cf['channelId'],'rootName':_0x2208cf['rootName']});}_0xaed141['status']='completed';}catch(_0x6f3e87){_0x6f3e87 instanceof Error&&_0x6f3e87['message']['includes']('ai-request-aborted')?_0xaed141['abort']():_0xaed141['error']=rr(_0x6f3e87,'ai-documentprocessinggateway-run-failed',this);}finally{_0xa225f0&&_0xa225f0();}if('completed'===_0xaed141['status'])for(const [_0x370421,_0x3e5131]of _0x4547b4['entries']()){const {channelId:_0x1d73af,contentRawOld:_0x53b351,documentVersion:_0x1d800a,editor:_0x5e0aba,rootName:_0x2ec147,sessionId:_0x57c5da}=_0x3e5131,_0x3034fb=new ar({'channelId':_0x1d73af,'editor':_0x5e0aba,'rootName':_0x2ec147,'sessionId':_0x57c5da});_0x3034fb['contentRawOld']=_0x53b351,_0x3034fb['documentVersion']=_0x1d800a,_0x3034fb['contentRawNew']=_0x5da672[_0x370421]['document'],_0x3034fb['summary']=_0x5da672[_0x370421]['summary'],_0xaed141['addResult'](_0x3034fb);}return _0xaed141;}applyResult(_0x5e2a19,_0x1f22d1){this['context']['plugins']['get']('AIGateway')['apply'](_0x5e2a19,_0x1f22d1);}};function lr(_0x1ea9a1){return _0x1ea9a1 instanceof Error&&('AbortError'===_0x1ea9a1['name']||('AICoreError'===_0x1ea9a1['name']?!0x0===_0x1ea9a1['isAbort']:_0x1ea9a1['message']['startsWith']('ai-request-aborted')));}var ur=class extends Error{['code'];severity;type;context;isAbort;constructor(_0x3e0c1a){super(_0x3e0c1a['code'],_0x3e0c1a['cause']instanceof Error?{'cause':_0x3e0c1a['cause']}:void 0x0),this['name']='AICoreError',this['code']=_0x3e0c1a['code'],this['severity']=_0x3e0c1a['severity']??'error',this['type']=_0x3e0c1a['type']??'system',this['context']=_0x3e0c1a['context'],this['isAbort']=_0x3e0c1a['isAbort']??lr(_0x3e0c1a['cause']);}},dr=class extends _0x4cd5fc{static get['pluginName'](){return'AIErrorSink';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}createReporter(_0x3aa071){return new _r(this,_0x3aa071);}},_r=class{['_sink'];_component;constructor(_0x8099f,_0x103ec4){this['_sink']=_0x8099f,this['_component']=_0x103ec4;}['logError'](_0x562386,_0x3f94e5={}){this['_emit'](_0x562386,_0x3f94e5),this['_defaultLog'](_0x562386);}reportError(_0x54d27b,_0x481071={}){this['_emit'](_0x54d27b,_0x481071);}_emit(_0x14efd4,_0x3ba6fc){if(lr(_0x14efd4))return;const _0x4ec140=_0x14efd4 instanceof ur?_0x14efd4:void 0x0,_0x18961c=_0x4ec140?.['context']||_0x3ba6fc['context']?{..._0x4ec140?.['context'],..._0x3ba6fc['context']}:void 0x0;this['_sink']['fire']('error',{'error':_0x14efd4,'component':this['_component'],'code':_0x4ec140?.['code'],'type':_0x4ec140?.['type'],'severity':_0x4ec140?.['severity'],'context':_0x18961c});}_defaultLog(_0x3d23a0){if(!lr(_0x3d23a0)){if(_0x3d23a0 instanceof ur){if('user'===_0x3d23a0['type']||'network'===_0x3d23a0['type'])return;if('warning'===_0x3d23a0['severity'])return void console['warn'](this['_component'],_0x3d23a0);}console['error'](this['_component'],_0x3d23a0);}}};const gr='ck-ai-button-primary\x20ck-button-action',Ir='ck-ai-button-secondary\x20ck-button_outline',Ar='ck-ai-button-tertiary',Er='ck-ai-button-surface\x20ck-button_surface',pr='ck-button_small',mr='ck-button_standard';function Tr(_0x431c29,_0x408f2b){const _0x24a314=new _0x1a9216(_0x431c29),_0x5e41ee=qs(_0x431c29,'AI_TABS_LABEL_MINIMIZE'),_0x4d581a=qs(_0x431c29,'AI_TABS_LABEL_MAXIMIZE');return _0x24a314['set']({'withText':!0x1,'icon':_0x1ab7e1,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-button_small\x20'+Ar}),_0x24a314['bind']('label')['to'](_0x408f2b,'isMaximized',_0x43a630=>_0x43a630?_0x5e41ee:_0x4d581a),_0x24a314['bind']('icon')['to'](_0x408f2b,'isMaximized',_0x2c9bf9=>_0x2c9bf9?_0x2a01f5:_0x1ab7e1),_0x24a314['bind']('isOn')['to'](_0x408f2b,'isMaximized'),_0x24a314['on']('execute',()=>{_0x408f2b['fire']('resizeTabs');}),_0x24a314;}function wr({changeGroups:_0xa8d11a,documentContextContent:_0x2abb71,showDiff:_0x235649,trimUnchanged:_0x1e341d=!0x0}){const _0x97f25a=fn(_0xa8d11a,_0x2abb71);return _0xa8d11a['map'](_0x2990cf=>{if(!_0x2990cf['editor']||'destroyed'===_0x2990cf['editor']['state'])return null;const _0x5a2487=En(_0x2990cf['editor'],_0x2990cf['rootName']),_0x4038b7=new _0x47233a([]),_0x564e46=new _0x47233a([]),_0xa98cf9=new Set();for(const _0x20100f of _0x2990cf['changes'])'new'==_0x20100f['type']&&rn('data-id',null,_0x20100f['node'])['forEach'](_0x3bb26e=>{_0xa98cf9['add'](ln(_0x3bb26e,'data-id'));});for(const _0x19aa43 of _0x2990cf['changes'])if('removed'!=_0x19aa43['type']?_0x564e46['children']['push'](_0x19aa43['node']['cloneNode'](!0x0)):_0x235649||_0xa98cf9['has'](_0x19aa43['id'])||_0x564e46['children']['push'](_0x19aa43['node']['cloneNode'](!0x0)),'new'!=_0x19aa43['type']&&(_0x235649||'removed'!=_0x19aa43['type'])){const _0x1f2596=_0x1b0303(_0x155487=>ln(_0x155487,'data-id')==_0x19aa43['id'],_0x2abb71['get'](_0x2990cf['documentId']),!0x0);_0x1f2596&&_0x4038b7['children']['push'](_0x1f2596['cloneNode'](!0x0));}if(_0x5a2487&&_0x97f25a['has'](_0x2990cf['index']))return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':new _0x47233a([]),'hasChanges':!0x1};let _0x3ec419,_0x1017bc,_0x27bcc6;try{({content:_0x3ec419,hasChanges:_0x1017bc}=function(_0x2ba8a0,_0x12c8e9,_0xbb4276,_0x5761fe,_0x1a05a8=!0x0){const _0x4e45cc=_0x2ba8a0['plugins']['get']('DocumentChanges'),_0x5e5725=sn(_0x12c8e9),_0x18a1b4=sn(_0xbb4276),_0x190525=_0x2ba8a0['data']['parse'](_0x5e5725,'$root'),_0x3feb2e=_0x2ba8a0['model']['createPositionAt'](_0x190525,0x0),_0x771e03=_0x4e45cc['getDiff'](_0x5e5725,_0x18a1b4,{'anchor':_0x3feb2e,'markDeletions':_0x5761fe,'targetEditor':_0x2ba8a0});if(0x0==_0x771e03['length'])return{'content':_0x12c8e9['cloneNode'](!0x0),'hasChanges':!0x1};_0x5761fe?function(_0x4146e2,_0xd3be79,_0x72e184){if(0x0==_0x4146e2['length'])return;const _0x565aed=_0x72e184['plugins']['get']('DocumentChanges'),_0x650b5=_0x72e184['plugins']['get']('SuggestionsConversion');_0x72e184['model']['change'](_0x3afc04=>{const _0x39ec27=new Set();for(let _0x3e33c5=0x0;_0x3e33c5<_0x4146e2['length'];_0x3e33c5++){const _0x4150f6=_0x4146e2[_0x3e33c5];if(_0x4150f6['baseVersion']=null,_0x4150f6['isDocumentOperation']=!0x1,!_0x3463ba(_0x4150f6)){if(_0x565aed['isMarkedRemoveOperation'](_0x4150f6)){const _0x5151e0=_0x236d37(_0x4150f6['newRange'],_0x72e184['model']),_0x45624a='suggestion:deletion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x45624a,_0x5151e0);}else switch(_0x4150f6['type']){case'rename':{if(_0x4150f6['oldName']==_0x4150f6['newName'])break;_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6);const _0x193d4d='$elementName',_0x4860b7=_0x4150f6['position'],_0x264958=_0x72e184['model']['createRange'](_0x4860b7,_0x72e184['model']['createPositionAt'](_0x4860b7['nodeAfter'],'end')),_0xe79d12='suggestion:attribute:'+_0x193d4d+':'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0xe79d12,_0x264958);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4150f6['oldValue']==_0x4150f6['newValue'])break;_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6);const _0x484460=_0x4150f6['key'];if(!_0x650b5['isRegisteredAttribute'](_0x484460))break;const _0x1b1c13=_0x236d37(_0x4150f6['range'],_0x72e184['model']),_0x1e56ea='suggestion:attribute:'+_0x484460+':'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x1e56ea,_0x1b1c13);break;}case'insert':{if(_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6),_0x4146e2[_0x3e33c5+0x1]&&'move'==_0x4146e2[_0x3e33c5+0x1]['type'])break;const _0x361b11=_0x4150f6['position'],_0x2e575b=_0x4150f6['howMany'],_0x1919de=_0x236d37(_0x72e184['model']['createRange'](_0x361b11,_0x361b11['getShiftedBy'](_0x2e575b)),_0x72e184['model']),_0x1e509b='suggestion:insertion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x1e509b,_0x1919de);break;}case'split':{_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6);const _0x309250=_0x4150f6['splitPosition'],_0x6ead04=_0x4150f6['moveTargetPosition'],_0xfa4b47=_0x72e184['model']['createRange'](_0x309250,_0x6ead04),_0x423921='suggestion:insertion:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x423921,_0xfa4b47);break;}case'move':{_0x3afc04['batch']['addOperation'](_0x4150f6),_0x72e184['model']['applyOperation'](_0x4150f6),Cr(_0xd3be79,_0x4150f6);const _0x2a49dd=_0x4150f6['getMovedRangeStart'](),_0x8a4ca0=_0x4150f6['howMany'];for(let _0x28a63f=0x0;_0x28a63f<_0x8a4ca0;_0x28a63f++){const _0x308374=_0x2a49dd['getShiftedBy'](_0x28a63f)['nodeAfter'];_0x39ec27['add'](_0x308374);}break;}case'remove':{const _0x2927f2=_0x4150f6['sourcePosition'],_0x38161b=_0x4150f6['howMany'],_0x52aaab=new _0x500e5d(_0x2927f2,_0x38161b);_0x3afc04['batch']['addOperation'](_0x52aaab),_0x72e184['model']['applyOperation'](_0x52aaab),Cr(_0xd3be79,_0x4150f6);break;}}}}for(const _0x23d7ff of _0x39ec27){const _0x3edf23=_0x72e184['model']['createRangeOn'](_0x23d7ff),_0x572e34='suggestion:formatBlock:$fakeWrap:'+Xt()+':$aiSuggestion';_0xd3be79['markers']['set'](_0x572e34,_0x236d37(_0x3edf23,_0x72e184['model']));}});}(_0x771e03,_0x190525,_0x2ba8a0):_0x2ba8a0['model']['change'](_0xbae5fe=>{for(const _0x28a8f6 of _0x771e03)if(!_0x3463ba(_0x28a8f6)){if('remove'==_0x28a8f6['type']){const _0x5f1190=_0x28a8f6['sourcePosition'],_0x53549d=_0x28a8f6['howMany'],_0x556806=new _0x500e5d(_0x5f1190,_0x53549d);_0xbae5fe['batch']['addOperation'](_0x556806),_0x2ba8a0['model']['applyOperation'](_0x556806),Cr(_0x190525,_0x28a8f6);}else{if('marker'==_0x28a8f6['type']){const _0x18eea4=_0x28a8f6['name'],_0x4901a4=_0x28a8f6['newRange'];null!==_0x4901a4?_0x190525['markers']['set'](_0x18eea4,_0x4901a4):_0x190525['markers']['delete'](_0x18eea4);}else _0x28a8f6['baseVersion']=null,_0x28a8f6['isDocumentOperation']=!0x1,_0xbae5fe['batch']['addOperation'](_0x28a8f6),_0x2ba8a0['model']['applyOperation'](_0x28a8f6),Cr(_0x190525,_0x28a8f6);}}});if(_0x1a05a8){const _0x3cdd1d=fr(_0x2ba8a0,_0x771e03,_0x190525);br(_0x2ba8a0['model'],_0x3cdd1d),function(_0x116255,_0x56e1fa){const _0x374fa8=_0x56e1fa['getFirstRange']()['start'];let _0x4e15e2=_0x56e1fa['getFirstRange']()['end'];const _0x59c894=_0x374fa8['root'];(_0x4e15e2['textNode']||_0x4e15e2['nodeAfter']&&_0x4e15e2['nodeAfter']['is']('$text'))&&(_0x53f0c6(_0x4e15e2,'...'),vr(_0x59c894,_0x4e15e2,0x3),_0x4e15e2=_0x4e15e2['getShiftedBy'](0x3)),(_0x374fa8['textNode']||_0x374fa8['nodeBefore']&&_0x374fa8['nodeBefore']['is']('$text'))&&(_0x53f0c6(_0x374fa8,'...'),vr(_0x59c894,_0x374fa8,0x3),_0x374fa8['parent']==_0x4e15e2['parent']&&(_0x4e15e2=_0x4e15e2['getShiftedBy'](0x3)));const _0x1cc394=_0x116255['createRange'](_0x116255['createPositionAt'](_0x59c894,0x0),_0x374fa8),_0x36739e=_0x116255['createRange'](_0x4e15e2,_0x116255['createPositionAt'](_0x59c894,'end')),_0x41fc50=[..._0x1cc394['getMinimalFlatRanges'](),..._0x36739e['getMinimalFlatRanges']()];_0x41fc50['reverse']();for(const _0x4f4b02 of _0x41fc50)_0x3922ec(_0x4f4b02),Or(_0x59c894,_0x4f4b02);}(_0x2ba8a0['model'],_0x3cdd1d);}return{'content':en(_0x2ba8a0['data']['stringify'](_0x190525,{'showSuggestionHighlights':!0x0})),'hasChanges':!0x0};}(_0x2990cf['editor'],_0x4038b7,_0x564e46,_0x235649,_0x1e341d));}catch{return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':new _0x47233a([]),'hasChanges':!0x1};}if(_0x5a2487){_0x27bcc6=_0x2990cf['editor']['ui']['getEditableElement'](_0x2990cf['rootName'])?.['tagName']['toLowerCase']();const _0x483f14=_0x3ec419['children']['filter'](_0x58049c);0x1===_0x483f14['length']&&(_0x3ec419=new _0x47233a(_0x483f14[0x0]['children']));}return{'type':_0x2990cf['changes'][0x0]['type'],'index':_0x2990cf['index'],'state':_0x2990cf['state'],'outdatedReason':_0x2990cf['outdatedReason'],'content':_0x3ec419,'hasChanges':_0x1017bc,'wrapperTag':_0x27bcc6};})['filter'](_0x2a0494=>null!==_0x2a0494);}function Cr(_0x1a8271,_0x309eed){for(const [_0x33b293,_0x16342a]of _0x1a8271['markers']){const _0x120fe9=_0x3aaa22['_createFromRanges'](_0x16342a['getTransformedByOperation'](_0x309eed));_0x120fe9['root']==_0x1a8271?_0x1a8271['markers']['set'](_0x33b293,_0x120fe9):_0x1a8271['markers']['delete'](_0x33b293);}}function fr(_0x38ca29,_0x4e33d2,_0x208ebf){const _0x109373=_0x38ca29['plugins']['get']('DocumentChanges');let _0x2756b3=_0x38ca29['model']['createPositionAt'](_0x208ebf,Number['POSITIVE_INFINITY']),_0x2f816e=_0x38ca29['model']['createPositionAt'](_0x208ebf,0x0);for(const _0x1f4291 of _0x4e33d2){let _0x198865,_0x2f6eab;if(_0x109373['isMarkedRemoveOperation'](_0x1f4291))_0x198865=_0x1f4291['newRange']['start'],_0x2f6eab=_0x1f4291['newRange']['end'];else switch(_0x2756b3=Rr(_0x2756b3,_0x1f4291),_0x2f816e=Rr(_0x2f816e,_0x1f4291),_0x1f4291['type']){case'rename':_0x198865=_0x1f4291['position'],_0x2f6eab=_0x198865['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x198865=_0x1f4291['range']['start'],_0x2f6eab=_0x1f4291['range']['end'];break;case'insert':_0x198865=_0x1f4291['position'],_0x2f6eab=_0x198865['getShiftedBy'](_0x1f4291['howMany']);break;case'split':_0x198865=_0x1f4291['splitPosition'],_0x2f6eab=_0x1f4291['moveTargetPosition'];break;case'merge':{const _0x53bc31=_0x1f4291['targetPosition']['path']['slice'](0x0,-0x1);_0x198865=_0x38ca29['model']['createPositionFromPath'](_0x208ebf,_0x53bc31),_0x2f6eab=_0x198865['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x1d0154=_0x1f4291['howMany'],_0xb3b9b0=_0x1f4291['sourcePosition']['_getTransformedByInsertion'](_0x1f4291['targetPosition'],_0x1d0154),_0xd5ff3c=_0x1f4291['getMovedRangeStart']();'remove'==_0x1f4291['type']?(_0x198865=_0xb3b9b0,_0x2f6eab=_0xb3b9b0):(_0x198865=_0xd5ff3c,_0x2f6eab=_0xd5ff3c['getShiftedBy'](_0x1d0154));break;}}_0x198865&&_0x198865['isBefore'](_0x2756b3)&&(_0x2756b3=_0x198865['clone'](),_0x2756b3['stickiness']='toNone'),_0x2f6eab&&_0x2f6eab['isAfter'](_0x2f816e)&&(_0x2f816e=_0x2f6eab['clone'](),_0x2f816e['stickiness']='toNone');}return _0x38ca29['model']['createSelection'](_0x38ca29['model']['createRange'](_0x2756b3,_0x2f816e));}function Rr(_0x4a1c14,_0x2a79bd){return'move'!=_0x2a79bd['type']&&'remove'!=_0x2a79bd['type']||_0x2a79bd['sourceRange']['containsPosition'](_0x4a1c14)&&((_0x4a1c14=_0x2a79bd['sourcePosition']['clone']())['stickiness']='toNone'),_0x4a1c14['getTransformedByOperation'](_0x2a79bd);}function br(_0x51b7f3,_0x4ac6c6){Sr(_0x51b7f3,_0x4ac6c6,'forward');const _0x5c5ad9=_0x4ac6c6['getFirstRange']();_0x4ac6c6['setTo']([]),_0x4ac6c6['setTo'](_0x5c5ad9,{'backward':!0x0}),Sr(_0x51b7f3,_0x4ac6c6,'backward');}function Sr(_0xa7cc96,_0x3e8b88,_0x2776ce){let _0x8379c7=0x14;for(;_0x8379c7;){_0xa7cc96['modifySelection'](_0x3e8b88,{'unit':'word','direction':_0x2776ce}),_0x8379c7--;const _0x3c1d02=_0x3e8b88['focus']['forward'==_0x2776ce?'nodeBefore':'nodeAfter'];if(_0x3c1d02&&_0x3c1d02['is']('element')&&_0xa7cc96['schema']['isBlock'](_0x3c1d02)&&_0xa7cc96['schema']['isObject'](_0x3c1d02))break;}}function Or(_0x557fd7,_0x3b1de2){for(const [_0x4d31c7,_0x4564f2]of _0x557fd7['markers']){const _0x518eed=_0x4564f2['_getTransformedByDeletion'](_0x3b1de2['start'],_0x3b1de2['end']['offset']-_0x3b1de2['start']['offset']);null!=_0x518eed?_0x557fd7['markers']['set'](_0x4d31c7,_0x518eed):_0x557fd7['markers']['delete'](_0x4d31c7);}}function vr(_0x131d02,_0x1257a6,_0x4beaf7){for(let [_0x382c39,_0x9dea40]of _0x131d02['markers'])_0x9dea40=_0x9dea40['_getTransformedByInsertion'](_0x1257a6,_0x4beaf7,!0x1)[0x0],_0x131d02['markers']['set'](_0x382c39,_0x9dea40);}const yr=/* #__PURE__ -- @preserve */
|
|
30
|
+
mt();var Nr=class extends yr{['id'];interactionId;type;content=new Map();['sources']=[];parsedContent=new Map();parsedMergedContent=new Map();['changeGroups']=[];areActionsDisabled=!0x1;_outdatedReasonByDocumentId;isFromHistory=!0x1;documentContextContent;_documentIdToSource=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];cachedSuggestionContentParts={'withDiff':[],'withoutDiff':[]};constructor({type:_0x4471d3,isDone:_0x1d869d=!0x1,isComplete:_0x6bb5e7,interactionId:_0x488b2a,areActionsDisabled:_0x15e368,outdatedReasonByDocumentId:_0x189c9b,isFromHistory:_0x5ca517=!0x1,documentContextContent:_0x3739fc,locale:_0x415d47,id:_0x79b79,channelsToEditors:_0x2a03a9}){super(),this['id']=_0x79b79||Xt(),this['interactionId']=_0x488b2a,this['type']=_0x4471d3,this['areActionsDisabled']=!!_0x15e368,this['_outdatedReasonByDocumentId']=_0x189c9b,this['isFromHistory']=_0x5ca517,this['locale']=_0x415d47,this['aiResponseParser']=new Xn(),this['aiResponseApplier']=new Kn(),this['documentContextContent']=new Map(_0x3739fc?.['map'](_0x52f343=>[_0x52f343['id'],en(_0x52f343['content'])])||[]),this['_documentIdToSource']=new Map(_0x3739fc?.['map'](_0x17c5fb=>[_0x17c5fb['id'],{'editor':_0x2a03a9['get'](_0x17c5fb['channelId']),'rootName':_0x17c5fb['rootName']}])||[]),this['set']('isDone',_0x1d869d),this['set']('isComplete',_0x6bb5e7??_0x1d869d),'text'===this['type']&&this['content']['set']('text','');}appendContent(_0x29fd20,_0x179a96){const _0x39f769='text'===this['type']?'text':_0x179a96;this['content']['has'](_0x39f769)||this['content']['set'](_0x39f769,''),this['content']['set'](_0x39f769,this['content']['get'](_0x39f769)+_0x29fd20),this['onContentChange'](_0x39f769);}['done'](_0x3a7dea=!0x0){this['isComplete']=_0x3a7dea,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}destroy(){this['stopListening']();}setChangeGroupState(_0x220a3a,_0x3a94c5,_0x3ca92d){this['changeGroups'][_0x220a3a]['state']=_0x3a94c5,this['changeGroups'][_0x220a3a]['outdatedReason']=_0x3ca92d,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x220a3a,'state':_0x3a94c5,'outdatedReason':_0x3ca92d});}getContentParts({showDiff:_0x361a56,groupIndex:_0x3acc51}){const _0x2b7da8=this['_getCachedContentParts'](_0x361a56,_0x3acc51);if(_0x2b7da8)return _0x2b7da8;let _0x4fbe76;if(void 0x0===_0x3acc51)_0x4fbe76=this['changeGroups'];else{const _0x3e310e=this['changeGroups']['find'](({index:_0xb4aef9})=>_0xb4aef9===_0x3acc51);if(!_0x3e310e)throw new dt('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3acc51});_0x4fbe76=[_0x3e310e];}const _0x21049c=wr({'showDiff':_0x361a56,'changeGroups':_0x4fbe76,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x361a56,_0x21049c),_0x21049c;}_getCachedContentParts(_0x592099,_0x17ac4a){const _0x5d6f59=_0x592099?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x5d6f59]['length'])return null;const _0x373e7b=this['cachedSuggestionContentParts'][_0x5d6f59];if(void 0x0===_0x17ac4a)return _0x373e7b['length']>0x0&&_0x373e7b['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x592099,null),null):_0x30d267(_0x373e7b);{const _0x5711ee=_0x373e7b['find'](({index:_0x425a7b})=>_0x425a7b===_0x17ac4a);if(_0x5711ee)return[_0x30d267(_0x5711ee)];}return null;}_setCachedContentParts(_0x1cd92e,_0x368df9){const _0x1cb0b5=_0x1cd92e?'withDiff':'withoutDiff';_0x368df9?_0x368df9['forEach'](_0x472ae7=>{const _0x4dde26=this['cachedSuggestionContentParts'][_0x1cb0b5],_0x5b7e06=_0x4dde26['find'](({index:_0x5d077a})=>_0x5d077a===_0x472ae7['index']);if(_0x5b7e06){const _0x3888ed=_0x4dde26['indexOf'](_0x5b7e06);_0x4dde26['splice'](_0x3888ed,0x1,_0x472ae7);}else _0x4dde26['push'](_0x472ae7);}):this['cachedSuggestionContentParts'][_0x1cb0b5]['length']=0x0;}onContentChange(_0x33063b){if('modification'===this['type']){if(_0x33063b)this['parsedContent']['set'](_0x33063b,this['aiResponseParser']['parseAndNormalizeHTML'](this['content']['get'](_0x33063b)));else{for(const [_0x2ff1e7,_0x5a2301]of this['content'])this['parsedContent']['set'](_0x2ff1e7,this['aiResponseParser']['parseAndNormalizeHTML'](_0x5a2301));}const _0x311d5a=this['changeGroups'];for(const _0x2c3747 of this['content']['keys']())this['updateChangeGroups'](_0x2c3747);const _0x42f446=this['_getDifferentChangeGroups'](_0x311d5a,this['changeGroups']);(_0x42f446['length']||this['isDone'])&&(this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0,this['fire']('replyContentUpdated',this,_0x42f446));}else this['parsedContent']['set']('text',this['aiResponseParser']['convertMarkdownToHTML'](this['content']['get']('text'))),this['fire']('replyContentUpdated',this);}_getDifferentChangeGroups(_0x1d688b,_0x3bae79){const _0xd922f3=[];for(const _0x30510a of _0x3bae79){const _0x2352e4=_0x1d688b[_0x30510a['index']];_0x2352e4?_0x2352e4['changes']['length']!==_0x30510a['changes']['length']?_0xd922f3['push'](_0x30510a):_0x2352e4['changes']['forEach']((_0x5cd5f5,_0x1a2622)=>{const _0x3366d6=_0x30510a['changes'][_0x1a2622];_0x5cd5f5['id']!==_0x3366d6['id']&&_0xd922f3['push'](_0x30510a);}):_0xd922f3['push'](_0x30510a);}return _0xd922f3;}updateChangeGroups(_0x22c474){const _0x464ce8=this['documentContextContent']['get'](_0x22c474),_0x10caff=this['parsedContent']['get'](_0x22c474);if(!_0x464ce8||!_0x10caff)return;const _0x46c8e5=new _0x3cf04b('p',{},[new _0x3cf04b('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3978f9(qs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x59b904=this['aiResponseApplier']['merge'](_0x10caff,_0x464ce8['cloneNode'](!0x0),{'cutAfterUnstable':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x46c8e5});this['parsedMergedContent']['set'](_0x22c474,_0x59b904['parsedContent']);let _0x184c8f=[];if(_0x457f76(_0x246abd=>{const _0x1f5075=ln(_0x246abd,'data-id');if(!_0x1f5075||!_0x19f650(_0x1f5075))return!0x1;const _0x27ac35=[_0x246abd,..._n(_0x246abd)]['at'](-0x2);if(_0x246abd!=_0x27ac35){const _0x1578e3=ln(_0x27ac35,'data-id');_0x19f650(_0x1578e3)||(_0x184c8f['push']({'node':_0x27ac35,'id':_0x1578e3,'type':'modified'}),_0x59b904['modifiedNodeIds']['push'](_0x1578e3));}else _0x59b904['modifiedNodeIds']['includes'](_0x1f5075)?_0x184c8f['push']({'node':_0x246abd,'type':'modified','id':_0x1f5075}):_0x59b904['newNodeIds']['includes'](_0x1f5075)?_0x184c8f['push']({'node':_0x246abd,'type':'new','id':_0x1f5075,'anchorId':ln(_0x246abd['previousSibling'],'data-id')}):_0x184c8f['push']({'node':_0x246abd,'type':'removed','id':_0x1f5075});return!0x0;},this['parsedMergedContent']['get'](_0x22c474)),_0x184c8f=_0x184c8f['filter'](({node:_0x5eb792})=>[..._n(_0x5eb792),_0x5eb792]['every'](_0x5667b3=>!ln(_0x5667b3,'data-unstable'))),this['changeGroups']=this['changeGroups']['filter'](_0x3c5097=>_0x3c5097['documentId']!==_0x22c474),0x0==_0x184c8f['length'])return;const _0x2cfbad=[[_0x184c8f[0x0]]];for(let _0x2679c4=0x1;_0x2679c4<_0x184c8f['length'];_0x2679c4++){const _0x486312=_0x2cfbad[_0x2cfbad['length']-0x1],_0x268e6b=_0x486312[_0x486312['length']-0x1];_0x184c8f[_0x2679c4]['node']['previousSibling']==_0x268e6b['node']&&'modified'!=_0x184c8f[_0x2679c4]['type']&&'modified'!=_0x268e6b['type']?_0x486312['push'](_0x184c8f[_0x2679c4]):_0x2cfbad['push']([_0x184c8f[_0x2679c4]]);}for(const _0x268ef4 of _0x2cfbad){const _0x5a5d44=_0x268ef4[0x0],_0x1907d6=_0x268ef4[_0x268ef4['length']-0x1],_0x443251=_0x2a72a2(_0x5a5d44['node']['previousSibling']);_0x443251&&_0x268ef4['unshift'](_0x443251);const _0x487b85=_0x2a72a2(_0x1907d6['node']['nextSibling']);_0x487b85&&_0x268ef4['push'](_0x487b85);}rn('data-wrapped-id',null,this['parsedMergedContent']['get'](_0x22c474))['forEach'](_0x3bbde8=>{un(_0x3bbde8,'data-wrapped-id',null);});const _0x1ae64b=new Map();rn('data-unwrapped-id',null,this['parsedMergedContent']['get'](_0x22c474))['forEach'](_0xc6c415=>{const _0x508a88=ln(_0xc6c415,'data-unwrapped-id'),_0x1173f0=ln(_0xc6c415,'data-id');_0x1ae64b['set'](_0x1173f0,_0x508a88),un(_0xc6c415,'data-id',_0x508a88),un(_0xc6c415,'data-unwrapped-id',null);});for(const _0x5b0107 of _0x184c8f){const _0x26fd5e=_0x1ae64b['get'](_0x5b0107['id']);_0x26fd5e&&(_0x5b0107['id']=_0x26fd5e);}this['changeGroups']['push'](..._0x2cfbad['map']((_0x2e8343,_0x3d86fe)=>{const _0xe23994=this['_documentIdToSource']['get'](_0x22c474),_0x1820ff=this['_outdatedReasonByDocumentId']?.['get'](_0x22c474),_0xa39959=this['areActionsDisabled']||void 0x0!==_0x1820ff;return{'changes':_0x2e8343,'state':_0xa39959?'outdated':'pending','outdatedReason':_0xa39959?_0x1820ff:void 0x0,'index':_0x3d86fe,'editor':_0xe23994['editor'],'rootName':_0xe23994['rootName'],'documentId':_0x22c474};}));const _0x223198=Array['from'](this['documentContextContent']['keys']());function _0x19f650(_0x1a672e){return _0x59b904['modifiedNodeIds']['includes'](_0x1a672e)||_0x59b904['newNodeIds']['includes'](_0x1a672e)||_0x59b904['removedNodeIds']['includes'](_0x1a672e);}function _0x2a72a2(_0x3d0625){if(_0x3d0625&&ln(_0x3d0625,'data-id')&&!ln(_0x3d0625,'data-unstable')){const _0x4d4839=ln(_0x3d0625,'data-id');if(!_0x19f650(_0x4d4839))return{'node':_0x3d0625,'type':'context','id':_0x4d4839};}return null;}this['changeGroups']['sort']((_0x3a45ba,_0x5baabf)=>_0x223198['indexOf'](_0x3a45ba['documentId'])-_0x223198['indexOf'](_0x5baabf['documentId'])),this['changeGroups']['forEach']((_0x5dc4f9,_0x1e235f)=>{_0x5dc4f9['index']=_0x1e235f;});}};const kr=/* #__PURE__ -- @preserve */
|
|
31
|
+
It(),xr=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];var Lr=class extends kr{['id'];['replies']=[];currentReply;['messageId'];actionCallId;currentRequest;connector;isStopped=!0x1;isDestroyed=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;_channelsToEditors;constructor({connector:_0xf6cc3,locale:_0x418eb5,channelsToEditors:_0x18da5e}){super(),this['id']=Xt(),this['connector']=_0xf6cc3,this['isStopped']=!0x0,this['locale']=_0x418eb5,this['_channelsToEditors']=_0x18da5e||new Map();}async start(){await this['_run']();}async['resume'](_0x418210){await this['_run'](_0x418210);}async['_run'](_0x1f7e99){const _0x527639=[];let _0x2458e7,_0x59f995,_0x585376,_0x260dcf=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=_0x1f7e99||this['sendRequest'](),this['fire']('interactionStarted',this);const _0x454fbe=await this['currentRequest']['getStream']();for await(const _0x347284 of _0x454fbe){if(this['isStopped'])return;if('error'==_0x347284['event'])return void this['fire']('error',{'error':new dt('ai-chat-interaction-error',this)});switch(_0x347284['event']){case'message-metadata':this['messageId']=_0x347284['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x347284['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x347284['data']['conversationTitle'],!0x0);break;case'source':_0x527639['push'](_0x347284['data']['source']);break;case'web-search':this['_isWebSearching']||(this['_isWebSearching']=!0x0,this['fire']('webSearchStarted',this));break;case'reasoning':this['_isReasoning']||(this['_isReasoning']=!0x0,this['fire']('reasoningStarted',this));break;case'modification-delta':case'text-delta':this['resetReasoningState'](),this['resetWebSearchState'](),_0x2458e7='modification-delta'==_0x347284['event']?'modification':'text',_0x59f995='modification-delta'==_0x347284['event']?_0x347284['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2458e7&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x2458e7,'interactionId':this['id'],'id':_0x59f995,'channelsToEditors':this['_channelsToEditors'],...'modification-delta'==_0x347284['event']&&{'documentId':_0x347284['data']['documentId']}}),'modification'==_0x2458e7&&(this['currentReply']['sources']=_0x527639['splice'](0x0))),this['currentReply']['appendContent'](_0x347284['data']['textDelta'],_0x347284['data']['documentId']);break;case'mcp-tool-result':_0x585376=JSON['parse'](_0x347284['data']['result']),this['_handleToolResultData']({'toolName':_0x347284['data']['toolName'],'data':_0x585376['data'],'attributes':_0x585376['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x347284['data']['toolName'],'data':_0x347284['data']['data']});}}_0x260dcf=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x527639['length']>0x0&&(this['currentReply']['sources']=_0x527639['splice'](0x0)),this['_finalizeInteraction'](_0x260dcf),this['fire']('interactionFinished',this));}}stop(){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}getReply(_0x1a2bc8){return this['replies']['find'](_0x950d1e=>_0x950d1e['id']===_0x1a2bc8);}destroy(){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x19343f=>_0x19343f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}createReply(_0x2a7aec){const _0x39defa=this['getDocumentContext'](),_0x3e09d0=new Nr({'locale':this['locale'],'documentContextContent':_0x39defa?.['documents'],..._0x2a7aec});return this['replies']['push'](_0x3e09d0),_0x3e09d0['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x3e09d0),_0x3e09d0;}setConversationTitle(_0x1eaba1,_0x14350e=!0x1){this['fire']('setConversationTitle',_0x1eaba1,_0x14350e);}resetWebSearchState(){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}resetReasoningState(){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}_handleToolResultData(_0xf5fafe){this['fire']('toolDataReceived',{'type':'result','toolName':_0xf5fafe['toolName'],'data':structuredClone(_0xf5fafe['data']||{}),'attributes':structuredClone(_0xf5fafe['attributes']||{})},this);}_handleToolNotificationData(_0x486a25){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x486a25['toolName'],'data':structuredClone(_0x486a25['data'])},this);}_finalizeInteraction(_0x5803f3=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x5803f3),this['currentRequest']=this['currentReply']=void 0x0;}};const Dr=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),Pr=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];var Mr=class AIChatContext extends nr{_connector;['_config'];['_ownerId'];constructor({connector:_0x2e7359,config:_0x2b24ab,ownerId:_0x1daecd}){super(),this['_connector']=_0x2e7359,this['_config']=_0x2b24ab,this['_ownerId']=_0x1daecd;}init(){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_shownLibraryContextRefIds']=new Set(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}getPendingContextItems(){return new Map(this['_pendingContextItems']);}async populateFromMessage(_0x5dc15b,_0x5d88be,_0x37981=new Set()){const _0x49b71f=new Map(),{contextItem:_0x4289d7,unmatchedDocumentIds:_0x3771a9}=await this['_populateDocumentContextItem'](_0x5dc15b,_0x5d88be);_0x4289d7&&_0x49b71f['set'](_0x4289d7['id'],_0x4289d7);for(const _0x372b65 of _0x5dc15b){if('document'===_0x372b65['type'])continue;const _0x27dca8=await this['_createContextItemFromContent'](_0x372b65,_0x37981);Vr(_0x27dca8)?this['_hideRepeatedContextReference'](_0x27dca8,_0x37981):this['_addToConversationContextItem'](_0x27dca8),_0x49b71f['set'](_0x27dca8['id'],_0x27dca8);}return this['_restoreContextReferencesAttachment'](_0x49b71f,_0x37981),{'contextItems':_0x49b71f,'hasUnmatched':_0x3771a9['size']>0x0,'unmatchedDocumentIds':_0x3771a9};}async _populateDocumentContextItem(_0x1bbd43,_0x2123b2){const _0x51dae5=_0x1bbd43['filter'](_0x46b4d7=>'document'===_0x46b4d7['type']);if(0x0===_0x51dae5['length'])return{'unmatchedDocumentIds':new Set()};const _0x871b7a=_0x51dae5['map'](_0xfd97c9=>_0xfd97c9['id']),_0x1ae923=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x871b7a)['getDocuments'](),_0x3cbd1f=new Map(_0x1ae923['map'](_0x14e999=>[_0x14e999['id'],_0x14e999])),_0x105261=[],_0x19de8e=new Set();for(const _0x508829 of _0x51dae5){const _0x124540=_0x3cbd1f['get'](_0x508829['id']);_0x124540&&(this['_matchDocumentToRoot'](_0x124540,_0x2123b2)||_0x19de8e['add'](_0x124540['id']),_0x105261['push']({'id':_0x124540['id'],'content':_0x124540['content'],'version':_0x124540['attributes']?.['version']??0x0,'sessionId':_0x124540['attributes']?.['sessionId']??null,'selection':[],'selectionSignature':'','channelId':_0x124540['attributes']?.['channelId']??_0x2123b2[0x0]?.['config']['get']('collaboration.channelId')??'','rootName':_0x124540['attributes']?.['rootName']??_0x2123b2[0x0]?.['model']['document']['getRoots']()[0x0]['rootName']??'','editorConfig':_0x508829['editorConfig']}));}const _0xa3cc4b={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x105261};return this['_addToConversationContextItem'](_0xa3cc4b),this['toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0xa3cc4b,'unmatchedDocumentIds':_0x19de8e};}_matchDocumentToRoot(_0x4c2fdc,_0x3d3fc2){const _0x4660a5=_0x4c2fdc['attributes']?.['channelId'],_0x327416=_0x4c2fdc['attributes']?.['rootName'];if(_0x4660a5&&_0x327416){for(const _0x3202c5 of _0x3d3fc2)if(_0x3202c5['config']['get']('collaboration.channelId')===_0x4660a5){for(const _0x1d4b2a of _0x3202c5['model']['document']['getRoots']())if('$graveyard'!==_0x1d4b2a['rootName']&&_0x1d4b2a['rootName']===_0x327416)return{'editor':_0x3202c5,'rootName':_0x1d4b2a['rootName']};}}}async _createContextItemFromContent(_0x27dcdd,_0x41999d=new Set()){if('mcp-tool-context'===_0x27dcdd['type'])return{'id':_0x27dcdd['id'],'uiId':_0x27dcdd['id'],'label':_0x27dcdd['data']?.['label']||_0x27dcdd['id'],'type':'mcp-tool-context','mcpServerName':_0x27dcdd['mcpServerName'],'toolName':_0x27dcdd['toolName'],'data':_0x27dcdd['data']||{}};const _0x687185=_0x27dcdd['attributes']?.['resourceId']||(Vr(_0x27dcdd)?_0x27dcdd['id']:void 0x0);return{'id':_0x27dcdd['id'],'uiId':_0x27dcdd['id'],'label':_0x27dcdd['attributes']?.['label']||_0x27dcdd['name']||_0x27dcdd['url']||_0x27dcdd['id'],'type':_0x27dcdd['type'],..._0x687185?{'resourceId':_0x687185}:{},...Vr(_0x27dcdd)&&_0x41999d['has'](_0x27dcdd['id'])?{'hidden':!0x0}:{}};}_restoreContextReferencesAttachment(_0x5810d3,_0x3ba00d){const _0x2b0417=new Set(),_0x383bc7=new Set();for(const _0x4ec5d8 of _0x5810d3['values']())Vr(_0x4ec5d8)&&!_0x3ba00d['has'](_0x4ec5d8['id'])&&_0x2b0417['add'](_0x4ec5d8['id']);for(const _0x4b2ec9 of Array['from'](this['_pendingContextItems']['values']()))Vr(_0x4b2ec9)&&(_0x2b0417['has'](_0x4b2ec9['id'])?_0x383bc7['add'](_0x4b2ec9['id']):this['_removeContextItem'](_0x4b2ec9['uiId']));for(const _0x3bedbc of _0x5810d3['values']())_0x2b0417['has'](_0x3bedbc['id'])&&!_0x383bc7['has'](_0x3bedbc['id'])&&this['_keepContextItemAttached'](_0x3bedbc);}getSentContextItems(){return new Map(this['_conversationContextItems']);}removeFromContext(_0x3d2eb7){this['_pendingContextItems']['get'](_0x3d2eb7)?.['isReadOnly']||this['_removeContextItem'](_0x3d2eb7);}clearPendingContextItems(){if(0x0===this['_pendingContextItems']['size'])return;const _0x139d33=Array['from'](this['_pendingContextItems']['values']());for(const _0x2df007 of _0x139d33)Vr(_0x2df007)&&_0x2df007['hidden']||(this['_removeContextItem'](_0x2df007['uiId']),Vr(_0x2df007)&&this['_keepContextItemAttached'](_0x2df007));const _0x5218bb=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x5218bb&&this['_keepContextItemAttached'](_0x5218bb);}addToConversationContext(_0x320c3a){for(const _0x438ca1 of _0x320c3a['values']())Vr(_0x438ca1)||this['_addToConversationContextItem'](_0x438ca1);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(_0x5a27d4){return Array['from'](_0x5a27d4['values']())['flatMap'](_0x4b634b=>this['_mapContextItemToRequestData'](_0x4b634b));}async addFilesToContext(_0x1ec901,_0x598c8f,_0x436e81='file'){const _0x424bf7='files-'+Xt();this['_startUploadOperation'](_0x424bf7);try{await Promise['all'](_0x1ec901['map'](async _0x10f7e2=>{const _0x759f51='file-'+Xt(),_0x32af0d=_0x369484(_0x10f7e2['name']),_0x2168fd='file'===_0x436e81&&_0x10f7e2['type']['startsWith']('image/')?'image':_0x436e81;try{this['_addContextItem']({'type':_0x2168fd,'label':_0x598c8f?.['label']||_0x32af0d,'uiId':_0x759f51,'resourceId':_0x598c8f?.['resourceId']},!0x0);const _0x2a2060=this['_connector']['uploadFile'](this['_ownerId'],_0x10f7e2,_0x598c8f);this['_ongoingUploads']['set'](_0x759f51,_0x2a2060['abortController']);const {id:_0x48b583}=await _0x2a2060['getId']();this['_ongoingUploads']['delete'](_0x759f51),this['_finishContextItemLoading']({'type':_0x2168fd,'id':_0x48b583,'label':_0x598c8f?.['label']||_0x32af0d,'uiId':_0x759f51,'resourceId':_0x598c8f?.['resourceId']},!0x1);}catch(_0x1422b4){if(this['_ongoingUploads']['delete'](_0x759f51),!lr(_0x1422b4)){const _0xcc2470=Dr['get'](_0x1422b4['code'])||'ai-chat-file-upload-failed',_0x1eedb1=new ur({'code':_0xcc2470,'cause':_0x1422b4,'context':{'fileName':_0x32af0d}});this['fire']('error',{'error':_0x1eedb1});}this['_removeContextItem'](_0x759f51);}}));}finally{this['_finishUploadOperation'](_0x424bf7);}}addCurrentDocumentToContext(_0x229216){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4f9d42={'type':'document','uiId':'current-document','label':_0x229216,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4f9d42);}getCurrentDocumentContext(){return this['_pendingContextItems']['get']('current-document');}async updateCurrentDocuments(_0x153b9a,_0x4cc0a9){const _0x4a0c97=this['getCurrentDocumentContext']();if(!_0x4a0c97)return;_0x153b9a['length']>0x1&&_0x153b9a['some'](_0x3d1fbd=>!_0x3d1fbd['description'])&&Ft('ai-chat-documents-missing-description');try{const _0x18e403=(_0x4a0c97['documents']||[])['filter'](_0x10ab01=>_0x4cc0a9['has'](_0x10ab01['channelId']));if(!_0x153b9a['length'])return void(_0x4a0c97['documents']=_0x18e403);const _0x1bd100=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x153b9a)['getIds']();if(_0x1bd100['length']!==_0x153b9a['length']||_0x1bd100['some'](_0x148208=>!_0x148208?.['id'])){const _0x1b2927=new dt('ai-chat-document-upload-reply-mismatch',null);return void this['fire']('error',{'error':_0x1b2927});}const _0x241adc=_0x153b9a['map']((_0x271a11,_0x57e1a6)=>{return{'id':_0x1bd100[_0x57e1a6]['id'],'content':_0x271a11['content'],'version':_0x271a11['version'],'sessionId':_0x271a11['sessionId'],'selection':(_0x3d3af4=_0x271a11['selections'],_0x3d3af4?_0x3d3af4['map'](_0xdd005=>({'start':_0xdd005['start'],'end':_0xdd005['end']})):[]),'selectionSignature':_0x271a11['selectionSignature'],'channelId':_0x271a11['channelId'],'rootName':_0x271a11['rootName'],'editorConfig':_0x271a11['editorConfig']};var _0x3d3af4;});_0x4a0c97['documents']=[..._0x18e403,..._0x241adc];}catch(_0x493fd8){throw new ur({'code':'ai-chat-document-upload-failed','type':'network','cause':_0x493fd8});}}addSelectionToContext(_0x181e28){this['_addContextItem']({'type':'selection','label':_0x181e28,'uiId':'selection','content':_0x181e28});}removeSelectionFromContext(){this['_removeContextItem']('selection');}addLibraryContextToContext(_0x579d92,_0x1e555d){this['_isResourceInContext'](_0x579d92)||this['_addContextItem']({'type':'context','id':_0x579d92,'label':_0x1e555d||_0x579d92,'uiId':'context-'+Xt(),'resourceId':_0x579d92});}async addUrlToContext(_0x5b382b,_0x47586d){const _0x311b51='url-'+Xt();this['_startUploadOperation'](_0x311b51);const _0x29e374='url-'+Xt();try{this['_addContextItem']({'type':'web-resource','label':_0x47586d?.['label']||_0x5b382b,'uiId':_0x29e374,'resourceId':_0x47586d?.['resourceId']},!0x0);const _0xd62030=this['_connector']['uploadUrl'](this['_ownerId'],_0x5b382b,_0x47586d);this['_ongoingUploads']['set'](_0x29e374,_0xd62030['abortController']);const {id:_0x120dd2}=await _0xd62030['getId']();this['_ongoingUploads']['delete'](_0x29e374),this['_finishContextItemLoading']({'type':'web-resource','id':_0x120dd2,'label':_0x47586d?.['label']||_0x5b382b,'uiId':_0x29e374,'resourceId':_0x47586d?.['resourceId']},!0x1);}catch(_0x295275){this['_ongoingUploads']['delete'](_0x29e374),lr(_0x295275)||this['fire']('error',{'error':new dt('ai-chat-url-upload-failed',this,{'url':_0x5b382b,'originalError':_0x295275}),'url':_0x5b382b}),this['_removeContextItem'](_0x29e374);}finally{this['_finishUploadOperation'](_0x311b51);}}addToolItemToContext(_0x15efa8){_0x15efa8['id']=_0x15efa8['id']??Xt()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x15efa8['uiId'],_0x15efa8),this['fire']('contextItemAdded',{'contextItem':_0x15efa8,'isLoading':!0x1});}async['loadSourceResources'](_0x4c88d2,_0x1f2d58,_0x12a91f){const _0x2f8448=this['_addContextOptionsState']['sources']['find'](_0x2199f9=>_0x2199f9['id']===_0x4c88d2);if(!_0x2f8448)return this['fire']('error',{'error':new dt('ai-chat-source-not-found',this,{'sourceId':_0x4c88d2}),'sourceId':_0x4c88d2}),[];try{const _0x109e0d=(await _0x2f8448['getResources'](_0x1f2d58))['map'](_0x4f899b=>{const _0x563da9=this['_isResourceInContext'](_0x4f899b['id']);return{..._0x4f899b,'isInContext':_0x563da9};});return _0x2f8448['resources']=_0x109e0d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4c88d2,'source':_0x2f8448,'resources':_0x109e0d,'uid':_0x12a91f}),_0x109e0d;}catch(_0xc39401){return this['fire']('error',{'error':new dt('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4c88d2,'originalError':_0xc39401}),'sourceId':_0x4c88d2,'sourceLabel':_0x2f8448['label']}),[];}}async addResourceToContext(_0x267f3e,_0x212f01){if(this['_isResourceInContext'](_0x212f01['id']))return;if(Vr(_0x212f01))return void this['addLibraryContextToContext'](_0x212f01['id'],_0x212f01['label']);let _0x2d825d=_0x212f01['data'];if(!_0x2d825d&&_0x267f3e['getData'])try{_0x2d825d=await _0x267f3e['getData'](_0x212f01['id']);}catch(_0x21acd8){return void this['fire']('error',{'error':new dt('ai-chat-resource-load-failed',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'originalError':_0x21acd8}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}if(_0x2d825d)switch(_0x212f01['type']){case'web-resource':if('string'!=typeof _0x2d825d)return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'string','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});await this['addUrlToContext'](_0x2d825d,{'label':_0x212f01['label'],'resourceId':_0x212f01['id']});break;case'file':if(!(_0x2d825d instanceof File))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'File','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});await this['addFilesToContext']([_0x2d825d],{'label':_0x212f01['label'],'resourceId':_0x212f01['id']});break;case'text':if('object'!=typeof _0x2d825d||!('content'in _0x2d825d)||!('type'in _0x2d825d))return void this['fire']('error',{'error':new dt('ai-chat-context-invalid-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2d825d}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});_0x2d825d=AIChatContext['_convertTextResourceToFile'](_0x2d825d,_0x212f01['label']),await this['addFilesToContext']([_0x2d825d],{'label':_0x212f01['label'],'resourceId':_0x212f01['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new dt('ai-chat-context-unsupported-type',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id'],'resourceType':_0x212f01['type']}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}else this['fire']('error',{'error':new dt('ai-chat-resource-no-data',this,{'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']}),'resourceId':_0x212f01['id'],'sourceId':_0x267f3e['id']});}addContextSource(_0x1de2a4){this['_addContextOptionsState']['sources']['some'](_0x2ebe05=>_0x2ebe05['id']===_0x1de2a4['id'])||(this['_addContextOptionsState']['sources']['push']({..._0x1de2a4,'resources':[]}),this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']}));}toggleAddCurrentDocumentOptionVisibility(_0x1970eb){if(void 0x0!==_0x1970eb)this['_addContextOptionsState']['document']['isHidden']=!_0x1970eb;else{const _0x683115=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x683115;}this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}static _convertTextResourceToFile(_0x1c3862,_0x33d801){switch(_0x1c3862['type']){case'markdown':return new File([_0x1c3862['content']],_0x33d801,{'type':'text/markdown'});case'html':return new File([_0x1c3862['content']],_0x33d801,{'type':'text/html'});default:return new File([_0x1c3862['content']],_0x33d801,{'type':'text/plain'});}}static _mapContextItemToRequestData(_0x118081){switch(_0x118081['type']){case'file':case'image':case'text':return[{'type':'file','id':_0x118081['id']}];case'web-resource':return[{'type':'web-resource','id':_0x118081['id']}];case'context':return[{'type':'context','id':_0x118081['id']}];case'document':return _0x118081['documents']?.['length']?_0x118081['documents']['map'](({id:_0x5b8772,editorConfig:_0x289791,selection:_0x4754fc})=>({'type':'document','id':_0x5b8772,..._0x289791&&{'editorConfig':_0x289791},..._0x4754fc?.['length']&&{'selection':_0x4754fc}})):[];case'mcp-tool-context':{const _0x163552=_0x118081;return[{'type':'mcp-tool-context','mcpServerName':_0x163552['mcpServerName'],'toolName':_0x163552['toolName'],'data':{..._0x163552['data'],'label':_0x163552['label']||_0x163552['data']?.['label']||_0x163552['id']},'id':_0x163552['id']}];}default:return[];}}_addContextItem(_0xfe473d,_0x4a174e=!0x1){if(this['_pendingContextItems']['set'](_0xfe473d['uiId'],_0xfe473d),_0xfe473d['hidden']||this['fire']('contextItemAdded',{'contextItem':_0xfe473d,'isLoading':_0x4a174e}),'current-document'===_0xfe473d['uiId']&&this['toggleAddCurrentDocumentOptionVisibility'](),_0xfe473d['resourceId']){const _0x54ed7f=this['_findSourceIdsByResourceId'](_0xfe473d['resourceId']);_0x54ed7f&&_0x54ed7f['forEach'](_0x12c278=>{this['_updateResourceInContextState'](_0x12c278,_0xfe473d['resourceId'],!0x0);});}}_keepContextItemAttached(_0x4cd110){this['_addContextItem']({..._0x4cd110,'isReadOnly':!0x0,'hidden':!0x0});}_removeContextItem(_0x448a4a){const _0x35e116=this['_pendingContextItems']['get'](_0x448a4a),_0x5ff6c2=this['_ongoingUploads']['get'](_0x448a4a);if(_0x5ff6c2&&(_0x5ff6c2['abort'](),this['_ongoingUploads']['delete'](_0x448a4a)),_0x35e116?.['resourceId']){const _0x3209e2=this['_findSourceIdsByResourceId'](_0x35e116['resourceId']);_0x3209e2&&_0x3209e2['forEach'](_0x4a65a2=>{this['_updateResourceInContextState'](_0x4a65a2,_0x35e116['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x448a4a),this['fire']('contextItemRemoved',{'uiId':_0x448a4a,'type':_0x35e116?.['type']}),'current-document'===_0x448a4a&&this['toggleAddCurrentDocumentOptionVisibility']();}_finishContextItemLoading(_0x987156,_0x2e43d8){if(this['_pendingContextItems']['has'](_0x987156['uiId'])&&(this['_pendingContextItems']['set'](_0x987156['uiId'],_0x987156),this['fire']('contextItemLoadingEnded',{'contextItem':_0x987156,'isLoading':_0x2e43d8}),_0x987156['resourceId'])){const _0x4b3e08=this['_findSourceIdsByResourceId'](_0x987156['resourceId']);_0x4b3e08&&_0x4b3e08['forEach'](_0x25e714=>{this['_updateResourceInContextState'](_0x25e714,_0x987156['resourceId'],!0x0);});}}_addToConversationContextItem(_0x356e23){this['_conversationContextItems']['set'](_0x356e23['uiId'],_0x356e23);}_hideRepeatedContextReference(_0x4ca57b,_0x187a28){_0x187a28['has'](_0x4ca57b['id'])||(this['_shownLibraryContextRefIds']['has'](_0x4ca57b['id'])?_0x4ca57b['hidden']=!0x0:this['_shownLibraryContextRefIds']['add'](_0x4ca57b['id']));}_setAddContextOptionsDefaultState(){this['_addContextOptionsState']={'document':{'enabled':!0x1!==this['_config']?.['document']?.['enabled'],'isHidden':!0x1},'urls':{'enabled':!0x1!==this['_config']?.['urls']?.['enabled']},'files':{'enabled':!0x1!==this['_config']?.['files']?.['enabled']},'sources':this['_getCustomSourcesInitialState'](),'customItems':this['_config']?.['customItems']?.['map'](_0x5a8dce=>({..._0x5a8dce,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}_getCustomSourcesInitialState(){return this['_config']?.['sources']?.['map'](_0x24bf49=>({..._0x24bf49,'resources':[]}))??[];}_isResourceInContext(_0x52646e){for(const _0xb9daf7 of this['_pendingContextItems']['values']())if(_0xb9daf7['resourceId']===_0x52646e)return!0x0;for(const _0x343c44 of this['_conversationContextItems']['values']())if(_0x343c44['resourceId']===_0x52646e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x10ec02){const _0x1643e4=[];for(const _0x10ff10 of this['_addContextOptionsState']['sources'])_0x10ff10['resources']['find'](_0x1139f1=>_0x1139f1['id']===_0x10ec02)&&_0x1643e4['push'](_0x10ff10['id']);return 0x0===_0x1643e4['length']?null:_0x1643e4;}_updateResourceInContextState(_0x10d228,_0x4b9f71,_0x43c3cb){const _0x54dec7=this['_addContextOptionsState']['sources']['find'](_0x20028e=>_0x20028e['id']===_0x10d228);if(!_0x54dec7)return;const _0x500800=_0x54dec7['resources']['find'](_0x12b61c=>_0x12b61c['id']===_0x4b9f71);_0x500800&&(_0x500800['isInContext']=_0x43c3cb,this['fire']('resourceStateChanged',{'sourceId':_0x10d228,'resourceId':_0x4b9f71,'isInContext':_0x43c3cb}));}_startUploadOperation(_0x4a059f){this['_ongoingUploadOperations']['set'](_0x4a059f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}_finishUploadOperation(_0x54b713){this['_ongoingUploadOperations']['delete'](_0x54b713),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}};function Vr(_0x406e11){return'context'===_0x406e11['type'];}var Hr=class extends Lr{['userMessage'];conversationId;contextItems=new Map();capabilities;['model'];attributes;context;constructor(_0xc19827){super(_0xc19827),this['conversationId']=_0xc19827['conversationId'],this['contextItems']=_0xc19827['contextItems'],this['capabilities']=_0xc19827['capabilities'],this['userMessage']=_0xc19827['userMessage'],this['model']=_0xc19827['model'],this['attributes']=_0xc19827['attributes'],this['context']=_0xc19827['context']??new nr();}sendRequest(){const _0x2caa36=Mr['mapContextItemsToRequestData'](this['contextItems']),_0x42e243=this['context']['toRequestParts'](_0x2caa36);return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':_0x42e243,'capabilities':er['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['context']['toMessageAttributes'](this['attributes'])});}getDocumentContext(){return this['contextItems']['get']('current-document');}};const Ur=/* #__PURE__ -- @preserve */
|
|
32
|
+
It();var Br=class extends Ur{['id'];isStarted=!0x1;isFromHistory;interactions=[];currentInteraction;selectedModel;connector;options;_abortReject;_channelsToEditors;_getSessionId;constructor(_0x2382e9){super(),this['options']=_0x2382e9,this['connector']=_0x2382e9['connector'],this['chatModels']=_0x2382e9['chatModels'],this['id']=_0x2382e9['conversationId'],this['isFromHistory']=_0x2382e9['isFromHistory'],this['_channelsToEditors']=_0x2382e9['channelsToEditors'],this['_getSessionId']=_0x2382e9['getSessionId'];}async init(_0x45de27){try{this['chatContext']=new Mr({'connector':this['connector'],'config':_0x45de27,'ownerId':this['id']}),this['chatContext']['delegate'](...Pr)['to'](this),this['chatContext']['init'](),this['options']['contextLibrary']?.['resolveContext']({'feature':'chat','extraContexts':this['options']['extraContexts'],'context':this['chatContext']}),this['chatCapabilities']=new er(),this['chatCapabilities']['delegate'](...tr)['to'](this),this['chatCapabilities']['init']();const _0x588210=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x588210});const _0x44ef16=await this['chatModels']['resolveModel'](this['options']['selectedModelId']);_0x44ef16&&await this['setModel'](_0x44ef16);}catch(_0x1ef823){const _0x5653b0=new ur({'code':'ai-chat-conversation-init-failed','cause':_0x1ef823,'type':'network'});this['fire']('error',{'error':_0x5653b0});}}async start(){if(this['isStarted'])throw new dt('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new dt('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x586818}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x586818,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x515827){const _0x49043e=new ur({'code':'ai-chat-conversation-start-failed','cause':_0x515827,'type':'network','context':{'conversationId':this['id']}});throw this['fire']('error',{'error':_0x49043e}),_0x49043e;}}async['load'](_0x256078){try{const _0x2fe58b=await this['connector']['fetchConversation'](_0x256078)['getConversation'](),_0xc864f7=await this['connector']['fetchConversationMessages'](_0x256078)['getMessages'](),_0x31e35e=_0xc864f7[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x2fe58b['id'],'title'in _0x2fe58b?this['fire']('setConversationTitle',_0x2fe58b['title'],!this['isFromHistory']):this['fire']('setConversationTitle','',!this['isFromHistory']),this['selectedModel']=await this['chatModels']['getModel'](_0x31e35e)??void 0x0,this['fire']('modelSelected',{'selectedModel':this['selectedModel'],'isDisabled':!0x0});const {streamingMessageId:_0x25ce3e}=await this['_processMessagesToInteractions'](_0xc864f7,_0x31e35e);return _0x25ce3e&&this['currentInteraction']?this['_resumeStream'](_0x25ce3e):this['currentInteraction']=void 0x0,this;}catch(_0x2b1376){const _0x288c54=new ur({'code':'ai-chat-conversation-init-from-id-failed','cause':_0x2b1376,'type':'network','context':{'conversationId':_0x256078}});throw this['fire']('error',{'error':_0x288c54}),_0x288c54;}}async _processMessagesToInteractions(_0x1000c4,_0x2b787c){let _0xb21c03,_0x555049,_0x47ac07=new Set();for(const _0x1a584c of _0x1000c4)if('user'===_0x1a584c['role']){const {contextItems:_0x1ac8ff,unmatchedDocumentIds:_0x3d4be9}=await this['_extractContextItems'](_0x1a584c);_0x47ac07=_0x3d4be9;const _0x54d110={'isReasoningEnabled':Object['hasOwn'](_0x1a584c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x1a584c['capabilities'],'webSearch')};_0xb21c03=this['createInteraction']({'userMessage':_0x1a584c['prompt'],'contextItems':_0x1ac8ff,'capabilities':_0x54d110,'modelId':_0x2b787c,'attributes':_0x1a584c['attributes'],'channelsToEditors':this['_channelsToEditors']}),this['currentInteraction']=_0xb21c03,_0x555049=void 0x0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x1a584c['role']&&_0xb21c03){if('streaming'===_0x1a584c['status']){_0x555049=_0x1a584c['id'];continue;}if('error'===_0x1a584c['status'])continue;const _0x1347ae=[];for(const _0x133c3c of _0x1a584c['content'])switch(_0x133c3c['type']){case'text':case'modification':{const _0x34645e=_0xb21c03['getDocumentContext'](),_0x5f4001=this['_getOutdatedReasonsByDocumentId'](_0x34645e,_0x47ac07),_0x3d5584=_0x34645e?.['documents']??[],_0x1af027=_0x3d5584['length']>0x0&&_0x3d5584['every'](_0x21b9e1=>_0x5f4001['has'](_0x21b9e1['id']));_0xb21c03['currentReply']?.['type']!==_0x133c3c['type']&&(_0xb21c03['currentReply']=_0xb21c03['createReply']({'type':_0x133c3c['type'],'isDone':!0x0,'interactionId':_0xb21c03['id'],'areActionsDisabled':_0x1af027,'outdatedReasonByDocumentId':_0x5f4001,'isFromHistory':!0x0,'channelsToEditors':this['_channelsToEditors']}),_0x1347ae['length']>0x0&&(_0xb21c03['currentReply']['sources']=_0x1347ae['splice'](0x0))),_0xb21c03['currentReply']['appendContent'](_0x133c3c['content'],_0x133c3c['documentId']);break;}case'url':_0x1347ae['push'](_0x133c3c);break;case'mcp-tool-result':{const {data:_0x4c65ed,attributes:_0x59d8bd}=JSON['parse'](_0x133c3c['content']);_0xb21c03['_handleToolResultData']({'toolName':_0x133c3c['toolName'],'data':_0x4c65ed,'attributes':_0x59d8bd});break;}}'cancelled'===_0x1a584c['status']&&this['fire']('error',{'interactionId':_0xb21c03['id'],'error':new dt('ai-request-aborted',this)});}}return{'streamingMessageId':_0x555049};}async _resumeStream(_0x26d147){if(this['currentInteraction'])try{const _0x43e39e=this['connector']['resumeStream'](this['id'],_0x26d147);await this['currentInteraction']['resume'](_0x43e39e);}catch(_0x2b4e73){_0x2b4e73 instanceof dt&&this['fire']('error',{'interactionId':this['currentInteraction']?.['id'],'error':_0x2b4e73});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}async _extractContextItems(_0x2cad83){return _0x2cad83['content']?this['chatContext']['populateFromMessage'](_0x2cad83['content'],Array['from'](this['_channelsToEditors']['values']()),nr['getDefaultContextIds'](_0x2cad83['attributes'])):{'contextItems':new Map(),'unmatchedDocumentIds':new Set()};}async handleUserInteraction({userMessage:_0x9d1db8,attributes:_0x397ae3}){if(!this['isStarted'])throw new dt('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new dt('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x68c685=new Map(this['getPendingContextItems']()),_0x5b29f0=this['chatCapabilities']['getCapabilitiesConfig'](),_0x10117f=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x9d1db8,'contextItems':_0x68c685,'capabilities':_0x5b29f0,'modelId':_0x10117f,'attributes':_0x397ae3,'channelsToEditors':this['_channelsToEditors']}),await this['updateCurrentDocumentsInContext'](),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2efaea){if(_0x2efaea instanceof dt)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2efaea});else{const _0x32edd3=Dr['get'](_0x2efaea['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new dt(_0x32edd3,null,{'error':_0x2efaea})});}}finally{this['stopProcessing']();}}stopProcessing(){this['_abortReject']&&(this['_abortReject'](),this['_abortReject']=void 0x0),this['currentInteraction']&&(this['currentInteraction']['stop'](),this['currentInteraction']=void 0x0);}createInteraction({userMessage:_0x4285fd,contextItems:_0x81036d,capabilities:_0x2a8132,modelId:_0x1ccfe3,attributes:_0x203aed,channelsToEditors:_0x14b958}){const _0x3ea617=new Hr({'userMessage':_0x4285fd,'contextItems':_0x81036d,'capabilities':_0x2a8132,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x1ccfe3,'attributes':_0x203aed,'channelsToEditors':_0x14b958,'context':this['chatContext']['isEmpty']?void 0x0:new nr(this['chatContext']['refs'])});return _0x3ea617['delegate'](...xr)['to'](this),this['interactions']['push'](_0x3ea617),this['fire']('interactionCreated',_0x3ea617),_0x3ea617;}getInteraction(_0x12c539){return this['interactions']['find'](_0x18a93a=>_0x18a93a['id']===_0x12c539);}removeInteraction(_0x2b2d74){const _0x57f41c=this['getInteraction'](_0x2b2d74);_0x57f41c&&(_0x57f41c['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x57f41c),0x1));}get lastInteraction(){return this['interactions'][this['interactions']['length']-0x1];}cancelLastInteractionStream(){const _0x2d5c21=this['lastInteraction'];_0x2d5c21?.['conversationId']&&_0x2d5c21['messageId']&&this['connector']['cancelStream'](_0x2d5c21['conversationId'],_0x2d5c21['messageId'])['execute']()['catch'](()=>{});}addCurrentDocumentToContext(_0xde4791){this['chatContext']['addCurrentDocumentToContext'](_0xde4791);}async updateCurrentDocumentsInContext(){if(!this['isCurrentDocumentInContext']())return;const {changedIds:_0x153c67,unchangedIds:_0x9bf626}=this['_compareEditorStateWithDocumentContext'](),_0x5e4697=new Promise((_0x63efcc,_0x1d72e9)=>{this['_abortReject']=()=>_0x1d72e9(new dt('ai-request-aborted',this));}),_0x46a616=await Promise['race']([this['options']['aiEditing']['getDocumentData'](_0x153c67),_0x5e4697]);await Promise['race']([this['chatContext']['updateCurrentDocuments'](_0x46a616,_0x9bf626),_0x5e4697]);}_compareEditorStateWithDocumentContext(){const _0x32b6ea=new Set(),_0x459994=new Set(),_0x515926=this['options']['aiEditing']['getEditorsVersions'](),_0x33ab40=this['options']['aiEditing']['getEditorsSelections'](),_0x2281a2=this['chatContext']['getCurrentDocumentContext']()['documents']||[],_0x156602=new Map(_0x2281a2['map'](({channelId:_0x2c4dfb,version:_0x33a66a})=>[_0x2c4dfb,_0x33a66a])),_0xb08920=new Map(_0x2281a2['map'](({channelId:_0x31d3d0,selectionSignature:_0x5c6818})=>[_0x31d3d0,_0x5c6818]));for(const [_0x50e338,_0x4ce9ac]of _0x515926){const _0x3dd8ad=_0x33ab40['get'](_0x50e338);_0x156602['get'](_0x50e338)!=_0x4ce9ac||_0xb08920['get'](_0x50e338)!=_0x3dd8ad?_0x32b6ea['add'](_0x50e338):_0x156602['has'](_0x50e338)&&_0x459994['add'](_0x50e338);}return{'changedIds':_0x32b6ea,'unchangedIds':_0x459994};}toggleAddCurrentDocumentOptionVisibility(_0x43d48c){this['chatContext']['toggleAddCurrentDocumentOptionVisibility'](_0x43d48c);}_getOutdatedReasonsByDocumentId(_0x36e6b5,_0x48c622){const _0x352121=new Map();if(!_0x36e6b5||!_0x36e6b5['documents'])return _0x352121;for(const _0x4cc471 of _0x36e6b5['documents']){const _0x29330d=this['_channelsToEditors']['get'](_0x4cc471['channelId']);_0x29330d&&'destroyed'!==_0x29330d['state']?_0x4cc471['sessionId']!==this['_getSessionId'](_0x29330d)?_0x352121['set'](_0x4cc471['id'],'session-changed'):_0x48c622['has'](_0x4cc471['id'])&&_0x352121['set'](_0x4cc471['id'],'content-removed'):_0x352121['set'](_0x4cc471['id'],'editor-removed');}return _0x352121;}addSelectionToContext(_0x3e9206){this['chatContext']['addSelectionToContext'](_0x3e9206);}removeSelectionFromContext(){this['chatContext']['removeSelectionFromContext']();}addFilesToContext(_0x2e1196){this['chatContext']['addFilesToContext'](_0x2e1196);}addUrlToContext(_0x2e1dcd){this['chatContext']['addUrlToContext'](_0x2e1dcd);}addToolItemToContext(_0x45a3a7){this['chatContext']['addToolItemToContext'](_0x45a3a7);}addLibraryContextToContext(_0x31dcd4,_0x291d39){this['chatContext']['addLibraryContextToContext'](_0x31dcd4,_0x291d39);}addResourceToContext(_0xdaa774,_0x22626b){this['chatContext']['addResourceToContext'](_0xdaa774,_0x22626b);}['loadSourceResources'](_0x338b3c,_0x5af2c4,_0x2b74b0){return this['chatContext']['loadSourceResources'](_0x338b3c,_0x5af2c4,_0x2b74b0);}removeFromContext(_0x57a089){this['chatContext']['removeFromContext'](_0x57a089);}setWebSearch(_0x396da1){this['chatCapabilities']['setWebSearch'](_0x396da1);}toggleWebSearch(){this['chatCapabilities']['toggleWebSearch']();}setReasoning(_0x22f34c){this['chatCapabilities']['setReasoning'](_0x22f34c);}toggleReasoning(){this['chatCapabilities']['toggleReasoning']();}isCurrentDocumentInContext(){return this['chatContext']['isCurrentDocumentInContext']();}isCurrentDocumentInConversation(){return this['chatContext']['isCurrentDocumentInConversation']();}isSelectionInContext(){return this['chatContext']['isSelectionInContext']();}getPendingContextItems(){return this['chatContext']['getPendingContextItems']();}addDefaultContext(_0x1c0a4a){_0x1c0a4a['length']&&this['chatContext']['addDefaultContext'](_0x1c0a4a);}async setModel(_0x139d7b){_0x139d7b?!0x1===await this['chatModels']['isAvailable'](_0x139d7b)&&(Ft('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x139d7b}),_0x139d7b=(await this['chatModels']['getAvailableModels']())[0x0]):(Ft('ai-chat-conversation-set-model-null',{'conversation':this}),_0x139d7b=(await this['chatModels']['getAvailableModels']())[0x0]),_0x139d7b['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x139d7b,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x139d7b}));}};function Gr({documentSuggestions:_0x4ff5a4,transform:_0xe3639b,documentChanges:_0x54d880,documentChangesOptions:_0x18540e}){const _0x1094be=new Map();for(const [_0x2893a5,{groups:_0x244595,documentContext:_0x2e7774,documentContent:_0x1ea14a,editor:_0x2723f2}]of _0x4ff5a4){const _0x27413d=_0x2e7774['content'],_0x354056=_0x2e7774['version'],_0x8f2a29=_0x1ea14a['cloneNode'](!0x0);for(const {changes:_0x42de97}of _0x244595)Cn(_0x8f2a29,_0x42de97);const _0x44eed4=sn(_0x8f2a29),_0x5f24ab=Rn(_0x2723f2,_0x2e7774['rootName'],_0x27413d,_0x44eed4);if(!_0x5f24ab)continue;const _0x24ea8c=_0x54d880['getDiff'](_0x5f24ab['before'],_0x5f24ab['after'],{'targetEditor':_0x2723f2,'anchor':_0x2e7774['rootName'],..._0x18540e});if(_0xe3639b){const _0x28b314=_0x2723f2['model']['document']['history']['getOperations'](_0x354056),_0x4aa9d8={'document':_0x2723f2['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};_0x1094be['set'](_0x2893a5,_0x3e782f(_0x24ea8c,_0x28b314,_0x4aa9d8)['operationsA']);}else _0x1094be['set'](_0x2893a5,_0x24ea8c);}return _0x1094be;}function Wr({groups:_0x5c108a,documentContextContent:_0x4e46f9,documents:_0x527f6a}){const _0x5c6d9f=new Map();for(const _0x298e1d of _0x5c108a){const {documentId:_0x4287cc}=_0x298e1d,_0x3912d1=_0x5c6d9f['get'](_0x4287cc);if(_0x3912d1)_0x3912d1['groups']['push'](_0x298e1d),_0x3912d1['indexes']['push'](_0x298e1d['index']);else{const _0x4f42ad=_0x527f6a['find'](_0x3f1a18=>_0x3f1a18['id']===_0x4287cc),_0x375750=_0x4e46f9['get'](_0x4287cc);if(!_0x4f42ad||!_0x375750)continue;_0x5c6d9f['set'](_0x4287cc,{'groups':[_0x298e1d],'documentContext':_0x4f42ad,'documentContent':_0x375750,'editor':_0x298e1d['editor'],'indexes':[_0x298e1d['index']]});}}return _0x5c6d9f;}function Fr(_0x30a472,_0xf69273){const _0x41b915=_0x30a472['files']['length']>0x0&&_0x30a472['files']['every'](_0x34db69=>_0x34db69['type']['startsWith']('image/')),_0x5954ef=_0x30a472['plainText']['trim']()['length']>0x0;if(_0x30a472['files']['length']>0x0&&_0xf69273['filesEnabled']&&(!_0x41b915||!_0x5954ef)){const _0xa5ad1e=_0x30a472['files']['filter'](_0x1d187e=>_0x1d187e['name']);return _0xa5ad1e['length']>0x0?{'type':'file','files':_0xa5ad1e}:null;}if(_0xf69273['urlsEnabled']){const _0x4077e8=function(_0x56c80e){const _0x464a02=_0x56c80e['trim']();if(/\s/['test'](_0x464a02))return null;try{const _0x304aa7=new URL(_0x464a02);return'http:'!==_0x304aa7['protocol']&&'https:'!==_0x304aa7['protocol']?null:_0x304aa7['toString']();}catch{return null;}}(_0x30a472['plainText']);if(_0x4077e8)return{'type':'url','url':_0x4077e8};}const _0x1af9e3=_0x30a472['forceTextAttachment']?0x1:_0xf69273['longTextThreshold']??0x1/0x0;if(_0x30a472['plainText']['length']>=Math['max'](_0x1af9e3,0x1)&&_0xf69273['filesEnabled']){const _0x43c183=_0xf69273['pastedTextLabel']+'.txt';return{'type':'text','files':[new File([_0x30a472['plainText']],_0x43c183,{'type':'text/plain'})]};}return null;}var Kr=class extends _0x4cd5fc{activeConversation;_aiEditing;_aiConnector;_aiChatUi;['_aiModels'];_aiContextLibrary;_contextLibrarySource=null;_hasAIChatBalloon=!0x1;_activeBalloon;_reporter;_batchToChanges=new Map();_currentPreviewedChangeGroup=null;_channelsToEditors=new Map();static get requires(){return[$s,dr,Un,Js];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['set']('isConversationReady',!0x1),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichat'),this['_aiModels']=this['context']['plugins']['get'](Js)['models'],this['_aiContextLibrary']=this['context']['plugins']['get'](Js)['contextLibrary'];const _0x2f4ec1=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x497d5d,_0x341d82)=>{this['sendMessage']({'message':_0x341d82});}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',()=>{this['activeConversation']?.['stopProcessing']();}),this['listenTo'](_0x2f4ec1['view'],'change:activeTab',(_0x2e5406,_0x530920,_0x4ad8a6)=>{'chat'!==_0x4ad8a6&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x2c6a1d,_0x199f05)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x199f05));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3586a0,_0x3286b8)=>{this['activeConversation']?.['addUrlToContext'](_0x3286b8);}),this['listenTo'](this['_aiChatUi'],'promptInputPaste',(_0x59cb6c,_0x11bb74)=>{const _0x2a4df9=this['activeConversation'];if(!_0x2a4df9)return;_0x11bb74['hasDirectory']&&(_0x11bb74['preventDefault'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FOLDER_NOT_SUPPORTED'),'id':'folder-error-'+Xt()}));const _0x5b483f=Fr(_0x11bb74,{'pastedTextLabel':qs(this['context']['locale'],'AI_CHAT_CONTEXT_PASTED_TEXT_NAME'),'longTextThreshold':this['context']['config']['get']('ai.chat.context.paste.textThreshold'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled'),'urlsEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.urls.enabled')});_0x5b483f&&(_0x11bb74['preventDefault'](),'url'===_0x5b483f['type']?_0x2a4df9['addUrlToContext'](_0x5b483f['url']):_0x2a4df9['chatContext']['addFilesToContext'](_0x5b483f['files'],void 0x0,_0x5b483f['type']));}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x48830b,_0x350161)=>{_0x350161['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5f4521,_0x54471a)=>{this['activeConversation']?.['addResourceToContext'](_0x54471a['source'],_0x54471a['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1ddfe6,_0x27ce6a)=>{this['_removeFromContext'](_0x27ce6a);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x508150,_0x3f6075)=>{this['activeConversation']?.['loadSourceResources'](_0x3f6075['sourceId'],_0x3f6075['query'],_0x3f6075['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x47d1fc,_0x32360f)=>{this['activeConversation']?.['setModel'](_0x32360f);}),this['listenTo'](this['_aiChatUi'],'like',(_0x41ea81,{replyId:_0x3f0401})=>{console['log']('Liked\x20response',_0x3f0401);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x11fbcb,{replyId:_0x11d63f})=>{console['log']('Disliked\x20response',_0x11d63f);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xcf5af5,_0xb79fcf)=>{this['_insertSuggestion'](_0xb79fcf);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5d924c,{replyId:_0x5f2cd7,partIndex:_0x29fd14})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x5f2cd7,_0x29fd14);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x8ede09,{replyId:_0x3cac29,partIndex:_0x34a189})=>{const _0x1e9b15=this['_getDocumentRangeForReplyChanges'](_0x3cac29,_0x34a189);if(!_0x1e9b15)return;const {reply:_0x103cc6}=this['getInteractionAndReplyById'](_0x3cac29);'$graveyard'!=_0x1e9b15['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'editor':_0x103cc6['changeGroups'][_0x34a189]['editor'],'ranges':[_0x1e9b15['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x3cd0d0,_0x42b063)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x42b063);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x16b326,{replyId:_0x561153,showDiff:_0x385b5e})=>{const {interaction:_0x53a7c2,reply:_0x28f85d}=this['getInteractionAndReplyById'](_0x561153),_0x5f2cd5=_0x28f85d['getContentParts']({'showDiff':_0x385b5e});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x53a7c2['id']+':'+_0x28f85d['id'],'parts':_0x5f2cd5});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4892fc,{replyId:_0x2b8735,partIndex:_0x4bcc71})=>{this['_rejectSuggestion']({'replyId':_0x2b8735,'partIndex':_0x4bcc71}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['on']('interactionCreated',(_0x55e368,_0x17452c)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x17452c);}),this['on']('replyCreated',(_0x2fa090,_0x397805)=>{this['_addFeedItemReply'](_0x397805);});}afterInit(){this['context']instanceof _0x553634?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x90de87,_0xaef8de)=>{_0xaef8de['on']('ready',()=>{this['_integrateEditor'](_0xaef8de);});}),this['context']['config']['get']('ai.chat.context')?.['contextLibrary']?.['enabled']&&this['_setUpContextLibrarySource'](),this['_initConversation']();}async _initConversation(){const _0x475e3d=this['context']['config']['get']('ai.chat.initialConversation');let _0x2c2691=_0x475e3d;try{if('lastCreated'==_0x475e3d&&(_0x2c2691=await this['_getLastCreatedConversationId'](),!_0x2c2691))return;'new'==_0x2c2691?await this['_startConversationSafely']():(this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['loadConversation'](_0x2c2691)),await this['_aiChatUi']['idleUiPromise'];}finally{this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'init');}}async destroy(){return this['_stopLastInteraction'](),super['destroy']();}async loadConversation(_0x481163){this['_closeActiveBalloon'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0,'conversation'),this['_detachFromActiveConversation'](),this['_stopLastInteraction'](),this['_aiChatUi']['toggleConversationLoading'](!0x0);try{this['_aiChatUi']['emptyConversationTitle'](),await this['_aiConnector']['fetchConversation'](_0x481163)['getConversation'](),await this['_startConversationSafely']({'id':_0x481163}),await this['activeConversation']['load'](_0x481163),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext'](),this['set']('isConversationReady',!0x0),this['activeConversation']?.['currentInteraction']?this['_aiChatUi']['enableControls']():this['_aiChatUi']['toggleConversationLoading'](!0x1);}catch(_0x443ffb){this['_aiChatUi']['resetConversationTitle'](),this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x481163}),this['_reporter']['logError'](new dt('ai-chat-conversation-not-found',this,void 0x0,_0x443ffb),{'context':{'operation':'load-conversation'}}),await this['_stopLastInteraction'](),this['_aiChatUi']['disableControls'](),this['set']('isConversationReady',!0x1),this['_aiChatUi']['resetChatBusyStateToIdle'](),this['activeConversation']?.['cancelLastInteractionStream']();}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1,'conversation');}}registerToolDataCallback(_0x5be84a){let _0x2b41f6=null,_0x3a97b1=null;this['on']('toolDataReceived',(_0xa9735,_0xc7d0ff,_0x275dbf)=>{_0x275dbf['id']!==_0x2b41f6&&(_0x2b41f6=_0x275dbf['id'],_0x3a97b1=this['_getAIChatFeedAPI'](_0x275dbf)),_0x5be84a(_0xc7d0ff,_0x3a97b1);});}addCurrentDocumentToChatContext(){Zs(this['context'])['length']&&this['activeConversation']?.['addCurrentDocumentToContext'](qs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async addSelectionToChatContext(_0x1c0b84){const _0x3f0ce2=this['_aiEditing']['getSelectionText'](_0x1c0b84);this['activeConversation']?.['addSelectionToContext'](_0x3f0ce2),this['addCurrentDocumentToChatContext']();}removeSelectionFromChatContext(){this['activeConversation']?.['removeSelectionFromContext']();}addLibraryContextToChatContext(_0x2fb926,_0x58a202){this['activeConversation']?.['addLibraryContextToContext'](_0x2fb926,_0x58a202);}focusPromptInput(){this['_aiChatUi']['focusPromptInput']();}async startConversation(_0x776332){await this['_startConversationSafely']({'modelId':_0x776332?.['modelId'],'contexts':_0x776332?.['contexts']});}async['sendMessage']({message:_0x427d62,attributes:_0xf5f946}){if(!this['activeConversation'])throw new dt('ai-chat-controller-no-active-conversation');this['activeConversation']['id']&&this['activeConversation']['isStarted']&&(this['_aiChatUi']['startInteraction'](),await this['activeConversation']['handleUserInteraction']({'userMessage':_0x427d62,'attributes':_0xf5f946}));}getGroupId(){const _0xd6d97d=this['context']['config']['get']('collaboration.channelId');if(!_0xd6d97d)throw new dt('ai-missing-channel-id',this);return _0xd6d97d;}_handleRemovedConversation(_0x1b09d2){this['activeConversation']['id']===_0x1b09d2&&this['_startConversationSafely']();}['_isGroupReadOnly'](_0x90f1ad){return!(!_0x90f1ad['editor']||'destroyed'===_0x90f1ad['editor']['state']||!_0x90f1ad['editor']['isReadOnly']);}_isGroupWriteable(_0x330a27){return!(!_0x330a27['editor']||'destroyed'===_0x330a27['editor']['state']||_0x330a27['editor']['isReadOnly']);}_computeSuggestionGating(_0x52d671){const _0xf8751c=new Map();for(const _0xe44db4 of _0x52d671['changeGroups'])_0xf8751c['set'](_0xe44db4['index'],this['_isGroupReadOnly'](_0xe44db4));const _0x2affdb=new Set(_0x52d671['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']})['filter'](_0xf96a1a=>_0xf96a1a['hasChanges'])['map'](_0xb610f6=>_0xb610f6['index']));return{'readOnlyByIndex':_0xf8751c,'isAcceptAllEnabled':_0x52d671['changeGroups']['some'](_0x2ef10b=>'pending'===_0x2ef10b['state']&&this['_isGroupWriteable'](_0x2ef10b)&&_0x2affdb['has'](_0x2ef10b['index']))};}_refreshSuggestionGating(){if(this['activeConversation']){for(const _0x1d0fb3 of this['activeConversation']['interactions'])for(const _0x227efd of _0x1d0fb3['replies'])'modification'===_0x227efd['type']&&this['_aiChatUi']['hasFeedItem'](_0x227efd['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x227efd['id'],this['_computeSuggestionGating'](_0x227efd));}if(this['_activeBalloon']&&this['_currentPreviewedChangeGroup']){const {reply:_0x4cb0c3}=this['getInteractionAndReplyById'](this['_currentPreviewedChangeGroup']['replyId']),_0x40866b=_0x4cb0c3['changeGroups']['find'](_0x4a87bb=>_0x4a87bb['index']===this['_currentPreviewedChangeGroup']['partIndex']);_0x40866b&&this['_activeBalloon']['setTargetReadOnly'](this['_isGroupReadOnly'](_0x40866b));}}_prepareDocumentSuggestions(_0x4346d0){const {reply:_0x3b7ada,interaction:_0x36b2d7}=this['getInteractionAndReplyById'](_0x4346d0['replyId']),_0x3591e0=void 0x0!==_0x4346d0['partIndex']?[_0x3b7ada['changeGroups'][_0x4346d0['partIndex']]]:_0x3b7ada['changeGroups']['filter'](_0x5f2c5d=>'pending'===_0x5f2c5d['state']&&!this['_isGroupReadOnly'](_0x5f2c5d)),_0x1ea87a=_0x3591e0['map'](_0x14aec9=>_0x3b7ada['changeGroups']['indexOf'](_0x14aec9)),_0x575d7c=fn(_0x3b7ada['changeGroups'],_0x3b7ada['documentContextContent']);return _0x1ea87a['forEach'](_0x4f83bf=>{if(_0x575d7c['has'](_0x4f83bf))return;const _0x36675c=this['_getDocumentRangeForReplyChanges'](_0x4346d0['replyId'],_0x4f83bf);_0x36675c&&'$graveyard'!=_0x36675c['range']['root']['rootName']?(_0x3b7ada['setChangeGroupState'](_0x4f83bf,'accepted'),void 0x0!==_0x4346d0['partIndex']&&this['_scrollToSuggestionRange'](_0x36675c['range'],!0x1,_0x36675c['targetEditor'])):_0x3b7ada['setChangeGroupState'](_0x4f83bf,'outdated',this['_getOutdatedReason'](_0x3b7ada['changeGroups'][_0x4f83bf]));}),Wr({'groups':_0x3591e0['filter'](_0x261ff6=>'accepted'===_0x261ff6['state']),'documentContextContent':_0x3b7ada['documentContextContent'],'documents':_0x36b2d7['getDocumentContext']()?.['documents']??[]});}_insertSuggestion(_0x23cc87){const _0x172e97=this['context']['plugins']['get'](Un),{reply:_0x588c00,interaction:_0x1e9103}=this['getInteractionAndReplyById'](_0x23cc87['replyId']),_0xa6819f=this['_prepareDocumentSuggestions'](_0x23cc87),_0x5bfa92=Gr({'documentSuggestions':_0xa6819f,'transform':!0x0,'documentChanges':_0x172e97,'documentChangesOptions':{'markDeletions':!0x0}});for(const [_0x367ea4,_0x4a1b4b]of _0x5bfa92){const {editor:_0x490d9c,indexes:_0x2f8c30}=_0xa6819f['get'](_0x367ea4);if(!_0x490d9c['plugins']['has']('TrackChanges')){Ft('ai-no-track-changes',{'editor':_0x490d9c});continue;}let _0x24448e;jn(_0x4a1b4b,'chat'),_0x490d9c['model']['change'](_0x353bf6=>{_0x24448e=_0x353bf6['batch'],_0x490d9c['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4a1b4b),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x24448e,{'interactionId':_0x1e9103['id'],'replyId':_0x588c00['id'],'indexes':_0x2f8c30});}this['_updateRatings'](_0x588c00);}_applySuggestion(_0x504b9a){const _0x40b189=this['context']['plugins']['get'](Un),{reply:_0xbb7b20,interaction:_0x9bb854}=this['getInteractionAndReplyById'](_0x504b9a['replyId']),_0x44c986=this['_prepareDocumentSuggestions'](_0x504b9a),_0x5ca22a=Gr({'documentSuggestions':_0x44c986,'transform':!0x0,'documentChanges':_0x40b189,'documentChangesOptions':{'markDeletions':!0x1}});for(const [_0x59d9d0,_0x447fc7]of _0x5ca22a){const {editor:_0x4292d2,indexes:_0x1f76d0}=_0x44c986['get'](_0x59d9d0);let _0x57da6a;jn(_0x447fc7,'chat');try{_0x4292d2['model']['change'](_0x44b175=>{_0x57da6a=_0x44b175['batch'],_0x40b189['applyOperations'](_0x44b175,_0x447fc7);}),this['_batchToChanges']['set'](_0x57da6a,{'interactionId':_0x9bb854['id'],'replyId':_0xbb7b20['id'],'indexes':_0x1f76d0});}catch(_0x33d194){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x33d194})),_0x33d194;}}this['_updateRatings'](_0xbb7b20);}_rejectSuggestion(_0x75f651){const {reply:_0x3dd71a}=this['getInteractionAndReplyById'](_0x75f651['replyId']);_0x3dd71a['setChangeGroupState'](_0x75f651['partIndex'],'rejected');}['_openBalloonFor'](_0x5b94d0,_0x1c30cc){if(!this['_hasAIChatBalloon'])return;const {reply:_0x553deb}=this['getInteractionAndReplyById'](_0x5b94d0),_0x104c49=_0x553deb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(!_0x104c49['length'])return;let _0x332e2f,_0x4c70f0;if(void 0x0!==_0x1c30cc?(_0x4c70f0=_0x104c49['find'](_0x13c52d=>_0x13c52d['index']==_0x1c30cc),_0x332e2f=_0x4c70f0?.['index']):(_0x4c70f0=_0x104c49[0x0],_0x332e2f=_0x4c70f0['index']),!_0x4c70f0)return void _0x553deb['setChangeGroupState'](_0x1c30cc??0x0,'outdated','editor-removed');if(this['_currentPreviewedChangeGroup']?.['replyId']==_0x5b94d0&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x332e2f)return;const _0x555ffd=this['_getUserPresentableContentPartDocumentRange'](_0x5b94d0,_0x553deb,_0x4c70f0),_0x8b77aa=_0x553deb['changeGroups']['find'](_0x1e9754=>_0x1e9754['index']==_0x332e2f),_0x7a75c3=_0x8b77aa['editor'],_0x17d820=_0x7a75c3['plugins']['get']('AIChatBalloon');if(this['_activeBalloon']&&this['_activeBalloon']!==_0x17d820&&this['_activeBalloon']['close'](),!_0x555ffd)return _0x17d820['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x17d820,this['_currentPreviewedChangeGroup']={'replyId':_0x5b94d0,'partIndex':_0x332e2f},this['_scrollToSuggestionRange'](_0x555ffd,!0x0,_0x7a75c3);const _0xd7bf2e=this['_getPresentableSiblingContentPartIndex'](_0x5b94d0,_0x332e2f,'next');_0x17d820['clearContent'](),_0x17d820['updateContent']({'part':_0x4c70f0,'renderingStrategy':'static'});const _0x12c691=_0x104c49['filter'](_0x417f89=>_0x417f89['hasChanges']),_0x60899a=this['_aiChatUi']['getFeedItemAIReplySuggestionPartUIIndex']({'id':_0x5b94d0,'index':_0x332e2f})??_0x12c691['findIndex'](_0xab56e9=>_0xab56e9['index']==_0x332e2f)+0x1;_0x17d820['open']({'index':_0x332e2f,'title':qs(this['context']['locale'],'AI_CHAT_BALLOON_HEADER_TITLE',[_0x60899a['toString'](),_0x12c691['length']['toString']()]),'showRotator':null!==_0xd7bf2e,'ranges':[_0x555ffd],'areActionsDisabled':_0x553deb['areActionsDisabled'],'targetEditor':_0x7a75c3,'isTargetReadOnly':this['_isGroupReadOnly'](_0x8b77aa)}),_0x17d820['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5b94d0,_0x332e2f),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5b94d0,'index':_0x332e2f,'isActive':!0x0});}_closeActiveBalloon(){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;}_getPresentableSiblingContentPartIndex(_0x30d274,_0x83436,_0x46ca78){const {reply:_0x825a52}=this['getInteractionAndReplyById'](_0x30d274),_0x5f4028=_0x825a52['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x5f4028['length'])return null;const _0x3d5c75='next'==_0x46ca78?0x1:-0x1;function _0x20fd67(_0x575c65){const _0x19a107=(_0x575c65+_0x3d5c75+_0x5f4028['length'])%_0x5f4028['length'];return{'siblingIndex':_0x19a107,'siblingPart':_0x5f4028[_0x19a107]};}const _0x346109=_0x5f4028['findIndex'](_0x2cfaf5=>_0x2cfaf5['index']==_0x83436);let {siblingIndex:_0x424f4f,siblingPart:_0x28c7e8}=_0x20fd67(_0x346109);for(;!this['_getUserPresentableContentPartDocumentRange'](_0x30d274,_0x825a52,_0x28c7e8);)if({siblingIndex:_0x424f4f,siblingPart:_0x28c7e8}=_0x20fd67(_0x424f4f),_0x424f4f===_0x346109)return null;return _0x28c7e8['index'];}_getOutdatedReason(_0x2aaa7a){return _0x2aaa7a?.['editor']&&'destroyed'!==_0x2aaa7a['editor']['state']?'content-removed':'editor-removed';}_getUserPresentableContentPartDocumentRange(_0xddbd86,_0x486342,_0x572ec6){const _0x1d8f37=_0x486342['changeGroups'];if(!_0x572ec6['hasChanges'])return null;const _0x23843f=_0x1d8f37['find'](_0x23473f=>_0x23473f['index']==_0x572ec6['index']);if('pending'!==_0x23843f?.['state'])return null;if(!_0x23843f?.['editor']||'destroyed'===_0x23843f['editor']['state'])return _0x486342['setChangeGroupState'](_0x572ec6['index'],'outdated',this['_getOutdatedReason'](_0x23843f)),null;const _0x112da2=this['_getDocumentRangeForReplyChanges'](_0xddbd86,_0x572ec6['index']);if(!_0x112da2)return _0x486342['setChangeGroupState'](_0x572ec6['index'],'outdated',this['_getOutdatedReason'](_0x23843f)),null;const {range:_0x38fdda,currentIndex:_0x223b4a}=_0x112da2;return'$graveyard'==_0x38fdda['root']['rootName']?(_0x486342['setChangeGroupState'](_0x223b4a,'outdated',this['_getOutdatedReason'](_0x23843f)),null):_0x112da2['range'];}_getDocumentRangeForReplyChanges(_0x324590,_0x4d3ff3){const {reply:_0x5ce10a,interaction:_0x14523f}=this['getInteractionAndReplyById'](_0x324590),_0x372347=_0x5ce10a['changeGroups']['filter'](_0x877b41=>'pending'==_0x877b41['state']),_0x123fd4=_0x372347['map'](_0x268168=>_0x5ce10a['changeGroups']['indexOf'](_0x268168));void 0x0===_0x4d3ff3&&(_0x4d3ff3=_0x123fd4[0x0]);const _0x51ae76=_0x123fd4['indexOf'](_0x4d3ff3);if(-0x1==_0x51ae76)return null;const _0xe8404d=_0x372347[_0x51ae76],_0x13f0c1=_0xe8404d['editor'];if(!_0x13f0c1||'destroyed'===_0x13f0c1['state'])return null;const _0x5ca98a=En(_0x13f0c1,_0xe8404d['rootName']),_0x52be22=_0x5ce10a['documentContextContent']['get'](_0xe8404d['documentId']),_0x570047=new _0x47233a([]),_0x4a2a0f=new _0x47233a([]);for(const _0x256dc5 of _0xe8404d['changes'])if('removed'!=_0x256dc5['type']&&_0x4a2a0f['children']['push'](_0x256dc5['node']['cloneNode'](!0x0)),'new'!=_0x256dc5['type']){const _0x4991fb=_0x1b0303(_0x3146f8=>ln(_0x3146f8,'data-id')==_0x256dc5['id'],_0x52be22,!0x0);_0x570047['children']['push'](_0x4991fb['cloneNode'](!0x0));}if(0x0==_0x570047['children']['length']){if(_0xe8404d['changes'][0x0]['anchorId']){const _0x36ddb3=nn('data-id',_0xe8404d['changes'][0x0]['anchorId'],_0x52be22);_0x570047['children']['unshift'](_0x36ddb3['cloneNode'](!0x0)),_0x4a2a0f['children']['unshift'](_0x36ddb3['cloneNode'](!0x0)),_0x36ddb3['nextSibling']&&(_0x570047['children']['push'](_0x36ddb3['nextSibling']['cloneNode'](!0x0)),_0x4a2a0f['children']['push'](_0x36ddb3['nextSibling']['cloneNode'](!0x0)));}else{const _0x276e56=_0x52be22['children'][0x0];if(!_0x276e56)return null;_0x570047['children']['push'](_0x276e56['cloneNode'](!0x0)),_0x4a2a0f['children']['push'](_0x276e56['cloneNode'](!0x0));}}if(_0x5ca98a&&fn(_0x5ce10a['changeGroups'],_0x5ce10a['documentContextContent'])['has'](_0xe8404d['index']))return null;const _0x3f217d=_0x14523f['getDocumentContext'](),_0x23c1f4=_0x3f217d['documents']['find'](_0x3bccb5=>_0x3bccb5['id']==_0xe8404d['documentId'])['content'],_0x5edcb0=_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x1b39bf=_0x13f0c1['data']['parse'](_0x23c1f4,_0x5edcb0),_0x1aa6db=_0x5ca98a?Tn(sn(_0x570047)):sn(_0x570047),_0x195486=_0x13f0c1['data']['parse'](_0x1aa6db,_0x5edcb0),_0x316a43=_0x13f0c1['data']['parse'](_0x1aa6db,_0x5edcb0),_0x4fd8c1=_0x13f0c1['model']['createPositionAt'](_0x195486,0x0),_0x53be40=_0x5ca98a?Tn(sn(_0x4a2a0f)):sn(_0x4a2a0f),_0x675fff={'targetEditor':_0x13f0c1,'anchor':_0x4fd8c1,'markDeletions':!0x1};let _0x30e956;try{_0x30e956=_0x13f0c1['plugins']['get'](Un)['getDiff'](_0x1aa6db,_0x53be40,_0x675fff);}catch(_0xee5d1b){return this['_reporter']['reportError'](new ur({'code':'ai-chat-suggestion-diff-failed','type':'runtime','severity':'warning','cause':_0xee5d1b,'context':{'replyId':_0x324590,'partIndex':_0x4d3ff3}})),null;}if(!_0x30e956['length'])return null;_0x13f0c1['model']['change'](_0x11a08e=>{for(const _0x32fa95 of _0x30e956)if(!_0x3463ba(_0x32fa95)){if('remove'==_0x32fa95['type']){const _0x468ff8=_0x32fa95['sourcePosition'],_0x33eb2a=_0x32fa95['howMany'],_0x4508be=new _0x500e5d(_0x468ff8,_0x33eb2a);_0x11a08e['batch']['addOperation'](_0x4508be),_0x13f0c1['model']['applyOperation'](_0x4508be);}else'marker'!==_0x32fa95['type']&&(_0x32fa95['baseVersion']=null,_0x32fa95['isDocumentOperation']=!0x1,_0x11a08e['batch']['addOperation'](_0x32fa95),_0x13f0c1['model']['applyOperation'](_0x32fa95));}});const _0x8536cd=fr(_0x13f0c1,_0x30e956,_0x195486);br(_0x13f0c1['model'],_0x8536cd);const _0x35d328=_0x8536cd['getFirstRange']()['start']['path']['slice'](),_0x568428=_0x8536cd['getFirstRange']()['end']['path']['slice'](),_0x561748=[];let _0xcc735c=_0x195486,_0x3d8de8=_0x316a43;for(let _0x55f50b=0x0;_0x55f50b<_0x568428['length'];_0x55f50b++){const _0x194621=_0xcc735c['maxOffset']-_0x568428[_0x55f50b];_0x561748[_0x55f50b]=_0x3d8de8['maxOffset']-_0x194621,_0xcc735c=_0xcc735c['getChildAtOffset'](_0x568428[_0x55f50b]),_0x3d8de8=_0x3d8de8['getChildAtOffset'](_0x561748[_0x55f50b]);}const _0x28e997=_0x13f0c1['model']['createRange'](_0x13f0c1['model']['createPositionFromPath'](_0x316a43,_0x35d328),_0x13f0c1['model']['createPositionFromPath'](_0x316a43,_0x561748)),_0x4e74b2=_0x28e997['start']['path']['slice'](),_0x5a0e35=_0x28e997['end']['path']['slice']();if(!_0x5ca98a){const _0x49d096=_0x316a43['getChild'](0x0)['getAttribute'](Vn),_0x31851b=Array['from'](_0x1b39bf['getChildren']())['find'](_0x3b27e3=>_0x3b27e3['getAttribute'](Vn)==_0x49d096)['getPath']();_0x4e74b2[0x0]=_0x31851b[0x0]+_0x4e74b2[0x0],_0x5a0e35[0x0]=_0x31851b[0x0]+_0x5a0e35[0x0];}let _0x151222=_0x13f0c1['model']['createRange'](_0x13f0c1['model']['createPositionFromPath'](_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x4e74b2),_0x13f0c1['model']['createPositionFromPath'](_0x13f0c1['model']['document']['getRoot'](_0xe8404d['rootName']),_0x5a0e35));const _0x89d12d=_0x3f217d['documents']['find'](_0x6f549b=>_0x6f549b['id']==_0xe8404d['documentId'])['version'],_0x30ba10=_0x13f0c1['model']['document']['history']['getOperations'](_0x89d12d);for(const _0x5970dd of _0x30ba10)_0x151222=_0x3aaa22['_createFromRanges'](_0x151222['getTransformedByOperation'](_0x5970dd));return{'range':_0x151222,'currentIndex':_0x4d3ff3,'targetEditor':_0x13f0c1};}_integrateEditorBalloon(_0x573174){if(!_0x573174['plugins']['has']('AIChatBalloon'))return;const _0x370888=_0x573174['plugins']['get']('AIChatBalloon');this['_hasAIChatBalloon']=!0x0,_0x370888['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x370888,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x3996f7,partIndex:_0x801912}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x5ec2da}=this['getInteractionAndReplyById'](_0x3996f7),_0x34e821=_0x5ec2da['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x801912});_0x370888['updateContent']({'part':_0x34e821[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x370888,'applySuggestion',()=>{const {replyId:_0x50e501,partIndex:_0x195444}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x50e501,'partIndex':_0x195444}),_0x370888['setState']('accepted');}),this['listenTo'](_0x370888,'insertSuggestion',()=>{const {replyId:_0x1de355,partIndex:_0x168a55}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x1de355,'partIndex':_0x168a55}),_0x370888['setState']('accepted');}),this['listenTo'](_0x370888,'rejectSuggestion',()=>{const {replyId:_0x563014,partIndex:_0xde6166}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x563014,'partIndex':_0xde6166}),_0x370888['setState']('rejected');}),this['listenTo'](_0x370888,'showNext',()=>{const {replyId:_0x18a357,partIndex:_0x43c049}=this['_currentPreviewedChangeGroup'],_0x21af33=this['_getPresentableSiblingContentPartIndex'](_0x18a357,_0x43c049,'next');null!==_0x21af33&&this['_openBalloonFor'](_0x18a357,_0x21af33);}),this['listenTo'](_0x370888,'showPrevious',()=>{const {replyId:_0x10f4d4,partIndex:_0x3d3da4}=this['_currentPreviewedChangeGroup'],_0x5ad631=this['_getPresentableSiblingContentPartIndex'](_0x10f4d4,_0x3d3da4,'previous');null!==_0x5ad631&&this['_openBalloonFor'](_0x10f4d4,_0x5ad631);}),this['listenTo'](_0x370888,'dialogClosed',(_0x2c52c4,{id:_0x4f75da})=>{if('aiChatBalloon'!==_0x4f75da)return;const {replyId:_0x1e3e34,partIndex:_0x434914}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1e3e34,'index':_0x434914,'isActive':!0x1}),this['_activeBalloon']===_0x370888&&(this['_activeBalloon']=void 0x0);});}_integrateEditor(_0x22dac9){if(this['_channelsToEditors']['set'](_0x22dac9['config']['get']('collaboration.channelId'),_0x22dac9),this['_integrateEditorBalloon'](_0x22dac9),this['addCurrentDocumentToChatContext'](),this['listenTo'](_0x22dac9,'change:isReadOnly',()=>this['_refreshSuggestionGating']()),_0x22dac9['once']('destroy',()=>{this['_checkRemoveCurrentDocumentFromChatContext']();}),_0x22dac9['plugins']['has']('Undo')){const _0x4a2600=_0x22dac9['commands']['get']('undo'),_0x581541=_0x22dac9['commands']['get']('redo');this['listenTo'](_0x4a2600,'revert',(_0x561948,_0x544beb,_0x4dff82)=>{const _0x2d738d=this['_batchToChanges']['get'](_0x544beb);if(!_0x2d738d)return;const _0x5a8d6c=this['activeConversation']['getInteraction'](_0x2d738d['interactionId']),_0x56952=_0x5a8d6c?.['getReply'](_0x2d738d['replyId']);this['_batchToChanges']['delete'](_0x544beb),_0x5a8d6c&&_0x56952&&(_0x2d738d['indexes']['forEach'](_0x3ea494=>_0x56952['setChangeGroupState'](_0x3ea494,'pending')),this['_batchToChanges']['set'](_0x4dff82,_0x2d738d));}),this['listenTo'](_0x581541,'revert',(_0x22a926,_0xcbef59,_0x52a675)=>{const _0x542e37=this['_batchToChanges']['get'](_0xcbef59);if(!_0x542e37)return;const _0x1c61c2=this['activeConversation']['getInteraction'](_0x542e37['interactionId']),_0x33f3f0=_0x1c61c2?.['getReply'](_0x542e37['replyId']);this['_batchToChanges']['delete'](_0xcbef59),_0x1c61c2&&_0x33f3f0&&(_0x542e37['indexes']['forEach'](_0x1c47bf=>_0x33f3f0['setChangeGroupState'](_0x1c47bf,'accepted')),this['_batchToChanges']['set'](_0x52a675,_0x542e37));});}const _0x1dbb6d=_0x22dac9['config']['get']('ai.chat.context');_0x1dbb6d['alwaysAddSelection']&&_0x1dbb6d['document']['enabled']&&this['listenTo'](_0x22dac9['model']['document']['selection'],'change:range',(_0x278725,_0x5b7040)=>{_0x5b7040['directChange']&&'chat'===_0x22dac9['plugins']['get']('AITabs')['view']['activeTab']&&(_0x22dac9['model']['hasContent'](_0x22dac9['model']['document']['selection'])?this['addSelectionToChatContext'](_0x22dac9):this['removeSelectionFromChatContext']());});}async _getLastCreatedConversationId(){const _0x596016=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x2ed4af=await _0x596016['getConversations']();return _0x2ed4af['length']?_0x2ed4af[0x0]['id']:'new';}catch(_0x3ae1c1){return this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':Xt()}),this['_reporter']['logError'](new dt('ai-chat-conversation-init-failed',this,{'error':_0x3ae1c1})),this['_aiChatUi']['disableControls'](),null;}}async _startConversationSafely(_0x4e896c={}){this['set']('isConversationReady',!0x1);try{await this['_handleStartConversation'](_0x4e896c),_0x4e896c['id']||this['set']('isConversationReady',!0x0);}catch(_0x58ce24){this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4e896c['id']||Xt()}),this['_reporter']['logError'](_0x58ce24),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}_detachFromActiveConversation(){this['_aiChatUi']['setIsUploadInProgress'](!0x1),this['activeConversation']&&this['stopListening'](this['activeConversation']);}async _handleStartConversation({id:_0x415ce8,modelId:_0x4fa82c,contexts:_0x4121bd}={}){this['_detachFromActiveConversation'](),this['_closeActiveBalloon']();let _0x15018a=_0x4fa82c;_0x15018a||(_0x415ce8||!this['activeConversation']?_0x15018a=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x15018a=this['activeConversation']['selectedModel']?.['id'])),this['_stopLastInteraction']();const _0x1d0ece=this['getGroupId'](),_0x594d0=_0x415ce8||Xt(),_0x43a5fe=await this['_aiModels']['getAvailableModels']();let _0x532f25;this['activeConversation']=new Br({'connector':this['_aiConnector'],'chatModels':this['_aiModels'],'selectedModelId':_0x15018a,'conversationId':_0x594d0,'group':_0x1d0ece,'locale':this['context']['locale'],'isFromHistory':!!_0x415ce8,'channelsToEditors':this['_channelsToEditors'],'contextLibrary':this['_aiContextLibrary'],'extraContexts':_0x4121bd,'getSessionId':_0xacd35b=>this['_aiEditing']['getSessionId'](_0xacd35b),'aiEditing':this['_aiEditing']}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['listenTo'](this['activeConversation'],'conversationInitialized',()=>{this['_aiChatUi']['createConversation']({'availableModels':_0x43a5fe}),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x415ce8||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['listenTo'](this['activeConversation'],'uploadProgressChanged',(_0x34a450,_0x3762d9)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x3762d9['isUploadInProgress']);}),this['listenTo'](this['activeConversation'],'webSearchStarted',()=>{const _0x3c99e3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3c99e3);}),this['listenTo'](this['activeConversation'],'reasoningStarted',()=>{const _0x1167b1=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1167b1);}),this['listenTo'](this['activeConversation'],'webSearchFinished',(_0x584e36,_0x3d6e13)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3d6e13,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['listenTo'](this['activeConversation'],'reasoningFinished',(_0x471979,_0x1be495)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1be495,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['listenTo'](this['activeConversation'],'interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['listenTo'](this['activeConversation'],'interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['listenTo'](this['activeConversation'],'interactionDestroyed',(_0x51d65b,_0x42048c)=>{this['_aiChatUi']['removeFeedInteraction'](_0x42048c['id']);}),this['listenTo'](this['activeConversation'],'setConversationTitle',(_0x17bbe9,_0x4eb1ec,_0x31a323)=>{this['_updateConversationTitle'](_0x4eb1ec,_0x31a323);}),this['listenTo'](this['activeConversation'],'replyContentUpdated',async(_0x1bfa2d,_0x30d44b)=>{void 0x0!==_0x532f25&&_0x532f25!==_0x30d44b['id']&&this['_updateReplyContentThrottled']['flush'](),_0x532f25=_0x30d44b['id'],_0x30d44b['isFromHistory']?await this['_updateReplyContent']({'reply':_0x30d44b}):await this['_updateReplyContentThrottled']({'reply':_0x30d44b});}),this['listenTo'](this['activeConversation'],'replyChangeGroupStateUpdated',(_0x23a99e,{reply:_0x120dd8,index:_0xd76c5e,state:_0x37778c,outdatedReason:_0x509e40})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x120dd8['id'],'index':_0xd76c5e,'state':_0x37778c,'outdatedReason':_0x509e40}),this['_aiChatUi']['hasFeedItem'](_0x120dd8['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x120dd8['id'],this['_computeSuggestionGating'](_0x120dd8)),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x120dd8['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xd76c5e&&this['_activeBalloon']?.['setState'](_0x37778c,_0x509e40);}),this['listenTo'](this['activeConversation'],'contextItemAdded',(_0x2a25de,_0x54e87e)=>{if(this['_aiChatUi']['addContextItem'](_0x54e87e['contextItem'],_0x54e87e['isLoading']),'selection'===_0x54e87e['contextItem']['type']){const _0x2f8d5c=tn(this['context']),_0x1d2bb4=[..._0x2f8d5c['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'editor':_0x2f8d5c,'ranges':_0x1d2bb4,'id':'context','priority':0x1});}}),this['listenTo'](this['activeConversation'],'contextItemRemoved',(_0xdb64b0,_0xb9e5fc)=>{this['_aiChatUi']['removeContextItem'](_0xb9e5fc['uiId']),'current-document'==_0xb9e5fc['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xb9e5fc['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['listenTo'](this['activeConversation'],'contextItemLoadingEnded',(_0x29f837,_0x5ca854)=>{this['_aiChatUi']['setContextItemLoading'](_0x5ca854['contextItem']['uiId'],_0x5ca854['isLoading']);}),this['listenTo'](this['activeConversation'],'contextSent',(_0x3468ba,_0x13d5d3)=>{this['_aiChatUi']['setConversationContext'](_0x13d5d3['contextItems']);}),this['listenTo'](this['activeConversation'],'addContextOptionsChanged',(_0x18862f,_0x1b5f6f)=>{this['_aiChatUi']['setAddContextOptions'](_0x1b5f6f['options']);}),this['listenTo'](this['activeConversation'],'sourceResourcesLoaded',(_0x42dae4,_0x1ef16e)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1ef16e['sourceId'],_0x1ef16e['source'],_0x1ef16e['resources'],_0x1ef16e['uid']);}),this['listenTo'](this['activeConversation'],'resourceStateChanged',(_0x5e7192,_0x402a96)=>{this['_aiChatUi']['updateResourceState'](_0x402a96['sourceId'],_0x402a96['resourceId'],_0x402a96['isInContext']);}),this['listenTo'](this['activeConversation'],'capabilitiesUpdated',(_0x58c3aa,_0x4324a3)=>{this['_aiChatUi']['updateCapabilities'](_0x4324a3);}),this['listenTo'](this['activeConversation'],'modelSelected',(_0x5639c5,_0x4b9860)=>{this['_aiChatUi']['setSelectedModel'](_0x4b9860['selectedModel']??null,_0x4b9860['isDisabled']);}),this['listenTo'](this['activeConversation'],'error',async(_0x59b6d0,{error:_0x38bffb,interactionId:_0x4fc84c,fileName:_0x14b2d6,url:_0x273de3,sourceId:_0x667119,sourceLabel:_0xd8b57b})=>{let _0x1a2659;const _0x3aea4c=_0x4fc84c?_0x4fc84c+':'+Xt():Xt();this['_reporter']['reportError'](_0x38bffb),this['_aiChatUi']['startAutoScroll'](),_0x38bffb['message']['startsWith']('ai-request-aborted')?(this['_cancelProcessing'](),this['activeConversation']?.['cancelLastInteractionStream'](),_0x1a2659=this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':qs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3aea4c})):_0x38bffb['message']['startsWith']('ai-chat-conversation-init-failed')||_0x38bffb['message']['startsWith']('ai-chat-conversation-start-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-file-upload-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x14b2d6),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-url-upload-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x273de3),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-invalid-data')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-unsupported-type')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x667119&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x667119),_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xd8b57b||'source'),'id':_0x3aea4c})):_0x38bffb['message']['startsWith']('ai-chat-resource-load-failed')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-invalid-request')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-unsupported-file-type')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-file-too-large')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-file-too-many-pages')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x3aea4c}):_0x38bffb['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x3aea4c}):(this['_cancelProcessing'](),_0x1a2659=this['_aiChatUi']['addFeedItemError']({'errorMessage':qs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3aea4c}));try{await Promise['race']([_0x1a2659,this['_aiChatUi']['idleUiPromise']]);}finally{this['_aiChatUi']['isBusy']||this['_aiChatUi']['stopAutoScroll']();}}),await this['activeConversation']['init'](this['_buildConversationContextConfig']()),_0x415ce8||(await this['activeConversation']['start'](),this['_aiChatUi']['enableControls']());}_buildConversationContextConfig(){const _0x57f6d3=this['context']['config']['get']('ai.chat.context');return this['_contextLibrarySource']?{..._0x57f6d3,'sources':[..._0x57f6d3?.['sources']??[],this['_contextLibrarySource']]}:_0x57f6d3;}async _setUpContextLibrarySource(){const _0x2e9b2e=await this['_createContextLibrarySource']();_0x2e9b2e&&(this['_contextLibrarySource']=_0x2e9b2e,this['activeConversation']&&this['activeConversation']['chatContext']['addContextSource'](_0x2e9b2e));}async _createContextLibrarySource(){let _0x250f34;try{_0x250f34=await this['_aiContextLibrary']['getAvailableContexts']();}catch{return null;}if(!_0x250f34['length'])return null;const _0x13e15f=_0x250f34['map'](_0x4e68ab=>({'id':_0x4e68ab['id'],'type':'context','label':_0x4e68ab['name']||_0x4e68ab['id']}));return{'id':'ck-ai-context-library','label':qs(this['context']['locale'],'AI_CHAT_CONTEXT_LIBRARY_LABEL'),'useDefaultFiltering':!0x0,'getResources':()=>Promise['resolve'](_0x13e15f)};}_removeFromContext(_0x4219d2){this['activeConversation']?.['removeFromContext'](_0x4219d2);}_toggleWebSearch(){this['activeConversation']?.['toggleWebSearch']();}_toggleReasoning(){this['activeConversation']?.['toggleReasoning']();}getInteractionAndReplyById(_0x488e4f){const [_0x4961f4,_0x30f51b]=_0x488e4f['split'](':'),_0x111847=this['activeConversation']['getInteraction'](_0x4961f4);return{'interaction':_0x111847,'reply':_0x111847['getReply'](_0x30f51b)};}_scrollToSuggestionRange(_0x52ad65,_0x3e8d7b=!0x1,_0x56e63f){const _0xad5ec4={'target':_0x56e63f['editing']['view']['domConverter']['viewRangeToDom'](_0x56e63f['editing']['mapper']['toViewRange'](_0x52ad65)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3e8d7b};_0x3e8d7b&&(_0xad5ec4['alignToTop']=!0x0),Yt(_0xad5ec4);}_updateConversationTitle(_0xc80b4d,_0x5e5999=!0x1){this['_aiChatUi']['setConversationTitle'](_0xc80b4d||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5e5999);}_addFeedItemReply(_0x3d1d67){'text'===_0x3d1d67['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3d1d67):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3d1d67);}async _updateReplyContent({reply:_0x5e1e1c,renderingStrategy:_0x37a0c8}){const {id:_0x32f42f,interactionId:_0x4a16ee,isDone:_0x1ecaa5,type:_0x3da76f,parsedContent:_0x4139dd}=_0x5e1e1c,_0x46ad3e=_0x4a16ee+':'+_0x32f42f;if('modification'===_0x3da76f){const _0x4a7a92=_0x5e1e1c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x46ad3e,'parts':_0x4a7a92,'isDone':_0x1ecaa5,'skipLoadingEffects':_0x5e1e1c['isFromHistory']}),this['_aiChatUi']['hasFeedItem'](_0x5e1e1c['id'])&&this['_aiChatUi']['setSuggestionGating'](_0x5e1e1c['id'],this['_computeSuggestionGating'](_0x5e1e1c));}else'text'===_0x3da76f&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x46ad3e,'parsedContent':_0x4139dd['get']('text'),'renderingStrategy':_0x37a0c8,'isDone':_0x1ecaa5});_0x1ecaa5&&_0x5e1e1c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x46ad3e,_0x5e1e1c['sources']);}_updateReplyContentThrottled=_0x467982(this['_updateReplyContent']['bind'](this),0xc8);_stopLastInteraction(){this['activeConversation']?.['stopProcessing'](),this['_aiChatUi']['stopInteraction'](this['activeConversation']?.['lastInteraction']),this['_updateReplyContentThrottled']['cancel']();}async _flushLastInteractionUI(){const _0x25ed1f=this['activeConversation']?.['lastInteraction'];if(_0x25ed1f){for await(const _0x15b7aa of _0x25ed1f['replies'])this['_aiChatUi']['hasFeedItem'](_0x15b7aa['id'])||this['_addFeedItemReply'](_0x15b7aa),await this['_updateReplyContent']({'reply':_0x15b7aa,'renderingStrategy':'static'});}}async['_cancelProcessing'](){this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}_updateRatings(_0x2ec2e3){const _0x4680bf={'positiveCount':_0x2ec2e3['changeGroups']['filter'](_0x5930ea=>'accepted'===_0x5930ea['state'])['length'],'totalCount':_0x2ec2e3['changeGroups']['length'],'modificationId':_0x2ec2e3['id']},_0x387dfb=this['activeConversation']['getInteraction'](_0x2ec2e3['interactionId'])['messageId'];_0x387dfb&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x387dfb,_0x4680bf);}_getAIChatFeedAPI(_0x28c6a5){const _0x256815=this['_aiChatUi'],_0x9fd897=()=>{_0x28c6a5['resetWebSearchState'](),_0x28c6a5['resetReasoningState'](),_0x256815['clearLoadingMessage']();},_0xd6fb79=()=>{_0x28c6a5['currentReply']&&(_0x28c6a5['currentReply']['done'](),_0x28c6a5['currentReply']=void 0x0);};return{'insertTextReply':(_0x16313c,_0x115f67)=>{_0xd6fb79(),_0x9fd897();const _0x14f95a=_0x28c6a5['currentReply']=_0x28c6a5['createReply']({'type':'text','interactionId':_0x28c6a5['id'],'id':_0x115f67||Xt(),'channelsToEditors':this['_channelsToEditors']});return _0x14f95a['appendContent'](_0x16313c),_0xd6fb79(),_0x14f95a;},'insertCustomElement':async(_0x28d027,_0x39771d)=>(_0xd6fb79(),_0x9fd897(),_0x256815['addFeedItemCustomElement'](_0x28d027,_0x39771d||Xt())),'setLoadingMessage':_0x39cc78=>{_0x256815['setLoadingMessage'](_0x39cc78);},'clearLoadingMessage':()=>{_0x256815['clearLoadingMessage']();}};}_checkRemoveCurrentDocumentFromChatContext(){Zs(this['context'])['find'](_0x3e8f3a=>'destroyed'!==_0x3e8f3a['state'])||(this['activeConversation']?.['removeFromContext']('current-document'),this['activeConversation']?.['toggleAddCurrentDocumentOptionVisibility'](!0x1));}};const $r=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Yr=[...$r,'startConversation','sendUserMessage','promptInputPaste','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function qr(_0x10aa1e){const _0x4cdeb6=new AbortController();return{'promise':new Promise((_0x507593,_0x44c001)=>{const _0x39e402=setTimeout(_0x507593,_0x10aa1e);_0x4cdeb6['signal']['addEventListener']('abort',()=>{clearTimeout(_0x39e402),_0x44c001();});}),'abortController':_0x4cdeb6};}var Qr=class{options;isStreaming=!0x1;document=null;nodesList=[];currentIndex=0x0;timeoutAbortController=null;lastUpdateTime=0x0;constructor(_0x57a653){this['options']={'delay':_0x57a653?.['delay']??0xa,'textNodeStyle':_0x57a653?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async stream({document:_0x53629a,targetElement:_0x5667ef,abortSignal:_0x2570e4}){this['isStreaming']&&this['stop'](),_0x2570e4?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x950ff(_0x53629a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3f03b9=0x0;_0x3f03b9<this['currentIndex'];_0x3f03b9++)this['nodesList'][_0x3f03b9]['shouldBeStreamed']=!0x0;do{const _0xa9da70=Date['now'](),_0x266111=this['nodesList'][this['currentIndex']],_0x100b75=_0xa9da70-this['lastUpdateTime'];if(_0x266111){_0x266111['shouldBeStreamed']=!0x0;let _0x4d5863=_0x266111['parent'];for(;_0x4d5863;)_0x4d5863['shouldBeStreamed']=!0x0,_0x4d5863=_0x4d5863['parent'];}if(_0x100b75<this['options']['delay'])try{const {promise:_0x25cf80,abortController:_0x3acbaa}=qr(this['options']['delay']-_0x100b75);this['timeoutAbortController']=_0x3acbaa,await _0x25cf80;}catch(_0x45401f){return;}const _0x103253=_0x5667ef['ownerDocument']['createElement'](_0x5667ef['tagName']);_0x103253['innerHTML']=Qt(this['renderNode'](this['document'])),_0x163546(_0x5667ef,_0x103253,{'childrenOnly':!0x0}),this['currentIndex']++,this['lastUpdateTime']=Date['now']();}while(this['currentIndex']<this['nodesList']['length']);this['currentIndex']=this['nodesList']['length'],this['isStreaming']=!0x1;}reset(){this['isStreaming']=!0x1,this['document']=null,this['nodesList']=[],this['currentIndex']=0x0,this['timeoutAbortController']=null;}cleanUpAnimations({targetElement:_0x4bb86a}){Array['from'](_0x4bb86a['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x110bf8=>{_0x110bf8['replaceWith'](_0x110bf8['childNodes'][0x0]);});}stop(){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x55b535){let _0x500c21='';if(function(_0x2eb7d2){return _0x2388bd(_0x2eb7d2);}(_0x55b535)){for(const _0x31c537 of _0x55b535['children'])_0x500c21+=this['renderNode'](_0x31c537);}else{if(jr(_0x55b535)){if(!_0x55b535['shouldBeStreamed'])return'';const _0x2a1a34=_0x55b535,_0x4a52a5=Object['entries'](_0x2a1a34['attribs'])['map'](([_0x569fda,_0x173c7b])=>_0x569fda+'=\x22'+_0x173c7b+'\x22')['join']('\x20');_0x500c21+='<'+_0x2a1a34['tagName']+(_0x4a52a5?'\x20'+_0x4a52a5:'')+'>';for(const _0x4f905f of _0x4fdaaa(_0x2a1a34))_0x500c21+=this['renderNode'](_0x4f905f);_0x500c21+='</'+_0x2a1a34['tagName']+'>';}else{if(!zr(_0x55b535))return'';if(!_0x55b535['shouldBeStreamed'])return'';!function(_0x4ab457){return!(!_0x4ab457['parent']||!jr(_0x4ab457['parent']))&&(!!Xr['includes'](_0x4ab457['parent']['tagName'])&&!_0x42359b(_0x4ab457)['match'](/^\s*[<>]\s*$/));}(_0x55b535)?_0x500c21+=_0x24a162(_0x55b535):_0x500c21+=_0x24a162(new _0x3cf04b('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x55b535]));}}return _0x500c21;}getParsedDocumentNodeList(){const _0x1fd9da=[];return function(_0x178a57,_0x57e4c9){const _0x4ce72f=_0x5193c8=>{if(_0x57e4c9(_0x5193c8),_0x5193c8 instanceof _0x2ba83d)for(let _0x514d7c=0x0;_0x514d7c<_0x5193c8['children']['length'];_0x514d7c++){const _0x183523=_0x5193c8['children'][_0x514d7c];_0x4ce72f(_0x183523);}};for(let _0x536239=0x0;_0x536239<_0x178a57['children']['length'];_0x536239++)_0x4ce72f(_0x178a57['children'][_0x536239]);}(this['document'],_0xfafc8e=>{if(zr(_0xfafc8e)){const _0x203389=this['splitTextNodeIntoWordNodes'](_0xfafc8e);_0x203389['length']&&_0x1fd9da['push'](..._0x203389);}_0xfafc8e['isWordSplitSource']||_0xfafc8e['isWordSplitResult']||_0x1fd9da['push'](_0xfafc8e);}),_0x1fd9da;}splitTextNodeIntoWordNodes(_0x5cfbde){if(_0x5cfbde['isWordSplitSource']||_0x5cfbde['isWordSplitResult'])return[];const _0xcc3b82=_0x42359b(_0x5cfbde)['match'](/(?:\s*\S+\s*)/g),_0x4d77b7=[];if(_0xcc3b82&&_0xcc3b82['length']>0x1){for(const _0x49849e of _0xcc3b82){const _0x332fde=new _0x3978f9(_0x49849e);_0x332fde['isWordSplitResult']=!0x0,_0x1e83fe(_0x5cfbde,_0x332fde),_0x4d77b7['push'](_0x332fde);}_0x5cfbde['isWordSplitSource']=!0x0,_0x15340f(_0x5cfbde);}return _0x4d77b7;}};const Xr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function zr(_0x2b65c4){return _0x4f3ed2(_0x2b65c4);}function jr(_0x5e9c51){return _0x58049c(_0x5e9c51);}function Jr(_0x1cbf27,_0x48ee93){_0x1cbf27['cleanUpAnimations']({'targetElement':_0x48ee93}),_0x48ee93['querySelectorAll']('[data-id]')['forEach'](_0x86f2b1=>{_0x86f2b1['removeAttribute']('data-id');});}var Zr=class extends _0x2df458{options;content='';htmlStreamer;['children'];constructor(_0x59ecb6){super();const _0x1c75a2=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Qr(),this['options']=_0x59ecb6,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x1c75a2['if']('isDone','ck-ai-chat__feed__item_done'),_0x1c75a2['if']('isVisible','ck-hidden',_0x29f0e0=>!_0x29f0e0),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){Jr(this['htmlStreamer'],this['element']),this['isDone']=!0x0;}async streamIntoElement(_0x20209e,_0xf25ac6,_0x20ce64){await this['htmlStreamer']['stream']({'document':_0x20209e,'targetElement':_0xf25ac6,'abortSignal':_0x20ce64});}},to=class extends _0x2df458{['showChangesToggleView'];constructor(_0x2f4384,_0x5c9cfe){super(_0x2f4384),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new _0x1a9216(_0x2f4384),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-button_small\x20'+Ir,'label':qs(_0x2f4384,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5c9cfe['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x59ec9f=>_0x59ec9f?nt:st),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x554ce3=new _0x5e3c18();_0x554ce3['content']=_0x5e85dd,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5c9cfe['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x554ce3,{'tag':'span','children':[qs(_0x2f4384,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}};const eo={'title':'AI_SUGGESTION_CONTENT_PART_TITLE','apply':'AI_SUGGESTION_CONTENT_PART_APPLY','suggest':'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION','reject':'AI_SUGGESTION_CONTENT_PART_REJECT','stateAccepted':'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED','stateRejected':'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED','stateOutdated':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED'},io={'accepted':_0x42448e,'rejected':_0x29be46,'outdated':tt};var so=class extends _0x2df458{statePillView;constructor(_0xf53388,_0x4735e9=eo){super(_0xf53388);const _0xb2615c=this['bindTemplate'];this['set']('state','accepted'),this['set']('outdatedReason',void 0x0),this['set']('isVisible',!0x0),this['statePillView']=new _0x286f6b(_0xf53388),this['statePillView']['bind']('label')['to'](this,'state',_0x49489a=>function(_0x3010a9,_0x4df6ea,_0x8f3741){const _0x5141f5={'accepted':_0x8f3741['stateAccepted'],'rejected':_0x8f3741['stateRejected'],'outdated':_0x8f3741['stateOutdated']};return qs(_0x3010a9,_0x5141f5[_0x4df6ea]);}(_0xf53388,_0x49489a,_0x4735e9)),this['statePillView']['bind']('icon')['to'](this,'state',_0x5c0f7a=>io[_0x5c0f7a]),this['statePillView']['bind']('class')['to'](this,'state',_0x47bac6=>'ck-pill_'+_0x47bac6),this['statePillView']['bind']('tooltip')['to'](this,'state',this,'outdatedReason',(_0x33b75d,_0x37b728)=>function(_0xe62b6a,_0x395e80,_0x169309){if('outdated'!==_0x395e80)return;return qs(_0xe62b6a,_0x169309?no[_0x169309]:'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_TOOLTIP');}(_0xf53388,_0x33b75d,_0x37b728)),this['statePillView']['size']='small',this['statePillView']['tooltipPosition']='s',this['statePillView']['tooltipClass']='ck-tooltip_multi-line',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0xb2615c['if']('isVisible','ck-hidden',_0x44f9bb=>!_0x44f9bb)]},'children':[this['statePillView']]});}setState(_0x38d3a4,_0x5c0265){this['state']=_0x38d3a4,this['outdatedReason']='outdated'===_0x38d3a4?_0x5c0265:void 0x0;}};const no={'content-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_CONTENT_REMOVED_TOOLTIP','editor-removed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_EDITOR_REMOVED_TOOLTIP','session-changed':'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED_SESSION_CHANGED_TOOLTIP'};var ro=class extends _0x20288e{_applyButton;_suggestButton;constructor(_0x55dce0,_0x20ea46,_0x430479,_0xf4c5ae=eo){super(_0x55dce0);const _0x7fff7b=Boolean(_0x430479);this['set']('isEnabled',!_0x7fff7b),this['set']('isVisible',!0x0),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0xa8e136=[];if(!_0x7fff7b){_0x20ea46['includes']('applySuggestion')&&(this['_applyButton']=new _0x1a9216(_0x55dce0),this['_applyButton']['set']({'label':qs(_0x55dce0,_0xf4c5ae['apply']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4e0bfc,'class':pr}),this['_applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0xa9f5d5,_0x11b80d)=>_0xa9f5d5&&!_0x11b80d),this['_applyButton']['bind']('isVisible')['to'](this,'isTrackChangesOn',this,'isApplyVisible',(_0x26000a,_0x402ddc)=>!_0x26000a&&_0x402ddc),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0xa8e136['push'](this['_applyButton'])),_0x20ea46['includes']('insertSuggestion')&&(this['_suggestButton']=new _0x1a9216(_0x55dce0),this['_suggestButton']['set']({'label':qs(_0x55dce0,_0xf4c5ae['suggest']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x32dbd8,'class':pr}),this['_suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x37c17e,_0x705e84)=>_0x37c17e&&!_0x705e84),this['_suggestButton']['bind']('isVisible')['to'](this,'isSuggestVisible'),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0xa8e136['push'](this['_suggestButton']));const _0x1c4dda=new _0x1a9216(_0x55dce0);_0x1c4dda['set']({'label':qs(_0x55dce0,_0xf4c5ae['reject']),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x28a335,'class':pr}),_0x1c4dda['bind']('isEnabled')['to'](this),_0x1c4dda['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0xa8e136['push'](_0x1c4dda);}this['items']['addMany'](_0xa8e136);const _0x28a7af=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x28a7af['if']('isVisible','ck-hidden',_0x3194cc=>!_0x3194cc)]}});}setButtonsVisibility({showApplyButton:_0x18b2cc,showSuggestButton:_0x3279c1}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x18b2cc),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3279c1);}},oo=class extends _0x2df458{toolbarView;stateView;titleLabelView;['children'];constructor(_0x241760,{part:_0x1af24c,uiIndex:_0x55c1c0,availableActions:_0x2afc0d,areActionsDisabled:_0x17e58d,translationKeys:_0xfd98df=eo}){super(_0x241760),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0),this['toolbarView']=new ro(_0x241760,_0x2afc0d,_0x17e58d,_0xfd98df),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x1af24c['index']});}),this['toolbarView']['bind']('isEnabled','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['stateView']=new so(_0x241760,_0xfd98df),this['titleLabelView']=new ao(_0x241760,_0x55c1c0,_0xfd98df['title']),this['children']=this['createCollection'](),this['children']['addMany']([this['titleLabelView'],this['toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x1dc9be,_0x432341,_0x420a87,_0x2fa159)=>{'pending'===_0x2fa159?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x420a87?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x420a87,this['outdatedReason']),this['children']['add'](this['stateView']));});}},ao=class extends _0x2df458{constructor(_0x34b050,_0x3c4b8e,_0x1a5451){super(_0x34b050),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[qs(_0x34b050,_0x1a5451,_0x3c4b8e['toString']())]});}},ho=class extends _0x2df458{htmlStreamer;constructor(_0x4661d6){super(_0x4661d6),this['htmlStreamer']=new Qr(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async update({part:_0x2f2c03,renderingStrategy:_0x3bb686,abortSignal:_0x3a68bb}){this['_ensureHostElementTag'](_0x2f2c03['wrapperTag']||'div');const _0x4322ef=_0x950ff(_0x2f2c03['content'],!0x0);for(const _0x4ea388 of on(_0x4322ef))_0x15340f(_0x4ea388);if('streaming'===_0x3bb686)await this['htmlStreamer']['stream']({'document':_0x4322ef,'targetElement':this['element'],'abortSignal':_0x3a68bb});else{const _0x3a0c87=this['element']['ownerDocument']['createElement'](this['element']['tagName']);_0x3a0c87['innerHTML']=Qt(sn(_0x4322ef)),_0x163546(this['element'],_0x3a0c87,{'childrenOnly':!0x0});}}['clear'](){this['htmlStreamer']['reset'](),this['element']&&(this['element']['replaceChildren'](),this['element']['scrollTop']=0x0);}cleanUpStreamingArtifacts(){Jr(this['htmlStreamer'],this['element']);}_ensureHostElementTag(_0x3bcd81){if(!this['element']||this['element']['tagName']['toLowerCase']()===_0x3bcd81)return;const _0x4102f1=new _0x4e263f({'tag':_0x3bcd81,'attributes':{'class':this['element']['className']}})['render']();this['element']['replaceWith'](_0x4102f1),this['element']=_0x4102f1;}},co=class extends _0x2df458{['uiIndex'];['_children'];['_headerView'];_streamableContentView;constructor(_0x1b4575,{part:_0x3925d5,uiIndex:_0x47b086,areActionsDisabled:_0x1cd71b,availableActions:_0x2ff154,translationKeys:_0x3e448b=eo}){super(_0x1b4575);const _0x5689db=this['bindTemplate'];this['uiIndex']=_0x47b086,this['set']('state',_0x3925d5['state']),this['set']('outdatedReason',_0x3925d5['outdatedReason']),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['set']('isApplyVisible',!0x0),this['set']('isSuggestVisible',!0x0);const _0x3690e4=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1cd71b;};this['on']('change:state',_0x3690e4),this['on']('change:isDone',_0x3690e4),_0x3690e4(),this['_children']=this['createCollection'](),this['_headerView']=new oo(_0x1b4575,{'part':_0x3925d5,'uiIndex':_0x47b086,'availableActions':_0x2ff154,'areActionsDisabled':_0x1cd71b,'translationKeys':_0x3e448b}),this['_headerView']['bind']('isEnabled','outdatedReason','state','isTrackChangesOn','isTargetReadOnly','isApplyVisible','isSuggestVisible')['to'](this),this['_headerView']['delegate'](...$r)['to'](this),this['_streamableContentView']=new ho(_0x1b4575),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5689db['to']('state',_0x2b3360=>'ck-ai-suggestion__body__content-part_'+_0x2b3360),_0x5689db['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5689db['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5689db['if']('isVisible','ck-hidden',_0x5b71b8=>!_0x5b71b8)]},'children':this['_children'],'on':{'mouseenter':_0x5689db['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3925d5['index']});}),'mouseleave':_0x5689db['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3925d5['index']});}),'click':_0x5689db['to'](_0x1fc648=>{const _0x15e20a=_0x1fc648['target'];_0x15e20a&&'A'===_0x15e20a['tagName']&&_0x1fc648['preventDefault'](),this['isEnabled']&&!Rt(this['_headerView']['toolbarView']['element'],_0x15e20a)&&this['fire']('showChangeInText',{'index':_0x3925d5['index']});})}});}async updateContent({part:_0x5a6e83,showUnchangedParts:_0xa5385d=!0x1,abortSignal:_0x42da89}){this['partDefinition']=_0x5a6e83,this['isVisible']=this['partDefinition']['hasChanges']||_0xa5385d,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x5a6e83,'renderingStrategy':'static','abortSignal':_0x42da89});}['markAsDone'](){this['isDone']=!0x0;}},lo=class extends _0x2df458{constructor(_0x379fa2,_0x245683){super(_0x379fa2),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x2024e9=>!_0x2024e9)]},'children':this['_createSkeletonItems'](_0x245683)});}_createSkeletonItems(_0x5f5843){const _0x76f5d4=['ck','ck-ai-skeleton__item'];return _0x5f5843['map'](_0x2bfaff=>{if('children'in _0x2bfaff)return{'tag':_0x2bfaff['tag'],'attributes':{'class':['ck','ck-ai-skeleton__row']},'children':this['_createSkeletonItems'](_0x2bfaff['children'])};let _0x2a45dd='';switch(_0x2bfaff['attributes']['align']){case'right':_0x2a45dd='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2a45dd='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2a45dd='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x2bfaff['tag'],'attributes':{'class':[..._0x76f5d4,_0x2bfaff['attributes']['class']?_0x2bfaff['attributes']['class']:''],'style':'width:\x20'+_0x2bfaff['attributes']['width']+';\x20height:\x20'+_0x2bfaff['attributes']['height']+';'+_0x2a45dd}};});}};const uo={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'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'}}],'aiChatInit':[{'tag':'div','attributes':{'width':'70%','height':'36px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'36px','align':'left'}}],'aiChatControls':[{'tag':'div','attributes':{'width':'100%','height':'30px','align':'left'}},{'tag':'div','attributes':{'width':'150px','height':'20px','align':'left'}}],'aiHistory':_o(0x5,'100%','44px','right'),'aiChatResources':_o(0x8,'100%','24px','right'),'aiReviewChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}}]),'aiTranslateChecks':go(0x10,[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'83%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'98%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'72%','height':'24px','align':'left'}}]),'aiActionsBalloon':[{'tag':'div','attributes':{'width':'76%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'20px','align':'left'}},{'tag':'div','attributes':{'width':'87%','height':'20px','align':'left'}}],'aiReviewInitCheck':go(0x6,[{'tag':'div','attributes':{'width':'30%','height':'18px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'18px','align':'left'}}])};function _o(_0xda5edb,_0x380504,_0x5c13ff,_0x20636d){return new Array(_0xda5edb)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x380504,'height':_0x5c13ff,'align':_0x20636d}}));}function go(_0x394720,_0x529beb){return new Array(_0x394720)['fill'](null)['map'](()=>({'tag':'div','children':_0x529beb}));}const Io=/* #__PURE__ -- @preserve */
|
|
33
|
+
It();var Ao=class extends Io{['queue']=[];['isProcessing']=!0x1;_abortController;async['enqueue'](_0x12eb5){const _0x154d57=this['createTask'](_0x12eb5);return this['queue']['push'](_0x154d57),this['_processQueue'](),_0x154d57['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(_0xedd69e=>{this['once']('_queueEmpty',()=>{_0xedd69e();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x229d0e=this['queue']['shift']();try{await _0x229d0e['callback'](this['_abortController']['signal']),_0x229d0e['resolve']();}catch(_0x1637e6){_0x229d0e['reject'](_0x1637e6);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}createTask(_0x44fac2){let _0x7ec861,_0x583681;const _0x12be15=new Promise((_0x3e367b,_0x5e7536)=>{_0x7ec861=_0x3e367b,_0x583681=_0x5e7536;});return{'callback':_0x44fac2,'resolve':_0x7ec861,'reject':_0x583681,'completePromise':_0x12be15};}},Eo=class extends Zr{constructor(_0x5100c5){super(_0x5100c5),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x5100c5['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}setContent(_0x293331){this['element']['innerHTML']=Qt(_0x293331);}};const po=['applySuggestion','insertSuggestion'];var mo=class extends _0x2df458{_applyChangesButton;_insertSuggestionsButton;['children'];constructor(_0x4175b4,_0x577427=[...po],_0x38fd6e){super(_0x4175b4);const _0x20a2ed=this['bindTemplate'],_0x5e21f9=Boolean(_0x38fd6e);this['set']('isEnabled',!_0x5e21f9),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x5e21f9||(this['_applyChangesButton']=new _0x1a9216(_0x4175b4),this['_applyChangesButton']['set']({'label':qs(_0x4175b4,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x577427['includes']('applySuggestion'),'class':gr}),this['_insertSuggestionsButton']=new _0x1a9216(_0x4175b4),this['_insertSuggestionsButton']['set']({'label':qs(_0x4175b4,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x577427['includes']('insertSuggestion'),'class':Ir}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4c894e=>{_0x4c894e['bind']('isEnabled')['to'](this);}),this['children']['addMany']([this['_applyChangesButton'],this['_insertSuggestionsButton']])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x20a2ed['if']('isVisible','ck-hidden',_0x1d96b3=>!_0x1d96b3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}updateVisibility(_0x541bd6){this['isVisible']=_0x541bd6;}_switchButtonLabelsPlurality(_0x3b3776){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x3b3776?(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=qs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}},To=class extends _0x2df458{['children'];['balloonPanelView'];bodyCollection;constructor(_0x746ed8,_0x4aa3cc){super(_0x746ed8),this['bodyCollection']=_0x4aa3cc,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',_0x24b966=>!_0x24b966)]},'children':this['children']});const _0x34f71e=new _0x2df458(this['locale']),_0x45e373=new _0x5e3c18();_0x45e373['content']=ut,_0x34f71e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x45e373,{'tag':'span','children':[{'text':qs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x34f71e),this['_setupBalloonPanel'](_0x746ed8);}['addSource'](_0x5b3806){this['children']['add'](new wo(this['locale'],_0x5b3806,this['balloonPanelView']));}_setupBalloonPanel(_0x1ac2ba){this['balloonPanelView']=new Jt(_0x1ac2ba),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}},wo=class extends _0x1a9216{['balloonPanelView'];['source'];constructor(_0x18f1ea,_0x24eb64,_0x67998e){super(_0x18f1ea),this['source']=_0x24eb64,this['balloonPanelView']=_0x67998e,this['set']({'label':_0x24eb64['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x57ae7b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x57ae7b['to'](()=>{window['open'](_0x24eb64['url'],'_blank');}),'mouseenter':_0x57ae7b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x57ae7b['to'](()=>{this['_hideTooltip']();})}}),_0x24eb64['favicon']){const _0x35fef6=new _0x2df458(_0x18f1ea);_0x35fef6['setTemplate']({'tag':'img','attributes':{'src':_0x24eb64['favicon']||ut,'alt':_0x24eb64['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x35fef6);}else this['set']('icon',ut);}_createTooltipContentView(_0x43f03d,_0x564ca3){const _0x45b3b9=new _0x2df458(_0x43f03d),_0x20765e=[];let _0x1bc054;_0x564ca3?.['favicon']?(_0x1bc054=new _0x2df458(_0x43f03d),_0x1bc054['setTemplate']({'tag':'img','attributes':{'src':_0x564ca3['favicon'],'alt':_0x564ca3['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x1bc054=new _0x5e3c18(),_0x1bc054['content']=ut,_0x1bc054['extendTemplate']({'attributes':{'alt':_0x564ca3['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x20765e['push'](_0x1bc054);const _0x38353a=new _0x2df458(_0x43f03d);_0x38353a['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x564ca3['url']},'children':[{'text':new URL(_0x564ca3['url'])?.['hostname']}]}),_0x20765e['push'](_0x38353a);const _0x4a2802=new _0x2df458(_0x43f03d);_0x4a2802['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x20765e});const _0xd3b5c7=new _0x2df458(_0x43f03d);return _0xd3b5c7['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x564ca3['title']['length']>0x190?_0x564ca3['title']['substring'](0x0,0x190)+'...':_0x564ca3['title']}]}),_0x45b3b9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4a2802,_0xd3b5c7]}),_0x45b3b9;}_showTooltip(){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouthEast']],'limiter':()=>ah(this['element'])}),this['balloonPanelView']['show']();}_hideTooltip(){this['balloonPanelView']['hide']();}_updateTooltipContent(){this['balloonPanelView']['content']['get'](0x0)?.['destroy'](),this['balloonPanelView']['content']['clear']();const _0x31c434=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x31c434);}},Co=class extends _0x2df458{_actionsView;['_readOnlyByIndex']=new Map();['_sourcesView'];['_children'];_skeletonView;_showSkeletonDebounced=_0x2fd977(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);_skeletonShownAt=null;_areActionsDisabled;_showUnchangedParts;_updateContentPartsPromiseQueue;_emptyPartsWarningView;_availableActions;_cachedContentParts=[];constructor(_0x2fd199,_0x4e9f89){super(_0x2fd199);const {areActionsDisabled:_0x325b78,showUnchangedParts:_0x38cc79,availableActions:_0x59d248}=_0x4e9f89;this['_areActionsDisabled']=_0x325b78,this['_showUnchangedParts']=_0x38cc79,this['_availableActions']=_0x59d248,this['set']('isTrackChangesOn',!0x1),this['set']('isAcceptAllEnabled',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new lo(_0x2fd199,uo['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Ao(),this['_emptyPartsWarningView']=new Eo({'id':'empty-parts-warning','initialContent':qs(_0x2fd199,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new mo(_0x2fd199,_0x4e9f89['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new To(this['locale'],_0x4e9f89['bodyCollection']),_0x4e9f89['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'isAcceptAllEnabled'),this['_actionsView']['delegate'](...$r)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}destroy(){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get partsCount(){return this['_contentPartViews']['length'];}get _contentPartViews(){return Array['from'](this['_children'])['filter'](_0x42c81f=>_0x42c81f instanceof co);}async updateContentParts({parts:_0x597d74,abortSignal:_0x5c0977,skipLoadingEffects:_0x1e9b85}){this['_cachedContentParts']['length']?_0x597d74['forEach'](_0x357cce=>{const _0x4c33d7=this['_cachedContentParts']['findIndex'](_0x73ed3b=>_0x73ed3b['index']==_0x357cce['index']);-0x1===_0x4c33d7?this['_cachedContentParts']['push'](_0x357cce):this['_cachedContentParts'][_0x4c33d7]=_0x357cce;}):this['_cachedContentParts']=_0x597d74;const _0x1ed854=this['_showUnchangedParts']?_0x597d74:_0x597d74['filter'](_0x27fa44=>_0x27fa44['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x1ed854['length']>0x1),_0x1e9b85&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x2c6c0e of _0x597d74)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3e4b78=>{let _0x25e8f3=this['getPartView'](_0x2c6c0e['index']);if(_0x25e8f3||_0x2c6c0e['hasChanges']||this['_showUnchangedParts']){if(!_0x25e8f3){if(_0x25e8f3=new co(this['locale'],{'part':_0x2c6c0e,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x25e8f3['delegate'](...$r)['to'](this),_0x25e8f3['bind']('isTrackChangesOn')['to'](this),!_0x1e9b85&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x3e4b78),_0x3e4b78['aborted']))return;_0x25e8f3['isTargetReadOnly']=this['_readOnlyByIndex']['get'](_0x2c6c0e['index'])??!0x1,this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x25e8f3,this['_children']['length']-0x1),_0x1e9b85||this['_showSkeletonDebounced']();}await _0x25e8f3['updateContent']({'part':_0x2c6c0e,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3e4b78}),_0x25e8f3['markAsDone']();}});return _0x5c0977?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}updatePartState(_0x308968,_0x12a84a,_0x71ba){const _0x286aba=this['getPartView'](_0x308968);_0x286aba&&(_0x286aba['outdatedReason']=_0x71ba,_0x286aba['state']=_0x12a84a);}setGating({readOnlyByIndex:_0x582f68,isAcceptAllEnabled:_0x3ea4a9}){this['_readOnlyByIndex']=_0x582f68,this['isAcceptAllEnabled']=_0x3ea4a9;for(const _0x23ba37 of this['_contentPartViews'])_0x23ba37['isTargetReadOnly']=_0x582f68['get'](_0x23ba37['partDefinition']['index'])??!0x1;}setPartActive(_0x5e71a3,_0x20242){if(!0x1===_0x5e71a3){for(const _0x5d5c89 of this['_contentPartViews'])_0x5d5c89['isActive']=!0x1;}else{const _0x458eba=this['getPartView'](_0x5e71a3);_0x458eba&&(_0x458eba['isActive']=_0x20242);}}updateSources(_0x1f817){_0x1f817['forEach'](_0x485c18=>this['_sourcesView']['addSource'](_0x485c18)),this['_sourcesView']['isVisible']=!0x0;}getPartView(_0x502312){return this['_contentPartViews']['find'](_0x497cd7=>_0x497cd7['partDefinition']['index']==_0x502312)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x256853=!this['_cachedContentParts']['find'](({hasChanges:_0x1ac0bf})=>_0x1ac0bf),_0x2294f9=!!this['_cachedContentParts']['find'](({hasChanges:_0x34643e})=>!_0x34643e);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x2294f9,_0x256853?this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](qs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x2fb461=>_0x2fb461['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']&&!this['_areActionsDisabled']);}async _awaitMinimumSkeletonDisplayTime(_0x1c1842){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x37f8bb=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x37f8bb>0x0){const {promise:_0x56b781,abortController:_0x4893dd}=qr(_0x37f8bb);_0x1c1842?.['addEventListener']('abort',()=>_0x4893dd['abort']()),await _0x56b781['catch'](()=>{});}}get hasNonEmptyParts(){return this['_contentPartViews']['filter'](_0x1938be=>_0x1938be['partDefinition']['hasChanges'])['length']>0x0;}},fo=class extends _0x2df458{['bodyView'];['children'];['headerView'];constructor(_0x422bb0,_0x1b9911,_0x5eb4f0){super(_0x422bb0);const {showDiff:_0x6f1332,areActionsDisabled:_0x28f559,showUnchangedParts:_0x30eabb,availableActions:_0xa85028}=_0x1b9911;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new to(_0x422bb0,{'showDiff':_0x6f1332}),this['headerView']['on']('toggleShowChanges',(_0x103c53,_0x4bf970)=>{this['areChangesVisible']=_0x4bf970['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4bf970['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Co(_0x422bb0,{'areActionsDisabled':_0x28f559,'showUnchangedParts':!!_0x30eabb,'availableActions':_0xa85028,'bodyCollection':_0x5eb4f0}),this['bodyView']['delegate'](...$r)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async updateContent(_0x2f2f09){await this['bodyView']['updateContentParts'](_0x2f2f09);}updateSources(_0x6ef13a){this['bodyView']['updateSources'](_0x6ef13a);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}},Ro=class extends Zr{containerView;constructor(_0x23b82d,_0x4b08cd,_0x293ed3){super(_0x4b08cd),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fo(_0x23b82d,{'showDiff':_0x4b08cd['showDiff'],'areActionsDisabled':_0x4b08cd['areActionsDisabled'],'availableActions':_0x4b08cd['availableActions']},_0x293ed3),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x471489,_0x4e54fa)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4e54fa['showDiff']});}),this['containerView']['bind']('isTrackChangesOn')['to'](this),this['containerView']['on']('like',()=>{this['fire']('like',{'replyId':this['options']['id']});}),this['containerView']['on']('dislike',()=>{this['fire']('dislike',{'replyId':this['options']['id']});}),this['containerView']['on']('showChangeInText',(_0x1f0463,{index:_0x4facc6})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x4facc6});}),this['containerView']['on']('applySuggestion',(_0x2aa03e,{index:_0x4a3a85}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x4a3a85});}),this['containerView']['on']('insertSuggestion',(_0x594ad2,{index:_0x220838}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x220838});}),this['containerView']['on']('rejectSuggestion',(_0x53c922,{index:_0x21139a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x21139a});}),this['containerView']['on']('mouseOverSuggestion',(_0x30d514,{index:_0x5e8508})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5e8508});}),this['containerView']['on']('mouseLeaveSuggestion',(_0xe9dcb4,{index:_0x11eab7})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x11eab7});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async updateContent(_0x272076){await this['containerView']['updateContent'](_0x272076);}updatePartState(_0x2f54a0,_0x16d0ac,_0x5c3d85){this['containerView']['bodyView']['updatePartState'](_0x2f54a0,_0x16d0ac,_0x5c3d85);}setPartActive(_0x169fb8,_0xee89a6){!0x1===_0x169fb8?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x169fb8,_0xee89a6);}updateSources(_0x3bc52c){this['containerView']['updateSources'](_0x3bc52c);}getPartView(_0x20ec2f){return this['containerView']['bodyView']['getPartView'](_0x20ec2f);}setGating(_0x3d935c){this['containerView']['bodyView']['setGating'](_0x3d935c);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}},bo=class extends Zr{replyContainer;_bodyCollection;constructor(_0x351487,_0x269881,_0x11e6fb){super(_0x269881),this['_bodyCollection']=_0x11e6fb,this['locale']=_0x351487,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x2df458(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container','ck-ai-chat-content']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':en(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async updateContent({parsedContent:_0xf45b2a,renderingStrategy:_0x192ccc,abortSignal:_0xd1f21f}){'streaming'===_0x192ccc?await this['streamIntoElement'](_0xf45b2a,this['replyContainer']['element'],_0xd1f21f):this['replyContainer']['element']['innerHTML']=Qt(_0x24a162(_0xf45b2a));}updateSources(_0xe15b92){const _0x30f267=new To(this['locale'],this['_bodyCollection']);_0x30f267['children']['addMany'](_0xe15b92['map'](_0x3c5ff0=>new wo(this['locale'],_0x3c5ff0,_0x30f267['balloonPanelView']))),_0x30f267['isVisible']=!0x0,this['children']['add'](_0x30f267);}},So=class extends _0x407319{constructor(_0x4712d5=void 0x0){super();const _0x166d11=_0x4712d5?'ck-ai-spinner_'+_0x4712d5:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x166d11]}});}};const Oo={'file':_0x105dd2,'image':_0x3c70a7,'document':_0x5e85dd,'web-resource':_0x3bcbd8,'text':_0x105dd2,'selection':it,'mcp-tool-context':_0x5e85dd,'context':_0x5e85dd},vo='ck-ai-chat-context-chip',yo='ck-ai-chat-context-chip_wide',No='ck-ai-chat-context-chip_document',ko='ck-ai-chat-context-chip__label',xo='ck-ai-chat-context-chip__type-icon',Lo='ck-ai-chat-context-controls__chip-tooltip',Do='n';var Po=class extends _0x1a9216{constructor(_0x8ab145,_0x241b5c,_0x136526,_0x37cba6,_0x1c5675=!0x1){super(_0x8ab145),this['_isAnimationOnEnterEnabled']=_0x37cba6,this['_initializeProperties'](_0x241b5c,_0x136526,_0x1c5675),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(_0x2d7960,_0x29683d,_0x59f0a7){this['set']('label',_0x2d7960['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2d7960['type']),this['set']('id',_0x2d7960['uiId']),this['set']('readonly',_0x29683d),this['set']('isLoading',_0x59f0a7);}_setupTemplate(){const _0x408608=this['_createIconView'](),_0x224dda=this['_createRemoveButton'](),_0x524612=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x524612),'children':this['_createTemplateChildren'](_0x408608,_0x224dda,_0x524612)});}_createTemplateAttributes(_0xd1d81){return{'class':[vo,_0xd1d81['if']('itemType',No,_0x156a90=>'document'==_0x156a90),_0xd1d81['if']('itemType',yo,_0x10a766=>'selection'==_0x10a766)],'data-cke-tooltip-text':_0xd1d81['to']('label',Mo),'data-cke-tooltip-position':Do,'data-cke-tooltip-class':Lo};}_createTemplateChildren(_0x299487,_0x57374b,_0x51d2b2){const _0x16680f=this['_createLabelElement'](_0x51d2b2),_0x47f80d=this['_createLoaderIcon']();return this['readonly']?[_0x299487,_0x16680f]:[_0x299487,_0x47f80d,_0x16680f,_0x57374b];}_createLabelElement(_0x35261c){return{'tag':'span','attributes':{'class':ko},'children':[{'text':_0x35261c['to']('label')}]};}_createRemoveButton(){const _0x5be6d2=new _0x1a9216(this['locale']);return _0x5be6d2['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x29be46}),this['_setupRemoveButtonEvent'](_0x5be6d2),_0x5be6d2;}_setupRemoveButtonEvent(_0x5bec12){_0x5bec12['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}_createIconView(){const _0x4ea9db=this['bindTemplate'],_0x391203=new _0x5e3c18();return _0x391203['content']=Oo[this['itemType']],_0x391203['extendTemplate']({'attributes':{'class':[xo,_0x4ea9db['if']('isLoading','ck-hidden',_0x2f6639=>_0x2f6639)]}}),_0x391203;}_handleAnimationEndOnce(_0x5a0122,_0x5c9bcb){if(!_0x5a0122)return;const _0x13fdab=()=>{_0x5c9bcb(),_0x5a0122['removeEventListener']('animationend',_0x13fdab),_0x5a0122['removeEventListener']('webkitAnimationEnd',_0x13fdab);};_0x5a0122['addEventListener']('animationend',_0x13fdab),_0x5a0122['addEventListener']('webkitAnimationEnd',_0x13fdab);}_createLoaderIcon(){const _0x4d124a=new So('small');return _0x4d124a['bind']('isVisible')['to'](this,'isLoading',_0x578b3b=>_0x578b3b),_0x4d124a;}};function Mo(_0x358c82){if(!_0x358c82)return _0x358c82;if(_0x358c82['length']<=0x78)return _0x358c82;const _0x2b2450=_0x358c82['slice'](0x0,0x78),_0x26d982=_0x2b2450['lastIndexOf']('\x20');return(_0x26d982>0x0?_0x2b2450['slice'](0x0,_0x26d982):_0x2b2450)+'…';}const Vo={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+','viewportOffset':{'top':0x64,'bottom':0xa}},Ho='300px';var Uo=class{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];_showMoreButtonView=null;['_showMoreBalloonPanelView']=null;_containerElement=null;_bodyCollection;_parentView;_intersectionObserver=null;_pendingCalculation=!0x1;constructor(_0x1fb78,_0x4d35a6,_0x2f117b,_0x1f4a5a,_0x561a40){this['_locale']=_0x1fb78,this['_visibleChips']=_0x4d35a6,this['_config']={...Vo,..._0x2f117b,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2f117b['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x1f4a5a,this['_parentView']=_0x561a40;}setContainerElement(_0x22471f){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x22471f,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':this['_getLimiterElement']()}));}['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 _0x2f7419=[...this['_visibleChips'],...this['_overflowChips']],_0x44711f=this['_createCalculationContainer'](),_0x244d1a=this['_calculateOverflowInContainer'](_0x44711f,_0x2f7419),_0x11cba5=_0x44711f['_ancestorsToRestore'];_0x11cba5&&this['_restoreAncestorVisibility'](_0x11cba5),_0x44711f['remove'](),this['_applyOverflowResults'](_0x2f7419,_0x244d1a);}_createShowMoreButton(){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x314252({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}_createShowMoreButtonView(){const _0x4cb4e9=new _0x1a9216(this['_locale']);_0x4cb4e9['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x1242a3=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x1242a3['push'](this['_config']['cssClasses']['controlsButton']),_0x4cb4e9['extendTemplate']({'attributes':{'class':_0x1242a3}}),_0x4cb4e9;}_createShowMoreBalloonPanelView(){const _0xd7626=new Jt(this['_locale']);return _0xd7626['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0xd7626),_0xd7626;}_updateBalloonContent(){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x1a1d09=>{_0x1a1d09['disableAnimationOnEnter']();});const _0xcb8a08=new _0x2df458(this['_locale']);_0xcb8a08['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0xcb8a08);}}_handleShowMoreButtonClick(){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}_updateShowMoreButtonVisibility(){const _0x58c504=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x58c504?'':'none');}['_repinBalloonPanel'](){this['_showMoreButtonView']?.['isOn']&&this['_showMoreBalloonPanelView']?.['isVisible']&&this['_showMoreButtonView']['element']&&this['_showMoreBalloonPanelView']['pin']({'target':this['_showMoreButtonView']['element'],'limiter':this['_getLimiterElement']()});}_getLimiterElement(){return this['_config']['getLimiterElement']?.()||null;}_findTargetContainer(_0x28059c){const _0x390bd5=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3ba169=this['_containerElement']?.['classList'];if(_0x3ba169){const _0x58c190=_0x3ba169[0x0]||'',_0x131583=_0x28059c['querySelector']('.'+_0x58c190),_0x25a217=_0x28059c['querySelector'](_0x390bd5);return _0x131583||_0x25a217||_0x28059c;}return _0x28059c['querySelector'](_0x390bd5)||_0x28059c;}_calculateContainerWidth(){const _0x2f5990=this['_parentView']['element']||this['_containerElement'];if(!_0x2f5990)return Ho;const _0x3bf097=window['getComputedStyle'](_0x2f5990)['width'];if('auto'===_0x3bf097||'0px'===_0x3bf097||!_0x3bf097){const _0x7d3bde=kt(_0x2f5990);if(_0x7d3bde){const _0xac526b=window['getComputedStyle'](_0x7d3bde);return'auto'!==_0xac526b['width']?_0xac526b['width']:Ho;}return Ho;}return _0x3bf097;}_applyCalculationStyles(_0x4e474c,_0x498f72){this['_config']['cssClasses']['calculationContainer']&&_0x4e474c['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x4e474c['style']['width']=_0x498f72,_0x4e474c['style']['position']='absolute',_0x4e474c['style']['top']='-9999px',_0x4e474c['style']['left']='-9999px',_0x4e474c['style']['opacity']='0',_0x4e474c['style']['pointerEvents']='none',_0x4e474c['style']['zIndex']='-1',_0x4e474c['style']['visibility']='visible\x20!important',_0x4e474c['style']['display']='block\x20!important',_0x4e474c['style']['boxSizing']='border-box';}_restoreAncestorVisibility(_0x10e271){_0x10e271['forEach'](({element:_0x50b600,originalDisplay:_0x57efb5,originalVisibility:_0x4ab076})=>{_0x50b600['style']['display']=_0x57efb5,_0x50b600['style']['visibility']=_0x4ab076;});}_makeAncestorsVisible(_0x59cc78){const _0xac8404=[],_0x354894=Mt(_0x59cc78),_0x49b6e2=_0x354894['length']?_0x354894[_0x354894['length']-0x1]['host']:null;let _0x508a77=kt(_0x59cc78);for(;_0x508a77&&_0x508a77!==document['body']&&_0x508a77!==_0x49b6e2;){const _0x1c06f7=window['getComputedStyle'](_0x508a77);_0x508a77 instanceof HTMLElement&&('none'===_0x1c06f7['display']||'hidden'===_0x1c06f7['visibility'])&&(_0xac8404['push']({'element':_0x508a77,'originalDisplay':_0x508a77['style']['display'],'originalVisibility':_0x508a77['style']['visibility']}),_0x508a77['style']['display']='block',_0x508a77['style']['visibility']='visible'),_0x508a77=kt(_0x508a77);}return _0xac8404;}_createContainerElements(){let _0x2349ca,_0x2e7a56;return this['_parentView']['element']?(_0x2349ca=this['_parentView']['element']['cloneNode'](!0x0),_0x2e7a56=this['_findTargetContainer'](_0x2349ca)):(_0x2349ca=document['createElement']('div'),_0x2e7a56=_0x2349ca),{'calculationContainer':_0x2349ca,'targetContainer':_0x2e7a56};}_createCalculationContainer(){const _0x2c3bc2=this['_parentView']['element']||this['_containerElement'],_0x3cada6=Dt(_0x2c3bc2),_0x2006a4=_0x3cada6 instanceof HTMLElement?_0x3cada6:xt(_0x2c3bc2),{calculationContainer:_0x557928,targetContainer:_0x15328a}=this['_createContainerElements'](),_0x41259a=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x557928,_0x41259a),_0x2006a4['appendChild'](_0x557928),_0x557928['_targetContainer']=_0x15328a;const _0x5478d6=this['_makeAncestorsVisible'](_0x2c3bc2);return _0x557928['offsetWidth'],_0x557928['_ancestorsToRestore']=_0x5478d6,_0x557928;}_calculateOverflowInContainer(_0x49e097,_0x182b7c){const _0x3689a6=_0x49e097['_targetContainer']||_0x49e097,_0x49baea=[],{rowCount:_0x126527}=this['_renderChipsAndCountRows'](_0x3689a6,_0x182b7c);if(_0x126527<=this['_config']['maxVisibleRows'])return _0x49baea;const _0x512d2c=_0x182b7c['slice']();for(;_0x512d2c['length']>0x0;){if(this['_testButtonFit'](_0x49e097,_0x3689a6,_0x512d2c)){const _0x234ed3=_0x182b7c['filter'](_0x3d8fa2=>!_0x512d2c['includes'](_0x3d8fa2));_0x49baea['push'](..._0x234ed3);break;}if(!_0x512d2c['pop']())break;}return _0x49baea;}_renderChipsAndCountRows(_0x3cf794,_0x48f07b){_0x3cf794['replaceChildren'](),_0x48f07b['forEach'](_0x3edf3a=>{if(_0x3edf3a['element']){const _0x5b5080=_0x3edf3a['element']['cloneNode'](!0x0);_0x3cf794['appendChild'](_0x5b5080);}}),_0x3cf794['offsetWidth'];const _0x303f38=_0x3cf794['children'],_0x5428d4=[];return Array['from'](_0x303f38)['forEach'](_0x903a28=>{const _0x2f6452=_0x903a28['getBoundingClientRect']()['top'];_0x5428d4['some'](_0x3fa910=>Math['abs'](_0x3fa910-_0x2f6452)<this['_config']['rowDetectionTolerance'])||_0x5428d4['push'](_0x2f6452);}),{'rowCount':_0x5428d4['length']};}_createMockButton(){const _0x4c025a=document['createElement']('button');_0x4c025a['className']='ck\x20ck-button\x20ck-off\x20ck-button_with-text\x20'+this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x4c025a['classList']['add'](this['_config']['cssClasses']['controlsButton']);const _0x86e333=document['createElement']('span');return _0x86e333['className']='ck\x20ck-button__label',_0x86e333['textContent']=this['_config']['showMoreLabelPrefix']+'1',_0x4c025a['appendChild'](_0x86e333),_0x4c025a;}_testButtonFit(_0x5c78c8,_0x29b528,_0x3e80b6){this['_renderChipsAndCountRows'](_0x29b528,_0x3e80b6);const _0x4c3f51=this['_createMockButton']();_0x5c78c8['appendChild'](_0x4c3f51),_0x5c78c8['offsetWidth'];const _0x5724bf=[..._0x29b528['children'],_0x4c3f51],_0x564cc5=[];_0x5724bf['forEach'](_0x36acb9=>{const _0x43b26a=_0x36acb9['getBoundingClientRect']()['top'];_0x564cc5['some'](_0x23dcce=>Math['abs'](_0x23dcce-_0x43b26a)<this['_config']['rowDetectionTolerance'])||_0x564cc5['push'](_0x43b26a);});const _0x4a76ce=_0x564cc5['length'];return _0x4c3f51['remove'](),_0x4a76ce<=this['_config']['maxVisibleRows'];}_distributeChips(_0x18de9f,_0x2ee56c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x18de9f['forEach'](_0x2d902d=>{_0x2ee56c['includes'](_0x2d902d)?this['_overflowChips']['add'](_0x2d902d):this['_visibleChips']['add'](_0x2d902d);});}_updateOverflowUI(_0x40a25d){if(_0x40a25d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x40a25d>0x0&&this['_showMoreButtonView']){const _0x5caa9e=''+this['_config']['showMoreLabelPrefix']+Math['min'](_0x40a25d,0x9);this['_showMoreButtonView']['label']=_0x5caa9e;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}_applyOverflowResults(_0x563024,_0x10c932){this['_distributeChips'](_0x563024,_0x10c932),this['_updateOverflowUI'](_0x10c932['length']);}_setupVisibilityObserver(){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1d2e06=>{_0x1d2e06[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 _0xea9e88=this['_containerElement']['getBoundingClientRect']();if(0x0===_0xea9e88['width']||0x0===_0xea9e88['height'])return!0x1;const _0x107fbe=window['innerHeight']||document['documentElement']['clientHeight'],_0x530515=window['innerWidth']||document['documentElement']['clientWidth'];return _0xea9e88['bottom']>=-0xc8&&_0xea9e88['top']<=_0x107fbe+0xc8&&_0xea9e88['right']>=-0xc8&&_0xea9e88['left']<=_0x530515+0xc8;}};const Bo='ck-ai-chat__feed__context-chips',Go='ck-ai-chat-context-chips-wrapper',Wo='ck-ai-chat-context-chips-wrapper-balloon',Fo='ck-ai-chat-controls-button',Ko='ck-ai-chat-controls_context_show-more-button',$o='ck-ai-chat-context-controls__show-more-balloon-panel';var Yo=class extends _0x2df458{_contextChips=this['createCollection']();['_overflowManager'];_bodyCollection;constructor(_0x574273,_0xf9e517,_0xc3abd2){super(_0x574273),this['_bodyCollection']=_0xc3abd2,this['_createContextChips'](_0xf9e517);const _0x294518={'cssClasses':{'showMoreButton':Ko+'\x20'+Ar,'showMoreBalloon':$o,'overflowContainer':Wo,'controlsButton':Fo},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x574273,this['_contextChips'],_0x294518,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Go},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x30c81a=this['element']['querySelector']('.'+Go);_0x30c81a&&(this['_overflowManager']['setContainerElement'](_0x30c81a),this['_overflowManager']['reorganizeChips']());}destroy(){super['destroy'](),this['_overflowManager']['destroy']();}_createContextChips(_0x1870ca){for(const _0x15e2cd of _0x1870ca){const _0x59cfe1=new Po(this['locale'],_0x15e2cd,!0x0,!0x1);this['_contextChips']['add'](_0x59cfe1);}}},qo=class extends Zr{_contextChipsView=null;['_locale'];_bodyCollection;_messageContentView;constructor(_0x33f5f7,_0x1bb3fb,_0x5ed856){super(_0x1bb3fb),this['_locale']=_0x33f5f7,this['_bodyCollection']=_0x5ed856,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 Yo(this['_locale'],this['options']['contextItems']['filter'](_0x47ca35=>!_0x47ca35['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}_createMessageContentView(){this['_messageContentView']=new _0x2df458(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':['ck-reset_all-excluded','ck-ai-chat__feed__message-content','ck-ai-chat-content']}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=Qt(this['options']['initialContent']),this['markAsDone']();}},Qo=class extends Zr{capabilities;constructor(_0x2d4d3d,_0x2fc68f){super(_0x2fc68f);const {isWebSearchEnabled:_0x39df19,isReasoningEnabled:_0x49c5b6}=_0x2fc68f['capabilities'],_0x508927=[];let _0x58083f='';_0x39df19&&_0x49c5b6?(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x508927['push'](Xo(ut)),_0x508927['push'](Xo(_0x44fd08))):_0x39df19?(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x508927['push'](Xo(ut))):_0x49c5b6&&(_0x58083f=qs(_0x2d4d3d,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x508927['push'](Xo(_0x44fd08))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x58083f?'':'ck-hidden']}});const _0x51727a=new _0x2df458();_0x51727a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x508927,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x58083f]}]}),this['children']['add'](_0x51727a),this['capabilities']=_0x2fc68f['capabilities'];}};function Xo(_0x365159){const _0x4b453c=new _0x5e3c18();return _0x4b453c['content']=_0x365159,_0x4b453c;}const zo=['wheel','touchstart','pointerdown','keydown'],jo=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];var Jo=class{element;animationFrameId;['isRunning'];abortController;['isUserPaused'];['scrollBehavior'];constructor(_0x403920){this['element']=_0x403920,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x3a7ec4 of zo){const _0xa893d6='keydown'!==_0x3a7ec4;this['element']['addEventListener'](_0x3a7ec4,this['_onUserEvent']['bind'](this),{'passive':_0xa893d6,'signal':this['abortController']['signal']});}}start({smooth:_0x2a4ad5=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x2a4ad5?'smooth':'auto',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(_0x206f41){if(this['isRunning']){if('keydown'===_0x206f41['type']){const _0x5c6d=_0x206f41['key'];if(!jo['includes'](_0x5c6d))return;}_0x206f41 instanceof WheelEvent?_0x206f41['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}_isAtBottom(){const {scrollTop:_0x3336e0,scrollHeight:_0x55c102,clientHeight:_0x27b93f}=this['element'];return _0x55c102-_0x3336e0-_0x27b93f<=0x5;}_rafUpdate(){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}},Zo=class extends _0x2df458{constructor(_0x4415ff){super(_0x4415ff),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-dots-loader']},'children':new Array(0x3)['fill'](null)['map'](()=>({'tag':'div','attributes':{'class':['ck-ai-dots-loader__dot']}}))});}},ta=class extends Zr{constructor(_0x5ce315){super(_0x5ce315),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=Qt(this['options']['content']):this['element']['appendChild'](this['options']['content']);}},ea=class extends _0x2df458{['children'];['scrollManager'];_bodyCollection;constructor(_0x1d99a4,_0x4c80e6){super(_0x1d99a4),this['_bodyCollection']=_0x4c80e6,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('loadingSkeletonType','conversation'),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Yr)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jo(this['element']);}destroy(){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}addItem(_0x419ea0,_0x589902){let _0x2423c6;return'ai-reply'===_0x419ea0?_0x2423c6=new bo(this['locale'],_0x589902,this['_bodyCollection']):'ai-suggestion-reply'===_0x419ea0?(_0x2423c6=new Ro(this['locale'],_0x589902,this['_bodyCollection']),_0x2423c6['bind']('isTrackChangesOn')['to'](this)):_0x2423c6='user-message'===_0x419ea0?new qo(this['locale'],_0x589902,this['_bodyCollection']):'interaction-header'===_0x419ea0?new Qo(this['locale'],_0x589902):'custom-element'===_0x419ea0?new ta(_0x589902):new Eo(_0x589902),this['children']['add'](_0x2423c6),_0x2423c6;}async updateReplyItem({id:_0x25bd24,parsedContent:_0x5b2627,renderingStrategy:_0x384a34,abortSignal:_0x5e7c65}){const _0x1ff67f=this['getItemById'](_0x25bd24);if(!(_0x1ff67f instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x1ff67f,'id':_0x25bd24,'parsedContent':_0x5b2627});await _0x1ff67f['updateContent']({'parsedContent':_0x5b2627,'renderingStrategy':_0x384a34,'abortSignal':_0x5e7c65});}async updateWebSources(_0x2f4e4b,_0x3cbd25){const _0x4482ce=this['getItemById'](_0x2f4e4b);if(_0x4482ce instanceof Ro)_0x4482ce['updateSources'](_0x3cbd25);else{if(!(_0x4482ce instanceof bo))throw new dt('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4482ce,'id':_0x2f4e4b,'sources':_0x3cbd25});_0x4482ce['updateSources'](_0x3cbd25);}}async updateSuggestionItem({id:_0x3d6fe3,parts:_0x1c5775,abortSignal:_0x1753e9,skipLoadingEffects:_0x26352e}){const _0x4a1aa9=this['getItemById'](_0x3d6fe3);if(!(_0x4a1aa9 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4a1aa9,'id':_0x3d6fe3,'parts':_0x1c5775});await _0x4a1aa9['updateContent']({'parts':_0x1c5775,'abortSignal':_0x1753e9,'skipLoadingEffects':_0x26352e});}updateSuggestionPartState({id:_0x102daa,index:_0x33462d,state:_0x30d907,outdatedReason:_0x105407}){const _0x26ba7d=this['getItemById'](_0x102daa);if(!(_0x26ba7d instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x102daa});_0x26ba7d['updatePartState'](_0x33462d,_0x30d907,_0x105407);}updateSuggestionGating(_0x1f4b57,_0x321943){const _0x4bda28=this['getItemById'](_0x1f4b57);if(!(_0x4bda28 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1f4b57});_0x4bda28['setGating'](_0x321943);}getSuggestionPartUIIndex({id:_0x3590dd,index:_0x148990}){if(!this['hasItem'](_0x3590dd))return null;const _0x51a174=this['getItemById'](_0x3590dd);return _0x51a174 instanceof Ro?_0x51a174['getPartView'](_0x148990)?.['uiIndex']??null:null;}setSuggestionPartActive({id:_0x27a462,index:_0x48036a,isActive:_0x3b930a}){const _0x3e7755=this['getItemById'](_0x27a462);if(!(_0x3e7755 instanceof Ro))throw new dt('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x27a462});this['children']['filter'](_0x5d01ea=>_0x5d01ea instanceof Ro)['forEach'](_0x4a4d6a=>{_0x4a4d6a['setPartActive'](!0x1);}),_0x3e7755['setPartActive'](_0x48036a,_0x3b930a);}markItemAsDone(_0x48f0fb){this['getItemById'](_0x48f0fb)['markAsDone']();}getItemIds(){return this['children']['map'](_0x107934=>_0x107934['options']['id']);}removeItem(_0x479400){this['children']['remove'](this['getItemById'](_0x479400));}hasItem(_0x31f443){return!!this['children']['find'](_0x43267f=>_0x43267f['options']['id']['includes'](_0x31f443));}scrollToSuggestion(_0x5bbb63,_0x13e613){const _0x3a0627=this['getItemById'](_0x5bbb63);if(!(_0x3a0627 instanceof Ro))return void Ft('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x5bbb63,'partIndex':_0x13e613});const _0x451a54=_0x3a0627['getPartView'](_0x13e613);if(_0x451a54){const _0x20bcba=kt(this['element']);_0x20bcba instanceof HTMLElement&&$t(_0x451a54['element'],0x14,_0x20bcba,!0x0,!0x0);}else Ft('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x5bbb63,'partIndex':_0x13e613});}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}_createTemplateChildren(){const _0x500727=this['_createSkeletonLoader']('init',uo['aiChatInit'],'ck-ai-chat__feed__init-skeleton'),_0x1351cb=this['_createSkeletonLoader']('conversation',uo['aiFeed']);return[this['_createFeedItems'](),_0x500727,_0x1351cb,this['_createFeedLoader']()];}_createSkeletonLoader(_0x2a1ab2,_0x1fa117,_0x453ce2){const _0x318af3=new lo(this['locale'],_0x1fa117);return _0x453ce2&&_0x318af3['extendTemplate']({'attributes':{'class':[_0x453ce2]}}),_0x318af3['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible',this,'loadingSkeletonType',(_0x47cadd,_0x56bd7b)=>_0x47cadd&&_0x56bd7b==_0x2a1ab2),_0x318af3;}_createFeedItems(){const _0x5763e7=new _0x2df458(this['locale']);return _0x5763e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5763e7;}_createFeedLoader(){const _0x1d3282=new _0x2df458(this['locale']);return _0x1d3282['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x3b36b4=>!_0x3b36b4)]},'children':this['_createLoaderChildren']()}),_0x1d3282;}_createLoaderChildren(){return[new Zo(this['locale']),{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}getItemById(_0x1f5136){const _0x1988e4=this['children']['find'](_0x2c1285=>_0x2c1285['options']['id']['includes'](_0x1f5136));if(!_0x1988e4)throw new dt('ai-chat-feed-view-item-not-found',this,{'id':_0x1f5136});return _0x1988e4;}setLoadingMessage(_0x1ae06b){this['set']('loadingMessage',_0x1ae06b);}toggleLoadingSkeleton(_0x179cbc,_0x48d8f0='conversation'){(_0x179cbc||this['loadingSkeletonType']==_0x48d8f0)&&(this['set']('loadingSkeletonType',_0x48d8f0),this['set']('isLoadingSkeletonVisible',_0x179cbc));}startAutoScroll(_0x32b207={}){this['scrollManager']['start'](_0x32b207);}stopAutoScroll(){this['scrollManager']['stop']();}},ia=class extends _0x4e6fd6{filter(){let _0x3c9770=0x0;for(const _0x38d1db of this['items'])_0x3c9770+=_0x38d1db['items']['length'];return{'resultsCount':_0x3c9770,'totalItemsCount':_0x3c9770};}};function sa(_0x53aae9){const _0x10fbc3=[];let _0x3613d5=!0x1;for(const _0x4030c7 of Array['from'](_0x53aae9['items'])){if('file'!==_0x4030c7['kind'])continue;if(_0x4030c7['webkitGetAsEntry']()?.['isDirectory']){_0x3613d5=!0x0;continue;}const _0x7e5fbc=_0x4030c7['getAsFile']();_0x7e5fbc&&_0x10fbc3['push'](_0x7e5fbc);}return{'files':_0x10fbc3,'hasDirectory':_0x3613d5};}const na='ck-ai-chat__prompt-input_highlighted';var ra=class AIChatPromptInputView extends jt{actionButtonView;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;_addContextButtonView;['_queryViewResizeObserver'];constructor(_0x4ad1f7,_0x51d8ab){super(_0x4ad1f7,{'queryView':{'label':'','creator':_0x3e1b5a,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new ia(_0x4ad1f7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['set']('isBusy',!0x1),this['_addContextButtonView']=_0x51d8ab,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['bind']('isEnabled')['to'](this,'isBusy',_0x341a88=>!_0x341a88),this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['bind']('canSubmit')['to'](this,'isEmpty',this,'isUploadInProgress',this,'isBusy',(_0x13641a,_0x1a8027,_0xeca74)=>!_0x13641a&&!_0x1a8027&&!_0xeca74),this['actionButtonView']=this['_createActionButton'](),this['actionButtonView']['bind']('isEnabled')['to'](this,'canSubmit',this,'isBusy',(_0x1d0dbd,_0x466756)=>_0x1d0dbd||_0x466756),this['focusableChildren']['add'](this['actionButtonView']),this['on']('change:isBusy',(_0x338e5b,_0x183ff4,_0x4f0572)=>{_0x4f0572||vt(this['actionButtonView']['element'])!==this['actionButtonView']['element']||this['focus']();});}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['actionButtonView']),this['keystrokes']['set']('enter',(_0x20536d,_0xa97224)=>{this['canSubmit']&&_0x20536d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xa97224());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();}),this['queryView']['fieldView']['element']['addEventListener']('paste',_0x200461=>this['_handlePaste'](_0x200461)),this['element']['addEventListener']('drop',_0x4a1846=>this['_handleDrop'](_0x4a1846));}_handlePaste(_0x3fa5de){const _0x7a7173=_0x3fa5de['clipboardData'];if(!_0x7a7173||this['isBusy'])return;const {files:_0x4a9e0e,hasDirectory:_0x4d3ba3}=sa(_0x7a7173),_0x3e6514={'files':_0x4a9e0e,'plainText':_0x7a7173['getData']('text/plain'),'hasDirectory':_0x4d3ba3,'forceTextAttachment':!0x1,'preventDefault':()=>_0x3fa5de['preventDefault']()};this['fire']('promptInputPaste',_0x3e6514);}['_handleDrop'](_0x528581){const _0x48d826=_0x528581['dataTransfer'];if(!_0x48d826||this['isBusy'])return;const _0x4f1d39={'files':[],'plainText':_0x48d826['getData']('text/uri-list')||_0x48d826['getData']('text/plain'),'hasDirectory':!0x1,'forceTextAttachment':!0x1,'preventDefault':()=>_0x528581['preventDefault']()};this['fire']('promptInputPaste',_0x4f1d39);}destroy(){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}submit(){const _0x4570be=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x4570be)return this['queryView']['errorText']=qs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x229e5c=_0x369484(_0x4570be);this['fire']('sendUserMessage',_0x229e5c),this['queryView']['fieldView']['reset']();}setPlaceholderText(_0x976e4){this['queryView']['fieldView']['set']('placeholder',_0x976e4);}['focus'](_0x2e6059=!0x1){super['focus'](),_0x2e6059&&(this['element']['classList']['contains'](na)||(this['element']['classList']['add'](na),setTimeout(()=>{this['element']['classList']['remove'](na);},0x320)));}_createActionButton(){const _0xe32972=new _0x1a9216(this['locale']);return _0xe32972['set']({'isVisible':!0x0,'tooltip':!0x0,'isEnabled':!0x1}),_0xe32972['bind']('icon')['to'](this,'isBusy',_0x27505c=>_0x27505c?ot:at),_0xe32972['bind']('label')['to'](this,'isBusy',_0x26e26f=>qs(this['locale'],_0x26e26f?'AI_CHAT_STOP_GENERATING':'AI_CHAT_LABEL_SUBMIT')),_0xe32972['bind']('class')['to'](this,'isBusy',_0x29a1c0=>'ck-ai-chat__prompt-submit-button\x20'+(_0x29a1c0?Ir:gr)),_0xe32972['on']('execute',()=>{this['isBusy']?this['fire']('abortPromptStream'):this['submit']();}),_0xe32972;}setIsUploadInProgress(_0x279e56){this['isUploadInProgress']=_0x279e56;}_setUpAddContextButtonPositioning(){const _0x3ffeb4=this['locale'],_0x2324fb=()=>{Vt['window']['requestAnimationFrame'](()=>{if(Bt(this['element'])){const _0x303aba=new Tt(this['queryView']['fieldView']['element']),_0x2f645c=new Tt(this['_addContextButtonView']['element']),_0x5366b7=_0x303aba['width'],_0x32b464='rtl'===_0x3ffeb4['uiLanguageDirection']?'right':'left';_0x303aba['excludeScrollbarsAndBorders']();const _0x262612=_0x5366b7-_0x303aba['width']+0x1;this['_addContextButtonView']['element']['style'][_0x32b464]='calc('+(_0x5366b7-_0x2f645c['width']-_0x262612)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2324fb),this['on']('render',()=>{_0x2324fb(),this['_queryViewResizeObserver']=new wt(this['queryView']['fieldView']['element'],()=>{_0x2324fb();});});}},oa=class extends _0x2df458{constructor(_0x2de198){super(_0x2de198),this['set']('isEnabled',!0x0);const _0x3cb87b=new _0x5e3c18();_0x3cb87b['content']=_0x105dd2,this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls__drop-overlay']},'children':[_0x3cb87b,{'tag':'span','attributes':{'class':['ck-ai-chat-controls__drop-overlay__label']},'children':[{'text':qs(_0x2de198,'AI_CHAT_DROP_ZONE_HINT')}]}]});}attach(_0x310407){let _0x1fe970=0x0;const _0x2d895c=()=>{_0x310407['classList']['toggle']('ck-ai-chat-controls_drag-over',this['isEnabled']&&_0x1fe970>0x0);};this['on']('change:isEnabled',(_0x32e09a,_0x2aab7a,_0x270ed3)=>{_0x270ed3&&_0x1fe970>0x0&&this['fire']('dragEnter'),_0x2d895c();}),_0x310407['addEventListener']('dragenter',_0x5828c2=>{_0x5828c2['dataTransfer']&&(_0x1fe970++,0x1===_0x1fe970&&this['isEnabled']&&this['fire']('dragEnter'),_0x2d895c());}),_0x310407['addEventListener']('dragover',_0x2248f8=>{_0x2248f8['dataTransfer']&&_0x2248f8['preventDefault']();}),_0x310407['addEventListener']('dragleave',()=>{--_0x1fe970<0x0&&(_0x1fe970=0x0),_0x2d895c();}),_0x310407['addEventListener']('drop',_0x107412=>{_0x107412['preventDefault'](),_0x1fe970=0x0,_0x2d895c(),this['isEnabled']&&this['_handleDrop'](_0x107412);});}['_handleDrop'](_0xed54f8){const _0x16b555=_0xed54f8['dataTransfer'];if(!_0x16b555)return;const {files:_0x14ba63,hasDirectory:_0x383a12}=sa(_0x16b555),_0x1cf7c9={'files':_0x14ba63,'plainText':_0x16b555['getData']('text/uri-list')||_0x16b555['getData']('text/plain'),'hasDirectory':_0x383a12,'forceTextAttachment':!0x0,'preventDefault':()=>{}};this['fire']('promptInputPaste',_0x1cf7c9);}};const aa='ck-ai-model-selector__item-name',ha='ck-ai-model-selector__item-description',ca='ck-ai-model-selector__item-capabilities';var la=class extends _0x2df458{['dropdownView'];['nameView'];_items;['_config'];constructor(_0x21de57,_0x314f0b){super(_0x21de57),this['_config']=_0x314f0b,this['set']('modelDisplayMode','selector'),this['set']('activeModelId',null),this['set']('activeModelName',null),this['set']('isEnabled',!0x0),this['dropdownView']=this['_createDropdown'](),this['_items']=new _t(),_0x34e876(this['dropdownView'],this['_items']),this['nameView']=new ua(_0x21de57,_0x314f0b['nameClass']),this['nameView']['bind']('text')['to'](this,'activeModelName',_0x180d31=>_0x180d31??''),this['nameView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5bba5b=>'name'===_0x5bba5b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-model-selector']},'children':[this['dropdownView'],this['nameView']]});}setModels(_0x43ebe8,_0x1cb8dc){var _0x4553cc;this['set']('modelDisplayMode',(_0x4553cc=_0x43ebe8['length'],_0x1cb8dc?0x1===_0x4553cc?'name':'selector':'hidden')),this['_items']['clear'](),0x1===_0x43ebe8['length']&&this['set']('activeModelName',_0x43ebe8[0x0]['name']||_0x43ebe8[0x0]['id']);for(const _0x344302 of _0x43ebe8){const _0x527e6e=new _0x13bdb1({'label':_0x344302['name'],'withText':!0x0,'role':'menuitemradio','id':_0x344302['id'],'model':_0x344302});_0x527e6e['bind']('isOn')['to'](this,'activeModelId',_0x55a934=>_0x55a934===_0x344302['id']),this['_items']['add']({'type':'button','model':_0x527e6e,'labelView':new da(this['locale'],_0x344302,{'nameClass':this['_config']['itemClasses']['name'],'descriptionClass':this['_config']['itemClasses']['description'],'capabilitiesClass':this['_config']['itemClasses']['capabilities'],'extraContent':this['_config']['showCapabilities']?_a(this['locale'],_0x344302,this['_config']['tooltipPosition']):void 0x0})});}}setSelectedModel(_0x51d821){this['set']('activeModelId',_0x51d821?_0x51d821['id']:null),this['set']('activeModelName',_0x51d821?_0x51d821['name']||_0x51d821['id']:null);}_createDropdown(){const _0x1328c6=_0x4c754a(this['locale']);return _0x1328c6['set']({'panelPosition':this['_config']['panelPosition'],'class':Array['isArray'](this['_config']['dropdownClass'])?this['_config']['dropdownClass']['join']('\x20'):this['_config']['dropdownClass']}),_0x1328c6['panelPositionLimiter']=()=>{const _0x2a0730=_0x1328c6['buttonView']['element'];return _0x2a0730&&St(_0x2a0730);},_0x1328c6['buttonView']['set']({'withText':!0x0,'tooltipPosition':this['_config']['tooltipPosition'],'class':'ck-button_small\x20'+Ar}),_0x1328c6['buttonView']['bind']('label')['to'](this,'activeModelName',_0x464507=>_0x464507??this['_config']['defaultLabel']??''),_0x1328c6['buttonView']['bind']('tooltip')['to'](this,'activeModelName',this,'isEnabled',(_0x3ccb79,_0x5d9ca8)=>!_0x5d9ca8&&this['_config']['disabledTooltip']?this['_config']['disabledTooltip']:_0x3ccb79??this['_config']['defaultLabel']??''),_0x1328c6['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x520986=>'selector'===_0x520986),_0x1328c6['bind']('isEnabled')['to'](this,'isEnabled'),this['listenTo'](_0x1328c6,'execute',_0x5bb50d=>{this['fire']('selectModel',_0x5bb50d['source']['model']);}),_0x1328c6;}},ua=class extends _0x2df458{constructor(_0x431013,_0xfbafb8){super(_0x431013),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x46e045=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0xfbafb8,_0x46e045['if']('isVisible','ck-hidden',_0x2da84d=>!_0x2da84d)]},'children':[{'text':_0x46e045['to']('text')}]});}},da=class extends te{constructor(_0x18174b,_0x139c1c,_0x2d32cc){super();const _0xa5f421=this['bindTemplate'],_0x2c0de9=[{'tag':'span','children':[{'text':_0xa5f421['to']('text')}]}];_0x2d32cc['extraContent']?.['length']&&_0x2d32cc['capabilitiesClass']&&_0x2c0de9['push']({'tag':'div','attributes':{'class':[ca,_0x2d32cc['capabilitiesClass']]},'children':_0x2d32cc['extraContent']});const _0x2ec1ca=[{'tag':'div','attributes':{'class':[aa,_0x2d32cc['nameClass']]},'children':_0x2c0de9},{'tag':'div','attributes':{'class':[ha,_0x2d32cc['descriptionClass']]},'children':[{'tag':'span','children':[_0x139c1c['description']||'']}]}];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xa5f421['to']('style'),'id':_0xa5f421['to']('id')},'children':_0x2ec1ca});}};function _a(_0x52c6d0,_0x33839f,_0x27a570){const _0x37044c=[];return _0x33839f['capabilities']['webSearch']?.['enabled']&&_0x37044c['push'](ga(_0x52c6d0,ut,'AI_CHAT_SEARCH_WEB',_0x27a570)),_0x33839f['capabilities']['reasoning']?.['enabled']&&_0x37044c['push'](ga(_0x52c6d0,_0x44fd08,'AI_CHAT_REASONING',_0x27a570)),_0x37044c;}function ga(_0x4bbca8,_0x3ee79b,_0x10409a,_0x24eaa5){const _0x25f548=qs(_0x4bbca8,_0x10409a),_0x474409=new _0x5e3c18();_0x474409['content']=_0x3ee79b;const _0x3c56df=new _0x2df458(_0x4bbca8);return _0x3c56df['setTemplate']({'tag':'span','attributes':{'role':'img','aria-label':_0x25f548,'data-cke-tooltip-text':_0x25f548,'data-cke-tooltip-position':_0x24eaa5},'children':[_0x474409]}),_0x3c56df;}const Ia='ck-ai-chat__prompt-capabilities',Aa='ck-ai-chat-controls-button',Ea='ck-ai-chat-controls__model-selection',pa='ck-ai-chat-controls__model-selection__item-name',ma='ck-ai-chat-controls__model-selection__item-description',Ta='ck-ai-chat-controls__model-selection__item-capabilities',wa='n';var Ca=class extends _0x2df458{_webSearchButton;_reasoningButton;_modelSelector;constructor(_0x2c2650){super(_0x2c2650),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorEnabled',!0x0),this['set']('isBusy',!0x1),this['_modelSelector']=function(_0x5b5d01){return new la(_0x5b5d01,{'panelPosition':'ne','dropdownClass':[Ea],'nameClass':'ck-ai-chat-controls__model-name','itemClasses':{'name':pa,'description':ma,'capabilities':Ta},'defaultLabel':qs(_0x5b5d01,'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'disabledTooltip':qs(_0x5b5d01,'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP'),'tooltipPosition':wa,'showCapabilities':!0x0});}(_0x2c2650),this['_modelSelector']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2e28d2=>_0x2e28d2),this['_modelSelector']['delegate']('selectModel')['to'](this),this['_webSearchButton']=this['_createWebSearchButton'](),this['_reasoningButton']=this['_createReasoningButton'](),this['setTemplate']({'tag':'div','attributes':{'class':[Ia]},'children':[this['_modelSelector'],this['_webSearchButton'],this['_reasoningButton']]});}setWebSearch(_0x1455c4){this['set']('webSearchActive',_0x1455c4);}setReasoning(_0x30f3f5){this['set']('reasoningActive',_0x30f3f5);}setModelList(_0x8c424e,_0x44726d){this['_modelSelector']['setModels'](_0x8c424e,!_0x44726d);}setModel(_0xcbfe95){if(!_0xcbfe95)return;this['_modelSelector']['setSelectedModel'](_0xcbfe95);const _0x280d46=_0xcbfe95['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isVisible',_0x280d46);const _0x5eb042=_0xcbfe95['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isVisible',_0x5eb042);}enableModelSelector(){this['set']('modelSelectorEnabled',!0x0);}disableModelSelector(_0x296fe7){this['set']('modelSelectorEnabled',!0x1),_0x296fe7&&(this['_modelSelector']['modelDisplayMode']='hidden');}_createWebSearchButton(){const _0x49f14f=new _0x1a9216();return _0x49f14f['set']({'label':qs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':ut,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x49f14f['bind']('isEnabled')['to'](this,'isBusy',_0x5733f5=>!_0x5733f5),_0x49f14f['bind']('isOn')['to'](this,'webSearchActive',_0x30f0e0=>_0x30f0e0),_0x49f14f['bind']('tooltip')['to'](this,'webSearchActive',_0x5edeb4=>qs(this['locale'],_0x5edeb4?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),_0x49f14f['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x49f14f;}_createReasoningButton(){const _0x5cd3e0=new _0x1a9216();return _0x5cd3e0['set']({'label':qs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x44fd08,'class':Aa+'\x20'+Ar+'\x20ck-button_small','isToggleable':!0x0,'tooltipPosition':wa}),_0x5cd3e0['bind']('isEnabled')['to'](this,'isBusy',_0x4f552e=>!_0x4f552e),_0x5cd3e0['bind']('isOn')['to'](this,'reasoningActive',_0xfcf731=>_0xfcf731),_0x5cd3e0['bind']('tooltip')['to'](this,'reasoningActive',_0x21dbcd=>qs(this['locale'],_0x21dbcd?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),_0x5cd3e0['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x5cd3e0;}};const fa='ck-ai-chat-context-controls__url-form',Ra='ck-ai-chat-context-controls__url-input-section';var ba=class extends _0x2df458{['focusTracker'];keystrokes;['_focusables'];['focusCycler'];urlInputField;backButton;confirmButton;constructor(_0x469a5f){super(_0x469a5f),this['focusTracker']=new Et(),this['keystrokes']=new pt(),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 _0x17323b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x36a013=>{this['focusTracker']['add'](_0x36a013['element']),this['keystrokes']['listenTo'](_0x36a013['element']);}),_0x32c7ed({'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(_0x247983){this['urlInputField']['errorText']=_0x247983,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}_createBackButton(){const _0x2d670a=new _0x1a9216(this['locale']);return _0x2d670a['set']({'icon':_0x9f5b9e,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x338c5f,_0x14344e,_0x4d95ea)=>{_0x2d670a['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4d95ea?'':'\x20ck-hidden')]});}),_0x2d670a;}_createUrlInputField(){const _0x1b5cbd=new _0x187ed8(this['locale'],_0x31f20c);return _0x1b5cbd['set']({'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1b5cbd['fieldView']['set']({'placeholder':qs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1b5cbd;}_createConfirmButton(){const _0x4b94d1=new _0x1a9216(this['locale']);return _0x4b94d1['set']({'icon':_0x42448e,'tooltip':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x4b94d1;}_setupTemplate(){const _0x5e2138=new _0x105865(this['locale'],{'label':qs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL')});_0x5e2138['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':fa,'tabindex':'-1'},'children':[_0x5e2138,{'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',_0x57154c=>{_0x57154c['stop'](),this['_handleSubmit']();});}_setupKeystrokes(){this['keystrokes']['set']('esc',(_0x2d62f2,_0x272d14)=>{this['clear'](),this['fire']('cancel'),_0x272d14();});}_handleSubmit(){const _0x554957=this['getValue']()['trim']();_0x554957?this['_isValidUrl'](_0x554957)?(this['clearError'](),this['fire']('submitUrl',_0x554957)):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](qs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}_updateConfirmButtonState(){const _0x1ab4df=this['getValue']()['trim'](),_0x53b614=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x1ab4df['length']>0x0&&!_0x53b614;}['_isValidUrl'](_0x546c49){try{return!!new URL(_0x546c49);}catch{return!0x1;}}};const Sa='ck-ai-chat-resources__item',Oa='ck-ai-chat-resources__item--in-context',va='ck-ai-chat-resources__item-title',ya='ck-ai-chat-resources__item__icon',Na='ck-ai-chat-resources__item__check';var ka=class extends _0xf665cb{['resource'];_titleView;['_iconView'];['_checkIconView'];constructor(_0x3e2348,_0x4f1b72){super(_0x3e2348),this['resource']=_0x4f1b72,this['set']('isInContext',!!_0x4f1b72['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_checkIconView']=this['_createCheckIconView'](),this['_setupTemplate']();}['render'](){super['render']();}getResourceIcon(_0x53184b){switch(_0x53184b['type']){case'document':return _0x5e85dd;case'web-resource':return _0x3bcbd8;case'file':case'text':return _0x105dd2;default:return _0x1052b8;}}highlightText(_0x121734){if(!_0x121734||''===_0x121734['trim']())return void this['_titleView']['highlightText'](null);const _0x2e2da4=new RegExp(_0x3df188(_0x121734),'gi');this['_titleView']['highlightText'](_0x2e2da4);}updateResourceState(_0x3d4bf7){this['resource']['isInContext']=_0x3d4bf7,this['isInContext']=_0x3d4bf7;}_createTitleView(){const _0x6e592d=new _0x2d3d45();return _0x6e592d['text']=this['resource']['label'],_0x6e592d['extendTemplate']({'tag':'span','attributes':{'class':[va]}}),_0x6e592d;}_createIconView(){const _0x3d5c78=new _0x5e3c18();return _0x3d5c78['content']=this['getResourceIcon'](this['resource']),_0x3d5c78;}_createCheckIconView(){const _0x1a33f6=new _0x5e3c18();return _0x1a33f6['content']=_0x42448e,_0x1a33f6['bind']('isVisible')['to'](this,'isInContext'),_0x1a33f6;}_setupTemplate(){const _0x3c8d46=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Sa,_0x3c8d46['if']('isVisible','ck-hidden',_0x373b4a=>!_0x373b4a),_0x3c8d46['if']('isInContext',Oa)]},'children':[{'tag':'div','attributes':{'class':[Na]},'children':[this['_checkIconView']]},{'tag':'div','attributes':{'class':[ya]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x3c8d46['to']('execute')}});}};const xa='ck-ai-chat-resources__list';var La=class extends _0x4e6fd6{['_source'];constructor(_0x318793,_0x4ec60d){super(_0x318793),this['_source']=_0x4ec60d,this['extendTemplate']({'attributes':{'class':[xa]}});}setResources(_0x311864,_0x41eb37){this['items']['clear']();let _0x1325e4=_0x311864;if(this['_source']['useDefaultFiltering']&&_0x41eb37&&''!==_0x41eb37['trim']()){const _0x56a040=new RegExp(_0x41eb37['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x1325e4=_0x311864['filter'](_0x1a093b=>_0x56a040['test'](_0x1a093b['label']));}for(const _0x324843 of _0x1325e4){const _0x37c184=new ka(this['locale'],_0x324843);_0x37c184['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x324843);}),this['items']['add'](_0x37c184);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x41eb37);}highlightText(_0x2cc336){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x50a100=>{_0x50a100['highlightText'](_0x2cc336);});}updateResourceState(_0x45377b,_0x339b18){for(const _0x4c3e4f of this['items']){const _0x1ede1a=_0x4c3e4f;_0x1ede1a['resource']['id']===_0x45377b&&_0x1ede1a['updateResourceState'](_0x339b18);}}_handleResourceSelection(_0x484692,_0x32d0bf){this['fire']('addResourceToContext',{'source':_0x484692,'resource':_0x32d0bf});}},Da=class extends _0x187ed8{['iconView'];resetButtonView;['_viewConfig'];constructor(_0x58a285){const t=_0x58a285['t'],_0x382bfb={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x31f20c,'label':qs(_0x58a285,'AI_CHAT_SEARCH_RESOURCES')};super(_0x58a285,_0x382bfb['creator']),this['label']=_0x382bfb['label'],this['_viewConfig']=_0x382bfb,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x58a285,t),this['_setupEventListeners']();}reset(){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5804a1){this['fire']('search',_0x5804a1);}getQuery(){return this['fieldView']['element']?.['value']||'';}_setupSearchIcon(){this['iconView']=new _0x5e3c18(),this['iconView']['content']=_0x432e10,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}_setupResetButton(_0x5c8502,t){this['resetButtonView']=new _0x1a9216(_0x5c8502),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x29be46,'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',_0x59b87b=>!_0x59b87b),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);}},Pa=class extends _0x2df458{['_searchView'];_searchSection;_searchInputVisibleFrom;_resourcesListView;_skeletonLoader;['_source'];['children'];_latestLoadResourcesUid=null;constructor(_0x430e6e,_0x530779){super(_0x430e6e),this['_source']=_0x530779['source'],this['_searchInputVisibleFrom']=_0x530779['searchInputVisibleFrom']??0x7,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView'](),this['_searchSection']=this['_createSearchSection'](),this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x15c4c2([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}_createSearchView(){return new Da(this['locale']);}_createSearchSection(){const _0x5ac341=new _0x2df458(this['locale']);return _0x5ac341['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x46279d,_0x22e723)=>{this['loadResources'](_0x22e723),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x22e723);}),_0x5ac341;}_createResourcesListView(){const _0x38ead1=new La(this['locale'],this['_source']);return _0x38ead1['delegate']('addResourceToContext')['to'](this),_0x38ead1['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x38ead1;}_createSkeletonView(){const _0x29f215=new lo(this['locale'],uo['aiChatResources']);return _0x29f215['bind']('isVisible')['to'](this,'isLoading'),_0x29f215;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1761c4){const _0x46673d=Xt();this['_latestLoadResourcesUid']=_0x46673d,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1761c4,'uid':_0x46673d}),this['isLoading']=!0x0;}setResources(_0x10c41a,_0x234481){if(_0x234481&&_0x234481!==this['_latestLoadResourcesUid'])return;const _0x301b90=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x10c41a,_0x301b90),_0x10c41a['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}updateResourceState(_0x48685b,_0x18ccd1){this['_resourcesListView']['updateResourceState'](_0x48685b,_0x18ccd1);}};const Ma='ck-ai-chat-context-controls__source-balloon-panel',Va='ck-button-icon\x20ck-button-back';var Ha=class{['_sourceResourceBalloons']=new Map();_bodyCollection;['_locale'];['_config'];constructor(_0x169ae0,_0x4eea06,_0x2383e2){this['_locale']=_0x169ae0,this['_bodyCollection']=_0x4eea06,this['_config']=_0x2383e2;}['showSourceResourcesBalloon']({source:_0x49b26f,withBackButton:_0x21339d}){let _0x1c5423=this['_sourceResourceBalloons']['get'](_0x49b26f['id']);_0x1c5423||(_0x1c5423=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x49b26f['id'],_0x1c5423),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1c5423)),this['_addSourceResourceContent']({'balloonPanel':_0x1c5423,'source':_0x49b26f,'withBackButton':_0x21339d}),_0x1c5423['show']();const _0x7ef488=this['_config']['getTargetElement']();_0x7ef488&&_0x1c5423['pin']({'target':_0x7ef488,'limiter':this['_config']['getLimiterElement']()});}populateSourceResourceBalloon(_0x3c218d,_0x2e47ed,_0x4c2bb4){const _0x43f7ec=this['_sourceResourceBalloons']['get'](_0x3c218d);if(!_0x43f7ec)return;const _0x3465b1=this['_getResourcesViewFromBalloon'](_0x43f7ec);_0x3465b1&&(_0x3465b1['setResources'](_0x2e47ed,_0x4c2bb4),_0x3465b1['once']('change:isLoading',()=>{_0x43f7ec['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x3f947b){const _0x4c0229=this['_sourceResourceBalloons']['get'](_0x3f947b);_0x4c0229&&requestAnimationFrame(()=>{_0x4c0229['hide'](),this['_sourceResourceBalloons']['delete'](_0x3f947b),this['_config']['onBalloonClosed']();});}['closeAll'](){for(const _0x272998 of Array['from'](this['_sourceResourceBalloons']['keys']()))this['closeSourceResourceBalloon'](_0x272998);}['isAnyResourceBalloonVisible'](){for(const _0xdd7688 of this['_sourceResourceBalloons']['values']())if(_0xdd7688['isVisible'])return!0x0;return!0x1;}updateResourceState(_0xeb9aa9,_0x190261,_0x5f1c4e){const _0x436fce=this['_sourceResourceBalloons']['get'](_0xeb9aa9);if(!_0x436fce||!_0x436fce['isVisible'])return;const _0x463e15=this['_config']['getTargetElement']();if(!_0x463e15)return;_0x436fce['pin']({'target':_0x463e15,'limiter':this['_config']['getLimiterElement']()});const _0x2ff31d=this['_getResourcesViewFromBalloon'](_0x436fce);_0x2ff31d&&_0x2ff31d['updateResourceState'](_0x190261,_0x5f1c4e);}destroy(){for(const _0x4d16dc of this['_sourceResourceBalloons']['values']())_0x4d16dc['destroy']();this['_sourceResourceBalloons']['clear']();}_createSourceResourceBalloonPanel(){const _0x3a7628=new Jt(this['_locale']);return _0x3a7628['extendTemplate']({'attributes':{'class':Ma}}),this['_bodyCollection']['add'](_0x3a7628),_0x3a7628;}_addSourceResourceContent({balloonPanel:_0x13743b,source:_0x5ee164,withBackButton:_0x5e2f80}){_0x13743b['content']['clear']();const _0x2ada56=this['_createBalloonHeader']({'balloonPanel':_0x13743b,'source':_0x5ee164,'withBackButton':_0x5e2f80});_0x13743b['content']['add'](_0x2ada56);const _0x8861b4=this['_createBalloonResourcesView'](_0x5ee164);_0x13743b['content']['add'](_0x8861b4);}_createBalloonHeader({balloonPanel:_0x147f6d,source:_0x5a0607,withBackButton:_0x57d6b0}){const _0x6147b4=new _0x105865(this['_locale'],{'label':_0x5a0607['label']});return _0x57d6b0&&_0x6147b4['children']['add'](this['_createBackButton'](_0x147f6d),0x0),_0x6147b4;}_createBackButton(_0x54d538){const _0x20d880=new _0x1a9216(this['_locale']);return _0x20d880['set']({'icon':_0x9f5b9e,'tooltip':qs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Va}),_0x20d880['on']('execute',()=>{_0x54d538['hide'](),this['_config']['onBackToContext']();}),_0x20d880;}_createBalloonResourcesView(_0x1d46e2){const _0x5a1bdf=new Pa(this['_locale'],{'source':_0x1d46e2,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x5a1bdf['on']('loadSourceResources',(_0x5e4b4f,_0x41a420)=>{this['_config']['onLoadSourceResources'](_0x41a420);}),_0x5a1bdf['on']('addResourceToContext',(_0x15aade,_0x10e4cb)=>{this['_config']['onResourceSelected'](_0x10e4cb['source'],_0x10e4cb['resource']),this['closeSourceResourceBalloon'](_0x1d46e2['id']);}),_0x5a1bdf;}_getResourcesViewFromBalloon(_0x1a06d7){const _0x685355=_0x1a06d7['content']['get'](0x1);return _0x685355 instanceof Pa?_0x685355:null;}_setupSingleResourceBalloonClickOutsideHandler(_0x58a12b){_0x314252({'emitter':_0x58a12b,'contextElements':[_0x58a12b['element']],'callback':()=>{_0x58a12b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x58a12b['isVisible']});}};const Ua=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Ba='ck-ai-chat-context-controls',Ga='ck-ai-chat-context-controls__pending-contexts',Wa='ck-ai-chat-context-controls__add-context-balloon-panel',Fa='ck-ai-chat-context-controls__add-context-button',Ka='ck-ai-chat-context-controls__url-balloon-panel',$a='ck-ai-chat-context-controls__balloon-list',Ya='ck-ai-chat-context-controls__balloon-button',qa='ck-ai-chat-context-controls__balloon-button-source',Qa='ck-ai-chat-controls-button',Xa='ck-ai-chat-context-chips-wrapper-balloon',za='ck-ai-chat-controls_context_show-more-button',ja='ck-ai-chat-context-controls__show-more-balloon-panel',Ja=[Jt['defaultPositions']['northArrowSouthWest'],Jt['defaultPositions']['northArrowSouth'],Jt['defaultPositions']['northArrowSouthEast'],Jt['defaultPositions']['southArrowNorthWest'],Jt['defaultPositions']['southArrowNorth'],Jt['defaultPositions']['southArrowNorthEast']];var Za=class extends _0x2df458{addContextButtonView;_currentContextsChips=this['createCollection']();_conversationContextsChips=this['createCollection']();['_overflowManager'];_addContextBalloonPanelView;_addContextListView;['_urlBalloonPanelView'];_urlInputView;['_resourcesBalloonView'];_addContextBalloonConfig;_hasExactlyOneSource=!0x1;bodyCollection;constructor(_0x9d27d1,_0x3b5bf6){super(_0x9d27d1),this['bodyCollection']=_0x3b5bf6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['set']('isBusy',!0x1),this['set']('hasContextOptions',!0x1),this['addContextButtonView']=this['_createAddContextButtonView'](_0x9d27d1),this['addContextButtonView']['bind']('isEnabled')['to'](this,'hasContextOptions',this,'isBusy',(_0x2c7a02,_0x485f95)=>_0x2c7a02&&!_0x485f95),this['_addContextListView']=this['_createAddContextListView'](_0x9d27d1),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x9d27d1),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x9d27d1),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x9d27d1,_0x3b5bf6);const _0x560ac8={'cssClasses':{'showMoreButton':za+'\x20'+Ar,'showMoreBalloon':ja,'overflowContainer':Xa,'controlsButton':Qa},'getLimiterElement':()=>ah(this['element'])};this['_overflowManager']=new Uo(_0x9d27d1,this['_currentContextsChips'],_0x560ac8,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(_0x2e5fd9,_0x45f85b){const _0x208e1b=this['_createContextButton'](_0x2e5fd9,'current',!0x0,_0x45f85b);this['_addContextToCollection'](_0x208e1b,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}removeContextItem(_0x3457eb){this['_removeContextFromCollection'](_0x3457eb,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3457eb,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}setContextItemLoading(_0x445305,_0x56ee1d){let _0x140853=this['_currentContextsChips']['find'](_0x5912cb=>_0x5912cb['id']===_0x445305);_0x140853||(_0x140853=this['_overflowManager']['overflowChips']['find'](_0x54eb41=>_0x54eb41['id']===_0x445305)),_0x140853&&(_0x140853['isLoading']=_0x56ee1d);}setConversationContext(_0x10aac0){this['_conversationContextsChips']['clear']();for(const _0x558fa1 of _0x10aac0){const _0x3e0f86=this['_createContextButton'](_0x558fa1,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3e0f86,this['_conversationContextsChips']);}}clearCurrentContextItems(){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}clearConversationContextItems(){this['_conversationContextsChips']['clear']();}updateResourceState(_0x5ddd39,_0x4949da,_0x260245){this['_resourcesBalloonView']['updateResourceState'](_0x5ddd39,_0x4949da,_0x260245);}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;}['hideAllBalloons'](){this['hideAddContextBalloonPanel'](),this['hideUrlBalloonPanel'](),this['_resourcesBalloonView']['closeAll']();}['_showSourceResourcesBalloon']({source:_0x17a675,withBackButton:_0x4e088e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x17a675,'withBackButton':_0x4e088e}),this['addContextButtonView']['isOn']=!0x0;}populateSourceResourceBalloon(_0x36526c,_0x4a4476,_0x14078a,_0x4e6920){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x36526c,_0x14078a,_0x4e6920);}['closeSourceResourceBalloon'](_0x3fcf95){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x3fcf95),this['addContextButtonView']['isOn']=!0x1;}setAddContextOptions(_0x35130b){this['_setBalloonPanelContent'](this['locale'],_0x35130b),this['_setAddContextButtonEnabled'](_0x35130b);}_setAddContextButtonEnabled(_0x40fec7){const _0x4e758d=!_0x40fec7['document']['isHidden']&&_0x40fec7['document']['enabled'],_0x800b5f=_0x40fec7['urls']['enabled'],_0x2d090e=_0x40fec7['files']['enabled'],_0x3d268d=_0x40fec7['sources']['length']>0x0,_0x431f45=!!_0x40fec7['customItems']?.['length'];this['hasContextOptions']=_0x4e758d||_0x800b5f||_0x2d090e||_0x3d268d||_0x431f45;}_setupTemplate(){this['setTemplate']({'tag':'div','attributes':{'class':[Ba,'ck-reset_all-excluded',this['bindTemplate']['if']('isBusy','ck-hidden')]},'children':[{'tag':'div','attributes':{'class':Ga},'children':this['_currentContextsChips']}]});}_bindEventHandlers(){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}_createAddContextButtonView(_0xd95534){const _0x2e8a63=new _0x1a9216(_0xd95534);return _0x2e8a63['set']({'label':qs(_0xd95534,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Qa+'\x20'+Fa+'\x20'+Ar+'\x20ck-button_small','icon':_0x4245d8,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2e8a63;}_createAddContextListView(_0x4a3e72){const _0x108f3a=new _0x4e6fd6(_0x4a3e72);return _0x108f3a['extendTemplate']({'attributes':{'class':$a}}),_0x108f3a;}_createAddContextBalloonPanelView(_0x559409){const _0xd13fe7=this['_createBaseBalloonPanel'](_0x559409,Wa);return _0xd13fe7['content']['add'](this['_addContextListView']),_0xd13fe7;}_createUrlBalloonPanelView(_0xa5bfdf){const _0x279df8=this['_createBaseBalloonPanel'](_0xa5bfdf,Ka);return this['_addUrlContent'](_0x279df8,_0xa5bfdf),_0x279df8;}_createResourcesBalloonView(_0x4fc8d9,_0x18b5f3){const _0x4fd25c={'searchInputVisibleFrom':_0x18b5f3['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});},'onResourceSelected':(_0x412477,_0x3c56a6)=>{this['fire']('addResourceToContext',{'source':_0x412477,'resource':_0x3c56a6});},'onLoadSourceResources':_0x39a186=>{this['fire']('loadSourceResources',_0x39a186);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>ah(this['element']),'getTargetElement':()=>this['addContextButtonView']['element']};return new Ha(_0x4fc8d9,_0x18b5f3['bodyCollection'],_0x4fd25c);}_createBaseBalloonPanel(_0x1085c6,_0x3046f2){const _0x3ff81e=new Jt(_0x1085c6);return _0x3ff81e['extendTemplate']({'attributes':{'class':_0x3046f2}}),this['bodyCollection']['add'](_0x3ff81e),_0x3ff81e;}_setBalloonPanelContent(_0x15e769,_0xd241de){if(this['_addContextListView']['items']['clear'](),!_0xd241de['document']['isHidden']&&_0xd241de['document']['enabled']){const _0x57983e=this['_createBalloonButton'](_0x15e769,{'label':qs(_0x15e769,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5e85dd});_0x57983e['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),this['_addBalloonListItem'](_0x15e769,_0x57983e);}if(_0xd241de['urls']['enabled']){const _0x46ae63=this['_createBalloonButton'](_0x15e769,{'label':qs(_0x15e769,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3bcbd8});_0x46ae63['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_urlInputView']['focus']();}),this['_addBalloonListItem'](_0x15e769,_0x46ae63);}if(_0xd241de['files']['enabled']){const _0x14b363=new _0x193b34(_0x15e769);_0x14b363['set']({'label':qs(_0x15e769,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x43cd6e,'withText':!0x0,'tooltip':!0x0,'class':Ya,'allowMultipleFiles':!0x0}),_0x14b363['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x14b363['on']('done',(_0x177ab6,_0x12c680)=>{this['fire']('addFileToContext',_0x12c680);}),_0x14b363['tooltip']=!0x0,this['_addBalloonListItem'](_0x15e769,_0x14b363);}for(const _0x13eef9 of _0xd241de['sources']){const _0x5892a8=this['_createBalloonButton'](_0x15e769,{'label':_0x13eef9['label'],'icon':_0x13eef9['icon']||_0x1052b8,'type':'source'});this['_addBalloonListItem'](_0x15e769,_0x5892a8),_0x5892a8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x13eef9,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3c125d of _0xd241de['customItems']||[]){const _0x866274=this['_createBalloonButton'](_0x15e769,{'label':_0x3c125d['label'],'icon':_0x3c125d['icon']||_0x1052b8,'type':'customItem'});this['_addBalloonListItem'](_0x15e769,_0x866274),_0x866274['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3c125d);});}this['_hasExactlyOneSource']=0x1===this['_addContextListView']['items']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}_addBalloonListItem(_0x1835f9,_0x34cd28){const _0xa1cd7c=new _0xf665cb(_0x1835f9);_0xa1cd7c['children']['add'](_0x34cd28),this['_addContextListView']['items']['add'](_0xa1cd7c);}_getBalloonListButton(_0x3a0609){return this['_addContextListView']['items']['get'](_0x3a0609)?.['children']['first'];}_addUrlContent(_0x100ba2,_0xc77ae2){this['_urlInputView']=new ba(_0xc77ae2),this['_urlInputView']['on']('submitUrl',(_0x456aef,_0x3422f2)=>{this['_handleUrlSubmit'](_0x3422f2);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja});}),_0x100ba2['content']['add'](this['_urlInputView']);}_createBalloonButton(_0x1c8495,_0x37ca54){const _0x5af5eb='source'===_0x37ca54['type']?new th(_0x1c8495):new _0x4bbb4c(_0x1c8495);return _0x5af5eb['set']({'label':_0x37ca54['label'],'icon':_0x37ca54['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Ya}),_0x5af5eb;}_setupAllBalloonClickOutsideHandlers(){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}_setupUrlBalloonClickOutsideHandler(){_0x314252({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}_toggleAddContextBalloon(_0x96d800){const _0x12cb16=this['_addContextBalloonConfig'];_0x12cb16['buttonView']['isOn']=_0x96d800,_0x96d800?_0x12cb16['balloonView']['show']():_0x12cb16['balloonView']['hide']();}_setupAddContextBalloonClickOutsideHandler(){const {balloonView:_0x169e29,buttonView:_0x311825,hideMethod:_0x29c30c}=this['_addContextBalloonConfig'];_0x314252({'emitter':_0x169e29,'contextElements':[_0x169e29['element'],_0x311825['element']],'callback':()=>{_0x29c30c();},'activator':()=>_0x311825['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}_createContextButton(_0x5cfff1,_0x808e43,_0x466daa=!0x1,_0xbfa3ea=!0x1){const _0x10445f='conversation'===_0x808e43||!0x0===_0x5cfff1['isReadOnly'],_0x3bd468=new Po(this['locale'],_0x5cfff1,_0x10445f,_0x466daa,_0xbfa3ea);return _0x10445f||_0x3bd468['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3bd468['id']);}),_0x3bd468;}_addContextToCollection(_0x2e35dd,_0xf83944){_0xf83944['add'](_0x2e35dd,0x0);}_removeContextFromCollection(_0x321d55,_0x247427){const _0x3840aa=_0x247427['find'](_0x585f51=>_0x585f51['id']===_0x321d55);_0x3840aa&&_0x247427['remove'](_0x3840aa);}_handleAddContextButtonClick(){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':ah(this['element']),'positions':Ja}),this['_hasExactlyOneSource']&&this['_getBalloonListButton'](0x0)?.['fire']('execute'));}_handleUrlSubmit(_0x5c067b){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5c067b);}},th=class extends _0x4bbb4c{['arrowView'];constructor(_0x3fc0cc){super(_0x3fc0cc),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[qa]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x564a12=new _0x5e3c18();return _0x564a12['content']=_0x4e5c52,_0x564a12['extendTemplate']({'attributes':{'class':qa+'__arrow'}}),_0x564a12;}},eh=class extends _0x2df458{_contextPanelView;_promptInputView;['_dropZoneView'];_promptCapabilitiesView;['_modelUnavailableMessageView'];['_filesEnabled'];constructor(_0x247c38,_0x1b79b6){super(_0x247c38),this['_filesEnabled']=_0x1b79b6['filesEnabled'],this['_contextPanelView']=this['_createContextPanelView'](_0x247c38,{'bodyCollection':_0x1b79b6['bodyCollection'],'searchInputVisibleFrom':_0x1b79b6['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x247c38),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x247c38),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x247c38),this['_dropZoneView']=new oa(_0x247c38),this['_promptInputView']['delegate']('sendUserMessage','promptInputPaste','abortPromptStream')['to'](this),this['_promptInputView']['bind']('isBusy')['to'](this,'isBusy'),this['_contextPanelView']['bind']('isBusy')['to'](this,'isBusy'),this['_promptCapabilitiesView']['bind']('isBusy')['to'](this,'isBusy'),this['_dropZoneView']['delegate']('promptInputPaste')['to'](this),this['_dropZoneView']['on']('dragEnter',()=>this['_contextPanelView']['hideAllBalloons']()),this['_dropZoneView']['bind']('isEnabled')['to'](this,'isBusy',_0x2f8ee8=>!_0x2f8ee8),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Ua)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1),this['set']('isLoadingSkeletonVisible',!0x1);const _0x45e1a7=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x45e1a7['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x45e1a7['if']('isModelAvailable','ck-hidden',_0x5f5841=>!_0x5f5841),_0x45e1a7['if']('isLoadingSkeletonVisible','ck-ai-chat-controls__content_covered')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x45e1a7['if']('isModelAvailable','ck-hidden',_0x1376e4=>_0x1376e4)]},'children':[this['_modelUnavailableMessageView']]},this['_dropZoneView'],this['_createSkeletonView']()]});}['render'](){super['render'](),this['_filesEnabled']&&this['_dropZoneView']['attach'](this['element']);}_createContextPanelView(_0x39aee7,_0x140c9b){return new Za(_0x39aee7,_0x140c9b);}_createPromptInputView(_0x307911){return new ra(_0x307911,this['_contextPanelView']['addContextButtonView']);}_createPromptCapabilitiesView(_0x1d1f18){return new Ca(_0x1d1f18);}_createSkeletonView(){const _0x113db1=new lo(this['locale'],uo['aiChatControls']);return _0x113db1['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x113db1;}_createModelUnavailableMessageView(_0x2821af){const _0xd38e68=new ih(_0x2821af);return _0xd38e68['delegate']('startConversation')['to'](this),_0xd38e68;}addContextItem(_0x318d36,_0x518a59){this['_contextPanelView']['addContextItem'](_0x318d36,_0x518a59);}removeContextItem(_0x910984){this['_contextPanelView']['removeContextItem'](_0x910984);}setContextItemLoading(_0x55698e,_0x382720){this['_contextPanelView']['setContextItemLoading'](_0x55698e,_0x382720);}setIsUploadInProgress(_0x327ceb){this['_promptInputView']['setIsUploadInProgress'](_0x327ceb);}setConversationContext(_0x351e4e){this['_contextPanelView']['setConversationContext'](_0x351e4e);}clearPendingContextUI(){this['_contextPanelView']['clearCurrentContextItems']();}clearConversationContextUI(){this['_contextPanelView']['clearConversationContextItems']();}updateResourceState(_0x20f55a,_0x1e1800,_0x35ae08){this['_contextPanelView']['updateResourceState'](_0x20f55a,_0x1e1800,_0x35ae08);}setWebSearch(_0x4538cf){this['_promptCapabilitiesView']['setWebSearch'](_0x4538cf);}setReasoning(_0x1e316c){this['_promptCapabilitiesView']['setReasoning'](_0x1e316c);}resetMessageInput(){this['_promptInputView']['reset']();}setAddContextOptions(_0xf9d377){this['_contextPanelView']['setAddContextOptions'](_0xf9d377);}setInputPlaceholder(_0x1c0ce5){this['_promptInputView']['setPlaceholderText'](_0x1c0ce5);}setModelList(_0xf3dc0d,_0x335a52){this['_promptCapabilitiesView']['setModelList'](_0xf3dc0d,_0x335a52);}setModel(_0x1905e7){_0x1905e7?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x1905e7)):this['isModelAvailable']=!0x1;}enableModelSelector(){this['_promptCapabilitiesView']['enableModelSelector']();}disableModelSelector(_0x312e4a){this['_promptCapabilitiesView']['disableModelSelector'](_0x312e4a);}populateSourceResourceBalloon(_0x49ff2a,_0x267bd8,_0x1b0094,_0x2880ee){this['_contextPanelView']['populateSourceResourceBalloon'](_0x49ff2a,_0x267bd8,_0x1b0094,_0x2880ee);}['closeSourceResourceBalloon'](_0x458e18){this['_contextPanelView']['closeSourceResourceBalloon'](_0x458e18);}focusPromptInput(_0x29ea1=!0x1){this['_promptInputView']['focus'](_0x29ea1);}setPromptInputValue(_0x3c6083){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3c6083;}},ih=class extends _0x2df458{constructor(_0x35ad98){super(_0x35ad98);const _0x44472e=new _0x1a9216(_0x35ad98);_0x44472e['set']({'label':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x44472e['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':qs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x44472e]}]});}},sh=class extends _0x105865{resizeButton;constructor(_0x3a3d5f,_0x57824b){super(_0x3a3d5f,{'label':_0x57824b['label'],'class':'ck-ai-header\x20'+_0x57824b['class'],'icon':_0x57824b['icon']}),this['set']('isMaximized',!0x1),this['set']('isLoadingSkeletonVisible',!0x1),this['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-ai-header_loading')]}}),_0x57824b['content']&&this['children']['add'](_0x57824b['content']),_0x57824b['showResizeButton']&&(this['resizeButton']=Tr(_0x3a3d5f,this),this['children']['add'](this['resizeButton']));}},nh=class extends _0x2df458{constructor(_0x5d4322){super(_0x5d4322),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':qs(_0x5d4322,'AI_DISCLAIMER_TEXT')}]}]});}};function rh(_0x1d2263,_0xfc53da){const _0x53e08d=new _0x1a9216(_0x1d2263);return _0x53e08d['set']({'label':qs(_0x1d2263,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x293553,'class':'ck-ai-chat__start-conversation\x20ck-button_small\x20'+Ir}),_0x53e08d['on']('execute',()=>{_0xfc53da['fire']('startConversation');}),_0x53e08d;}const oh='ck-ai-chat';function ah(_0x2531b9){return _0x2531b9?.['closest']('.'+oh)||null;}var hh=class extends _0x2df458{chatHeader;chatFeed;chatControls;chatDisclaimer;constructor(_0x108473,_0x28ea67){super(_0x108473);const _0x4c5697=rh(_0x108473,this);this['chatHeader']=new sh(_0x108473,{'label':qs(_0x108473,'AI_CHAT_HEADING'),'icon':_0x2024d5,'class':'ck-ai-header_chat','content':_0x4c5697,'showResizeButton':_0x28ea67['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new ea(_0x108473,_0x28ea67['bodyCollection']),this['chatFeed']['delegate'](...Yr)['to'](this),this['chatControls']=new eh(_0x108473,{'bodyCollection':_0x28ea67['bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x28ea67['contextResourcesSearchInputVisibleFrom'],'filesEnabled':_0x28ea67['filesEnabled']}),this['chatControls']['delegate'](...Yr)['to'](this),this['chatControls']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatHeader']['bind']('isLoadingSkeletonVisible')['to'](this['chatFeed']),this['chatDisclaimer']=new nh(_0x108473),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all',oh,'ck-rounded-corners'],'dir':_0x108473['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}populateSourceResourceBalloon(_0x4b6a64,_0x53f7ad,_0x70f5c7,_0x154b9b){this['chatControls']['populateSourceResourceBalloon'](_0x4b6a64,_0x53f7ad,_0x70f5c7,_0x154b9b);}['closeSourceResourceBalloon'](_0x4e202d){this['chatControls']['closeSourceResourceBalloon'](_0x4e202d);}},ch=class extends _0x4cd5fc{static get requires(){return[Ks];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}feedItemRenderingStrategy='streaming';['showDiff']=!0x0;['_promiseQueue'];_interactionPromiseResolver;_titleAnimationInterval=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;get['idleUiPromise'](){return this['_promiseQueue']['queueEmptyPromise'];}constructor(_0x220a29){super(_0x220a29);const _0x56be23=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['set']('isChatStreaming',!0x1),this['_promiseQueue']=new Ao(),this['_view']=new hh(this['context']['locale'],{'bodyCollection':_0x56be23['bodyCollection'],'showResizeButton':_0x56be23['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom'),'filesEnabled':!0x1!==this['context']['config']['get']('ai.chat.context.files.enabled')}),this['_view']['delegate']('resizeTabs')['to'](_0x56be23),this['_view']['delegate'](...Yr)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x361eea,{showDiff:_0x550440})=>{this['showDiff']=_0x550440;}),this['disableControls'](),this['toggleLoadingSkeleton'](!0x0,'init'),_0x56be23['view']['addTab']({'id':'chat','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x2024d5,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x56be23['view'],'isMaximized',_0x4da277=>_0x4da277),this['_view']['chatControls']['bind']('isBusy')['to'](this,'isChatStreaming',_0x4fe16c=>_0x4fe16c),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}destroy(){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}createConversation({availableModels:_0x137d68}){const _0x2b46dc=this['context']['config']['get']('ai.chat.welcomeMessage')??qs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x137d68,!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x2b46dc}),this['fire']('conversationCreated');}async addFeedItemStaticMessage({id:_0x4b6519,staticMessage:_0x4b7bc9}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4b6519,'initialContent':'<p>'+_0x4b7bc9+'</p>'});});}async addFeedItemUserMessage(_0x27df2c){const _0xba6fda=_0x27df2c['attributes']?.['displayedPrompt']||_0x27df2c['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x27df2c['contextItems']['values']()),'initialContent':'<p>'+_0xba6fda+'</p>','id':_0x27df2c['id']});});}async addFeedItemError({errorMessage:_0x57258e,id:_0x1e7a27}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x57258e+'</p>','id':_0x1e7a27});});}async addFeedItemAIReply(_0x51ab1c){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x51ab1c['interactionId']+':'+_0x51ab1c['id']}),this['clearLoadingMessage']();});}async addFeedItemAISuggestion(_0x5e20a6){const _0x207fd5=Zs(this['context']),_0x15ba52=_0x207fd5['map'](_0x3e8f8e=>_0x3e8f8e['config']['get']('ai.availableReplyActions')||[...po]);let _0x4b3bf0=_0x15ba52['reduce']((_0x118195,_0xd3120d)=>_0x118195['filter'](_0x405195=>_0xd3120d['includes'](_0x405195)),_0x15ba52[0x0]||[...po]);const _0x3308e4=_0x207fd5['every'](_0x20dfbb=>_0x20dfbb['plugins']['has']('TrackChanges')),_0x4ba95a=_0x207fd5['map'](_0x5e93d3=>_0x5e93d3['commands']['get']('trackChanges'));return _0x3308e4?this['_isTrackChangesCommandValueBound']||(this['_isTrackChangesCommandValueBound']=!0x0,this['_view']['chatFeed']['bind']('isTrackChangesOn')['toMany'](_0x4ba95a,'value',(..._0x34146e)=>_0x34146e['some'](_0x45eb91=>_0x45eb91))):_0x4b3bf0=_0x4b3bf0['filter'](_0x4a393e=>'insertSuggestion'!=_0x4a393e),this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x5e20a6['interactionId']+':'+_0x5e20a6['id'],'areActionsDisabled':_0x5e20a6['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4b3bf0}),this['clearLoadingMessage']();});}async addFeedInteractionHeader(_0x55661c,_0x28c0f5){return this['_promiseQueue']['enqueue'](async()=>{const _0x4bc371=this['_view']['chatFeed']['children']['last'];if(_0x4bc371 instanceof Qo)return this['_view']['chatFeed']['children']['remove'](_0x4bc371),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x55661c['id'],'capabilities':{'isWebSearchEnabled':_0x4bc371['capabilities']['isWebSearchEnabled']||_0x28c0f5['isWebSearchEnabled'],'isReasoningEnabled':_0x4bc371['capabilities']['isReasoningEnabled']||_0x28c0f5['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x55661c['id'],'capabilities':_0x28c0f5});});}async addFeedItemCustomElement(_0x56e46c,_0x578eff){let _0x586971;return await this['_promiseQueue']['enqueue'](async()=>{_0x586971=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x56e46c,'id':_0x578eff});}),_0x586971;}removeFeedItem(_0x2ed51a){this['_view']['chatFeed']['removeItem'](_0x2ed51a);}hasFeedItem(_0xafdf60){return this['_view']['chatFeed']['hasItem'](_0xafdf60);}updateFeedInteractionHeader(_0x1b6a19){const _0x9c9cb9=this['_view']['chatFeed']['children']['find'](_0x3ff435=>_0x3ff435['options']['id']==_0x1b6a19['id']&&_0x3ff435 instanceof Qo);_0x9c9cb9&&_0x9c9cb9['set']('isVisible',_0x1b6a19['isVisible']);}async updateFeedItemAIReplyContent(_0x4024fd){const _0x45b9f2=_0x4024fd['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4290cf=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x4024fd,'abortSignal':_0x4290cf,'renderingStrategy':_0x45b9f2}),_0x4024fd['isDone']&&this['markFeedItemAsDone'](_0x4024fd['id']);});}updateFeedItemAIReplySources(_0x1dde72,_0x596f36){this['_view']['chatFeed']['updateWebSources'](_0x1dde72,_0x596f36);}async updateFeedItemAIReplySuggestionContent(_0x26e949){return this['_promiseQueue']['enqueue'](async _0x4de266=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x26e949,'abortSignal':_0x4de266}),_0x26e949['isDone']&&this['markFeedItemAsDone'](_0x26e949['id']);});}updateFeedItemAIReplySuggestionPartState(_0x1875b6){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1875b6);}setSuggestionGating(_0x3dcb54,_0x353d82){this['_view']['chatFeed']['updateSuggestionGating'](_0x3dcb54,_0x353d82);}setFeedItemAIReplySuggestionPartActive(_0x1e91ad){this['_view']['chatFeed']['setSuggestionPartActive'](_0x1e91ad);}getFeedItemAIReplySuggestionPartUIIndex(_0x45e4bc){return this['_view']['chatFeed']['getSuggestionPartUIIndex'](_0x45e4bc);}markFeedItemAsDone(_0x4f251c){this['_view']['chatFeed']['markItemAsDone'](_0x4f251c);}removeFeedInteraction(_0x2da4b2){this['_view']['chatFeed']['getItemIds']()['filter'](_0x8ef9d8=>_0x8ef9d8['startsWith'](_0x2da4b2))['forEach'](_0x2d9f0=>this['_view']['chatFeed']['removeItem'](_0x2d9f0));}startInteraction(){const _0x103eec=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x103eec),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['isChatStreaming']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}stopInteraction(_0x2dd897){this['_promiseQueue']['abort'](),_0x2dd897&&this['_view']['chatFeed']['getItemIds']()['filter'](_0x57fb12=>_0x57fb12['startsWith'](_0x2dd897['id']))['forEach'](_0x120842=>this['markFeedItemAsDone'](_0x120842)),this['resetChatBusyStateToIdle']();}resetChatBusyStateToIdle(){this['isBusy']=!0x1,this['isChatStreaming']=!0x1,this['clearLoadingMessage'](),this['_view']['chatFeed']['stopAutoScroll']();}async finishInteraction(){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['resetChatBusyStateToIdle']();});}addContextItem(_0x2e3f9c,_0x23c7a3){this['_view']['chatControls']['addContextItem'](_0x2e3f9c,_0x23c7a3);}removeContextItem(_0x29d9dd){this['_view']['chatControls']['removeContextItem'](_0x29d9dd);}setContextItemLoading(_0xbacd39,_0xde5b9a){this['_view']['chatControls']['setContextItemLoading'](_0xbacd39,_0xde5b9a);}setIsUploadInProgress(_0x4a410a){this['_view']['chatControls']['setIsUploadInProgress'](_0x4a410a);}setConversationContext(_0x320a26){this['_view']['chatControls']['setConversationContext'](_0x320a26);}clearPendingContextUI(){this['_view']['chatControls']['clearPendingContextUI']();}clearConversationContextUI(){this['_view']['chatControls']['clearConversationContextUI']();}updateResourceState(_0x3ce1a1,_0x1a7dd8,_0x104216){this['_view']['chatControls']['updateResourceState'](_0x3ce1a1,_0x1a7dd8,_0x104216);}resetMessageInput(){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}setAddContextOptions(_0x16f053){this['_view']['chatControls']['setAddContextOptions'](_0x16f053);}updateCapabilities(_0x53753d){this['_view']['chatControls']['setWebSearch'](_0x53753d['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x53753d['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x53753d));}setSelectedModel(_0xd011f3,_0x3f5220){this['_view']['chatControls']['setModel'](_0xd011f3),_0x3f5220&&this['_view']['chatControls']['disableModelSelector'](!0x1);}setFeedItemRenderingStrategy(_0x4d5010){this['feedItemRenderingStrategy']=_0x4d5010;}toggleLoadingSkeleton(_0x5b7f4e,_0x25e5e9='conversation'){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5b7f4e,_0x25e5e9);}resetConversationTitle(){this['setConversationTitle'](qs(this['context']['locale'],'AI_CHAT_HEADING'));}emptyConversationTitle(){this['setConversationTitle']('');}setConversationTitle(_0x1ccd85,_0x1f9215=!0x1){if(clearInterval(this['_titleAnimationInterval']),_0x1f9215&&!ft()&&_0x1ccd85['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1ccd85);this['_view']['chatHeader']['label']=_0x1ccd85;}setLoadingMessage(_0x533176){this['_view']['chatFeed']['setLoadingMessage'](_0x533176);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}_animateConversationTitle(_0x542e8f){let _0x561e46=0x0;this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x542e8f[_0x561e46],_0x561e46++,_0x561e46===_0x542e8f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x2c6d08){return _0x2c6d08['isWebSearchEnabled']&&_0x2c6d08['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2c6d08['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2c6d08['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):qs(this['context']['locale'],'AI_CHAT_IS_WRITING');}_getInputPlaceholder(_0x6864d7){return _0x6864d7?_0x6864d7['isWebSearchEnabled']&&_0x6864d7['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x6864d7['isWebSearchEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x6864d7['isReasoningEnabled']?qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):qs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}populateSourceResourceBalloon(_0x5dee2b,_0x1e326b,_0x5eb107,_0x46bf66){this['_view']['populateSourceResourceBalloon'](_0x5dee2b,_0x1e326b,_0x5eb107,_0x46bf66);}['closeSourceResourceBalloon'](_0x1d4d8b){this['_view']['closeSourceResourceBalloon'](_0x1d4d8b);}setPromptInputValue(_0x2a350c){this['_view']['chatControls']['setPromptInputValue'](_0x2a350c);}focusPromptInput(_0x208c40=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x208c40);}scrollFeedToSuggestion(_0x1e8d21,_0x4290fb){this['_view']['chatFeed']['scrollToSuggestion'](_0x1e8d21,_0x4290fb);}startAutoScroll(_0x5c3016={}){this['_view']['chatFeed']['startAutoScroll'](_0x5c3016);}stopAutoScroll(){this['_view']['chatFeed']['stopAutoScroll']();}disableControls(){this['_view']['chatControls']['isDisabled']=!0x0;}enableControls(){this['_view']['chatControls']['isDisabled']=!0x1;}toggleConversationLoading(_0x30d1c3){_0x30d1c3?(this['isBusy']=_0x30d1c3,this['disableControls']()):(this['enableControls'](),this['resetChatBusyStateToIdle']());}},lh=class extends _0x4e6fd6{sections;constructor(_0x185a22,_0x276289){super(_0x185a22),this['sections']=_0x276289,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}filter(_0x2598f1){let _0x18c4b2=0x0,_0x21aee5=0x0;for(const _0x10eccb of this['sections']){const {resultsCount:_0x21d781,totalItemsCount:_0x9c93ae}=_0x10eccb['filter'](_0x2598f1);_0x18c4b2+=_0x21d781,_0x21aee5+=_0x9c93ae;}return{'resultsCount':_0x18c4b2,'totalItemsCount':_0x21aee5};}},uh=class extends _0xf665cb{title;itemsViews;_itemsListView;constructor(_0x559d5d,{title:_0x39cebf,items:_0x2e479b}){super(_0x559d5d);const _0x2e7c05=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x39cebf,this['itemsViews']=_0x2e479b;const _0x3128d9=new _0x2df458(_0x559d5d);_0x3128d9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x4e6fd6(_0x559d5d),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2e7c05['if']('isVisible','ck-hidden',_0x515fa3=>!_0x515fa3)]},'children':[_0x3128d9,this['_itemsListView']]});}filter(_0x2bd3e1){const _0x595f66=this['itemsViews']['length'];let _0x16216c=0x0;for(const _0x16ec7a of this['itemsViews'])_0x2bd3e1?(_0x16ec7a['isVisible']=!!_0x16ec7a['isMatching'](_0x2bd3e1),_0x16ec7a['highlightText'](_0x2bd3e1)):(_0x16ec7a['isVisible']=!0x0,_0x16ec7a['highlightText'](null)),_0x16ec7a['isVisible']&&_0x16216c++;return this['isVisible']=_0x16216c>0x0,{'resultsCount':_0x16216c,'totalItemsCount':_0x595f66};}getItem(_0x457c44){return this['itemsViews']['find'](_0x16109b=>_0x16109b['id']===_0x457c44);}removeItem(_0x4384f6){const _0x40ecac=this['itemsViews']['indexOf'](_0x4384f6);-0x1!==_0x40ecac&&(this['itemsViews']['splice'](_0x40ecac,0x1),this['_itemsListView']['items']['remove'](_0x4384f6));}};const dh=/* #__PURE__ -- @preserve */
|
|
34
|
+
_0x15c985(_0xf665cb);var _h=class AIChatHistoryListItemView extends dh{['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(_0x1a887a,_0x38b493){super(_0x1a887a);const _0x3c32e3=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x38b493['pinned']),this['set']('loadingState',null),this['set']('title',_0x38b493['title']),this['id']=_0x38b493['id'];const {createdAt:_0x44bf6a,active:_0x3663a3=!0x1}=_0x38b493;this['_titleView']=new _0x2d3d45(),this['_titleView']['bind']('text')['to'](this,'title'),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x50bd6a=this['_createCheckView'](),_0x416ba4=this['_createPinButtonView'](_0x1a887a),_0x463e9f=this['_createMenuDropdownView'](),_0x1b94f8=this['_createEditInputView'](_0x1a887a),_0x38e907=this['_createAcceptEditButtonView'](_0x1a887a,_0x1b94f8),_0x201179=this['_createCancelEditButtonView'](_0x1a887a);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x416ba4),this['actions']['add'](_0x463e9f),this['on']('change:isEdit',(_0x3b0b23,_0xc3c177,_0x46f5f4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x46f5f4?(this['actions']['add'](_0x38e907),this['actions']['add'](_0x201179),this['mainContent']['add'](_0x1b94f8),_0x1b94f8['element']['value']=this['title']||'',_0x1b94f8['element']['focus']()):(this['actions']['add'](_0x416ba4),this['actions']['add'](_0x463e9f),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3663a3?'ck-ai-chat-history__item--active':'',_0x3c32e3['if']('isVisible','ck-hidden',_0x4b21ee=>!_0x4b21ee),_0x3c32e3['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',_0x3c32e3['if']('loadingState','ck-hidden',_0xe1f3d8=>!!_0xe1f3d8)]},'children':_0x3663a3?[_0x50bd6a]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x3c32e3['if']('loadingState','ck-hidden',_0x19a55=>!_0x19a55)]},'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-container',_0x3c32e3['if']('loadingState','ck-hidden',_0x401ad5=>!!_0x401ad5)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x3c32e3['if']('loadingState','ck-hidden',_0x4156fd=>!_0x4156fd)]},'children':[{'text':_0x3c32e3['to']('loadingState',_0x3aa2f7=>_0x3aa2f7?qs(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x3aa2f7]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x44bf6a]}]},{'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(_0x38cfee){this['set']('title',_0x38cfee);}updateLoadingState(_0x193d55,_0x466eeb){this['set']('loadingState',_0x466eeb?_0x193d55:null);}_createCheckView(){const _0x2ff775=new _0x5e3c18();return _0x2ff775['set']({'content':_0x42448e}),_0x2ff775;}_createPinButtonView(_0x3ab60f){const _0x4e1375=new _0x1a9216(_0x3ab60f);return _0x4e1375['set']({'label':qs(_0x3ab60f,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5ad74f,'withText':!0x1,'tooltip':!0x0,'class':Er}),_0x4e1375['bind']('isOn')['to'](this,'pinned'),_0x4e1375['on']('execute',()=>{const _0x36abdc=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x36abdc});}),_0x4e1375;}_createMenuDropdownView(){const _0x40c0ae=_0x4c754a(this['locale']),_0x30982e=_0x40c0ae['panelView']['children'];_0x40c0ae['buttonView']['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':ht,'class':Er}),_0x40c0ae['panelPosition']='sw';const _0x31f8c0=new _0x1a9216(this['locale']);_0x31f8c0['label']=qs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x31f8c0['icon']=_0x4e1016,_0x31f8c0['withText']=!0x0,_0x31f8c0['on']('execute',()=>{this['isEdit']=!0x0;});const _0x400c93=new _0x1a9216(this['locale']);_0x400c93['label']=qs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x400c93['icon']=_0x173e6f,_0x400c93['withText']=!0x0,_0x400c93['on']('execute',()=>{this['showConfirm'](qs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x56f710=new _0x4e6fd6(this['locale']),_0x144b80=new _0xf665cb(this['locale']);_0x144b80['children']['add'](_0x31f8c0);const _0x56cba1=new _0xf665cb(this['locale']);return _0x56cba1['children']['add'](_0x400c93),_0x56f710['items']['addMany']([_0x144b80,_0x56cba1]),_0x30982e['add'](_0x56f710),_0x40c0ae;}_createEditInputView(_0x2abce7){const _0x30970d=new _0x3a21ad(_0x2abce7),_0xa4f96b=_0x30970d['bindTemplate'];return _0x30970d['extendTemplate']({'on':{'keydown':_0xa4f96b['to'](_0x149b08=>{'Enter'==_0x149b08['key']&&this['_commitEditInputValue'](_0x30970d);})}}),_0x30970d;}_createAcceptEditButtonView(_0x7893cd,_0x4a92c2){const _0x298e61=new _0x1a9216(_0x7893cd);return _0x298e61['set']({'icon':_0x42448e,'withText':!0x1,'tooltip':qs(_0x7893cd,'AI_CHAT_HISTORY_ACCEPT'),'class':Er}),_0x298e61['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x298e61['on']('execute',()=>{this['_commitEditInputValue'](_0x4a92c2);}),_0x298e61;}_commitEditInputValue(_0x1167fd){const _0x18ef2b=_0x1167fd['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x18ef2b});}_createCancelEditButtonView(_0x206637){const _0x2fe53c=new _0x1a9216(_0x206637);return _0x2fe53c['set']({'icon':_0x29be46,'withText':!0x1,'tooltip':qs(_0x206637,'AI_CHAT_HISTORY_CANCEL'),'class':Er}),_0x2fe53c['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2fe53c['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x2fe53c;}_createSpinnerView(){const _0x252f3f=new So('small');return _0x252f3f['isVisible']=!0x0,_0x252f3f;}isMatching(_0x592f76){return'string'==typeof this['title']&&this['title']['match'](_0x592f76)?{'title':!0x0}:null;}highlightText(_0x36b4eb){this['_titleView']['highlightText'](_0x36b4eb);}},gh=class extends _0x2df458{['headerView'];['searchView'];['mainErrorView'];skeletonView;emptyView;sectionsView;constructor(_0x21255d,_0xe03038){super(_0x21255d),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x229c98=rh(_0x21255d,this);this['headerView']=new sh(_0x21255d,{'label':qs(_0x21255d,'AI_CHAT_HISTORY_HEADING'),'icon':_0x23e734,'class':'ck-ai-header_history','content':_0x229c98,'showResizeButton':_0xe03038}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new lh(_0x21255d,[]),this['sectionsView']['delegate'](...Ih)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x5e37ea=>!_0x5e37ea)]}}),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':[this['headerView'],{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['mainErrorView'],this['emptyView'],this['searchView']]}]});}_updateViewVisibility(){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'],this['isMainErrorViewVisible']=!this['isSearchViewVisible']&&!!this['errorMessage'];}_createSearchView(){const _0xfee83b=new _0x2750eb(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x43c270=>qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x43c270),'secondary':qs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x22d94e=this['_createErrorView']();return _0x22d94e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x689c80=>!_0x689c80)]}}),_0xfee83b['on']('render',()=>{_0xfee83b['children']['add'](_0x22d94e,0x1);}),_0xfee83b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x6049e4=>!_0x6049e4)]}}),_0xfee83b;}_createSkeletonView(){const _0x3b807f=new lo(this['locale'],uo['aiHistory']);return _0x3b807f['bind']('isVisible')['to'](this,'isLoading'),_0x3b807f;}_createErrorView(){const _0x49b14c=new _0x2df458(this['locale']),_0x10c9f2=new _0x1a9216(this['locale']);_0x10c9f2['set']({'withText':!0x1,'icon':_0x29be46,'class':'ck-ai-notification_error__dismiss-button'}),_0x10c9f2['bind']('isVisible')['to'](this,'hasItems',_0x587157=>!!_0x587157),_0x10c9f2['on']('execute',()=>{this['errorMessage']='';});const _0x35afcd=this['bindTemplate'];return _0x49b14c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x35afcd['to']('errorMessage')}]},_0x10c9f2]}),_0x49b14c;}_createEmptyStateView(){const _0x4035c5=new _0x2df458(this['locale']);return _0x4035c5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3601b3=>!_0x3601b3)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[qs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x4035c5;}_createListItemViews(_0x13d38c,_0x1acabf){const _0x23de8a=[];for(const _0x2f567f of _0x13d38c){const _0x1aa382=new _h(_0x1acabf,_0x2f567f);_0x1aa382['delegate'](...Ih)['to'](this),_0x23de8a['push'](_0x1aa382);}return _0x23de8a;}updateHistoryItemsWithCategories(_0x492f5b){const _0x142d9c=this['locale']||'en',_0x562c49=[];for(const _0x4e0d37 of _0x492f5b){const _0x58e7bf=this['_createListItemViews'](_0x4e0d37['items'],_0x142d9c);_0x562c49['push'](new uh(_0x142d9c,{'title':_0x4e0d37['title'],'items':_0x58e7bf}));}this['sectionsView']['sections']=_0x562c49,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x562c49),this['hasItems']=_0x492f5b['some'](_0x3cb22f=>_0x3cb22f['items']['length']>0x0),this['_refreshSearch']();}removeHistoryItem(_0x492fa4){for(const _0x875f60 of this['sectionsView']['sections']){const _0x555a25=_0x875f60['getItem'](_0x492fa4);if(_0x555a25){if(_0x875f60['removeItem'](_0x555a25),0x0===_0x875f60['itemsViews']['length']){const _0x63172=this['sectionsView']['sections']['indexOf'](_0x875f60);-0x1!==_0x63172&&(this['sectionsView']['sections']['splice'](_0x63172,0x1),this['sectionsView']['items']['remove'](_0x875f60));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}updateItemTitle(_0x21feee,_0x4f5ebb){for(const _0x229bff of this['sectionsView']['sections']){const _0x546731=_0x229bff['getItem'](_0x21feee);if(_0x546731){_0x546731['updateTitle'](_0x4f5ebb);break;}}}updateItemLoadingState(_0x44bf33,_0x503be5,_0x455e98){for(const _0x22467d of this['sectionsView']['sections']){const _0x1acee7=_0x22467d['getItem'](_0x44bf33);if(_0x1acee7){_0x1acee7['updateLoadingState'](_0x503be5,_0x455e98);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3b7dda=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3b7dda);}}};const Ih=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];var Ah=class extends _0x4cd5fc{static get requires(){return[Ks];}_historyView;static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b1b41){super(_0x5b1b41);const _0x53e8bf=this['context']['plugins']['get']('AITabs');this['_historyView']=new gh(this['context']['locale'],_0x53e8bf['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x53e8bf),this['_historyView']['delegate'](...Ih)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x53e8bf['view'],'isMaximized',_0x287458=>_0x287458),_0x53e8bf['view']['addTab']({'id':'history','buttonLabel':qs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x23e734,'order':0x0,'content':this['_historyView']});}removeHistoryItem(_0x434ada){this['_historyView']['removeHistoryItem'](_0x434ada);}updateItems(_0x57daef){this['_historyView']['updateHistoryItemsWithCategories'](_0x57daef);}updateItemTitle(_0x5859d2,_0x4641ac){this['_historyView']['updateItemTitle'](_0x5859d2,_0x4641ac);}updateItemLoadingState(_0x5e98cf,_0x287739,_0x2bfa3c){this['_historyView']['updateItemLoadingState'](_0x5e98cf,_0x287739,_0x2bfa3c);}setLoadingSkeleton(_0x4108ee){this['_historyView']['isLoading']=_0x4108ee;}['showError'](_0xf24d50){this['_historyView']['errorMessage']=_0xf24d50;}['hideError'](){this['_historyView']['errorMessage']='';}};const Eh=/* #__PURE__ -- @preserve */
|
|
35
|
+
mt();var ph=class extends Eh{['id'];createdAt;constructor({id:_0x29e090,title:_0x196392,createdAt:_0x5d6596,updatedAt:_0xc56c09,pinned:_0x55215c}){super(),this['id']=_0x29e090,this['createdAt']=new Date(_0x5d6596),this['set']('title',_0x196392),this['set']('updatedAt',_0xc56c09?new Date(_0xc56c09):null),this['set']('pinned',_0x55215c||!0x1);}updateTitle(_0x2b7730){this['set']('title',_0x2b7730),this['updatedAt']=new Date();}updatePinned(_0x58e7c5){this['set']('pinned',_0x58e7c5),this['updatedAt']=new Date();}};const mh=/* #__PURE__ -- @preserve */
|
|
36
|
+
It();var Th=class extends mh{items=[];connector;['group'];constructor({connector:_0x1e6471,group:_0xc641ca}){super(),this['connector']=_0x1e6471,this['group']=_0xc641ca;}async init(){try{const _0x2dcda2=await this['connector']['fetchConversations'](this['group'])['getConversations']();this['loadItems'](_0x2dcda2);}catch(_0x211afa){this['fire']('error',{'error':_0x211afa,'operation':'init'});}}addItem(_0x1a5939){this['items']['push'](_0x1a5939);}async removeItem(_0x395826){const _0xd414ff=this['items']['findIndex'](_0x5c3961=>_0x5c3961['id']===_0x395826);if(-0x1===_0xd414ff)return!0x1;try{return await this['connector']['deleteConversation'](_0x395826)['execute'](),this['items']['splice'](_0xd414ff,0x1),this['fire']('itemRemoved',{'itemId':_0x395826}),!0x0;}catch(_0xf8418e){return this['fire']('error',{'error':_0xf8418e,'operation':'removeItem','itemId':_0x395826}),!0x1;}}getItem(_0x544559){return this['items']['find'](_0x56dc67=>_0x56dc67['id']===_0x544559);}async updateItemTitle(_0x3ab6b9,_0x430fdb){const _0x417922=this['getItem'](_0x3ab6b9);if(!_0x417922)return!0x1;try{return await this['connector']['updateConversation'](_0x3ab6b9,{'title':_0x430fdb})['getResult'](),_0x417922['updateTitle'](_0x430fdb),this['fire']('itemUpdated',{'itemId':_0x3ab6b9,'updates':{'title':_0x430fdb}}),!0x0;}catch(_0x1dc9cd){return this['fire']('error',{'error':_0x1dc9cd,'operation':'updateItemTitle','itemId':_0x3ab6b9}),!0x1;}}async updateItemPinned(_0x20402a,_0xe3e49f){const _0x5529bf=this['getItem'](_0x20402a);if(!_0x5529bf)return!0x1;try{return await this['connector']['updateConversation'](_0x20402a,{'pinned':_0xe3e49f})['getResult'](),_0x5529bf['updatePinned'](_0xe3e49f),this['fire']('itemUpdated',{'itemId':_0x20402a,'updates':{'pinned':_0xe3e49f}}),!0x0;}catch(_0x254f39){return this['fire']('error',{'error':_0x254f39,'operation':'updateItemPinned','itemId':_0x20402a}),!0x1;}}loadItems(_0x486662){try{this['items']=[],_0x486662['map'](_0xd4bf95=>{this['addItem'](new ph(_0xd4bf95));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x1496e2){this['fire']('error',{'error':_0x1496e2,'operation':'loadItems'});}}getItems(_0x5a540f={}){const _0x48e05e=void 0x0!==_0x5a540f['pinned']&&_0x5a540f['pinned'],_0x277169=_0x5a540f['from']?new Date(_0x5a540f['from']['getFullYear'](),_0x5a540f['from']['getMonth'](),_0x5a540f['from']['getDate']()):null,_0x2bc372=_0x5a540f['to']?new Date(_0x5a540f['to']['getFullYear'](),_0x5a540f['to']['getMonth'](),_0x5a540f['to']['getDate']()):null;return this['items']['filter'](_0x39f218=>{if(_0x39f218['pinned']!==_0x48e05e)return!0x1;if(_0x2bc372){const _0x4f4ed8=new Date(_0x39f218['createdAt']['getFullYear'](),_0x39f218['createdAt']['getMonth'](),_0x39f218['createdAt']['getDate']());return _0x277169?_0x277169['getTime']()===_0x2bc372['getTime']()?_0x4f4ed8['getTime']()===_0x277169['getTime']():_0x4f4ed8<_0x2bc372&&_0x4f4ed8>=_0x277169:_0x4f4ed8<_0x2bc372;}return!0x0;});}},wh=class extends _0x4cd5fc{_aiConnector;_reporter;_aiChatHistoryUi;_aiChatController;static get requires(){return[$s,dr,Kr,Ah,Ks];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiConnector']=this['context']['plugins']['get']($s),this['_aiChatHistoryUi']=this['context']['plugins']['get'](Ah),this['_aiChatController']=this['context']['plugins']['get'](Kr),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aichathistory');const _0x42974a=this['context']['plugins']['get'](Ks);try{const _0x6de4f4=this['_aiChatController']['getGroupId']();this['history']=new Th({'connector':this['_aiConnector'],'group':_0x6de4f4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x486386,_0x5125cc)=>{this['_setItemLoading'](_0x5125cc['id'],'remove'),this['_handleRemove'](_0x5125cc['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x7358b1,_0x2fdade)=>{this['_setItemLoading'](_0x2fdade['id'],'rename'),this['_handleEditTitle'](_0x2fdade['id'],_0x2fdade['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x12b6f7,_0x186f28)=>{void 0x0!==_0x186f28['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x186f28['itemId'],_0x186f28['updates']['title']),void 0x0!==_0x186f28['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x186f28['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0xcb9d41,_0x3117e1)=>{this['_aiChatController']['_handleRemovedConversation'](_0x3117e1['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x3117e1['itemId']),this['_clearItemLoading'](_0x3117e1['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xf22add,_0xe0719b)=>{this['_handleHistoryErrorUI'](_0xe0719b['error'],_0xe0719b['operation'],_0xe0719b['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x101371,_0x17a482)=>{this['_handleSelectConversation'](_0x17a482['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4bd3a5,_0x1d09c7)=>{const _0x948e98=_0x1d09c7['pinned']?'pin':'unpin';this['_setItemLoading'](_0x1d09c7['id'],_0x948e98),this['_handleTogglePin'](_0x1d09c7['id'],_0x1d09c7['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{_0x42974a['view']['activateTab']('chat'),this['_aiChatController']['startConversation']();}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x42974a['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x46e821){this['_handleHistoryErrorUI'](_0x46e821,'init');}}async _handleEditTitle(_0x4b506a,_0x2a0bb9){await this['history']['updateItemTitle'](_0x4b506a,_0x2a0bb9);}async['_handleTogglePin'](_0x536d3d,_0x19cdeb){await this['history']['updateItemPinned'](_0x536d3d,_0x19cdeb);}async['_handleRemove'](_0x258a0c){await this['history']['removeItem'](_0x258a0c);}async _handleSelectConversation(_0x2ef82){this['context']['plugins']['get'](Ks)['view']['activateTab']('chat'),await this['_aiChatController']['loadConversation'](_0x2ef82);}async _showConversationHistory(){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_updateHistoryItemsUI(){const _0xb4c82a=this['_aiChatController']['activeConversation']?.['id'],_0x4f7099=this['_getCategorizedItems']()['map'](_0x5e53db=>({'title':_0x5e53db['title'],'items':_0x5e53db['items']['map'](_0x54a06a=>({'id':_0x54a06a['id'],'title':_0x54a06a['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x54a06a['createdAt'])['toLocaleDateString'](),'active':_0x54a06a['id']===_0xb4c82a,'pinned':_0x54a06a['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x4f7099);}_setItemLoading(_0x186367,_0x2a5006){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x186367,_0x2a5006,!0x0);}_clearItemLoading(_0x199cee){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x199cee,null,!0x1);}_handleHistoryErrorUI(_0x248d18,_0x27f5f0,_0x4f2877){const _0x316497=this['_generateErrorMessage'](_0x27f5f0,_0x4f2877);this['_aiChatHistoryUi']['showError'](_0x316497),this['_reporter']['reportError'](_0x248d18,{'context':{'operation':_0x27f5f0}}),_0x4f2877&&this['_clearItemLoading'](_0x4f2877),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}_generateErrorMessage(_0x14829a,_0x55db31){const _0x40cd5b=_0x55db31?this['history']['getItem'](_0x55db31):null,_0x4faaac=_0x40cd5b?.['title']||qs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x14829a){case'updateItemTitle':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4faaac);case'updateItemPinned':{const _0x333e35=qs(this['context']['locale'],_0x40cd5b?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x333e35,_0x4faaac]);}case'removeItem':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4faaac);case'init':case'loadItems':return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return qs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}_getCategorizedItems(){const _0x58e2e3=new Date(),_0x43d6b5=new Date(_0x58e2e3['getFullYear'](),_0x58e2e3['getMonth'](),_0x58e2e3['getDate']()),_0x277106=new Date(_0x43d6b5);_0x277106['setDate'](_0x277106['getDate']()-0x1);const _0x2c951e=new Date(_0x43d6b5);_0x2c951e['setDate'](_0x2c951e['getDate']()-0xe);const _0x5187da=this['history']['getItems']({'pinned':!0x0}),_0x156f96=this['history']['getItems']({'from':_0x43d6b5,'to':_0x43d6b5}),_0x4cddc2=this['history']['getItems']({'from':_0x277106,'to':_0x277106}),_0x1ef322=this['history']['getItems']({'from':_0x2c951e,'to':_0x277106}),_0x43b524=this['history']['getItems']({'to':_0x2c951e}),_0x169a8=[];return _0x5187da['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x5187da}),_0x156f96['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x156f96}),_0x4cddc2['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4cddc2}),_0x1ef322['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1ef322}),_0x43b524['length']>0x0&&_0x169a8['push']({'title':qs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x43b524}),_0x169a8;}},Ch=class extends _0x4cd5fc{static get requires(){return[wh,Ah];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},fh=class extends _0x4cd5fc{static get requires(){return[Kr,Pn,ch,Ch,cr];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39c694){super(_0x39c694),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'contextLibrary':{'enabled':!0x1},'sources':[],'alwaysAddSelection':!0x1,'paste':{'textThreshold':0x5dc}}),this['context']['config']['define']('ai.chat.initialConversation','new');}},Rh=class extends _0x1a9216{['id'];constructor(_0x220397,_0x4c3095){super(_0x220397);const {id:_0x304829,type:_0x10d5df,icon:_0x2fbcfe}=_0x4c3095;this['id']=_0x304829,this['set']({'label':_0x4c3095['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4c3095['id']}}),_0x2fbcfe?this['icon']=_0x2fbcfe:'chat'===_0x10d5df?this['icon']=_0x2024d5:'review'===_0x10d5df?this['icon']=_0x2c00e7:'translate'===_0x10d5df&&(this['icon']=_0x46b415);}},bh=class extends _0x2df458{listView;constructor(_0x3ad90c,_0x5dc02e){super(_0x3ad90c),this['set']('isEnabled',!0x0);const _0x474c3d=_0x5dc02e['map'](_0x228136=>{const _0x568265=new _0xf665cb(this['locale']),_0x267a6a=new Rh(this['locale'],_0x228136);return _0x267a6a['bind']('isEnabled')['to'](this),_0x568265['children']['add'](_0x267a6a),_0x267a6a['delegate']('execute')['to'](this),_0x568265;});this['listView']=new _0x4e6fd6(this['locale']),this['listView']['items']['addMany'](_0x474c3d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}};const Sh='reviewMode',Oh='translate',vh='chat-shortcuts';var yh=class extends _0x4cd5fc{_shortcuts;_shortcutsView;_aiChatUI;_listenedConversation;static get requires(){return[ch,Js];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_aiChatUI']=this['context']['plugins']['get'](ch),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x22349a=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{const _0xe239e1=_0x22349a['activeConversation'];_0xe239e1['isFromHistory']||this['_injectShortcuts'](_0xe239e1);}),this['listenTo'](_0x22349a,'interactionCreated',()=>{this['_removeShortcuts']();}));}_validateShortcuts(){const _0x2515d9=['chat','review','translate'];this['_shortcuts']['forEach'](_0x33ee2d=>{let _0x31e7e9=!0x0;if(_0x33ee2d['id']&&_0x33ee2d['label']&&_0x2515d9['includes'](_0x33ee2d['type'])?'chat'===_0x33ee2d['type']&&(_0x31e7e9='string'==typeof _0x33ee2d['prompt']):_0x31e7e9=!0x1,!_0x31e7e9)throw new dt('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x33ee2d});});}_injectShortcuts(_0x5f0f60){this['_removeShortcuts'](),this['_shortcutsView']=new bh(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),this['_aiChatUI']['addFeedItemCustomElement'](this['_shortcutsView']['element'],vh),this['_shortcutsView']['on']('execute',_0x58c4a6=>{const _0x5601e9=_0x58c4a6['source']['id'];this['_executeShortcut'](_0x5601e9);}),this['_listenedConversation']=_0x5f0f60,this['listenTo'](_0x5f0f60,'uploadProgressChanged',(_0xa5bd73,_0x124ee7)=>{this['_shortcutsView']['isEnabled']=!_0x124ee7['isUploadInProgress'];});}_removeShortcuts(){const _0x143423=this['context']['plugins']['get'](ch);_0x143423['hasFeedItem'](vh)&&_0x143423['removeFeedItem'](vh),this['_listenedConversation']&&(this['stopListening'](this['_listenedConversation'],'uploadProgressChanged'),this['_listenedConversation']=void 0x0),this['_shortcutsView']?.['destroy']();}_executeShortcut(_0x17e22c){const _0x1aaa76=this['_shortcuts']['find'](_0x2a278c=>_0x2a278c['id']===_0x17e22c),_0x15db9f=_0x1aaa76['type'];'chat'===_0x15db9f?this['_runChatShortcut'](_0x1aaa76):'review'===_0x15db9f?_0x1aaa76['commandId']?this['_runReviewShortcut'](_0x1aaa76):this['_switchTab'](Sh):'translate'===_0x15db9f&&(_0x1aaa76['language']?this['_runTranslateShortcut'](_0x1aaa76):this['_switchTab'](Oh));}_switchTab(_0x5467a5){if(!this['context']['plugins']['has']('AITabs'))throw new dt('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x5467a5});return this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x5467a5);}async _runChatShortcut({id:_0x352262,prompt:_0x208d91,draftMode:_0x40c688,useWebSearch:_0x4b52a8=!0x1,useReasoning:_0x1e2d91=!0x1,model:_0x5576bc}){const _0x2ffdd5=this['context']['plugins']['get']('AIChatController'),_0x1eb783=_0x2ffdd5['activeConversation'],_0x3799f6=this['context']['plugins']['get'](Js),_0x4d8bcf=await _0x3799f6['models']['resolveModel'](_0x5576bc);_0x4d8bcf&&await _0x1eb783['setModel'](_0x4d8bcf),_0x1eb783['setWebSearch'](_0x4b52a8),_0x1eb783['setReasoning'](_0x1e2d91);const _0x49eef7=_0x3799f6['contextLibrary']['resolveContext']({'feature':'chat','ids':[_0x352262],'idScopedOnly':!0x0,'context':new nr()});_0x1eb783['addDefaultContext'](_0x49eef7['refs']),_0x2ffdd5['addCurrentDocumentToChatContext'](),_0x40c688?(this['_aiChatUI']['setPromptInputValue'](_0x208d91),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2ffdd5['sendMessage']({'message':_0x208d91});}_runReviewShortcut({commandId:_0x2159d4,model:_0x34b39f,prompt:_0x4adf7a,params:_0x3c16df}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new dt('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab'](Sh);const _0x264507={'id':_0x2159d4,'isCustom':'custom'===_0x2159d4};_0x34b39f&&_0x4adf7a&&(_0x264507['args']={'model':_0x34b39f,'prompt':_0x4adf7a}),_0x3c16df&&(_0x264507['params']=_0x3c16df),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x264507);}_runTranslateShortcut({language:_0x524707}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new dt('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x524707,'args':{'language':_0x524707}});}},Nh=class extends _0x3f0a57{constructor(_0x4fb691){super(_0x4fb691);const _0x125aa9=_0x4fb691['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x125aa9,'isVisible'),this['isEnabled']=!0x0;}execute(){const _0x4e5ae7=this['editor']['plugins']['get']('AITabs')['view'];_0x4e5ae7['isVisible']=!_0x4e5ae7['isVisible'];}},kh=class extends _0x158c3f{static get requires(){return[Ks];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x1fe14b=this['editor'];_0x1fe14b['commands']['add']('toggleAi',new Nh(_0x1fe14b)),_0x1fe14b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x1c5596=this['_createAIUIButton'](_0x1a9216);return _0x1c5596['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x1c5596;}),_0x1fe14b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3d2177=this['_createAIUIButton'](_0x410c15);return _0x3d2177['set']({'role':'menuitemcheckbox'}),_0x3d2177;});}_createAIUIButton(_0x4683f6){const _0x582ded=this['editor'],_0x2d5435=_0x582ded['commands']['get']('toggleAi'),_0x365737=new _0x4683f6(_0x582ded['locale']);return _0x365737['set']({'label':qs(_0x582ded['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4745fe,'isToggleable':!0x0}),_0x365737['bind']('isEnabled')['to'](_0x2d5435),_0x365737['bind']('isOn')['to'](_0x2d5435,'value',_0x75d7c5=>!!_0x75d7c5),this['listenTo'](_0x365737,'execute',()=>{_0x2d5435['execute']();}),_0x365737;}},xh=class extends _0x2df458{constructor(_0x57507b){super(_0x57507b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':qs(_0x57507b,'AI_DISCLAIMER_TEXT')}]}]});}};const Lh='ck-ai-mini-toolbar-copy-button\x20'+Ar,Dh=Lh+'\x20ck-ai-mini-toolbar-copy-button_copied';var Ph=class extends _0x20288e{copyButton;likeButton;dislikeButton;showChangesButton;['_config'];constructor(_0x4a6cda,_0x227315={}){super(_0x4a6cda),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x227315};const _0x1961b2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1961b2?'ck-ai-mini-toolbar\x20ck-hidden':'ck-ai-mini-toolbar',this['_config']['showCopy']&&(this['_setupCopyButton'](),this['items']['add'](this['copyButton'])),this['_config']['showChanges']&&(this['_setupShowChangesButton'](),this['items']['add'](this['showChangesButton'])),this['_setupRatingButtons'](),this['_config']['showLike']&&this['items']['add'](this['likeButton']),this['_config']['showDislike']&&this['items']['add'](this['dislikeButton']),this['_config']['customView']&&this['items']['addMany'](this['_config']['customView']);}toggleShowChangesEnabled(_0x3646b8){this['showChangesButton']['isEnabled']=_0x3646b8;}_setupRatingButtons(){this['likeButton']=new _0x1a9216(this['locale']),this['likeButton']['set']({'icon':lt,'label':qs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Ar,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x1a9216(this['locale']),this['dislikeButton']['set']({'icon':ct,'label':qs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Ar,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}_setupCopyButton(){this['copyButton']=new _0x1a9216(this['locale']),this['copyButton']['set']({'icon':_0x21a060,'label':qs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':Lh,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x15be84=new _0x5e3c18();_0x15be84['set']({'content':_0x42448e}),_0x15be84['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']=Dh,setTimeout(()=>{this['copyButton']['class']=Lh;},0x7d0);}),this['copyButton']['children']['add'](_0x15be84);}_setupShowChangesButton(){this['showChangesButton']=new _0x1a9216(this['locale']),this['showChangesButton']['set']({'icon':st,'label':qs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Ar}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x4e445c=>_0x4e445c?nt:st),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}},Mh=class extends _0x20288e{constructor(_0x356c2f,_0x17ab9c=!0x0,_0x31950b=!0x0){super(_0x356c2f),this['set']('isEnabled',!0x1),this['set']('isVisible',!0x0),this['set']('isTargetReadOnly',!0x1),this['rejectButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_REJECT_BUTTON'),Ar),this['rejectButton']['bind']('isEnabled')['to'](this),this['rejectButton']['on']('execute',()=>{this['fire']('rejectSuggestion');}),this['items']['add'](this['rejectButton']),_0x31950b&&(this['suggestButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_SUGGEST_BUTTON'),Ir),this['suggestButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x339f7b,_0x504b4c)=>_0x339f7b&&!_0x504b4c),this['suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['items']['add'](this['suggestButton'])),_0x17ab9c&&(this['applyButton']=this['_createButton'](qs(_0x356c2f,'AI_BALLOON_APPLY_BUTTON'),gr),this['applyButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isTargetReadOnly',(_0x3ea09e,_0x21574d)=>_0x3ea09e&&!_0x21574d),this['applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),this['items']['add'](this['applyButton'])),this['setButtonsVisibility']({'showApplyButton':_0x17ab9c,'showSuggestButton':_0x31950b});const _0x4e9828=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar',_0x4e9828['if']('isVisible','ck-hidden',_0x242e53=>!_0x242e53)]}});}get primaryActionButton(){return this['applyButton']&&this['applyButton']['isVisible']?this['applyButton']:this['suggestButton']&&this['suggestButton']['isVisible']?this['suggestButton']:this['rejectButton'];}setButtonsVisibility({showApplyButton:_0x1f8aec,showSuggestButton:_0x374791}){this['applyButton']&&(this['applyButton']['isVisible']=_0x1f8aec),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x374791);}_createButton(_0x32751d,_0x418bd1){const _0x14183c=new _0x1a9216(this['locale']);return _0x14183c['set']({'label':_0x32751d,'class':mr+'\x20'+_0x418bd1,'isVisible':!0x0,'withText':!0x0}),_0x14183c;}};const Vh=['applySuggestion','insertSuggestion','rejectSuggestion','showNext','showPrevious'];var Hh=class extends _0x2df458{['_errorView'];['children'];_streamableContentView;_contentView;_contentChildren;_toolbarContainerView;_toolbarView;['_disclaimerView'];['_miniToolbarView'];['_config'];constructor(_0x14ec89,_0x5185c7){super(_0x14ec89),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1),this['set']('width',null),this['set']('isTrackChangesOn',!0x1),this['set']('isTargetReadOnly',!0x1),this['_streamableContentView']=new ho(_0x14ec89),this['_disclaimerView']=new xh(_0x14ec89),this['_miniToolbarView']=new Ph(_0x14ec89,{'showChanges':_0x5185c7['showChangesButtonMode']??'icon'}),this['_config']=_0x5185c7,this['_toolbarView']=new Mh(_0x14ec89,_0x5185c7['showApplyButton'],_0x5185c7['showSuggestButton']),this['_toolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_toolbarView']['bind']('isTargetReadOnly')['to'](this),this['_toolbarContainerView']=new Uh(_0x14ec89,[this['_miniToolbarView'],this['_toolbarView']]),this['_toggleToolbarButtonsVisibility'](_0x5185c7),this['on']('change:isTrackChangesOn',()=>{this['_toggleToolbarButtonsVisibility'](_0x5185c7);}),this['_contentView']=new _0x2df458(_0x14ec89),this['_contentChildren']=this['_contentView']['createCollection']([this['_streamableContentView']]),this['_contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__content']},'children':this['_contentChildren']}),this['children']=this['createCollection']([this['_contentView'],this['_disclaimerView'],this['_toolbarContainerView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon-main']},'children':this['children']});}['showBlockingError'](_0x1173bf){this['showError'](_0x1173bf);}['showError'](_0x245625){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_contentChildren']['has'](this['_errorView'])||this['_contentChildren']['add'](this['_errorView'],0x0),this['_errorMessage']=_0x245625,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}clearContent(){this['_streamableContentView']['clear']();}async updateContent(_0x23b01a){_0x23b01a?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x23b01a);}_createErrorView(){const _0x4f62a6=new _0x2df458(this['locale']),_0x1653ae=new _0x2df458(this['locale']);return _0x1653ae['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4f62a6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3515be=>!_0x3515be)]},'children':[_0x1653ae]}),_0x4f62a6;}_toggleToolbarButtonsVisibility({showApplyButton:_0x7a99d8,showSuggestButton:_0x2fba29}){_0x7a99d8=_0x7a99d8&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2fba29=_0x2fba29&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x7a99d8,'showSuggestButton':_0x2fba29});}},Uh=class extends _0x2df458{['children'];constructor(_0x19a50d,_0x1a6bff){super(_0x19a50d),this['children']=this['createCollection'](_0x1a6bff),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-balloon__toolbar-container']},'children':this['children']});}};const Bh=0xa;var Gh=class extends _0x4cd5fc{static get requires(){return[Pn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;_currentConfig;_editor;_isUpdatingMarkers=!0x1;['open'](_0xab6492){const {id:_0x418b4c}=this['_currentConfig']??{};this['_currentConfig']=_0xab6492,this['_editor']=_0xab6492['targetEditor'];const {id:_0xaa048e}=this['_currentConfig'];this['isOpen']&&_0x418b4c===_0xaa048e?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x4f7c9a=this['_editor'];if(!_0x4f7c9a)return;const _0x1e2b30=_0x4f7c9a['plugins']['get']('Dialog');_0x1e2b30['isOpen']&&this['_currentConfig']&&_0x1e2b30['id']===this['_currentConfig']['id']&&_0x1e2b30['hide']();}_updateDialog(){const _0x39f0c9=this['_editor']['plugins']['get']('Dialog');if(!_0x39f0c9['view'])return;const {icon:_0x2a93fc,title:_0x26203b,mainView:_0xbdc785}=this['_currentConfig'];this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x39f0c9['view']['headerView']&&(_0x39f0c9['view']['headerView']['label']=_0x26203b,_0x39f0c9['view']['headerView']['iconView']&&_0x2a93fc&&(_0x39f0c9['view']['headerView']['iconView']['content']=_0x2a93fc)),this['_adjustBalloonWidth'](_0xbdc785),_0x39f0c9['view']['updatePosition']();}_showFakeVisualSelection(){this['context']['plugins']['get'](Pn)['showFakeVisualSelection']({'editor':this['_editor'],'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),Pt(Array['from'](this['_editor']['editing']['view']['domRoots']['values']()))?.['removeAllRanges']();}_hideFakeVisualSelection(){this['context']['plugins']['get'](Pn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0xf74b28=this['_editor']['plugins']['get']('Dialog'),{id:_0x26e171,title:_0x890e77,icon:_0x27fc84,class:_0x5c29a5,mainView:_0x28ef30}=this['_currentConfig'];_0x28ef30['delegate'](...Vh)['to'](this),_0xf74b28['show']({'title':_0x890e77,'icon':_0x27fc84,'hasCloseButton':!0x0,'id':_0x26e171,'position':this['_calculateDialogPosition']['bind'](this),'getRootName':this['_getCurrentDomRootName']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5c29a5||''),'content':_0x28ef30,'onShow':_0x55ef7c=>{this['_adjustBalloonWidth'](_0x28ef30),this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x55ef7c['view']?.['updatePosition']();const _0x332828=this['_getSelectionElements']();_0x332828&&_0x332828[0x0]&&Yt({'target':_0x332828[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x55ef7c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x26e171});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x26e171}),this['isOpen']=!0x1;}});}_calculateDialogPosition(_0x3b8548,_0x2724cb,_0x4dd0d9){const _0x432119=_0x2724cb||_0x4dd0d9;if(!_0x432119)return null;const _0x26ab5d=this['_getSelectionElements']();if(!_0x26ab5d||0x0===_0x26ab5d['length'])return{'left':Math['round'](_0x432119['left']+_0x432119['width']/0x2-_0x3b8548['width']/0x2),'top':Math['round'](_0x432119['top']+_0x432119['height']/0x2-_0x3b8548['height']/0x2)};const _0x41ad38=Math['round'](_0x432119['left']+_0x432119['width']/0x2-_0x3b8548['width']/0x2),_0x16d94e=_0x26ab5d['map'](_0xc50e1e=>new Tt(_0xc50e1e)),_0x305fc8=_0x3b8548['height'];return{'left':_0x41ad38,'top':this['_calculateOptimalTopPosition'](_0x16d94e,_0x305fc8,_0x432119)};}_calculateOptimalTopPosition(_0x3a8415,_0x208eb6,_0x546af4){const _0x4dd2d6=new Tt(Vt['window']),_0x3c13ed=_0x3a8415['map'](_0x32f34c=>_0x32f34c['getVisible']())['filter'](_0xd37723=>_0xd37723),_0x25878a=Tt['getBoundingRect'](_0x3c13ed);if(!_0x25878a)return Math['round'](_0x546af4['top']+_0x546af4['height']/0x2);const _0x32ad9f=_0x4dd2d6['getIntersection'](_0x25878a);if(!_0x32ad9f)return Math['round'](_0x546af4['top']+_0x546af4['height']/0x2);const _0x5e0333=_0x546af4['getVisible'](),_0x29758b=_0x5e0333&&_0x25878a['height']>_0x5e0333['height'],_0x54463c=_0x32ad9f['top'],_0x54e486=_0x32ad9f['bottom'];if(_0x29758b){const _0x4b27eb=_0x4dd2d6['top']+_0x4dd2d6['height']/0x2-_0x208eb6/0x2,_0x73758=_0x54463c-Bh-_0x4dd2d6['top'],_0xdf1502=_0x4dd2d6['bottom']-_0x54e486-Bh;return _0x73758>=_0x208eb6?Math['max'](Bh,_0x54463c-_0x208eb6-Bh):_0xdf1502>=_0x208eb6?_0x54e486+Bh:Math['max'](Bh,_0x4b27eb);}const _0x48f776=_0x54463c-_0x208eb6,_0xab69a2=_0x4dd2d6['bottom']-_0x54e486-Bh,_0x31f7b7=_0x54463c-Bh-_0x4dd2d6['top'];let _0x4e7553;return _0x4e7553=_0xab69a2>=_0x208eb6?_0x54e486+Bh:_0x31f7b7>=_0x208eb6?_0x48f776-Bh:_0x54463c+_0x25878a['height']/0x2-_0x208eb6/0x2,_0x4e7553;}_setupFakeVisualSelectionMarkerRemovalListener(){const _0x36eb8e=this['_editor'];this['listenTo'](_0x36eb8e['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5b7f26,data:{newRange:_0x48da23}}of _0x36eb8e['model']['document']['differ']['getChangedMarkers']())if(_0x5b7f26['startsWith']('ai-selection:')&&(_0x48da23&&(_0x48da23['start']['isEqual'](_0x48da23['end'])||'$graveyard'==_0x48da23['root']['rootName'])||null==_0x48da23)){const _0x4eb390=qs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4eb390),this['fire']('selectionRemoved');}}});}_cleanupFakeVisualSelectionMarkerRemovalListener(){const _0x136a46=this['_editor'];this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x136a46['model']['document']);}_getSelectionElements(){const _0x5008ce=this['_editor'];return _0x4337d7(_0x5008ce['editing'],[..._0x5008ce['model']['markers']['getMarkersGroup']('ai-selection'),..._0x5008ce['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}_getCurrentDomRootName(){const _0x1461d1=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];return _0x1461d1&&_0x1461d1['rootName']?_0x1461d1['rootName']:null;}_adjustBalloonWidth(_0x519070){const _0x3fe355=this['_getCurrentDomRootName'](),_0x38c0b1=_0x3fe355?this['_editor']['editing']['view']['getDomRoot'](_0x3fe355):null;_0x38c0b1&&_0x519070['adjustWidthToEditable'](_0x38c0b1);}};function Wh({domRoot:_0x3276bb,innerElement:_0x1c6142,outerElement:_0xef6e11,widthCustomProperty:_0x5b077b}){if(!_0x1c6142||!_0xef6e11)return null;const _0x4cf73e=function(_0x4b5e02,_0x151e7c){let _0x35394f=0x0,_0x2dde1a=_0x4b5e02;for(;_0x2dde1a;){const {paddingLeft:_0x1a8436,paddingRight:_0x444dd9,borderLeftWidth:_0x1030cc,borderRightWidth:_0x8f4617}=Fh(_0x2dde1a);if(_0x35394f+=Kh(_0x1a8436)+Kh(_0x444dd9)+Kh(_0x1030cc)+Kh(_0x8f4617),_0x2dde1a===_0x151e7c)return _0x35394f;_0x2dde1a=Lt(_0x2dde1a);}return null;}(_0x1c6142,_0xef6e11);if(null===_0x4cf73e)return null;const _0x29d0a3=function(_0x5e4001){const {paddingLeft:_0x47868b,paddingRight:_0x16b84a}=Fh(_0x5e4001);return _0x5e4001['clientWidth']-Kh(_0x47868b)-Kh(_0x16b84a);}(_0x3276bb)+_0x4cf73e;return _0x29d0a3<=0x0?null:'var('+_0x5b077b+','+Math['min'](Math['ceil'](_0x29d0a3),0x384)+'px)';}function Fh(_0x549369){return _0x549369['ownerDocument']['defaultView']['getComputedStyle'](_0x549369);}function Kh(_0xb20e1a){return parseFloat(_0xb20e1a)||0x0;}var $h=class extends _0x2df458{constructor(_0x1a6bcc,_0x304775){super(_0x1a6bcc);const _0x1d2c9a=this['bindTemplate'];this['set']('isVisible',!0x0),this['setTemplate']({'tag':'span','attributes':{'class':['ck',_0x304775,_0x1d2c9a['if']('isVisible','ck-hidden',_0x206be7=>!_0x206be7)]}});}},Yh=class extends Hh{nextButtonView;previousButtonView;headerSeparatorView;['focusCycler'];['_focusables'];['_focusTracker'];_keystrokes;_stateView;constructor(_0xaf1641,_0x341348){super(_0xaf1641,{'showChangesButtonMode':'full',..._0x341348});const _0x7f55ac=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['set']('_outdatedReason',void 0x0),this['set']('areActionsDisabled',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['headerSeparatorView']=new $h(_0xaf1641,'ck-ai-chat-balloon-header-separator'),this['_toolbarView']['bind']('isEnabled')['to'](this,'areActionsDisabled',this,'_isErrorVisible',(_0x1643f2,_0x36e1ec)=>!_0x1643f2&&!_0x36e1ec),this['_stateView']=new so(_0xaf1641),this['_stateView']['isVisible']=!0x1,this['_toolbarContainerView']['children']['add'](this['_stateView']),this['_setupMiniToolbar'](),this['on']('change:_state',(_0x1c36ca,_0x4b3787,_0x429782,_0x8bb427)=>{let _0x22d4e3,_0xfb2ce6;'pending'===_0x8bb427?(_0x22d4e3=this['_toolbarView'],_0xfb2ce6=this['_stateView']):(_0x22d4e3=this['_stateView'],_0xfb2ce6=this['_toolbarView']),this['_stateView']['setState'](_0x429782,this['_outdatedReason']),_0x22d4e3['isVisible']=!0x1,_0xfb2ce6['isVisible']=!0x0;}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon-main',_0x7f55ac['to']('_state',_0x2cf6be=>'ck-ai-chat-balloon-main_state_'+_0x2cf6be)],'style':{'width':_0x7f55ac['to']('width')}}});}['render'](){super['render'](),this['nextButtonView']['render'](),this['previousButtonView']['render'](),this['_focusTracker']['add'](this['element']),this['_focusTracker']['add'](this['nextButtonView']),this['_focusTracker']['add'](this['previousButtonView']),this['_focusTracker']['add'](this['_miniToolbarView']),this['_focusTracker']['add'](this['_toolbarView']),this['_keystrokes']['listenTo'](this['element']),this['_keystrokes']['listenTo'](this['nextButtonView']['element']),this['_keystrokes']['listenTo'](this['previousButtonView']['element']),this['_focusables']['addMany']([this['nextButtonView'],this['previousButtonView'],this['_miniToolbarView'],this['_toolbarView']]);}destroy(){super['destroy'](),this['previousButtonView']['destroy'](),this['nextButtonView']['destroy'](),this['headerSeparatorView']['destroy']();}['focus'](){this['focusCycler']['focusFirst']();}focusLast(){this['focusCycler']['focusLast']();}setState(_0x4aae8d,_0x513c75){this['_outdatedReason']=_0x513c75,this['_state']=_0x4aae8d;}toggleRotatorButtonsVisibility(_0x5cdb9f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=this['headerSeparatorView']['isVisible']=_0x5cdb9f;}_createNextButtonView(){const _0x204b08=new _0x1a9216(this['locale']);return _0x204b08['set']({'icon':_0xcedfde,'label':qs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'class':pr,'isVisible':!0x0}),_0x204b08['on']('execute',()=>{this['fire']('showNext');}),_0x204b08;}_createPreviousButtonView(){const _0x92d2b0=new _0x1a9216(this['locale']);return _0x92d2b0['set']({'icon':_0x6b5523,'label':qs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'class':pr,'isVisible':!0x0}),_0x92d2b0['on']('execute',()=>{this['fire']('showPrevious');}),_0x92d2b0;}adjustWidthToEditable(_0x4b638b){const _0x1e8523=Wh({'domRoot':_0x4b638b,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-chat-balloon-width'});_0x1e8523&&(this['width']=_0x1e8523);}_setupMiniToolbar(){this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');});}},qh=class extends _0x158c3f{static get requires(){return[_0x3fa2e4,Gh];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_chatBalloonView;constructor(_0x451b70){super(_0x451b70),this['set']('showDiff',!0x1);}['open'](_0x13962a){const _0x393175=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x393175['plugins']['get']('AIBalloon')['open']({..._0x13962a,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x13962a['showRotator']),this['_chatBalloonView']['areActionsDisabled']=_0x13962a['areActionsDisabled'],this['_chatBalloonView']['isTargetReadOnly']=_0x13962a['isTargetReadOnly'],this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}updateContent(_0x37f573){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x37f573);}clearContent(){this['_chatBalloonView']&&this['_chatBalloonView']['clearContent']();}setState(_0x5aefa3,_0x342df9){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x5aefa3,_0x342df9);}setTargetReadOnly(_0x81cb36){this['_chatBalloonView']&&(this['_chatBalloonView']['isTargetReadOnly']=_0x81cb36);}_createChatBalloonView(){const _0x30aeee=this['editor'],_0x4203aa=_0x30aeee['plugins']['get']('AIBalloon'),_0x50791b=_0x30aeee['commands']['get']('trackChanges');let _0x4f0bcb=_0x30aeee['config']['get']('ai.availableReplyActions')||[...po];_0x30aeee['plugins']['has']('TrackChanges')||(_0x4f0bcb=_0x4f0bcb['filter'](_0x4bd3b2=>'insertSuggestion'!=_0x4bd3b2));const _0x572ecc=new Yh(_0x30aeee['locale'],{'availableActions':_0x4f0bcb,'showApplyButton':!0x0,'showSuggestButton':!!_0x50791b});return _0x572ecc['bind']('showDiff')['to'](this),_0x572ecc['delegate'](...$r)['to'](this),_0x572ecc['delegate']('showPrevious','showNext')['to'](this),_0x4203aa['delegate']('dialogClosed')['to'](this),_0x572ecc['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x572ecc['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x572ecc['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x50791b&&_0x572ecc['bind']('isTrackChangesOn')['to'](_0x50791b,'value'),_0x572ecc['render'](),_0x572ecc;}_toggleRotatorButtonsInDialogHeader(_0xc37686){const _0xddf90d=this['editor'],_0x27ad40=_0xddf90d['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0xc37686),_0x27ad40['has'](this['_chatBalloonView']['previousButtonView'])||(_0x27ad40['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView'],this['_chatBalloonView']['headerSeparatorView']],0x0),_0xddf90d['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x27ad40['remove'](this['_chatBalloonView']['previousButtonView']),_0x27ad40['remove'](this['_chatBalloonView']['nextButtonView']),_0x27ad40['remove'](this['_chatBalloonView']['headerSeparatorView']);}));}_restoreDefaultViewFocus(){this['_chatBalloonView']['focus']();}},Qh=class extends _0x158c3f{static get requires(){return[kh,qh,_0x33c035];}get['dialog'](){return this['editor']['plugins']['get'](_0x3fa2e4);}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};function Xh(_0x4196bf){const {editor:_0x5b2e65,action:_0x425184,withText:_0x4b521f=!0x1,withIcon:_0x1f82d1=!0x0,isInDropdown:_0x5e5ccf=!0x0,shouldPreventFocus:_0x565b3b=!0x1,actionButtons:_0x546769}=_0x4196bf;return()=>{const _0x33aeed=_0x5b2e65['locale'],_0x4cd1d6=new _0x1a9216(_0x33aeed),_0x3a24b3=_0x4cd1d6['bindTemplate'];_0x5e5ccf&&_0x4cd1d6['extendTemplate']({'on':{'mouseenter':_0x3a24b3['to'](()=>{_0x565b3b&&_0x565b3b()||_0x4cd1d6['focus']();})}}),_0x546769['push']({'buttonView':_0x4cd1d6,'action':_0x425184});const _0x2befd8=_0x425184['icon']??_0x425184['parent']?.['icon'];return _0x4cd1d6['set']({'label':_0x425184['label'],'withText':_0x4b521f,'role':'menuitem','icon':_0x1f82d1?_0x2befd8??_0x957fd2:void 0x0,'tooltip':!_0x4b521f,'class':'ck-ai-quick-actions-button','isEnabled':_0x425184['isEnabled']}),_0x4cd1d6['on']('execute',()=>{_0x5b2e65['editing']['view']['focus'](),_0x5b2e65['commands']['execute']('aiQuickAction',_0x425184);}),_0x4cd1d6;};}var zh=class extends _0x4bbb4c{['arrowView'];constructor(_0x331cb7,_0x1156bd){super(_0x331cb7,_0x1156bd);const _0x11bdb5=this['bindTemplate'];this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':['ck-dropdown-menu-list__nested-menu__button'],'aria-haspopup':!0x0,'aria-expanded':this['bindTemplate']['to']('isOn',_0x21b999=>String(_0x21b999)),'data-cke-tooltip-disabled':_0x11bdb5['to']('isOn')},'on':{'mouseenter':_0x11bdb5['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}_createArrowView(){const _0x222cbc=new _0x5e3c18();return _0x222cbc['content']=_0x4e5c52,_0x222cbc['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x222cbc;}},jh=class extends _0x4e6fd6{_allListItems;_allSearchableItems;constructor(_0x139f5f,_0x28a10d,_0x4e8d9c){super(_0x139f5f),this['_allListItems']=_0x28a10d,this['_allSearchableItems']=_0x4e8d9c;}filter(_0x2816e3){if(!_0x2816e3)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5009bc=_0x2816e3['source']['toLowerCase']()['trim'](),_0x1e1903=this['_allSearchableItems']['filter'](_0x4bb4c0=>(_0x4bb4c0['groupLabel']?_0x4bb4c0['label']+'\x20('+_0x4bb4c0['groupLabel']+')':_0x4bb4c0['label'])['toLowerCase']()['includes'](_0x5009bc));return this['items']['clear'](),this['items']['addMany'](_0x1e1903['sort']((_0xfde72d,_0x5af04d)=>{const _0x4e3bfe=_0xfde72d['groupLabel'],_0x4b5073=_0x5af04d['groupLabel'];return _0x4e3bfe||_0x4b5073?_0x4e3bfe?0x1:-0x1:0x0;})['map'](_0x2e8982=>_0x2e8982['item'])),this['_highlightQuery'](_0x5009bc,_0x1e1903),{'resultsCount':_0x1e1903['length'],'totalItemsCount':this['_allSearchableItems']['length']};}_highlightQuery(_0xbdd01b,_0x49589e){if(!_0xbdd01b)return;const _0x1a5252=new RegExp(_0x3df188(_0xbdd01b),'gi');_0x49589e['forEach'](_0x33a763=>{_0x33a763['highlightViews']&&_0x33a763['highlightViews']['forEach'](_0x579563=>{'function'==typeof _0x579563['highlightText']&&_0x579563['highlightText'](_0x1a5252);});});}_clearHighlight(){this['_allSearchableItems']['forEach'](_0x11ae1a=>{_0x11ae1a['highlightViews']&&_0x11ae1a['highlightViews']['forEach'](_0x590028=>{'function'==typeof _0x590028['highlightText']&&_0x590028['highlightText'](null);});});}};const Jh='menu',Zh='menuitem';var tc=class extends _0x2df458{_bodyCollection;optionsListView;_searchTextView=null;_allSearchableItems=[];['children'];['focusTracker'];keystrokes;['_focusables'];['focusCycler'];_openNestedPanels=new Set();_nestedPanels=new Set();['_hasSearch'];_actionButtons;constructor(_0x48ae76,_0x2ffba3,_0x37a4b6,_0x35d624,_0x4ee021=!0x1,_0x410cb2=[]){const _0x26cb42=_0x48ae76['locale'];super(_0x26cb42),this['_bodyCollection']=_0x35d624,this['_hasSearch']=_0x4ee021,this['_actionButtons']=_0x410cb2;const _0x1fda6d=this['_createListItems'](_0x48ae76,_0x2ffba3,_0x37a4b6);this['optionsListView']=new jh(_0x26cb42,_0x1fda6d,this['_allSearchableItems']),this['optionsListView']['role']=Jh,this['optionsListView']['items']['addMany'](_0x1fda6d),this['focusTracker']=new Et(),this['keystrokes']=new pt(),_0x4ee021&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x1fda6d,this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x4ee021&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5d0f3c=_0x4ee021&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x15c4c2(_0x5d0f3c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x26cb42['uiLanguageDirection']},'children':this['children']});}_createSearchTextView(){return new _0x2750eb(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':qs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x2bc75f=this['_searchTextView']['queryView']['fieldView']['element'];return Rt(_0x2bc75f,vt(_0x2bc75f));}_createListItems(_0xb5bae8,_0x4dc3e8,_0x1d7953){const _0xe878e5=new _0x15c4c2();return _0x4dc3e8['forEach'](_0x385539=>{if('actions'in _0x385539){const {listItem:_0x118f93}=this['_createActionGroupButton'](_0xb5bae8,_0x385539,_0x1d7953);_0xe878e5['add'](_0x118f93),_0x385539['actions']['forEach'](_0xe6c8e8=>{const {listItem:_0x41f276,highlightViews:_0x31a103}=this['_createSearchResultActionButton'](_0xb5bae8,_0xe6c8e8,_0x385539['label'],_0x385539['icon']);this['_allSearchableItems']['push']({'item':_0x41f276,'label':_0xe6c8e8['label'],'groupLabel':_0x385539['label'],'highlightViews':_0x31a103});});}else{const {listItem:_0x2b83eb}=this['_createActionButton'](_0xb5bae8,_0x385539);_0xe878e5['add'](_0x2b83eb);const _0x380152=_0x2b83eb['children']['first'];if(_0x380152){const {listItem:_0x13275d,highlightViews:_0x1b4f36}=this['_createSearchResultActionButton'](_0xb5bae8,_0x385539);this['_allSearchableItems']['push']({'item':_0x13275d,'label':_0x380152['label']||'','highlightViews':_0x1b4f36});}}}),_0xe878e5;}_createActionButton(_0x39605,_0x3f5649,_0x32c1d5,_0x4d8809){const _0x4c3693=new _0xf665cb(this['locale']);if(_0x32c1d5&&_0x4d8809){const _0xadb5e8=new _0x1a9216(this['locale']),_0x22c45f=_0xadb5e8['bindTemplate'],_0x24e430=new _0x2d3d45();_0x24e430['text']=_0x3f5649['label'];const _0x1accd9=new _0x2d3d45();_0x1accd9['text']=_0x32c1d5;const _0x5259ad=new _0x5e3c18();_0x5259ad['content']=_0x4d8809,_0x5259ad['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x420ed0=new _0x2df458(this['locale']);_0x420ed0['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4c3e94=new _0x2df458(this['locale']);return _0x4c3e94['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xadb5e8['set']({'label':_0x3f5649['label']+'\x20('+_0x32c1d5+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1,'isEnabled':_0x3f5649['isEnabled']}),_0xadb5e8['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group',_0x22c45f['if']('isEnabled','ck-disabled',_0x5123a4=>!_0x5123a4)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x24e430,_0x420ed0,_0x5259ad,_0x1accd9,_0x4c3e94],'on':{'mouseenter':_0x22c45f['to'](()=>{this['_isSearchFocused']()||_0xadb5e8['focus']();}),'click':_0x22c45f['to'](()=>{_0xadb5e8['fire']('execute');})}}),_0xadb5e8['on']('execute',()=>{_0xadb5e8['isEnabled']&&(_0x39605['editing']['view']['focus'](),_0x39605['commands']['execute']('aiQuickAction',_0x3f5649));}),_0x4c3693['children']['add'](_0xadb5e8),this['_actionButtons']['push']({'buttonView':_0xadb5e8,'action':_0x3f5649}),{'listItem':_0x4c3693,'highlightViews':[_0x24e430,_0x1accd9]};}{const _0x4da19d=new _0x4bbfbe(),_0x26778d=new _0x1a9216(this['locale'],_0x4da19d),_0x4ba0fe=_0x26778d['bindTemplate'],_0x12a727=_0x3f5649['icon']??_0x3f5649['parent']?.['icon'],_0x243fe1=void 0x0!==_0x3f5649['icon'];return _0x26778d['set']({'label':_0x3f5649['label'],'withText':!0x0,'role':'menuitem','icon':_0x243fe1?_0x12a727??_0x957fd2:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button','isEnabled':_0x3f5649['isEnabled']}),_0x26778d['extendTemplate']({'on':{'mouseenter':_0x4ba0fe['to'](()=>{this['_isSearchFocused']()||_0x26778d['focus']();})}}),_0x26778d['on']('execute',()=>{_0x39605['editing']['view']['focus'](),_0x39605['commands']['execute']('aiQuickAction',_0x3f5649);}),_0x4c3693['children']['add'](_0x26778d),this['_actionButtons']['push']({'buttonView':_0x26778d,'action':_0x3f5649}),{'listItem':_0x4c3693,'highlightViews':[_0x4da19d]};}}_createSearchResultActionButton(_0x2705b1,_0xdee50d,_0x3b3886,_0xbdddc0){return _0x3b3886&&_0xbdddc0?this['_createSearchResultGroupedActionButton'](_0x2705b1,_0xdee50d,_0x3b3886,_0xbdddc0):this['_createSearchResultIndividualActionButton'](_0x2705b1,_0xdee50d);}_createSearchResultGroupedActionButton(_0x1d6a82,_0x14379d,_0x4f733b,_0x241afe){const _0x18d485=new _0xf665cb(this['locale']),_0x240940=new _0x1a9216(this['locale']),_0x97875b=_0x240940['bindTemplate'],{view:_0x22aa0a,highlightView:_0x27b3de}=this['_createSearchResultGroupRow'](_0x4f733b,_0x241afe),{view:_0x2bffd3,highlightView:_0x5a24b0}=this['_createSearchResultActionRow'](_0x14379d['label']),_0x45ef40=this['_createSearchResultContentView'](_0x22aa0a,_0x2bffd3);return _0x240940['set']({'label':_0x14379d['label'],'withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button\x20ck-ai-quick-actions-search-result-button_with-group','tooltip':!0x1,'isEnabled':_0x14379d['isEnabled']}),_0x240940['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group',_0x97875b['if']('isEnabled','ck-disabled',_0x1f5ade=>!_0x1f5ade)],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x45ef40],'on':{'mouseenter':_0x97875b['to'](()=>{this['_isSearchFocused']()||_0x240940['focus']();}),'click':_0x97875b['to'](()=>{this['_handleSearchResultButtonClick'](_0x240940);})}}),this['_setupActionButtonExecution'](_0x240940,_0x1d6a82,_0x14379d),_0x18d485['children']['add'](_0x240940),this['_actionButtons']['push']({'buttonView':_0x240940,'action':_0x14379d}),{'listItem':_0x18d485,'highlightViews':[_0x27b3de,_0x5a24b0]};}_createSearchResultIndividualActionButton(_0x3cdf9b,_0x1043eb){const _0x20379b=new _0xf665cb(this['locale']),_0x289399=new _0x4bbfbe(),_0x40d1e6=new _0x1a9216(this['locale'],_0x289399),_0x31990e=_0x40d1e6['bindTemplate'];return _0x40d1e6['set']({'label':_0x1043eb['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button','isEnabled':_0x1043eb['isEnabled']}),_0x40d1e6['extendTemplate']({'on':{'mouseenter':_0x31990e['to'](()=>{this['_isSearchFocused']()||_0x40d1e6['focus']();})}}),this['_setupActionButtonExecution'](_0x40d1e6,_0x3cdf9b,_0x1043eb),_0x20379b['children']['add'](_0x40d1e6),this['_actionButtons']['push']({'buttonView':_0x40d1e6,'action':_0x1043eb}),{'listItem':_0x20379b,'highlightViews':[_0x289399]};}_createSearchResultGroupRow(_0xc7a171,_0x46402c){const _0x1bd4ae=new _0x2df458(this['locale']),_0x5472ad=new _0x5e3c18();_0x5472ad['content']=_0x46402c,_0x5472ad['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x363187=new _0x2d3d45();return _0x363187['text']=_0xc7a171,_0x1bd4ae['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x5472ad,_0x363187]}),{'view':_0x1bd4ae,'highlightView':_0x363187};}_createSearchResultActionRow(_0xaf4f52){const _0x222009=new _0x2df458(this['locale']),_0x2df43b=new _0x2d3d45();return _0x2df43b['text']=_0xaf4f52,_0x222009['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x2df43b]}),{'view':_0x222009,'highlightView':_0x2df43b};}_createSearchResultContentView(_0x4a2628,_0x34befb){const _0x1fea21=new _0x2df458(this['locale']);return _0x1fea21['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4a2628,_0x34befb]}),_0x1fea21;}_setupActionButtonExecution(_0x275ff4,_0x257f66,_0x19bce3){_0x275ff4['on']('execute',()=>{_0x275ff4['isEnabled']&&(_0x257f66['editing']['view']['focus'](),_0x257f66['commands']['execute']('aiQuickAction',_0x19bce3));});}_createActionGroupButton(_0x1a3245,_0x4b8910,_0x31abb3){const _0x151dcf=new _0xf665cb(this['locale']),_0x1d6fec=new _0x4bbfbe(),_0x3cfdd5=new zh(this['locale'],_0x1d6fec),_0x384f1f=_0x3cfdd5['bindTemplate'],_0x32608f=this['_getPanelKeystroke'](_0x31abb3),_0x225ecd=this['_createGroupActionsList'](_0x1a3245,_0x4b8910['actions'],_0x31abb3);_0x3cfdd5['set']({'label':_0x4b8910['label'],'withText':!0x0,'role':Zh,'icon':_0x4b8910['icon']??_0x957fd2,'isEnabled':_0x4b8910['actions']['some'](_0x199323=>_0x199323['isEnabled'])}),_0x3cfdd5['extendTemplate']({'on':{'mouseenter':_0x384f1f['to'](()=>{this['_isSearchFocused']()||_0x3cfdd5['focus']();})}});const _0xa8ed52=new Jt(this['locale']);return _0xa8ed52['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel','ck-toolbar-context']},'on':{'keydown':_0x384f1f['to'](_0x1e1fe2=>{this['_handlePanelKeydown'](_0x1e1fe2,_0x32608f,_0x3cfdd5,_0xa8ed52);})}}),_0x3cfdd5['bind']('isOn')['to'](_0xa8ed52,'isVisible'),this['_bodyCollection']['add'](_0xa8ed52),this['_nestedPanels']['add'](_0xa8ed52),_0xa8ed52['content']['add'](_0x225ecd),this['_setupGroupMenuBehavior'](_0x3cfdd5,_0xa8ed52),_0x151dcf['children']['add'](_0x3cfdd5),this['_actionButtons']['push']({'buttonView':_0x3cfdd5,'action':_0x4b8910}),{'listItem':_0x151dcf,'highlightView':_0x1d6fec};}_createGroupActionsList(_0x45f1b1,_0xa8caa0,_0x55c580){const _0x2e2fe=new _0x4e6fd6(this['locale']);return _0x2e2fe['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xa8caa0['forEach'](_0x15d93b=>{const _0x3d9219=new _0xf665cb(this['locale']),_0x3b16c4=Xh({'editor':_0x45f1b1,'action':_0x15d93b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused'](),'actionButtons':this['_actionButtons']})();_0x3d9219['children']['add'](_0x3b16c4),_0x55c580['focusTracker']['add'](_0x3b16c4),_0x2e2fe['items']['add'](_0x3d9219);}),_0x2e2fe;}_setupGroupMenuBehavior(_0x3ba0b3,_0x4821cd){const _0x57166c=_0x3ba0b3['bindTemplate'],_0x3830a8=this['_getButtonKeystroke'](_0x3ba0b3);_0x3ba0b3['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x57166c['to'](()=>{this['_showNestedPanel'](_0x4821cd,_0x3ba0b3);}),'mouseleave':_0x57166c['to'](_0x54a635=>{ec(_0x54a635,_0x3ba0b3,_0x4821cd)||this['_hideNestedPanel'](_0x4821cd);}),'keydown':_0x57166c['to'](_0x5e5f98=>{_0x5e5f98['key']==_0x3830a8&&(this['_showNestedPanel'](_0x4821cd,_0x3ba0b3),_0x4821cd['content']['get'](0x0)['focus']());})}}),_0x4821cd['on']('render',()=>{this['listenTo'](_0x4821cd['element'],'mouseleave',(_0x13d3b4,_0x3dd323)=>{ec(_0x3dd323,_0x3ba0b3,_0x4821cd)||this['_hideNestedPanel'](_0x4821cd);});});}_showNestedPanel(_0xc99519,_0x515621){this['_openNestedPanels']['forEach'](_0x2154e2=>{_0x2154e2!==_0xc99519&&_0x2154e2['isVisible']&&_0x2154e2['hide']();}),_0xc99519['show'](),_0xc99519['pin']({'positions':[_0x592d61['eastSouth']],'target':_0x515621['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xc99519);}_hideNestedPanel(_0x22a7a6){_0x22a7a6['hide'](),this['_openNestedPanels']['delete'](_0x22a7a6);}_hideAllNestedPanels(){this['_openNestedPanels']['forEach'](_0x322e92=>_0x322e92['hide']()),this['_openNestedPanels']['clear']();}resetSearch(){this['_searchTextView']&&this['_searchTextView']['reset']();}destroy(){this['_hideAllNestedPanels']();for(const _0x2e3c4a of this['_nestedPanels'])this['_bodyCollection']['has'](_0x2e3c4a)&&this['_bodyCollection']['remove'](_0x2e3c4a),_0x2e3c4a['destroy']();this['_nestedPanels']['clear'](),super['destroy']();}['focus'](){this['_searchTextView']?this['_searchTextView']['focus']():this['optionsListView']['focus']();}_getPanelKeystroke(_0x13004f){return'rtl'===_0x13004f['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}_getButtonKeystroke(_0x5d880d){return'rtl'===_0x5d880d['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xb20e95,_0x35a1be,_0xb7224f,_0x35cdd4){_0xb20e95['key']==_0x35a1be&&(_0xb7224f['focus'](),this['_hideNestedPanel'](_0x35cdd4));}_handleSearchResultButtonClick(_0x2880b1){_0x2880b1['fire']('execute');}};function ec(_0x29c1,_0x2778e6,_0x1992ca){return[_0x2778e6['element'],_0x1992ca['element']]['filter'](_0x4554a4=>!!_0x4554a4)['some'](_0x4c3994=>_0x299f8c(_0x4c3994,_0x29c1));}function ic(_0x58afcc){const {editor:_0x5c614c,content:_0x5003eb,buttonDefinition:_0x47d0c0,bodyCollection:_0x19c56c,hasSearch:_0x117d77=!0x1,actionButtons:_0x114b8e}=_0x58afcc;return()=>{const _0x326f9e=_0x5c614c['locale'],_0x5d1ae8=_0x5c614c['commands']['get']('aiQuickAction'),_0x111c2d=_0x4c754a(_0x326f9e);_0x111c2d['bind']('isEnabled')['to'](_0x5d1ae8),_0x111c2d['buttonView']['set']({'icon':_0x47d0c0['icon']??_0x957fd2,'label':_0x47d0c0['label'],'tooltip':!0x0}),_0x111c2d['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x4c79fa=new tc(_0x5c614c,_0x5003eb,_0x111c2d,_0x19c56c,_0x117d77,_0x114b8e);return _0x111c2d['panelView']['children']['add'](_0x4c79fa),_0x117d77&&_0x111c2d['on']('change:isOpen',(_0x2e50dd,_0x41d4e8,_0x5eb3c4)=>{if(_0x5eb3c4){if(_0x5c614c['plugins']['has']('AIEditing')){const _0x5a44bb=_0x5c614c['plugins']['get'](Pn),_0x164f8a=_0x5c614c['model']['document']['selection'],_0xf50e8=Array['from'](_0x164f8a['getRanges']());_0xf50e8['length']>0x0&&_0x5a44bb['showFakeVisualSelection']({'editor':_0x5c614c,'ranges':_0xf50e8,'id':'quick-action','priority':0x14});}}else _0x5c614c['plugins']['has']('AIEditing')&&_0x5c614c['plugins']['get'](Pn)['hideFakeVisualSelection']('quick-action'),_0x4c79fa['resetSearch']();}),_0x111c2d;};}const sc='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\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).-\x20Avoid\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',nc='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',rc='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</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><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',oc=/* #__PURE__ -- @preserve */
|
|
37
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());var ac=class AIQuickActionsUI extends _0x158c3f{_actionButtons=[];['_menuBarGroupViews']=[];_reporter;static get requires(){return[Zt,$s,dr,Js];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiquickactions');const _0x72c6e9=this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x72c6e9),this['_initializeQuickActionsComponentsAndCommands'](),this['_initActionTypeQuickActions'](),this['_initChatTypeQuickActions']();}static getDefaultQuickActions(_0x3aa528){return function(_0x21fd99){const _0x1ad460=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x21fd99['uiLanguage'])||'English';return[{'id':'ask-ai','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x1e0a0c},{'id':'chat-commands','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x1e0a0c,'actions':[{'id':'explain','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':sc['replace']('%0',_0x1ad460),'type':'chat'},{'id':'summarize','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':nc['replace']('%0',_0x1ad460),'type':'chat'},{'id':'highlight-key-points','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':qs(_0x21fd99,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':rc['replace']('%0',_0x1ad460),'type':'chat'}]},{'id':'improve-writing','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x6ea41f},{'id':'continue','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x21f936},{'id':'fix-grammar','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x2315ac},{'id':'adjust-length','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x435456,'actions':[{'id':'make-shorter','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x59af22,'actions':[{'id':'make-tone-casual','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x46b415,'actions':[{'id':'translate-to-english','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':qs(_0x21fd99,'AI_QUICK_ACTIONS_OTHER'),'icon':_0xd0155a,'actions':[]}];}(_0x3aa528);}_getDefaultAndCustomActions(){const _0x41815b=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x3e97cc=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x1473ac=>({..._0x1473ac,'type':'chat'===_0x1473ac['type']?'chat':'action','icon':void 0x0}));return _0x41815b['find'](_0x37f643=>'other'===_0x37f643['id'])['actions']['push'](..._0x3e97cc),_0x41815b;}async _initActionTypeQuickActions(){try{const _0x4ae1b5=this['editor']['plugins']['get'](Js),_0x3422c3=await _0x4ae1b5['models']['getAllModels'](),_0x4b704b=(await _0x4ae1b5['models']['getDefault']())?.['id'];this['_assignDefaultModelToCustomActions'](_0x4b704b),this['_enableButtonsByType']('action',_0x396e84=>!!_0x3422c3['find'](_0x52e97e=>_0x52e97e['id']===_0x396e84['model'])||void 0x0===_0x396e84['model']);}catch(_0x387c43){const _0x2b6580=new dt('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x387c43});this['_reporter']['logError'](_0x2b6580);}}_initChatTypeQuickActions(){if(!this['editor']['plugins']['has']('AIChatController'))return;const _0x120ff1=this['editor']['plugins']['get']('AIChatController'),_0x232016=this['editor']['plugins']['has']('AIChatUI')?this['editor']['plugins']['get']('AIChatUI'):null;this['listenTo'](_0x120ff1,'change:isConversationReady',(_0x3376c0,_0x406ceb,_0x2977b9)=>{this['_enableButtonsByType']('chat',()=>_0x2977b9&&!_0x232016?.['isBusy']);}),_0x232016&&this['listenTo'](_0x232016,'change:isBusy',(_0x47518c,_0x4d9687,_0x5f4561)=>{this['_enableButtonsByType']('chat',()=>_0x120ff1['isConversationReady']&&!_0x5f4561);}),this['_enableButtonsByType']('chat',()=>_0x120ff1['isConversationReady']&&!_0x232016?.['isBusy']);}_enableButtonsByType(_0x29b6d3,_0x154f16){this['_quickActionsDefinition']['forEach'](_0x3492f5=>{'actions'in _0x3492f5?_0x3492f5['actions']['forEach'](_0x5b9f42=>{_0x5b9f42['type']===_0x29b6d3&&(_0x5b9f42['isEnabled']=_0x154f16(_0x5b9f42));}):_0x3492f5['type']===_0x29b6d3&&(_0x3492f5['isEnabled']=_0x154f16(_0x3492f5));}),this['_actionButtons']['forEach'](_0x32aff1=>{if(hc(_0x32aff1['action']))return;if(_0x32aff1['action']['type']!==_0x29b6d3)return;const _0x40fc7e=_0x154f16(_0x32aff1['action']);if(_0x32aff1['action']['isEnabled']=_0x40fc7e,_0x32aff1['buttonView']['isEnabled']=_0x40fc7e,'action'===_0x29b6d3&&!_0x40fc7e&&_0x32aff1['action']['model']){const _0x207dab=new dt('ai-quick-actions-unavailable-model',this,{'actionId':_0x32aff1['action']['id'],'modelId':_0x32aff1['action']['model']});this['_reporter']['logError'](_0x207dab);}}),this['_actionButtons']['filter'](_0xabd0aa=>hc(_0xabd0aa['action']))['forEach'](_0x299923=>{_0x299923['buttonView']['isEnabled']=_0x299923['action']['actions']['some'](_0x5a701c=>_0x5a701c['isEnabled']);}),this['_menuBarGroupViews']['forEach'](({view:_0x43db2f,group:_0x8a5b2d})=>{_0x43db2f['isEnabled']=_0x8a5b2d['actions']['some'](_0xa93aed=>_0xa93aed['isEnabled']);});}_enableButtonById(_0x5093da,_0x20510f){this['_quickActionsDefinition']['forEach'](_0x32953d=>{'actions'in _0x32953d?_0x32953d['actions']['forEach'](_0x2f83a3=>{_0x2f83a3['id']===_0x5093da&&(_0x2f83a3['isEnabled']=_0x20510f(_0x2f83a3));}):_0x32953d['id']===_0x5093da&&(_0x32953d['isEnabled']=_0x20510f(_0x32953d));}),this['_actionButtons']['forEach'](_0x25bfdb=>{if(hc(_0x25bfdb['action']))return;if(_0x25bfdb['action']['id']!==_0x5093da)return;const _0x323dd3=_0x20510f(_0x25bfdb['action']);_0x25bfdb['action']['isEnabled']=_0x323dd3,_0x25bfdb['buttonView']['isEnabled']=_0x323dd3;});}_assignDefaultModelToCustomActions(_0x168b03){this['_actionButtons']['forEach'](_0x2f7243=>{hc(_0x2f7243['action'])||'action'===_0x2f7243['action']['type']&&(_0x2f7243['action']['model']||(_0x2f7243['action']['model']=_0x168b03));});}_initializeQuickActionsComponentsAndCommands(){const _0x3b8fbc=this['editor']['ui']['view']['body'];this['_initializeQuickActionsDropdown'](_0x3b8fbc),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x3b8fbc);}_initializeQuickActionsDropdown(_0x37c5d4){const _0x4b4671=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',ic({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x957fd2,'label':qs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x37c5d4,'hasSearch':_0x4b4671,'actionButtons':this['_actionButtons']}));}_prepareQuickActionsDefinition(_0x4e7822){this['_quickActionsDefinition']=_0x4e7822['map'](_0x4307b9=>{if('actions'in _0x4307b9){const _0x145ce6=_0x4307b9;return{..._0x145ce6,'actions':_0x145ce6['actions']['map'](_0x5c0492=>{const {actions:_0x17230b,..._0x1ae99b}=_0x145ce6;return{..._0x5c0492,'isEnabled':!0x1,'parent':_0x1ae99b};})['filter'](_0x16618c=>this['_shouldIncludeAction'](_0x16618c))};}return{..._0x4307b9,'isEnabled':!0x1};})['filter'](_0x5744c3=>'actions'in _0x5744c3?_0x5744c3['actions']['length']>0x0:this['_shouldIncludeAction'](_0x5744c3));}_shouldIncludeAction(_0x74bc44){const _0xc60cd2=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](oc[_0x74bc44['type']])&&!_0xc60cd2['includes'](_0x74bc44['id'])&&!('chat'===_0x74bc44['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}_initializeQuickActionsComponents(_0x17592e){this['_quickActionsDefinition']['forEach'](_0x5e9c3f=>{if('actions'in _0x5e9c3f){const _0x43f264=ic({'editor':this['editor'],'content':_0x5e9c3f['actions'],'buttonDefinition':_0x5e9c3f,'bodyCollection':_0x17592e,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e9c3f['id'],_0x43f264),_0x5e9c3f['actions']['forEach'](_0x599ab7=>{const _0x4a81d2=Xh({'editor':this['editor'],'action':_0x599ab7,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x599ab7['id'],_0x4a81d2);});}else{const _0x3e3d8d=Xh({'editor':this['editor'],'action':_0x5e9c3f,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1,'actionButtons':this['_actionButtons']});this['editor']['ui']['componentFactory']['add'](_0x5e9c3f['id'],_0x3e3d8d);}});}_initializeQuickActionsMenuBar(){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3aac6e=>{const _0x611ae2=this['editor']['commands']['get']('aiQuickAction'),_0x5bf99c=new _0x5e7fd5(_0x3aac6e),_0x14d582=qs(_0x3aac6e,'AI_QUICK_ACTIONS_HEADING');_0x5bf99c['buttonView']['set']({'label':_0x14d582,'icon':_0x957fd2});const _0x337614=new _0x1969ff(_0x3aac6e);return _0x337614['set']({'ariaLabel':_0x14d582,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x36229d=>{if('actions'in _0x36229d){const _0x415f8a=_0x36229d,_0x5e028f=new _0x5d5b51(_0x3aac6e,_0x5bf99c),_0x19c805=new _0x5e7fd5(_0x3aac6e),_0x379235=new _0x1969ff(_0x3aac6e);_0x19c805['buttonView']['set']({'label':_0x415f8a['label'],'icon':_0x415f8a['icon']}),_0x415f8a['actions']['forEach'](_0x2592cd=>{const _0x6b8b9e=new _0x5d5b51(_0x3aac6e,_0x19c805),_0x5084b5=new _0x410c15(_0x3aac6e);_0x5084b5['set']({'label':_0x2592cd['label'],'icon':_0x2592cd['icon'],'role':'menuitem','isEnabled':_0x2592cd['isEnabled']}),_0x5084b5['on']('execute',()=>{this['_executeQuickAction'](_0x2592cd);}),this['_actionButtons']['push']({'buttonView':_0x5084b5,'action':_0x2592cd}),_0x5084b5['delegate']('execute')['to'](_0x19c805),_0x6b8b9e['children']['add'](_0x5084b5),_0x379235['items']['add'](_0x6b8b9e);}),_0x19c805['isEnabled']=_0x415f8a['actions']['some'](_0xed05a8=>_0xed05a8['isEnabled']),this['_menuBarGroupViews']['push']({'view':_0x19c805,'group':_0x415f8a}),_0x19c805['panelView']['children']['add'](_0x379235),_0x5e028f['children']['add'](_0x19c805),_0x337614['items']['add'](_0x5e028f);}else{const _0x13d82f=_0x36229d,_0x64ccad=new _0x5d5b51(_0x3aac6e,_0x5bf99c),_0x3ea080=new _0x410c15(_0x3aac6e);_0x3ea080['set']({'label':_0x13d82f['label'],'icon':_0x13d82f['icon'],'role':'menuitem','isEnabled':_0x13d82f['isEnabled']}),this['_actionButtons']['push']({'buttonView':_0x3ea080,'action':_0x13d82f}),_0x3ea080['on']('execute',()=>{this['_executeQuickAction'](_0x13d82f);}),_0x3ea080['delegate']('execute')['to'](_0x5bf99c),_0x64ccad['children']['add'](_0x3ea080),_0x337614['items']['add'](_0x64ccad);}}),Object['values'](oc)['some'](_0x52e20a=>this['editor']['plugins']['has'](_0x52e20a))?_0x5bf99c['bind']('isEnabled')['to'](_0x611ae2):_0x5bf99c['set']({'isEnabled':!0x1}),_0x5bf99c['panelView']['children']['add'](_0x337614),_0x5bf99c;});}_executeQuickAction(_0xfb5849){const _0x2b77de=this['editor'];_0x2b77de['editing']['view']['focus'](),_0x2b77de['commands']['execute']('aiQuickAction',_0xfb5849);const _0x5579aa=_0x2b77de['ui']['view']['menuBarView'];_0x5579aa&&_0x5579aa['close']&&_0x5579aa['close']();}};function hc(_0xc9bd55){return'actions'in _0xc9bd55;}function cc(_0x2a534a,_0x2d615e){const _0x41df7d=_0x2a534a['plugins']['get']('AITabs')['view'];return _0x41df7d['isVisible']=!0x0,_0x41df7d['activateTabAwaitingConfirmation'](_0x2d615e);}var lc=class extends _0x3f0a57{execute(_0x1f3750){switch(_0x1f3750['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x560bb8=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x560bb8});}this['_handleAIChatAction'](_0x1f3750);break;case'action':if(this['_expandSelectionIfCollapsed'](),!this['editor']['plugins']['has']('AIActions')){const _0x5afb11=qs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new dt('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5afb11});}this['_handleAIActionsAction'](_0x1f3750);}}async _handleAIChatAction(_0x28217d){const _0x3eccfb=this['editor']['plugins']['get']('AIChatController');if(await cc(this['editor'],'chat')){if(this['_expandSelectionIfCollapsed'](),'ask-ai'===_0x28217d['id'])_0x3eccfb['removeSelectionFromChatContext'](),_0x3eccfb['addSelectionToChatContext'](this['editor']),_0x3eccfb['focusPromptInput']();else await _0x3eccfb['startConversation']({'modelId':_0x28217d['model'],'contexts':this['_resolveActionContexts'](_0x28217d)}),_0x3eccfb['removeSelectionFromChatContext'](),_0x3eccfb['addSelectionToChatContext'](this['editor']),_0x3eccfb['focusPromptInput'](),await _0x3eccfb['sendMessage']({'message':_0x28217d['prompt']||_0x28217d['displayedPrompt']||_0x28217d['label'],'attributes':{'quickActionData':{'id':_0x28217d['id']},'displayedPrompt':_0x28217d['displayedPrompt']}});}}_expandSelectionIfCollapsed(){const _0x5a29cb=this['editor'],_0x27a9d2=_0x5a29cb['model']['document']['selection'];if(!_0x27a9d2['isCollapsed'])return;const _0xbe2b5b=Ot(_0x27a9d2['getSelectedBlocks']())||_0x5a29cb['model']['schema']['getLimitElement'](_0x27a9d2);_0x5a29cb['model']['change'](_0x16819b=>{_0x16819b['setSelection'](_0xbe2b5b,'in');});}_handleAIActionsActionLabel(_0x2ea769){return _0x2ea769['parent']?.['label']&&'other'!==_0x2ea769['parent']?.['id']?_0x2ea769['parent']['label']+':\x20'+_0x2ea769['label']:_0x2ea769['label'];}async _handleAIActionsAction(_0x29bb8d){const _0x3d5a24=this['editor']['plugins']['get']('AIActions'),_0x328f78=this['_resolveActionContexts'](_0x29bb8d);let _0x542358;_0x542358=_0x29bb8d['prompt']?{'userMessage':_0x29bb8d['prompt'],'model':_0x29bb8d['model'],'contexts':_0x328f78}:_0x29bb8d['context']?{'model':_0x29bb8d['model'],'contexts':_0x328f78}:{'actionName':_0x29bb8d['actionName']||_0x29bb8d['id'],'args':_0x29bb8d['args'],'contexts':_0x328f78};const _0x45eb4f=this['_handleAIActionsActionLabel'](_0x29bb8d);await _0x3d5a24['executeAction'](_0x542358,_0x45eb4f,_0x29bb8d['icon']);}_resolveActionContexts(_0x532230){const _0x4d517a=_0x532230['parent']?.['id']?[_0x532230['id'],_0x532230['parent']['id']]:[_0x532230['id']];return this['editor']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':'quickActions','ids':_0x4d517a,'extraContexts':_0x532230['context']?[_0x532230['context']]:[],'context':new nr()})['refs'];}},uc=class extends _0x158c3f{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0xf224c8=this['editor'],_0x2eeba4=new lc(this['editor']);if(_0xf224c8['commands']['add']('aiQuickAction',_0x2eeba4),_0xf224c8['plugins']['has']('AIChat')){const _0x3d1902=this['editor']['plugins']['get']('AIChatController');_0xf224c8['model']['document']['selection']['on']('change:range',(_0x20efb2,_0x579d42)=>{_0x579d42['directChange']&&_0x3d1902['removeSelectionFromChatContext']();});}}},dc=class extends Nr{appendContent(_0x2ce918,_0x4bf8b1='text'){'modification'===this['type']&&'text'===_0x4bf8b1&&(_0x4bf8b1=this['documentContextContent']['keys']()['next']()['value']),super['appendContent'](_0x2ce918,_0x4bf8b1);}updateChangeGroups(_0x5a5f58){const _0x502190=this['parsedContent']['get'](_0x5a5f58)['cloneNode'](!0x0);if(this['parsedMergedContent']['set'](_0x5a5f58,_0x502190),this['changeGroups']=[],0x0==_0x502190['childNodes']['length'])return;qn(this['documentContextContent']['get'](_0x5a5f58),this['parsedMergedContent']['get'](_0x5a5f58));const _0x474e60=this['documentContextContent']['get'](_0x5a5f58)['children']['map'](_0x794424=>({'node':_0x794424,'id':ln(_0x794424,'data-id')})),_0x3d8ac2=_0x502190['children']['map'](_0x4ab90d=>({'node':_0x4ab90d,'id':ln(_0x4ab90d,'data-id')||Xt()})),_0x2539ff=_0x3874b5(_0x474e60,_0x3d8ac2,{'comparator':(_0x11ba49,_0x32cd81)=>_0x11ba49['id']==_0x32cd81['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x2539ff['length']&&_0x2539ff[_0x2539ff['length']-0x1]['removed'];)_0x2539ff['pop']();}const _0x35d865=_0x2539ff['map'](_0x4c4eda=>{const _0x7e9822=_0x4c4eda['added']?'new':_0x4c4eda['removed']?'removed':'modified';return{'node':_0x4c4eda['value'][0x0]['node'],'type':_0x7e9822,'id':_0x4c4eda['value'][0x0]['id']};}),_0x1d8c51=this['_documentIdToSource']['get'](_0x5a5f58);this['changeGroups']['push']({'changes':_0x35d865,'state':'pending','index':this['changeGroups']['length'],'editor':_0x1d8c51['editor'],'rootName':_0x1d8c51['rootName'],'documentId':_0x5a5f58});}_getDifferentChangeGroups(_0x444a00,_0x119838){return _0x119838;}},_c=class extends Lr{content;['version'];editor;rootName;actionName;['args'];['userMessage'];['model'];context;['hasError']=!0x1;stoppedExplicitly=!0x1;constructor(_0x2c50f7){super(_0x2c50f7),this['content']=_0x2c50f7['content'],this['version']=_0x2c50f7['version'],this['editor']=_0x2c50f7['editor'],this['rootName']=_0x2c50f7['rootName'],this['actionName']=_0x2c50f7['actionName'],this['args']=_0x2c50f7['args'],this['userMessage']=_0x2c50f7['userMessage'],this['model']=_0x2c50f7['model'],this['context']=new nr(_0x2c50f7['contexts']),this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}sendRequest(){const _0x2a566a=this['context']['toRequestContexts']();return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args'],'contexts':_0x2a566a}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html','contexts':_0x2a566a});}getDocumentContext(){return{'type':'document','documents':[{'id':this['id'],'content':this['content'],'version':this['version'],'rootName':this['rootName'],'sessionId':Xt(),'channelId':this['editor']['config']['get']('collaboration.channelId'),'selectionSignature':''}],'label':'Current\x20document','uiId':'current-document'};}createReply(_0x16d08a){const _0x4dccbd=this['editor']['config']['get']('collaboration.channelId'),_0x49e6d3=new dc({..._0x16d08a,'locale':this['locale'],'documentContextContent':[{'id':this['id'],'content':this['content'],'channelId':_0x4dccbd,'rootName':this['rootName']}],'channelsToEditors':new Map([[_0x4dccbd,this['editor']]])});return this['replies']['push'](_0x49e6d3),_0x49e6d3['delegate'](...xr)['to'](this),this['fire']('replyCreated',_0x49e6d3),_0x49e6d3;}},gc=class extends Hh{['focusCycler'];_skeletonView;['_focusTracker'];_keystrokes;['_focusables'];_navigationPreviousButton;_navigationNextButton;_navigationTryAgainButton;_navigationCounter;constructor(_0x2e8c39,_0x2cd2d4){super(_0x2e8c39,{'showChangesButtonMode':'icon',..._0x2cd2d4}),this['set']('isBusy',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_focusTracker']=new Et(),this['_keystrokes']=new pt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_setupToolbar'](),this['_createSkeletonView'](),this['_setupMiniToolbar'](),this['_focusables']['clear'](),this['_focusables']['addMany']([this['_miniToolbarView'],this['_toolbarView']]),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-main'],'style':{'width':this['bindTemplate']['to']('width')}}});}['render'](){super['render']();for(const _0x2550b0 of this['_focusables'])this['_focusTracker']['add'](_0x2550b0['element']);this['_keystrokes']['listenTo'](this['element']);}['focus'](_0x17dfb3){-0x1===_0x17dfb3?this['focusCycler']['focusLast']():this['_toolbarView']['primaryActionButton']['focus']();}setErrorState(){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}clearErrorState(){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x479da8){super['showBlockingError'](_0x479da8),this['setErrorState']();}addMiniToolbarItem(_0x560a04){this['_miniToolbarView']['items']['has'](_0x560a04)||this['_miniToolbarView']['items']['add'](_0x560a04);}removeMiniToolbarItem(_0x2bbd68){this['_miniToolbarView']['items']['has'](_0x2bbd68)&&this['_miniToolbarView']['items']['remove'](_0x2bbd68);}setIsLoading(_0x4e61cc){this['_isLoading']=_0x4e61cc;}finalizeContent(){this['_streamableContentView']['cleanUpStreamingArtifacts']();}_setupToolbar(){this['_toolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',this,'_hasError',(_0x3ea6f6,_0x2d7dbb,_0x2216d2)=>!(_0x3ea6f6||_0x2d7dbb||_0x2216d2));}_setupMiniToolbar(){this['_miniToolbarView']['delegate'](...$r)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x4545a1,_0x3b04b5)=>!(_0x4545a1||_0x3b04b5));}_createSkeletonView(){this['_skeletonView']=new lo(this['locale'],uo['aiActionsBalloon']),this['_skeletonView']['bind']('isVisible')['to'](this,'_isLoading',this,'_isErrorVisible',(_0x444444,_0x60e326)=>_0x444444&&!_0x60e326),this['_contentChildren']['add'](this['_skeletonView']);}_setupMiniToolbarButtons(){const _0x39f4e6=new _0x1a9216(this['locale']),_0x4ac700=new _0x1a9216(this['locale']),_0x2f95ae=new Ic(this['locale']),_0x562d98=new _0x1a9216(this['locale']);_0x39f4e6['set']({'icon':_0x34fe5e,'label':qs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':Ar}),_0x4ac700['set']({'icon':_0x33c89a,'tooltip':qs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Ar}),_0x562d98['set']({'icon':_0x4273a3,'tooltip':qs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Ar}),_0x39f4e6['bind']('isEnabled')['to'](this,'isBusy',_0x3b3b2f=>!_0x3b3b2f),_0x39f4e6['on']('execute',()=>{this['fire']('tryAgain');}),_0x4ac700['bind']('isEnabled')['to'](this,'isBusy',_0x2fed1b=>!_0x2fed1b),_0x4ac700['on']('execute',()=>{this['fire']('showPrevious');}),_0x562d98['bind']('isEnabled')['to'](this,'isBusy',_0x31a995=>!_0x31a995),_0x562d98['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4ac700,this['_navigationCounter']=_0x2f95ae,this['_navigationNextButton']=_0x562d98,this['_navigationTryAgainButton']=_0x39f4e6;}updateMiniToolbarButtons(_0x4ec08a,_0x47da5c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1633a7=_0x4ec08a>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1633a7){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x2b02d1=_0x4ec08a-_0x47da5c;this['_navigationCounter']['setInteractionCount'](_0x2b02d1,_0x4ec08a),this['_navigationPreviousButton']['isEnabled']=_0x47da5c<_0x4ec08a-0x1,this['_navigationNextButton']['isEnabled']=_0x47da5c>0x0;}else this['removeMiniToolbarItem'](this['_navigationPreviousButton']),this['removeMiniToolbarItem'](this['_navigationCounter']),this['removeMiniToolbarItem'](this['_navigationNextButton']);}disableMiniToolbarButtons(){this['_navigationTryAgainButton']['isEnabled']=!0x1,this['_navigationPreviousButton']['isEnabled']=!0x1,this['_navigationNextButton']['isEnabled']=!0x1;}setShowChangesButton(_0xa70836){this['_miniToolbarView']['isShowChangesOn']=_0xa70836;}adjustWidthToEditable(_0x52e631){const _0x5bc17b=Wh({'domRoot':_0x52e631,'innerElement':this['_streamableContentView']['element'],'outerElement':this['element'],'widthCustomProperty':'--ck-ai-actions-balloon-width'});_0x5bc17b&&(this['width']=_0x5bc17b);}},Ic=class extends _0x2df458{constructor(_0xc3eb1f){super(_0xc3eb1f);const _0x3aa092=this['bindTemplate'];this['set']('currentInteraction',0x1),this['set']('totalInteractions',0x1),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x3aa092['to']('currentInteraction')},{'text':_0x3aa092['to']('totalInteractions',_0x3f9400=>'\x20/\x20'+_0x3f9400)}]});}setInteractionCount(_0x3e4e5f,_0x60e369){this['set']({'currentInteraction':_0x3e4e5f,'totalInteractions':_0x60e369});}},Ac=class extends _0x158c3f{static get requires(){return[$s,dr,_0x3fa2e4,Pn,Gh,Un];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_aiConnector;_interactions=[];_currentInteractionIndex=0x0;_interactionParams;['_balloonShowDiff']=!0x0;['_promiseQueue'];get _interaction(){return this['_interactions'][this['_interactions']['length']-0x1];}_actionsBalloonView;_reporter;constructor(_0xe50a64){super(_0xe50a64),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['_reporter']=this['editor']['plugins']['get'](dr)['createReporter']('aiactions'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Ao();}stopInteraction(){this['_stopInteraction']();}async executeAction(_0x4e825c,_0x342dc8,_0xfde829){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')&&this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x5bcb27,anchorData:_0x343f82,root:_0x53c12b}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4e825c,_0x5bcb27,_0x343f82,_0x53c12b,_0x342dc8,_0xfde829);}const {modelFragment:_0x3bbdde,anchorData:_0x4486a0,root:_0x194cb0}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4e825c,_0x3bbdde,_0x4486a0,_0x194cb0,_0x342dc8,_0xfde829);}async destroy(){return this['_stopInteraction'](),super['destroy']();}_createActionsBalloonView(){const _0x18a180=this['editor']['plugins']['has']('TrackChanges');let _0x2c71f1=this['editor']['config']['get']('ai.availableReplyActions')||[...po];_0x18a180||(_0x2c71f1=_0x2c71f1['filter'](_0x55cfe9=>'insertSuggestion'!=_0x55cfe9));const _0x7a6653=this['editor']['commands']['get']('trackChanges'),_0x1ab45d=new gc(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x18a180,'availableActions':_0x2c71f1});return _0x1ab45d['bind']('isBusy')['to'](this),_0x1ab45d['setShowChangesButton'](this['_balloonShowDiff']),_0x1ab45d['bind']('isTargetReadOnly')['to'](this['editor'],'isReadOnly'),_0x7a6653&&_0x1ab45d['bind']('isTrackChangesOn')['to'](_0x7a6653,'value'),_0x1ab45d['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x1ab45d['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x1ab45d['on']('showNext',()=>{this['_navigateToNext']();}),_0x1ab45d;}_normalizeSelectionStart(){const _0x1d15ff=this['editor']['model'],_0x5e356a=_0x1d15ff['document']['selection'],_0x1743bb=_0x5e356a['getFirstRange']();if(!_0x1743bb||_0x1743bb['isCollapsed'])return;const _0x3738d5=Ot(_0x5e356a['getSelectedBlocks']());if(!_0x3738d5)return;const _0x43e7e0=_0x1d15ff['createPositionAt'](_0x3738d5,0x0);_0x43e7e0['isAfter'](_0x1743bb['start'])&&_0x1d15ff['change'](_0x1e1d57=>{_0x1e1d57['setSelection'](_0x1e1d57['createRange'](_0x43e7e0,_0x1743bb['end']));});}_getExecuteDataRegular(){const _0x9f6b3a=this['editor']['model']['document']['selection'],_0x173207=_0x9f6b3a['getFirstRange']()['start']['root'];if(_0x9f6b3a['isCollapsed']){const _0x17b1ea=Ot(_0x9f6b3a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x9f6b3a);this['editor']['model']['change'](_0x3e2f99=>{_0x3e2f99['setSelection'](_0x17b1ea,'in');});}this['_normalizeSelectionStart']();const _0x3f1e1e=_0x9f6b3a['getFirstRange'](),_0x52450b=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x9f6b3a),_0x3f1e1e['start'],_0x3f1e1e['end']);this['_copyMarkersToFragment'](_0x52450b,_0x9f6b3a,{'isTableSelection':!0x1});const _0x1cb6df=_0x9f6b3a['getFirstRange']()['start'],_0x2c3de8=new Map();let _0xaa8561=_0x52450b;for(let _0x1088f5=0x0;_0x1088f5<_0x1cb6df['path']['length'];_0x1088f5++)_0x2c3de8['set'](_0xaa8561,_0x1cb6df['path'][_0x1088f5]),_0xaa8561=_0xaa8561['getChild'](0x0);return{'modelFragment':_0x52450b,'anchorData':_0x2c3de8,'root':_0x173207};}_getExecuteDataInTable(){const _0x4b0457=this['editor']['model']['document']['selection'],_0xbdffc0=this['editor']['plugins']['get']('TableSelection'),_0x5c5d3f=_0x4b0457['getFirstRange']()['start']['root'],_0x5bcfff=_0xbdffc0['getSelectionAsFragment'](),_0x1e460e=_0x4b0457['getFirstRange']()['start']['parent']['parent'],_0x58490c=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x1e460e),this['editor']['model']['createPositionAfter'](_0x1e460e)),_0xa8bf3=this['_wrapWithCommonAncestors'](_0x5bcfff,_0x58490c['start'],_0x58490c['end']);this['_copyMarkersToFragment'](_0xa8bf3,_0x4b0457,{'isTableSelection':!0x0});const _0xf92072=_0x4b0457['getFirstRange']()['start'],_0x5f02e2=new Map();let _0x3e92e9=_0xa8bf3;for(let _0x17bf5e=0x0;_0x17bf5e<_0xf92072['path']['length'];_0x17bf5e++)if(_0x5f02e2['set'](_0x3e92e9,_0xf92072['path'][_0x17bf5e]),_0x17bf5e<_0xf92072['path']['length']-0x1)_0x3e92e9=_0x3e92e9['getChild'](0x0);else{let _0x4d73ad=_0x3e92e9['nextSibling'];for(;_0x4d73ad;)_0x5f02e2['set'](_0x4d73ad,_0xf92072['path'][_0x17bf5e]),_0x4d73ad=_0x4d73ad['nextSibling'];}return{'modelFragment':_0xa8bf3,'anchorData':_0x5f02e2,'root':_0x5c5d3f};}async _executeAction(_0x4eaa94,_0x629f47,_0x4f3244,_0x393c16,_0x1a863c,_0x1d9fa4){const _0x326c01=this['editor']['plugins']['get'](Pn),_0xe8bf43=this['editor']['plugins']['get'](Gh),_0x15bf3c=this['editor']['model']['document']['selection'],_0x19053f=await _0x326c01['modelToDataWithIds'](_0x629f47,this['editor'],_0x393c16['rootName']),_0x567258=this['editor']['model']['document']['version'],_0x2a1baa=[..._0x15bf3c['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),_0xe8bf43['open']({'targetEditor':this['editor'],'index':0x3e8*Math['random']()%0x3e8,'title':_0x1a863c,'icon':_0x1d9fa4||_0x957fd2,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2a1baa,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xe8bf43),this['_interactionParams']={'action':_0x4eaa94,'content':_0x19053f,'version':_0x567258,'aiBalloon':_0xe8bf43,'modelFragment':_0x629f47,'anchorData':_0x4f3244,'root':_0x393c16},this['_setupApplyListeners'](),this['listenTo'](_0xe8bf43,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0xe8bf43,'dialogClosed',(_0x3df1d9,{id:_0x58eb8e})=>{if('aiActionsBalloon'===_0x58eb8e){for(const _0x77a667 of this['_interactions']){if(0x0===_0x77a667['replies']['length']||_0x77a667['stoppedExplicitly'])continue;const _0x449b7b=_0x77a667['replies'][_0x77a667['replies']['length']-0x1],_0x332cf0=_0x449b7b['changeGroups'][0x0];_0x332cf0&&'pending'===_0x332cf0['state']&&_0x449b7b['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0xe8bf43);}}),this['_createInteraction'](_0x19053f,_0x567258,_0xe8bf43,_0x4eaa94);}_setupApplyListeners(){if(!this['_interactionParams'])return;const {modelFragment:_0x33d95a,anchorData:_0x4c0e8a,root:_0xde8a36}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x33d95a,_0x4c0e8a,_0xde8a36,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x33d95a,_0x4c0e8a,_0xde8a36,!0x0);}),this['listenTo'](this['_actionsBalloonView'],'rejectSuggestion',()=>{this['editor']['plugins']['get']('AIBalloon')['close']();});}_wrapWithCommonAncestors(_0x5ce274,_0x109000,_0x4576ab){const _0x273a36=this['editor']['model']['createRange'](_0x109000,_0x4576ab)['getCommonAncestor'](),_0x20c783=_0x273a36['is']('documentFragment')?[]:_0x273a36['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x20c783['length']){const _0x5511e1=_0x20c783['map'](_0x57f249=>_0x57f249['_clone'](!0x1));for(let _0x3f6dfe=0x1;_0x3f6dfe<_0x5511e1['length'];_0x3f6dfe++)_0x5511e1[_0x3f6dfe-0x1]['_appendChild'](_0x5511e1[_0x3f6dfe]);return _0x5511e1[_0x5511e1['length']-0x1]['_appendChild'](_0x5ce274),new _0x1f9306(_0x5511e1[0x0]);}return _0x5ce274;}_copyMarkersToFragment(_0x2964b2,_0x11c79c,_0x1c79e7={'isTableSelection':!0x1}){const _0x24f03a=this['editor']['model'],_0x3be9b=Array['from'](_0x11c79c['getRanges']()),_0x4c3e75=_0x11c79c['getFirstRange']()['start'];for(const _0x13d5bc of _0x24f03a['markers']){if(_0x13d5bc['name']['startsWith']('ai-selection')||!_0x13d5bc['affectsData'])continue;const _0x1986c4=_0x13d5bc['getRange']();if(!_0x3be9b['some'](_0x4a8e7f=>_0x4a8e7f['containsRange'](_0x1986c4,!0x0)))continue;const _0x35a8f8=this['_regularCalculateMarkerPath'](_0x1986c4['start'],_0x4c3e75,_0x1c79e7['isTableSelection']),_0x16dbf5=this['_regularCalculateMarkerPath'](_0x1986c4['end'],_0x4c3e75,_0x1c79e7['isTableSelection']),_0x4c04eb=_0x24f03a['createPositionFromPath'](_0x2964b2,_0x35a8f8),_0x1d76d7=_0x24f03a['createPositionFromPath'](_0x2964b2,_0x16dbf5);if(!_0x4c04eb['isEqual'](_0x1d76d7)){const _0x16f9db=_0x24f03a['createRange'](_0x4c04eb,_0x1d76d7);_0x2964b2['markers']['set'](_0x13d5bc['name'],_0x16f9db);}}}_regularCalculateMarkerPath(_0x29cf62,_0x751a03,_0x281701=!0x1){const _0x450d27=[..._0x29cf62['path']['slice']()];for(let _0x549662=0x0;_0x549662<Math['max'](_0x751a03['path']['length'],_0x29cf62['path']['length']);_0x549662++){const _0x5cd94c=_0x751a03['path'][_0x549662]||0x0,_0x493612=(_0x29cf62['path'][_0x549662]||0x0)-_0x5cd94c;if(_0x450d27[_0x549662]=_0x493612,0x0!==_0x493612&&!_0x281701)break;}return _0x450d27;}async _createInteraction(_0x38ee8e,_0x109a34,_0x4791fe,_0x527e3e){const _0x449294=this['editor'],_0x890f30=_0x449294['model']['document']['selection']['getFirstRange']()['start']['root'];this['_interactionParams']||(this['_interactionParams']={'action':_0x527e3e,'content':_0x38ee8e,'version':_0x109a34,'aiBalloon':_0x4791fe,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':_0x890f30});const _0x1cfc22=new _c({'connector':this['_aiConnector'],'locale':_0x449294['locale'],'content':_0x38ee8e,'version':_0x109a34,'editor':_0x449294,'rootName':_0x890f30['rootName'],..._0x527e3e});this['_interactions']['push'](_0x1cfc22);const _0x11e642=(_0xed1fe5,_0x49bf31=this['_balloonShowDiff'])=>this['_promiseQueue']['enqueue'](async _0x4a1604=>{try{if(this['_isUnsupportedInlineRootChange'](_0xed1fe5,_0x890f30))return this['_actionsBalloonView']['showBlockingError'](qs(_0x449294['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')),void this['_actionsBalloonView']['finalizeContent']();const _0x3bd558=wr({'changeGroups':_0xed1fe5['changeGroups'],'documentContextContent':_0xed1fe5['documentContextContent'],'showDiff':_0x49bf31,'trimUnchanged':!0x1});_0x3bd558['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x3bd558[0x0],'renderingStrategy':'static','abortSignal':_0x4a1604,'keepErrors':!_0xed1fe5['isComplete']}),this['_actionsBalloonView']['finalizeContent']();}catch(_0xbda798){if(lr(_0xbda798))return;throw _0xbda798;}});_0x1cfc22['on']('replyContentUpdated',(_0x4bf105,_0x589792)=>{_0x589792['isDone']&&_0x11e642(_0x589792)['catch'](_0x200434=>{this['_reporter']['logError'](_0x200434,{'context':{'operation':'reply-update'}}),this['_setErrorState'](_0x1cfc22,_0x200434);});}),_0x1cfc22['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x5eb8b3){this['_reporter']['logError'](_0x5eb8b3,{'context':{'operation':'interaction-finish'}}),this['_setErrorState'](_0x1cfc22,_0x5eb8b3);}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x1a3733,{showDiff:_0x1a196f})=>{try{this['_balloonShowDiff']=_0x1a196f;const _0xc57817=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xc57817&&await _0x11e642(_0xc57817,_0x1a196f);}catch(_0x3b4560){this['_reporter']['logError'](_0x3b4560,{'context':{'operation':'toggle-suggestion-display'}}),this['_setErrorState'](_0x1cfc22,_0x3b4560);}}),_0x1cfc22['on']('replyChangeGroupStateUpdated',()=>{const _0x4fa6b7={'positiveCount':_0x1cfc22['replies']['reduce']((_0x26e19c,_0x573ae3)=>_0x26e19c+_0x573ae3['changeGroups']['filter'](_0x31e391=>'accepted'===_0x31e391['state'])['length'],0x0),'totalCount':_0x1cfc22['replies']['reduce']((_0x74460a,_0x3d9a73)=>_0x74460a+_0x3d9a73['changeGroups']['length'],0x0)},_0x44c5af=_0x1cfc22['actionCallId'],_0x451a76=_0x1cfc22['actionName'];_0x451a76?this['_aiConnector']['upsertAIActionRating'](_0x451a76,_0x44c5af,_0x4fa6b7):this['_aiConnector']['upsertCustomAIActionRating'](_0x44c5af,_0x4fa6b7);}),this['_setLoadingState']();try{const _0x141035=await _0x1cfc22['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x141035;}catch(_0x457fd5){lr(_0x457fd5)||this['_actionsBalloonView']['setIsLoading'](!0x1),this['_reporter']['logError'](_0x457fd5,{'context':{'operation':'create-interaction'}}),this['_setErrorState'](_0x1cfc22,_0x457fd5);}}_isUnsupportedInlineRootChange(_0x4205a8,_0x5d0117){const _0x1d1b08=this['editor'];if(!En(_0x1d1b08,_0x5d0117['rootName']))return!0x1;return!wn(_0x1d1b08,new _0x47233a((_0x4205a8['changeGroups'][0x0]?.['changes']??[])['filter'](_0x2f96ee=>'removed'!==_0x2f96ee['type'])['map'](_0xd0b808=>_0xd0b808['node']['cloneNode'](!0x0))));}['_applyChanges'](_0x36267f,_0x3ac0ad,_0x7f1b08,_0x10f157){const _0x545ae6=this['editor'];if(_0x10f157&&!_0x545ae6['plugins']['has']('TrackChanges'))throw new dt('ai-no-track-changes',null);const _0x41f36e=this['editor']['plugins']['get'](Un),_0x3957fb=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3957fb||!_0x3957fb['replies']['length'])return;const _0x224cfe=_0x3957fb['replies'][_0x3957fb['replies']['length']-0x1];if(this['_isUnsupportedInlineRootChange'](_0x224cfe,_0x7f1b08))return void this['_actionsBalloonView']['showBlockingError'](qs(_0x545ae6['locale'],'AI_SUGGESTION_NO_PARTS_WARNING'));_0x224cfe['setChangeGroupState'](0x0,'accepted');const _0x5a2e8d=Gr({'documentSuggestions':Wr({'groups':[_0x224cfe['changeGroups'][0x0]],'documentContextContent':_0x224cfe['documentContextContent'],'documents':_0x3957fb['getDocumentContext']()['documents']}),'transform':!0x1,'documentChanges':_0x41f36e,'documentChangesOptions':{'anchor':_0x545ae6['model']['createPositionAt'](_0x36267f,0x0),'markDeletions':_0x10f157}})['values']()['next']()['value']??[],_0x3ce61f=this['_filterOperationsOutsideRange'](_0x5a2e8d,_0x3ac0ad);for(const _0x22fd78 of _0x3ce61f)this['_anchorOperation'](_0x3ac0ad,_0x22fd78,_0x7f1b08);const _0x42ace4=_0x3957fb['getDocumentContext']()['documents'][0x0]['version'],_0x3f5c93=_0x545ae6['model']['document']['history']['getOperations'](_0x42ace4),_0x175f2a={'document':_0x545ae6['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x30a101=_0x3e782f(_0x3ce61f,_0x3f5c93,_0x175f2a)['operationsA'];jn(_0x30a101,'quickActions');try{_0x545ae6['model']['change'](_0x19989f=>{_0x19989f['setSelection'](_0x545ae6['model']['document']['selection']['focus']),_0x10f157?_0x545ae6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x30a101):_0x41f36e['applyOperations'](_0x19989f,_0x30a101);});}catch(_0x4540eb){throw this['_reporter']['logError'](new ur({'code':'ai-applying-suggestion-failed','type':'runtime','cause':_0x4540eb})),_0x4540eb;}this['editor']['plugins']['get']('AIBalloon')['close']();}_filterOperationsOutsideRange(_0xc47264,_0x2020a8){return _0xc47264['filter'](_0x14c28c=>{if('rename'==_0x14c28c['type']){const _0x393d60=_0x14c28c['position']['nodeAfter'];return!_0x2020a8['has'](_0x393d60);}if(_0x14c28c['type']['indexOf']('Attribute')>-0x1){const _0x201868=_0x14c28c['range']['start']['nodeAfter'];return!_0x2020a8['has'](_0x201868);}return!0x0;});}_anchorOperation(_0x5b9667,_0x118def,_0x420ffd){const _0x23c7f9=_0x118def['clone']();for(const _0x28c87b in _0x118def){const _0x2c455a=_0x118def[_0x28c87b];_0x2c455a instanceof _0x3aaa22?_0x118def[_0x28c87b]=new _0x3aaa22(_0x5b9bdf(_0x2c455a['start']),_0x5b9bdf(_0x2c455a['end'])):_0x2c455a instanceof _0x265910&&(_0x118def[_0x28c87b]=_0x5b9bdf(_0x2c455a));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x23c7f9['type'])){if(_0x23c7f9['isDocumentOperation']=!0x1,_0x23c7f9['baseVersion']=null,'remove'==_0x23c7f9['type']){const _0x205f9e=_0x23c7f9['sourcePosition'],_0x88e6ce=_0x23c7f9['howMany'];new _0x500e5d(_0x205f9e,_0x88e6ce)['_execute']();}else _0x23c7f9['_execute']();}function _0x5b9bdf(_0x31b8e3){if('$graveyard'==_0x31b8e3['root']['rootName'])return _0x31b8e3;const _0x3c31bd=[];let _0x540338=_0x31b8e3['root'];for(let _0x5adce3=0x0;_0x5adce3<_0x31b8e3['path']['length'];_0x5adce3++){const _0x1747f0=_0x5b9667['get'](_0x540338)||0x0;_0x3c31bd[_0x5adce3]=_0x31b8e3['path'][_0x5adce3]+_0x1747f0,_0x540338=_0x540338['getChildAtOffset'](_0x31b8e3['path'][_0x5adce3]);}return new _0x265910(_0x420ffd,_0x3c31bd,_0x31b8e3['stickiness']);}}_refreshInteraction(){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0;const {action:_0x2d425c,content:_0x1f0964,version:_0x3fa7fa,aiBalloon:_0x5c55e8}=this['_interactionParams'];this['_clearErrorState'](),this['_actionsBalloonView']['clearContent'](),this['_actionsBalloonView']['setIsLoading'](!0x0),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),this['stopListening'](this['_actionsBalloonView']),this['_setupApplyListeners'](),this['_createInteraction'](_0x1f0964,_0x3fa7fa,_0x5c55e8,_0x2d425c)['catch'](_0x517df4=>{this['_reporter']['logError'](_0x517df4,{'context':{'operation':'refresh-interaction'}});});}_clearInteractionHistory(){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_stopInteraction(){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_actionsBalloonView']&&!this['_actionsBalloonView']['_isErrorVisible']&&this['_actionsBalloonView']['setIsLoading'](!0x1);}_navigateToPrevious(){const _0x3444d4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x3444d4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}_navigateToNext(){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async _displayInteractionAtIndex(_0x29e09a){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x29e09a;const _0x4c2d55=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4c2d55)return;if(_0x4c2d55['hasError'])return this['_setErrorState'](_0x4c2d55),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x4c2d55['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2b6244=_0x4c2d55['replies'][_0x4c2d55['replies']['length']-0x1];if(_0x2b6244)try{const _0x26966a=wr({'changeGroups':_0x2b6244['changeGroups'],'documentContextContent':_0x2b6244['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2a558a=>setTimeout(_0x2a558a,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x26966a[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x213091){this['_reporter']['logError'](_0x213091,{'context':{'operation':'navigation-update'}});}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}_setLoadingState(){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async _setErrorState(_0x2850c5,_0x3c2276){if(void 0x0!==_0x3c2276&&lr(_0x3c2276))return;const _0x402fd3=qs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x402fd3),_0x2850c5['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['setIsLoading'](!0x0);}_clearErrorState(){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['setIsLoading'](!0x1);}async _clearLoadingState(){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}},Ec=class extends _0x158c3f{static get requires(){return[ac,uc,Ac];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x515f76){super(_0x515f76),_0x515f76['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}},pc=class extends _0x2df458{['dropdownView'];constructor(_0x3c039c,_0xb9bbb2){super(_0x3c039c),this['set']('hasPendingChanges',!0x0),this['dropdownView']=this['_createDropdown'](_0x3c039c,_0xb9bbb2),this['setTemplate']({'tag':'div','children':[this['dropdownView']],'attributes':{'class':[this['bindTemplate']['if']('isVisible','ck-hidden',_0x50ce2f=>!_0x50ce2f)]}});}_createDropdown(_0xf3a83e,_0x4b7c5b){const _0x46d68e=_0x4c754a(_0xf3a83e);_0x46d68e['set']({'class':'ck-ai_review__complete-review-dropdown'}),_0x46d68e['panelPositionLimiter']=()=>{const _0x3ef3ef=_0x46d68e['buttonView']['element'];return _0x3ef3ef&&St(_0x3ef3ef);},_0x46d68e['on']('execute',_0x30df0=>{_0x30df0['source']['onClick']();}),_0x46d68e['buttonView']['set']({'label':qs(_0xf3a83e,'AI_REVIEW_MODE_COMPLETE_REVIEW'),'class':_0x4b7c5b,'withText':!0x0});const _0x1caa01=new _0x13bdb1({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('acceptAllChanges')});_0x1caa01['bind']('label')['to'](this,'isAnyResultReviewed',_0x417d5e=>qs(_0xf3a83e,_0x417d5e?'AI_REVIEW_MODE_ACCEPT_REMAINING':'AI_REVIEW_MODE_ACCEPT_ALL')),_0x1caa01['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x5bddfc=new _0x13bdb1({'withText':!0x0,'role':'menuitem','onClick':()=>this['fire']('rejectAllChanges')});_0x5bddfc['bind']('label')['to'](this,'isAnyResultReviewed',_0x865632=>qs(_0xf3a83e,_0x865632?'AI_REVIEW_MODE_REJECT_REMAINING':'AI_REVIEW_MODE_REJECT_ALL')),_0x5bddfc['bind']('isEnabled')['to'](this,'hasPendingChanges');const _0x50cf5e=new _0x13bdb1({'withText':!0x0,'label':qs(_0xf3a83e,'AI_REVIEW_MODE_EXIT_REVIEW'),'role':'menuitem','onClick':()=>this['fire']('leaveReviewCoreResultList')}),_0x5ca60c=new _t([{'type':'button','model':_0x1caa01},{'type':'button','model':_0x5bddfc},{'type':'separator'},{'type':'button','model':_0x50cf5e}]);return _0x34e876(_0x46d68e,_0x5ca60c,{'role':'menu'}),_0x46d68e;}};const mc={'title':'AI_REVIEW_MODE_CONTENT_PART_TITLE','apply':'AI_REVIEW_MODE_ACCEPT_CHANGE','suggest':'AI_REVIEW_MODE_SUGGEST_CHANGE','reject':'AI_REVIEW_MODE_DISMISS_CHANGE','stateAccepted':'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED','stateRejected':'AI_REVIEW_MODE_CHECK_STATUS_REJECTED','stateOutdated':'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'};var Tc=class AIReviewCoreNavigationPanelView extends Jt{_previousButtonView;_nextButtonView;_toggleDiffButtonView;_completeReviewDropdownView;_acceptButtonView;_suggestButtonView;_dismissButtonView;_stateView;['_changeId']='';_pinOptions=void 0x0;_getTarget;['_reflowObservers']=[];constructor(_0x28be19,_0x26e6bd){super(_0x28be19),this['set']({'isVisible':!0x1,'position':'arrow_se','class':null,'top':0x0,'left':0x0}),this['set']('changeIndex',0x0),this['set']('changesCount',0x0),this['set']('hasChangesToNavigate',!0x1),this['set']('isDiffOn',!0x1),this['set']('isAnyResultReviewed',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isError',!0x1),this['set']('isResultReady',!0x1),this['set']('changeStatus','pending'),this['bind']('counterLabel')['to'](this,'changeIndex',this,'changesCount',(_0x919758,_0x3ba594)=>qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_COUNTER',[_0x919758,_0x3ba594])),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel-balloon'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x26e6bd['add'](this);}get['changeId'](){return this['_changeId'];}updateContent(_0x4762ac){this['_acceptButtonView']['isVisible']=_0x4762ac['isAcceptButtonVisible'],this['_suggestButtonView']['isVisible']=_0x4762ac['isSuggestButtonVisible'],this['_changeId']=_0x4762ac['change']['id'],this['changeStatus']=_0x4762ac['change']['status'],this['updateChangePosition'](_0x4762ac['position']);}updateChangePosition(_0x46587b){this['changeIndex']=_0x46587b['index'],this['changesCount']=_0x46587b['total'],this['hasChangesToNavigate']=_0x46587b['pendingCount']>('pending'===this['changeStatus']?0x1:0x0);}updateChangeState(_0x3955a6,_0x7e96ec){_0x3955a6===this['_changeId']&&(this['changeStatus']=_0x7e96ec);}['showPanel'](_0x57e138){const {getTarget:_0x14b99c,domEvent:_0x4029f9,limiter:_0x4454d7,viewportOffset:_0x388313}=_0x57e138;this['updateContent'](_0x57e138);const _0xbb2de1=_0x14b99c();if(!_0xbb2de1)return void this['hidePanel']();this['_prepareMoveAnimation'](),this['_getTarget']=_0x14b99c,this['show']();const _0x1aaca4=Array['from'](_0xbb2de1['getClientRects']())['reverse'](),_0x5c34ce=this['_getPointedRectIndexFromEvent'](_0x4029f9,_0x1aaca4),_0x3ebed1=_0x1aaca4[_0x5c34ce??0x0];this['_pinOptions']={'target':()=>(this['_stretchToDocument'](_0x4454d7),this['_getBestRectPosition'](_0x14b99c(),_0x5c34ce,_0x4454d7,_0x388313)||_0x3ebed1),'positions':this['_createPanelPositions'](),..._0x4454d7?{'limiter':_0x4454d7}:{}},this['pin'](this['_pinOptions']),this['_observeDocumentResize'](_0x4454d7),this['_endMoveAnimation']();}_prepareMoveAnimation(){const _0x732104=new Tt(Vt['window']),_0x51e364=this['isVisible']?new Tt(this['element']):null,_0x5c7d61=[];let _0x4b25a0=!!_0x51e364;if(this['element']['style']['transition']='none',_0x51e364&&!_0x51e364['getIntersection'](_0x732104)){const _0x36df78=this['_getTarget'](),_0x4dc219=_0x36df78?new Tt(_0x36df78):null;_0x4dc219&&_0x4dc219['bottom']<=_0x732104['top']?(this['top']=Vt['window']['scrollY']-_0x51e364['height'],_0x5c7d61['push']('top')):_0x4dc219&&_0x4dc219['top']>=_0x732104['bottom']&&(this['top']=Vt['window']['scrollY']+_0x732104['height'],_0x5c7d61['push']('top')),_0x4dc219&&_0x4dc219['right']<=_0x732104['left']?(this['left']=Vt['window']['scrollX']-_0x51e364['width'],_0x5c7d61['push']('left')):_0x4dc219&&_0x4dc219['left']>=_0x732104['right']&&(this['left']=Vt['window']['scrollX']+_0x732104['width'],_0x5c7d61['push']('left')),_0x4b25a0=_0x5c7d61['length']>0x0;}this['element']['getBoundingClientRect'](),this['element']['style']['transition']=_0x4b25a0?'':'none',_0x5c7d61['length']&&(this['element']['style']['transitionProperty']=_0x5c7d61['join'](',\x20'));}_endMoveAnimation(){const _0x2ae463=this['element'],_0x366d76=_0x2ae463['getAnimations']();_0x366d76['length']?Promise['allSettled'](_0x366d76['map'](_0x4471cb=>_0x4471cb['finished']))['then'](()=>this['_endMoveAnimation']()):_0x2ae463['style']['transition']='none';}_stretchToDocument(_0x350851){this['element']['style']['width']=_0x350851?new Tt(_0x350851)['width']+'px':'';}_createPanelPositions(){return[(_0x4afc81,_0x4032f6,_0x13eeb3,_0x4c3e52)=>({'top':_0x4afc81['bottom']+AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0x4afc81,_0x4032f6,_0x4c3e52||_0x13eeb3),'name':'arrow_n','config':{'withArrow':!0x1}}),(_0xc9de33,_0x3d54a7,_0x17a854,_0x2281e4)=>({'top':_0xc9de33['top']-_0x3d54a7['height']-AIReviewCoreNavigationPanelView['verticalOffset'],'left':this['_getLeftFollowingChange'](_0xc9de33,_0x3d54a7,_0x2281e4||_0x17a854),'name':'arrow_s','config':{'withArrow':!0x1}})];}_getLeftFollowingChange(_0x3e0d52,_0x358195,_0x19b9b2){const _0x4f742f=parseFloat(Vt['window']['getComputedStyle'](this['content']['first']['element'])['marginInlineStart']),_0x2e875d='rtl'===this['locale']['contentLanguageDirection']?_0x3e0d52['right']+_0x4f742f-_0x358195['width']:_0x3e0d52['left']-_0x4f742f;return Math['max'](_0x19b9b2['left'],Math['min'](_0x2e875d,_0x19b9b2['right']-_0x358195['width']));}['hidePanel'](){this['hide'](),this['unpin'](),this['_stopObservingReflow'](),this['_pinOptions']=void 0x0;}isInViewport(){return this['isVisible']&&!!new Tt(this['element'])['getIntersection'](new Tt(Vt['window']));}destroy(){this['_stopObservingReflow'](),super['destroy']();}_observeDocumentResize(_0xca747e){this['_stopObservingReflow']();const _0xe5c860=()=>{this['isVisible']&&this['_pinOptions']&&this['attachTo'](this['_pinOptions']);};for(const _0x4b0200 of[_0xca747e,Vt['document']['body']])_0x4b0200&&this['_reflowObservers']['push'](new wt(_0x4b0200,_0xe5c860));}_stopObservingReflow(){for(const _0x294d7c of this['_reflowObservers'])_0x294d7c['destroy']();this['_reflowObservers']=[];}_createActionButtonView(_0xd72ecc,_0x2b69e4,_0x21bf47){const _0x368e0e=new _0x1a9216(this['locale']);return _0x368e0e['set']({'label':qs(this['locale'],_0xd72ecc),'withText':!0x0,'class':_0x2b69e4+'\x20'+pr}),_0x368e0e['on']('execute',_0x21bf47),_0x368e0e;}_createIconButtonView(_0xa1fb01,_0x5c9751,_0x5786d2){const _0x5f01e3=new _0x1a9216(this['locale']);return _0x5f01e3['set']({'label':qs(this['locale'],_0xa1fb01),'icon':_0x5c9751,'tooltip':!0x0,'class':Ar+'\x20'+pr}),_0x5f01e3['on']('execute',_0x5786d2),_0x5f01e3;}_createNavigationButtonViews(){this['_previousButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_PREVIOUS_CHANGE',_0x6b5523,()=>this['fire']('navigateChange',{'direction':'previous'})),this['_nextButtonView']=this['_createIconButtonView']('AI_REVIEW_MODE_NAVIGATION_NEXT_CHANGE',_0xcedfde,()=>this['fire']('navigateChange',{'direction':'next'}));for(const _0x5de67e of[this['_previousButtonView'],this['_nextButtonView']])_0x5de67e['bind']('isEnabled')['to'](this,'hasChangesToNavigate');const _0x17f65f=new _0x2df458(this['locale']);return _0x17f65f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__navigation']},'children':[this['_previousButtonView'],this['_nextButtonView']]}),_0x17f65f;}_createToggleDiffButtonView(){const _0x3dbbd2=this['_createIconButtonView']('AI_REVIEW_MODE_SHOW_CHANGES',_0x41fd30,()=>{this['isDiffOn']=!this['isDiffOn'],this['fire']('toggleDiff',{'on':this['isDiffOn'],'changeId':this['_changeId']});}),_0x490471=qs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x203222=qs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3dbbd2['set']({'isToggleable':!0x0}),_0x3dbbd2['bind']('isOn')['to'](this,'isDiffOn'),_0x3dbbd2['bind']('icon')['to'](this,'isDiffOn',_0x3db404=>_0x3db404?_0x508a5c:_0x41fd30),_0x3dbbd2['bind']('label')['to'](this,'isDiffOn',_0x427d2c=>_0x427d2c?_0x490471:_0x203222),_0x3dbbd2;}_createHeaderView(){const _0x507c6c=new _0x2df458(this['locale']);this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView']();const _0xa01056=new _0x5e3c18();return _0xa01056['content']=_0x61b11,_0xa01056['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__header__icon'}}),_0x507c6c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__header__notice']},'children':[_0xa01056,{'text':qs(this['locale'],'AI_REVIEW_MODE_NAVIGATION_READ_ONLY_NOTICE')}]},this['_completeReviewDropdownView']]}),_0x507c6c;}_createCompleteReviewDropdownView(){const _0x433c14=new pc(this['locale'],Ir+'\x20'+pr);return _0x433c14['set']('isVisible',!0x0),_0x433c14['extendTemplate']({'attributes':{'class':'ck-ai_review-navigation-panel__complete-container'}}),_0x433c14['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x433c14['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',this,'isResultReady',(_0xd588b3,_0x4652bd,_0x53b350)=>_0xd588b3&&!_0x4652bd&&_0x53b350),_0x433c14['delegate']('acceptAllChanges')['to'](this),_0x433c14['delegate']('rejectAllChanges')['to'](this),_0x433c14['delegate']('leaveReviewCoreResultList')['to'](this),_0x433c14;}_createContentView(){const _0x437870=new _0x2df458(this['locale']);return this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_acceptButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_ACCEPT_CHANGE',gr,()=>this['fire']('acceptChange',{'id':this['_changeId']})),this['_suggestButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_SUGGEST_CHANGE',Ir,()=>this['fire']('suggestChange',{'changeId':this['_changeId']})),this['_dismissButtonView']=this['_createActionButtonView']('AI_REVIEW_MODE_DISMISS_CHANGE',Ar,()=>this['fire']('dismissChange',{'id':this['_changeId']})),this['_stateView']=this['_createStateView'](),_0x437870['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai_review-navigation-panel']},'children':[this['_createHeaderView'](),{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__body']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__controls']},'children':[this['_createNavigationButtonViews'](),new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),{'tag':'span','attributes':{'class':['ck-ai_review-navigation-panel__counter'],'aria-live':'polite'},'children':[{'text':this['bindTemplate']['to']('counterLabel')}]},new $h(this['locale'],'ck-ai_review-navigation-panel__divider'),this['_toggleDiffButtonView']]},{'tag':'div','attributes':{'class':['ck-ai_review-navigation-panel__actions',this['bindTemplate']['if']('changeStatus','ck-hidden',_0x50789a=>'pending'!==_0x50789a)]},'children':[this['_dismissButtonView'],this['_suggestButtonView'],this['_acceptButtonView']]},this['_stateView']]}]}),_0x437870;}_createStateView(){const _0x4e8c0a=new so(this['locale'],mc);return _0x4e8c0a['bind']('isVisible')['to'](this,'changeStatus',_0x15a4fb=>'pending'!==_0x15a4fb),_0x4e8c0a['bind']('state')['to'](this,'changeStatus',_0xaaf5b6=>'pending'===_0xaaf5b6?'outdated':_0xaaf5b6),_0x4e8c0a;}_getBestRectPosition(_0x4e52c6,_0x22bbc5,_0x2f5396,_0x252773){if(!_0x4e52c6)return null;const _0x515470=this['position']['replace']('arrow_',''),_0x48fb89=Array['from'](_0x4e52c6['getClientRects']());if(!_0x48fb89['length'])return _0x4e52c6['getBoundingClientRect']();const _0x4a7b19=[..._0x48fb89]['reverse'](),_0x5207b9=void 0x0===_0x22bbc5?void 0x0:_0x4a7b19[_0x22bbc5];let _0x283067;return _0x5207b9&&this['_isPinnedRectVisible'](_0x5207b9,_0x2f5396,_0x252773)?_0x283067=_0x5207b9:void 0x0===_0x22bbc5&&this['_isPinnedRectVisible'](_0x4a7b19[0x0],_0x2f5396,_0x252773)?_0x283067=_0x4a7b19[0x0]:('s'==_0x515470[0x0]?_0x48fb89:_0x4a7b19)['forEach'](_0x507175=>{this['_isPinnedRectVisible'](_0x507175,_0x2f5396,_0x252773)&&(_0x283067=_0x507175);}),_0x283067||_0x4e52c6;}_getPointedRectIndexFromEvent(_0x37ab5c,_0x423df7){if(_0x37ab5c)for(let _0x4814e7=0x0;_0x4814e7<_0x423df7['length'];_0x4814e7++){const _0x5ca59b=_0x423df7[_0x4814e7];if(_0x37ab5c['clientX']>=_0x5ca59b['left']-0x3&&_0x37ab5c['clientX']<=_0x5ca59b['right']+0x3&&_0x37ab5c['clientY']>=_0x5ca59b['top']-0x3&&_0x37ab5c['clientY']<=_0x5ca59b['bottom']+0x3)return _0x4814e7;}}_isPinnedRectVisible(_0x130d36,_0x41a9ea,_0x1f1e88){const _0x332678=new Tt(_0x130d36),_0x5e3af2=_0x41a9ea||document['documentElement'],_0x1281bf=_0x332678['getIntersection'](yt(_0x1f1e88)),_0x1841ab=new Tt(_0x5e3af2)['getVisible'](),_0x351a77=_0x1841ab&&_0x1841ab['getIntersection'](_0x332678);return!!(_0x1281bf&&_0x351a77&&_0x332678['width']>0x0);}static verticalOffset=0x8;};const wc=['getReviewCheckList','runReviewCheck','abortReviewStream','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','suggestChange','learnMore','finishReview','retryReview'];var Cc=class extends _0x4cd5fc{['_mainView'];_navigationPanelView;_bodyCollection;static get requires(){return[Ks];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4bdd94){super(_0x4bdd94),this['_bodyCollection']=this['context']['plugins']['get'](Ks)['bodyCollection'];}init(){this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...wc)['to'](this),this['_navigationPanelView']=new Tc(this['context']['locale'],this['_bodyCollection']),this['_navigationPanelView']['bind']('isAnyResultReviewed')['to'](this['_mainView']['reviewCheckResultsView'],'isAnyResultReviewed'),this['_navigationPanelView']['bind']('hasPendingChanges')['to'](this['_mainView']['reviewCheckResultsView'],'hasPendingChanges'),this['_navigationPanelView']['bind']('isError')['to'](this['_mainView']['reviewCheckResultsView'],'isError'),this['_navigationPanelView']['bind']('isResultReady')['to'](this['_mainView']['reviewCheckResultsView'],'isResultReady'),this['_navigationPanelView']['delegate']('acceptChange','dismissChange','suggestChange','navigateChange','toggleDiff','acceptAllChanges','rejectAllChanges','leaveReviewCoreResultList')['to'](this),this['toggleLoadingSkeleton'](!0x0);const _0x5454cc=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x5454cc);}setAvailableChecks(_0x31d977){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x14757f=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x31d977,_0x14757f);}this['_mainView']['showReviewCheckListView']();}toggleLoadingSkeleton(_0x584f05){this['_mainView']['toggleLoadingSkeleton'](_0x584f05);}showReviewCheckList(){this['fire']('getReviewCheckList');}showCheckRunResults(_0x2eb1de){_0x2eb1de&&('error-general'!==_0x2eb1de['status']?'error-chunk'!==_0x2eb1de['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}showCheckRunResult(_0x462c50){this['_mainView']['addCheckRunResult'](_0x462c50,this['_isAcceptButtonVisibleForChange'](),this['_isSuggestButtonVisibleForChange']());}showGeneralResultsErrorView(){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x436453){this['_mainView']['showGeneralReviewCoreErrorView'](_0x436453??qs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}showUnsupportedInlineChangeView(){this['_mainView']['showUnsupportedInlineChangeView']();}setCheckResultTitle(_0xcd76ad,_0x29e82e){this['_mainView']['reviewCheckResultsView']['setTitle'](_0xcd76ad,_0x29e82e);}setHasPendingChanges(_0x4bef83){this['_mainView']['reviewCheckResultsView']['hasPendingChanges']=_0x4bef83;}setActiveStateInResults(_0x3260f3){this['_mainView']['reviewCheckResultsView']['setActiveResult'](_0x3260f3);}resetActiveStateInResults(){this['_mainView']['reviewCheckResultsView']['resetActiveResults']();}updateChangeState(_0x4f5c14,_0x59a9bd){this['_navigationPanelView']['updateChangeState'](_0x4f5c14,_0x59a9bd),this['_mainView']['reviewCheckResultsView']['updateChangeState'](_0x4f5c14,_0x59a9bd);}updateProgress(_0x3cb495,_0x151898){this['_mainView']['reviewCheckResultsView']['updateProgress'](_0x3cb495,_0x151898);}showReviewCompletedView(){this['_mainView']['showReviewCompletedView']();}showActionsWhenResultIsReady(){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}hideActionsWhenResultIsReady(){this['_mainView']['hideActionsWhenResultIsReady']();}showNavigationPanel(_0x3af29b){this['_navigationPanelView']['showPanel']({..._0x3af29b,'isAcceptButtonVisible':this['_isAcceptButtonVisibleForChange'](),'isSuggestButtonVisible':this['_isSuggestButtonVisibleForChange']()});}hideNavigationPanel(){this['_navigationPanelView']['hidePanel']();}isNavigationPanelInViewport(){return this['_navigationPanelView']['isInViewport']();}updateNavigationPanelPosition(_0x513384){this['_navigationPanelView']['updateChangePosition'](_0x513384);}getNavigationPanelChangeId(){return this['_navigationPanelView']['changeId'];}scrollResultsToChange(_0x35bd75){this['_mainView']['reviewCheckResultsView']['scrollToResult'](_0x35bd75);}_isAcceptButtonVisibleForChange(){return!0x0;}_isSuggestButtonVisibleForChange(){return!0x1;}showLeaveConfirmationDialog(_0x4731e8,_0x513d31,_0x141c3d){const _0x4aeb83=tn(this['context']),_0xd00171=new _0x2df458(_0x4aeb83['locale']);_0xd00171['setTemplate']({'tag':'div','attributes':{'style':{'padding':'var(--ck-spacing-large)','whiteSpace':'initial'}},'children':[_0x4731e8['content']]}),function(_0xce8bea,_0x3fca27,_0x5f1da3,_0x2c143e,_0x35431c){if(!_0xce8bea['plugins']['has']('AIEditorIntegration'))return void _0x2c143e();const _0x453716=_0xce8bea['plugins']['get']('AIEditorIntegration')['dialog'];let _0x487171=!0x1;_0x453716['show']({'id':_0x3fca27['dialogId'],'isModal':!0x0,'hasCloseButton':!0x0,'className':'ck-ai-leave-confirmation','title':_0x3fca27['title'],'content':_0x5f1da3,'actionButtons':[{'label':_0x3fca27['exitButton'],'withText':!0x0,'onExecute':()=>{_0x487171=!0x0,_0x453716['hide'](),_0x2c143e();}},{'label':_0x3fca27['stayButton'],'class':gr,'withText':!0x0,'onExecute':()=>_0x453716['hide']()}],'onHide':()=>{_0x487171||_0x35431c?.();}});}(_0x4aeb83,_0x4731e8,_0xd00171,_0x513d31,_0x141c3d);}},fc=class extends _0x2df458{constructor(_0x5cc737){super(_0x5cc737),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0xbda9bc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0xbda9bc['if']('isVisible','ck-hidden',_0x59d918=>!_0x59d918)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0xbda9bc['to']('errorMessage')}]}]});}},Rc=class extends _0x2df458{['reviewCoreHeader'];['generalErrorView'];reviewCheckListView;reviewCheckResultsView;reviewCompletedView;constructor(_0x116432,_0x51d537){super(_0x116432),this['reviewCoreHeader']=_0x51d537['header'],this['generalErrorView']=new fc(_0x116432),this['reviewCheckListView']=_0x51d537['list'],this['reviewCheckListView']['delegate'](...wc)['to'](this),this['reviewCheckResultsView']=_0x51d537['results'],this['reviewCheckResultsView']['delegate'](...wc)['to'](this),this['reviewCompletedView']=_0x51d537['completed'],this['reviewCompletedView']['delegate']('finishReview')['to'](this),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isLoading',!0x1),this['reviewCheckResultsView']['set']('isResultReady',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1),this['set']('isLoadingSkeletonVisible',!0x1),this['reviewCoreHeader']['bind']('isLoadingSkeletonVisible')['to'](this,'isLoadingSkeletonVisible'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewCoreHeader'],this['generalErrorView'],this['reviewCheckListView'],this['reviewCheckResultsView'],this['reviewCompletedView'],this['_createLoadingSkeletonView']()]});}toggleLoadingSkeleton(_0x3376d3){this['set']('isLoadingSkeletonVisible',_0x3376d3);}_createLoadingSkeletonView(){const _0x3422e6=new lo(this['locale'],uo['aiReviewInitCheck']);return _0x3422e6['extendTemplate']({'attributes':{'class':['ck-ai_review__init-skeleton']}}),_0x3422e6['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x3422e6;}showReviewCheckListView(){this['reviewCheckListView']['resetAllParameterizedChecks'](),this['reviewCheckListView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x1);}showReviewCheckResultsView(){this['hideActionsWhenResultIsReady'](),this['reviewCheckResultsView']['resetErrorState'](),this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCheckResultsView']['clearResults'](),this['reviewCheckResultsView']['set']('isLoading',!0x0),this['reviewCheckResultsView']['set']('isCompleted',!0x1);}addCheckRunResult(_0x349679,_0x30e281,_0x24efa6){this['reviewCheckResultsView']['addResult'](_0x349679,_0x30e281,_0x24efa6),this['reviewCheckResultsView']['set']('isLoading',!0x1);}showReviewCompletedView(){this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isCompleted',!0x0),this['reviewCheckListView']['set']('isVisible',!0x1);}showActionsWhenResultIsReady(){this['reviewCheckResultsView']['isResultReady']?(this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x0),this['reviewCompletedView']['set']('isVisible',!0x1)):this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('isVisible',!0x0);}hideActionsWhenResultIsReady(){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralReviewCoreErrorView'](_0x8e6021){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x8e6021;}showGeneralResultsErrorView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}showUnsupportedInlineChangeView(){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showUnsupportedInlineChangeMessage']();}},bc=class extends _0x2df458{resultResponseView;acceptButtonView;dismissButtonView;infoButtonView;outdatedButtonView;suggestButtonView;constructor(_0x56d31b,_0x4210dc,_0x53e54d,_0x1d7d74){super(_0x56d31b),this['id']=_0x4210dc,this['set']('status','pending'),this['set']('changeId',_0x4210dc),this['set']('isAcceptButtonVisible',_0x53e54d),this['set']('isSuggestButtonVisible',_0x1d7d74),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['outdatedButtonView']=this['_createOutdatedButtonView'](),this['suggestButtonView']=this['_createSuggestButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['set']('showDiff',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-result',this['bindTemplate']['if']('isActive','ck-ai_review__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click'),'mouseover':this['bindTemplate']['to']('mouseover'),'mouseout':this['bindTemplate']['to']('mouseout')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['suggestButtonView'],this['dismissButtonView'],this['outdatedButtonView']]},this['infoButtonView']]}]}),this['on']('click',(_0x4886b6,_0x4825ff)=>{_0x4825ff&&_0x4825ff['target']&&'A'===_0x4825ff['target']['tagName']&&_0x4825ff['preventDefault'](),this['fire']('activateChange',{'id':_0x4210dc,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4210dc,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4210dc,'source':this});}),this['on']('change:showDiff',()=>this['_syncResponseVisibility']());}['render'](){super['render'](),this['_syncResponseVisibility']();}setItemAsActive(){this['isActive']=!0x0;}setItemAsInactive(){this['isActive']=!0x1;}_createResultResponseView(){const _0xc7dc0f=new _0x2df458(this['locale']);return _0xc7dc0f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai_review__check-run-result-response']}}),_0xc7dc0f;}updateResponseContent(_0x2d30b2,_0x3b7f36){const _0x85fcc0=_0x3b7f36||'div',_0x191a49=this['resultResponseView']['element'];if(_0x191a49['tagName']['toLowerCase']()!==_0x85fcc0){const _0x500011=new _0x4e263f({'tag':_0x85fcc0,'attributes':{'class':_0x191a49['className']}})['render']();_0x191a49['replaceWith'](_0x500011),this['resultResponseView']['element']=_0x500011,this['_syncResponseVisibility']();}this['resultResponseView']['element']['innerHTML']=Qt(_0x2d30b2);}_syncResponseVisibility(){this['resultResponseView']['element']?.['classList']['toggle']('ck-hidden',!this['showDiff']);}_createAcceptButtonView(){const _0x57569e=new _0x1a9216(this['locale']);return _0x57569e['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x57569e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xcace95=>{_0xcace95['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status',gr,_0x1e87f=>'pending'===_0x1e87f),this['bindTemplate']['if']('status',Ar,_0x334545=>'pending'!==_0x334545),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x8e84ab=>'accepted'===_0x8e84ab),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_success',_0x5c62b5=>'accepted'===_0x5c62b5)]}}),_0x57569e['bind']('isVisible')['to'](this,'isAcceptButtonVisible',this,'status',(_0x4c645c,_0x434eb5)=>'accepted'===_0x434eb5||_0x4c645c&&'pending'===_0x434eb5),_0x57569e['bind']('isEnabled')['to'](this,'status',_0x3a28a4=>'pending'===_0x3a28a4),_0x57569e['on']('execute',()=>{this['fire']('acceptChange',{'id':this['changeId']});}),this['on']('change:status',(_0x386bb6,_0x1499ea,_0x48db35)=>{'accepted'===_0x48db35&&(_0x57569e['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x57569e['icon']=_0x42448e);}),_0x57569e;}_createDismissButtonView(){const _0x28f579=new _0x1a9216(this['locale']);return _0x28f579['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x28f579['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e284e=>{_0x2e284e['stopPropagation']();})},'attributes':{'class':[Ar,this['bindTemplate']['if']('status','ck-hidden',_0x4c48ff=>'pending'!==_0x4c48ff&&'rejected'!==_0x4c48ff),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x3e2cff=>'pending'===_0x3e2cff),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3ae775=>'rejected'===_0x3ae775),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button_error',_0xfe8ebf=>'rejected'===_0xfe8ebf)]}}),_0x28f579['on']('execute',()=>{this['fire']('dismissChange',{'id':this['changeId']});}),this['on']('change:status',(_0x109987,_0x20f657,_0x1d50db)=>{_0x28f579['isEnabled']='pending'===_0x1d50db,'rejected'===_0x1d50db&&(_0x28f579['label']=qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x28f579['icon']=_0x29be46);}),_0x28f579;}_createInfoButtonView(){const _0x566675=new _0x1a9216(this['locale']);return _0x566675['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x14d28a,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Ar+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x566675['bind']('isOn')['to'](this,'isInfoToggleOn',_0x468ee3=>_0x468ee3),_0x566675['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x566675;}_createOutdatedButtonView(){const _0x4a7053=new _0x1a9216(this['locale']);return _0x4a7053['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':_0x230d59,'withText':!0x0,'isEnabled':!0x1}),_0x4a7053['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x459c90=>'outdated'!==_0x459c90)],'disabled':'disabled'}}),_0x4a7053;}_createSuggestButtonView(){const _0x430477=new _0x1a9216(this['locale']);return _0x430477['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_SUGGEST_CHANGE'),'withText':!0x0}),_0x430477['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x40ead1=>{_0x40ead1['stopPropagation']();})},'attributes':{'class':[Ir]}}),_0x430477['on']('execute',()=>{this['fire']('suggestChange',{'changeId':this['changeId']});}),_0x430477['bind']('isVisible')['to'](this,'isSuggestButtonVisible',this,'status',(_0x5ca995,_0x479fc0)=>_0x5ca995&&'pending'===_0x479fc0),_0x430477['bind']('isEnabled')['to'](this,'status',_0xdc0d29=>'pending'===_0xdc0d29),_0x430477;}},Sc=class extends _0x1a9216{constructor(_0x281a54,_0x2f2241){super(_0x2f2241),this['set']({'label':_0x281a54,'withText':!0x0,'class':gr}),this['on']('execute',()=>{this['fire']('finishReview');});}},Oc=class extends _0x2df458{['_labelView'];constructor(_0x1727a8){super(_0x1727a8),this['_labelView']=new _0x2df458(_0x1727a8),this['_labelView']['setTemplate']({'tag':'span','attributes':{'class':['ck-ai_review__progress-bar-label']}}),this['_labelView']['render'](),this['set']('isVisible',!0x1),this['set']('_percentageDone',0x0);const _0x49448e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-container',_0x49448e['if']('isVisible','ck-hidden',_0x4f85d6=>!_0x4f85d6)]},'children':[this['_labelView'],{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-track']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__progress-bar-fill'],'style':{'width':_0x49448e['to']('_percentageDone',_0x1298ef=>_0x1298ef+'%')}}}]}]});}updateProgress(_0x1d5f34,_0x37230c){this['_percentageDone']=_0x37230c?Math['round'](_0x1d5f34/_0x37230c*0x64):0x0,this['_labelView']['element']['innerHTML']=Qt(qs(this['locale'],'AI_REVIEW_MODE_PROGRESS',['<strong>'+_0x1d5f34+'</strong>',_0x37230c]));}},vc=class extends _0xf665cb{_resultViews;get _tileViews(){return Array['from'](this['_resultViews']);}_resultsHeader;_resultsBody;['reviewDisclaimer'];_titleContentResizeObserver=null;_cancelButtonView;['_errorMessageView'];_finishReviewButtonView;_completeReviewDropdownView;['_progressBarView'];_contents;constructor(_0x55c4c3,_0x219322){super(_0x55c4c3),this['_contents']=_0x219322,this['_resultViews']=new _0x15c4c2(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_completeReviewDropdownView']=this['_createCompleteReviewDropdownView'](),this['_progressBarView']=this['_createProgressBarView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new nh(_0x55c4c3),this['set']('isLoading',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('headerSubtitle',''),this['set']('_headerTitleTooltipText',''),this['set']('_headerSubtitleTooltipText',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general'),this['set']('isCompleted',!0x1),this['set']('hasPendingChanges',!0x1),this['set']('isAnyResultReviewed',!0x1);const _0x4377ef=this['_createCombinedSkeletonLoader'](),_0x18cb8f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x18cb8f['if']('isLoading','ck-ai_review__check-run_loading',_0x24a0a2=>_0x24a0a2),_0x18cb8f['if']('isVisible','ck-hidden',_0xaeba7a=>!_0xaeba7a)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x4377ef,this['reviewDisclaimer']]});}['render'](){super['render']();const _0x59756d=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title-content');this['_titleContentResizeObserver']=new wt(_0x59756d,()=>{this['_updateTitleTooltipText'](),this['_updateSubtitleTooltipText']();}),this['listenTo'](this,'change:headerTitle',()=>this['_updateTitleTooltipText']()),this['listenTo'](this,'change:headerSubtitle',()=>this['_updateSubtitleTooltipText']());}destroy(){super['destroy'](),this['_titleContentResizeObserver']&&this['_titleContentResizeObserver']['destroy']();}clearResults(){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}updateProgress(_0x13efb7,_0x1951bc){this['isAnyResultReviewed']=_0x13efb7>0x0,this['_progressBarView']['updateProgress'](_0x13efb7,_0x1951bc);}getResults(){return this['_resultViews'];}setActiveResult(_0x2e5440){for(const _0xbd0e17 of this['_tileViews'])_0xbd0e17['id']===_0x2e5440&&_0xbd0e17['setItemAsActive']();}resetActiveResults(){for(const _0x6d1caa of this['_tileViews'])_0x6d1caa['setItemAsInactive']();}scrollToResult(_0x1f9b01){const _0xadf9ff=this['_resultsBody']['element'],_0x162464=this['getResultElement'](_0x1f9b01);if(!_0xadf9ff||!_0x162464)return;const _0x1c659b=_0x162464['getBoundingClientRect']()['top']-_0xadf9ff['getBoundingClientRect']()['top'];_0xadf9ff['scrollTo']({'top':_0xadf9ff['scrollTop']+_0x1c659b,'behavior':'smooth'});}getResultElement(_0x10e7e4){const _0x11f8c4=this['_tileViews']['find'](_0x370984=>_0x370984['id']===_0x10e7e4);return _0x11f8c4?_0x11f8c4['element']:null;}addResult(_0x353f54,_0x108c7f,_0x1c4fc9){const _0x426e56=new bc(this['locale'],_0x353f54['id'],_0x108c7f,_0x1c4fc9);_0x426e56['delegate']('acceptChange','dismissChange','activateChange','deactivateChange','suggestChange')['to'](this),this['_resultViews']['add'](_0x426e56),_0x426e56['updateResponseContent'](_0x353f54['contentDiffed'],_0x353f54['wrapperTag']);}updateChangeState(_0x1123f0,_0x4a3f5d){const _0x5413be=this['_tileViews']['find'](_0x4db104=>_0x4db104['id']===_0x1123f0);_0x5413be&&(_0x5413be['status']=_0x4a3f5d,_0x5413be['element']?.['classList']['toggle']('ck-ai_review__check-run-result_grayout','pending'!==_0x4a3f5d));}setTitle(_0x3480ec,_0x1451d8){this['headerTitle']=_0x3480ec,this['headerSubtitle']=_0x1451d8||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}showUnsupportedInlineChangeMessage(){this['errorType']='unsupported-inline',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}resetErrorState(){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}_createCombinedSkeletonLoader(){const _0x44c778=new lo(this['locale'],this['_getSkeletonDefinition']());return _0x44c778['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-container']}}),_0x44c778['bind']('isVisible')['to'](this,'isLoading'),_0x44c778;}_getSkeletonDefinition(){return uo['aiReviewChecks'];}_createResultsBodyView(){const _0x4c7264=new _0x2df458(this['locale']);return _0x4c7264['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x358923=>_0x358923)]},'children':this['_resultViews']}),_0x4c7264;}_createErrorView(){const _0x2033d4=new _0x2df458(this['locale']),_0x5e5ef4=new _0x1a9216(this['locale']),t=this['locale']['t'];return _0x2033d4['delegate']('retryReview')['to'](this),_0x5e5ef4['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ir}),_0x5e5ef4['on']('execute',()=>{this['fire']('retryReview');}),_0x2033d4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4c982d=>!_0x4c982d),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x566b91=>'chunk'===_0x566b91)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error','ck-ai-notification__full-width','ck-ai_review__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-notification_warning',_0x275d7c=>'chunk'===_0x275d7c||'unsupported-inline'===_0x275d7c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x7c02f2=>'general'!==_0x7c02f2)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x415c7a=>'chunk'!==_0x415c7a)]},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5dda1b=>'unsupported-inline'!==_0x5dda1b)]},'children':[{'text':qs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')}]}]},_0x5e5ef4]}),_0x2033d4;}_createCancelButtonView(){const _0x134639=new _0x1a9216(this['locale']);return _0x134639['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ir+'\x20ck-ai-button-stop-generating'],'icon':rt}),_0x134639['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x33aae0=>_0x33aae0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x97e295=>_0x97e295)]}}),_0x134639['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x134639;}_createHeaderControlViews(){return[this['_cancelButtonView'],this['_completeReviewDropdownView'],this['_finishReviewButtonView']];}_createResultHeaderView(){const _0x401a3d=new _0x2df458(this['locale']),_0x331ebb=this['_createTitleView']();return _0x401a3d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1710c9=>_0x1710c9)]},'children':[_0x331ebb,{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x29932c=>!_0x29932c)],'title':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')},'children':[{'text':qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':this['_createHeaderControlViews']()},...this['_createProgressBarViewList']()]}),_0x401a3d;}_createTitleView(){const _0x18e26f=new _0x2df458(this['locale']);return _0x18e26f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1265a8=>_0x1265a8)]},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerTitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle'],'data-cke-tooltip-text':this['bindTemplate']['to']('_headerSubtitleTooltipText'),'data-cke-tooltip-class':'ck-tooltip_multi-line'},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]}]}),_0x18e26f;}_updateTitleTooltipText(){const _0x3337dc=this['element']['querySelector']('.ck-ai_review__check-run-results-header-title');this['_headerTitleTooltipText']=_0x3337dc['scrollWidth']>_0x3337dc['clientWidth']?this['headerTitle']:'';}_updateSubtitleTooltipText(){const _0x141936=this['element']['querySelector']('.ck-ai_review__check-run-results-header-subtitle');this['_headerSubtitleTooltipText']=_0x141936['scrollWidth']>_0x141936['clientWidth']?this['headerSubtitle']:'';}_createProgressBarView(){const _0x121970=new Oc(this['locale']);return _0x121970['bind']('isVisible')['to'](this,'isResultReady'),_0x121970;}_createProgressBarViewList(){return[this['_progressBarView']];}_createFinishReviewButtonView(){const _0x1de345=new Sc(qs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x1de345['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1001af=>!_0x1001af)]}}),_0x1de345['delegate']('finishReview')['to'](this),_0x1de345;}_createCompleteReviewDropdownView(){const _0x1880a6=new pc(this['locale'],gr);return _0x1880a6['bind']('isAnyResultReviewed')['to'](this,'isAnyResultReviewed'),_0x1880a6['bind']('isVisible')['to'](this,'isCompleted',this,'isResultReady',(_0x1ff051,_0x4ad1d0)=>!_0x1ff051&&_0x4ad1d0),_0x1880a6['bind']('hasPendingChanges')['to'](this,'hasPendingChanges',this,'isError',(_0x2f5c0d,_0x4a75e4)=>_0x2f5c0d&&!_0x4a75e4),_0x1880a6['delegate']('acceptAllChanges')['to'](this),_0x1880a6['delegate']('rejectAllChanges')['to'](this),_0x1880a6['delegate']('leaveReviewCoreResultList')['to'](this),_0x1880a6;}},yc=class extends vc{_changeIdByPartIndex=new Map();clearResults(){super['clearResults'](),this['_changeIdByPartIndex']['clear']();}addResult(_0x569074,_0x4fb4ad,_0x1571a9){const _0x3db587=this['_resultViews']['length'],_0x582fae=function(_0x407f15,_0x4a7ca3){return{'type':'modified','index':_0x4a7ca3,'state':_0x407f15['status'],'content':en(_0x407f15['contentDiffed']),'hasChanges':!0x0,'wrapperTag':_0x407f15['wrapperTag']};}(_0x569074,_0x3db587);this['_changeIdByPartIndex']['set'](_0x3db587,_0x569074['id']);const _0xdde25=new co(this['locale'],{'part':_0x582fae,'uiIndex':_0x3db587+0x1,'areActionsDisabled':!0x1,'availableActions':[...po],'translationKeys':mc});_0xdde25['isApplyVisible']=_0x4fb4ad,_0xdde25['isSuggestVisible']=_0x1571a9,_0xdde25['on']('applySuggestion',()=>this['fire']('acceptChange',{'id':_0x569074['id']})),_0xdde25['on']('insertSuggestion',()=>this['fire']('suggestChange',{'changeId':_0x569074['id']})),_0xdde25['on']('rejectSuggestion',()=>this['fire']('dismissChange',{'id':_0x569074['id']})),_0xdde25['on']('showChangeInText',()=>this['fire']('activateChange',{'id':_0x569074['id'],'source':_0xdde25,'uiInteraction':'click'})),_0xdde25['on']('mouseOverSuggestion',()=>this['fire']('activateChange',{'id':_0x569074['id'],'source':_0xdde25,'uiInteraction':'hover'})),_0xdde25['on']('mouseLeaveSuggestion',()=>this['fire']('deactivateChange',{'origin':'panel','id':_0x569074['id'],'source':_0xdde25})),this['_resultViews']['add'](_0xdde25),_0xdde25['markAsDone'](),_0xdde25['updateContent']({'part':_0x582fae})['catch'](_0x56f83a=>Wt('ai-review-content-part-render-failed',_0x56f83a));}updateChangeState(_0x3412fe,_0x2c7dbf){const _0x5e0314=this['_getPartView'](_0x3412fe);_0x5e0314&&(_0x5e0314['state']=_0x2c7dbf);}setActiveResult(_0xd7895a){for(const _0x5cd315 of this['_partViews'])_0x5cd315['isActive']=this['_changeIdByPartIndex']['get'](_0x5cd315['partDefinition']['index'])===_0xd7895a;}resetActiveResults(){for(const _0x4bcff1 of this['_partViews'])_0x4bcff1['isActive']=!0x1;}getResultElement(_0x40a77d){return this['_getPartView'](_0x40a77d)?.['element']??null;}get _partViews(){return Array['from'](this['_resultViews']);}_getPartView(_0x467822){for(const _0x568078 of this['_partViews'])if(this['_changeIdByPartIndex']['get'](_0x568078['partDefinition']['index'])===_0x467822)return _0x568078;return null;}},Nc=class extends _0xf665cb{_resultsHeader;_finishReviewButtonView;constructor(_0x4a3ab3,_0x849668){super(_0x4a3ab3),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x849668['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x849668['headerText']);const _0x3212b8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3212b8['if']('isVisible','ck-hidden',_0x11e4a7=>!_0x11e4a7)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-content-icon']},'children':[{'text':'👍'}]},{'tag':'p','attributes':{'class':['ck-ai_review__review-completed-content-text']},'children':[{'text':_0x849668['emptyResultsText']}]}]}]});}_createFinishReviewButtonView(_0x55597a){const _0x4e3d63=new Sc(_0x55597a,this['locale']);return _0x4e3d63['delegate']('finishReview')['to'](this),_0x4e3d63;}_createResultHeaderView(_0x9f2e68){const _0x52933c=new _0x2df458(this['locale']);return _0x52933c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title'],'title':_0x9f2e68},'children':[{'text':_0x9f2e68}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x52933c;}},kc=class extends _0x2df458{['_dropdownView'];_defaultValue;_defaultLabel;constructor(_0x5c0ce6,_0x3ff393){super(_0x5c0ce6),this['_defaultValue']=_0x3ff393['default']||(_0x3ff393['data']['length']>0x0?_0x3ff393['data'][0x0]['id']:''),this['_defaultLabel']=_0x3ff393['data']['find'](_0xe0034=>_0xe0034['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x4c754a(this['locale']);const _0x4aec01=this['_prepareListOptions'](_0x3ff393['data']);_0x34e876(this['_dropdownView'],_0x4aec01,{'role':'menu','ariaLabel':_0x3ff393['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2da334=>{_0x2da334['stopPropagation']();})}}),this['_dropdownView']['panelPositionLimiter']=()=>{const _0x3ae531=this['_dropdownView']['buttonView']['element'];return _0x3ae531&&St(_0x3ae531);},this['listenTo'](this['_dropdownView'],'execute',_0x13dab4=>{this['formValue']=_0x13dab4['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x13dab4['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai_review__check-list-item-parameterized-form-element','ck-ai_review__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}resetToDefault(){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}_prepareListOptions(_0x18b03b=[]){const _0x353f22=new _t();this['resetToDefault']();for(const _0x5cdca9 of _0x18b03b){const _0x367222=new _0x13bdb1({'label':_0x5cdca9['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5cdca9['id'],'model':_0x5cdca9});_0x367222['bind']('isOn')['to'](this,'formValue',_0x321199=>_0x321199===_0x367222['id']);const _0x19fdb7={'type':'button','model':_0x367222};_0x353f22['add'](_0x19fdb7);}return _0x353f22;}},xc=class extends _0xf665cb{_formItem=null;constructor(_0x52e762,_0x455fec,_0x533609){if(super(_0x52e762),this['argsKey']=_0x455fec?.['argsKey'],'dropdown'===_0x455fec['formType'])this['_formItem']=new kc(this['locale'],_0x455fec);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x775e6c=new _0x57ecc8(this['locale'],{'children':[this['_formItem']],'class':[_0x533609?'ck-form__row_with-submit':'']});_0x533609&&_0x775e6c['children']['add'](_0x533609),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x775e6c]});}resetToDefault(){this['_formItem']['resetToDefault']();}},Lc=class AIReviewCorePromptInputView extends _0x1e334c{keystrokes;static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x10c1ce){super(_0x10c1ce),this['set']('isEmpty',!0x0),this['keystrokes']=new pt(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['placeholder']=qs(_0x10c1ce,'AI_REVIEW_MODE_CUSTOM_PROMPT_PLACEHOLDER'),this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}},Dc=class extends _0x2df458{['focusTracker']=new Et();keystrokes=new pt();['focusCycler'];['_focusables']=new _0x15c4c2();submitButtonView;cancelButtonView;promptInputView;actionsFooterView;_modelSelector;['_check'];constructor(_0x5cd012,_0x4b5dd2,_0x479def=!0x1){super(_0x5cd012),this['_check']=_0x4b5dd2,this['set']('prompt',''),this['set']('modelId',''),this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new _0x187ed8(this['locale'],()=>new Lc(_0x5cd012)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelector']=new la(_0x5cd012,{'panelPosition':'auto','dropdownClass':'ck-ai_review__check-list-item-model-dropdown','nameClass':'ck-ai_review__check-list-item-model-name','itemClasses':{'name':'ck-ai_review__check-list-item-model-dropdown-name','description':'ck-ai_review__check-list-item-model-dropdown-description'}}),this['listenTo'](this['_modelSelector'],'selectModel',(_0x477d27,_0x198684)=>{this['modelId']=_0x198684['id'],this['_modelSelector']['setSelectedModel'](_0x198684);}),this['_setModelList'](_0x479def),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-rows']},'children':[new _0x57ecc8(this['locale'],{'children':[this['promptInputView']]}),new _0x57ecc8(this['locale'],{'children':[this['actionsFooterView']]})]}]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x47b146,_0x153661)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x153661()):_0x153661();}),this['focusCycler']=new _0x17323b({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),[this['promptInputView'],this['_modelSelector']['dropdownView'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x5a46d3=>{this['_focusables']['add'](_0x5a46d3),this['focusTracker']['add'](_0x5a46d3['element']);}),this['keystrokes']['listenTo'](this['element']);}resetToDefault(){this['prompt']='',this['modelId']=this['_check']['defaultModel']?.['id']??'',this['_check']['defaultModel']&&this['_modelSelector']['setSelectedModel'](this['_check']['defaultModel']),this['resetFormValidationStatus']();}resetFormValidationStatus(){this['promptInputView']['errorText']='';}['_isValid'](){this['resetFormValidationStatus']();for(const _0x16f6e9 of this['_getFormValidators']()){const _0x4a102e=_0x16f6e9();if(_0x4a102e)return this['promptInputView']['errorText']=_0x4a102e,!0x1;}return!0x0;}_getFormValidators(){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return qs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}_createSubmitButtonView(){const _0xd170bb=new _0x1a9216(this['locale']);return _0xd170bb['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr+'\x20'+pr}),_0xd170bb['bind']('isEnabled')['to'](this,'prompt',_0x43846d=>_0x43846d['trim']()['length']>0x0),_0xd170bb['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xd170bb;}_createCancelButtonView(){const _0x44ae5a=new _0x1a9216(this['locale']),t=this['locale']['t'];return _0x44ae5a['set']({'label':t('Cancel'),'withText':!0x0,'class':Ar+'\x20'+pr}),_0x44ae5a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x24c9a1=>{_0x24c9a1['stopPropagation']();})}}),_0x44ae5a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x44ae5a;}_setModelList(_0x6b1505){this['_modelSelector']['setModels'](this['_check']['models'],!_0x6b1505),this['resetToDefault']();}_createActionsFooterView(){const _0xf140da=new _0x2df458(this['locale']);return _0xf140da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions-footer']},'children':[this['_modelSelector'],{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),_0xf140da;}},Pc=class extends _0xf665cb{_formItemsCollection=new _0x15c4c2();_customCheckView=null;['_headerView'];_contentFormView;['_hideModels']=!0x1;['check'];constructor(_0x1d65ea,_0x386323,_0x2563e5,_0x3b8079=!0x1){super(_0x1d65ea),this['_hideModels']=_0x3b8079,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x386323['isParameterized']),this['check']=_0x386323,this['_headerView']=this['_createHeaderView'](_0x386323),this['_contentFormView']=this['_createContentFormView'](),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai_review__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai_review__check-list-item_selected',_0x2594dc=>_0x2594dc),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x3306ce=>_0x3306ce)],'style':{'--ck-ai-review-check-list-item-index':_0x2563e5}},'on':{'keydown':this['bindTemplate']['to'](_0x1c84ea=>{const _0x9d1e41=_0x1c84ea;'ArrowUp'!==_0x9d1e41['key']&&'ArrowDown'!==_0x9d1e41['key']||this['_headerView']['element']['contains'](_0x1c84ea['target'])||_0x1c84ea['stopPropagation']();}),'click':this['bindTemplate']['to'](_0x3e3a82=>{_0x3e3a82['target']===_0x3e3a82['currentTarget']&&(this['focus'](),this['fire']('click',_0x3e3a82));})},'children':[this['_headerView'],...this['_contentFormView']?[this['_contentFormView']]:[]]}),this['on']('click',()=>{_0x386323['isParameterized']?this['isParametrizedViewOpen']=!this['isParametrizedViewOpen']:this['fire']('runReviewCheck',{'id':_0x386323['id'],'args':_0x386323['useArgs']?_0x386323['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['focus'](){this['_headerView']['element']['focus']();}resetToDefault(){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x494d08=>{_0x494d08['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}_createHeaderView(_0xb381a){const _0x44e1a9=new _0x2df458(),_0x515296=this['_createIconView']();return _0x44e1a9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-content'],'tabindex':'-1','role':'button',..._0xb381a['isParameterized']?{'aria-expanded':this['bindTemplate']['to']('isParametrizedViewOpen',_0x56e71d=>String(_0x56e71d))}:{}},'on':{'click':this['bindTemplate']['to']('click'),'keydown':this['bindTemplate']['to'](_0x3a9ce0=>{const _0x47512d=_0x3a9ce0;_0x3a9ce0['target']!==_0x3a9ce0['currentTarget']||'Enter'!==_0x47512d['key']&&'\x20'!==_0x47512d['key']||(_0x3a9ce0['preventDefault'](),this['fire']('click',_0x3a9ce0));})},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-list-item-title-text']},'children':[{'text':_0xb381a['title']}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0xb381a['description']?[{'text':_0xb381a['description']}]:[]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-icon-wrapper']},'children':[_0x515296]}]}),_0x44e1a9;}_createIconView(){const _0x1f7e38=new _0x5e3c18();return _0x1f7e38['content']=_0x4e5c52,_0x1f7e38['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x1f7e38;}_createParameterizedView(_0x7c5709){const _0xb0c164=new _0x2df458(),_0x186d9a=this['_createFormView'](_0x7c5709);return _0xb0c164['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1fa813=>!_0x1fa813)]},'children':[_0x186d9a]}),_0xb0c164;}_createFormView(_0xb72854){const _0x5c4692=new _0x2df458(),_0x4377b3=Array['isArray'](_0xb72854['options'])?_0xb72854['options']:[],_0x395db2=new _0x1a9216(this['locale']);_0x395db2['set']({'label':qs(this['locale'],'AI_REVIEW_MODE_RUN_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':gr}),_0x395db2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x64802a=>{_0x64802a['stopPropagation']();})}}),_0x395db2['on']('execute',()=>{const _0x2e82b7=[],_0x54aeef={};this['_formItemsCollection']['forEach'](_0x124324=>{_0x2e82b7['push'](_0x124324['value']),_0xb72854['useArgs']&&_0xb72854['options']&&(_0x54aeef[_0x124324['argsKey']]=_0x124324['value']);}),this['fire']('runReviewCheck',{'id':_0xb72854['id'],'params':_0x2e82b7['length']?_0x2e82b7:void 0x0,'args':Object['keys'](_0x54aeef)['length']?_0x54aeef:void 0x0});});const _0x3882e3=_0x4377b3['length'];return _0x4377b3['forEach']((_0x522342,_0x30538c)=>{const _0x9ff839=_0x30538c===_0x3882e3-0x1;this['_formItemsCollection']['add'](new xc(this['locale'],_0x522342,_0x9ff839?_0x395db2:null));}),_0x5c4692['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5c4692;}_createCustomView(_0x29202c,_0x102efa=!0x1){return this['_customCheckView']=new Dc(this['locale'],_0x29202c,_0x102efa),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-parameterized','ck-ai_review__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x327778=>!_0x327778)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5025be,_0x1ccd71,_0x50d56a)=>{_0x50d56a||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}_createContentFormView(){return'custom'===this['check']['id']?this['_createCustomView'](this['check'],this['_hideModels']):this['check']['isParameterized']?this['_createParameterizedView'](this['check']):null;}},Mc=class extends _0x4e6fd6{constructor(_0x46146a){super(_0x46146a),this['set']('isVisible',!0x0);}setChecks(_0x463ca1,_0x595384=!0x1){this['_clearCheckViews']();for(const [_0x4b987a,_0x2100af]of this['_getVisualOrder'](_0x463ca1)['entries']()){const _0x395f1c=this['_createCheckView'](_0x2100af,_0x4b987a,_0x595384);this['_addCheckView'](_0x395f1c);}this['_onChecksSet']();}_getVisualOrder(_0x3d0307){return _0x3d0307;}_onChecksSet(){}_createCheckView(_0x2e8f8d,_0x85e5d2,_0x4fcf74){const _0x5cf137=new Pc(this['locale'],_0x2e8f8d,_0x85e5d2,_0x4fcf74);return _0x5cf137['delegate']('runReviewCheck')['to'](this),this['listenTo'](_0x5cf137,'change:isParametrizedViewOpen',(_0x58f0c0,_0x17801c,_0x5e19b7)=>{_0x5e19b7&&this['_closeCheckViewsOtherThan'](_0x5cf137);}),_0x5cf137;}_closeCheckViewsOtherThan(_0x1c6bd2=null){for(const _0x1995a8 of this['getCheckViews']())_0x1995a8!==_0x1c6bd2&&_0x1995a8['isParametrizedViewOpen']&&(_0x1995a8['isParametrizedViewOpen']=!0x1);}['render'](){super['render'](),_0x314252({'emitter':this,'activator':()=>this['getCheckViews']()['some'](_0x2e019e=>_0x2e019e['isParametrizedViewOpen']),'contextElements':()=>this['getCheckViews']()['filter'](_0x4eb6b3=>_0x4eb6b3['isItemParametrized'])['map'](_0x5e304a=>_0x5e304a['element']),'callback':()=>this['_closeCheckViewsOtherThan']()});}getCheckViewById(_0x243857){return this['getCheckViews']()['find'](_0x227b08=>_0x227b08['check']['id']===_0x243857);}['hasChecks'](){return this['getCheckViews']()['length']>0x0;}resetAllParameterizedChecks(){for(const _0x303c4b of this['getCheckViews']())_0x303c4b['isItemParametrized']&&_0x303c4b['resetToDefault']();}},Vc=class extends Mc{_parameterizedCheckViews;_nonParameterizedCheckViews;constructor(_0x38378a){super(_0x38378a),this['_parameterizedCheckViews']=new _0x340eed(_0x38378a),this['_parameterizedCheckViews']['label']=qs(_0x38378a,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_PARAMETERIZED'),this['_parameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_nonParameterizedCheckViews']=new _0x340eed(_0x38378a),this['_nonParameterizedCheckViews']['label']=qs(_0x38378a,'AI_REVIEW_MODE_REVIEW_CATEGORY_TITLE_NON_PARAMETERIZED'),this['_nonParameterizedCheckViews']['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-group']}}),this['_setupTemplate']();}_getVisualOrder(_0x2577be){return[..._0x2577be['filter'](_0xc38b69=>!_0xc38b69['isParameterized']),..._0x2577be['filter'](_0x52ebb6=>_0x52ebb6['isParameterized'])];}['_clearCheckViews'](){this['_parameterizedCheckViews']['items']['clear'](),this['_nonParameterizedCheckViews']['items']['clear'](),this['items']['clear']();}['_addCheckView'](_0x5ca425){_0x5ca425['isItemParametrized']?this['_parameterizedCheckViews']['items']['add'](_0x5ca425):this['_nonParameterizedCheckViews']['items']['add'](_0x5ca425),this['items']['add'](_0x5ca425);}_onChecksSet(){this['_parameterizedCheckViews']['isVisible']=this['_parameterizedCheckViews']['items']['length']>0x0,this['_nonParameterizedCheckViews']['isVisible']=this['_nonParameterizedCheckViews']['items']['length']>0x0;}getCheckViews(){return[...this['_nonParameterizedCheckViews']['items'],...this['_parameterizedCheckViews']['items']]['filter'](_0x551437=>_0x551437 instanceof Pc);}_setupTemplate(){const _0x3ac516=this['bindTemplate'];this['setTemplate']({'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x3ac516['if']('isVisible','ck-hidden',_0x4e61ad=>!_0x4e61ad)]},'children':[this['_nonParameterizedCheckViews'],this['_parameterizedCheckViews']]});}};function Hc(_0x53c5c5){const _0x37bcd2=Zs(_0x53c5c5);return _0x37bcd2['length']>0x0&&_0x37bcd2['every'](_0x2b12c1=>_0x2b12c1['plugins']['has']('TrackChanges'));}function Uc(_0x376d4d){return Zs(_0x376d4d)['some'](_0x482e6b=>function(_0x256d6c){return Boolean(_0x256d6c['commands']['get']('trackChanges')?.['value']);}(_0x482e6b));}var Bc=class extends Cc{static get['pluginName'](){return'AIReviewModeUI';}createMainView(){const _0x517d98=this['context']['plugins']['get']('AITabs'),_0x18e04f=this['context']['locale'],_0x23e6e0=new sh(_0x18e04f,{'label':qs(_0x18e04f,'AI_REVIEW_MODE'),'icon':_0x2c00e7,'class':'ck-ai-header_review','showResizeButton':_0x517d98['showResizeButton']});_0x23e6e0['delegate']('resizeTabs')['to'](_0x517d98),_0x23e6e0['bind']('isMaximized')['to'](_0x517d98['view'],'isMaximized',_0xb87ea5=>_0xb87ea5);const _0x1e7758=new Rc(this['context']['locale'],{'header':_0x23e6e0,'list':new Vc(_0x18e04f),'results':new yc(_0x18e04f,{'generalErrorText':qs(_0x18e04f,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x18e04f,{'headerText':qs(_0x18e04f,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':qs(_0x18e04f,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x18e04f,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});return _0x1e7758['extendTemplate']({'attributes':{'class':'ck-ai-review-mode'}}),_0x1e7758;}registerTab(){const _0x38d910=this['context']['plugins']['get']('AITabs');_0x38d910['view']['on']('activateTab',(_0x3d1cc3,{newTab:_0x585689,oldTab:_0xdd0821})=>{_0x585689===Sh?this['fire']('getReviewCheckList'):_0xdd0821===Sh&&this['fire']('leaveReview');}),_0x38d910['view']['addTab']({'id':Sh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2c00e7,'order':0x0,'content':this['_mainView']});}_isSuggestButtonVisibleForChange(){return Hc(this['context']);}_isAcceptButtonVisibleForChange(){return!this['_isSuggestButtonVisibleForChange']()||!Uc(this['context']);}},Gc=class extends or{_affectedBlocks=[];get affectedBlocks(){return this['_affectedBlocks']['slice']();}set affectedBlocks(_0x417f19){this['_affectedBlocks']=_0x417f19;}};const Wc='review-',Fc=['softBreak'],Kc=['htmlScript','htmlStyle','htmlCustomElement'];var $c=class extends _0x4cd5fc{static get requires(){return[Un,Pn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();_activeMarkers=new Set();_domEmitter;_eventEmitter;shadowRootRegistry=new Ct();_reviewEditingAttachedEditors=new WeakSet();_boundEditables=new WeakMap();_inlineRootDataIds=new WeakMap();['_markerBlurHandler']=null;constructor(_0x628627){super(_0x628627),this['_domEmitter']=new(gt())(),this['_eventEmitter']=new(It())();}get emitter(){return this['_eventEmitter'];}afterInit(){const _0x3aa29d=_0x518468=>this['_scheduleAttachReviewEditingToEditor'](_0x518468);if(this['_registerGlobalMarkerBlurHandler'](),this['context']instanceof _0x553634)return void _0x3aa29d(this['context']);const _0x328437=this['context'];for(const _0x32f5c7 of _0x328437['editors'])_0x3aa29d(_0x32f5c7);this['listenTo'](_0x328437['editors'],'add',(_0x462835,_0x5bf75e)=>{_0x3aa29d(_0x5bf75e);}),this['listenTo'](_0x328437['editors'],'remove',(_0x48db98,_0x1e9ac6)=>{for(const [_0xe93c79,_0x525d11]of this['_markers'])_0x525d11['editor']===_0x1e9ac6&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0xe93c79,'changeId':_0x525d11['groupId']}),this['_markers']['delete'](_0xe93c79));});}destroy(){super['destroy'](),this['_domEmitter']['stopListening'](),this['shadowRootRegistry']['destroy'](),this['_markerBlurHandler']?.['cancel']();}_scheduleAttachReviewEditingToEditor(_0x462d32){const _0x6c388f=()=>{'destroyed'!==_0x462d32['state']&&_0x462d32['conversion']&&this['_attachReviewEditingToEditor'](_0x462d32);};if('ready'===_0x462d32['state'])return void _0x6c388f();const _0x561c5c=()=>{this['stopListening'](_0x462d32,'ready',_0x561c5c),_0x6c388f();};this['listenTo'](_0x462d32,'ready',_0x561c5c);}_attachReviewEditingToEditor(_0x5658a0){this['_reviewEditingAttachedEditors']['has'](_0x5658a0)||(_0x5658a0['conversion']['for']('editingDowncast')['markerToElement']({'model':Wc+'insert','view':(_0x54f8c3,{writer:_0x43536e})=>{const _0x4cd772=this['_markers']['get'](_0x54f8c3['markerName']),_0x5bdba0={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4cd772?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x54f8c3['markerName']};return _0x43536e['createUIElement']('span',_0x5bdba0,function(_0x145621){const _0x41186c=this['toDomElement'](_0x145621);return _0x41186c['innerHTML']=Qt(_0x4cd772?.['content']?.['asString']||''),_0x41186c;});}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-only','view':_0xd92147=>{const _0x411d9e=this['_markers']['get'](_0xd92147['markerName']),_0x1dcc24=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x411d9e?.['id']||'')&&_0x1dcc24['push']('ck-ai_review__change_active'),{'classes':_0x1dcc24,'attributes':{'data-marker-id':_0xd92147['markerName']}};}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-context','view':_0x4b2e5b=>{const _0x5b64b7=this['_markers']['get'](_0x4b2e5b['markerName']),_0x170708=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5b64b7?.['id']||'')&&_0x170708['push']('ck-ai_review__change_active'),{'classes':_0x170708,'attributes':{'data-marker-id':_0x4b2e5b['markerName']}};}}),_0x5658a0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Wc+'remove-text','view':_0xf45d71=>{const _0x4e5202=this['_markers']['get'](_0xf45d71['markerName']),_0x1200b1=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x4e5202?.['id']||'')&&_0x1200b1['push']('ck-ai_review__change_active'),{'classes':_0x1200b1,'attributes':{'data-marker-id':_0xf45d71['markerName']}};}}),_0x5658a0['conversion']['for']('dataDowncast')['markerToElement']({'model':Wc+'suggestion-context','view':(_0x1100ee,{writer:_0x2092ab})=>_0x2092ab['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x1100ee['isOpening']?'start':'end')})}),_0x5658a0['conversion']['for']('downcast')['attributeToAttribute']({'model':Vn,'view':Hn}),this['_updateMouseMarkerInteractionListeners'](_0x5658a0),this['listenTo'](_0x5658a0,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5658a0),{'priority':'lowest'}),this['listenTo'](_0x5658a0,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5658a0),{'priority':'lowest'}),_0x5658a0['model']['document']['registerPostFixer'](_0x582b6e=>this['_validateMarkers'](_0x5658a0,_0x582b6e)),_0x5658a0['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5658a0)),this['_reviewEditingAttachedEditors']['add'](_0x5658a0));}_updateMouseMarkerInteractionListeners(_0x54e4ad){let _0x48b926=this['_boundEditables']['get'](_0x54e4ad);_0x48b926||(_0x48b926=new Map(),this['_boundEditables']['set'](_0x54e4ad,_0x48b926));const _0x12ffbf=new Set(_0x54e4ad['ui']['getEditableElementsNames']());for(const _0x4bbdc3 of _0x12ffbf){if(_0x48b926['has'](_0x4bbdc3))continue;const _0x44f91e=_0x54e4ad['ui']['getEditableElement'](_0x4bbdc3);_0x48b926['set'](_0x4bbdc3,_0x44f91e),this['_attachMouseMarkerInteractionListeners'](_0x44f91e),this['shadowRootRegistry']['registerNode'](_0x44f91e);}for(const [_0x394d57,_0x43cee3]of _0x48b926)_0x12ffbf['has'](_0x394d57)||(_0x48b926['delete'](_0x394d57),this['_domEmitter']['stopListening'](_0x43cee3),this['shadowRootRegistry']['unregisterNode'](_0x43cee3));}_attachMouseMarkerInteractionListeners(_0x1fa5d9){this['_domEmitter']['listenTo'](_0x1fa5d9,'mouseup',(_0xa56af7,_0xc5d857)=>{const _0xa736bc=_0xc5d857['target'],_0x2f6b49=this['_findMarkerElement'](_0xa736bc);if(!_0x2f6b49)return;const _0x54741d=_0x2f6b49['getAttribute']('data-marker-id'),_0x1f593d=_0x54741d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x54741d,'changeId':_0x1f593d,'markerElement':()=>this['_findMarkerElementById'](_0x54741d),'domEvent':_0xc5d857});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x1fa5d9,'mouseover',(_0x5931ec,_0x141200)=>{const _0xe152cf=_0x141200['target'],_0x2ee9e2=_0x141200['relatedTarget'];let _0x2f724f=this['_findMarkerElement'](_0xe152cf);if(!_0x2f724f&&_0x2ee9e2&&(_0x2f724f=this['_findMarkerElement'](_0x2ee9e2)),!_0x2f724f)return;const _0x316ef5=_0x2f724f['getAttribute']('data-marker-id'),_0x485db2=_0x316ef5['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x485db2,'markerElement':()=>this['_findMarkerElementById'](_0x316ef5),'domEvent':_0x141200});});}_registerGlobalMarkerBlurHandler(){const _0x4987d0=_0x2fd977((_0x35c41e,_0x164bdb)=>{const _0x4dd13e=this['_getHoveredElement'](_0x164bdb);_0x4dd13e&&(this['_findMarkerElement'](_0x4dd13e)||this['_eventEmitter']['fire']('changeMarkerBlurred'));},0xc8);this['_markerBlurHandler']=_0x4987d0,this['_domEmitter']['listenTo'](document,'mouseover',_0x4987d0),Gt(this['shadowRootRegistry'],{'emitter':this['_domEmitter'],'event':'mouseover','callback':_0x4987d0});}_getHoveredElement(_0x49300e){return this['shadowRootRegistry']['refresh'](),Nt(_0x49300e['clientX'],_0x49300e['clientY'],Array['from'](this['shadowRootRegistry']['getShadowRoots']()));}getDocumentData(_0x34c455){const _0x3de101=this['context']['plugins']['get']('AIEditing'),_0x21ba9d=Zs(this['context']);if(!_0x21ba9d['length'])throw new dt('ai-get-editor-from-context-no-editor',this);const _0x4a2034=_0x34c455?.['roots'];if(_0x4a2034&&0x0===_0x4a2034['length'])throw new dt('ai-reviewcoreediting-empty-roots',this);const _0x4bc3d5=_0x4a2034?new Set(_0x4a2034['map'](_0x497556=>_0x497556['channelId']+'\x00'+_0x497556['rootName'])):null,_0x4b5cb7=_0x4bc3d5?new Set():null,_0x55c8bb=new Set(),_0x246a36=[],_0x96878d=new Map(),_0x7e8a57=[];for(const _0xfa9b81 of _0x21ba9d){const _0x869ff4=_0xfa9b81['config']['get']('collaboration.channelId');for(const _0x1f1a94 of _0xfa9b81['model']['document']['getRoots']()){const _0x385d42=_0x869ff4+'\x00'+_0x1f1a94['rootName'];if(_0x4bc3d5&&!_0x4bc3d5['has'](_0x385d42))continue;const _0x416527=this['_buildDocumentDataSliceForRoot'](_0xfa9b81,_0x1f1a94,_0x3de101,_0x55c8bb);_0x246a36['push'](_0x416527['content']);for(const [_0x31e996,_0x546e2f]of _0x416527['elements'])_0x96878d['set'](_0x31e996,_0x546e2f);_0x7e8a57['push']({'channelId':_0x869ff4,'rootName':_0x1f1a94['rootName'],'content':_0x416527['content'],'documentVersion':_0x416527['documentVersion']}),_0x4b5cb7?.['add'](_0x385d42);}}if(_0x4a2034&&_0x4b5cb7['size']!==_0x4bc3d5['size']){const _0x34537e=_0x4a2034['find'](_0x271be0=>!_0x4b5cb7['has'](_0x271be0['channelId']+'\x00'+_0x271be0['rootName']));throw new dt('ai-reviewcoreediting-root-not-found',this,{'channelId':_0x34537e['channelId'],'rootName':_0x34537e['rootName']});}return{'elements':_0x96878d,'content':_0x246a36['join'](''),'roots':_0x7e8a57};}async['runCheck'](_0xd7b81b,_0x4c4786){const _0x12abb4=new hr(),_0x3a7119=_0x4c4786?.['signal'];let _0x3ae4dd;const _0x37fc1f=()=>{_0x12abb4['abort'](),_0xd7b81b['abort']();};if(_0x3a7119){if(_0x3a7119['aborted'])return _0x37fc1f(),_0x12abb4;_0x3a7119['addEventListener']('abort',_0x37fc1f),_0x3ae4dd=()=>_0x3a7119['removeEventListener']('abort',_0x37fc1f);}const _0x27115c={'apiId':_0xd7b81b['sourceCheck']['apiId']};try{_0xd7b81b['on']('reviewCheckRunUpdated',(_0x2e8753,_0x1d7108)=>{'aborted'===_0x1d7108['status']?_0x12abb4['abort']():'error-general'!==_0x1d7108['status']&&'error-chunk'!==_0x1d7108['status']||(_0x12abb4['error']=rr(_0x1d7108['error'],'ai-reviewcoreediting-check-run-failed',this,_0x27115c));}),'aborted'!==_0x12abb4['status']&&await _0xd7b81b['start']();}catch(_0x534ff2){_0x12abb4['error']=rr(_0x534ff2,'ai-reviewcoreediting-check-run-failed',this,_0x27115c);}finally{_0x3ae4dd&&_0x3ae4dd();}return'error'===_0x12abb4['status']||'aborted'===_0x12abb4['status']||(_0x12abb4['addResult'](...this['_buildPerRootResults'](_0xd7b81b)),_0x12abb4['status']='completed'),_0x12abb4;}buildErrorContext(_0x53ee43){return{'apiId':_0x53ee43['sourceCheck']['apiId']};}_buildPerRootResults(_0x45cf9a){const _0x539709=this['buildErrorContext'](_0x45cf9a),_0x39a9d5=this['context']['plugins']['get']('AIEditing'),_0x2db3fd=this['context']['plugins']['get']('AIGateway'),_0x5658ab=new Map();for(const _0x10ddde of Zs(this['context']))_0x5658ab['set'](_0x10ddde['config']['get']('collaboration.channelId'),_0x10ddde);return _0x45cf9a['documentData']['roots']['map'](({channelId:_0x570728,rootName:_0x55a18f,content:_0x4fdbf1,documentVersion:_0x5cb7b2})=>{const _0x143967=_0x5658ab['get'](_0x570728),_0x1ddd06=new Gc({'editor':_0x143967,'rootName':_0x55a18f,'channelId':_0x570728,'sessionId':_0x39a9d5['getSessionId'](_0x143967)});_0x1ddd06['contentRawOld']=_0x4fdbf1,_0x1ddd06['documentVersion']=_0x5cb7b2;const _0x5d6a5b=this['_collectResultAffectedBlocks'](_0x1ddd06,_0x45cf9a['results'],_0x45cf9a['documentData']['elements']);_0x1ddd06['affectedBlocks']=_0x5d6a5b;try{_0x1ddd06['contentRawNew']=sn(_0x2db3fd['mergeChangesIntoContent'](_0x5d6a5b,_0x1ddd06['contentRawOld']));}catch(_0x380de3){_0x1ddd06['error']=rr(_0x380de3,'ai-reviewcoreediting-check-run-failed',this,_0x539709);}return _0x1ddd06;});}_collectResultAffectedBlocks(_0x477556,_0x212ada,_0x329821){return _0x212ada['filter'](_0x5988bc=>{const _0x4bb70b=_0x329821['get'](_0x5988bc['id']);return!!_0x4bb70b&&_0x4bb70b['editor']===_0x477556['editor']&&_0x4bb70b['rootName']===_0x477556['rootName'];})['map'](_0x85fab=>({'id':_0x85fab['id'],'content':_0x85fab['contentNew']}));}_buildDocumentDataSliceForRoot(_0x1795bd,_0x31e492,_0x2e89d2,_0x1b11fc){const _0x297486=_0x1795bd['model'],_0x37b12e=new _0x1f9306();for(const _0x2593cb of _0x31e492['getChildren']())_0x37b12e['_appendChild'](_0x2593cb['_clone'](!0x0));for(const _0x62f821 of _0x297486['markers']){const _0x31ab7c=_0x62f821['getRange']();_0x31ab7c&&_0x31ab7c['root']['rootName']===_0x31e492['rootName']&&_0x37b12e['markers']['set'](_0x62f821['name'],this['_changeRangeOwnerDocument'](_0x31ab7c['clone'](),_0x37b12e));}const _0x4355d7=new Map(),_0x5732b5=_0x297486['document']['version'];if(En(_0x1795bd,_0x31e492['rootName'])){let _0x5168d8=this['_inlineRootDataIds']['get'](_0x31e492);_0x5168d8?_0x1b11fc['add'](_0x5168d8):(_0x5168d8=_0x2e89d2['_nextDataId'](_0x1b11fc),this['_inlineRootDataIds']['set'](_0x31e492,_0x5168d8));const _0x1ae4bc=pn(_0x1795bd['data']['processor']['toData'](_0x1795bd['data']['toView'](_0x37b12e)),_0x5168d8);return _0x4355d7['set'](_0x5168d8,{'editor':_0x1795bd,'rootName':_0x31e492['rootName'],'path':[],'documentVersion':_0x5732b5,'getContent':()=>_0x1ae4bc}),{'content':_0x1ae4bc,'documentVersion':_0x5732b5,'elements':_0x4355d7};}const _0x37dff5=new _0x3d1b58({'ignoreElementEnd':!0x0,'startPosition':_0x297486['createPositionAt'](_0x37b12e,0x0)});for(const {item:_0x3786bc}of _0x37dff5){if(_0x3786bc['is']('element')&&_0x3786bc['name']&&Kc['includes'](_0x3786bc['name'])){const _0x22a1c9=this['_upsertDataId'](_0x3786bc,()=>_0x2e89d2['_nextDataId'](_0x1b11fc));_0x1b11fc['add'](_0x22a1c9);}if(!_0x3786bc['is']('$textProxy'))continue;const _0x5856db=_0x3786bc['parent'];if(!_0x5856db||!_0x5856db['is']('element'))continue;const _0x38bbb6=this['_upsertDataId'](_0x5856db,()=>_0x2e89d2['_nextDataId'](_0x1b11fc));_0x1b11fc['add'](_0x38bbb6);for(const _0x58d7a4 of _0x5856db['getChildren']())_0x58d7a4['is']('element')&&(_0x58d7a4['name']&&Fc['includes'](_0x58d7a4['name'])||_0x1b11fc['add'](this['_upsertDataId'](_0x58d7a4,()=>_0x2e89d2['_nextDataId'](_0x1b11fc))));let _0x472c56=_0x5856db;for(;_0x472c56['parent']&&!_0x472c56['parent']['is']('documentFragment');)_0x472c56=_0x472c56['parent'],_0x472c56['hasAttribute']('$elementId')&&_0x472c56['_removeAttribute'](Vn);_0x4355d7['set'](_0x38bbb6,{'editor':_0x1795bd,'rootName':_0x31e492['rootName'],'path':_0x5856db['getPath'](),'documentVersion':_0x5732b5,'getContent':this['_createGetContentUsingDataIdFn'](_0x472c56['_clone'](!0x0),_0x38bbb6,_0x1795bd['data'])}),_0x37dff5['jumpTo'](_0x297486['createPositionAfter'](_0x5856db));}return{'content':_0x1795bd['data']['processor']['toData'](_0x1795bd['data']['toView'](_0x37b12e)),'documentVersion':_0x5732b5,'elements':_0x4355d7};}diffContent(_0x3614eb,_0x5955e9,_0x5ef25a,_0x14bf1c=!0x1){const {contentInitial:_0x3c2c0d,contentNew:_0x1d8410}=this['_neutralizeChangesOnUnsupportedElements'](_0x5955e9,_0x5ef25a),_0x1e51a9=[],_0x580ed1=_0x3614eb['data']['parse'](_0x1d8410,'$documentFragment'),_0x25bc9c=_0x3614eb['data']['parse'](_0x3c2c0d,'$documentFragment'),_0x217630=_0x3614eb['model']['createPositionAt'](_0x25bc9c,0x0);if(this['_haveSingleTopLevelElement'](_0x580ed1)){if(!this['_hasSameTopLevelElement'](_0x25bc9c,_0x580ed1))return _0x1e51a9;}else{const _0x29dc29=_0x3614eb['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x25bc9c,_0x29dc29)||!this['_haveOnlyInlineContent'](_0x580ed1,_0x29dc29))return _0x1e51a9;}const _0x392266=this['context']['plugins']['get']('DocumentChanges')['getDiff'](_0x3c2c0d,_0x1d8410,{'targetEditor':_0x3614eb,'anchor':_0x217630,'markDeletions':!0x0})['filter'](_0x442da7=>'insert'===_0x442da7['type']||'marker'===_0x442da7['type']&&_0x442da7['name']['startsWith']('$markedRemove')),_0x1dd144=this['_groupAdjacentOperations'](_0x392266),_0x2aedbf=[];if(_0x14bf1c){if(_0x1dd144['length']){const _0x36f456=_0x1dd144[0x0]['operations'][0x0],_0x3a4cef='insert'===_0x36f456['type']?_0x36f456['position']:_0x36f456['newRange']['start'],_0x9eaa22=this['_getPositionLimitingRange'](_0x3a4cef,_0x3614eb,'inside'),_0x1fe5e2=_0x9eaa22?_0x9eaa22['start']['parent']:_0x25bc9c,_0x53091a=_0x9eaa22?_0x580ed1['getChild'](0x0):_0x580ed1;let _0x47af12=_0x53091a['getChildren'](),_0x26a273=_0x9eaa22||_0x3614eb['model']['createRangeIn'](_0x25bc9c);const _0x53be60=this['_getTrailingSoftBreaks'](_0x1fe5e2),_0x2dc643=this['_getTrailingSoftBreaks'](_0x53091a),_0x598028=Math['min'](_0x53be60['length'],_0x2dc643['length']);if(_0x598028>0x0){const _0x41b27f=_0x53be60[_0x53be60['length']-_0x598028]['startOffset'],_0x4f0e2c=_0x2dc643[_0x2dc643['length']-_0x598028]['startOffset'];_0x26a273=new _0x3aaa22(_0x26a273['start'],_0x3614eb['model']['createPositionAt'](_0x1fe5e2,_0x41b27f)),_0x47af12=Array['from'](_0x47af12)['filter'](_0x2f47ba=>_0x2f47ba['startOffset']<_0x4f0e2c);}const _0x4ba144=[new _0x2070bd('$markedRemove:synthetic'+Xt(),null,_0x26a273,_0x3614eb['model']['document']['model']['markers'],!0x0,_0x3614eb['model']['document']['version']+0x1),new _0x38210e(_0x26a273['end'],_0x47af12,_0x3614eb['model']['document']['version']+0x2)];_0x2aedbf['push']({'operations':_0x4ba144,'operationsIsolated':_0x4ba144,'groupOffset':0x0});}}else _0x2aedbf['push'](..._0x1dd144);let _0x27de4c=0x0;return _0x3614eb['model']['change'](_0x7a3d40=>{for(let _0x3f112f=0x0;_0x3f112f<_0x2aedbf['length'];_0x3f112f++){const _0x1ddb96=_0x2aedbf[_0x3f112f],_0x3d67fa=_0x7a3d40['createDocumentFragment']();for(const _0x3b6fc8 of _0x25bc9c['getChildren']())_0x7a3d40['append'](_0x3b6fc8['_clone'](!0x0),_0x3d67fa);for(const _0x2f012b of _0x1ddb96['operationsIsolated'])if('insert'===_0x2f012b['type']){const _0x1d4389=_0x2f012b;_0x1d4389['baseVersion']=null,_0x1d4389['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1d4389,_0x3d67fa),_0x7a3d40['batch']['addOperation'](_0x2f012b),_0x3614eb['model']['applyOperation'](_0x2f012b);const _0x5baf66='suggestion:insertion:id:authorId:'+_0x27de4c++,_0x210f9a=_0x3614eb['model']['createRange'](_0x1d4389['position'],_0x1d4389['position']['getShiftedBy'](_0x1d4389['howMany']));_0x3d67fa['markers']['set'](_0x5baf66,_0x210f9a);}else{if('marker'===_0x2f012b['type']&&_0x2f012b['name']['startsWith']('$markedRemove')){const _0x471071=_0x2f012b,_0xd89a6e='suggestion:deletion:id:authorId:'+_0x27de4c++;this['_changeOperationOwnerDocument'](_0x471071,_0x3d67fa),_0x3d67fa['markers']['set'](_0xd89a6e,_0x471071['newRange']);}}if(_0x14bf1c)_0x1e51a9['push']({..._0x1ddb96,'context':this['_createGetContentFn'](_0x25bc9c,_0x3614eb['data']),'content':this['_createGetContentFn'](_0x25bc9c,_0x3614eb['data'])});else{const _0xe49b58=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1ddb96['operationsIsolated'][0x0]),_0x3d67fa),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1ddb96['operationsIsolated'][_0x1ddb96['operationsIsolated']['length']-0x1]),_0x3d67fa),_0x3614eb);_0x3d67fa['markers']['set'](Wc+'suggestion-context',new _0x3aaa22(_0xe49b58['start'],_0xe49b58['end'])),_0x1e51a9['push']({..._0x1ddb96,'context':this['_createGetContextFn'](_0x3d67fa,_0x3614eb['data'],{'ellipsisBefore':_0xe49b58['hasContentBefore'],'ellipsisAfter':_0xe49b58['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3d67fa,_0x3614eb['data'])});}}}),_0x1e51a9;}markChangePositionInEditorContent(_0x3b38cd,_0x165014){if(!_0x3b38cd['length'])return;const _0x102585=_0x3b38cd[0x0]['parent']['id'],_0x265fa2=_0x165014['elements']['get'](_0x102585);if(!_0x265fa2)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x102585);const _0x3d7d7f=_0x265fa2['path'],_0x1496f8=_0x265fa2['editor'],_0x1c63e6=_0x1496f8['model']['document']['getRoot'](_0x265fa2['rootName']);if(!_0x1c63e6)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x265fa2['rootName']);const _0xd2902d=_0x1496f8['model']['document']['history']['getOperations'](_0x265fa2['documentVersion']),_0x56a459=[];for(const _0x53d8e0 of _0x3b38cd){const _0x8a8afe=_0x53d8e0['operationsIsolated']['map'](_0x4f7fa3=>this['_translateOperationToEditorContent'](_0x4f7fa3,_0x3d7d7f,_0x1c63e6));if(!_0x8a8afe||!_0x8a8afe['length'])continue;const _0x36727f=_0x8a8afe['every'](_0x5bea71=>'marker'===_0x5bea71['type']&&_0x5bea71['name']['startsWith']('$markedRemove')),_0x2a3fe0={'document':_0x1496f8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x51c000=_0x3e782f(_0x8a8afe,_0xd2902d,_0x2a3fe0)['operationsA'];for(const _0x167efd of _0x51c000)if('insert'===_0x167efd['type']){const _0x1a389f=_0x167efd;_0x1a389f['position']=this['_clampPositionToParent'](_0x1a389f['position']);const _0x3eb5f1=_0x1a389f['nodes'];_0x1496f8['model']['change'](_0x20bdf9=>{const _0x4655c1=_0x20bdf9['createDocumentFragment']();for(const _0x1fb9e8 of _0x3eb5f1)_0x20bdf9['append'](_0x1fb9e8['_clone'](!0x0),_0x4655c1);_0x56a459['push']({'start':_0x1a389f['position'],'end':_0x1a389f['position'],'type':'insert','groupId':_0x53d8e0['id'],'content':{'asString':this['_createGetContentFn'](_0x4655c1,_0x1496f8['data'])(),'asFragment':_0x4655c1}});});}else{if('marker'===_0x167efd['type']&&_0x167efd['name']['startsWith']('$markedRemove')){const _0x32c707=_0x167efd;_0x32c707['newRange']=new _0x3aaa22(this['_clampPositionToParent'](_0x32c707['newRange']['start']),this['_clampPositionToParent'](_0x32c707['newRange']['end']));let _0x1d0ea7='remove-text';if(_0x36727f){const _0xcc810f=this['_findAdjacentContextDistance'](_0x32c707['newRange']['start'],'backward',_0x1496f8['model']['schema']),_0x2dd6aa=this['_findAdjacentContextDistance'](_0x32c707['newRange']['end'],'forward',_0x1496f8['model']['schema']);if(_0xcc810f||_0x2dd6aa){const _0x566a35=_0x32c707['newRange']['start']['getShiftedBy'](-_0xcc810f),_0xa18402=_0x32c707['newRange']['end']['getShiftedBy'](_0x2dd6aa);_0x56a459['push']({'start':_0x566a35,'end':_0xa18402,'groupId':_0x53d8e0['id'],'type':'remove-context'});}else _0x1d0ea7='remove-only';}_0x56a459['push']({'start':_0x32c707['newRange']['start'],'end':_0x32c707['newRange']['end'],'groupId':_0x53d8e0['id'],'type':_0x1d0ea7});}}}this['_insertMarkers'](_0x56a459,_0x1496f8);}['clearAllMarkers'](){const _0x4998b7=new Map();for(const _0x3084f9 of this['_markers']['keys']()){const _0xef4d03=this['_markers']['get'](_0x3084f9);_0xef4d03?.['editor']&&(_0x4998b7['has'](_0xef4d03['editor'])||_0x4998b7['set'](_0xef4d03['editor'],[]),_0x4998b7['get'](_0xef4d03['editor'])['push'](_0x3084f9));}for(const [_0x50f5e1,_0x373bc2]of _0x4998b7)_0x50f5e1['model']['change'](_0x401289=>{for(const _0x1bdda3 of _0x373bc2)_0x50f5e1['model']['markers']['get'](_0x1bdda3)&&_0x401289['removeMarker'](_0x1bdda3);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}switchToReadOnly(){for(const _0x281abc of this['getEditors']())_0x281abc['enableReadOnlyMode']('ai-review');}switchToEdit(){for(const _0x57a5a4 of this['getEditors']())_0x57a5a4['disableReadOnlyMode']('ai-review');}['applyChange'](_0x376720,_0x1ef812=null){const _0x555ca8=_0x376720['map'](_0x157f23=>this['_getMarkersDataForGroup'](_0x157f23))['flat'](),_0x3b6ef1=new Map();for(const _0x5cccff of _0x555ca8)_0x3b6ef1['has'](_0x5cccff['editor'])||_0x3b6ef1['set'](_0x5cccff['editor'],[]),_0x3b6ef1['get'](_0x5cccff['editor'])['push'](_0x5cccff);for(const [_0x5595c5,_0x3cbea7]of _0x3b6ef1){const _0x34114c=_0x5595c5['model'],_0x2bf2a9=_0x5595c5['plugins']['has']('TrackChangesEditing')?_0x5595c5['plugins']['get']('TrackChangesEditing'):null;_0x34114c['change'](_0x3eafd4=>{for(const _0x3db86b of _0x3cbea7){const _0x302e3b=_0x5595c5['model']['markers']['get'](_0x3db86b['id']);if(!_0x302e3b)continue;const _0x51bece=_0x3eafd4['batch']['operations']['length'];if('insert'===_0x3db86b['type']){if(!_0x3db86b['content'])continue;_0x34114c['insertContent'](_0x3db86b['content']['asFragment']||null,_0x302e3b['getRange']()['start']);}else'remove-text'!==_0x3db86b['type']&&'remove-only'!==_0x3db86b['type']||_0x34114c['deleteContent'](_0x34114c['createSelection'](_0x302e3b['getRange']()));if(_0x3eafd4['removeMarker'](_0x3db86b['id']),this['_markers']['delete'](_0x3db86b['id']),!_0x1ef812)continue;const _0x3ea669=_0x3eafd4['batch']['operations']['slice'](_0x51bece),_0x4a4772=[],_0x4f3d98=new Set();for(const _0x16b189 of _0x3ea669){if('marker'!=_0x16b189['type']||null!==_0x16b189['oldRange'])continue;const _0x2cb661=_0x16b189['name'],{group:_0x326590,id:_0x2ad9e4}=_0x3940d0(_0x2cb661);if('suggestion'!=_0x326590||!_0x2bf2a9||!_0x2bf2a9['hasSuggestion'](_0x2ad9e4))continue;const _0x123b34=_0x2bf2a9['getSuggestion'](_0x2ad9e4);null===_0x123b34['_originalSuggestionId']&&(_0x4a4772['push'](_0x123b34),_0x4f3d98['add'](_0x2cb661));}const _0x3627f6='insert'===_0x3db86b['type']&&_0x4f3d98['size']>0x0;jn(_0x3ea669['filter'](_0x9e9460=>'marker'==_0x9e9460['type']?_0x4f3d98['has'](_0x9e9460['name']):!_0x3627f6),_0x1ef812);for(const _0x289c90 of _0x4a4772)_0x289c90['setAttribute']('@ai',{'type':_0x1ef812});}});}}applyChangesAsSuggestions(_0xd560f3,_0x4797df=null){const _0x5e992b=_0xd560f3['map'](_0x4b8658=>this['_getMarkersDataForGroup'](_0x4b8658))['flat'](),_0x25006b=new Map();for(const _0x549c49 of _0x5e992b)_0x25006b['has'](_0x549c49['editor'])||_0x25006b['set'](_0x549c49['editor'],[]),_0x25006b['get'](_0x549c49['editor'])['push'](_0x549c49);for(const _0x52f5d2 of _0x25006b['keys']())if(!_0x52f5d2['plugins']['has']('TrackChangesEditing'))throw new dt('ai-no-track-changes',this);for(const [_0x9aed63,_0x12a7f3]of _0x25006b){const _0x32cf39=_0x9aed63['plugins']['get']('TrackChangesEditing');_0x9aed63['model']['change'](_0xdab538=>{for(const _0x2106ff of _0x12a7f3){const _0x459128=_0x9aed63['model']['markers']['get'](_0x2106ff['id']);if(_0x459128){const _0x55b0f8=this['_buildSuggestionOperationForMarker'](_0x2106ff,_0x459128,_0x9aed63);_0x55b0f8&&(_0x4797df&&jn([_0x55b0f8],_0x4797df),_0x32cf39['_applyOperationsAsSuggestions']([_0x55b0f8])),_0xdab538['removeMarker'](_0x2106ff['id']);}this['_markers']['delete'](_0x2106ff['id']);}});}}_buildSuggestionOperationForMarker(_0x20e062,_0x527d14,_0x3f1ff4){if('insert'===_0x20e062['type']){if(!_0x20e062['content'])return null;const _0x392b90=Array['from'](_0x20e062['content']['asFragment']['getChildren']())['map'](_0x4d57f1=>_0x4d57f1['_clone'](!0x0));return _0x392b90['length']?new _0x38210e(_0x527d14['getRange']()['start'],_0x392b90,_0x3f1ff4['model']['document']['version']):null;}if('remove-text'===_0x20e062['type']||'remove-only'===_0x20e062['type']){const _0x56eabc=_0x527d14['getRange']();return _0x56eabc['isCollapsed']?null:new _0x2070bd('$markedRemove:aireview'+Xt(),null,_0x56eabc,_0x3f1ff4['model']['markers'],!0x0,_0x3f1ff4['model']['document']['version']);}return null;}rejectChange(_0xe4db21){this['_rejectMarkersForChanges']([_0xe4db21]);}rejectAllChanges(_0x51e939){this['_rejectMarkersForChanges'](_0x51e939);}_rejectMarkersForChanges(_0x3058ca){const _0x1cd4d1=_0x3058ca['map'](_0x41b8a8=>this['_getMarkersDataForGroup'](_0x41b8a8))['flat'](),_0x449223=new Map();for(const _0x231e43 of _0x1cd4d1)_0x449223['has'](_0x231e43['editor'])||_0x449223['set'](_0x231e43['editor'],[]),_0x449223['get'](_0x231e43['editor'])['push'](_0x231e43);for(const [_0x500b87,_0x425013]of _0x449223)_0x500b87['model']['change'](_0x5751fb=>{for(const _0x6a5bcc of _0x425013)_0x500b87['model']['markers']['get'](_0x6a5bcc['id'])&&(_0x5751fb['removeMarker'](_0x6a5bcc['id']),this['_markers']['delete'](_0x6a5bcc['id']));});}getEditor(){return tn(this['context']);}getEditors(){return Zs(this['context']);}getEditorForChange(_0x3cc29e){return this['_getMarkersDataForGroup'](_0x3cc29e)[0x0]?.['editor'];}getMarkerElementForChange(_0x38a594){const _0x2c42aa=Array['from'](this['_markers']['values']())['filter'](_0x3169cc=>_0x3169cc['groupId']===_0x38a594);if(!_0x2c42aa['length'])return null;const _0x5cc48a=0x1===_0x2c42aa['length']?_0x2c42aa[0x0]:this['_sortMarkers'](_0x2c42aa)[0x0],_0x495c87=_0x5cc48a['editor']['model']['markers']['get'](_0x5cc48a['id']);return _0x495c87?{'modelRange':_0x495c87['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5cc48a['id'])}:null;}getContentElementForChange(_0x39e0ae){const _0x41e1b4=Array['from'](this['_markers']['values']())['filter'](_0x30ada9=>_0x30ada9['groupId']===_0x39e0ae);if(!_0x41e1b4['length'])return null;const _0x2acaf9=0x1===_0x41e1b4['length']?_0x41e1b4[0x0]:this['_sortMarkers'](_0x41e1b4)[0x0],_0x39b2cb=_0x2acaf9['editor'],_0x1860d4=_0x39b2cb['model']['markers']['get'](_0x2acaf9['id']);if(!_0x1860d4)return null;const _0x106eb9=_0x1860d4['getRange'](),_0x55325b=_0x39b2cb['editing']['view']['getDomRoot'](_0x106eb9['root']['rootName'])||_0x39b2cb['editing']['view']['getDomRoot']();if(!_0x55325b||!_0x106eb9)return null;let _0x42975f=_0x106eb9['start']['parent'];for(;_0x42975f['parent']&&!_0x42975f['parent']['is']('rootElement');)_0x42975f=_0x42975f['parent'];if(!_0x42975f||!_0x42975f['name'])return null;const _0x2cfde4=_0x55325b['querySelector']('[data-marker-id=\x22'+_0x2acaf9['id']+'\x22]');if(!_0x2cfde4)return null;if(_0x42975f['is']('rootElement'))return _0x2cfde4;let _0x511229=null;_0x39b2cb['model']['change'](_0x122389=>{_0x511229=_0x122389['createDocumentFragment'](),_0x122389['append'](_0x42975f['_clone'](!0x0),_0x511229);});const _0x46b847=_0x39b2cb['data']['toView'](_0x511229)['getChild'](0x0);return _0x2cfde4['closest'](_0x46b847['name']);}reactivateMarkers(_0x1a7c25){const _0x4fe6de=this['_getMarkersDataForGroup'](_0x1a7c25);if(!_0x4fe6de['length'])return;const _0x4249e1=Array['from'](this['_activeMarkers'])['sort'](),_0x2250f8=Array['from'](new Set(_0x4fe6de['map'](_0x315bf9=>_0x315bf9['id'])))['sort']();_0x4249e1['join']('|')!==_0x2250f8['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1a7c25));}setMarkersInElementAsActive(_0x17381e){const _0x483533=this['_getMarkersDataForGroup'](_0x17381e);if(!_0x483533['length'])return;const _0x4bb253=_0x483533[0x0]['editor'],_0x37001b=new Set(_0x483533['map'](_0x59ffe3=>_0x59ffe3['id'])),_0x48cd6f=Array['from'](_0x37001b['values']())['map'](_0x11ad68=>_0x4bb253['model']['markers']['get'](_0x11ad68))['filter'](_0xaf3e9a=>!!_0xaf3e9a);_0x37001b['forEach'](_0x22e429=>{this['_activeMarkers']['add'](_0x22e429);}),_0x4bb253['model']['change'](()=>{_0x48cd6f['forEach'](_0x352d7c=>{_0x4bb253['editing']['reconvertMarker'](_0x352d7c);});});}setAllMarkersAsInactive(){const _0x454455=Array['from'](this['_activeMarkers']);if(!_0x454455['length'])return;this['_activeMarkers']['clear']();const _0x38f4f9=new Map();for(const _0x98538c of _0x454455){const _0x3f2589=this['_markers']['get'](_0x98538c);if(!_0x3f2589)continue;const _0x1573e2=_0x3f2589['editor'],_0x58a7e8=_0x1573e2['model']['markers']['get'](_0x98538c);_0x58a7e8&&(_0x38f4f9['has'](_0x1573e2)||_0x38f4f9['set'](_0x1573e2,[]),_0x38f4f9['get'](_0x1573e2)['push'](_0x58a7e8));}for(const [_0x21b9fd,_0x24faf8]of _0x38f4f9)_0x21b9fd['model']['change'](()=>{_0x24faf8['forEach'](_0x89037e=>{_0x21b9fd['editing']['reconvertMarker'](_0x89037e);});});}_getTrailingSoftBreaks(_0x39a5e9){const _0x13bb08=Array['from'](_0x39a5e9['getChildren']());let _0x4e99c5=_0x13bb08['length'];const _0x23c103=_0x13bb08[_0x4e99c5-0x1];_0x23c103&&_0x23c103['is']('$text')&&''===_0x23c103['data']['trim']()&&_0x4e99c5--;let _0x31063e=_0x4e99c5;for(;_0x31063e>0x0&&_0x13bb08[_0x31063e-0x1]['is']('element','softBreak');)_0x31063e--;return _0x13bb08['slice'](_0x31063e,_0x4e99c5);}_getPositionLimitingRange(_0x225106,_0x125013,_0x560eb8='outside'){if(!_0x225106)return null;let _0x52eae2=_0x225106['parent'];for(;_0x52eae2&&_0x52eae2['parent']&&!_0x52eae2['parent']['is']('rootElement')&&!_0x125013['model']['schema']['isLimit'](_0x52eae2)&&!_0x125013['model']['schema']['isBlock'](_0x52eae2);)_0x52eae2=_0x52eae2['parent'];if(!_0x52eae2||!_0x52eae2['name']||_0x52eae2['is']('rootElement'))return null;let _0x57c1d3=null;return _0x125013['model']['change'](_0x1e7f6d=>{_0x57c1d3='inside'===_0x560eb8?_0x1e7f6d['createRangeIn'](_0x52eae2):_0x1e7f6d['createRangeOn'](_0x52eae2);}),_0x57c1d3;}_validateMarkers(_0x205cb0,_0x3a7fd7){const _0xd3ff6d=Array['from'](this['_markers']['keys']()),_0x1c2190=new Map();for(const _0x5afaf3 of _0xd3ff6d){const _0x50e4e8=_0x205cb0['model']['markers']['get'](_0x5afaf3);if(!_0x50e4e8)continue;const _0x37374a=_0x50e4e8['getStart']()['root']['rootName']+':'+_0x50e4e8['getStart']()['path'][0x0];_0x1c2190['has'](_0x37374a)||_0x1c2190['set'](_0x37374a,[]),_0x1c2190['get'](_0x37374a)['push'](_0x50e4e8);}const _0x37bce3=new Set();for(const _0x593471 of _0x205cb0['model']['document']['differ']['getChanges']()){let _0x2bfa6c,_0x29b4e5;if('insert'===_0x593471['type'])_0x29b4e5=new _0x3aaa22(_0x593471['position'],_0x593471['position']['getShiftedBy'](_0x593471['length'])),_0x2bfa6c=_0x593471['position']['root']['rootName']+':'+_0x593471['position']['path'][0x0];else{if('remove'!==_0x593471['type'])continue;_0x29b4e5=new _0x3aaa22(_0x593471['position']),_0x2bfa6c=_0x593471['position']['root']['rootName']+':'+_0x593471['position']['path'][0x0];}const _0x207deb=_0x1c2190['get'](_0x2bfa6c)||[];if(_0x207deb['length']){for(const _0x13907b of _0x207deb)if(_0x29b4e5['root']['rootName']===_0x13907b['getRange']()['root']['rootName']&&('insert'!==_0x593471['type']||!_0x29b4e5['containsRange'](_0x13907b['getRange']()))&&(_0x29b4e5['isIntersecting'](_0x13907b['getRange']())||_0x29b4e5['start']['isTouching'](_0x13907b['getRange']()['end'])||_0x29b4e5['end']['isTouching'](_0x13907b['getRange']()['start']))){const _0x4b20a9=this['_parseMarkerName'](_0x13907b['name']);Array['from'](this['_markers']['values']())['filter'](_0x168622=>_0x168622['groupId']===_0x4b20a9['groupId'])['forEach'](_0x2c2387=>_0x37bce3['add'](_0x2c2387['id']));}}}if(_0x37bce3['size']){for(const _0x18892c of _0x37bce3)_0x3a7fd7['removeMarker'](_0x18892c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xec9c02){for(const {name:_0x5c14be,data:_0x520feb}of _0xec9c02['model']['document']['differ']['getChangedMarkers']()){if(!_0x5c14be['startsWith'](Wc))continue;const _0x14a4cd=_0x520feb['oldRange'],_0x347fdc=_0x520feb['newRange'],_0x230303=_0x14a4cd&&'$graveyard'===_0x14a4cd['root']['rootName'],_0x2498ec=_0x347fdc&&'$graveyard'===_0x347fdc['root']['rootName'];if(_0x230303&&_0x2498ec)continue;const _0x1ad1a6=this['_parseMarkerName'](_0x5c14be);this['_markers']['get'](_0x5c14be)&&(_0x2498ec||!_0x347fdc?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5c14be,'changeId':_0x1ad1a6['groupId']}):_0x230303&&_0x347fdc&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x5c14be,'changeId':_0x1ad1a6['groupId']}));}}['_parseMarkerName'](_0x481585){const _0x4759a1=_0x481585['split'](':'),_0xf508ed=(_0x4759a1[0x1]||'')['split']('_');return{'prefix':_0x4759a1[0x0],'groupId':_0xf508ed[0x0],'suffix':_0xf508ed[0x1]};}_translateOperationToEditorContent(_0x39ef54,_0x1a5880,_0x37ff16){if('insert'===_0x39ef54['type']){const _0x47842d=_0x39ef54;return new _0x38210e(this['_changePosition'](_0x1a5880['concat'](_0x47842d['position']['offset']),_0x37ff16),_0x47842d['nodes'],_0x47842d['baseVersion']);}if('marker'===_0x39ef54['type']&&_0x39ef54['name']['startsWith']('$markedRemove')){const _0x4a3d85=_0x39ef54;return new _0x2070bd(_0x4a3d85['name'],_0x4a3d85['oldRange'],this['_changeRange'](_0x4a3d85['newRange'],_0x1a5880['concat'](_0x4a3d85['newRange']['start']['offset']),_0x1a5880['concat'](_0x4a3d85['newRange']['end']['offset']),_0x37ff16),_0x4a3d85['_markers'],_0x4a3d85['affectsData'],_0x4a3d85['baseVersion']);}return _0x39ef54;}_groupAdjacentOperations(_0x41cb5f){if(!_0x41cb5f['length'])return[];const _0x56af39=[];let _0x2b3ba1=0x0,_0x550aee=0x0,_0x2f5ca1=[];for(let _0x384b47=0x0;_0x384b47<=_0x41cb5f['length'];_0x384b47++){const _0x540c7c=_0x41cb5f[_0x384b47],_0x19be80=_0x41cb5f[_0x384b47-0x1];!_0x540c7c||_0x19be80&&!this['_getOperationEnd'](_0x19be80)['isTouching'](this['_getOperationStart'](_0x540c7c))?(_0x56af39['push']({'operations':_0x2f5ca1,'operationsIsolated':_0x2f5ca1['map'](_0x1dc46b=>this['_shiftOperation'](_0x1dc46b['clone'](),-_0x550aee)),'groupOffset':_0x2b3ba1}),_0x2f5ca1=_0x540c7c?[_0x540c7c]:[],_0x550aee+=_0x2b3ba1,_0x2b3ba1=0x0):_0x2f5ca1['push'](_0x540c7c),_0x540c7c&&'insert'===_0x540c7c['type']&&(_0x2b3ba1+=_0x540c7c['howMany']);}return _0x56af39;}_findAdjacentContextDistance(_0x3e7143,_0x5c7872,_0x1ad375,_0x30af8e=0x1){const _0x8a2ef3=new _0x3d1b58({'startPosition':_0x3e7143,'direction':_0x5c7872});let _0x2e7b30=0x0;for(let _0x2ce3ce=0x0;_0x2ce3ce<_0x30af8e;_0x2ce3ce++){let _0x269685=0x0,_0x1ea706=!0x1,_0x54a3c2='forward'===_0x5c7872?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x11f6ee}of _0x8a2ef3)if(_0x11f6ee['is']('$textProxy')){const _0x579482=_0x54a3c2['exec'](_0x11f6ee['data']);if(_0x579482&&_0x579482['length']){if(_0x269685+='forward'===_0x5c7872?_0x579482['index']+_0x579482[0x0]['length']:_0x11f6ee['data']['length']-_0x579482['index'],_0x579482[0x0]['length']!==_0x11f6ee['data']['length'])break;_0x1ea706=!0x0,_0x54a3c2='forward'===_0x5c7872?/^\w+/:/\w+$/;}else{if(_0x1ea706)break;_0x269685+=_0x11f6ee['offsetSize'];}}else{if(_0x11f6ee['is']('element')){_0x1ad375['isInline'](_0x11f6ee)&&!_0x1ea706&&(_0x269685+=0x1);break;}}_0x2e7b30+=_0x269685,_0x8a2ef3['jumpTo'](_0x3e7143['getShiftedBy']('forward'===_0x5c7872?_0x2e7b30:-_0x2e7b30));}return _0x2e7b30;}_getChangeContext(_0x535fab,_0x5ea329,_0x4141e8){const _0x35fa38=_0x4141e8['model']['schema'],_0x5b5ade=this['_findAdjacentContextDistance'](_0x535fab,'backward',_0x35fa38,0x6),_0x34ba0f=this['_findAdjacentContextDistance'](_0x5ea329,'forward',_0x35fa38,0x6),_0x5ce7b3=_0x535fab['getShiftedBy'](-_0x5b5ade),_0x4d6490=_0x5ea329['getShiftedBy'](_0x34ba0f);return{'start':_0x5ce7b3,'end':_0x4d6490,'hasContentBefore':!_0x5ce7b3['isAtStart'],'hasContentAfter':!_0x4d6490['isAtEnd']};}_insertMarkers(_0x1737c8,_0x3c51f6){const _0x5d1a54=this['context']['plugins']['get']('AIEditing'),_0x2a347b=new Set();_0x3c51f6['model']['change'](_0xc93e80=>{for(const _0x2bc5e9 of _0x1737c8){const _0x3d043d=''+Wc+_0x2bc5e9['type']+':'+_0x2bc5e9['groupId']+'_'+_0x5d1a54['_nextDataId'](_0x2a347b);this['_markers']['set'](_0x3d043d,{'id':_0x3d043d,'groupId':_0x2bc5e9['groupId'],'type':_0x2bc5e9['type'],'content':_0x2bc5e9['content'],'editor':_0x3c51f6}),_0xc93e80['addMarker'](_0x3d043d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xc93e80['createRange'](_0x2bc5e9['start'],_0x2bc5e9['end'])});}});}_createGetContextFn(_0x54201f,_0x2c3f15,_0x88352a){let _0x281171='';return()=>{if(!_0x281171){const _0x2ef02a=_0x2c3f15['toView'](_0x54201f,{'showSuggestionHighlights':!0x0});let _0x35f074=_0x2ef02a['getChild'](0x0);if(_0x35f074['is']('containerElement')||(_0x35f074=_0x2ef02a),!_0x35f074)return'';let _0x139b34=!0x1;const _0x3b1df7=[];for(const _0x38e569 of _0x35f074['getChildren']())_0x38e569['is']('element','span')&&_0x38e569['hasClass']('ck-ai_review-marker_context-end')&&(_0x139b34=!0x1),_0x139b34&&_0x3b1df7['push'](_0x38e569),_0x38e569['is']('element','span')&&_0x38e569['hasClass']('ck-ai_review-marker_context-start')&&(_0x139b34=!0x0);_0x35f074['_removeChildren'](0x0,_0x35f074['childCount']),_0x88352a?.['ellipsisBefore']&&_0x35f074['_appendChild']('…'),_0x35f074['_appendChild'](_0x3b1df7),_0x88352a?.['ellipsisAfter']&&_0x35f074['_appendChild']('…');const _0x34e5dc=_0x2c3f15['htmlProcessor']['domConverter']['viewToDom'](_0x2ef02a),_0x491754=_0x2c3f15['htmlProcessor']['htmlWriter']['getHtml'](_0x34e5dc);_0x281171=this['_removeUnsupportedElements'](_0x491754);}return _0x281171;};}_createGetContentFn(_0x31f291,_0x2b9a18){let _0x2fd361='';return()=>(_0x2fd361||(_0x2fd361=this['_removeUnsupportedElements'](_0x2b9a18['stringify'](_0x31f291,{'showSuggestionHighlights':!0x0}))),_0x2fd361);}_createGetContentUsingDataIdFn(_0xdb51b4,_0x4deed8,_0xcff7a6){let _0x4c476a='';return()=>{if(!_0x4c476a){const _0x4cc3b4=_0xcff7a6['toView'](new _0x1f9306(_0xdb51b4));_0x4c476a=_0xcff7a6['htmlProcessor']['domConverter']['viewToDom'](_0x4cc3b4)['querySelector']('[data-id=\x22'+_0x4deed8+'\x22]')?.['outerHTML']||'';}return _0x4c476a;};}_removeUnsupportedElements(_0x4909b1){if(!_0x4909b1)return'';const _0x3bb142=en(_0x4909b1,{'decodeEntities':!0x1}),_0x387375=on(_0x3bb142);if(!_0x387375['length'])return _0x4909b1;for(const _0xf4395d of _0x387375)_0x15340f(_0xf4395d);return sn(_0x3bb142,{'encodeEntities':!0x1});}_neutralizeChangesOnUnsupportedElements(_0x560cf6,_0x268389){const _0x53ca26=en(_0x560cf6,{'decodeEntities':!0x1}),_0x560880=en(_0x268389,{'decodeEntities':!0x1}),_0x4058d9=on(_0x53ca26),_0x1ab9b0=on(_0x560880);if(!_0x4058d9['length']&&!_0x1ab9b0['length'])return{'contentInitial':_0x560cf6,'contentNew':_0x268389};const _0x8621dd=new Map(),_0x57d125=new Map();for(const _0x31ce42 of _0x4058d9){const _0xd5e76f=ln(_0x31ce42,'data-id');if(_0xd5e76f)_0x8621dd['set'](_0xd5e76f,_0x31ce42);else{const _0x468c41=sn(_0x31ce42,{'encodeEntities':!0x1}),_0x2fc1b4=_0x57d125['get'](_0x468c41);_0x2fc1b4?_0x2fc1b4['push'](_0x31ce42):_0x57d125['set'](_0x468c41,[_0x31ce42]);}}for(const _0x284b96 of _0x1ab9b0){const _0x2b2cf7=ln(_0x284b96,'data-id');let _0x547960;if(_0x2b2cf7)_0x547960=_0x8621dd['get'](_0x2b2cf7);else{const _0x9c364b=_0x57d125['get'](sn(_0x284b96,{'encodeEntities':!0x1}));_0x547960=_0x9c364b&&_0x9c364b['length']?_0x9c364b['shift']():void 0x0;}_0x547960?_0x418ed2(_0x284b96,_0x950ff(_0x547960,!0x0)):_0x15340f(_0x284b96);}return{'contentInitial':sn(_0x53ca26,{'encodeEntities':!0x1}),'contentNew':sn(_0x560880,{'encodeEntities':!0x1})};}_findMarkerElement(_0x1508e1,_0x5baa9c=0x5){let _0x2c5bbb=_0x1508e1,_0x5ccddc=null;for(let _0x361cf9=0x0;_0x361cf9<_0x5baa9c&&_0x2c5bbb;_0x361cf9++)if(_0x2c5bbb instanceof HTMLElement&&_0x2c5bbb['className']){if((''+_0x2c5bbb['className'])['includes']('ck-ai_review-marker_')){if(!_0x2c5bbb['getAttribute']('data-marker-id'))break;_0x5ccddc=_0x2c5bbb;break;}_0x2c5bbb=Lt(_0x2c5bbb);}else _0x2c5bbb=Lt(_0x2c5bbb);return _0x5ccddc;}_findMarkerElementById(_0x499253){const _0x275dc6=this['_markers']['get'](_0x499253);if(!_0x275dc6)return null;const _0x5af4a9=_0x275dc6['editor']['model']['markers']['get'](_0x499253);return _0x5af4a9?_0x4e2022(_0x275dc6['editor']['editing'],_0x5af4a9):null;}_getMarkersDataForGroup(_0x52d4ad){return Array['from'](this['_markers']['values']())['filter'](_0x1f1164=>_0x1f1164['groupId']===_0x52d4ad);}_getOperationStart(_0x10298b){return'insert'===_0x10298b['type']?_0x10298b['position']:_0x10298b['newRange']['start'];}_getOperationEnd(_0x1f056e,_0x37ce70=!0x1){return'insert'===_0x1f056e['type']?_0x37ce70?_0x1f056e['position']:_0x1f056e['position']['getShiftedBy'](_0x1f056e['howMany']):_0x1f056e['newRange']['end'];}_shiftOperation(_0x272695,_0x3207d5){return'insert'===_0x272695['type']?_0x272695['position']=_0x272695['position']['getShiftedBy'](_0x3207d5):'marker'===_0x272695['type']&&_0x272695['newRange']&&(_0x272695['newRange']=new _0x3aaa22(_0x272695['newRange']['start']['getShiftedBy'](_0x3207d5),_0x272695['newRange']['end']['getShiftedBy'](_0x3207d5))),_0x272695;}_changeOperationOwnerDocument(_0x737861,_0x4251da){'insert'===_0x737861['type']?_0x737861['position']=this['_changePositionOwnerDocument'](_0x737861['position'],_0x4251da):'marker'===_0x737861['type']&&_0x737861['newRange']&&(_0x737861['newRange']=this['_changeRangeOwnerDocument'](_0x737861['newRange'],_0x4251da));}_changePositionOwnerDocument(_0x11debe,_0x2256bb){return new _0x265910(_0x2256bb,_0x11debe['path']);}_changeRangeOwnerDocument(_0x3e71af,_0x52eda6){return new _0x3aaa22(this['_changePositionOwnerDocument'](_0x3e71af['start'],_0x52eda6),this['_changePositionOwnerDocument'](_0x3e71af['end'],_0x52eda6));}_changePosition(_0x2a28c2,_0x470d9f){return new _0x265910(_0x470d9f,[..._0x2a28c2]);}_clampPositionToParent(_0x272c8a){const _0x537792=_0x272c8a['parent'];return!_0x537792['is']('element')||_0x272c8a['offset']<=_0x537792['maxOffset']?_0x272c8a:_0x265910['_createAt'](_0x537792,_0x537792['maxOffset']);}['_changeRange'](_0x1c7fa1,_0xf520d1,_0x7b31c4,_0xaef808){return new _0x3aaa22(this['_changePosition'](_0xf520d1,_0xaef808),this['_changePosition'](_0x7b31c4,_0xaef808));}_sortMarkers(_0x31945c){const _0x399207=_0x1f05e3=>{switch(_0x1f05e3){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x31945c['sort']((_0x369e67,_0x4daf18)=>_0x399207(_0x369e67['type'])-_0x399207(_0x4daf18['type']));}_hasSameTopLevelElement(_0x1f7598,_0x32514f){const _0x42dbbc=_0x1f7598['getChild'](0x0),_0x1dcba1=_0x32514f['getChild'](0x0);return!(!_0x42dbbc||!_0x1dcba1)&&((!_0x42dbbc['is']('element')||!_0x1dcba1['is']('element')||_0x42dbbc['name']===_0x1dcba1['name'])&&!(_0x42dbbc['is']('element')&&!_0x1dcba1['is']('element')||!_0x42dbbc['is']('element')&&_0x1dcba1['is']('element')));}_haveSingleTopLevelElement(_0x2ea7e0){return 0x1===_0x2ea7e0['childCount'];}_haveOnlyInlineContent(_0x457aea,_0x1f235d){for(const _0x59cf0e of _0x457aea['getChildren']())if(_0x59cf0e['is']('element')&&!_0x1f235d['isInline'](_0x59cf0e))return!0x1;return!0x0;}_upsertDataId(_0x67b0e4,_0x53235a){let _0xb1ab58=_0x67b0e4['getAttribute'](Vn);return _0xb1ab58||(_0xb1ab58=_0x53235a(),_0x67b0e4['_setAttribute'](Vn,_0xb1ab58)),_0xb1ab58;}};const Yc=/* #__PURE__ -- @preserve */
|
|
38
|
+
It();var qc=class extends Yc{['id'];contentNew;contentInitial;documentVersion;constructor({id:_0x1f02c9,contentNew:_0x27ad1f,contentInitial:_0x4ef39a,documentVersion:_0x472be2}){super(),this['id']=_0x1f02c9,this['contentNew']=_0x27ad1f,this['contentInitial']=_0x4ef39a,this['documentVersion']=_0x472be2;}};const Qc=/* #__PURE__ -- @preserve */
|
|
39
|
+
mt();var Xc=class extends Qc{['id'];parent;editor;_data;_editorOperations=[];constructor(_0x20cc3f,_0x2ab10d,_0x1978e7,_0x33755b){super(),this['id']=_0x20cc3f,this['parent']=_0x1978e7,this['editor']=_0x33755b,this['_data']=_0x2ab10d,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get contentDiffed(){return this['_data']['wrapperTag']?function(_0x249d2a){const _0x34caad=en(_0x249d2a)['children']['filter'](_0x58049c);return 0x1!==_0x34caad['length']?_0x249d2a:_0x34caad[0x0]['children']['map'](_0x199c30=>sn(_0x199c30))['join']('');}(this['_data']['context']()):this['_data']['context']();}get['wrapperTag'](){return this['_data']['wrapperTag'];}get operations(){return this['_data']['operations']['slice']();}get operationsIsolated(){return this['_data']['operationsIsolated']['slice']();}};const zc=/* #__PURE__ -- @preserve */
|
|
40
|
+
mt();var jc=class extends zc{get['isUnresolved'](){return'initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['pendingChangesCount']>0x0;}['id']=Xt();['callId'];_results=new Map();['_changes']=[];_hasUnsupportedInlineChange=!0x1;['_sourceCheck'];_documentData;_aiConnector;['_reviewParams'];['_reviewArgs'];_context;_activeRequest=null;_currentError;_wasAborted=!0x1;constructor(_0x1cc65b,_0x31feb8,_0x455d49,_0xd8d54f,_0x41d36f,_0x5161e3=new nr()){super(),this['_sourceCheck']=_0x31feb8,this['_documentData']=_0x1cc65b,this['_aiConnector']=_0x455d49,this['_reviewParams']=_0xd8d54f,this['_reviewArgs']=_0x41d36f,this['_context']=_0x5161e3,this['on']('change:status',(_0x3be6bb,_0x24190f,_0x59d6ec)=>{'aborted'==_0x59d6ec&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x59d6ec,'run':this,'error':this['_currentError']});}),this['set']('status','initialized');}get documentData(){return this['_documentData'];}get['sourceCheck'](){return this['_sourceCheck'];}get processedResultsCount(){return this['_results']['size'];}get hasUnsupportedInlineChange(){return this['_hasUnsupportedInlineChange'];}get title(){return this['_sourceCheck']['title'];}get subTitle(){return'';}get['reviewName'](){return this['_sourceCheck']['id'];}get hasModifications(){return!this['_changes']['every'](_0x147f1c=>'pending'===_0x147f1c['status']);}get currentError(){return this['_currentError'];}get results(){return Array['from'](this['_results']['values']());}updateDocumentData(_0x40eeca){this['_documentData']=_0x40eeca;}async start(){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x291936=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1419b9 of _0x291936)'unmodified'!==_0x1419b9['data']['operation']&&('error'!==_0x1419b9['data']['operation']?'review-metadata'!==_0x1419b9['event']?this['_addReviewCheckResult'](_0x1419b9['data']['dataId'],_0x1419b9['data']['textDelta']):this['callId']=_0x1419b9['data']['callId']:this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']||0x0===this['_changes']['length']?this['status']='unmodified':this['status']='ready');}catch(_0x20a767){this['_currentError']=_0x20a767,lr(_0x20a767)?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async restart(){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,this['_hasUnsupportedInlineChange']=!0x1,await this['start']();}addResultChanges(_0x24d1ba,_0x24ae70){const _0x1288c7=this['_results']['get'](_0x24d1ba);if(!_0x1288c7)return;if(0x0===_0x24ae70['length'])return;const _0x144b42=this['_documentData']['elements']['get'](_0x24d1ba);if(!_0x144b42)return;const _0x3babe7=[];_0x24ae70['forEach']((_0x37c2d0,_0x1582a6)=>{const _0x2e1de7=new Xc(_0x1288c7['id']+'-'+_0x1582a6,_0x37c2d0,_0x1288c7,_0x144b42['editor']);_0x2e1de7['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2e1de7,'status':_0x2e1de7['status']});}),_0x2e1de7['on']('change:isActivated',()=>{_0x2e1de7['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2e1de7}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2e1de7});}),this['_changes']['push'](_0x2e1de7),_0x3babe7['push'](_0x2e1de7);}),this['fire']('reviewCheckResultReady',{'changes':_0x3babe7,'result':_0x1288c7,'source':this});}abort(){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}isChangeActive(_0x4f5f5c){const _0x37e7ea=this['_changes']['find'](_0x4285ef=>_0x4285ef['id']===_0x4f5f5c);return!(!_0x37e7ea||'pending'!==_0x37e7ea['status']);}isAnyChangeActivated(){return this['_changes']['some'](_0x33439b=>!0x0===_0x33439b['isActivated']);}getActiveChanges(){return this['_changes']['filter'](_0x2c1ed4=>'pending'===_0x2c1ed4['status']);}getChangeById(_0x1c1934){return this['_changes']['find'](_0x46263f=>_0x46263f['id']===_0x1c1934);}getChangePosition(_0x47b4b9){return this['_changes']['findIndex'](_0x27b769=>_0x27b769['id']===_0x47b4b9)+0x1;}get totalChangesCount(){return this['_changes']['length'];}get pendingChangesCount(){return this['getActiveChanges']()['length'];}get reviewedChangesCount(){return this['totalChangesCount']-this['pendingChangesCount'];}markAllChangesAsAccepted(){for(const _0x5bf48f of this['_changes'])'pending'===_0x5bf48f['status']&&(_0x5bf48f['status']='accepted');this['_checkIfFinished']();}markAllChangesAsRejected(){for(const _0x511235 of this['_changes'])'pending'===_0x511235['status']&&(_0x511235['status']='rejected');this['_checkIfFinished']();}markChangeAsAccepted(_0x56c763){const _0x5d1028=this['_changes']['find'](_0x5c47d1=>_0x5c47d1['id']===_0x56c763);_0x5d1028&&'pending'===_0x5d1028['status']&&(_0x5d1028['status']='accepted'),this['_checkIfFinished']();}markChangeAsRejected(_0x39418d){const _0x47f295=this['_changes']['find'](_0x2eec64=>_0x2eec64['id']===_0x39418d);_0x47f295&&'pending'===_0x47f295['status']&&(_0x47f295['status']='rejected'),this['_checkIfFinished']();}markChangeAsOutdated(_0x1f099d){const _0x1c58cc=this['_changes']['find'](_0x418207=>_0x418207['id']===_0x1f099d);_0x1c58cc&&'pending'===_0x1c58cc['status']&&(_0x1c58cc['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x1b1439){const _0x2dedd2=this['_changes']['find'](_0x5519dc=>_0x5519dc['id']===_0x1b1439);_0x2dedd2&&'outdated'===_0x2dedd2['status']&&(_0x2dedd2['status']='pending'),this['_checkIfFinished']();}activateChange(_0x20785c){this['_changes']['filter'](_0x3a4ab1=>_0x3a4ab1['isActivated']&&_0x3a4ab1['id']!==_0x20785c)['forEach'](_0x3a296c=>{_0x3a296c['isActivated']=!0x1;});const _0x44846a=this['_changes']['find'](_0x27e903=>_0x27e903['id']===_0x20785c);_0x44846a&&'pending'===_0x44846a['status']&&(_0x44846a['isActivated']=!0x0);}deactivateChange(){this['_changes']['filter'](_0xadaf5f=>_0xadaf5f['isActivated'])['forEach'](_0x4017c7=>{_0x4017c7['isActivated']=!0x1;});}forceReadyState(){this['status']='ready';}async sendRating(_0x513ea8){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x1ad2b6;if(_0x513ea8){const _0x5e113e=this['_changes']['find'](_0x2d5f22=>_0x2d5f22['id']===_0x513ea8);if(_0x5e113e&&_0x5e113e['isRated'])return;_0x5e113e&&(_0x1ad2b6=_0x5e113e['parent']['id'],_0x5e113e['isRated']=!0x0);}const _0x52c7f2={'positiveCount':this['_changes']['filter'](_0x436a3e=>'accepted'===_0x436a3e['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x52c7f2,this['callId'],_0x1ad2b6);}_addReviewCheckResult(_0x1ef781,_0x35c687){const _0x4555c2=this['_documentData']['elements']['get'](_0x1ef781);if(!_0x4555c2)return;if(En(_0x4555c2['editor'],_0x4555c2['rootName'])&&!wn(_0x4555c2['editor'],en(_0x35c687)))return void(this['_hasUnsupportedInlineChange']=!0x0);const _0x1313dc=_0x4555c2['getContent']();if(_0x1313dc===_0x35c687)return;const _0x5e2da8=new qc({'id':_0x1ef781,'contentInitial':_0x1313dc,'contentNew':_0x35c687,'documentVersion':_0x4555c2['documentVersion']});this['_results']['set'](_0x5e2da8['id'],_0x5e2da8),this['fire']('reviewCheckResultAdded',{'result':_0x5e2da8,'source':this,'editor':_0x4555c2['editor'],'rootName':_0x4555c2['rootName']});}['_checkIfFinished'](){'finished'===this['status']&&this['_changes']['filter'](_0xca358b=>'pending'===_0xca358b['status'])['length']>0x0&&(this['status']='ready'),'ready'===this['status']&&0x0===this['_changes']['filter'](_0x3b0c65=>'pending'===_0x3b0c65['status'])['length']&&(this['status']='finished');}},Jc=class extends jc{get subTitle(){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2a4373=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x25d500=0x0;_0x25d500<this['_reviewParams']['length'];_0x25d500++){if(!this['_reviewParams'][_0x25d500]||!this['_sourceCheck']['options'][_0x25d500])continue;const _0x3a5220=this['_sourceCheck']['options'][_0x25d500]['data']?.['find'](_0x882d8c=>_0x882d8c['id']===this['_reviewParams'][_0x25d500]);_0x3a5220&&_0x2a4373['push'](_0x3a5220['label']);}return _0x2a4373['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}_createApiRequest(){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0xbd1376,_0x54b8e9,_0x8b37c1){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x54b8e9,_0xbd1376,_0x8b37c1);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}},Zc=class extends _0x4cd5fc{_aiConnector;['_aiTabs'];['_aiReviewCoreUi'];_aiReviewCoreEditing;['_availableReviewChecks'];_reporter;_currentReviewCheckRun;_changeActivationSource=null;_shouldAcceptAsSuggestion(){return!0x1;}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['_initRequiredPlugins'](),this['_initAvailableReviewChecks'](),this['_initUIListeners']();}async _initAvailableReviewChecks(){try{this['_availableReviewChecks']=await this['_getReviewChecks'](),this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}finally{this['_aiReviewCoreUi']['toggleLoadingSkeleton'](!0x1);}}_initUIListeners(){this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_availableReviewChecks']&&this['_aiReviewCoreUi']['setAvailableChecks'](this['_availableReviewChecks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',(_0x547339,_0x3dcf00)=>this['runCheck'](_0x3dcf00)),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_currentReviewCheckRun']?.['isUnresolved']?this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{this['_onReviewRunLeave'](!0x0);}):this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>this['abort']()),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3eec84=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3eec84['length'])return;this['_shouldAcceptAsSuggestion']()?this['_aiReviewCoreEditing']['applyChangesAsSuggestions'](_0x3eec84['map'](_0x48bb11=>_0x48bb11['id']),this['_aiSource']):this['_aiReviewCoreEditing']['applyChange'](_0x3eec84['map'](_0x37191b=>_0x37191b['id']),this['_aiSource']);const _0x38c9fa=this['_currentReviewCheckRun'];_0x38c9fa['markAllChangesAsAccepted'](),_0x38c9fa['sendRating'](),this['_leaveReviewAfterBulkAction']();}),this['listenTo'](this['_aiReviewCoreUi'],'rejectAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3646a5=this['_currentReviewCheckRun'],_0x2040cc=_0x3646a5['getActiveChanges']();_0x2040cc['length']&&(this['_aiReviewCoreEditing']['rejectAllChanges'](_0x2040cc['map'](({id:_0x1b77c4})=>_0x1b77c4)),_0x3646a5['markAllChangesAsRejected'](),_0x3646a5['sendRating'](),this['_leaveReviewAfterBulkAction']());}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x5a8132,_0x1d98e0)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x1d98e0['id']))return;const _0x54a033=this['_getPendingChangeIndex'](_0x1d98e0['id']);this['_aiReviewCoreEditing']['applyChange']([_0x1d98e0['id']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1d98e0['id']),this['_onChangeResolved'](_0x54a033),this['_currentReviewCheckRun']['sendRating'](_0x1d98e0['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x311351,_0x32529a)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x32529a['id']))return;const _0x10f0d2=this['_getPendingChangeIndex'](_0x32529a['id']);this['_aiReviewCoreEditing']['rejectChange'](_0x32529a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x32529a['id']),this['_onChangeResolved'](_0x10f0d2),this['_currentReviewCheckRun']['sendRating'](_0x32529a['id']);}),this['listenTo'](this['_aiReviewCoreUi'],'suggestChange',(_0x3eaef0,_0x5791b7)=>{if(!this['_currentReviewCheckRun']||!this['_currentReviewCheckRun']['isChangeActive'](_0x5791b7['changeId']))return;const _0x2c060d=this['_getPendingChangeIndex'](_0x5791b7['changeId']);this['_aiReviewCoreEditing']['applyChangesAsSuggestions']([_0x5791b7['changeId']],this['_aiSource']),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5791b7['changeId']),this['_onChangeResolved'](_0x2c060d),this['_currentReviewCheckRun']['sendRating'](_0x5791b7['changeId']);}),this['listenTo'](this['_aiReviewCoreUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&(this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1),this['_currentReviewCheckRun']['updateDocumentData'](this['_aiReviewCoreEditing']['getDocumentData']()),await this['_currentReviewCheckRun']['restart']());}),this['listenTo'](this['_aiReviewCoreUi'],'activateChange',(_0x25981f,_0x1a5cad)=>{this['_onActivateChange'](_0x1a5cad);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x18b298,_0x124e19)=>{this['_onDeactivateChange'](_0x124e19);}),this['listenTo'](this['_aiReviewCoreUi'],'navigateChange',(_0x270eca,_0x320d1a)=>{this['_onNavigateChange'](_0x320d1a['direction']);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x491e6d,_0x5f20d5)=>{this['_onChangeMarkerClicked'](_0x491e6d,_0x5f20d5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x258c5d,_0x62e90e)=>{this['_onChangeMarkerHovered'](_0x258c5d,_0x62e90e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x20bac2,_0x126095)=>{this['_onChangeMarkerRemoved'](_0x20bac2,_0x126095);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1d5d2b,_0x4e6d68)=>{this['_onChangeMarkerRestored'](_0x1d5d2b,_0x4e6d68);}),this['listenTo'](this['_aiTabs']['view'],'beforeActivateTab',(_0x248cee,{newTab:_0x475c14,oldTab:_0x53f0cc,resolveActivation:_0x3cb032})=>{_0x475c14!==_0x53f0cc&&_0x53f0cc===this['_aiTabId']&&this['_currentReviewCheckRun']?.['isUnresolved']&&(_0x248cee['stop'](),this['_aiReviewCoreUi']['showLeaveConfirmationDialog'](this['_leaveConfirmationDialogOptions'],()=>{_0x3cb032?_0x3cb032(!0x0):this['_aiTabs']['view']['forceActivateTab'](_0x475c14);},()=>{_0x3cb032?.(!0x1);}));});}async['runCheck'](_0x487090){if(this['_hideOpenDialog'](),!this['_availableReviewChecks'])return;const _0x58fcf0=this['_availableReviewChecks']['find'](_0xf863dd=>_0xf863dd['id']===_0x487090['id']);if(!_0x58fcf0)return void this['_logError'](new dt('ai-review-mode-source-check-not-found',this,{'checkId':_0x487090['id']}));this['_onReviewCheckRun'](_0x487090),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_aiReviewCoreUi']['setHasPendingChanges'](!0x1);const _0x453094=this['context']['plugins']['get'](Js)['contextLibrary']['resolveContext']({'feature':this['_defaultContextFeature'],'ids':[_0x487090['id']],'context':new nr()});this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x487090,_0x58fcf0,_0x453094);const _0x149dac=this['_currentReviewCheckRun'];_0x149dac['on']('reviewCheckResultChangeStatusUpdated',(_0x3a9a21,_0x244a15)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x244a15['change']['id'],_0x244a15['status']),this['_aiReviewCoreUi']['updateProgress'](_0x149dac['reviewedChangesCount'],_0x149dac['totalChangesCount']),this['_refreshNavigationPanelPosition'](),this['_pushHasPendingChanges'](_0x149dac);}),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4987c6,_0x958d91)=>{switch(_0x958d91['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x958d91);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():(this['_aiReviewCoreUi']['updateProgress'](this['_currentReviewCheckRun']['reviewedChangesCount'],this['_currentReviewCheckRun']['totalChangesCount']),this['_aiReviewCoreUi']['showActionsWhenResultIsReady']());break;case'unmodified':this['_currentReviewCheckRun']?.['hasUnsupportedInlineChange']?this['_aiReviewCoreUi']['showUnsupportedInlineChangeView']():this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new dt('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new dt('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x958d91['status']&&'error-chunk'!==_0x958d91['status']&&'error-general'!==_0x958d91['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2689ed,_0x3b1d2e)=>{if(!this['_currentReviewCheckRun'])throw new dt('ai-review-mode-no-current-check-run',this);const _0x112aab=En(_0x3b1d2e['editor'],_0x3b1d2e['rootName']);let _0x9a1e91=_0x3b1d2e['result']['contentInitial'],_0x6c97ac=_0x3b1d2e['result']['contentNew'];_0x112aab&&(_0x9a1e91=Tn(_0x9a1e91),_0x6c97ac=Tn(_0x6c97ac));const _0x31eb01=this['_diffContent'](_0x3b1d2e['editor'],_0x9a1e91,_0x6c97ac);if(_0x112aab){const _0x34d133=_0x3b1d2e['editor']['ui']['getEditableElement'](_0x3b1d2e['rootName'])?.['tagName']['toLowerCase']();for(const _0x2e9c81 of _0x31eb01)_0x2e9c81['wrapperTag']=_0x34d133;}_0x3b1d2e['source']['addResultChanges'](_0x3b1d2e['result']['id'],_0x31eb01);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0xc7729b,_0x4e162d)=>{for(const _0x32a4fc of _0x4e162d['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x32a4fc);this['_pushHasPendingChanges'](_0x4e162d['source']),this['_markChangePositionInEditorContent'](_0x4e162d['changes'],_0x4e162d['source']['documentData']),this['_onReviewCheckResultsRendered'](),this['_refreshNavigationPanelPosition']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x1e30b6,_0x41619c)=>{this['_onReviewCheckResultActivated'](_0x41619c);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1c72bf){if(lr(_0x1c72bf))return;_0x1c72bf instanceof dt?this['_logError'](_0x1c72bf):this['_logError'](new dt('ai-review-mode-check-run-failed',this,void 0x0,_0x1c72bf));}}abort(){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}getAvailableChecks(){return(this['_availableReviewChecks']??[])['slice']();}getCurrentCheckRun(){return this['_currentReviewCheckRun'];}['_pushHasPendingChanges'](_0xaa0813){this['_aiReviewCoreUi']['setHasPendingChanges'](_0xaa0813['getActiveChanges']()['length']>0x0);}['_hideOpenDialog'](){this['_aiReviewCoreEditing']['getEditors']()['find'](_0x269b15=>_0x269b15['plugins']['has']('AIEditorIntegration'))?.['plugins']['get']('AIEditorIntegration')['dialog']['hide']();}_createReviewCheckRun(_0x29ed2a,_0x498826,_0x45dee4=new nr()){return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x498826,this['_aiConnector'],_0x29ed2a['params'],_0x29ed2a['args'],_0x45dee4);}_getNavigationPosition(_0x14433b){const _0xed0a1b=this['_currentReviewCheckRun'];return{'index':_0xed0a1b?.['getChangePosition'](_0x14433b)??0x0,'total':_0xed0a1b?.['totalChangesCount']??0x0,'pendingCount':_0xed0a1b?.['pendingChangesCount']??0x0};}_getPendingChangeIndex(_0x554427){return(this['_currentReviewCheckRun']?.['getActiveChanges']()??[])['findIndex'](_0x4bbc3a=>_0x4bbc3a['id']===_0x554427);}_refreshNavigationPanelPosition(){const _0xc1f6b7=(this['_currentReviewCheckRun']?.['getActiveChanges']()['find'](_0x2f6775=>_0x2f6775['isActivated']))?.['id']??this['_aiReviewCoreUi']['getNavigationPanelChangeId']();_0xc1f6b7&&this['_aiReviewCoreUi']['updateNavigationPanelPosition'](this['_getNavigationPosition'](_0xc1f6b7));}_onNavigateChange(_0x4d2400){const _0xa70682=this['_currentReviewCheckRun']?.['getActiveChanges']()??[],_0x2da472=_0xa70682['findIndex'](_0x558b96=>_0x558b96['isActivated']);if(_0xa70682['length']<(-0x1===_0x2da472?0x1:0x2))return;const _0x57d56a=-0x1===_0x2da472?0x0:(_0x2da472+('next'===_0x4d2400?0x1:-0x1)+_0xa70682['length'])%_0xa70682['length'];this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xa70682[_0x57d56a]['id']);}['_onChangeResolved'](_0x459ed8){const _0x32a4a6=this['_currentReviewCheckRun'];if(!_0x32a4a6?.['pendingChangesCount'])return void this['_aiReviewCoreUi']['hideNavigationPanel']();const _0x3447a0=_0x32a4a6['getActiveChanges'](),_0x2bc49e=Math['max'](_0x459ed8,0x0),_0x193e9d=_0x2bc49e<_0x3447a0['length']?_0x2bc49e:0x0;this['_changeActivationSource']='panel',_0x32a4a6['activateChange'](_0x3447a0[_0x193e9d]['id']);}_onReviewCheckResultsRendered(){}['_onChangeMarkerRemoved'](_0x18aa73,_0x4aae45){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4aae45['changeId']);}_onChangeMarkerRestored(_0x1c30f8,_0x2cae81){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x2cae81['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_aiReviewCoreUi']['showReviewCompletedView']();}_leaveReviewAfterBulkAction(){this['_currentReviewCheckRun']&&this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview'),this['_aiTabs']=this['context']['plugins']['get'](Ks);}['_onReviewRunLeave'](_0x1f4715=!0x1){this['_aiReviewCoreUi']['hideNavigationPanel'](),this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x1f4715&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3adcba of this['_aiReviewCoreEditing']['getEditors']())_0x3adcba['editing']['view']['change'](_0x56bbf3=>{for(const _0x2e7890 of _0x3adcba['editing']['view']['document']['getRoots']())_0x56bbf3['removeClass']('ck-ai_review-diff',_0x2e7890),_0x56bbf3['removeClass']('ck-ai_review-highlights',_0x2e7890),_0x56bbf3['removeClass']('ck-ai-translate-mode-content',_0x2e7890);});}['_logError'](_0x31f33a){this['_reporter']['logError'](_0x31f33a),'ai-review-mode-models-unable-to-retrieve'===function(_0x16644e){return _0x16644e instanceof ur?_0x16644e['code']:_0x16644e instanceof Error?_0x16644e['message']['match'](/^\S+/)?.[0x0]:void 0x0;}(_0x31f33a)?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']();}['_scrollToChange'](_0x168a03){if(!this['_changeActivationSource'])return;if(this['_aiReviewCoreUi']['scrollResultsToChange'](_0x168a03),'content'===this['_changeActivationSource'])return;const _0x3c6a25=this['_getChangeContentElement'](_0x168a03);_0x3c6a25&&Yt({'target':_0x3c6a25,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}},tl=class extends jc{_prompt;['_model'];constructor(_0x20e1a2,_0x4b08ba,_0x2f15a9,_0x261aac,_0x34d528,_0x3fcc3b){super(_0x2f15a9,_0x261aac,_0x34d528,void 0x0,void 0x0,_0x3fcc3b),this['_prompt']=_0x20e1a2,this['_model']=_0x4b08ba;}get subTitle(){return this['_prompt']??'';}_createApiRequest(){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],...void 0x0!==this['_prompt']&&{'prompt':this['_prompt']},'model':this['_model'],'contexts':this['_context']['toRequestContexts']()});}_sendRatingRequest(_0x1069c0,_0x21b4b5,_0x117bc7){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x21b4b5,_0x1069c0,_0x117bc7);}},el=class{['id'];['commandId'];title;description;isParameterized;['useArgs'];options;['args'];get['apiId'](){return this['commandId'];}constructor(_0x574e7f){this['id']=_0x574e7f['id'],this['commandId']=_0x574e7f['commandId'],this['title']=_0x574e7f['title'],this['description']=_0x574e7f['description'],this['isParameterized']=_0x574e7f['isParameterized'],this['useArgs']=_0x574e7f['useArgs'],this['options']=_0x574e7f['options'],this['args']=_0x574e7f['args'];}},il=class extends el{isExtra=!0x0;prompt;context;['model'];_defaultModel=null;constructor(_0x46aa79,_0x50b061,_0x28da48){super(_0x46aa79),this['prompt']=_0x46aa79['prompt'],this['context']=_0x46aa79['context'],this['model']=_0x46aa79['model'],this['model']?this['_defaultModel']=_0x50b061['find'](_0x51c6d0=>_0x51c6d0['id']===this['model'])||null:this['_defaultModel']=_0x28da48;}get defaultModel(){return this['_defaultModel'];}},sl=class extends tl{get subTitle(){return'';}set prompt(_0x2cc71a){this['_prompt']=_0x2cc71a;}set['model'](_0x322c15){this['_model']=_0x322c15;}},nl=class extends _0x4cd5fc{static get requires(){return[$s,dr];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_cache'];_reporter;init(){this['_reporter']=this['context']['plugins']['get'](dr)['createReporter']('aireview');}getChecksList(){return this['_cache']||(this['_cache']=this['_loadChecksList']()),this['_cache'];}};const rl=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}],ol=/* #__PURE__ -- @preserve */
|
|
41
|
+
mt();var al=class extends ol{['_checks']=[];setupChecks(_0x3af79d){this['_checks']=_0x3af79d['map'](_0x9e4982=>new el(_0x9e4982));}get['checks'](){return this['_checks']['slice']();}getCheckById(_0x1e2c55){return this['checks']['find'](_0x17bfaa=>_0x17bfaa['id']===_0x1e2c55);}['removeCheckById'](_0x28153b){this['_checks']=this['_checks']['filter'](_0x56363f=>_0x56363f['id']!==_0x28153b);}},hl=class extends el{['_models']=[];_defaultModel=null;constructor(_0x8bb64e,_0x3515c8,_0x371b46){super(_0x8bb64e),this['_models']=_0x3515c8,this['_defaultModel']=_0x371b46;}get['models'](){return this['_models']['slice']();}get defaultModel(){return this['_defaultModel'];}},cl=class extends al{['_allModels']=[];['_recommendedModels']=[];_defaultModel=null;constructor(_0xff286b,_0x3570b1,_0x589ba2){super(),this['_allModels']=_0xff286b,this['_recommendedModels']=_0x3570b1,this['_defaultModel']=_0x589ba2;}get['allModels'](){return this['_allModels']['slice']();}setupChecks(_0x5cdf8d){this['_checks']=_0x5cdf8d['map'](_0x172d57=>!0x0===_0x172d57['isExtra']?new il(_0x172d57,this['_allModels'],this['_defaultModel']):'custom'===_0x172d57['id']?new hl(_0x172d57,this['_recommendedModels'],this['_defaultModel']):new el(_0x172d57));}},ll=class extends nl{static get['pluginName'](){return'AIReviewModeCheckRegistry';}static get requires(){return[$s,dr,Js];}['_modelsLoadError']=null;constructor(_0x3a1514){super(_0x3a1514),this['context']['config']['define']('ai.review.extraCommands',[]);}get['modelsLoadError'](){return this['_modelsLoadError'];}getExtraChecks(){return this['context']['config']['get']('ai.review.extraCommands')['map'](_0x5114b9=>({'id':_0x5114b9['id'],'commandId':_0x5114b9['id'],'title':_0x5114b9['label'],'description':_0x5114b9['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x5114b9['prompt'],'context':_0x5114b9['context'],'model':_0x5114b9['model']}));}async _loadChecksList(){const _0xe000d9=[...rl,...this['getExtraChecks']()]['map'](_0x160cf6=>_0x160cf6['isExtra']?_0x160cf6:this['_translateReviewCheck'](_0x160cf6)),_0x3c1e2d=this['context']['plugins']['get'](Js);let _0x3cba10;try{_0x3cba10=new cl(await _0x3c1e2d['models']['getAllModels'](),await _0x3c1e2d['models']['getAvailableModels'](),await _0x3c1e2d['models']['getDefault']()),this['_modelsLoadError']=null;}catch(_0x52df96){this['_modelsLoadError']=new dt('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x52df96),this['_reporter']['logError'](this['_modelsLoadError'],{'context':{'operation':'load-review-models'}}),_0x3cba10=new cl([],[],null);}return _0x3cba10['setupChecks'](_0xe000d9),_0x3cba10;}_translateReviewCheck(_0x9b1c39){const _0x45f733='AI_REVIEW_CHECK_'+_0x9b1c39['commandId']['toUpperCase']()['replaceAll']('-','_'),_0x394e37={..._0x9b1c39,'title':this['_translate'](_0x45f733+'_TITLE',_0x9b1c39['title']),'description':this['_translate'](_0x45f733+'_DESCRIPTION',_0x9b1c39['description'])};return _0x9b1c39['options']&&(_0x394e37['options']=_0x9b1c39['options']['map'](_0x231fdd=>({..._0x231fdd,'label':this['_translate'](_0x45f733+'_OPTIONS_LABEL',_0x231fdd['label']||''),'data':_0x231fdd['data']?_0x231fdd['data']['map'](_0x1436bc=>({..._0x1436bc,'label':this['_translate'](_0x45f733+'_OPTIONS_DATA_'+_0x1436bc['id']['toUpperCase'](),_0x1436bc['label'])})):void 0x0}))),_0x394e37;}_translate(_0x3c392f,_0x497363){const _0x13b982=qs(this['context']['locale'],_0x3c392f);return _0x13b982===_0x3c392f?_0x497363:_0x13b982;}},ul=class extends Zc{static get['pluginName'](){return'AIReviewModeController';}static get requires(){return[dr,ll,Js];}get['_aiSource'](){return'review';}_shouldAcceptAsSuggestion(){return Hc(this['context'])&&Uc(this['context']);}get _defaultContextFeature(){return'review';}get['_aiTabId'](){return Sh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0xc3d834}}=this;return{'dialogId':'aiReviewModeLeaveConfirmation','title':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0xc3d834,'AI_REVIEW_MODE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_isDiffOn']=!0x1;['_usesAvailableCommandsConfig'];constructor(_0x434541){super(_0x434541),this['_usesAvailableCommandsConfig']=Boolean(this['context']['config']['get']('ai.review.availableCommands')),this['context']['config']['define']('ai.review.availableCommands',rl['map'](_0x7a9406=>_0x7a9406['id']));}init(){super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1b7fa5,_0x1f837e)=>{this['_isDiffOn']=_0x1f837e['on'],this['_onDiffChange'](this['_isDiffOn']);});}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x545302,_0x4db7f2,_0xf718b5=new nr()){if(_0x545302['isCustom'])return new tl(_0x545302['args']['prompt'],_0x545302['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0xf718b5);if(_0x4db7f2['isExtra']){const _0x7f5d20=_0x4db7f2,_0xfe8222=_0x7f5d20['context']?_0xf718b5['cloneWith'](_0x7f5d20['context']):_0xf718b5;return new sl(_0x545302['args']?.['prompt']??_0x7f5d20['prompt'],_0x545302['args']?.['model']??_0x7f5d20['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0xfe8222);}return new Jc(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4db7f2,this['_aiConnector'],_0x545302['params'],_0x545302['args'],_0xf718b5);}_onReviewCheckResultActivated(_0x1952b8){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x1952b8['change']['id']);const {markerData:_0x2dadeb,editorInstance:_0x186da7}=this['_activateChangeMarkersAndReveal'](_0x1952b8['change']['id']);'content'!==this['_changeActivationSource']&&this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x1952b8['change'],'position':this['_getNavigationPosition'](_0x1952b8['change']['id']),'getTarget':()=>_0x2dadeb?.['getElement']()??null,'limiter':this['_getBalloonDomRoot'](_0x186da7,_0x2dadeb?.['modelRange']['root']['rootName']),'viewportOffset':_0x186da7?.['ui']?.['viewportOffset']});}_activateChangeMarkersAndReveal(_0x18d91c){return this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x18d91c),this['_scrollToChange'](_0x18d91c),{'markerData':this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x18d91c),'editorInstance':this['_aiReviewCoreEditing']['getEditorForChange'](_0x18d91c)??this['_aiReviewCoreEditing']['getEditor']()};}_onReviewCheckResultsRendered(){if(!this['_currentReviewCheckRun']||this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const [_0x5df475]=this['_currentReviewCheckRun']['getActiveChanges']();_0x5df475&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5df475['id']));}_revealActivatedChange(_0x5532f5){this['_aiReviewCoreUi']['isNavigationPanelInViewport']()||(this['_changeActivationSource']='panel',this['_onReviewCheckResultActivated']({'change':_0x5532f5}));}_onDeactivateChange(){}['_onChangeMarkerHovered'](){}['_onChangeMarkerBlurred'](){}_onReviewCheckResultDeactivated(){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}_onActivateChange(_0xfcbe2c){if(!this['_currentReviewCheckRun']||'click'!==_0xfcbe2c['uiInteraction'])return;const _0x13ad4b=this['_currentReviewCheckRun']['getChangeById'](_0xfcbe2c['id']);_0x13ad4b?.['isActivated']?this['_revealActivatedChange'](_0x13ad4b):(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xfcbe2c['id']));}['_onChangeMarkerClicked'](_0x379494,_0x5c0251){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5c0251['changeId']);const _0x47bb6f=this['_currentReviewCheckRun']['getChangeById'](_0x5c0251['changeId']);if(!_0x47bb6f)return;const _0x255758=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5c0251['changeId']),_0x35034c=this['_aiReviewCoreEditing']['getEditorForChange'](_0x5c0251['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showNavigationPanel']({'change':_0x47bb6f,'position':this['_getNavigationPosition'](_0x5c0251['changeId']),'getTarget':_0x5c0251['markerElement'],'domEvent':_0x5c0251['domEvent'],'limiter':this['_getBalloonDomRoot'](_0x35034c,_0x255758?.['modelRange']['root']['rootName']),'viewportOffset':_0x35034c?.['ui']?.['viewportOffset']});}_getChangeContentElement(_0x15c80b){const _0x540245=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x15c80b);return _0x540245?_0x540245['getElement']():null;}_markChangePositionInEditorContent(_0x55c718,_0x4fb9fa){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x55c718,_0x4fb9fa);}_diffContent(_0x3b295e,_0x366549,_0x31f974){return this['_aiReviewCoreEditing']['diffContent'](_0x3b295e,_0x366549,_0x31f974,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x53c506){for(const _0x215690 of this['_aiReviewCoreEditing']['getEditors']())_0x215690['editing']['view']['change'](_0x223862=>{for(const _0x80d486 of _0x215690['editing']['view']['document']['getRoots']()){for(const _0x23333f of _0x80d486['getClassNames']())_0x23333f['startsWith']('ck-ai_review-')&&_0x223862['removeClass'](_0x23333f,_0x80d486);_0x223862['addClass'](_0x53c506?'ck-ai_review-diff':'ck-ai_review-highlights',_0x80d486);}});}_getBalloonDomRoot(_0x38cb40,_0x52845a){const _0x4f4221=_0x38cb40['editing']['view'];if(_0x52845a){const _0x1287ed=_0x4f4221['getDomRoot'](_0x52845a);if(_0x1287ed)return _0x1287ed;}return _0x4f4221['getDomRoot']()??void 0x0;}async _getReviewChecks(){const _0x33bacf=this['context']['plugins']['get']('AIReviewModeCheckRegistry'),_0x3c4fe2=await _0x33bacf['getChecksList']();_0x33bacf['modelsLoadError']&&this['_logError'](_0x33bacf['modelsLoadError']);let _0x2aba11=_0x3c4fe2['checks'];const _0x1522ac=this['context']['config']['get']('ai.review.availableCommands');return this['_logWarningForNonExistentChecks'](_0x1522ac,_0x2aba11),this['_usesAvailableCommandsConfig']&&(_0x2aba11=_0x1522ac['map'](_0x20103e=>_0x2aba11['find'](_0x537df0=>_0x537df0['id']===_0x20103e))['filter'](_0x55bd9f=>!!_0x55bd9f)),this['_filterChecksWithMissingModel'](_0x2aba11);}_logWarningForNonExistentChecks(_0x539d96,_0x35da26){const _0x245904=_0x539d96['filter'](_0x2bcc21=>!_0x35da26['some'](_0x177af7=>_0x177af7['id']===_0x2bcc21));_0x245904['length']&&this['_reporter']['logError'](new ur({'code':'ai-review-mode-non-existent-commands-used','severity':'warning','context':{'commandIds':_0x245904['join'](',\x20')}}));}_filterChecksWithMissingModel(_0x4e368b){const _0x324a70=[];return _0x4e368b['forEach'](_0x555e81=>{(_0x555e81 instanceof il&&!_0x555e81['defaultModel']||_0x555e81 instanceof hl&&!_0x555e81['models']['length'])&&_0x324a70['push'](_0x555e81['id']);}),_0x324a70['length']&&_0x324a70['forEach'](_0x4dccab=>{_0x4e368b=_0x4e368b['filter'](_0x45b553=>_0x45b553['id']!==_0x4dccab),this['_reporter']['logError'](new ur({'code':'ai-review-mode-command-unavailable-due-to-missing-model','context':{'commandId':_0x4dccab}}));}),_0x4e368b;}},dl=class extends _0x4cd5fc{static get['pluginName'](){return'AIReviewGateway';}static get requires(){return[$c,ll,$s,Pn,Jn,Js];}get['models'](){return this['context']['plugins']['get'](Js)['models'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async getAllCommands(){return(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['map'](_0x22a894=>{const _0x1b0bc9={'id':_0x22a894['id'],'title':_0x22a894['title'],'description':_0x22a894['description']};return'custom'!==_0x22a894['id']&&_0x22a894['options']?.['length']&&(_0x1b0bc9['parameters']=_0x22a894['options'][0x0]['data']['map'](_0x3d7073=>({..._0x3d7073}))),_0x1b0bc9;});}async['runReview'](_0x499779,_0x5eff7b){const _0x52064c=await this['_resolveReviewCheck'](_0x499779),_0xa1d518=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x328d1e=this['context']['plugins']['get']('AIConnector'),_0x58f009=_0xa1d518['getDocumentData']({'roots':_0x5eff7b?.['roots']}),_0x5bb39a=this['_createReviewCheckRun'](_0x52064c,_0x58f009,_0x328d1e,_0x5eff7b?.['parameterId'],new nr(_0x5eff7b?.['contexts']));return _0xa1d518['runCheck'](_0x5bb39a,{'signal':_0x5eff7b?.['signal']});}async runCustomReview(_0x5f315f,_0x335657){const {reviewCheck:_0x8298eb,resolvedModel:_0x335d47}=await this['_resolveCustomReviewCheck'](_0x5f315f,_0x335657?.['model']),_0x4964d6=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x443f89=this['context']['plugins']['get']('AIConnector'),_0x4c5687=_0x4964d6['getDocumentData']({'roots':_0x335657?.['roots']}),_0x2b61ea=new tl(_0x5f315f,_0x335d47,_0x4c5687,_0x8298eb,_0x443f89,new nr(_0x335657?.['contexts']));return _0x4964d6['runCheck'](_0x2b61ea,{'signal':_0x335657?.['signal']});}['applyReview'](_0x5021da,_0x55be2a){this['context']['plugins']['get']('AIGateway')['apply'](_0x5021da,{'aiSource':'review',..._0x55be2a});}async['_resolveReviewCheck'](_0x2ccd8c){const _0x550f83=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x1acd54=>_0x1acd54['id']===_0x2ccd8c);if(!_0x550f83)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0x2ccd8c});if(_0x550f83 instanceof hl)throw new dt('ai-reviewgateway-not-a-system-command',this,{'checkId':_0x2ccd8c});if(_0x550f83 instanceof il&&!_0x550f83['defaultModel']?.['id'])throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x2ccd8c});return _0x550f83;}async _resolveCustomReviewCheck(_0x4df0f9,_0x24e92b){const _0x5c3304='custom',_0x5a7fa1=(await this['context']['plugins']['get']('AIReviewModeCheckRegistry')['getChecksList']())['checks']['find'](_0x324ea4=>_0x324ea4['id']===_0x5c3304);if(!_0x5a7fa1)throw new dt('ai-reviewgateway-unknown-command',this,{'checkId':_0x5c3304});if(!(_0x5a7fa1 instanceof hl))throw new dt('ai-reviewgateway-not-a-custom-command',this,{'checkId':_0x5c3304});if(!_0x4df0f9)throw new dt('ai-reviewgateway-missing-custom-command-prompt',this,{'checkId':_0x5c3304});const _0x4e548a=_0x24e92b??_0x5a7fa1['defaultModel']?.['id'];if(!_0x4e548a)throw new dt('ai-reviewgateway-missing-custom-command-model',this,{'checkId':_0x5c3304});return{'reviewCheck':_0x5a7fa1,'resolvedModel':_0x4e548a};}_createReviewCheckRun(_0x841fb3,_0x85acac,_0x39093e,_0x10265a,_0x370f5f=new nr()){if(_0x841fb3 instanceof il){const _0x20e963=_0x841fb3['context']?_0x370f5f['cloneWith'](_0x841fb3['context']):_0x370f5f;return new sl(_0x841fb3['prompt'],_0x841fb3['defaultModel']['id'],_0x85acac,_0x841fb3,_0x39093e,_0x20e963);}return new Jc(_0x85acac,_0x841fb3,_0x39093e,_0x10265a?[_0x10265a]:void 0x0,void 0x0,_0x370f5f);}},_l=class extends _0x4cd5fc{static get requires(){return[ul,Bc,$c,dl];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startReview(_0x5e7221,_0x239489){await this['assertStartReviewPreconditions'](_0x5e7221,_0x3c6869=>{if(_0x3c6869 instanceof hl)throw new dt('ai-reviewmode-not-a-system-command',this,{'commandId':_0x5e7221});}),await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x5e7221,'params':_0x239489?.['parameterId']?[_0x239489['parameterId']]:void 0x0});}async startCustomReview(_0xb5ec43,_0x23f08f){if(!_0xb5ec43)throw new dt('ai-reviewmode-missing-custom-command-prompt',this);const _0x3c52d8=rl['find'](_0x2522aa=>'custom'===_0x2522aa['commandId'])['id'],_0x5ea8a1=await this['assertStartReviewPreconditions'](_0x3c52d8,_0x5d8231=>{if(!this['resolveCustomReviewModel'](_0x5d8231,_0x23f08f))throw new dt('ai-reviewmode-missing-custom-command-model',this);}),_0x1beb2a=this['resolveCustomReviewModel'](_0x5ea8a1,_0x23f08f);await this['context']['plugins']['get']('AIReviewModeController')['runCheck']({'id':_0x3c52d8,'isCustom':!0x0,'args':{'prompt':_0xb5ec43,'model':_0x1beb2a}});}getAvailableCommands(){return this['context']['plugins']['get']('AIReviewModeController')['getAvailableChecks']()['map'](_0x3d059a=>{const _0x4a9806={'id':_0x3d059a['id'],'title':_0x3d059a['title'],'description':_0x3d059a['description']};return'custom'!==_0x3d059a['id']&&_0x3d059a['options']?.['length']&&(_0x4a9806['parameters']=_0x3d059a['options'][0x0]['data']['map'](_0x29dbd9=>({..._0x29dbd9}))),_0x4a9806;});}async assertStartReviewPreconditions(_0x4aad26,_0x3bf576){const _0x20d996=this['context']['plugins']['get']('AIReviewModeController');if(_0x20d996['getCurrentCheckRun']())throw new dt('ai-reviewmode-review-already-running',this);const _0x39348a=_0x20d996['getAvailableChecks']()['find'](_0x5348a7=>_0x5348a7['id']===_0x4aad26);if(!_0x39348a)throw new dt('ai-reviewmode-unknown-command',this,{'commandId':_0x4aad26});if(_0x3bf576(_0x39348a),!await cc(this['context'],Sh))throw new dt('ai-reviewmode-review-vetoed',this);return _0x39348a;}resolveCustomReviewModel(_0x5b6dc2,_0x13cd13){return _0x13cd13?.['model']??_0x5b6dc2['defaultModel']?.['id'];}},gl=class extends Jc{_title;constructor(_0x4ff110,_0x40053a,_0x1fb8a1,_0x3f5586,_0x4e7138,_0x435d90,_0x5c8211){super(_0x4ff110,_0x40053a,_0x1fb8a1,_0x4e7138,_0x435d90,_0x5c8211),this['_title']=_0x3f5586;}get title(){return this['_title'];}get subTitle(){return this['_sourceCheck']['title'];}},Il=class extends el{get['apiId'](){return'translate';}},Al=class extends al{setupChecks(_0x336d2a){this['_checks']=_0x336d2a['map'](_0x6da231=>new Il(_0x6da231));}};const El=[{'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'}];var pl=class extends nl{static get['pluginName'](){return'AITranslateCheckRegistry';}constructor(_0x18d102){super(_0x18d102),this['context']['config']['define']('ai.translate.languages',El);}async _loadChecksList(){const _0x234b9c=[],_0x3bbc03=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5d2ee7 of _0x3bbc03)_0x234b9c['push']({'title':_0x5d2ee7['label'],'id':_0x5d2ee7['id'],'commandId':_0x5d2ee7['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5d2ee7['id']}});const _0x3b372d=new Al();return _0x3b372d['setupChecks'](this['_translateChecks'](_0x234b9c)),_0x3b372d;}_translateChecks(_0x4a9765){const _0x2c87d4=this['context']['locale'];return _0x4a9765['map'](_0x431ab0=>{const _0x800520='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x431ab0['title']['toUpperCase']()['replaceAll']('-','_'),_0x17a889=qs(_0x2c87d4,_0x800520);return{..._0x431ab0,'title':_0x17a889===_0x800520?_0x431ab0['title']:_0x17a889};});}},ml=class extends Zc{static get['pluginName'](){return'AITranslateController';}static get requires(){return[dr,pl,Js];}get['_aiSource'](){return'translate';}get _defaultContextFeature(){return'translate';}get['_aiTabId'](){return Oh;}get _leaveConfirmationDialogOptions(){const {context:{locale:_0x37bb68}}=this;return{'dialogId':'aiTranslateLeaveConfirmation','title':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_TITLE'),'content':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_CONTENT'),'stayButton':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_STAY_BUTTON'),'exitButton':qs(_0x37bb68,'AI_TRANSLATE_LEAVE_CONFIRMATION_EXIT_BUTTON')};}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}_initRequiredPlugins(){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}_createReviewCheckRun(_0x4530dc,_0x354595,_0x49f45f){return new gl(this['_aiReviewCoreEditing']['getDocumentData'](),_0x354595,this['_aiConnector'],qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x4530dc['params'],_0x4530dc['args'],_0x49f45f);}_onReviewCheckResultActivated(_0x39aa02){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x39aa02['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x39aa02['change']['id']);}_onReviewCheckResultDeactivated(){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}_onActivateChange(_0x2ac3f1){this['_currentReviewCheckRun']&&('hover'===_0x2ac3f1['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2ac3f1['id'])),'click'===_0x2ac3f1['uiInteraction']&&this['_scrollToChange'](_0x2ac3f1['id']));}_onDeactivateChange(_0x3c0d56){this['_currentReviewCheckRun']&&'panel'===_0x3c0d56['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x45ef37,_0x2f5560){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2f5560['changeId']),this['_scrollToChange'](_0x2f5560['changeId']));}['_onChangeMarkerHovered'](_0x3bc790,_0x3f4a08){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3f4a08['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3f4a08['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}_getChangeContentElement(_0x53fa77){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x53fa77);}_markChangePositionInEditorContent(_0x269208,_0x190780){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x269208,_0x190780);}_diffContent(_0x4e6ac1,_0x1f99b6,_0x18e112){return this['_aiReviewCoreEditing']['diffContent'](_0x4e6ac1,_0x1f99b6,_0x18e112,!0x0);}['_onReviewCheckRun'](){for(const _0x24abee of this['_aiReviewCoreEditing']['getEditors']())_0x24abee['editing']['view']['change'](_0x7aa301=>{for(const _0x524165 of _0x24abee['editing']['view']['document']['getRoots']())_0x7aa301['addClass']('ck-ai-translate-mode-content',_0x524165);});}async _getReviewChecks(){return(await this['context']['plugins']['get']('AITranslateCheckRegistry')['getChecksList']())['checks'];}},Tl=class extends vc{constructor(_0x45af9a,_0x2ee1f5){super(_0x45af9a,_0x2ee1f5),this['on']('set:isLoading',(_0x441037,_0x2da7fd,_0x2253e3)=>{_0x2253e3&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x1eb356,_0x282e26,_0x57fc80)=>{_0x57fc80&&(this['headerTitle']=qs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}_createAcceptAllButtonView(){const _0x2fd03f=new _0x1a9216(this['locale']);return _0x2fd03f['set']({'label':qs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL'),'withText':!0x0}),_0x2fd03f['bind']('isEnabled')['to'](this,'hasPendingChanges',this,'isError',(_0x562c79,_0x23cdd3)=>_0x562c79&&!_0x23cdd3),_0x2fd03f['extendTemplate']({'attributes':{'class':[gr,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1482cc=>!_0x1482cc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2dad1a=>_0x2dad1a)]}}),_0x2fd03f['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2fd03f;}_createExitButtonView(){const _0x939eb=new _0x1a9216(this['locale']);return _0x939eb['set']({'label':qs(this['locale'],'AI_CHAT_HISTORY_CANCEL'),'withText':!0x0}),_0x939eb['extendTemplate']({'attributes':{'class':[Ar,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4ad33b=>!_0x4ad33b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4fc6b5=>_0x4fc6b5)]}}),_0x939eb['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x939eb;}_createHeaderControlViews(){return this['_acceptAllButtonView']??=this['_createAcceptAllButtonView'](),this['_exitButtonView']??=this['_createExitButtonView'](),[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitButtonView'],this['_finishReviewButtonView']];}_createProgressBarViewList(){return[];}_getSkeletonDefinition(){return uo['aiTranslateChecks'];}},wl=class extends Mc{constructor(_0x4b9b7f){super(_0x4b9b7f),this['_setupTemplate']();}['_clearCheckViews'](){this['items']['clear']();}['_addCheckView'](_0x45143b){this['items']['add'](_0x45143b);}getCheckViews(){return[...this['items']]['filter'](_0x1acc3d=>_0x1acc3d instanceof Pc);}_setupTemplate(){const _0x3578c5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x3578c5['if']('isVisible','ck-hidden',_0x1d89a6=>!_0x1d89a6)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':qs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'ul','attributes':{'class':['ck-ai_review__check-list',_0x3578c5['if']('isVisible','ck-hidden',_0x35fdb1=>!_0x35fdb1)]},'children':this['items']}]});}},Cl=class extends Cc{static get['pluginName'](){return'AITranslateUI';}createMainView(){const _0x4f5cc0=this['context']['plugins']['get']('AITabs'),_0x210ce7=this['context']['locale'],_0x14be93=new sh(_0x210ce7,{'label':qs(_0x210ce7,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x46b415,'class':'ck-ai-header_review-translate','showResizeButton':_0x4f5cc0['showResizeButton']});_0x14be93['delegate']('resizeTabs')['to'](_0x4f5cc0),_0x14be93['bind']('isMaximized')['to'](_0x4f5cc0['view'],'isMaximized',_0x73ef5d=>_0x73ef5d);const _0x56b648=new Rc(_0x210ce7,{'header':_0x14be93,'list':new wl(_0x210ce7),'results':new Tl(_0x210ce7,{'generalErrorText':qs(_0x210ce7,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Nc(_0x210ce7,{'headerText':qs(_0x210ce7,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':qs(_0x210ce7,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':qs(_0x210ce7,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x56b648['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x56b648;}registerTab(){const _0x49f3db=this['context']['plugins']['get']('AITabs');_0x49f3db['view']['on']('activateTab',(_0x37a678,{newTab:_0x24c94a,oldTab:_0x47263e})=>{_0x24c94a===Oh?this['fire']('getReviewCheckList'):_0x47263e===Oh&&this['fire']('leaveReview');}),_0x49f3db['view']['addTab']({'id':Oh,'buttonLabel':qs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x46b415,'order':0x0,'content':this['_mainView']});}},fl=class extends _0x4cd5fc{static get['pluginName'](){return'AITranslateGateway';}static get requires(){return[$c,$s,Pn,Jn];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async runTranslate(_0x293024,_0x55b6c3){const _0x50e96a=this['context']['plugins']['get']('AIReviewCoreEditing'),_0x804843=this['context']['plugins']['get']('AIConnector'),_0x532bd9=new Il({'id':_0x293024,'commandId':_0x293024,'title':_0x293024,'description':'','isParameterized':!0x1}),_0x44ad86=_0x50e96a['getDocumentData']({'roots':_0x55b6c3?.['roots']}),_0x277180=new Jc(_0x44ad86,_0x532bd9,_0x804843,void 0x0,{'language':_0x293024},new nr(_0x55b6c3?.['contexts']));return _0x50e96a['runCheck'](_0x277180,{'signal':_0x55b6c3?.['signal']});}applyTranslate(_0x3d4a4b,_0x2a5b66){this['context']['plugins']['get']('AIGateway')['apply'](_0x3d4a4b,_0x2a5b66);}},Rl=class extends _0x4cd5fc{static get requires(){return[ml,Cl,$c,fl];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async startTranslate(_0x4d773b){const _0x3e8f50=await this['assertStartTranslatePreconditions'](_0x4d773b);await this['context']['plugins']['get']('AITranslateController')['runCheck']({'id':_0x3e8f50['id'],'args':_0x3e8f50['useArgs']?_0x3e8f50['args']:void 0x0});}getAvailableLanguages(){return this['context']['plugins']['get']('AITranslateController')['getAvailableChecks']()['map'](_0x3faff8=>({'id':_0x3faff8['id'],'label':_0x3faff8['title']}));}async assertStartTranslatePreconditions(_0x385df8){const _0x3e3ca3=this['context']['plugins']['get']('AITranslateController');if(_0x3e3ca3['getCurrentCheckRun']())throw new dt('ai-translate-translation-already-running',this);const _0x37445b=_0x3e3ca3['getAvailableChecks']()['find'](_0x532415=>_0x532415['id']===_0x385df8);if(!_0x37445b)throw new dt('ai-translate-unknown-language',this,{'languageId':_0x385df8});if(!await cc(this['context'],Oh))throw new dt('ai-translate-translation-vetoed',this);return _0x37445b;}},bl=class extends _0x158c3f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'DocumentCompareUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x157d1c=[this['editor']];for(const _0x376c16 of _0x157d1c){let _0x1f1217;for(const _0xe3d53d in _0x376c16){const _0x14f3bc=_0xe3d53d,_0x138a74=_0x376c16[_0x14f3bc];if('documentCompareLicenseKeyValid'==_0x138a74||'documentCompareLicenseKeyInvalid'==_0x138a74||'documentCompareLicenseKeyExpired'==_0x138a74||'documentCompareLicenseKeyDomainLimit'==_0x138a74||'documentCompareLicenseKeyNotAllowed'==_0x138a74||'documentCompareLicenseKeyEvaluationLimit'==_0x138a74||'documentCompareLicenseKeyUsageLimit'==_0x138a74){delete _0x376c16[_0x14f3bc],_0x1f1217=_0x138a74,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentCompareLicenseKeyInvalid'==_0x1f1217&&_0x376c16['_showLicenseError']('invalid'),'documentCompareLicenseKeyExpired'==_0x1f1217&&_0x376c16['_showLicenseError']('expired'),'documentCompareLicenseKeyDomainLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('domainLimit'),'documentCompareLicenseKeyNotAllowed'==_0x1f1217&&_0x376c16['_showLicenseError']('featureNotAllowed','DocumentCompare'),'documentCompareLicenseKeyEvaluationLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('evaluationLimit'),'documentCompareLicenseKeyUsageLimit'==_0x1f1217&&_0x376c16['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}};const Sl=new Set(['br']);var Ol=class{['_usedIds']=new Set();_writer;constructor(_0x35d7f7){this['_writer']=new _0x1cc48b(_0x35d7f7['editing']['view']['document']);}['assign'](_0x870d3f){this['_assignToChildren'](_0x870d3f);}['_assignToChildren'](_0x2ad7e6){let _0x883d96=!0x1;for(const _0x1228c7 of _0x2ad7e6['getChildren']()){if(!_0x1228c7['is']('view:element')||Sl['has'](_0x1228c7['name']))continue;const _0x5b9a67=_0x1228c7['is']('view:containerElement'),_0x2a81c9=_0x1228c7['is']('view:emptyElement'),_0x3b8831=_0x1228c7['is']('view:rawElement'),_0x21c63a=this['_assignToChildren'](_0x1228c7);_0x1228c7['hasAttribute']('data-id')?(this['_usedIds']['add'](_0x1228c7['getAttribute'](Hn)),_0x883d96=!0x0):(_0x5b9a67||_0x2a81c9||_0x3b8831||_0x21c63a)&&(this['_writer']['setAttribute'](Hn,this['_nextId'](),_0x1228c7),_0x883d96=!0x0);}return _0x883d96;}_nextId(){let _0x1e43ae;do{_0x1e43ae='';for(let _0x469366=0x0;_0x469366<0x4;_0x469366++)_0x1e43ae+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(this['_usedIds']['has'](_0x1e43ae));return this['_usedIds']['add'](_0x1e43ae),_0x1e43ae;}};function vl(_0x40f659){return new _0x1f9306(Array['from'](_0x40f659['getChildren'](),_0x14d186=>_0x14d186['_clone'](!0x0)));}const yl='documentcompare-selection',Nl='documentcompare-selection-start',kl='documentcompare-selection-end';function xl(_0x501f0e){const _0x3ce353='<'+Nl+'></'+Nl+'>',_0x52c9d1='<'+kl+'></'+kl+'>';let _0x152e2c=_0x501f0e;const _0x424ea9=[];let _0x4a6837=_0x152e2c['indexOf'](_0x3ce353);for(;-0x1!==_0x4a6837;){_0x152e2c=_0x152e2c['slice'](0x0,_0x4a6837)+_0x152e2c['slice'](_0x4a6837+_0x3ce353['length']);const _0x516b0f=_0x152e2c['indexOf'](_0x3ce353);let _0x432e5f=_0x152e2c['indexOf'](_0x52c9d1);-0x1===_0x432e5f||-0x1!==_0x516b0f&&_0x516b0f<_0x432e5f?_0x432e5f=_0x4a6837:_0x152e2c=_0x152e2c['slice'](0x0,_0x432e5f)+_0x152e2c['slice'](_0x432e5f+_0x52c9d1['length']),_0x424ea9['push']({'start':_0x4a6837,'end':_0x432e5f}),_0x4a6837=_0x152e2c['indexOf'](_0x3ce353);}return{'content':_0x152e2c,'selection':_0x424ea9};}var Ll=class extends _0x158c3f{['_sessionId'];static get['pluginName'](){return'DocumentCompare';}static get requires(){return[Un,bl];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['editor']['conversion']['for']('dataDowncast')['markerToElement']({'model':yl,'view':(_0x562882,{writer:_0x12b802,options:_0x794779})=>_0x794779['includeDocumentCompareSelection']?_0x12b802['createUIElement'](_0x562882['isOpening']?Nl:kl):null});}afterInit(){!async function(_0x3f4bc5){const _0x71c00a='KpOBJGNSEgqCyfVF1kZ8lbnRjM7eIzAsDQHw9aThu6rcYi05UmPL4d3X2Wotvx',_0x3b7e9a=0x79710,_0xb6660c={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x3b4897(_0x4d74b1){const _0x311628=new window['Promise'](_0xbb2545=>{_0x4d74b1['once']('ready',_0xbb2545);}),_0x6633d7=window['Date']['now'](),_0x2eec08=_0x4d74b1['config']['get']('licenseKey');async function _0x5d1ee1(){let _0x5e8f56,_0x51b029=null,_0xf5d7c7=null;try{return'GPL'==_0x2eec08?'NotAllowed':(_0x5e8f56=_0x48f245(),_0x5e8f56?(_0x5e8f56['usageEndpoint']&&(_0xf5d7c7=_0x14e6d1(_0x5e8f56['usageEndpoint'],_0x5e8f56['jti'])),await _0x2b1fdb()?_0x338522()?_0x3ae98c()?'Expired':_0x1eb252()?('evaluation'==_0x5e8f56['licenseType']&&(_0x51b029=_0x254680('EvaluationLimit')),await _0x399d46()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3ae98c(){const _0x533a03=['evaluation','trial']['includes'](_0x5e8f56['licenseType'])?_0x6633d7/0x3e8:0xe10*_0x3b7e9a;return _0x5e8f56['exp']<_0x533a03;}function _0x338522(){const _0x5125eb=_0x5e8f56['features'];return!!_0x5125eb&&(!!_0x5125eb['includes']('*')||(!!_0x5125eb['includes']('DC')||!!_0x5125eb['includes']('ET')));}function _0x1eb252(){const _0x4e8512=_0x5e8f56['licensedHosts'];if(!_0x4e8512||0x0==_0x4e8512['length'])return!0x0;const {hostname:_0x35979c}=new URL(window['location']['href']);if(_0x4e8512['includes'](_0x35979c))return!0x0;const _0x274601=_0x35979c['split']('.');return _0x4e8512['filter'](_0x364f3e=>_0x364f3e['includes']('*'))['map'](_0x14f805=>_0x14f805['split']('.'))['filter'](_0x5dc1b8=>_0x5dc1b8['length']<=_0x274601['length'])['map'](_0x40111e=>Array(_0x274601['length']-_0x40111e['length'])['fill']('*'===_0x40111e[0x0]?'*':'')['concat'](_0x40111e))['some'](_0x4224b9=>_0x274601['every']((_0x4c3e96,_0x5c45f6)=>_0x4224b9[_0x5c45f6]===_0x4c3e96||'*'===_0x4224b9[_0x5c45f6]));}function _0x399d46(){return _0x51b029&&_0xf5d7c7?new window['Promise']((_0x39310d,_0x2db89d)=>{_0x51b029['then'](_0x39310d,_0x2db89d),_0xf5d7c7['then'](_0x4a3a0c=>{'Valid'!=_0x4a3a0c&&_0x39310d(_0x4a3a0c);},_0x2db89d);}):_0x51b029||_0xf5d7c7||'Valid';}}function _0x14e6d1(_0x3fa267,_0x19a42b){return new window['Promise'](_0x2a0c44=>{if(_0x453c63())return _0x2a0c44('Valid');_0x322b7f(),_0x4d74b1['decorate']('_sendUsageRequest');let _0xb35d84=!0x1;const _0x25d1f2=Xt();function _0x5375be(_0x582876){return!!_0x582876&&('object'==typeof _0x582876||'function'==typeof _0x582876)&&'function'==typeof _0x582876['then']&&'function'==typeof _0x582876['catch'];}function _0x12df0f(_0x59ce4e){_0x64da05(_0x59ce4e)['then'](_0x515dcd=>_0x515dcd&&'ok'==_0x515dcd['status']?_0x43590e(_0x4e3210(_0x25d1f2+_0x19a42b))!=_0x515dcd['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3a075=>(_0x3e4e4e(),_0x3a075),()=>{const _0xa2e339=_0x540a9d();return null==_0xa2e339?(_0x3e4e4e(),'Valid'):_0x6633d7-_0xa2e339>0x240c8400?'UsageLimit':'Valid';})['then'](_0x2a0c44)['catch'](()=>{_0x2a0c44('UsageLimit');});const _0x292a81=0x36ee80;function _0x3e4e4e(){const _0x431c38='llct-'+_0x43590e(_0x4e3210(_0x3fa267)),_0x395bab=_0x2be04e(_0x43590e(window['Math']['ceil'](_0x6633d7/_0x292a81)));window['localStorage']['setItem'](_0x431c38,_0x395bab);}function _0x540a9d(){const _0x7e4ac8='llct-'+_0x43590e(_0x4e3210(_0x3fa267)),_0x43a9f3=window['localStorage']['getItem'](_0x7e4ac8);return _0x43a9f3?window['parseInt'](_0x2be04e(_0x43a9f3),0x10)*_0x292a81:null;}function _0x64da05(_0x4ad672){return new window['Promise']((_0x3a9a86,_0x55d277)=>{_0x4ad672['then'](_0x3a9a86,_0x55d277),window['setTimeout'](_0x55d277,0x1d4c0);});}}_0x4d74b1['on']('_sendUsageRequest',(_0xbe783d,_0x1167a9)=>{if(_0x1167a9[0x0]!=_0x3fa267)return _0x2a0c44('UsageLimit');_0x1167a9[0x1]={..._0x1167a9[0x1],'requestId':_0x25d1f2};},{'priority':'high'}),_0x4d74b1['on']('_sendUsageRequest',_0xb09f17=>{_0x5375be(_0xb09f17['return'])&&(_0xb35d84=!0x0,_0x12df0f(_0xb09f17['return']));},{'priority':'low'}),_0x311628['then'](()=>{_0xb35d84||_0x2a0c44('UsageLimit');});});function _0x453c63(){return'auto'==_0x4d74b1['editing']['view']['_overlayModeHint'];}function _0x322b7f(){_0x4d74b1['editing']['view']['_overlayModeHint']='auto';}}function _0x254680(_0x10e1f4){const _0x10b0e2=[new window['Promise'](_0x2248ff=>setTimeout(_0x2248ff,0x93ecc)),_0x311628['then'](()=>new window['Promise'](_0xa41b6d=>{let _0x314ec7=0x0;_0x4d74b1['model']['on']('applyOperation',(_0x5cdf02,_0x556c6e)=>{_0x556c6e[0x0]['isDocumentOperation']&&_0x314ec7++,0x5e8==_0x314ec7&&(_0xa41b6d(),_0x5cdf02['off']());});}))];return window['Promise']['race'](_0x10b0e2)['then'](()=>_0x10e1f4);}async function _0xa151c7(){await _0x311628,_0x3f4bc5['makeSnapshot']=_0x43a9d1,_0x3f4bc5['diffSnapshot']=_0x43a9d1,_0x3f4bc5['applyPatch']=_0x43a9d1,_0x4d74b1['model']['change']=_0x43a9d1,_0x4d74b1['model']['enqueueChange']=_0x43a9d1,_0x4d74b1['enableReadOnlyMode']('model');}function _0x414ef7(_0x4fdcef){const _0x536f35=_0x346cb0();_0x4d74b1[_0x536f35]='documentCompareLicenseKey'+_0x4fdcef,'Valid'!=_0x4fdcef&&_0xa151c7();}function _0x346cb0(){const _0x4e9621=window['String'](window['performance']['now']())['replace']('.','');let _0x3a285f='K';for(let _0x206a87=0x0;_0x206a87<_0x4e9621['length'];_0x206a87+=0x2){let _0x1f6573=window['parseInt'](_0x4e9621['substring'](_0x206a87,_0x206a87+0x2));_0x1f6573>=0x3e&&(_0x1f6573-=0x3e),_0x3a285f+=_0x71c00a[_0x1f6573];}return _0x3a285f;}function _0x48f245(){const _0x42d545=_0x2eec08['split']('.');if(0x3!=_0x42d545['length'])return null;return _0x4d349d(_0x42d545[0x1]);function _0x4d349d(_0x4048d0){const _0x35e85f=_0x2cc47c(_0x4048d0);return _0x35e85f&&_0x58c412()?_0x35e85f:null;function _0x58c412(){const _0x195228=_0x35e85f['jti'],_0x582f74=window['parseInt'](_0x195228['substring'](_0x195228['length']-0x8),0x10),_0x3cd63b={..._0x35e85f,'jti':_0x195228['substring'](0x0,_0x195228['length']-0x8)};return delete _0x3cd63b['vc'],_0x4e3210(_0x3cd63b)==_0x582f74;}}}async function _0x2b1fdb(){let _0x523551=!0x0;try{const [_0x5a14cb,_0x86db6b,_0x405d7e]=_0x2eec08['split']('.');return _0x13eede(_0x5a14cb),await _0x4f12af(_0x5a14cb,_0x86db6b,_0x405d7e),_0x523551;}catch{return!0x1;}function _0x13eede(_0x4e5497){const _0x372a03=_0x2cc47c(_0x4e5497);_0x372a03&&'ES256'==_0x372a03['alg']||(_0x523551=!0x1);}async function _0x4f12af(_0x4613e3,_0x100e32,_0x38c533){const _0xf09497=window['Uint8Array']['from'](_0x468928(_0x38c533),_0x579e91=>_0x579e91['charCodeAt'](0x0)),_0x21a583=new window['TextEncoder']()['encode'](_0x4613e3+'.'+_0x100e32),_0x32cb09=window['crypto']['subtle'];if(!_0x32cb09)return;const _0x23a1e4=await _0x32cb09['importKey']('jwk',_0xb6660c,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x32cb09['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x23a1e4,_0xf09497,_0x21a583)||(_0x523551=!0x1);}}function _0x2cc47c(_0x5d1226){return _0x5d1226['startsWith']('ey')?JSON['parse'](_0x468928(_0x5d1226)):null;}function _0x468928(_0x2dc1c9){return window['atob'](_0x2dc1c9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x4e3210(_0x2136ed){let _0x3076be=0x1505;function _0x240a41(_0x5a8435){for(let _0x40506b=0x0;_0x40506b<_0x5a8435['length'];_0x40506b++){const _0x117859=_0x5a8435['charCodeAt'](_0x40506b);_0x3076be=(_0x3076be<<0x5)+_0x3076be+_0x117859,_0x3076be&=_0x3076be;}}function _0x28ce12(_0xe825aa){Array['isArray'](_0xe825aa)?_0xe825aa['forEach'](_0x28ce12):_0xe825aa&&'object'==typeof _0xe825aa?Object['entries'](_0xe825aa)['sort']()['forEach'](([_0x17d5ae,_0x520faa])=>{_0x240a41(_0x17d5ae),_0x28ce12(_0x520faa);}):_0x240a41(window['String'](_0xe825aa));}return _0x28ce12(_0x2136ed),_0x3076be>>>0x0;}function _0x43590e(_0x549e07){return _0x549e07['toString'](0x10)['padStart'](0x8,'0');}function _0x2be04e(_0x4cd043){return _0x4cd043['split']('')['reverse']()['join']('');}function _0x43a9d1(){}_0x414ef7(await _0x5d1ee1());}_0x3b4897(_0x3f4bc5['editor']);}(this);}makeSnapshot(_0x461479=[]){const _0x468b1b=this['editor'],_0xadc2af=Array['from'](_0x461479),_0x401ed6={},_0x381155={},_0x27dbe0=new Ol(_0x468b1b);for(const _0x2719d5 of _0x468b1b['model']['document']['getRoots']()){const _0x349adf=Array['from'](_0x2719d5['getChildren']())['map'](_0x778e79=>_0x778e79['_clone'](!0x0)),_0x28deba=new _0x1f9306(_0x349adf);for(const _0x5e715a of _0x468b1b['model']['markers']){const _0x612930=_0x5e715a['getRange']();_0x5e715a['affectsData']&&_0x612930['root']===_0x2719d5&&_0x28deba['markers']['set'](_0x5e715a['name'],_0x468b1b['model']['createRange'](_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x612930['start']['path']),_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x612930['end']['path'])));}let _0x4ffa5a=0x0;for(const _0x4a075e of _0xadc2af)_0x4a075e['root']===_0x2719d5&&_0x28deba['markers']['set'](yl+':'+_0x4ffa5a++,_0x468b1b['model']['createRange'](_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x4a075e['start']['path']),_0x468b1b['model']['createPositionFromPath'](_0x28deba,_0x4a075e['end']['path'])));const _0x11154d=_0x468b1b['data']['toView'](_0x28deba,{'includeDocumentCompareSelection':!0x0});_0x27dbe0['assign'](_0x11154d);const {content:_0x13d5d7,selection:_0x1bc413}=xl(_0x468b1b['data']['processor']['toData'](_0x11154d));_0x401ed6[_0x2719d5['rootName']]=_0x13d5d7,_0x1bc413['length']&&(_0x381155[_0x2719d5['rootName']]=_0x1bc413);}return{'channelId':this['_getChannelId'](),'sessionId':this['_getSessionId'](),'version':_0x468b1b['model']['document']['version'],'content':_0x401ed6,'selection':_0x381155,'editorConfig':xn(_0x468b1b)};}diffSnapshot(_0x2b9eb2,_0x30f7c9,_0xad6296={}){const _0x4028ca=this['editor']['plugins']['get'](Un),_0x3e62b4='string'==typeof _0x30f7c9?{'main':_0x30f7c9}:_0x30f7c9,_0x20b785={};for(const _0x296990 of Object['keys'](_0x2b9eb2['content'])){const _0x22434e=_0x3e62b4[_0x296990];void 0x0!==_0x22434e&&(_0x20b785[_0x296990]=_0x4028ca['getDiff'](_0x2b9eb2['content'][_0x296990],_0x22434e,{'targetEditor':this['editor'],'anchor':_0x296990,'markDeletions':_0xad6296['asSuggestions']||!0x1}));}return{'channelId':_0x2b9eb2['channelId'],'sessionId':_0x2b9eb2['sessionId'],'version':_0x2b9eb2['version'],'options':_0xad6296,'operations':_0x20b785};}applyPatch(_0x2d16eb){const _0x106240=this['editor'];if(_0x2d16eb['channelId']!==this['_getChannelId']()||_0x2d16eb['sessionId']!==this['_getSessionId']())throw new dt('documentcompare-apply-session-mismatch',_0x106240);const _0x36fdc9=_0x2d16eb['options']['asSuggestions']||!0x1,_0x3f415b=Object['values'](_0x2d16eb['operations'])['filter'](_0x26dba2=>_0x26dba2['length']);if(!_0x3f415b['length'])return;if(_0x36fdc9&&!_0x106240['plugins']['has']('TrackChangesEditing'))throw new dt('documentcompare-no-track-changes',_0x106240);const _0x1f20ca=_0x106240['model']['document']['history']['getOperations'](_0x2d16eb['version']),_0xc71d17=[];for(const _0x509b77 of _0x3f415b)_0xc71d17['push'](..._0x3e782f(_0x509b77,_0x1f20ca,{'document':_0x106240['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1})['operationsA']);const _0x2493a5=function(_0x24939b,_0x13e4e5){const _0xe77529=_0x24939b['model']['document'],_0x4be0ae=new Map();for(const _0x406f38 of _0xe77529['roots'])_0x4be0ae['set'](_0x406f38['rootName'],vl(_0x406f38));for(const _0x2177d7 of _0x13e4e5)if('marker'!==_0x2177d7['type']){if(_0x2177d7 instanceof _0x285c43||_0x2177d7 instanceof ti)return{'reason':'unsupported','operation':_0x2177d7};try{const _0x13d190=_0x2177d7['clone']();if(_0x13d190['baseVersion']=null,_0x13d190['isDocumentOperation']=!0x1,ts(_0x13d190,_0x4be0ae),_0x3463ba(_0x13d190))continue;_0x13d190['_validate'](),_0x13d190['_execute']();}catch(_0x4bbc58){return{'reason':'invalid','operation':_0x2177d7,'cause':_0x4bbc58};}}return null;}(_0x106240,_0xc71d17);if(_0x2493a5){if('unsupported'===_0x2493a5['reason'])throw new dt('documentcompare-applypatch-unsupported-operation',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb,'operation':_0x2493a5['operation']});throw new dt('documentcompare-applypatch-invalid-patch',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb,'operation':_0x2493a5['operation']},_0x2493a5['cause']);}try{_0x106240['model']['change'](_0x5188a8=>{_0x36fdc9?_0x106240['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0xc71d17):_0x106240['plugins']['get'](Un)['applyOperations'](_0x5188a8,_0xc71d17);});}catch(_0x5591f5){throw new dt('documentcompare-apply-failed',_0x106240,{'history':_0x1f20ca,'patch':_0x2d16eb},_0x5591f5);}}async['process'](_0x1ebeb1,_0x34d948={}){const _0xc8d53a=this['makeSnapshot'](),_0x4a7c93=await _0x1ebeb1(_0xc8d53a);try{return this['applyPatch'](this['diffSnapshot'](_0xc8d53a,_0x4a7c93,_0x34d948)),!0x0;}catch(_0x3f3f89){if(!_0x34d948['overwriteOnError'])throw _0x3f3f89;return this['editor']['data']['set'](_0x4a7c93,{'suppressErrorInCollaboration':!0x0}),!0x1;}}_getSessionId(){const _0x28f540=this['editor'];return _0x28f540['plugins']['has']('RealTimeCollaborationClient')?_0x28f540['plugins']['get']('RealTimeCollaborationClient')['sessionId']:(this['_sessionId']||(this['_sessionId']=Xt()),this['_sessionId']);}_getChannelId(){return this['editor']['config']['get']('collaboration.channelId')||'';}};export{Ac as AIActions,us as AIAdapter,Ps as AIAssistant,xs as AIAssistantUI,Gh as AIBalloon,fh as AIChat,Kr as AIChatController,ta as AIChatFeedCustomElementView,Ch as AIChatHistory,wh as AIChatHistoryController,Ah as AIChatHistoryUI,Hr as AIChatInteraction,yh as AIChatShortcuts,ch as AIChatUI,Gc as AICheckRunSingleRootResult,$s as AIConnector,nr as AIContext,js as AIContextLibrary,Js as AICore,ur as AICoreError,cr as AIDocumentProcessingGateway,ar as AIDocumentProcessingRunResult,Pn as AIEditing,Qh as AIEditorIntegration,_r as AIErrorReporter,dr as AIErrorSink,Jn as AIGateway,Lr as AIInteraction,Xs as AIModels,Ec as AIQuickActions,ac as AIQuickActionsUI,Nr as AIReply,ds as AIRequestError,el as AIReviewCheck,qc as AIReviewCheckResult,Xc as AIReviewCheckResultChange,jc as AIReviewCheckRun,dl as AIReviewGateway,_l as AIReviewMode,Zc as AIReviewModeController,$c as AIReviewModeEditing,Bc as AIReviewModeUI,hr as AIRunResult,or as AIRunSingleRootResult,Ks as AITabs,Fs as AITabsMainView,Bs as AITabsView,Vs as AITextAdapter,kh as AIToggleButtonUI,Rl as AITranslate,ml as AITranslateController,fl as AITranslateGateway,Cl as AITranslateUI,Us as AWSTextAdapter,Ll as DocumentCompare,Hs as OpenAITextAdapter,gs as ShowAIAssistantCommand,Nh as ToggleAICommand,Tr as createResizeButton,Ms as getDefaultAICommands,jn as markOperationsAsAI};
|