jodit-pro 4.9.4 → 4.9.15
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/CHANGELOG.md +44 -2
- package/config.js +1 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +26 -26
- package/es2015/jodit.js +5 -3
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +10 -4
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +6 -6
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +1 -1
- package/es2015/plugins/finder/finder.js +1 -1
- package/es2015/plugins/finder/finder.min.js +1 -1
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/style/style.css +79 -0
- package/es2015/plugins/style/style.js +395 -0
- package/es2015/plugins/style/style.min.css +1 -0
- package/es2015/plugins/style/style.min.js +8 -0
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +1 -1
- package/es2015/plugins/tune-block/tune-block.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +15 -15
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +7 -7
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/style/style.min.css +1 -0
- package/es2018/plugins/style/style.min.js +8 -0
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +16 -16
- package/es2021/jodit.js +5 -3
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +9 -4
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +28 -28
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +1 -1
- package/es2021/plugins/finder/finder.js +1 -1
- package/es2021/plugins/finder/finder.min.js +1 -1
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/style/style.css +79 -0
- package/es2021/plugins/style/style.js +395 -0
- package/es2021/plugins/style/style.min.css +1 -0
- package/es2021/plugins/style/style.min.js +8 -0
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +1 -1
- package/es2021/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +14 -14
- package/es2021.en/jodit.js +5 -3
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +9 -4
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +7 -7
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +1 -1
- package/es2021.en/plugins/finder/finder.js +1 -1
- package/es2021.en/plugins/finder/finder.min.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/style/style.css +79 -0
- package/es2021.en/plugins/style/style.js +395 -0
- package/es2021.en/plugins/style/style.min.css +1 -0
- package/es2021.en/plugins/style/style.min.js +8 -0
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +5 -3
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +11 -5
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +2 -2
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +1 -1
- package/es5/plugins/finder/finder.js +1 -1
- package/es5/plugins/finder/finder.min.js +1 -1
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/style/style.css +79 -0
- package/es5/plugins/style/style.js +524 -0
- package/es5/plugins/style/style.min.css +1 -0
- package/es5/plugins/style/style.min.js +8 -0
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +1 -1
- package/es5/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +6 -0
- package/esm/plugins/ai-assistant-pro/ai-assistant-pro.js +2 -2
- package/esm/plugins/ai-assistant-pro/core/ai-response-handler.js +1 -1
- package/esm/plugins/ai-assistant-pro/core/panel-resize.js +1 -1
- package/esm/plugins/ai-assistant-pro/helpers/api-client.js +1 -1
- package/esm/plugins/all.js +1 -1
- package/esm/plugins/style/config.d.ts +13 -0
- package/esm/plugins/style/config.js +1 -0
- package/esm/plugins/style/helpers/apply-style.d.ts +8 -0
- package/esm/plugins/style/helpers/apply-style.js +1 -0
- package/esm/plugins/style/helpers/classify-definitions.d.ts +7 -0
- package/esm/plugins/style/helpers/classify-definitions.js +1 -0
- package/esm/plugins/style/helpers/detect-active-style.d.ts +8 -0
- package/esm/plugins/style/helpers/detect-active-style.js +1 -0
- package/esm/plugins/style/icon.svg.js +1 -0
- package/esm/plugins/style/interface.d.ts +15 -0
- package/esm/plugins/style/interface.js +0 -0
- package/esm/plugins/style/style.d.ts +18 -0
- package/esm/plugins/style/style.js +1 -0
- package/esm/plugins/style/ui/style-popup.d.ts +8 -0
- package/esm/plugins/style/ui/style-popup.js +1 -0
- package/examples/assets/app.js +2 -1
- package/examples/style-plugin.html +508 -0
- package/package.json +1 -1
- package/types/config.d.ts +6 -0
- package/types/plugins/style/config.d.ts +13 -0
- package/types/plugins/style/helpers/apply-style.d.ts +8 -0
- package/types/plugins/style/helpers/classify-definitions.d.ts +7 -0
- package/types/plugins/style/helpers/detect-active-style.d.ts +8 -0
- package/types/plugins/style/interface.d.ts +15 -0
- package/types/plugins/style/style.d.ts +18 -0
- package/types/plugins/style/ui/style-popup.d.ts +8 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit-pro - PRO Version of Jodit Editor
|
|
3
3
|
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
-
* Version: v4.9.
|
|
4
|
+
* Version: v4.9.15
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var u=t();for(var s in u)("object"==typeof exports?exports:e)[s]=u[s]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[830],{473:function(e,t,u){"use strict";u.d(t,{handleBackToList:function(){return h},handleConversationSearch:function(){return d},handleConversationSelect:function(){return c},handleToolApproval:function(){return a},handleToolDenial:function(){return l}});var s=u(77688),n=u(56075),i=u(11886),r=u(79078),o=u(82758);function a(e,t,u,r,o){return(0,s._)(function*(){let s=u.getPendingToolCalls().find(t=>t.id===e);if(!s)return null;let a=r.grantPermission(s.name,t),l=u.getCurrentConversation();return l&&(l.permissions.push(a),yield o.save(l)),u.removePendingToolCall(e),(0,i._)((0,n._)({},s),{status:"approved"})})()}function l(e,t,u,o){return(0,s._)(function*(){let s=u.getPendingToolCalls().find(e=>e.id===t);if(!s)return;let a=u.getCurrentConversation();if(!a)return;let l=a.messages.findIndex(e=>{var u;return null==(u=e.toolCalls)?void 0:u.find(e=>e.id===t)});if(-1===l)return;let c=a.messages[l],h=(0,i._)((0,n._)({},s),{result:{error:"Tool call denied by user."},status:"denied"}),d=(0,r.updateToolCallInMessage)(c,h),F=[...a.messages];F[l]=d,a=(0,i._)((0,n._)({},a),{messages:F,updated:Date.now()}),u.setCurrentConversation(a),yield o.save(a),e.e.fire("toolCallDenied.ai-assistant-pro",s),u.removePendingToolCall(t)})()}function c(e,t,u){return(0,s._)(function*(){try{u.setLoading(!0);let s=yield t.get(e);if(!s)throw Error("Conversation not found: "+e);u.setCurrentConversation((0,n._)({},s))}catch(e){o.IS_PROD}finally{u.setLoading(!1)}})()}function h(e,t){return(0,s._)(function*(){t.setView("conversationList");try{t.setLoading(!0);let u=yield e.list().catch(()=>[]);t.setConversations(u)}finally{t.setLoading(!1)}})()}function d(e,t,u){return(0,s._)(function*(){u.setLoading(!0);try{let s=yield t.list(e||void 0);u.setConversations(s),u.setView("conversationList")}finally{u.setLoading(!1)}})()}},2020:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(96675),r=u(3091);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},3091:function(e,t,u){"use strict";u.d(t,{execute:function(){return a}});var s=u(77688),n=u(6689),i=u(49459),r=u(44526),o=u(22732);function a(e,t,u){return(0,s._)(function*(){let{index:s,selector:a}=t,l=(0,i.requireString)(t,"html");if((0,n.throwIfAborted)(u),void 0===s&&!a||void 0!==s&&a)throw Error("Either index or selector must be provided, but not both");let{element:c,identifier:h}=(0,r.resolveBlock)(e,{selector:a,index:s,requireExactlyOne:!0});try{var d;let t=e.createInside.div();t.innerHTML=l;let u=t.firstChild;if(!u||!o.Dom.isElement(u))throw Error("Invalid HTML: must contain at least one element");return null==(d=c.parentNode)||d.replaceChild(u,c),e.synchronizeValues(),{success:!0,message:`Block ${h} replaced successfully`}}catch(e){throw Error(`Failed to replace block ${h}: ${e.message}`)}})()}},5618:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(93809),r=u(28157);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},6689:function(e,t,u){"use strict";u.d(t,{throwIfAborted:function(){return n}});var s=u(93661);function n(e){if(e.aborted)throw(0,s.abort)()}},11886:function(e,t,u){"use strict";function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t.push.apply(t,u)}return t})(Object(t)).forEach(function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}),e}u.d(t,{_:function(){return s}})},12570:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(62553),r=u(56293);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},15927:function(e,t,u){"use strict";function s(e){if(e.s.isCollapsed())return null;let t=e.s.html,u=e.s.range;return{html:t,rangeInfo:{startContainer:u.startContainer.nodeName,startOffset:u.startOffset,endContainer:u.endContainer.nodeName,endOffset:u.endOffset}}}u.d(t,{getCurrentSelectionContext:function(){return s}})},16015:function(e,t,u){"use strict";u.d(t,{UIDialogSettings:function(){return d}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(31635),a=u(65478),l=u(67510),c=u(12234),h=u(62357);class d extends l.UIElement{className(){return"UIDialogSettings"}setParentView(e){var t,u;return null==(t=this.modelSelect)||t.setParentView(e),null==(u=this.temperatureInput)||u.setParentView(e),super.setParentView(e)}build(){return(0,s._)(function*(){var e,t,u,s,n;let i=this.container,r=this.getConversation().options||{};if(this.options.dialogSettings.models&&this.options.dialogSettings.models.length>0){let u=this.parseModels(this.options.dialogSettings.models),s=null!=(e=null!=(t=r.model)?t:this.state.defaultModel)?e:u[0].value;this.modelSelect=new c.UISelect(this.j,{label:"Model",name:"model",value:s,options:u,onChange:this.onModelChange.bind(this)}),i.appendChild(this.modelSelect.container)}if(this.options.dialogSettings.temperature){this.temperatureInput=new h.UIRange(this.j,{label:"Temperature",name:"temperature",min:this.options.dialogSettings.temperature.min,max:this.options.dialogSettings.temperature.max,value:null!=(u=null!=(s=r.temperature)?s:this.state.defaultTemperature)?u:.5,onChange:this.onTemperatureChange.bind(this)});let e=this.temperatureInput.nativeInput;e&&e.setAttribute("step",String(null!=(n=this.options.dialogSettings.temperature.step)?n:.1)),i.appendChild(this.temperatureInput.container)}}).call(this)}parseModels(e){return 0===e.length?[]:"object"==typeof e[0]&&"title"in e[0]?e.map(e=>({text:e.title,value:e.value})):e.map(e=>({text:e,value:e}))}onModelChange(){return(0,s._)(function*(){if(!this.modelSelect)return;let e=this.modelSelect.value;this.updateConversation({options:(0,r._)((0,i._)({},this.getConversation().options),{model:e})}),this.state.defaultModel=e}).call(this)}onTemperatureChange(){return(0,s._)(function*(){if(!this.temperatureInput)return;let e=parseFloat(this.temperatureInput.value);this.updateConversation({options:(0,r._)((0,i._)({},this.getConversation().options),{temperature:e})}),this.state.defaultTemperature=e}).call(this)}onDefaultModelChange(){this.modelSelect&&this.state.defaultModel&&(this.modelSelect.value=this.state.defaultModel)}onDefaultTemperatureChange(){this.temperatureInput&&void 0!==this.state.defaultTemperature&&(this.temperatureInput.value=String(this.state.defaultTemperature))}destruct(){var e;null==(e=this.modelSelect)||e.destruct(),super.destruct()}constructor(e,t,u,s,i){super(e),(0,n._)(this,"getConversation",void 0),(0,n._)(this,"updateConversation",void 0),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"modelSelect",void 0),(0,n._)(this,"temperatureInput",void 0),this.getConversation=t,this.updateConversation=u,this.state=s,this.options=i,this.modelSelect=null,this.temperatureInput=null,this.build()}}(0,o.__decorate)([(0,a.watch)("state.defaultModel")],d.prototype,"onDefaultModelChange",null),(0,o.__decorate)([(0,a.watch)("state.defaultTemperature")],d.prototype,"onDefaultTemperatureChange",null),d=(0,o.__decorate)([a.component],d)},16745:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(56732),r=u(39592);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},18549:function(e,t,u){"use strict";u.d(t,{UIFlightPosition:function(){return i}});var s=u(2748);let n=new WeakMap;class i{static install(e,t,u={}){this.remove(e);let{panelHeight:s=250,containerClassName:i,toolbarSelector:r=".jodit-toolbar__box",gap:o=16}=u,a=e.j.c.div("jodit-flight-position");i&&a.classList.add(i),a.style.setProperty("--flight-panel-height",`${s}px`),a.appendChild(e.container),document.body.appendChild(a);let l={toolbarSelector:r,gap:o},c=()=>{this.updatePosition(a,t,l)},h=new ResizeObserver(c);h.observe(t),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c,{passive:!0}),n.set(e,{container:a,anchor:t,onScroll:c,resizeObserver:h,options:l}),this.updatePosition(a,t,l)}static updatePosition(e,t,u){let{toolbarSelector:s,gap:n}=u,i=t.getBoundingClientRect(),r=window.innerHeight,o=e.offsetHeight||250;e.style.left=`${i.left}px`,e.style.width=`${i.width}px`;let a=t.querySelector(s),l=a?a.getBoundingClientRect().bottom:i.top,c=i.bottom-l,h=i.bottom<=r;o<=c?h?(e.style.top="auto",e.style.bottom=`${r-i.bottom+n}px`):(e.style.top="auto",e.style.bottom=`${n}px`):(e.style.bottom="auto",e.style.top=`${l}px`)}static remove(e){let t=n.get(e);if(t){if(window.removeEventListener("scroll",t.onScroll),window.removeEventListener("resize",t.onScroll),t.resizeObserver.disconnect(),e.container.parentNode===t.container){var u;null==(u=t.container.parentNode)||u.insertBefore(e.container,t.container)}s.Dom.safeRemove(t.container),n.delete(e)}}static isInstalled(e){return n.has(e)}static setPanelHeight(e,t){let u=n.get(e);u&&u.container.style.setProperty("--flight-panel-height",`${t}px`)}static refresh(e){let t=n.get(e);t&&this.updatePosition(t.container,t.anchor,t.options)}}},19127:function(e,t,u){"use strict";u.d(t,{execute:function(){return a}});var s=u(77688),n=u(56075),i=u(11886),r=u(6689),o=u(44526);function a(e,t,u){return(0,s._)(function*(){let{element:s,attributes:a,remove:l,blockIndex:c,selector:h}=t;if((0,r.throwIfAborted)(u),!s&&!a)throw Error('Either "element" or "attributes" must be provided');if(e.s.restore(),void 0!==c||h){let{element:t}=(0,o.resolveBlock)(e,{selector:h,index:c});e.s.select(t)}if(e.s.isCollapsed())throw Error("No selection found. Please select text to format");try{let t={};return s&&(t.element=s),a&&(t.attributes=a),l?e.s.commitStyle((0,i._)((0,n._)({},t),{mode:"remove"})):e.s.commitStyle(t),e.synchronizeValues(),{success:!0,message:l?"Formatting removed successfully":"Formatting applied successfully"}}catch(e){throw Error(`Failed to ${l?"remove":"apply"} formatting: ${e.message}`)}})()}},21020:function(e,t,u){"use strict";u.d(t,{PermissionManager:function(){return r}});var s=u(82749),n=u(56075),i=u(11886);class r{requiresPermission(e){let{autoApproveTools:t,alwaysDenyTools:u}=this.jodit.o.aiAssistantPro;if(u.includes(e))return!0;if(t.includes(e))return!1;let s=this.toolRegistry.getTool(e);return!s||s.requiresPermission}isAutoDenied(e){let{alwaysDenyTools:t}=this.jodit.o.aiAssistantPro;return t.includes(e)}isAutoApproved(e){let{autoApproveTools:t}=this.jodit.o.aiAssistantPro;return t.includes(e)}checkPermission(e,t){if(this.isAutoApproved(e))return{toolName:e,granted:!0,grantedAt:Date.now(),scope:"once"};if(this.isAutoDenied(e))return null;let u=this.permanentPermissions.get(e);return u&&u.granted?u:t.find(t=>t.toolName===e&&t.granted)||null}grantPermission(e,t){let u={toolName:e,granted:!0,grantedAt:Date.now(),scope:t};return"forever"===t&&(this.permanentPermissions.set(e,u),this.savePermanentPermissions()),u}denyPermission(e){return{toolName:e,granted:!1,grantedAt:Date.now(),scope:"once"}}filterToolCalls(e,t){let u=[],s=[],r=[];for(let o of e){if(this.isAutoDenied(o.name)){r.push((0,i._)((0,n._)({},o),{status:"denied"}));continue}if(this.isAutoApproved(o.name)){u.push((0,i._)((0,n._)({},o),{status:"approved"}));continue}let e=this.checkPermission(o.name,t);e&&e.granted?u.push((0,i._)((0,n._)({},o),{status:"approved"})):this.requiresPermission(o.name)?(this.jodit.e.fire("permissionRequested.ai-assistant-pro",o.name),s.push((0,i._)((0,n._)({},o),{status:"pending"}))):u.push((0,i._)((0,n._)({},o),{status:"approved"}))}return{approved:u,needsPermission:s,denied:r}}clearConversationPermissions(e){}loadPermanentPermissions(){try{let e=localStorage.getItem(this.PERMANENT_PERMISSIONS_KEY);e&&JSON.parse(e).forEach(e=>{"forever"===e.scope&&e.granted&&this.permanentPermissions.set(e.toolName,e)})}catch(e){}}savePermanentPermissions(){try{let e=Array.from(this.permanentPermissions.values());localStorage.setItem(this.PERMANENT_PERMISSIONS_KEY,JSON.stringify(e))}catch(e){}}clearPermanentPermissions(){this.permanentPermissions.clear(),localStorage.removeItem(this.PERMANENT_PERMISSIONS_KEY)}getPermanentPermissions(){return Array.from(this.permanentPermissions.values())}revokePermanentPermission(e){this.permanentPermissions.delete(e),this.savePermanentPermissions()}destruct(){this.permanentPermissions.clear()}constructor(e,t){(0,s._)(this,"jodit",void 0),(0,s._)(this,"toolRegistry",void 0),(0,s._)(this,"permanentPermissions",void 0),(0,s._)(this,"PERMANENT_PERMISSIONS_KEY",void 0),this.jodit=e,this.toolRegistry=t,this.permanentPermissions=new Map,this.PERMANENT_PERMISSIONS_KEY="jodit-permissions.ai-assistant-pro",this.loadPermanentPermissions()}}},21064:function(e,t,u){"use strict";u.d(t,{WebStorageConversationStorage:function(){return o},createStorageProvider:function(){return a},generateConversationId:function(){return l},generateMessageId:function(){return c}});var s=u(77688),n=u(82749),i=u(56075),r=u(97333);class o{close(){return this.storage.close()}getConversationKey(e){return`conv:${e}`}getAllKeys(){return(0,s._)(function*(){let e=yield this.storage.get("__conversation_index__");return e&&Array.isArray(e)?e:[]}).call(this)}updateIndex(e){return(0,s._)(function*(){yield this.storage.set("__conversation_index__",e)}).call(this)}addToIndex(e){return(0,s._)(function*(){let t=yield this.getAllKeys();t.includes(e)||(t.push(e),yield this.updateIndex(t))}).call(this)}removeFromIndex(e){return(0,s._)(function*(){let t=(yield this.getAllKeys()).filter(t=>t!==e);yield this.updateIndex(t)}).call(this)}list(e){return(0,s._)(function*(){try{let s=yield this.getAllKeys(),n=[],i=null==e?void 0:e.toLowerCase().trim();for(let e of s){var t,u;let s=yield this.get(e);if(s){if(i){let e=null==(u=s.title)?void 0:u.toLowerCase().includes(i),t=!e&&s.messages.some(e=>e.content.toLowerCase().includes(i));if(!e&&!t)continue}n.push({id:s.id,title:null!=(t=s.title)?t:"",created:s.created,updated:s.updated,messageCount:s.messages.length})}}return n.sort((e,t)=>t.updated-e.updated),n}catch(e){return[]}}).call(this)}get(e){return(0,s._)(function*(){try{let t=this.getConversationKey(e);return(yield this.storage.get(t))||null}catch(e){return null}}).call(this)}save(e){return(0,s._)(function*(){try{if(0===e.messages.length)throw Error("Conversation must have at least one message.");let t=yield this.getAllKeys();t.length>=this.maxConversations&&!t.includes(e.id)&&(yield this.evictOldest());let u=this.getConversationKey(e.id);yield this.storage.set(u,e),yield this.addToIndex(e.id)}catch(t){if((null==t?void 0:t.name)==="QuotaExceededError"||(null==t?void 0:t.code)===22||(null==t?void 0:t.code)===1014){yield this.evictOldest();try{let t=this.getConversationKey(e.id);yield this.storage.set(t,e),yield this.addToIndex(e.id)}catch(e){throw Error("Storage quota exceeded. Please delete some conversations.")}}else throw Error(`Failed to save conversation: ${(null==t?void 0:t.message)||"Unknown error"}`)}}).call(this)}delete(e){return(0,s._)(function*(){try{let t=this.getConversationKey(e);yield this.storage.delete(t),yield this.removeFromIndex(e)}catch(e){}}).call(this)}clear(){return(0,s._)(function*(){try{for(let e of yield this.getAllKeys()){let t=this.getConversationKey(e);yield this.storage.delete(t)}yield this.updateIndex([])}catch(e){}}).call(this)}evictOldest(){return(0,s._)(function*(){try{let e=yield this.list();if(0===e.length)return;e.sort((e,t)=>e.updated-t.updated);let t=e[0];yield this.delete(t.id)}catch(e){}}).call(this)}getGlobalSettings(){return(0,s._)(function*(){try{return(yield this.storage.get("global-settings"))||null}catch(e){return null}}).call(this)}saveGlobalSettings(e){return(0,s._)(function*(){try{let t=yield this.getGlobalSettings(),u=(0,i._)({},t,e);yield this.storage.set("global-settings",u)}catch(e){throw Error("Failed to save global settings")}}).call(this)}constructor(e,t){(0,n._)(this,"storage",void 0),(0,n._)(this,"maxConversations",void 0),this.storage=e,this.maxConversations=t}}function a(e,t){return r.AsyncStorage.makeStorage(e,t)}function l(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function c(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}},26612:function(e){e.exports={"AI Assistant":"AI Assistant","AI Assistant Pro":"AI Assistant Pro","Welcome to AI Assistant":"Welcome to AI Assistant","Start your first conversation":"Start your first conversation","Tip: Select text in editor to add context":"Tip: Select text in editor to add context","New Chat":"New Chat","Search conversations...":"Search conversations...","No conversations yet":"No conversations yet","Ask me anything...":"Ask me anything...","Ask a follow-up...":"Ask a follow-up...","Reply...":"Reply...","Type your message...":"Type your message...",Send:"Send",Cancel:"Cancel",Retry:"Retry",Insert:"Insert",Copy:"Copy",Edit:"Edit",Delete:"Delete",New:"New",Back:"Back","Permission Required":"Permission Required",Approve:"Approve",Deny:"Deny",Once:"Once","This conversation":"This conversation",Always:"Always","The AI wants to execute:":"The AI wants to execute:","This will modify your document content.":"This will modify your document content.","Executing...":"Executing...","Completed successfully":"Completed successfully",Failed:"Failed","Pending approval":"Pending approval","Denied by user":"Denied by user","Tool Result":"Tool Result","Tool Execution Error":"Tool Execution Error",Context:"Context",Contexts:"Contexts","Add to AI Context":"Add to AI Context",Remove:"Remove","Clear all":"Clear all","An error occurred":"An error occurred","Request failed":"Request failed","Connection error":"Connection error","AI Assistant is not configured":"AI Assistant is not configured","Thinking...":"Thinking...","Generating response...":"Generating response...",insertHTML:"Insert HTML",readDocument:"Read Document",readBlock:"Read Block",replaceInDocument:"Replace in Document",replaceInBlock:"Replace in Block",getSelection:"Get Selection","Just now":"Just now",Conversation:"Conversation","New Conversation":"New Conversation",Yesterday:"Yesterday","Delete conversation":"Delete conversation","Are you sure you want to delete this conversation?":"Are you sure you want to delete this conversation?","Failed to delete conversation":"Failed to delete conversation"}},27769:function(e,t,u){"use strict";u.d(t,{UIMainPanel:function(){return s.UIMainPanel}});var s=u(51251)},28157:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(22732);function r(e,t,u){return(0,s._)(function*(){let{start:s,end:r,aroundSelection:o}=t;(0,n.throwIfAborted)(u);let a=e.value,l=a.length;if(o&&!e.s.isCollapsed()){let t=e.s.range.commonAncestorContainer;for(;t&&t!==e.editor;){if(i.Dom.isElement(t)&&t.parentNode===e.editor){a=t.outerHTML;break}t=t.parentNode}return{html:a,length:l}}let c=void 0!==r?Math.min(r,l):l,h=Math.max(0,Math.min("number"==typeof s?s:0,l));return(h>0||l>c)&&(a=a.substring(h,c)),{html:a,length:l,start:h,end:c}})()}},36142:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html"),{collapseToEnd:r}=t;(0,n.throwIfAborted)(u);try{if(e.s.restore(),e.s.insertHTML(s),r){let t=e.s.range;t.collapse(!1),e.s.selectRange(t)}return e.e.fire("change"),{success:!0,message:"Selection replaced successfully"}}catch(e){throw Error(`Failed to replace selection: ${e.message}`)}})()}},39296:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(73943),r=u(19127);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},39592:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html",{allowEmpty:!0}),{replace:r}=t;if(!s.trim())return{success:!0,message:"Nothing to insert: HTML is empty"};(0,n.throwIfAborted)(u);try{return e.s.focus(),r&&!e.s.isCollapsed()&&e.s.remove(),e.s.insertHTML(s),e.synchronizeValues(),{success:!0,message:`Inserted ${s.length} characters of HTML`}}catch(e){throw Error(`Failed to insert HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}})()}},41810:function(e,t,u){"use strict";u.r(t),u.d(t,{aiAssistantPro:function(){return y}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(31635);u(66645);var a=u(86449),l=u(21020),c=u(46166),h=u(62895),d=u(55487),F=u(27769),p=u(58579),A=u(63805),C=u(82758),g=u(65478),E=u(580),D=u(21537),f=u(50911),m=u(2692),B=u(18549),v=u(54747);class y extends f.Plugin{get state(){return this.stateManager.state}get toolRegistry(){return new d.ToolRegistry(this.j)}get permissionManager(){return new l.PermissionManager(this.j,this.toolRegistry)}get apiClient(){return new a.APIClient(this.j,this.toolRegistry)}get storage(){let{storage:e,storageKey:t,maxConversations:u}=this.j.o.aiAssistantPro;if("string"==typeof e){let s=(0,h.createStorageProvider)(e,t);return new h.WebStorageConversationStorage(s,u)}return e}get stateManager(){return new c.StateManager(this.j)}get mainPanel(){return new F.UIMainPanel(this.j,this.stateManager.state,this.j.o.aiAssistantPro,e=>{let t=this.stateManager.getCurrentConversation();t&&this.stateManager.setCurrentConversation((0,i._)({},t,e))})}get dialog(){let e=this.j.dlg({resizable:this.j.o.aiAssistantPro.resizable,eventEmmiter:this.j.e});return e.e.on(e,"afterClose",()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro")}),e}afterInit(){(0,E.extendLang)(A),this.setupEventListeners(),this.j.async.promise(e=>{let{initiallyOpened:t,persistOpenState:u}=this.j.o.aiAssistantPro,s=t;u?this.storage.getGlobalSettings().then(e=>{if((null==e?void 0:e.isOpen)!=null&&(s=e.isOpen),s)return this.openAssistant()}).catch(()=>null).finally(()=>e(void 0)):e(void 0)}).catch(()=>null)}__loadData(){return this.__initedPromise?this.__initedPromise:this.isDestructed?Promise.reject():(this.__initedPromise=this.j.async.promise(e=>{this.loadInitialData().then(e)}).catch(()=>null),this.__initedPromise)}loadInitialData(){return(0,s._)(function*(){this.mainPanel.setMod("ready",!0),yield(0,p.loadInitialData)(this.j,this.storage,this.stateManager)}).call(this)}setupEventListeners(){this.j.e.on("selectConversation.ai-assistant-pro",e=>(0,s._)(function*(){try{yield this.__loadData(),yield(0,p.handleConversationSelect)(e,this.storage,this.stateManager)}catch(e){C.IS_PROD}}).call(this)),this.j.e.on("newConversation.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData();let e=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature);this.stateManager.setCurrentConversation(e)}).call(this)),this.j.e.on("deleteConversation.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),yield this.deleteConversation(e)}).call(this)),this.j.e.on("backToList.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleBackToList)(this.storage,this.stateManager)}).call(this)),this.j.e.on("removeContext.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),this.stateManager.removeSelectionContext(e)}).call(this)),this.j.e.on("approveToolCall.ai-assistant-pro",(e,t)=>(0,s._)(function*(){try{yield this.__loadData();let u=yield(0,p.handleToolApproval)(e,t,this.stateManager,this.permissionManager,this.storage);if(u){let e=this.stateManager.getCurrentConversation();if(!e)return;let t=e.messages.find(e=>{var t;return null==(t=e.toolCalls)?void 0:t.some(e=>e.id===u.id)});if(!t)return;yield this.executeToolCall(t.id,u)}}catch(e){if((0,D.isAbortError)(e))return;this.stateManager.setError(e instanceof Error?e.message:String(e))}}).call(this)),this.j.e.on("denyToolCall.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleToolDenial)(this.j,e,this.stateManager,this.storage)}).call(this)),this.j.e.on("abortRequest.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData(),this.apiClient.abort(),this.stateManager.setLoading(!1)}).call(this))}__applyTheme(){(0,p.applyTheme)(this.j,this.stateManager.state.theme,this.stateManager.state.displayMode,this.mainPanel.container,this.dialog)}openAssistant(){return(0,s._)(function*(){if(this.stateManager.isOpen()){this.stateManager.close(),yield this.__closeInContainer();return}yield this.__loadData(),this.isDestructed||(this.stateManager.open(),yield this.__openInContainer(),this.j.o.aiAssistantPro.includeSelectionByDefault&&!this.j.s.isCollapsed()&&this.addCurrentSelectionToContext())}).call(this)}__openInContainer(){return(0,s._)(function*(){let{resizable:e,allowClose:t,flightPanelHeight:u}=this.j.o.aiAssistantPro,{displayMode:s,panelWidth:n,panelHeight:i}=this.stateManager.state;switch(this.__applyTheme(),this.mainPanel.setMod("displayMode",s),this.mainPanel.setMod("allowClose",t),this.mainPanel.setParentView("dialog"===s||"flight"===s?this.dialog:this.j),this.__openedMode=s,s){case"dialog":this.dialog.setSize(n,i).open().setContent(this.mainPanel.container);break;case"flight":B.UIFlightPosition.install(this.mainPanel,this.j.container,{panelHeight:u,containerClassName:this.getFullElName("flight-container")});break;default:e&&(v.UIResize.remove(this.mainPanel),v.UIResize.install(this.mainPanel,(0,p.invertMode)(s),{handleClassName:this.getFullElName("ai-assistent-resize-handle"),onResize:({newSize:e})=>{let t="left"===s||"right"===s?e:n,u="top"===s||"bottom"===s?e:i;return this.stateManager.state.panelWidth=t,this.stateManager.state.panelHeight=u,!0}})),this.j.currentPlace.slots[s].appendChild(this.mainPanel.container),(0,p.resizeInPanelView)(this.j,s,n,i)}}).call(this)}__onResizeInPanelView(){let{displayMode:e,panelWidth:t,panelHeight:u}=this.stateManager.state;(0,p.resizeInPanelView)(this.j,e,t,u)}__closeInContainer(){return(0,s._)(function*(){let{displayMode:e}=yield this.stateManager.state;switch(this.__openedMode!==e&&"dialog"===this.__openedMode&&this.dialog.close(),this.__openedMode!==e&&"flight"===this.__openedMode&&this.__closeFlightMode(),e){case"dialog":this.dialog.close();break;case"flight":this.__closeFlightMode();break;default:this.mainPanel.container.remove()}}).call(this)}__closeFlightMode(){B.UIFlightPosition.remove(this.mainPanel)}__onSavedStateChange(){var e;let t=this.stateManager.state;return this.storage.saveGlobalSettings((0,i._)({displayMode:t.displayMode,panelWidth:t.panelWidth,panelHeight:t.panelHeight,theme:t.theme,defaultModel:t.defaultModel,defaultTemperature:t.defaultTemperature,currentConversationId:null==(e=t.currentConversation)?void 0:e.id},this.j.o.aiAssistantPro.persistOpenState?{isOpen:t.isOpen}:{}))}closeAssistant(){return(0,s._)(function*(){this.stateManager.isOpen()&&(yield this.__loadData(),this.stateManager.close(),this.__closeInContainer())}).call(this)}addCurrentSelectionToContext(){return(0,s._)(function*(){yield this.__loadData();let e=(0,p.getCurrentSelectionContext)(this.j);e&&this.stateManager.addSelectionContext(e)}).call(this)}executeQuickCommand(e){return(0,s._)(function*(){let t,{quickCommandsSilentMode:u,quickCommandsDisplayMode:s}=this.j.o.aiAssistantPro,n=this.j.o.aiAssistant;if(n&&n[e]&&(0,D.isString)(n[e])&&(t=n[e]),!t)return void this.j.e.fire("error",`Command not found: ${e}`);let i=this.j.s.isCollapsed()?this.j.value:this.j.s.html;if(!i)return;let r=(null==n?void 0:n.aiCommonPrefixPrompt)||"",o=(null==n?void 0:n.aiCommonSuffixPrompt)||"",a=`${r}${t}${o}
|
|
8
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var u=t();for(var s in u)("object"==typeof exports?exports:e)[s]=u[s]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[830],{473:function(e,t,u){"use strict";u.d(t,{handleBackToList:function(){return h},handleConversationSearch:function(){return d},handleConversationSelect:function(){return c},handleToolApproval:function(){return a},handleToolDenial:function(){return l}});var s=u(77688),n=u(56075),i=u(11886),r=u(79078),o=u(82758);function a(e,t,u,r,o){return(0,s._)(function*(){let s=u.getPendingToolCalls().find(t=>t.id===e);if(!s)return null;let a=r.grantPermission(s.name,t),l=u.getCurrentConversation();return l&&(l.permissions.push(a),yield o.save(l)),u.removePendingToolCall(e),(0,i._)((0,n._)({},s),{status:"approved"})})()}function l(e,t,u,o){return(0,s._)(function*(){let s=u.getPendingToolCalls().find(e=>e.id===t);if(!s)return;let a=u.getCurrentConversation();if(!a)return;let l=a.messages.findIndex(e=>{var u;return null==(u=e.toolCalls)?void 0:u.find(e=>e.id===t)});if(-1===l)return;let c=a.messages[l],h=(0,i._)((0,n._)({},s),{result:{error:"Tool call denied by user."},status:"denied"}),d=(0,r.updateToolCallInMessage)(c,h),F=[...a.messages];F[l]=d,a=(0,i._)((0,n._)({},a),{messages:F,updated:Date.now()}),u.setCurrentConversation(a),yield o.save(a),e.e.fire("toolCallDenied.ai-assistant-pro",s),u.removePendingToolCall(t)})()}function c(e,t,u){return(0,s._)(function*(){try{u.setLoading(!0);let s=yield t.get(e);if(!s)throw Error("Conversation not found: "+e);u.setCurrentConversation((0,n._)({},s))}catch(e){o.IS_PROD}finally{u.setLoading(!1)}})()}function h(e,t){return(0,s._)(function*(){t.setView("conversationList");try{t.setLoading(!0);let u=yield e.list().catch(()=>[]);t.setConversations(u)}finally{t.setLoading(!1)}})()}function d(e,t,u){return(0,s._)(function*(){u.setLoading(!0);try{let s=yield t.list(e||void 0);u.setConversations(s),u.setView("conversationList")}finally{u.setLoading(!1)}})()}},2020:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(96675),r=u(3091);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},3091:function(e,t,u){"use strict";u.d(t,{execute:function(){return a}});var s=u(77688),n=u(6689),i=u(49459),r=u(44526),o=u(22732);function a(e,t,u){return(0,s._)(function*(){let{index:s,selector:a}=t,l=(0,i.requireString)(t,"html");if((0,n.throwIfAborted)(u),void 0===s&&!a||void 0!==s&&a)throw Error("Either index or selector must be provided, but not both");let{element:c,identifier:h}=(0,r.resolveBlock)(e,{selector:a,index:s,requireExactlyOne:!0});try{var d;let t=e.createInside.div();t.innerHTML=l;let u=t.firstChild;if(!u||!o.Dom.isElement(u))throw Error("Invalid HTML: must contain at least one element");return null==(d=c.parentNode)||d.replaceChild(u,c),e.synchronizeValues(),{success:!0,message:`Block ${h} replaced successfully`}}catch(e){throw Error(`Failed to replace block ${h}: ${e.message}`)}})()}},5618:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(93809),r=u(28157);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},6689:function(e,t,u){"use strict";u.d(t,{throwIfAborted:function(){return n}});var s=u(93661);function n(e){if(e.aborted)throw(0,s.abort)()}},11886:function(e,t,u){"use strict";function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t.push.apply(t,u)}return t})(Object(t)).forEach(function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}),e}u.d(t,{_:function(){return s}})},12570:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(62553),r=u(56293);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},15927:function(e,t,u){"use strict";function s(e){if(e.s.isCollapsed())return null;let t=e.s.html,u=e.s.range;return{html:t,rangeInfo:{startContainer:u.startContainer.nodeName,startOffset:u.startOffset,endContainer:u.endContainer.nodeName,endOffset:u.endOffset}}}u.d(t,{getCurrentSelectionContext:function(){return s}})},16015:function(e,t,u){"use strict";u.d(t,{UIDialogSettings:function(){return d}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(31635),a=u(65478),l=u(67510),c=u(12234),h=u(62357);class d extends l.UIElement{className(){return"UIDialogSettings"}setParentView(e){var t,u;return null==(t=this.modelSelect)||t.setParentView(e),null==(u=this.temperatureInput)||u.setParentView(e),super.setParentView(e)}build(){return(0,s._)(function*(){var e,t,u,s,n;let i=this.container,r=this.getConversation().options||{};if(this.options.dialogSettings.models&&this.options.dialogSettings.models.length>0){let u=this.parseModels(this.options.dialogSettings.models),s=null!=(e=null!=(t=r.model)?t:this.state.defaultModel)?e:u[0].value;this.modelSelect=new c.UISelect(this.j,{label:"Model",name:"model",value:s,options:u,onChange:this.onModelChange.bind(this)}),i.appendChild(this.modelSelect.container)}if(this.options.dialogSettings.temperature){this.temperatureInput=new h.UIRange(this.j,{label:"Temperature",name:"temperature",min:this.options.dialogSettings.temperature.min,max:this.options.dialogSettings.temperature.max,value:null!=(u=null!=(s=r.temperature)?s:this.state.defaultTemperature)?u:.5,onChange:this.onTemperatureChange.bind(this)});let e=this.temperatureInput.nativeInput;e&&e.setAttribute("step",String(null!=(n=this.options.dialogSettings.temperature.step)?n:.1)),i.appendChild(this.temperatureInput.container)}}).call(this)}parseModels(e){return 0===e.length?[]:"object"==typeof e[0]&&"title"in e[0]?e.map(e=>({text:e.title,value:e.value})):e.map(e=>({text:e,value:e}))}onModelChange(){return(0,s._)(function*(){if(!this.modelSelect)return;let e=this.modelSelect.value;this.updateConversation({options:(0,r._)((0,i._)({},this.getConversation().options),{model:e})}),this.state.defaultModel=e}).call(this)}onTemperatureChange(){return(0,s._)(function*(){if(!this.temperatureInput)return;let e=parseFloat(this.temperatureInput.value);this.updateConversation({options:(0,r._)((0,i._)({},this.getConversation().options),{temperature:e})}),this.state.defaultTemperature=e}).call(this)}onDefaultModelChange(){this.modelSelect&&this.state.defaultModel&&(this.modelSelect.value=this.state.defaultModel)}onDefaultTemperatureChange(){this.temperatureInput&&void 0!==this.state.defaultTemperature&&(this.temperatureInput.value=String(this.state.defaultTemperature))}destruct(){var e;null==(e=this.modelSelect)||e.destruct(),super.destruct()}constructor(e,t,u,s,i){super(e),(0,n._)(this,"getConversation",void 0),(0,n._)(this,"updateConversation",void 0),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"modelSelect",void 0),(0,n._)(this,"temperatureInput",void 0),this.getConversation=t,this.updateConversation=u,this.state=s,this.options=i,this.modelSelect=null,this.temperatureInput=null,this.build()}}(0,o.__decorate)([(0,a.watch)("state.defaultModel")],d.prototype,"onDefaultModelChange",null),(0,o.__decorate)([(0,a.watch)("state.defaultTemperature")],d.prototype,"onDefaultTemperatureChange",null),d=(0,o.__decorate)([a.component],d)},16745:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(56732),r=u(39592);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},18549:function(e,t,u){"use strict";u.d(t,{UIFlightPosition:function(){return i}});var s=u(2748);let n=new WeakMap;class i{static install(e,t,u={}){this.remove(e);let{panelHeight:s=250,containerClassName:i,toolbarSelector:r=".jodit-toolbar__box",gap:o=16}=u,a=e.j.c.div("jodit-flight-position");i&&a.classList.add(i),a.style.setProperty("--flight-panel-height",`${s}px`),a.appendChild(e.container),document.body.appendChild(a);let l={toolbarSelector:r,gap:o},c=()=>{this.updatePosition(a,t,l)},h=new ResizeObserver(c);h.observe(t),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c,{passive:!0}),n.set(e,{container:a,anchor:t,onScroll:c,resizeObserver:h,options:l}),this.updatePosition(a,t,l)}static updatePosition(e,t,u){let{toolbarSelector:s,gap:n}=u,i=t.getBoundingClientRect(),r=window.innerHeight,o=e.offsetHeight||250;e.style.left=`${i.left}px`,e.style.width=`${i.width}px`;let a=t.querySelector(s),l=a?a.getBoundingClientRect().bottom:i.top,c=i.bottom-l,h=i.bottom<=r;o<=c?h?(e.style.top="auto",e.style.bottom=`${r-i.bottom+n}px`):(e.style.top="auto",e.style.bottom=`${n}px`):(e.style.bottom="auto",e.style.top=`${l}px`)}static remove(e){let t=n.get(e);if(t){if(window.removeEventListener("scroll",t.onScroll),window.removeEventListener("resize",t.onScroll),t.resizeObserver.disconnect(),e.container.parentNode===t.container){var u;null==(u=t.container.parentNode)||u.insertBefore(e.container,t.container)}s.Dom.safeRemove(t.container),n.delete(e)}}static isInstalled(e){return n.has(e)}static setPanelHeight(e,t){let u=n.get(e);u&&u.container.style.setProperty("--flight-panel-height",`${t}px`)}static refresh(e){let t=n.get(e);t&&this.updatePosition(t.container,t.anchor,t.options)}}},19127:function(e,t,u){"use strict";u.d(t,{execute:function(){return a}});var s=u(77688),n=u(56075),i=u(11886),r=u(6689),o=u(44526);function a(e,t,u){return(0,s._)(function*(){let{element:s,attributes:a,remove:l,blockIndex:c,selector:h}=t;if((0,r.throwIfAborted)(u),!s&&!a)throw Error('Either "element" or "attributes" must be provided');if(e.s.restore(),void 0!==c||h){let{element:t}=(0,o.resolveBlock)(e,{selector:h,index:c});e.s.select(t)}if(e.s.isCollapsed())throw Error("No selection found. Please select text to format");try{let t={};return s&&(t.element=s),a&&(t.attributes=a),l?e.s.commitStyle((0,i._)((0,n._)({},t),{mode:"remove"})):e.s.commitStyle(t),e.synchronizeValues(),{success:!0,message:l?"Formatting removed successfully":"Formatting applied successfully"}}catch(e){throw Error(`Failed to ${l?"remove":"apply"} formatting: ${e.message}`)}})()}},21020:function(e,t,u){"use strict";u.d(t,{PermissionManager:function(){return r}});var s=u(82749),n=u(56075),i=u(11886);class r{requiresPermission(e){let{autoApproveTools:t,alwaysDenyTools:u}=this.jodit.o.aiAssistantPro;if(u.includes(e))return!0;if(t.includes(e))return!1;let s=this.toolRegistry.getTool(e);return!s||s.requiresPermission}isAutoDenied(e){let{alwaysDenyTools:t}=this.jodit.o.aiAssistantPro;return t.includes(e)}isAutoApproved(e){let{autoApproveTools:t}=this.jodit.o.aiAssistantPro;return t.includes(e)}checkPermission(e,t){if(this.isAutoApproved(e))return{toolName:e,granted:!0,grantedAt:Date.now(),scope:"once"};if(this.isAutoDenied(e))return null;let u=this.permanentPermissions.get(e);return u&&u.granted?u:t.find(t=>t.toolName===e&&t.granted)||null}grantPermission(e,t){let u={toolName:e,granted:!0,grantedAt:Date.now(),scope:t};return"forever"===t&&(this.permanentPermissions.set(e,u),this.savePermanentPermissions()),u}denyPermission(e){return{toolName:e,granted:!1,grantedAt:Date.now(),scope:"once"}}filterToolCalls(e,t){let u=[],s=[],r=[];for(let o of e){if(this.isAutoDenied(o.name)){r.push((0,i._)((0,n._)({},o),{status:"denied"}));continue}if(this.isAutoApproved(o.name)){u.push((0,i._)((0,n._)({},o),{status:"approved"}));continue}let e=this.checkPermission(o.name,t);e&&e.granted?u.push((0,i._)((0,n._)({},o),{status:"approved"})):this.requiresPermission(o.name)?(this.jodit.e.fire("permissionRequested.ai-assistant-pro",o.name),s.push((0,i._)((0,n._)({},o),{status:"pending"}))):u.push((0,i._)((0,n._)({},o),{status:"approved"}))}return{approved:u,needsPermission:s,denied:r}}clearConversationPermissions(e){}loadPermanentPermissions(){try{let e=localStorage.getItem(this.PERMANENT_PERMISSIONS_KEY);e&&JSON.parse(e).forEach(e=>{"forever"===e.scope&&e.granted&&this.permanentPermissions.set(e.toolName,e)})}catch(e){}}savePermanentPermissions(){try{let e=Array.from(this.permanentPermissions.values());localStorage.setItem(this.PERMANENT_PERMISSIONS_KEY,JSON.stringify(e))}catch(e){}}clearPermanentPermissions(){this.permanentPermissions.clear(),localStorage.removeItem(this.PERMANENT_PERMISSIONS_KEY)}getPermanentPermissions(){return Array.from(this.permanentPermissions.values())}revokePermanentPermission(e){this.permanentPermissions.delete(e),this.savePermanentPermissions()}destruct(){this.permanentPermissions.clear()}constructor(e,t){(0,s._)(this,"jodit",void 0),(0,s._)(this,"toolRegistry",void 0),(0,s._)(this,"permanentPermissions",void 0),(0,s._)(this,"PERMANENT_PERMISSIONS_KEY",void 0),this.jodit=e,this.toolRegistry=t,this.permanentPermissions=new Map,this.PERMANENT_PERMISSIONS_KEY="jodit-permissions.ai-assistant-pro",this.loadPermanentPermissions()}}},21064:function(e,t,u){"use strict";u.d(t,{WebStorageConversationStorage:function(){return o},createStorageProvider:function(){return a},generateConversationId:function(){return l},generateMessageId:function(){return c}});var s=u(77688),n=u(82749),i=u(56075),r=u(97333);class o{close(){return this.storage.close()}getConversationKey(e){return`conv:${e}`}getAllKeys(){return(0,s._)(function*(){let e=yield this.storage.get("__conversation_index__");return e&&Array.isArray(e)?e:[]}).call(this)}updateIndex(e){return(0,s._)(function*(){yield this.storage.set("__conversation_index__",e)}).call(this)}addToIndex(e){return(0,s._)(function*(){let t=yield this.getAllKeys();t.includes(e)||(t.push(e),yield this.updateIndex(t))}).call(this)}removeFromIndex(e){return(0,s._)(function*(){let t=(yield this.getAllKeys()).filter(t=>t!==e);yield this.updateIndex(t)}).call(this)}list(e){return(0,s._)(function*(){try{let s=yield this.getAllKeys(),n=[],i=null==e?void 0:e.toLowerCase().trim();for(let e of s){var t,u;let s=yield this.get(e);if(s){if(i){let e=null==(u=s.title)?void 0:u.toLowerCase().includes(i),t=!e&&s.messages.some(e=>e.content.toLowerCase().includes(i));if(!e&&!t)continue}n.push({id:s.id,title:null!=(t=s.title)?t:"",created:s.created,updated:s.updated,messageCount:s.messages.length})}}return n.sort((e,t)=>t.updated-e.updated),n}catch(e){return[]}}).call(this)}get(e){return(0,s._)(function*(){try{let t=this.getConversationKey(e);return(yield this.storage.get(t))||null}catch(e){return null}}).call(this)}save(e){return(0,s._)(function*(){try{if(0===e.messages.length)throw Error("Conversation must have at least one message.");let t=yield this.getAllKeys();t.length>=this.maxConversations&&!t.includes(e.id)&&(yield this.evictOldest());let u=this.getConversationKey(e.id);yield this.storage.set(u,e),yield this.addToIndex(e.id)}catch(t){if((null==t?void 0:t.name)==="QuotaExceededError"||(null==t?void 0:t.code)===22||(null==t?void 0:t.code)===1014){yield this.evictOldest();try{let t=this.getConversationKey(e.id);yield this.storage.set(t,e),yield this.addToIndex(e.id)}catch(e){throw Error("Storage quota exceeded. Please delete some conversations.")}}else throw Error(`Failed to save conversation: ${(null==t?void 0:t.message)||"Unknown error"}`)}}).call(this)}delete(e){return(0,s._)(function*(){try{let t=this.getConversationKey(e);yield this.storage.delete(t),yield this.removeFromIndex(e)}catch(e){}}).call(this)}clear(){return(0,s._)(function*(){try{for(let e of yield this.getAllKeys()){let t=this.getConversationKey(e);yield this.storage.delete(t)}yield this.updateIndex([])}catch(e){}}).call(this)}evictOldest(){return(0,s._)(function*(){try{let e=yield this.list();if(0===e.length)return;e.sort((e,t)=>e.updated-t.updated);let t=e[0];yield this.delete(t.id)}catch(e){}}).call(this)}getGlobalSettings(){return(0,s._)(function*(){try{return(yield this.storage.get("global-settings"))||null}catch(e){return null}}).call(this)}saveGlobalSettings(e){return(0,s._)(function*(){try{let t=yield this.getGlobalSettings(),u=(0,i._)({},t,e);yield this.storage.set("global-settings",u)}catch(e){throw Error("Failed to save global settings")}}).call(this)}constructor(e,t){(0,n._)(this,"storage",void 0),(0,n._)(this,"maxConversations",void 0),this.storage=e,this.maxConversations=t}}function a(e,t){return r.AsyncStorage.makeStorage(e,t)}function l(){return`conv_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}function c(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,11)}`}},26612:function(e){e.exports={"AI Assistant":"AI Assistant","AI Assistant Pro":"AI Assistant Pro","Welcome to AI Assistant":"Welcome to AI Assistant","Start your first conversation":"Start your first conversation","Tip: Select text in editor to add context":"Tip: Select text in editor to add context","New Chat":"New Chat","Search conversations...":"Search conversations...","No conversations yet":"No conversations yet","Ask me anything...":"Ask me anything...","Ask a follow-up...":"Ask a follow-up...","Reply...":"Reply...","Type your message...":"Type your message...",Send:"Send",Cancel:"Cancel",Retry:"Retry",Insert:"Insert",Copy:"Copy",Edit:"Edit",Delete:"Delete",New:"New",Back:"Back","Permission Required":"Permission Required",Approve:"Approve",Deny:"Deny",Once:"Once","This conversation":"This conversation",Always:"Always","The AI wants to execute:":"The AI wants to execute:","This will modify your document content.":"This will modify your document content.","Executing...":"Executing...","Completed successfully":"Completed successfully",Failed:"Failed","Pending approval":"Pending approval","Denied by user":"Denied by user","Tool Result":"Tool Result","Tool Execution Error":"Tool Execution Error",Context:"Context",Contexts:"Contexts","Add to AI Context":"Add to AI Context",Remove:"Remove","Clear all":"Clear all","An error occurred":"An error occurred","Request failed":"Request failed","Connection error":"Connection error","AI Assistant is not configured":"AI Assistant is not configured","Thinking...":"Thinking...","Generating response...":"Generating response...",insertHTML:"Insert HTML",readDocument:"Read Document",readBlock:"Read Block",replaceInDocument:"Replace in Document",replaceInBlock:"Replace in Block",getSelection:"Get Selection","Just now":"Just now",Conversation:"Conversation","New Conversation":"New Conversation",Yesterday:"Yesterday","Delete conversation":"Delete conversation","Are you sure you want to delete this conversation?":"Are you sure you want to delete this conversation?","Failed to delete conversation":"Failed to delete conversation"}},27769:function(e,t,u){"use strict";u.d(t,{UIMainPanel:function(){return s.UIMainPanel}});var s=u(51251)},28157:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(22732);function r(e,t,u){return(0,s._)(function*(){let{start:s,end:r,aroundSelection:o}=t;(0,n.throwIfAborted)(u);let a=e.value,l=a.length;if(o&&!e.s.isCollapsed()){let t=e.s.range.commonAncestorContainer;for(;t&&t!==e.editor;){if(i.Dom.isElement(t)&&t.parentNode===e.editor){a=t.outerHTML;break}t=t.parentNode}return{html:a,length:l}}let c=void 0!==r?Math.min(r,l):l,h=Math.max(0,Math.min("number"==typeof s?s:0,l));return(h>0||l>c)&&(a=a.substring(h,c)),{html:a,length:l,start:h,end:c}})()}},36142:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html"),{collapseToEnd:r}=t;(0,n.throwIfAborted)(u);try{if(e.s.restore(),e.s.insertHTML(s),r){let t=e.s.range;t.collapse(!1),e.s.selectRange(t)}return e.e.fire("change"),{success:!0,message:"Selection replaced successfully"}}catch(e){throw Error(`Failed to replace selection: ${e.message}`)}})()}},39296:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(73943),r=u(19127);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},39592:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html",{allowEmpty:!0}),{replace:r}=t;if(!s.trim())return{success:!0,message:"Nothing to insert: HTML is empty"};(0,n.throwIfAborted)(u);try{return e.s.focus(),r&&!e.s.isCollapsed()&&e.s.remove(),e.s.insertHTML(s),e.synchronizeValues(),{success:!0,message:`Inserted ${s.length} characters of HTML`}}catch(e){throw Error(`Failed to insert HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}})()}},41810:function(e,t,u){"use strict";u.r(t),u.d(t,{aiAssistantPro:function(){return y}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(31635);u(66645);var a=u(86449),l=u(21020),c=u(46166),h=u(62895),d=u(55487),F=u(27769),p=u(58579),A=u(63805),C=u(82758),g=u(65478),E=u(580),D=u(21537),f=u(50911),m=u(2692),B=u(18549),v=u(54747);class y extends f.Plugin{get state(){return this.stateManager.state}get toolRegistry(){return new d.ToolRegistry(this.j)}get permissionManager(){return new l.PermissionManager(this.j,this.toolRegistry)}get apiClient(){return new a.APIClient(this.j,this.toolRegistry)}get storage(){let{storage:e,storageKey:t,maxConversations:u}=this.j.o.aiAssistantPro;if("string"==typeof e){let s=(0,h.createStorageProvider)(e,t);return new h.WebStorageConversationStorage(s,u)}return e}get stateManager(){return new c.StateManager(this.j)}get mainPanel(){return new F.UIMainPanel(this.j,this.stateManager.state,this.j.o.aiAssistantPro,e=>{let t=this.stateManager.getCurrentConversation();t&&this.stateManager.setCurrentConversation((0,i._)({},t,e))})}get dialog(){let e=this.j.dlg({resizable:this.j.o.aiAssistantPro.resizable,eventEmmiter:this.j.e});return e.e.on(e,"afterClose",()=>{this.j.e.fire("closeAIAssistantPro.ai-assistant-pro")}),e}afterInit(){(0,E.extendLang)(A),this.setupEventListeners(),this.j.async.promise(e=>{let{initiallyOpened:t,persistOpenState:u}=this.j.o.aiAssistantPro,s=t;u?this.storage.getGlobalSettings().then(e=>{if((null==e?void 0:e.isOpen)!=null&&(s=e.isOpen),s)return this.openAssistant()}).catch(()=>null).finally(()=>e(void 0)):e(void 0)}).catch(()=>null)}__loadData(){return this.__initedPromise?this.__initedPromise:this.isDestructed?Promise.reject():(this.__initedPromise=this.j.async.promise(e=>{this.loadInitialData().then(e)}).catch(()=>null),this.__initedPromise)}loadInitialData(){return(0,s._)(function*(){this.mainPanel.setMod("ready",!0),yield(0,p.loadInitialData)(this.j,this.storage,this.stateManager)}).call(this)}setupEventListeners(){this.j.e.on("selectConversation.ai-assistant-pro",e=>(0,s._)(function*(){try{yield this.__loadData(),yield(0,p.handleConversationSelect)(e,this.storage,this.stateManager)}catch(e){C.IS_PROD}}).call(this)),this.j.e.on("newConversation.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData();let e=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature);this.stateManager.setCurrentConversation(e)}).call(this)),this.j.e.on("deleteConversation.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),yield this.deleteConversation(e)}).call(this)),this.j.e.on("backToList.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleBackToList)(this.storage,this.stateManager)}).call(this)),this.j.e.on("removeContext.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),this.stateManager.removeSelectionContext(e)}).call(this)),this.j.e.on("approveToolCall.ai-assistant-pro",(e,t)=>(0,s._)(function*(){try{yield this.__loadData();let u=yield(0,p.handleToolApproval)(e,t,this.stateManager,this.permissionManager,this.storage);if(u){let e=this.stateManager.getCurrentConversation();if(!e)return;let t=e.messages.find(e=>{var t;return null==(t=e.toolCalls)?void 0:t.some(e=>e.id===u.id)});if(!t)return;yield this.executeToolCall(t.id,u)}}catch(e){if((0,D.isAbortError)(e))return;this.stateManager.setError(e instanceof Error?e.message:String(e))}}).call(this)),this.j.e.on("denyToolCall.ai-assistant-pro",e=>(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleToolDenial)(this.j,e,this.stateManager,this.storage)}).call(this)),this.j.e.on("abortRequest.ai-assistant-pro",()=>(0,s._)(function*(){yield this.__loadData(),this.apiClient.abort(),this.stateManager.setLoading(!1)}).call(this))}__applyTheme(){(0,p.applyTheme)(this.j,this.stateManager.state.theme,this.stateManager.state.displayMode,this.mainPanel.container,this.dialog)}openAssistant(){return(0,s._)(function*(){if(this.stateManager.isOpen()){this.stateManager.close(),yield this.__closeInContainer();return}yield this.__loadData(),this.isDestructed||(this.stateManager.open(),yield this.__openInContainer(),this.j.o.aiAssistantPro.includeSelectionByDefault&&!this.j.s.isCollapsed()&&this.addCurrentSelectionToContext())}).call(this)}__openInContainer(){return(0,s._)(function*(){let{resizable:e,allowClose:t,flightPanelHeight:u}=this.j.o.aiAssistantPro,{displayMode:s="right",panelWidth:n,panelHeight:i}=this.stateManager.state;switch(this.__applyTheme(),this.mainPanel.setMod("displayMode",s),this.mainPanel.setMod("allowClose",t),this.mainPanel.setParentView("dialog"===s||"flight"===s?this.dialog:this.j),this.__openedMode=s,s){case"dialog":this.dialog.setSize(n,i).open().setContent(this.mainPanel.container);break;case"flight":B.UIFlightPosition.install(this.mainPanel,this.j.container,{panelHeight:u,containerClassName:this.getFullElName("flight-container")});break;default:e&&(v.UIResize.remove(this.mainPanel),v.UIResize.install(this.mainPanel,(0,p.invertMode)(s),{handleClassName:this.getFullElName("ai-assistent-resize-handle"),onResize:({newSize:e})=>{let t="left"===s||"right"===s?e:n,u="top"===s||"bottom"===s?e:i;return this.stateManager.state.panelWidth=t,this.stateManager.state.panelHeight=u,!0}})),this.j.currentPlace.slots[s].appendChild(this.mainPanel.container),(0,p.resizeInPanelView)(this.j,s,n,i)}}).call(this)}__onResizeInPanelView(){let{displayMode:e,panelWidth:t,panelHeight:u}=this.stateManager.state;(0,p.resizeInPanelView)(this.j,e,t,u)}__closeInContainer(){return(0,s._)(function*(){let{displayMode:e}=yield this.stateManager.state;switch(this.__openedMode!==e&&"dialog"===this.__openedMode&&this.dialog.close(),this.__openedMode!==e&&"flight"===this.__openedMode&&this.__closeFlightMode(),e){case"dialog":this.dialog.close();break;case"flight":this.__closeFlightMode();break;default:this.mainPanel.container.remove()}}).call(this)}__closeFlightMode(){B.UIFlightPosition.remove(this.mainPanel)}__onSavedStateChange(){var e;let t=this.stateManager.state;return this.storage.saveGlobalSettings((0,i._)({displayMode:t.displayMode,panelWidth:t.panelWidth,panelHeight:t.panelHeight,theme:t.theme,defaultModel:t.defaultModel,defaultTemperature:t.defaultTemperature,currentConversationId:null==(e=t.currentConversation)?void 0:e.id},this.j.o.aiAssistantPro.persistOpenState?{isOpen:t.isOpen}:{}))}closeAssistant(){return(0,s._)(function*(){this.stateManager.isOpen()&&(yield this.__loadData(),this.stateManager.close(),this.__closeInContainer())}).call(this)}addCurrentSelectionToContext(){return(0,s._)(function*(){yield this.__loadData();let e=(0,p.getCurrentSelectionContext)(this.j);e&&this.stateManager.addSelectionContext(e)}).call(this)}executeQuickCommand(e){return(0,s._)(function*(){let t,{quickCommandsSilentMode:u,quickCommandsDisplayMode:s}=this.j.o.aiAssistantPro,n=this.j.o.aiAssistant;if(n&&n[e]&&(0,D.isString)(n[e])&&(t=n[e]),!t)return void this.j.e.fire("error",`Command not found: ${e}`);let i=this.j.s.isCollapsed()?this.j.value:this.j.s.html;if(!i)return;let r=(null==n?void 0:n.aiCommonPrefixPrompt)||"",o=(null==n?void 0:n.aiCommonSuffixPrompt)||"",a=`${r}${t}${o}
|
|
9
9
|
|
|
10
|
-
${i}`.trim();u?yield this.__executeQuickCommandSilent(a,i):yield this.__executeQuickCommandWithPanel(a,s)}).call(this)}__executeQuickCommandSilent(e,t){return(0,s._)(function*(){yield this.__loadData(),this.j.progressbar.show().progress(100);try{let t=(0,p.createUserMessage)(e),u=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature,[t]),s=yield this.apiClient.sendRequest(u.id,u.messages,null,[],u.options);if("final"===s.mode){let e=s.response.content;e&&this.j.s.insertHTML(e)}}catch(e){(0,D.isAbortError)(e)||this.j.e.fire("error",e)}finally{this.j.progressbar.hide()}}).call(this)}__executeQuickCommandWithPanel(e,t){return(0,s._)(function*(){yield this.__loadData();let u=this.stateManager.state.displayMode;this.stateManager.state.displayMode=t;let s=(0,p.getCurrentSelectionContext)(this.j);s&&this.stateManager.addSelectionContext(s),this.stateManager.isOpen()||(yield this.openAssistant()),yield this.sendMessage(e),this.stateManager.state.displayMode=u}).call(this)}sendMessage(e){return(0,s._)(function*(){yield this.__loadData();let t=this.stateManager.getCurrentConversation(),u=this.stateManager.getEditingMessageId();if(u&&t){let e=t.messages.findIndex(e=>e.id===u);if(-1!==e){let u=t.messages.slice(0,e),s=(0,r._)((0,i._)({},t),{messages:u,updatedAt:Date.now()});this.stateManager.setCurrentConversation(s),yield this.storage.save(s),this.stateManager.clearEditingMessage(),t=s}}t||(t=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature),this.stateManager.setCurrentConversation(t));let s=null;e.trim()&&(s=(0,p.createUserMessage)(e),t.title||(t=(0,r._)((0,i._)({},t),{title:e})),t=(0,r._)((0,i._)({},t),{updated:Date.now(),messages:[...t.messages,s]})),this.stateManager.setCurrentConversation((0,i._)({},t)),s&&this.j.e.fire("messageSent.ai-assistant-pro",s),this.stateManager.setLoading(!0),this.stateManager.clearError();try{yield this.sendRequestToAI(0),this.stateManager.clearSelectionContexts()}catch(e){if((0,D.isAbortError)(e))return;this.stateManager.setError(e instanceof Error?e.message:String(e))}finally{this.stateManager.setLoading(!1)}}).call(this)}sendRequestToAI(e=0){return(0,s._)(function*(){let t,u,s=this.j.o.aiAssistantPro.maxRecursionToolCallDepth;if(e>=s)throw Error(`Max recursion depth ${s} reached for tool calls`);let n=this.stateManager.getCurrentConversation();if(!n)return;let r=(0,p.findParentMessageId)(n),[o]=yield Promise.all([this.apiClient.sendRequest(n.id,n.messages,r,this.stateManager.getSelectionContexts(),n.options),this.storage.save(n)]);if("stream"===o.mode){let e=yield(0,p.processStreamingResponse)(this.stateManager,o,n);t=e.aiMessage,u=e.index,n=e.conversation}else{let e=(0,p.processFinalResponse)(o,n);t=e.aiMessage,u=e.index,n=e.conversation}n=yield(0,p.processArtifacts)(this.j,t,n,u),this.j.e.fire("messageReceived.ai-assistant-pro",t),this.stateManager.setCurrentConversation((0,i._)({},n)),yield this.storage.save(n),yield this.handleToolCalls(t.id,e)}).call(this)}deleteConversation(e){return(0,s._)(function*(){yield this.__loadData(),yield(0,p.deleteConversationWithCleanup)(this.j,e,this.storage,this.stateManager,this.permissionManager)}).call(this)}searchConversations(e){return(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleConversationSearch)(e,this.storage,this.stateManager)}).call(this)}handleToolCalls(e,t=0){return(0,s._)(function*(){let u=this.stateManager.getCurrentConversation();if(!u)return;let s=u.messages.find(t=>t.id===e);if(!s)return;let n=s.toolCalls;if(!n||0===n.length)return;yield this.__loadData();let{approved:i,needsPermission:r}=this.permissionManager.filterToolCalls(n,u.permissions);for(let u of(this.stateManager.setPendingToolCalls(r),i))yield this.executeToolCall(e,u,t)}).call(this)}executeToolCall(e,t,u=0){return(0,s._)(function*(){yield this.__loadData();let s=this.stateManager.getCurrentConversation();if(!s)return;let n=yield(0,p.executeToolCall)(this.j,t,this.toolRegistry),o=s.messages.findIndex(t=>t.id===e);if(-1===o)return;let a=s.messages[o],l=s.messages.slice();l[o]=(0,p.updateToolCallInMessage)(a,n),s=(0,r._)((0,i._)({},s),{messages:l,updated:Date.now()}),this.stateManager.setCurrentConversation(s),(0,p.areAllToolCallsExecuted)(s)&&(yield this.sendRequestToAI(u+1))}).call(this)}copyMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.find(t=>t.id===e);if(u)try{yield navigator.clipboard.writeText(u.content),this.j.message.success("Message copied to clipboard")}catch(e){this.j.e.fire("error",Error("Failed to copy message"))}}).call(this)}restartFromMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.findIndex(t=>t.id===e);if(-1===u)return;let s=t.messages[u];if("user"!==s.role)return;yield this.__loadData();let n=t.messages.slice(0,u),o=(0,r._)((0,i._)({},t),{messages:n,updatedAt:Date.now()});this.stateManager.setCurrentConversation(o),yield this.storage.save(o),yield this.sendMessage(s.content)}).call(this)}editMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.find(t=>t.id===e);u&&"user"===u.role&&(this.stateManager.setEditingMessageId(e),this.mainPanel.inputArea.setValue(u.content),this.mainPanel.inputArea.focus())}).call(this)}cancelEditMessage(){this.stateManager.isEditingMessage()&&(this.stateManager.clearEditingMessage(),this.mainPanel.inputArea.setValue(""))}deleteMessage(e){return(0,s._)(function*(){yield this.__loadData();let t=this.stateManager.getCurrentConversation();if(!t||-1===t.messages.findIndex(t=>t.id===e))return;let u=t.messages.filter(t=>t.id!==e),s=(0,r._)((0,i._)({},t),{messages:u,updatedAt:Date.now()});this.stateManager.setCurrentConversation(s),yield this.storage.save(s)}).call(this)}beforeDestruct(){var e,t,u,s,n,i,r,o;this.__closeFlightMode(),null==(e=(0,g.cached)(this,"toolRegistry"))||e.destruct(),null==(t=(0,g.cached)(this,"permissionManager"))||t.destruct(),null==(u=(0,g.cached)(this,"apiClient"))||u.destruct(),null==(s=(0,g.cached)(this,"stateManager"))||s.destruct(),null==(n=(0,g.cached)(this,"mainPanel"))||n.destruct(),null==(i=(0,g.cached)(this,"dialog"))||i.destruct(),null==(o=(0,g.cached)(this,"storage"))||null==(r=o.close)||r.call(o)}constructor(...e){super(...e),(0,n._)(this,"buttons",[{name:"aiAssistantPro",group:"insert"},{name:"aiCommandsPro",group:"insert"}]),(0,n._)(this,"__initedPromise",null),(0,n._)(this,"__openedMode",null)}}(0,n._)(y,"requires",["license"]),(0,o.__decorate)([g.cache],y.prototype,"toolRegistry",null),(0,o.__decorate)([g.cache],y.prototype,"permissionManager",null),(0,o.__decorate)([g.cache],y.prototype,"apiClient",null),(0,o.__decorate)([g.cache],y.prototype,"storage",null),(0,o.__decorate)([g.cache],y.prototype,"stateManager",null),(0,o.__decorate)([g.cache],y.prototype,"mainPanel",null),(0,o.__decorate)([g.cache],y.prototype,"dialog",null),(0,o.__decorate)([(0,g.watch)("state.theme")],y.prototype,"__applyTheme",null),(0,o.__decorate)([(0,g.watch)(":openAIAssistantPro.ai-assistant-pro")],y.prototype,"openAssistant",null),(0,o.__decorate)([(0,g.watch)(["state.panelWidth","state.panelHeight"])],y.prototype,"__onResizeInPanelView",null),(0,o.__decorate)([(0,g.watch)(["state.isOpen","state.displayMode","state.panelWidth","state.panelHeight","state.theme","state.defaultModel","state.defaultTemperature","state.currentConversation"]),(0,g.debounce)()],y.prototype,"__onSavedStateChange",null),(0,o.__decorate)([(0,g.watch)(":closeAIAssistantPro.ai-assistant-pro")],y.prototype,"closeAssistant",null),(0,o.__decorate)([(0,g.watch)(":addContextToAIAssistant.ai-assistant-pro")],y.prototype,"addCurrentSelectionToContext",null),(0,o.__decorate)([(0,g.watch)(":executeQuickCommand.ai-assistant-pro")],y.prototype,"executeQuickCommand",null),(0,o.__decorate)([(0,g.watch)(":sendMessage.ai-assistant-pro")],y.prototype,"sendMessage",null),(0,o.__decorate)([(0,g.watch)(":searchConversations.ai-assistant-pro")],y.prototype,"searchConversations",null),(0,o.__decorate)([(0,g.watch)(":copyMessage.ai-assistant-pro")],y.prototype,"copyMessage",null),(0,o.__decorate)([(0,g.watch)(":restartFromMessage.ai-assistant-pro")],y.prototype,"restartFromMessage",null),(0,o.__decorate)([(0,g.watch)(":editMessage.ai-assistant-pro")],y.prototype,"editMessage",null),(0,o.__decorate)([(0,g.watch)(":cancelEditMessage.ai-assistant-pro")],y.prototype,"cancelEditMessage",null),(0,o.__decorate)([(0,g.watch)(":deleteMessage.ai-assistant-pro")],y.prototype,"deleteMessage",null),y=(0,o.__decorate)([g.component],y),m.JoditPro.plugins.add("aiAssistantPro",y)},44526:function(e,t,u){"use strict";u.d(t,{resolveBlock:function(){return n}});var s=u(22732);function n(e,{selector:t,index:u,requireExactlyOne:i=!1}={}){let r=null!=t,o=null!=u;if(i&&r===o)throw Error("Either index or selector must be provided, but not both");if(!r&&!o)throw Error("Block identifier is required");if(r){if("string"!=typeof t)throw Error("Selector must be a string");let u=e.editor.querySelector(t);if(!u)throw Error(`No element found matching selector "${t}"`);if(!s.Dom.isElement(u))throw Error(`Selector "${t}" does not point to an element node`);return{element:u,identifier:`with selector "${t}"`}}if("number"!=typeof u)throw Error("Block index must be a number");let a=Array.from(e.editor.children);if(u<0||u>=a.length)throw Error(`Block index ${u} is out of range. Document has ${a.length} blocks`);let l=a[u];if(!s.Dom.isElement(l))throw Error(`Block at index ${u} is not a valid element`);return{element:l,identifier:`at index ${u}`}}},46166:function(e,t,u){"use strict";u.d(t,{StateManager:function(){return r}});var s=u(82749),n=u(56075),i=u(11886);class r{createInitialState(){return{isOpen:!1,currentView:"welcome",currentConversation:null,conversations:[],isLoading:!1,error:null,pendingToolCalls:[],selectionContexts:[],abortController:null,editingMessageId:null,theme:this.jodit.o.aiAssistantPro.theme||"parent",displayMode:this.jodit.o.aiAssistantPro.displayMode,panelWidth:this.jodit.o.aiAssistantPro.panelWidth,panelHeight:this.jodit.o.aiAssistantPro.panelHeight,defaultModel:this.jodit.o.aiAssistantPro.defaultModel,defaultTemperature:this.jodit.o.aiAssistantPro.defaultTemperature}}open(){this.state.isOpen=!0,this.jodit.e.fire("open.ai-assistant-pro",this.state.currentConversation)}close(){this.state.isOpen=!1,this.jodit.e.fire("close.ai-assistant-pro")}isOpen(){return this.state.isOpen}setView(e){this.state.currentView=e,this.jodit.e.fire("viewChanged.ai-assistant-pro",e)}getView(){return this.state.currentView}setConversations(e){this.state.conversations=e}setSavedState(e){e.theme&&(this.state.theme=e.theme),e.displayMode&&(this.state.displayMode=e.displayMode),e.panelWidth&&(this.state.panelWidth=e.panelWidth),e.panelHeight&&(this.state.panelHeight=e.panelHeight),e.defaultModel&&(this.state.defaultModel=e.defaultModel),e.defaultTemperature&&(this.state.defaultTemperature=e.defaultTemperature)}getConversations(){return this.state.conversations}setCurrentConversation(e){if(this.state.currentConversation===e)throw Error("Conversation is already current");this.state.currentConversation=e||null,e&&(this.setView("conversation"),this.jodit.e.fire("conversationSwitched.ai-assistant-pro",e))}getCurrentConversation(){return this.state.currentConversation}removeConversation(e){let t=this.state.conversations.filter(t=>t.id!==e);this.setConversations(t)}setLoading(e){this.state.isLoading=e}isLoading(){return this.state.isLoading}setError(e){this.state.error=e,e&&this.jodit.e.fire("error.ai-assistant-pro",Error(e))}getError(){return this.state.error}clearError(){this.setError(null)}setPendingToolCalls(e){this.state.pendingToolCalls=e}getPendingToolCalls(){return this.state.pendingToolCalls}addPendingToolCall(e){let t=[...this.state.pendingToolCalls,e];this.setPendingToolCalls(t)}removePendingToolCall(e){let t=this.state.pendingToolCalls.filter(t=>t.id!==e);this.setPendingToolCalls(t)}updateToolCallStatus(e,t){let u=this.state.pendingToolCalls.map(u=>u.id===e?(0,i._)((0,n._)({},u),{status:t}):u);this.setPendingToolCalls(u)}setSelectionContexts(e){this.state.selectionContexts=e}getSelectionContexts(){return this.state.selectionContexts}addSelectionContext(e){let{maxContextRanges:t}=this.jodit.o.aiAssistantPro,u=[...this.state.selectionContexts,e];u.length>t&&(u=u.slice(-t)),this.setSelectionContexts(u),this.jodit.e.fire("contextAdded.ai-assistant-pro",e)}removeSelectionContext(e){let t=this.state.selectionContexts.filter((t,u)=>u!==e);this.setSelectionContexts(t),this.jodit.e.fire("contextRemoved.ai-assistant-pro",e)}clearSelectionContexts(){this.setSelectionContexts([])}setAbortController(e){this.state.abortController=e}getAbortController(){return this.state.abortController}setEditingMessageId(e){this.state.editingMessageId=e}getEditingMessageId(){return this.state.editingMessageId}isEditingMessage(){return null!=this.state.editingMessageId}clearEditingMessage(){this.setEditingMessageId(null)}reset(){this.state=this.createInitialState()}destruct(){this.state.abortController&&this.state.abortController.abort(),this.reset()}constructor(e){(0,s._)(this,"jodit",void 0),(0,s._)(this,"state",void 0),this.jodit=e,this.state=this.createInitialState()}}},47373:function(e,t,u){"use strict";function s(e,t,u="image/png"){let n=atob(e),i=n.length,r=new Uint8Array(i);for(let e=0;i>e;e++)r[e]=n.charCodeAt(e);return new File([new Blob([r],{type:u})],t,{type:u})}u.d(t,{base64ToFile:function(){return s}})},48705:function(e,t,u){"use strict";u.d(t,{UISettingsButton:function(){return s.UISettingsButton}});var s=u(76697)},49459:function(e,t,u){"use strict";function s(e,t,u={}){let n=e[t];if("string"!=typeof n||!u.allowEmpty&&""===n)throw Error(`Parameter "${t}" is required and must be a${u.allowEmpty?"":" non-empty"} string`);return n}u.d(t,{requireString:function(){return s}})},51251:function(e,t,u){"use strict";u.d(t,{UIMainPanel:function(){return C}});var s=u(77688),n=u(82749),i=u(31635),r=u(68365),o=u(63227),a=u(86563),l=u(93677),c=u(48705),h=u(55885),d=u(65478),F=u(2748),p=u(67510),A=u(62843);class C extends p.UIElement{className(){return"UIMainPanel"}setParentView(e){var t,u,s,n,i,r;return null==(t=this.welcomeScreen)||t.setParentView(e),null==(u=this.conversationList)||u.setParentView(e),null==(s=this.messageList)||s.setParentView(e),null==(n=this.inputArea)||n.setParentView(e),null==(i=this.permissionRequest)||i.setParentView(e),null==(r=this.settingsButton)||r.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
10
|
+
${i}`.trim();u?yield this.__executeQuickCommandSilent(a,i):yield this.__executeQuickCommandWithPanel(a,s)}).call(this)}__executeQuickCommandSilent(e,t){return(0,s._)(function*(){yield this.__loadData(),this.j.progressbar.show().progress(100);try{let t=(0,p.createUserMessage)(e),u=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature,[t]),s=yield this.apiClient.sendRequest(u.id,u.messages,null,[],u.options);if("final"===s.mode){let e=s.response.content;e&&this.j.s.insertHTML(e)}}catch(e){(0,D.isAbortError)(e)||this.j.e.fire("error",e)}finally{this.j.progressbar.hide()}}).call(this)}__executeQuickCommandWithPanel(e,t){return(0,s._)(function*(){yield this.__loadData();let u=this.stateManager.state.displayMode;this.stateManager.state.displayMode=t;let s=(0,p.getCurrentSelectionContext)(this.j);s&&this.stateManager.addSelectionContext(s),this.stateManager.isOpen()||(yield this.openAssistant()),yield this.sendMessage(e),this.stateManager.state.displayMode=u}).call(this)}sendMessage(e){return(0,s._)(function*(){yield this.__loadData();let t=this.stateManager.getCurrentConversation(),u=this.stateManager.getEditingMessageId();if(u&&t){let e=t.messages.findIndex(e=>e.id===u);if(-1!==e){let u=t.messages.slice(0,e),s=(0,r._)((0,i._)({},t),{messages:u,updatedAt:Date.now()});this.stateManager.setCurrentConversation(s),yield this.storage.save(s),this.stateManager.clearEditingMessage(),t=s}}t||(t=(0,p.createNewConversation)(this.j,this.state.defaultModel,this.state.defaultTemperature),this.stateManager.setCurrentConversation(t));let s=null;e.trim()&&(s=(0,p.createUserMessage)(e),t.title||(t=(0,r._)((0,i._)({},t),{title:e})),t=(0,r._)((0,i._)({},t),{updated:Date.now(),messages:[...t.messages,s]})),this.stateManager.setCurrentConversation((0,i._)({},t)),s&&this.j.e.fire("messageSent.ai-assistant-pro",s),this.stateManager.setLoading(!0),this.stateManager.clearError();try{yield this.sendRequestToAI(0),this.stateManager.clearSelectionContexts()}catch(e){if((0,D.isAbortError)(e))return;this.stateManager.setError(e instanceof Error?e.message:String(e))}finally{this.stateManager.setLoading(!1)}}).call(this)}sendRequestToAI(e=0){return(0,s._)(function*(){let t,u,s=this.j.o.aiAssistantPro.maxRecursionToolCallDepth;if(e>=s)throw Error(`Max recursion depth ${s} reached for tool calls`);let n=this.stateManager.getCurrentConversation();if(!n)return;let r=(0,p.findParentMessageId)(n),[o]=yield Promise.all([this.apiClient.sendRequest(n.id,n.messages,r,this.stateManager.getSelectionContexts(),n.options),this.storage.save(n)]);if("stream"===o.mode){let e=yield(0,p.processStreamingResponse)(this.stateManager,o,n);t=e.aiMessage,u=e.index,n=e.conversation}else{let e=(0,p.processFinalResponse)(o,n);t=e.aiMessage,u=e.index,n=e.conversation}n=yield(0,p.processArtifacts)(this.j,t,n,u),this.j.e.fire("messageReceived.ai-assistant-pro",t),this.stateManager.setCurrentConversation((0,i._)({},n)),yield this.storage.save(n),yield this.handleToolCalls(t.id,e)}).call(this)}deleteConversation(e){return(0,s._)(function*(){yield this.__loadData(),yield(0,p.deleteConversationWithCleanup)(this.j,e,this.storage,this.stateManager,this.permissionManager)}).call(this)}searchConversations(e){return(0,s._)(function*(){yield this.__loadData(),yield(0,p.handleConversationSearch)(e,this.storage,this.stateManager)}).call(this)}handleToolCalls(e,t=0){return(0,s._)(function*(){let u=this.stateManager.getCurrentConversation();if(!u)return;let s=u.messages.find(t=>t.id===e);if(!s)return;let n=s.toolCalls;if(!n||0===n.length)return;yield this.__loadData();let{approved:i,needsPermission:r}=this.permissionManager.filterToolCalls(n,u.permissions);for(let u of(this.stateManager.setPendingToolCalls(r),i))yield this.executeToolCall(e,u,t)}).call(this)}executeToolCall(e,t,u=0){return(0,s._)(function*(){yield this.__loadData();let s=this.stateManager.getCurrentConversation();if(!s)return;let n=yield(0,p.executeToolCall)(this.j,t,this.toolRegistry),o=s.messages.findIndex(t=>t.id===e);if(-1===o)return;let a=s.messages[o],l=s.messages.slice();l[o]=(0,p.updateToolCallInMessage)(a,n),s=(0,r._)((0,i._)({},s),{messages:l,updated:Date.now()}),this.stateManager.setCurrentConversation(s),(0,p.areAllToolCallsExecuted)(s)&&(yield this.sendRequestToAI(u+1))}).call(this)}copyMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.find(t=>t.id===e);if(u)try{yield navigator.clipboard.writeText(u.content),this.j.message.success("Message copied to clipboard")}catch(e){this.j.e.fire("error",Error("Failed to copy message"))}}).call(this)}restartFromMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.findIndex(t=>t.id===e);if(-1===u)return;let s=t.messages[u];if("user"!==s.role)return;yield this.__loadData();let n=t.messages.slice(0,u),o=(0,r._)((0,i._)({},t),{messages:n,updatedAt:Date.now()});this.stateManager.setCurrentConversation(o),yield this.storage.save(o),yield this.sendMessage(s.content)}).call(this)}editMessage(e){return(0,s._)(function*(){let t=this.stateManager.getCurrentConversation();if(!t)return;let u=t.messages.find(t=>t.id===e);u&&"user"===u.role&&(this.stateManager.setEditingMessageId(e),this.mainPanel.inputArea.setValue(u.content),this.mainPanel.inputArea.focus())}).call(this)}cancelEditMessage(){this.stateManager.isEditingMessage()&&(this.stateManager.clearEditingMessage(),this.mainPanel.inputArea.setValue(""))}deleteMessage(e){return(0,s._)(function*(){yield this.__loadData();let t=this.stateManager.getCurrentConversation();if(!t||-1===t.messages.findIndex(t=>t.id===e))return;let u=t.messages.filter(t=>t.id!==e),s=(0,r._)((0,i._)({},t),{messages:u,updatedAt:Date.now()});this.stateManager.setCurrentConversation(s),yield this.storage.save(s)}).call(this)}beforeDestruct(){var e,t,u,s,n,i,r,o;this.__closeFlightMode(),null==(e=(0,g.cached)(this,"toolRegistry"))||e.destruct(),null==(t=(0,g.cached)(this,"permissionManager"))||t.destruct(),null==(u=(0,g.cached)(this,"apiClient"))||u.destruct(),null==(s=(0,g.cached)(this,"stateManager"))||s.destruct(),null==(n=(0,g.cached)(this,"mainPanel"))||n.destruct(),null==(i=(0,g.cached)(this,"dialog"))||i.destruct(),null==(o=(0,g.cached)(this,"storage"))||null==(r=o.close)||r.call(o)}constructor(...e){super(...e),(0,n._)(this,"buttons",[{name:"aiAssistantPro",group:"insert"},{name:"aiCommandsPro",group:"insert"}]),(0,n._)(this,"__initedPromise",null),(0,n._)(this,"__openedMode",null)}}(0,n._)(y,"requires",["license"]),(0,o.__decorate)([g.cache],y.prototype,"toolRegistry",null),(0,o.__decorate)([g.cache],y.prototype,"permissionManager",null),(0,o.__decorate)([g.cache],y.prototype,"apiClient",null),(0,o.__decorate)([g.cache],y.prototype,"storage",null),(0,o.__decorate)([g.cache],y.prototype,"stateManager",null),(0,o.__decorate)([g.cache],y.prototype,"mainPanel",null),(0,o.__decorate)([g.cache],y.prototype,"dialog",null),(0,o.__decorate)([(0,g.watch)("state.theme")],y.prototype,"__applyTheme",null),(0,o.__decorate)([(0,g.watch)(":openAIAssistantPro.ai-assistant-pro")],y.prototype,"openAssistant",null),(0,o.__decorate)([(0,g.watch)([":resize","state.panelWidth","state.panelHeight"])],y.prototype,"__onResizeInPanelView",null),(0,o.__decorate)([(0,g.watch)(["state.isOpen","state.displayMode","state.panelWidth","state.panelHeight","state.theme","state.defaultModel","state.defaultTemperature","state.currentConversation"]),(0,g.debounce)()],y.prototype,"__onSavedStateChange",null),(0,o.__decorate)([(0,g.watch)(":closeAIAssistantPro.ai-assistant-pro")],y.prototype,"closeAssistant",null),(0,o.__decorate)([(0,g.watch)(":addContextToAIAssistant.ai-assistant-pro")],y.prototype,"addCurrentSelectionToContext",null),(0,o.__decorate)([(0,g.watch)(":executeQuickCommand.ai-assistant-pro")],y.prototype,"executeQuickCommand",null),(0,o.__decorate)([(0,g.watch)(":sendMessage.ai-assistant-pro")],y.prototype,"sendMessage",null),(0,o.__decorate)([(0,g.watch)(":searchConversations.ai-assistant-pro")],y.prototype,"searchConversations",null),(0,o.__decorate)([(0,g.watch)(":copyMessage.ai-assistant-pro")],y.prototype,"copyMessage",null),(0,o.__decorate)([(0,g.watch)(":restartFromMessage.ai-assistant-pro")],y.prototype,"restartFromMessage",null),(0,o.__decorate)([(0,g.watch)(":editMessage.ai-assistant-pro")],y.prototype,"editMessage",null),(0,o.__decorate)([(0,g.watch)(":cancelEditMessage.ai-assistant-pro")],y.prototype,"cancelEditMessage",null),(0,o.__decorate)([(0,g.watch)(":deleteMessage.ai-assistant-pro")],y.prototype,"deleteMessage",null),y=(0,o.__decorate)([g.component],y),m.JoditPro.plugins.add("aiAssistantPro",y)},44526:function(e,t,u){"use strict";u.d(t,{resolveBlock:function(){return n}});var s=u(22732);function n(e,{selector:t,index:u,requireExactlyOne:i=!1}={}){let r=null!=t,o=null!=u;if(i&&r===o)throw Error("Either index or selector must be provided, but not both");if(!r&&!o)throw Error("Block identifier is required");if(r){if("string"!=typeof t)throw Error("Selector must be a string");let u=e.editor.querySelector(t);if(!u)throw Error(`No element found matching selector "${t}"`);if(!s.Dom.isElement(u))throw Error(`Selector "${t}" does not point to an element node`);return{element:u,identifier:`with selector "${t}"`}}if("number"!=typeof u)throw Error("Block index must be a number");let a=Array.from(e.editor.children);if(u<0||u>=a.length)throw Error(`Block index ${u} is out of range. Document has ${a.length} blocks`);let l=a[u];if(!s.Dom.isElement(l))throw Error(`Block at index ${u} is not a valid element`);return{element:l,identifier:`at index ${u}`}}},46166:function(e,t,u){"use strict";u.d(t,{StateManager:function(){return r}});var s=u(82749),n=u(56075),i=u(11886);class r{createInitialState(){return{isOpen:!1,currentView:"welcome",currentConversation:null,conversations:[],isLoading:!1,error:null,pendingToolCalls:[],selectionContexts:[],abortController:null,editingMessageId:null,theme:this.jodit.o.aiAssistantPro.theme||"parent",displayMode:this.jodit.o.aiAssistantPro.displayMode,panelWidth:this.jodit.o.aiAssistantPro.panelWidth,panelHeight:this.jodit.o.aiAssistantPro.panelHeight,defaultModel:this.jodit.o.aiAssistantPro.defaultModel,defaultTemperature:this.jodit.o.aiAssistantPro.defaultTemperature}}open(){this.state.isOpen=!0,this.jodit.e.fire("open.ai-assistant-pro",this.state.currentConversation)}close(){this.state.isOpen=!1,this.jodit.e.fire("close.ai-assistant-pro")}isOpen(){return this.state.isOpen}setView(e){this.state.currentView=e,this.jodit.e.fire("viewChanged.ai-assistant-pro",e)}getView(){return this.state.currentView}setConversations(e){this.state.conversations=e}setSavedState(e){e.theme&&(this.state.theme=e.theme),e.displayMode&&(this.state.displayMode=e.displayMode),e.panelWidth&&(this.state.panelWidth=e.panelWidth),e.panelHeight&&(this.state.panelHeight=e.panelHeight),e.defaultModel&&(this.state.defaultModel=e.defaultModel),e.defaultTemperature&&(this.state.defaultTemperature=e.defaultTemperature)}getConversations(){return this.state.conversations}setCurrentConversation(e){if(this.state.currentConversation===e)throw Error("Conversation is already current");this.state.currentConversation=e||null,e&&(this.setView("conversation"),this.jodit.e.fire("conversationSwitched.ai-assistant-pro",e))}getCurrentConversation(){return this.state.currentConversation}removeConversation(e){let t=this.state.conversations.filter(t=>t.id!==e);this.setConversations(t)}setLoading(e){this.state.isLoading=e}isLoading(){return this.state.isLoading}setError(e){this.state.error=e,e&&this.jodit.e.fire("error.ai-assistant-pro",Error(e))}getError(){return this.state.error}clearError(){this.setError(null)}setPendingToolCalls(e){this.state.pendingToolCalls=e}getPendingToolCalls(){return this.state.pendingToolCalls}addPendingToolCall(e){let t=[...this.state.pendingToolCalls,e];this.setPendingToolCalls(t)}removePendingToolCall(e){let t=this.state.pendingToolCalls.filter(t=>t.id!==e);this.setPendingToolCalls(t)}updateToolCallStatus(e,t){let u=this.state.pendingToolCalls.map(u=>u.id===e?(0,i._)((0,n._)({},u),{status:t}):u);this.setPendingToolCalls(u)}setSelectionContexts(e){this.state.selectionContexts=e}getSelectionContexts(){return this.state.selectionContexts}addSelectionContext(e){let{maxContextRanges:t}=this.jodit.o.aiAssistantPro,u=[...this.state.selectionContexts,e];u.length>t&&(u=u.slice(-t)),this.setSelectionContexts(u),this.jodit.e.fire("contextAdded.ai-assistant-pro",e)}removeSelectionContext(e){let t=this.state.selectionContexts.filter((t,u)=>u!==e);this.setSelectionContexts(t),this.jodit.e.fire("contextRemoved.ai-assistant-pro",e)}clearSelectionContexts(){this.setSelectionContexts([])}setAbortController(e){this.state.abortController=e}getAbortController(){return this.state.abortController}setEditingMessageId(e){this.state.editingMessageId=e}getEditingMessageId(){return this.state.editingMessageId}isEditingMessage(){return null!=this.state.editingMessageId}clearEditingMessage(){this.setEditingMessageId(null)}reset(){this.state=this.createInitialState()}destruct(){this.state.abortController&&this.state.abortController.abort(),this.reset()}constructor(e){(0,s._)(this,"jodit",void 0),(0,s._)(this,"state",void 0),this.jodit=e,this.state=this.createInitialState()}}},47373:function(e,t,u){"use strict";function s(e,t,u="image/png"){let n=atob(e),i=n.length,r=new Uint8Array(i);for(let e=0;i>e;e++)r[e]=n.charCodeAt(e);return new File([new Blob([r],{type:u})],t,{type:u})}u.d(t,{base64ToFile:function(){return s}})},48705:function(e,t,u){"use strict";u.d(t,{UISettingsButton:function(){return s.UISettingsButton}});var s=u(76697)},49459:function(e,t,u){"use strict";function s(e,t,u={}){let n=e[t];if("string"!=typeof n||!u.allowEmpty&&""===n)throw Error(`Parameter "${t}" is required and must be a${u.allowEmpty?"":" non-empty"} string`);return n}u.d(t,{requireString:function(){return s}})},51251:function(e,t,u){"use strict";u.d(t,{UIMainPanel:function(){return C}});var s=u(77688),n=u(82749),i=u(31635),r=u(68365),o=u(63227),a=u(86563),l=u(93677),c=u(48705),h=u(55885),d=u(65478),F=u(2748),p=u(67510),A=u(62843);class C extends p.UIElement{className(){return"UIMainPanel"}setParentView(e){var t,u,s,n,i,r;return null==(t=this.welcomeScreen)||t.setParentView(e),null==(u=this.conversationList)||u.setParentView(e),null==(s=this.messageList)||s.setParentView(e),null==(n=this.inputArea)||n.setParentView(e),null==(i=this.permissionRequest)||i.setParentView(e),null==(r=this.settingsButton)||r.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
11
11
|
<div class="&__header">
|
|
12
12
|
<div class="&__header-left"></div>
|
|
13
13
|
<div class="&__header-title"></div>
|
|
@@ -27,7 +27,7 @@ ${i}`.trim();u?yield this.__executeQuickCommandSilent(a,i):yield this.__executeQ
|
|
|
27
27
|
<div class="&__title">~Welcome to AI Assistant~</div>
|
|
28
28
|
<div class="&__subtitle">~Start your first conversation~</div>
|
|
29
29
|
<div class="&__tip">~Tip: Select text in editor to add context~</div>
|
|
30
|
-
</div>`}}r=(0,s.__decorate)([n.component],r)},56110:function(e,t,u){"use strict";u.d(t,{deleteConversationWithCleanup:function(){return i},loadInitialData:function(){return r}});var s=u(77688),n=u(82758);function i(e,t,u,n,i){return(0,s._)(function*(){try{n.setLoading(!0),yield u.delete(t),n.removeConversation(t),i.clearConversationPermissions(t);let s=n.getCurrentConversation();(null==s?void 0:s.id)===t&&n.setCurrentConversation(null);let r=yield u.list();n.setConversations(r),n.setView(0===r.length?"welcome":"conversationList"),e.e.fire("conversationDeleted.ai-assistant-pro",t)}catch(t){e.alert(e.i18n("Failed to delete conversation")+": "+((null==t?void 0:t.message)||"Unknown error"))}finally{n.setLoading(!1)}})()}function r(e,t,u){return(0,s._)(function*(){u.setLoading(!0);try{let[n,i]=yield Promise.all([t.list().catch(()=>[]),t.getGlobalSettings().catch(()=>null)]);if(u.setConversations(n),i&&u.setSavedState(i),0===n.length)u.setView("welcome");else if(e.o.aiAssistantPro.rememberLastConversation&&(null==i?void 0:i.currentConversationId)){var s;let e=null!=(s=n.find(e=>e.id===i.currentConversationId))?s:n[0],r=yield t.get(e.id);r?u.setCurrentConversation(r):u.setView("conversationList")}else u.setView("conversationList")}catch(e){n.IS_PROD,u.setView("welcome")}finally{u.setLoading(!1)}})()}},56293:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"search"),r=(0,i.requireString)(t,"replace",{allowEmpty:!0}),{useRegex:o,useSelector:a}=t;(0,n.throwIfAborted)(u);try{let t;e.s.focus(),e.s.save();let i=0;if(a){let l=function(e,t,u,s,i,r){let o=e.editor.querySelectorAll(i);if(0===o.length)return{replacements:0,message:`No elements found matching selector "${i}"`};let a=0;return o.forEach(e=>{(0,n.throwIfAborted)(r);let i=e.innerHTML,o=i;if(s)try{let e=RegExp(t,"g");i=i.replace(e,()=>(a++,u))}catch(e){throw Error(`Invalid regex pattern: ${(null==e?void 0:e.message)||"Unknown error"}`)}else{let e=t.length,s=0;for(;-1!==(s=i.indexOf(t,s));)(0,n.throwIfAborted)(r),i=i.substring(0,s)+u+i.substring(s+e),s+=u.length,a++}i!==o&&(e.innerHTML=i)}),a>0&&(e.synchronizeValues(),e.s.restore()),{replacements:a}}(e,s,r,o,a,u);i=l.replacements,t=l.message}else i=function(e,t,u,s,i,r){let o=0,a=t;if(i)try{let e=RegExp(u,"g");a=a.replace(e,()=>(o++,s))}catch(e){throw Error(`Invalid regex pattern: ${(null==e?void 0:e.message)||"Unknown error"}`)}else{let e=u.length,t=0;for(;-1!==(t=a.indexOf(u,t));)(0,n.throwIfAborted)(r),a=a.substring(0,t)+s+a.substring(t+e),t+=s.length,o++}return o>0&&(e.value=a,e.s.restore(),e.synchronizeValues()),o}(e,e.value,s,r,o,u);return{replacements:i,message:t||(i>0?`Replaced ${i} occurrence(s)`:"No matches found")}}catch(t){throw e.s.restore(),Error(`Failed to replace in document: ${(null==t?void 0:t.message)||"Unknown error"}`)}})()}},56732:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="insertHTML",n="Insert or replace HTML content at the current cursor position in the editor",i=[{name:"html",type:"string",description:"HTML content to insert",required:!0},{name:"replace",type:"boolean",description:"If true, replaces current selection. If false, inserts at cursor",required:!1,default:!1}],r=!0},58579:function(e,t,u){"use strict";u.d(t,{applyTheme:function(){return c.applyTheme},areAllToolCallsExecuted:function(){return n.areAllToolCallsExecuted},createNewConversation:function(){return n.createNewConversation},createUserMessage:function(){return r.createUserMessage},deleteConversationWithCleanup:function(){return l.deleteConversationWithCleanup},executeToolCall:function(){return h.executeToolCall},findParentMessageId:function(){return n.findParentMessageId},getCurrentSelectionContext:function(){return a.getCurrentSelectionContext},handleBackToList:function(){return i.handleBackToList},handleConversationSearch:function(){return i.handleConversationSearch},handleConversationSelect:function(){return i.handleConversationSelect},handleToolApproval:function(){return i.handleToolApproval},handleToolDenial:function(){return i.handleToolDenial},invertMode:function(){return o.invertMode},loadInitialData:function(){return l.loadInitialData},processArtifacts:function(){return s.processArtifacts},processFinalResponse:function(){return s.processFinalResponse},processStreamingResponse:function(){return s.processStreamingResponse},resizeInPanelView:function(){return o.resizeInPanelView},updateToolCallInMessage:function(){return h.updateToolCallInMessage}});var s=u(61872),n=u(70308),i=u(473),r=u(61558),o=u(71050),a=u(15927),l=u(56110),c=u(53014),h=u(79078)},61558:function(e,t,u){"use strict";u.d(t,{createAIMessage:function(){return r},createErrorMessage:function(){return o},createUserMessage:function(){return i},uploadArtifacts:function(){return a}});var s=u(77688),n=u(21064);function i(e){return{id:(0,n.generateMessageId)(),role:"user",content:e,timestamp:Date.now()}}function r(){return{id:"",role:"assistant",content:"",artifacts:[],timestamp:Date.now(),toolCalls:[]}}function o(e){return{id:"error_"+(0,n.generateMessageId)(),role:"assistant",content:`❌ Error: ${e.message}`,timestamp:Date.now(),toolCalls:[],artifacts:[]}}function a(e,t){return(0,s._)(function*(){if(!t||0===t.length)return t;let u=e.o.aiAssistantPro.uploadBase64Artifact;return u?Promise.all(t.map(t=>(0,s._)(function*(){var s;return null!=(s=u(t,e))?s:t})())):t})()}},61872:function(e,t,u){"use strict";u.d(t,{processArtifacts:function(){return c},processFinalResponse:function(){return l},processStreamingResponse:function(){return a}});var s=u(89929),n=u(77688),i=u(56075),r=u(11886),o=u(61558);function a(e,t,u){return(0,n._)(function*(){let n=(0,o.createAIMessage)(),a=-1;var l,c=!1,h=!1;try{for(var d,F=(0,s._)(t.stream);c=!(d=yield F.next()).done;c=!1){let t=d.value;switch(t.type){case"created":n=(0,r._)((0,i._)({},n),{id:t.response.responseId,content:""}),a=u.messages.length;break;case"text-delta":n=(0,r._)((0,i._)({},n),{content:n.content+t.delta});break;case"completed":n=(0,r._)((0,i._)({},n),{toolCalls:t.response.toolCalls||[],artifacts:t.response.artifacts||[]});break;case"error":{let e=(0,o.createErrorMessage)(t.error);n=(0,r._)((0,i._)({},n),{id:e.id,content:e.content})}}if(n.id){let t=u.messages.slice();t[a>=0?a:u.messages.length]=n,u=(0,r._)((0,i._)({},u),{messages:t,updated:Date.now()}),e.setCurrentConversation(u)}}}catch(e){h=!0,l=e}finally{try{c&&null!=F.return&&(yield F.return())}finally{if(h)throw l}}return{aiMessage:n,index:a,conversation:u}})()}function l(e,t){let u=(0,r._)((0,i._)({},(0,o.createAIMessage)()),{id:e.response.responseId,content:e.response.content,toolCalls:e.response.toolCalls||[],artifacts:e.response.artifacts||[]}),s=t.messages.slice();return s.push(u),{aiMessage:u,index:(t=(0,r._)((0,i._)({},t),{messages:s,updated:Date.now()})).messages.length-1,conversation:t}}function c(e,t,u,s){return(0,n._)(function*(){if(t.artifacts&&t.artifacts.length>0){let n=u.messages.slice();return n[s]=(0,r._)((0,i._)({},n[s]),{artifacts:yield(0,o.uploadArtifacts)(e,t.artifacts)}),(0,r._)((0,i._)({},u),{messages:n,updated:Date.now()})}return u})()}},62357:function(e,t,u){"use strict";u.d(t,{UIRange:function(){return c}});var s=u(82749),n=u(56075),i=u(11886),r=u(31635),o=u(65478),a=u(21537),l=u(67510);class c extends l.UIInput{className(){return"UIRange"}appendUIRange(){let e=this.j.create.div(this.getFullElName("slider"));this.container.appendChild(e);let t=this.j.create.div(this.getFullElName("handle"));e.appendChild(t);let u=this.j.create.div(this.getFullElName("log")),s=this.getElm("label");s&&s.appendChild(u)}onDragStart(e){this.startValue=parseFloat(this.value)||0,this.startX=e.clientX;let t=this.getElm("slider");(0,a.assert)(null!=t,"slider element does not exists"),this.width=t.offsetWidth,this.j.e.on(this.j.ow,"mousemove",this.onDrag)}onDrag(e){let{min:t,max:u,step:s=1}=this.state,n=(e.clientX-this.startX)/this.width*(this.state.max-this.state.min),i=this.startValue+n;i<t&&(i=t),i>u&&(i=u),i=Math.round(i/s)*s,this.value=i.toFixed(10)}onDragEnd(){this.j.e.off(this.j.ow,"mousemove",this.onDrag)}onChangeSelfValue(){let e=this.getElm("handle"),t=parseFloat(this.value)||0;(0,a.assert)(null!=e,"Handle element does not exist"),(0,a.css)(e,{left:(t-this.state.min)/(this.state.max-this.state.min)*100+"%"});let u=this.getElm("log");(0,a.assert)(null!=u,"log element does not exist"),u.innerText=t.toString()}destruct(){return this.onDragEnd(),super.destruct()}constructor(e,t){super(e,(0,i._)((0,n._)({},t),{type:"hidden"})),(0,s._)(this,"state",(0,i._)((0,n._)({},l.UIInput.defaultState),{min:0,max:100,step:1})),(0,s._)(this,"startValue",0),(0,s._)(this,"startX",0),(0,s._)(this,"width",100),Object.assign(this.state,t),this.appendUIRange(),this.onChangeSelfValue()}}(0,r.__decorate)([(0,o.watch)(["handle:mousedown","handle:touchstart"])],c.prototype,"onDragStart",null),(0,r.__decorate)([o.autobind],c.prototype,"onDrag",null),(0,r.__decorate)([(0,o.watch)(["j.ow:mouseup","j.ow:touchend"])],c.prototype,"onDragEnd",null),(0,r.__decorate)([(0,o.watch)(":change")],c.prototype,"onChangeSelfValue",null),c=(0,r.__decorate)([o.component],c)},62553:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="replaceInDocument",n="Find and replace text or HTML patterns throughout the entire document",i=[{name:"search",type:"string",description:"Text or pattern to search for",required:!0},{name:"replace",type:"string",description:"Replacement text or HTML",required:!0},{name:"useRegex",type:"boolean",description:"If true, treats search as a regular expression",required:!1,default:!1},{name:"useSelector",type:"string",description:"CSS selector to narrow down the search scope to specific elements",required:!1}],r=!0},62895:function(e,t,u){"use strict";u.d(t,{WebStorageConversationStorage:function(){return s.WebStorageConversationStorage},createStorageProvider:function(){return s.createStorageProvider}});var s=u(21064)},63227:function(e,t,u){"use strict";u.d(t,{UIInputArea:function(){return c}});var s=u(82749),n=u(31635),i=u(65478),r=u(38837),o=u(67510),a=u(62843),l=u(85120);class c extends o.UIElement{className(){return"UIInputArea"}setParentView(e){var t,u,s;return null==(t=this.textarea)||t.setParentView(e),null==(u=this.sendButton)||u.setParentView(e),null==(s=this.stopButton)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
30
|
+
</div>`}}r=(0,s.__decorate)([n.component],r)},56110:function(e,t,u){"use strict";u.d(t,{deleteConversationWithCleanup:function(){return i},loadInitialData:function(){return r}});var s=u(77688),n=u(82758);function i(e,t,u,n,i){return(0,s._)(function*(){try{n.setLoading(!0),yield u.delete(t),n.removeConversation(t),i.clearConversationPermissions(t);let s=n.getCurrentConversation();(null==s?void 0:s.id)===t&&n.setCurrentConversation(null);let r=yield u.list();n.setConversations(r),n.setView(0===r.length?"welcome":"conversationList"),e.e.fire("conversationDeleted.ai-assistant-pro",t)}catch(t){e.alert(e.i18n("Failed to delete conversation")+": "+((null==t?void 0:t.message)||"Unknown error"))}finally{n.setLoading(!1)}})()}function r(e,t,u){return(0,s._)(function*(){u.setLoading(!0);try{let[n,i]=yield Promise.all([t.list().catch(()=>[]),t.getGlobalSettings().catch(()=>null)]);if(u.setConversations(n),i&&u.setSavedState(i),0===n.length)u.setView("welcome");else if(e.o.aiAssistantPro.rememberLastConversation&&(null==i?void 0:i.currentConversationId)){var s;let e=null!=(s=n.find(e=>e.id===i.currentConversationId))?s:n[0],r=yield t.get(e.id);r?u.setCurrentConversation(r):u.setView("conversationList")}else u.setView("conversationList")}catch(e){n.IS_PROD,u.setView("welcome")}finally{u.setLoading(!1)}})()}},56293:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"search"),r=(0,i.requireString)(t,"replace",{allowEmpty:!0}),{useRegex:o,useSelector:a}=t;(0,n.throwIfAborted)(u);try{let t;e.s.focus(),e.s.save();let i=0;if(a){let l=function(e,t,u,s,i,r){let o=e.editor.querySelectorAll(i);if(0===o.length)return{replacements:0,message:`No elements found matching selector "${i}"`};let a=0;return o.forEach(e=>{(0,n.throwIfAborted)(r);let i=e.innerHTML,o=i;if(s)try{let e=RegExp(t,"g");i=i.replace(e,()=>(a++,u))}catch(e){throw Error(`Invalid regex pattern: ${(null==e?void 0:e.message)||"Unknown error"}`)}else{let e=t.length,s=0;for(;-1!==(s=i.indexOf(t,s));)(0,n.throwIfAborted)(r),i=i.substring(0,s)+u+i.substring(s+e),s+=u.length,a++}i!==o&&(e.innerHTML=i)}),a>0&&(e.synchronizeValues(),e.s.restore()),{replacements:a}}(e,s,r,o,a,u);i=l.replacements,t=l.message}else i=function(e,t,u,s,i,r){let o=0,a=t;if(i)try{let e=RegExp(u,"g");a=a.replace(e,()=>(o++,s))}catch(e){throw Error(`Invalid regex pattern: ${(null==e?void 0:e.message)||"Unknown error"}`)}else{let e=u.length,t=0;for(;-1!==(t=a.indexOf(u,t));)(0,n.throwIfAborted)(r),a=a.substring(0,t)+s+a.substring(t+e),t+=s.length,o++}return o>0&&(e.value=a,e.s.restore(),e.synchronizeValues()),o}(e,e.value,s,r,o,u);return{replacements:i,message:t||(i>0?`Replaced ${i} occurrence(s)`:"No matches found")}}catch(t){throw e.s.restore(),Error(`Failed to replace in document: ${(null==t?void 0:t.message)||"Unknown error"}`)}})()}},56732:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="insertHTML",n="Insert or replace HTML content at the current cursor position in the editor",i=[{name:"html",type:"string",description:"HTML content to insert",required:!0},{name:"replace",type:"boolean",description:"If true, replaces current selection. If false, inserts at cursor",required:!1,default:!1}],r=!0},58579:function(e,t,u){"use strict";u.d(t,{applyTheme:function(){return c.applyTheme},areAllToolCallsExecuted:function(){return n.areAllToolCallsExecuted},createNewConversation:function(){return n.createNewConversation},createUserMessage:function(){return r.createUserMessage},deleteConversationWithCleanup:function(){return l.deleteConversationWithCleanup},executeToolCall:function(){return h.executeToolCall},findParentMessageId:function(){return n.findParentMessageId},getCurrentSelectionContext:function(){return a.getCurrentSelectionContext},handleBackToList:function(){return i.handleBackToList},handleConversationSearch:function(){return i.handleConversationSearch},handleConversationSelect:function(){return i.handleConversationSelect},handleToolApproval:function(){return i.handleToolApproval},handleToolDenial:function(){return i.handleToolDenial},invertMode:function(){return o.invertMode},loadInitialData:function(){return l.loadInitialData},processArtifacts:function(){return s.processArtifacts},processFinalResponse:function(){return s.processFinalResponse},processStreamingResponse:function(){return s.processStreamingResponse},resizeInPanelView:function(){return o.resizeInPanelView},updateToolCallInMessage:function(){return h.updateToolCallInMessage}});var s=u(61872),n=u(70308),i=u(473),r=u(61558),o=u(71050),a=u(15927),l=u(56110),c=u(53014),h=u(79078)},61558:function(e,t,u){"use strict";u.d(t,{createAIMessage:function(){return r},createErrorMessage:function(){return o},createUserMessage:function(){return i},uploadArtifacts:function(){return a}});var s=u(77688),n=u(21064);function i(e){return{id:(0,n.generateMessageId)(),role:"user",content:e,timestamp:Date.now()}}function r(){return{id:"",role:"assistant",content:"",artifacts:[],timestamp:Date.now(),toolCalls:[]}}function o(e){return{id:"error_"+(0,n.generateMessageId)(),role:"assistant",content:`❌ Error: ${e.message}`,timestamp:Date.now(),toolCalls:[],artifacts:[]}}function a(e,t){return(0,s._)(function*(){if(!t||0===t.length)return t;let u=e.o.aiAssistantPro.uploadBase64Artifact;return u?Promise.all(t.map(t=>(0,s._)(function*(){var s;return null!=(s=u(t,e))?s:t})())):t})()}},61872:function(e,t,u){"use strict";u.d(t,{processArtifacts:function(){return c},processFinalResponse:function(){return l},processStreamingResponse:function(){return a}});var s=u(89929),n=u(77688),i=u(56075),r=u(11886),o=u(61558);function a(e,t,u){return(0,n._)(function*(){let n=(0,o.createAIMessage)(),a=-1;var l,c=!1,h=!1;try{for(var d,F=(0,s._)(t.stream);c=!(d=yield F.next()).done;c=!1){let t=d.value;switch(t.type){case"created":n=(0,r._)((0,i._)({},n),{id:t.response.responseId,content:""}),a=u.messages.length;break;case"text-delta":n=(0,r._)((0,i._)({},n),{content:n.content+t.delta});break;case"completed":n=(0,r._)((0,i._)({},n),{id:t.response.responseId,toolCalls:t.response.toolCalls||[],artifacts:t.response.artifacts||[]});break;case"error":{let e=(0,o.createErrorMessage)(t.error);n=(0,r._)((0,i._)({},n),{id:e.id,content:e.content})}}if(n.id){let t=u.messages.slice();t[a>=0?a:u.messages.length]=n,u=(0,r._)((0,i._)({},u),{messages:t,updated:Date.now()}),e.setCurrentConversation(u)}}}catch(e){h=!0,l=e}finally{try{c&&null!=F.return&&(yield F.return())}finally{if(h)throw l}}return{aiMessage:n,index:a,conversation:u}})()}function l(e,t){let u=(0,r._)((0,i._)({},(0,o.createAIMessage)()),{id:e.response.responseId,content:e.response.content,toolCalls:e.response.toolCalls||[],artifacts:e.response.artifacts||[]}),s=t.messages.slice();return s.push(u),{aiMessage:u,index:(t=(0,r._)((0,i._)({},t),{messages:s,updated:Date.now()})).messages.length-1,conversation:t}}function c(e,t,u,s){return(0,n._)(function*(){if(t.artifacts&&t.artifacts.length>0){let n=u.messages.slice();return n[s]=(0,r._)((0,i._)({},n[s]),{artifacts:yield(0,o.uploadArtifacts)(e,t.artifacts)}),(0,r._)((0,i._)({},u),{messages:n,updated:Date.now()})}return u})()}},62357:function(e,t,u){"use strict";u.d(t,{UIRange:function(){return c}});var s=u(82749),n=u(56075),i=u(11886),r=u(31635),o=u(65478),a=u(21537),l=u(67510);class c extends l.UIInput{className(){return"UIRange"}appendUIRange(){let e=this.j.create.div(this.getFullElName("slider"));this.container.appendChild(e);let t=this.j.create.div(this.getFullElName("handle"));e.appendChild(t);let u=this.j.create.div(this.getFullElName("log")),s=this.getElm("label");s&&s.appendChild(u)}onDragStart(e){this.startValue=parseFloat(this.value)||0,this.startX=e.clientX;let t=this.getElm("slider");(0,a.assert)(null!=t,"slider element does not exists"),this.width=t.offsetWidth,this.j.e.on(this.j.ow,"mousemove",this.onDrag)}onDrag(e){let{min:t,max:u,step:s=1}=this.state,n=(e.clientX-this.startX)/this.width*(this.state.max-this.state.min),i=this.startValue+n;i<t&&(i=t),i>u&&(i=u),i=Math.round(i/s)*s,this.value=i.toFixed(10)}onDragEnd(){this.j.e.off(this.j.ow,"mousemove",this.onDrag)}onChangeSelfValue(){let e=this.getElm("handle"),t=parseFloat(this.value)||0;(0,a.assert)(null!=e,"Handle element does not exist"),(0,a.css)(e,{left:(t-this.state.min)/(this.state.max-this.state.min)*100+"%"});let u=this.getElm("log");(0,a.assert)(null!=u,"log element does not exist"),u.innerText=t.toString()}destruct(){return this.onDragEnd(),super.destruct()}constructor(e,t){super(e,(0,i._)((0,n._)({},t),{type:"hidden"})),(0,s._)(this,"state",(0,i._)((0,n._)({},l.UIInput.defaultState),{min:0,max:100,step:1})),(0,s._)(this,"startValue",0),(0,s._)(this,"startX",0),(0,s._)(this,"width",100),Object.assign(this.state,t),this.appendUIRange(),this.onChangeSelfValue()}}(0,r.__decorate)([(0,o.watch)(["handle:mousedown","handle:touchstart"])],c.prototype,"onDragStart",null),(0,r.__decorate)([o.autobind],c.prototype,"onDrag",null),(0,r.__decorate)([(0,o.watch)(["j.ow:mouseup","j.ow:touchend"])],c.prototype,"onDragEnd",null),(0,r.__decorate)([(0,o.watch)(":change")],c.prototype,"onChangeSelfValue",null),c=(0,r.__decorate)([o.component],c)},62553:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="replaceInDocument",n="Find and replace text or HTML patterns throughout the entire document",i=[{name:"search",type:"string",description:"Text or pattern to search for",required:!0},{name:"replace",type:"string",description:"Replacement text or HTML",required:!0},{name:"useRegex",type:"boolean",description:"If true, treats search as a regular expression",required:!1,default:!1},{name:"useSelector",type:"string",description:"CSS selector to narrow down the search scope to specific elements",required:!1}],r=!0},62895:function(e,t,u){"use strict";u.d(t,{WebStorageConversationStorage:function(){return s.WebStorageConversationStorage},createStorageProvider:function(){return s.createStorageProvider}});var s=u(21064)},63227:function(e,t,u){"use strict";u.d(t,{UIInputArea:function(){return c}});var s=u(82749),n=u(31635),i=u(65478),r=u(38837),o=u(67510),a=u(62843),l=u(85120);class c extends o.UIElement{className(){return"UIInputArea"}setParentView(e){var t,u,s;return null==(t=this.textarea)||t.setParentView(e),null==(u=this.sendButton)||u.setParentView(e),null==(s=this.stopButton)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
31
31
|
<div class="&__context-badges"></div>
|
|
32
32
|
<div class="&__loading-indicator">
|
|
33
33
|
<span class="&__loading-dot"></span>
|
|
@@ -44,7 +44,7 @@ ${i}`.trim();u?yield this.__executeQuickCommandSilent(a,i):yield this.__executeQ
|
|
|
44
44
|
<div class="&__search-loader"></div>
|
|
45
45
|
</div>
|
|
46
46
|
<div class="&__list"></div>
|
|
47
|
-
</div>`}afterRender(){this.createControls(),this.listContainer=this.getElm("list")}appendChildToContainer(e){this.listContainer&&this.listContainer.appendChild(e)}createControls(){let e=this.getElm("search");this.searchInput=new a.UIInput(this.j,{name:"search",placeholder:"Search conversations...",icon:"search",clearButton:!0}),this.j.e.on(this.searchInput.nativeInput,"input",this.onSearch),e.appendChild(this.searchInput.container)}setConversations(e){this.buildList(e)}setActiveConversation(e){this.activeConversationId=e,this.elements.forEach(t=>{t.setActive(t.conversation.id===e)})}onSearch(){let e=this.searchInput.value.trim();this.j.e.fire("searchConversations.ai-assistant-pro",e)}buildList(e){let t=this.elements.map(e=>e.conversation),u=i.ListReconciler.reconcile(t,e,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.updated===t.updated,preserveOrder:!0});u.toRemove.forEach(e=>{let t=this.conversationItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.conversationItems.delete(e.id))}),u.toUpdate.forEach(({newItem:e,index:t})=>{let u=this.conversationItems.get(e.id);if(u){let s=e.id===this.activeConversationId;u.setActive(s),this.elements.indexOf(u)!==t&&t<this.elements.length&&(this.remove(u),this.append(u,t))}}),u.toCreate.forEach(t=>{let u=t.id===this.activeConversationId,s=new r.UIConversationListItem(this.j,t,u,this.opts);this.conversationItems.set(t.id,s);let n=e.indexOf(t);this.append(s,n)}),u.unchanged.forEach(e=>{let t=this.conversationItems.get(e.id);if(t){let u=e.id===this.activeConversationId;t.setActive(u)}})}setLoading(e){this.setMod("loading",e)}setParentView(e){var t;return null==(t=this.searchInput)||t.setParentView(e),super.setParentView(e)}destruct(){var e;null==(e=this.searchInput)||e.destruct(),super.destruct()}constructor(e,t){super(e),(0,s._)(this,"opts",void 0),(0,s._)(this,"searchInput",void 0),(0,s._)(this,"activeConversationId",void 0),(0,s._)(this,"listContainer",void 0),(0,s._)(this,"conversationItems",void 0),this.opts=t,this.searchInput=null,this.activeConversationId=null,this.conversationItems=new Map}}(0,n.__decorate)([(0,o.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([(0,o.debounce)()],c.prototype,"onSearch",null),c=(0,n.__decorate)([o.component],c)},70308:function(e,t,u){"use strict";u.d(t,{areAllToolCallsExecuted:function(){return r},createNewConversation:function(){return n},findParentMessageId:function(){return i}});var s=u(21064);function n(e,t,u,i=[]){let r=e.o.aiAssistantPro,o={id:(0,s.generateConversationId)(),created:Date.now(),updated:Date.now(),messages:i,permissions:[],options:{model:null!=t?t:r.defaultModel,temperature:null!=u?u:r.defaultTemperature}};return e.e.fire("conversationCreated.ai-assistant-pro",o),o}function i(e){for(let t=e.messages.length-1;t>=0;t--){let u=e.messages[t];if("assistant"===u.role&&!u.id.startsWith("error_"))return u.id}return null}function r(e){let t=e.messages[e.messages.length-1];return!!(null==t?void 0:t.toolCalls)&&t.toolCalls.every(e=>"executed"===e.status||"denied"===e.status||"error"===e.status)}},70750:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="replaceSelection",n="Replace the current selection with new HTML content",i=[{name:"html",type:"string",description:"HTML content to insert in place of the selection",required:!0},{name:"collapseToEnd",type:"boolean",description:"Move cursor to the end of the inserted content",required:!1,default:!0}],r=!0},71050:function(e,t,u){"use strict";function s(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top"}}function n(e,t,u,n){var i,r,o;"dialog"!==t&&"flight"!==t&&(("left"===t||"right"===t)&&(null==(r=e.currentPlace.slots[s(t)])||r.style.setProperty(`--jd-slot-${s(t)}-width`,"auto"),null==(o=e.currentPlace.slots[t])||o.style.setProperty(`--jd-slot-${t}-width`,`${u}px`)),null==(i=e.currentPlace.slots[t])||i.style.setProperty("min-height",`${n}px`))}u.d(t,{invertMode:function(){return s},resizeInPanelView:function(){return n}})},71102:function(e,t,u){"use strict";u.d(t,{UIGlobalSettings:function(){return c}});var s=u(77688),n=u(82749),i=u(31635),r=u(65478),o=u(67510),a=u(80256),l=u(12234);class c extends o.UIElement{className(){return"UIGlobalSettings"}setParentView(e){var t,u,s;return null==(t=this.displayModeSelect)||t.setParentView(e),null==(u=this.panelWidthInput)||u.setParentView(e),null==(s=this.themeSelect)||s.setParentView(e),super.setParentView(e)}build(){return(0,s._)(function*(){var e,t,u,s,n,i;let r=this.container;this.options.allowEditDisplayMode&&(this.displayModeSelect=new l.UISelect(this.j,{label:"Display Mode",name:"displayMode",value:null!=(e=null==(t=this.state)?void 0:t.displayMode)?e:"right",options:[{text:"Dialog",value:"dialog"},{text:"Flight",value:"flight"},{text:"Left",value:"left"},{text:"Right",value:"right"},{text:"Top",value:"top"},{text:"Bottom",value:"bottom"}],onChange:()=>{this.onDisplayModeChange()}}),r.appendChild(this.displayModeSelect.container)),this.options.allowEditPanelWidth&&(this.panelWidthInput=new a.UIInput(this.j,{label:"Panel Width",name:"panelWidth",type:"number",value:String(null!=(u=null==(s=this.state)?void 0:s.panelWidth)?u:400),onChange:()=>{this.onPanelWidthChange()}}),this.panelWidthInput.nativeInput.setAttribute("min","200"),this.panelWidthInput.nativeInput.setAttribute("max","800"),this.panelWidthInput.nativeInput.setAttribute("step","10"),r.appendChild(this.panelWidthInput.container)),this.options.allowEditTheme&&(this.themeSelect=new l.UISelect(this.j,{label:"Theme",name:"theme",value:null!=(n=null==(i=this.state)?void 0:i.theme)?n:"parent",options:[{text:"Inherit",value:"parent"},{text:"Light",value:"light"},{text:"Dark",value:"dark"}],onChange:()=>{this.onThemeChange()}}),r.appendChild(this.themeSelect.container))}).call(this)}onDisplayModeChange(){return(0,s._)(function*(){this.displayModeSelect&&(this.state.displayMode=this.displayModeSelect.value,this.j.async.setTimeout(()=>(0,s._)(function*(){this.j.e.fire("closeAIAssistantPro.ai-assistant-pro"),yield this.j.async.requestIdlePromise(),this.j.e.fire("openAIAssistantPro.ai-assistant-pro")}).call(this),100))}).call(this)}onPanelWidthChange(){return(0,s._)(function*(){if(!this.panelWidthInput)return;let e=parseInt(this.panelWidthInput.value,10);isNaN(e)||e<200||e>800||(this.state.panelWidth=e)}).call(this)}onThemeChange(){return(0,s._)(function*(){this.themeSelect&&(this.state.theme=this.themeSelect.value)}).call(this)}destruct(){var e,t,u;null==(e=this.displayModeSelect)||e.destruct(),null==(t=this.panelWidthInput)||t.destruct(),null==(u=this.themeSelect)||u.destruct(),super.destruct()}onStateDisplayModeChange(){this.displayModeSelect&&(this.displayModeSelect.value=this.state.displayMode)}onStatePanelWidthChange(){this.panelWidthInput&&this.panelWidthInput.value!==String(this.state.panelWidth)&&(this.panelWidthInput.value=String(this.state.panelWidth))}onStateThemeChange(){this.themeSelect&&(this.themeSelect.value=this.state.theme)}constructor(e,t,u){super(e),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"displayModeSelect",void 0),(0,n._)(this,"panelWidthInput",void 0),(0,n._)(this,"themeSelect",void 0),this.state=t,this.options=u,this.displayModeSelect=null,this.panelWidthInput=null,this.themeSelect=null,this.build()}}(0,i.__decorate)([(0,r.watch)("state.displayMode")],c.prototype,"onStateDisplayModeChange",null),(0,i.__decorate)([(0,r.watch)("state.panelWidth")],c.prototype,"onStatePanelWidthChange",null),(0,i.__decorate)([(0,r.watch)("state.theme")],c.prototype,"onStateThemeChange",null),c=(0,i.__decorate)([r.component],c)},72573:function(e,t,u){"use strict";function s(e,t,u,s,n,i,r){try{var o=e[i](r),a=o.value}catch(e){u(e);return}o.done?t(a):Promise.resolve(a).then(s,n)}function n(e){return function(){var t=this,u=arguments;return new Promise(function(n,i){var r=e.apply(t,u);function o(e){s(r,n,i,o,a,"next",e)}function a(e){s(r,n,i,o,a,"throw",e)}o(void 0)})}}function i(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function r(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{},s=Object.keys(u);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(u).filter(function(e){return Object.getOwnPropertyDescriptor(u,e).enumerable}))),s.forEach(function(t){i(e,t,u[t])})}return e}function o(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t.push.apply(t,u)}return t})(Object(t)).forEach(function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}),e}function a(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}u.d(t,{marked:function(){return ey}});var l,c=a(),h={exec:()=>null};function d(e,t=""){let u="string"==typeof e?e:e.source,s={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(p.caret,"$1"),u=u.replace(e,n),s},getRegex:()=>new RegExp(u,t)};return s}var F=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch(e){return!1}})(),p={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}\\u0030-\\u0039\\u00B2-\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D58-\\u0D5E\\u0D66-\\u0D78\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\\u{10107}-\\u{10133}\\u{10140}-\\u{10178}\\u{1018A}-\\u{1018B}\\u{102E1}-\\u{102FB}\\u{10320}-\\u{10323}\\u{10341}\\u{1034A}\\u{103D1}-\\u{103D5}\\u{104A0}-\\u{104A9}\\u{10858}-\\u{1085F}\\u{10879}-\\u{1087F}\\u{108A7}-\\u{108AF}\\u{108FB}-\\u{108FF}\\u{10916}-\\u{1091B}\\u{109BC}-\\u{109BD}\\u{109C0}-\\u{109CF}\\u{109D2}-\\u{109FF}\\u{10A40}-\\u{10A48}\\u{10A7D}-\\u{10A7E}\\u{10A9D}-\\u{10A9F}\\u{10AEB}-\\u{10AEF}\\u{10B58}-\\u{10B5F}\\u{10B78}-\\u{10B7F}\\u{10BA9}-\\u{10BAF}\\u{10CFA}-\\u{10CFF}\\u{10D30}-\\u{10D39}\\u{10D40}-\\u{10D49}\\u{10E60}-\\u{10E7E}\\u{10F1D}-\\u{10F26}\\u{10F51}-\\u{10F54}\\u{10FC5}-\\u{10FCB}\\u{11052}-\\u{1106F}\\u{110F0}-\\u{110F9}\\u{11136}-\\u{1113F}\\u{111D0}-\\u{111D9}\\u{111E1}-\\u{111F4}\\u{112F0}-\\u{112F9}\\u{11450}-\\u{11459}\\u{114D0}-\\u{114D9}\\u{11650}-\\u{11659}\\u{116C0}-\\u{116C9}\\u{116D0}-\\u{116E3}\\u{11730}-\\u{1173B}\\u{118E0}-\\u{118F2}\\u{11950}-\\u{11959}\\u{11BF0}-\\u{11BF9}\\u{11C50}-\\u{11C6C}\\u{11D50}-\\u{11D59}\\u{11DA0}-\\u{11DA9}\\u{11DE0}-\\u{11DE9}\\u{11F50}-\\u{11F59}\\u{11FC0}-\\u{11FD4}\\u{12400}-\\u{1246E}\\u{16130}-\\u{16139}\\u{16A60}-\\u{16A69}\\u{16AC0}-\\u{16AC9}\\u{16B50}-\\u{16B59}\\u{16B5B}-\\u{16B61}\\u{16D70}-\\u{16D79}\\u{16E80}-\\u{16E96}\\u{16FF4}-\\u{16FF6}\\u{1CCF0}-\\u{1CCF9}\\u{1D2C0}-\\u{1D2D3}\\u{1D2E0}-\\u{1D2F3}\\u{1D360}-\\u{1D378}\\u{1D7CE}-\\u{1D7FF}\\u{1E140}-\\u{1E149}\\u{1E2F0}-\\u{1E2F9}\\u{1E4F0}-\\u{1E4F9}\\u{1E5F1}-\\u{1E5FA}\\u{1E8C7}-\\u{1E8CF}\\u{1E950}-\\u{1E959}\\u{1EC71}-\\u{1ECAB}\\u{1ECAD}-\\u{1ECAF}\\u{1ECB1}-\\u{1ECB4}\\u{1ED01}-\\u{1ED2D}\\u{1ED2F}-\\u{1ED3D}\\u{1F100}-\\u{1F10C}\\u{1FBF0}-\\u{1FBF9}]","u"),escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,C=/(?:[*+-]|\d{1,9}[.)])/,g=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,E=d(g).replace(/bull/g,C).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),D=d(g).replace(/bull/g,C).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),f=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,B=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",m).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),v=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C).getRegex(),y="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",x=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",x).replace("tag",y).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),w=d(f).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),b={blockquote:d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",w).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:B,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:A,html:_,lheading:E,list:v,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:w,table:h,text:/^[^\n]+/},k=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),S=o(r({},b),{lheading:D,table:k,paragraph:d(f).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex()}),I=o(r({},b),{html:d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",x).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(f).replace("hr",A).replace("heading",` *#{1,6} *[^
|
|
47
|
+
</div>`}afterRender(){this.createControls(),this.listContainer=this.getElm("list")}appendChildToContainer(e){this.listContainer&&this.listContainer.appendChild(e)}createControls(){let e=this.getElm("search");this.searchInput=new a.UIInput(this.j,{name:"search",placeholder:"Search conversations...",icon:"search",clearButton:!0}),this.j.e.on(this.searchInput.nativeInput,"input",this.onSearch),e.appendChild(this.searchInput.container)}setConversations(e){this.buildList(e)}setActiveConversation(e){this.activeConversationId=e,this.elements.forEach(t=>{t.setActive(t.conversation.id===e)})}onSearch(){let e=this.searchInput.value.trim();this.j.e.fire("searchConversations.ai-assistant-pro",e)}buildList(e){let t=this.elements.map(e=>e.conversation),u=i.ListReconciler.reconcile(t,e,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.updated===t.updated,preserveOrder:!0});u.toRemove.forEach(e=>{let t=this.conversationItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.conversationItems.delete(e.id))}),u.toUpdate.forEach(({newItem:e,index:t})=>{let u=this.conversationItems.get(e.id);if(u){let s=e.id===this.activeConversationId;u.setActive(s),this.elements.indexOf(u)!==t&&t<this.elements.length&&(this.remove(u),this.append(u,t))}}),u.toCreate.forEach(t=>{let u=t.id===this.activeConversationId,s=new r.UIConversationListItem(this.j,t,u,this.opts);this.conversationItems.set(t.id,s);let n=e.indexOf(t);this.append(s,n)}),u.unchanged.forEach(e=>{let t=this.conversationItems.get(e.id);if(t){let u=e.id===this.activeConversationId;t.setActive(u)}})}setLoading(e){this.setMod("loading",e)}setParentView(e){var t;return null==(t=this.searchInput)||t.setParentView(e),super.setParentView(e)}destruct(){var e;null==(e=this.searchInput)||e.destruct(),super.destruct()}constructor(e,t){super(e),(0,s._)(this,"opts",void 0),(0,s._)(this,"searchInput",void 0),(0,s._)(this,"activeConversationId",void 0),(0,s._)(this,"listContainer",void 0),(0,s._)(this,"conversationItems",void 0),this.opts=t,this.searchInput=null,this.activeConversationId=null,this.conversationItems=new Map}}(0,n.__decorate)([(0,o.hook)("ready")],c.prototype,"afterRender",null),(0,n.__decorate)([(0,o.debounce)()],c.prototype,"onSearch",null),c=(0,n.__decorate)([o.component],c)},70308:function(e,t,u){"use strict";u.d(t,{areAllToolCallsExecuted:function(){return r},createNewConversation:function(){return n},findParentMessageId:function(){return i}});var s=u(21064);function n(e,t,u,i=[]){let r=e.o.aiAssistantPro,o={id:(0,s.generateConversationId)(),created:Date.now(),updated:Date.now(),messages:i,permissions:[],options:{model:null!=t?t:r.defaultModel,temperature:null!=u?u:r.defaultTemperature}};return e.e.fire("conversationCreated.ai-assistant-pro",o),o}function i(e){for(let t=e.messages.length-1;t>=0;t--){let u=e.messages[t];if("assistant"===u.role&&!u.id.startsWith("error_"))return u.id}return null}function r(e){let t=e.messages[e.messages.length-1];return!!(null==t?void 0:t.toolCalls)&&t.toolCalls.every(e=>"executed"===e.status||"denied"===e.status||"error"===e.status)}},70750:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="replaceSelection",n="Replace the current selection with new HTML content",i=[{name:"html",type:"string",description:"HTML content to insert in place of the selection",required:!0},{name:"collapseToEnd",type:"boolean",description:"Move cursor to the end of the inserted content",required:!1,default:!0}],r=!0},71050:function(e,t,u){"use strict";u.d(t,{invertMode:function(){return n},resizeInPanelView:function(){return i}});var s=u(41180);function n(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top"}}function i(e,t,u,i){var r,o,a,l;if("dialog"===t||"flight"===t)return;("left"===t||"right"===t)&&(null==(a=e.currentPlace.slots[n(t)])||a.style.setProperty(`--jd-slot-${n(t)}-width`,"auto"),null==(l=e.currentPlace.slots[t])||l.style.setProperty(`--jd-slot-${t}-width`,`${u}px`));let c=null!=(r=(0,s.css)(e.currentPlace.workplace,"height"))?r:0;null==(o=e.currentPlace.slots[t])||o.style.setProperty("min-height",`${Math.min(c,i)}px`)}},71102:function(e,t,u){"use strict";u.d(t,{UIGlobalSettings:function(){return c}});var s=u(77688),n=u(82749),i=u(31635),r=u(65478),o=u(67510),a=u(80256),l=u(12234);class c extends o.UIElement{className(){return"UIGlobalSettings"}setParentView(e){var t,u,s;return null==(t=this.displayModeSelect)||t.setParentView(e),null==(u=this.panelWidthInput)||u.setParentView(e),null==(s=this.themeSelect)||s.setParentView(e),super.setParentView(e)}build(){return(0,s._)(function*(){var e,t,u,s,n,i;let r=this.container;this.options.allowEditDisplayMode&&(this.displayModeSelect=new l.UISelect(this.j,{label:"Display Mode",name:"displayMode",value:null!=(e=null==(t=this.state)?void 0:t.displayMode)?e:"right",options:[{text:"Dialog",value:"dialog"},{text:"Flight",value:"flight"},{text:"Left",value:"left"},{text:"Right",value:"right"},{text:"Top",value:"top"},{text:"Bottom",value:"bottom"}],onChange:()=>{this.onDisplayModeChange()}}),r.appendChild(this.displayModeSelect.container)),this.options.allowEditPanelWidth&&(this.panelWidthInput=new a.UIInput(this.j,{label:"Panel Width",name:"panelWidth",type:"number",value:String(null!=(u=null==(s=this.state)?void 0:s.panelWidth)?u:400),onChange:()=>{this.onPanelWidthChange()}}),this.panelWidthInput.nativeInput.setAttribute("min","200"),this.panelWidthInput.nativeInput.setAttribute("max","800"),this.panelWidthInput.nativeInput.setAttribute("step","10"),r.appendChild(this.panelWidthInput.container)),this.options.allowEditTheme&&(this.themeSelect=new l.UISelect(this.j,{label:"Theme",name:"theme",value:null!=(n=null==(i=this.state)?void 0:i.theme)?n:"parent",options:[{text:"Inherit",value:"parent"},{text:"Light",value:"light"},{text:"Dark",value:"dark"}],onChange:()=>{this.onThemeChange()}}),r.appendChild(this.themeSelect.container))}).call(this)}onDisplayModeChange(){return(0,s._)(function*(){this.displayModeSelect&&(this.state.displayMode=this.displayModeSelect.value,this.j.async.setTimeout(()=>(0,s._)(function*(){this.j.e.fire("closeAIAssistantPro.ai-assistant-pro"),yield this.j.async.requestIdlePromise(),this.j.e.fire("openAIAssistantPro.ai-assistant-pro")}).call(this),100))}).call(this)}onPanelWidthChange(){return(0,s._)(function*(){if(!this.panelWidthInput)return;let e=parseInt(this.panelWidthInput.value,10);isNaN(e)||e<200||e>800||(this.state.panelWidth=e)}).call(this)}onThemeChange(){return(0,s._)(function*(){this.themeSelect&&(this.state.theme=this.themeSelect.value)}).call(this)}destruct(){var e,t,u;null==(e=this.displayModeSelect)||e.destruct(),null==(t=this.panelWidthInput)||t.destruct(),null==(u=this.themeSelect)||u.destruct(),super.destruct()}onStateDisplayModeChange(){this.displayModeSelect&&(this.displayModeSelect.value=this.state.displayMode)}onStatePanelWidthChange(){this.panelWidthInput&&this.panelWidthInput.value!==String(this.state.panelWidth)&&(this.panelWidthInput.value=String(this.state.panelWidth))}onStateThemeChange(){this.themeSelect&&(this.themeSelect.value=this.state.theme)}constructor(e,t,u){super(e),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"displayModeSelect",void 0),(0,n._)(this,"panelWidthInput",void 0),(0,n._)(this,"themeSelect",void 0),this.state=t,this.options=u,this.displayModeSelect=null,this.panelWidthInput=null,this.themeSelect=null,this.build()}}(0,i.__decorate)([(0,r.watch)("state.displayMode")],c.prototype,"onStateDisplayModeChange",null),(0,i.__decorate)([(0,r.watch)("state.panelWidth")],c.prototype,"onStatePanelWidthChange",null),(0,i.__decorate)([(0,r.watch)("state.theme")],c.prototype,"onStateThemeChange",null),c=(0,i.__decorate)([r.component],c)},72573:function(e,t,u){"use strict";function s(e,t,u,s,n,i,r){try{var o=e[i](r),a=o.value}catch(e){u(e);return}o.done?t(a):Promise.resolve(a).then(s,n)}function n(e){return function(){var t=this,u=arguments;return new Promise(function(n,i){var r=e.apply(t,u);function o(e){s(r,n,i,o,a,"next",e)}function a(e){s(r,n,i,o,a,"throw",e)}o(void 0)})}}function i(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function r(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{},s=Object.keys(u);"function"==typeof Object.getOwnPropertySymbols&&(s=s.concat(Object.getOwnPropertySymbols(u).filter(function(e){return Object.getOwnPropertyDescriptor(u,e).enumerable}))),s.forEach(function(t){i(e,t,u[t])})}return e}function o(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t.push.apply(t,u)}return t})(Object(t)).forEach(function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}),e}function a(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}u.d(t,{marked:function(){return ey}});var l,c=a(),h={exec:()=>null};function d(e,t=""){let u="string"==typeof e?e:e.source,s={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(p.caret,"$1"),u=u.replace(e,n),s},getRegex:()=>new RegExp(u,t)};return s}var F=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch(e){return!1}})(),p={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376-\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E-\\u066F\\u0671-\\u06D3\\u06D5\\u06E5-\\u06E6\\u06EE-\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4-\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088F\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0-\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5C-\\u0C5D\\u0C60-\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDC-\\u0CDE\\u0CE0-\\u0CE1\\u0CF1-\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E46\\u0E81-\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065-\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE-\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5-\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183-\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3006\\u3031-\\u3035\\u303B-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A-\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7DC\\uA7F1-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD-\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5-\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40-\\uFB41\\uFB43-\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}-\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}-\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}-\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}-\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}-\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10940}-\\u{10959}\\u{10980}-\\u{109B7}\\u{109BE}-\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}-\\u{10EB1}\\u{10EC2}-\\u{10EC7}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}-\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}-\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}-\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}-\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}-\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}-\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}-\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}-\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11DB0}-\\u{11DDB}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16EA0}-\\u{16EB8}\\u{16EBB}-\\u{16ED3}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}-\\u{16FE1}\\u{16FE3}\\u{16FF2}-\\u{16FF3}\\u{17000}-\\u{18CD5}\\u{18CFF}-\\u{18D1E}\\u{18D80}-\\u{18DF2}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}-\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}-\\u{1D49F}\\u{1D4A2}\\u{1D4A5}-\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E6C0}-\\u{1E6DE}\\u{1E6E0}-\\u{1E6E2}\\u{1E6E4}-\\u{1E6E5}\\u{1E6E7}-\\u{1E6ED}\\u{1E6F0}-\\u{1E6F4}\\u{1E6FE}-\\u{1E6FF}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}-\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}-\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}-\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}-\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B81D}\\u{2B820}-\\u{2CEAD}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{33479}\\u0030-\\u0039\\u00B2-\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D58-\\u0D5E\\u0D66-\\u0D78\\u0DE6-\\u0DEF\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uA9F0-\\uA9F9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\\u{10107}-\\u{10133}\\u{10140}-\\u{10178}\\u{1018A}-\\u{1018B}\\u{102E1}-\\u{102FB}\\u{10320}-\\u{10323}\\u{10341}\\u{1034A}\\u{103D1}-\\u{103D5}\\u{104A0}-\\u{104A9}\\u{10858}-\\u{1085F}\\u{10879}-\\u{1087F}\\u{108A7}-\\u{108AF}\\u{108FB}-\\u{108FF}\\u{10916}-\\u{1091B}\\u{109BC}-\\u{109BD}\\u{109C0}-\\u{109CF}\\u{109D2}-\\u{109FF}\\u{10A40}-\\u{10A48}\\u{10A7D}-\\u{10A7E}\\u{10A9D}-\\u{10A9F}\\u{10AEB}-\\u{10AEF}\\u{10B58}-\\u{10B5F}\\u{10B78}-\\u{10B7F}\\u{10BA9}-\\u{10BAF}\\u{10CFA}-\\u{10CFF}\\u{10D30}-\\u{10D39}\\u{10D40}-\\u{10D49}\\u{10E60}-\\u{10E7E}\\u{10F1D}-\\u{10F26}\\u{10F51}-\\u{10F54}\\u{10FC5}-\\u{10FCB}\\u{11052}-\\u{1106F}\\u{110F0}-\\u{110F9}\\u{11136}-\\u{1113F}\\u{111D0}-\\u{111D9}\\u{111E1}-\\u{111F4}\\u{112F0}-\\u{112F9}\\u{11450}-\\u{11459}\\u{114D0}-\\u{114D9}\\u{11650}-\\u{11659}\\u{116C0}-\\u{116C9}\\u{116D0}-\\u{116E3}\\u{11730}-\\u{1173B}\\u{118E0}-\\u{118F2}\\u{11950}-\\u{11959}\\u{11BF0}-\\u{11BF9}\\u{11C50}-\\u{11C6C}\\u{11D50}-\\u{11D59}\\u{11DA0}-\\u{11DA9}\\u{11DE0}-\\u{11DE9}\\u{11F50}-\\u{11F59}\\u{11FC0}-\\u{11FD4}\\u{12400}-\\u{1246E}\\u{16130}-\\u{16139}\\u{16A60}-\\u{16A69}\\u{16AC0}-\\u{16AC9}\\u{16B50}-\\u{16B59}\\u{16B5B}-\\u{16B61}\\u{16D70}-\\u{16D79}\\u{16E80}-\\u{16E96}\\u{16FF4}-\\u{16FF6}\\u{1CCF0}-\\u{1CCF9}\\u{1D2C0}-\\u{1D2D3}\\u{1D2E0}-\\u{1D2F3}\\u{1D360}-\\u{1D378}\\u{1D7CE}-\\u{1D7FF}\\u{1E140}-\\u{1E149}\\u{1E2F0}-\\u{1E2F9}\\u{1E4F0}-\\u{1E4F9}\\u{1E5F1}-\\u{1E5FA}\\u{1E8C7}-\\u{1E8CF}\\u{1E950}-\\u{1E959}\\u{1EC71}-\\u{1ECAB}\\u{1ECAD}-\\u{1ECAF}\\u{1ECB1}-\\u{1ECB4}\\u{1ED01}-\\u{1ED2D}\\u{1ED2F}-\\u{1ED3D}\\u{1F100}-\\u{1F10C}\\u{1FBF0}-\\u{1FBF9}]","u"),escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,C=/(?:[*+-]|\d{1,9}[.)])/,g=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,E=d(g).replace(/bull/g,C).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),D=d(g).replace(/bull/g,C).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),f=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,B=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",m).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),v=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C).getRegex(),y="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",x=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",x).replace("tag",y).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),w=d(f).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),b={blockquote:d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",w).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:B,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:A,html:_,lheading:E,list:v,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:w,table:h,text:/^[^\n]+/},k=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex(),S=o(r({},b),{lheading:D,table:k,paragraph:d(f).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",k).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",y).getRegex()}),I=o(r({},b),{html:d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",x).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:h,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(f).replace("hr",A).replace("heading",` *#{1,6} *[^
|
|
48
48
|
]`).replace("lheading",E).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),M=/^( {2,}|\\)\n(?!\s*$)/,T=RegExp("[\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]","u"),P=RegExp("[\\s\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]","u"),j=RegExp("[^\\s\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]","u"),R=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,P).getRegex(),L=RegExp("(?!~)[\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]","u"),$=RegExp("(?!~)[\\s\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]","u"),N=RegExp("(?:[^\\s\\u0021-\\u0023\\u0025-\\u002A\\u002C-\\u002F\\u003A-\\u003B\\u003F-\\u0040\\u005B-\\u005D\\u005F\\u007B\\u007D\\u00A1\\u00A7\\u00AB\\u00B6-\\u00B7\\u00BB\\u00BF\\u037E\\u0387\\u055A-\\u055F\\u0589-\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3-\\u05F4\\u0609-\\u060A\\u060C-\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964-\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A-\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9-\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B-\\u169C\\u16EB-\\u16ED\\u1735-\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944-\\u1945\\u1A1E-\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B4E-\\u1B4F\\u1B5A-\\u1B60\\u1B7D-\\u1B7F\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E-\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D-\\u207E\\u208D-\\u208E\\u2308-\\u230B\\u2329-\\u232A\\u2768-\\u2775\\u27C5-\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC-\\u29FD\\u2CF9-\\u2CFC\\u2CFE-\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE-\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE-\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E-\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE-\\uA9DF\\uAA5C-\\uAA5F\\uAADE-\\uAADF\\uAAF0-\\uAAF1\\uABEB\\uFD3E-\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A-\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A-\\uFF1B\\uFF1F-\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65\\u{10100}-\\u{10102}\\u{1039F}\\u{103D0}\\u{1056F}\\u{10857}\\u{1091F}\\u{1093F}\\u{10A50}-\\u{10A58}\\u{10A7F}\\u{10AF0}-\\u{10AF6}\\u{10B39}-\\u{10B3F}\\u{10B99}-\\u{10B9C}\\u{10D6E}\\u{10EAD}\\u{10ED0}\\u{10F55}-\\u{10F59}\\u{10F86}-\\u{10F89}\\u{11047}-\\u{1104D}\\u{110BB}-\\u{110BC}\\u{110BE}-\\u{110C1}\\u{11140}-\\u{11143}\\u{11174}-\\u{11175}\\u{111C5}-\\u{111C8}\\u{111CD}\\u{111DB}\\u{111DD}-\\u{111DF}\\u{11238}-\\u{1123D}\\u{112A9}\\u{113D4}-\\u{113D5}\\u{113D7}-\\u{113D8}\\u{1144B}-\\u{1144F}\\u{1145A}-\\u{1145B}\\u{1145D}\\u{114C6}\\u{115C1}-\\u{115D7}\\u{11641}-\\u{11643}\\u{11660}-\\u{1166C}\\u{116B9}\\u{1173C}-\\u{1173E}\\u{1183B}\\u{11944}-\\u{11946}\\u{119E2}\\u{11A3F}-\\u{11A46}\\u{11A9A}-\\u{11A9C}\\u{11A9E}-\\u{11AA2}\\u{11B00}-\\u{11B09}\\u{11BE1}\\u{11C41}-\\u{11C45}\\u{11C70}-\\u{11C71}\\u{11EF7}-\\u{11EF8}\\u{11F43}-\\u{11F4F}\\u{11FFF}\\u{12470}-\\u{12474}\\u{12FF1}-\\u{12FF2}\\u{16A6E}-\\u{16A6F}\\u{16AF5}\\u{16B37}-\\u{16B3B}\\u{16B44}\\u{16D6D}-\\u{16D6F}\\u{16E97}-\\u{16E9A}\\u{16FE2}\\u{1BC9F}\\u{1DA87}-\\u{1DA8B}\\u{1E5FF}\\u{1E95E}-\\u{1E95F}\\u0024\\u002B\\u003C-\\u003E\\u005E\\u0060\\u007C\\u007E\\u00A2-\\u00A6\\u00A8-\\u00A9\\u00AC\\u00AE-\\u00B1\\u00B4\\u00B8\\u00D7\\u00F7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384-\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E-\\u060F\\u06DE\\u06E9\\u06FD-\\u06FE\\u07F6\\u07FE-\\u07FF\\u0888\\u09F2-\\u09F3\\u09FA-\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE-\\u0FCF\\u0FD5-\\u0FD8\\u109E-\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD-\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C1\\u2100-\\u2101\\u2103-\\u2106\\u2108-\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A-\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A-\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2429\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2BFF\\u2CE5-\\u2CEA\\u2E50-\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012-\\u3013\\u3020\\u3036-\\u3037\\u303E-\\u303F\\u309B-\\u309C\\u3190-\\u3191\\u3196-\\u319F\\u31C0-\\u31E5\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720-\\uA721\\uA789-\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A-\\uAB6B\\uFB29\\uFBB2-\\uFBD2\\uFD40-\\uFD4F\\uFD90-\\uFD91\\uFDC8-\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC-\\uFFFD\\u{10137}-\\u{1013F}\\u{10179}-\\u{10189}\\u{1018C}-\\u{1018E}\\u{10190}-\\u{1019C}\\u{101A0}\\u{101D0}-\\u{101FC}\\u{10877}-\\u{10878}\\u{10AC8}\\u{10D8E}-\\u{10D8F}\\u{10ED1}-\\u{10ED8}\\u{1173F}\\u{11FD5}-\\u{11FF1}\\u{16B3C}-\\u{16B3F}\\u{16B45}\\u{1BC9C}\\u{1CC00}-\\u{1CCEF}\\u{1CCFA}-\\u{1CCFC}\\u{1CD00}-\\u{1CEB3}\\u{1CEBA}-\\u{1CED0}\\u{1CEE0}-\\u{1CEF0}\\u{1CF50}-\\u{1CFC3}\\u{1D000}-\\u{1D0F5}\\u{1D100}-\\u{1D126}\\u{1D129}-\\u{1D164}\\u{1D16A}-\\u{1D16C}\\u{1D183}-\\u{1D184}\\u{1D18C}-\\u{1D1A9}\\u{1D1AE}-\\u{1D1EA}\\u{1D200}-\\u{1D241}\\u{1D245}\\u{1D300}-\\u{1D356}\\u{1D6C1}\\u{1D6DB}\\u{1D6FB}\\u{1D715}\\u{1D735}\\u{1D74F}\\u{1D76F}\\u{1D789}\\u{1D7A9}\\u{1D7C3}\\u{1D800}-\\u{1D9FF}\\u{1DA37}-\\u{1DA3A}\\u{1DA6D}-\\u{1DA74}\\u{1DA76}-\\u{1DA83}\\u{1DA85}-\\u{1DA86}\\u{1E14F}\\u{1E2FF}\\u{1ECAC}\\u{1ECB0}\\u{1ED2E}\\u{1EEF0}-\\u{1EEF1}\\u{1F000}-\\u{1F02B}\\u{1F030}-\\u{1F093}\\u{1F0A0}-\\u{1F0AE}\\u{1F0B1}-\\u{1F0BF}\\u{1F0C1}-\\u{1F0CF}\\u{1F0D1}-\\u{1F0F5}\\u{1F10D}-\\u{1F1AD}\\u{1F1E6}-\\u{1F202}\\u{1F210}-\\u{1F23B}\\u{1F240}-\\u{1F248}\\u{1F250}-\\u{1F251}\\u{1F260}-\\u{1F265}\\u{1F300}-\\u{1F6D8}\\u{1F6DC}-\\u{1F6EC}\\u{1F6F0}-\\u{1F6FC}\\u{1F700}-\\u{1F7D9}\\u{1F7E0}-\\u{1F7EB}\\u{1F7F0}\\u{1F800}-\\u{1F80B}\\u{1F810}-\\u{1F847}\\u{1F850}-\\u{1F859}\\u{1F860}-\\u{1F887}\\u{1F890}-\\u{1F8AD}\\u{1F8B0}-\\u{1F8BB}\\u{1F8C0}-\\u{1F8C1}\\u{1F8D0}-\\u{1F8D8}\\u{1F900}-\\u{1FA57}\\u{1FA60}-\\u{1FA6D}\\u{1FA70}-\\u{1FA7C}\\u{1FA80}-\\u{1FA8A}\\u{1FA8E}-\\u{1FAC6}\\u{1FAC8}\\u{1FACD}-\\u{1FADC}\\u{1FADF}-\\u{1FAEA}\\u{1FAEF}-\\u{1FAF8}\\u{1FB00}-\\u{1FB92}\\u{1FB94}-\\u{1FBEF}\\u{1FBFA}]|~)","u"),q=d(/link|precode-code|html/,"g").replace("link",RegExp("\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("precode-",F?"(?<!`)()":"(^^|[^`])").replace("code",RegExp("(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),z=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,O=d(z,"u").replace(/punct/g,T).getRegex(),U=d(z,"u").replace(/punct/g,L).getRegex(),V="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",H=d(V,"gu").replace(/notPunctSpace/g,j).replace(/punctSpace/g,P).replace(/punct/g,T).getRegex(),W=d(V,"gu").replace(/notPunctSpace/g,N).replace(/punctSpace/g,$).replace(/punct/g,L).getRegex(),G=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,j).replace(/punctSpace/g,P).replace(/punct/g,T).getRegex(),Z=d(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),Q=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),K=d(x).replace("(?:--\x3e|$)","--\x3e").getRegex(),J=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",K).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),X=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Y=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",X).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ee=d(/^!?\[(label)\]\[(ref)\]/).replace("label",X).replace("ref",m).getRegex(),et=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",m).getRegex(),eu=d("reflink|nolink(?!\\()","g").replace("reflink",ee).replace("nolink",et).getRegex(),es=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,en={_backpedal:h,anyPunctuation:Z,autolink:Q,blockSkip:q,br:M,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:h,emStrongLDelim:O,emStrongRDelimAst:H,emStrongRDelimUnd:G,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Y,nolink:et,punctuation:R,reflink:ee,reflinkSearch:eu,tag:J,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:h},ei=o(r({},en),{link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",X).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X).getRegex()}),er=o(r({},en),{emStrongRDelimAst:W,emStrongLDelim:U,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",es).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",es).getRegex()}),eo=o(r({},er),{br:d(M).replace("{2,}","*").getRegex(),text:d(er.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),ea={normal:b,gfm:S,pedantic:I},el={normal:en,gfm:er,breaks:eo,pedantic:ei},ec={"&":"&","<":"<",">":">",'"':""","'":"'"},eh=e=>ec[e];function ed(e,t){if(t){if(p.escapeTest.test(e))return e.replace(p.escapeReplace,eh)}else if(p.escapeTestNoEncode.test(e))return e.replace(p.escapeReplaceNoEncode,eh);return e}function eF(e){try{e=encodeURI(e).replace(p.percentDecode,"%")}catch(e){return null}return e}function ep(e,t){var u;let s=e.replace(p.findPipe,(e,t,u)=>{let s=!1,n=t;for(;--n>=0&&"\\"===u[n];)s=!s;return s?"|":" |"}).split(p.splitPipe),n=0;if(s[0].trim()||s.shift(),!(s.length>0)||(null==(u=s.at(-1))?void 0:u.trim())||s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(p.slashPipe,"|");return s}function eA(e,t,u){let s=e.length;if(0===s)return"";let n=0;for(;n<s;){let i=e.charAt(s-n-1);if(i!==t||u)if(i!==t&&u)n++;else break;else n++}return e.slice(0,s-n)}function eC(e,t,u,s,n){let i=t.href,r=t.title||null,o=e[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:"!"===e[0].charAt(0)?"image":"link",raw:u,href:i,title:r,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}var eg=class{space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:eA(e,`
|
|
49
49
|
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],u=function(e,t,u){let s=e.match(u.other.indentCodeCompensation);if(null===s)return t;let n=s[1];return t.split(`
|
|
50
50
|
`).map(e=>{let t=e.match(u.other.beginningSpace);if(null===t)return e;let[s]=t;return s.length>=n.length?e.slice(n.length):e}).join(`
|
|
@@ -107,7 +107,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error
|
|
|
107
107
|
<h3 class="&__title">~Settings~</h3>
|
|
108
108
|
</div>
|
|
109
109
|
<div class="&__content"></div>
|
|
110
|
-
</div>`}updateContent(){return(0,s._)(function*(){let e=this.getElm("content");if(!e)return;e.innerHTML="";let t=this.options,u=t.allowEditDisplayMode||t.allowEditPanelWidth||t.allowEditTheme,s=t.allowEditDialogSettings;if(u){let t=document.createElement("div");t.className=this.getFullElName("section");let u=document.createElement("h4");u.className=this.getFullElName("section-title"),u.textContent=this.j.i18n("General Settings"),t.appendChild(u),this.globalSettings=new o.UIGlobalSettings(this.j,this.state,this.options),t.appendChild(this.globalSettings.container),e.appendChild(t)}let n=this.getConversation();if(s&&n){let t=document.createElement("div");t.className=this.getFullElName("section");let u=document.createElement("h4");u.className=this.getFullElName("section-title"),u.textContent=this.j.i18n("Conversation Settings"),t.appendChild(u),this.dialogSettings=new r.UIDialogSettings(this.j,()=>this.getConversation(),this.updateConversation,this.state,this.options),t.appendChild(this.dialogSettings.container),e.appendChild(t)}}).call(this)}destruct(){var e,t;null==(e=this.globalSettings)||e.destruct(),null==(t=this.dialogSettings)||t.destruct(),super.destruct()}constructor(e,t,u,s,i){super(e),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"getConversation",void 0),(0,n._)(this,"updateConversation",void 0),(0,n._)(this,"globalSettings",void 0),(0,n._)(this,"dialogSettings",void 0),this.state=t,this.options=u,this.getConversation=s,this.updateConversation=i,this.globalSettings=null,this.dialogSettings=null}}(0,i.__decorate)([(0,a.watch)("state.theme"),(0,a.hook)("ready")],c.prototype,"onChangeTheme",null),c=(0,i.__decorate)([a.component],c)},79766:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html",{allowEmpty:!0});(0,n.throwIfAborted)(u);try{return e.s.focus(),e.value=s,e.synchronizeValues(),{success:!0,message:`Document content was replaced with provided HTML(${s.length} characters)`}}catch(e){throw Error(`Failed to replace HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}})()}},80453:function(e,t,u){"use strict";u.d(t,{UIConversationListItem:function(){return l}});var s=u(82749),n=u(31635),i=u(65478),r=u(67510),o=u(62843),a=u(26866);class l extends r.UIElement{className(){return"UIConversationListItem"}render(){return'<div class="jodit-ui-conversation-list__item"></div>'}setActive(e){this.isActive=e,this.updateContent()}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-id",this.conversation.id),this.isActive?e.classList.add("jodit-ui-conversation-list__item_active"):e.classList.remove("jodit-ui-conversation-list__item_active");let t=this.j.c.div("jodit-ui-conversation-list__item-avatar");t.textContent="AI",e.appendChild(t);let u=this.j.c.div("jodit-ui-conversation-list__item-wrapper"),s=this.j.c.div("jodit-ui-conversation-list__item-content"),n=this.j.c.div("jodit-ui-conversation-list__item-title");if(n.textContent=this.conversation.title,s.appendChild(n),this.opts.showTimestamps){let e=this.j.c.div("jodit-ui-conversation-list__item-meta");e.textContent=this.opts.formatTimestamp(this.conversation.updated,this.j.i18n.bind(this.j)),s.appendChild(e)}if(u.appendChild(s),this.conversation.messageCount>0){let e=this.j.c.div("jodit-ui-conversation-list__item-badge");e.textContent=String(this.conversation.messageCount),u.appendChild(e)}e.appendChild(u),this.deleteButton||(this.deleteButton=new o.UIButton(this.j,{icon:{name:"bin"},variant:"outline",size:"tiny",tooltip:"Delete conversation"}),this.deleteButton.container.classList.add("jodit-ui-conversation-list__item-delete"),this.deleteButton.onAction(e=>{e.stopPropagation(),this.onDelete()})),e.appendChild(this.deleteButton.container)}onClick(){this.j.e.fire("selectConversation.ai-assistant-pro",this.conversation.id)}onDelete(){a.Confirm.call(void 0,this.j.i18n("Are you sure you want to delete this conversation?"),this.j.i18n("Delete conversation"),e=>{e&&this.j.e.fire("deleteConversation.ai-assistant-pro",this.conversation.id)})}destruct(){var e;null==(e=this.deleteButton)||e.destruct(),super.destruct()}constructor(e,t,u=!1,n){super(e),(0,s._)(this,"opts",void 0),(0,s._)(this,"conversation",void 0),(0,s._)(this,"isActive",void 0),(0,s._)(this,"deleteButton",void 0),this.opts=n,this.conversation=t,this.isActive=u,this.updateContent()}}(0,n.__decorate)([(0,i.watch)("container:click")],l.prototype,"onClick",null),(0,n.__decorate)([i.autobind],l.prototype,"onDelete",null),l=(0,n.__decorate)([i.component],l)},81835:function(e,t,u){"use strict";u.d(t,{UIArtifact:function(){return a}});var s=u(82749),n=u(31635),i=u(65478),r=u(29960),o=u(67510);class a extends o.UIElement{className(){return"UIArtifact"}onReady(){this.renderArtifact()}renderArtifact(){let e=this.container;e.innerHTML="",(0,r.attr)(e,{"data-type":this.artifact.type,"data-status":this.artifact.status});let t=this.createStatusIndicator();if(e.appendChild(t),"pending"===this.artifact.status||"generating"===this.artifact.status)return void this.renderLoading();if("failed"===this.artifact.status)return void this.renderError();switch(this.artifact.type){case"image":this.renderImage();break;case"audio":this.renderAudio();break;case"file":this.renderFile();break;case"json":this.renderJSON();break;default:this.renderOther()}}createStatusIndicator(){let e=this.j.c.div(this.getFullElName("status"));e.setAttribute("data-status",this.artifact.status);let t=this.j.c.span(this.getFullElName("status-icon")),u=this.j.c.span(this.getFullElName("status-text"));switch(this.artifact.status){case"pending":t.textContent="⏳",u.textContent=this.j.i18n("Pending");break;case"generating":t.textContent="\uD83D\uDD04",u.textContent=this.j.i18n("Generating...");break;case"ready":t.textContent="✅",u.textContent=this.j.i18n("Ready");break;case"failed":t.textContent="❌",u.textContent=this.j.i18n("Failed")}return e.appendChild(t),e.appendChild(u),e}renderLoading(){let e=this.j.c.div(this.getFullElName("loader")),t=this.j.c.div(this.getFullElName("spinner")),u=this.j.c.div(this.getFullElName("loader-message"));u.textContent=this.j.i18n("Generating artifact..."),e.appendChild(t),e.appendChild(u),this.container.appendChild(e)}renderError(){var e;let t=this.j.c.div(this.getFullElName("error")),u=this.j.c.div(this.getFullElName("error-icon"));u.textContent="❌";let s=this.j.c.div(this.getFullElName("error-message"));s.textContent=(null==(e=this.artifact.metadata)?void 0:e.error)||this.j.i18n("Failed to generate artifact"),t.appendChild(u),t.appendChild(s),this.container.appendChild(t)}renderImage(){var e,t;if(!this.artifact.data)return;let u=this.j.c.div(this.getFullElName("content")),s=this.j.c.element("img",{class:this.getFullElName("image")});if("url"===this.artifact.data.kind)s.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"image/png";s.src=`data:${e};base64,${this.artifact.data.base64}`}if(s.alt=(null==(e=this.artifact.metadata)?void 0:e.alt)||"AI Generated Image",u.appendChild(s),null==(t=this.artifact.metadata)?void 0:t.caption){let e=this.j.c.div(this.getFullElName("caption"));e.textContent=this.artifact.metadata.caption,u.appendChild(e)}this.container.appendChild(u)}renderAudio(){if(!this.artifact.data)return;let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.element("audio",{class:this.getFullElName("audio"),controls:"controls"});if("url"===this.artifact.data.kind)t.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"audio/mpeg";t.src=`data:${e};base64,${this.artifact.data.base64}`}e.appendChild(t),this.container.appendChild(e)}renderFile(){var e,t,u;if(!this.artifact.data)return;let s=this.j.c.div(this.getFullElName("content")),n=this.j.c.div(this.getFullElName("file-card")),i=this.j.c.div(this.getFullElName("file-icon"));i.textContent="\uD83D\uDCC4";let r=this.j.c.div(this.getFullElName("file-info")),o=this.j.c.div(this.getFullElName("file-name"));o.textContent=(null==(e=this.artifact.metadata)?void 0:e.filename)||"download.file";let a=this.j.c.div(this.getFullElName("file-size"));(null==(t=this.artifact.metadata)?void 0:t.size)&&(a.textContent=this.formatFileSize(this.artifact.metadata.size)),r.appendChild(o),r.appendChild(a);let l=this.j.c.element("a",{class:this.getFullElName("download-btn"),download:(null==(u=this.artifact.metadata)?void 0:u.filename)||"download.file"});if(l.textContent=this.j.i18n("Download"),"url"===this.artifact.data.kind)l.href=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"application/octet-stream";l.href=`data:${e};base64,${this.artifact.data.base64}`}n.appendChild(i),n.appendChild(r),n.appendChild(l),s.appendChild(n),this.container.appendChild(s)}renderJSON(){let e;if(!this.artifact.data)return;let t=this.j.c.div(this.getFullElName("content")),u=this.j.c.element("pre",{class:this.getFullElName("json")}),s=this.j.c.element("code");if("url"===this.artifact.data.kind)s.textContent=this.j.i18n("JSON data at URL");else if("base64"===this.artifact.data.kind)try{let t=atob(this.artifact.data.base64);e=JSON.parse(t),s.textContent=JSON.stringify(e,null,2)}catch(e){s.textContent=this.j.i18n("Invalid JSON data")}u.appendChild(s),t.appendChild(u),this.container.appendChild(t)}renderOther(){let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.div(this.getFullElName("placeholder")),u=this.j.c.div(this.getFullElName("placeholder-icon"));u.textContent="\uD83D\uDCE6";let s=this.j.c.div(this.getFullElName("placeholder-text"));s.textContent=this.j.i18n("Unknown artifact type"),t.appendChild(u),t.appendChild(s),e.appendChild(t),this.container.appendChild(e)}formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(2)} KB`:e<0x40000000?`${(e/1048576).toFixed(2)} MB`:`${(e/0x40000000).toFixed(2)} GB`}updateArtifact(e){this.artifact=e,this.renderArtifact()}constructor(e,t){super(e),(0,s._)(this,"artifact",void 0),this.artifact=t}}(0,n.__decorate)([(0,i.hook)("ready")],a.prototype,"onReady",null),a=(0,n.__decorate)([i.component],a)},85130:function(e,t,u){"use strict";u.d(t,{execute:function(){return i}});var s=u(77688),n=u(6689);function i(e,t,u){return(0,s._)(function*(){let{contextCharsBefore:s,contextCharsAfter:i}=t;if((0,n.throwIfAborted)(u),e.s.restore(),e.s.isCollapsed())return{hasSelection:!1};let r=e.s.html,o=e.s.range,a=o.toString(),l={hasSelection:!0,html:r,text:a,startContainer:o.startContainer.nodeName,endContainer:o.endContainer.nodeName};if(s>0||i>0){let t=e.editor.textContent||"",u=t.substring(0,t.indexOf(a)),n=t.substring(t.indexOf(a)+a.length);s>0&&(l.contextBefore=u.slice(-s)),i>0&&(l.contextAfter=n.slice(0,i))}return l})()}},86428:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Background rounded rect --\x3e <rect x="1" y="1" width="22" height="22" rx="3"/> \x3c!-- Letter A - outer shape --\x3e <polygon points="8,5 2,19 5,19 6.5,16 11.5,16 13,19 16,19 10,5" fill="white"/> \x3c!-- Letter A - inner triangle (hole) --\x3e <polygon points="9,9 7.5,13 10.5,13" fill="currentColor"/> \x3c!-- Letter I --\x3e <rect x="17" y="5" width="3" height="14" fill="white"/> </svg>'},86449:function(e,t,u){"use strict";u.d(t,{APIClient:function(){return l}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(82758),a=u(21537);class l{sendRequest(e,t,u,n,i){return(0,s._)(function*(){let{apiRequest:s,requestTimeout:r,maxRetries:l}=this.jodit.o.aiAssistantPro;if(!s)throw Error("AI Assistant Pro callback is not configured");let c=new AbortController;this.abortControllers.add(c);try{let h=this.buildRequestContext(e,t,u,n,i),d=null;for(let e=0;l>=e;e++)try{if(c.signal.aborted)throw(0,a.abort)();let e=setTimeout(()=>{c.abort()},r);try{let t=yield s(h,c.signal);return clearTimeout(e),this.validateResponse(t),t}catch(t){throw clearTimeout(e),t}}catch(t){if(d=t,o.IS_PROD,l>e){let t=this.calculateRetryDelay(e);yield this.sleep(t)}else throw t}throw d||Error("API request failed after all retries")}finally{this.abortControllers.delete(c)}}).call(this)}abort(){this.abortControllers.forEach(e=>{e.abort()}),this.abortControllers.clear()}isInProgress(){return this.abortControllers.size>0}buildRequestContext(e,t,u,s,n){let{apiMode:o,instructions:a}=this.jodit.o.aiAssistantPro,l={mode:o,conversationId:e,tools:this.toolRegistry.getAllTools(),selectionContexts:s,conversationOptions:n,instructions:a},c=[];if("full"===o)c=t;else if(u){let e=t.findIndex(e=>e.id===u);c=-1!==e?t.slice(e+1):t,l=(0,r._)((0,i._)({},l),{parentMessageId:u})}else c=t;return(0,r._)((0,i._)({},l),{messages:this.expandToolMessages(c,t.find(e=>e.id===u))})}expandToolMessages(e,t){let u=[];for(let t of e)u.push(t),this.expandToolResultsMessage(t,u);return t&&this.expandToolResultsMessage(t,u),u}expandToolResultsMessage(e,t){if(e.toolCalls&&e.toolCalls.length>0)for(let s of e.toolCalls){var u;let n=null!=(u=s.result)?u:{error:"result not found"};if(t.find(e=>e.id===`${s.id}-result`))continue;let i={id:`${s.id}-result`,role:"tool",content:n.error?`Error: ${n.error}`:JSON.stringify(n.result),timestamp:e.timestamp,toolResults:[{toolCallId:s.id,result:n}]};t.push(i)}}validateResponse(e){if("final"!==e.mode)return;let t=e.response;if(!t)throw Error("API returned empty response");if(!t.responseId)throw Error("API response missing messageId");if(void 0===t.content)throw Error("API response missing content");if(void 0===t.finished)throw Error("API response missing finished flag");if(t.toolCalls){if(!Array.isArray(t.toolCalls))throw Error("API response toolCalls must be an array");t.toolCalls.forEach((e,t)=>{if(!e.id)throw Error(`Tool call at index ${t} is missing id`);if(!e.name)throw Error(`Tool call at index ${t} is missing name`);if(!e.arguments||"object"!=typeof e.arguments)throw Error(`Tool call at index ${t} has invalid arguments`)})}}calculateRetryDelay(e){let{retryDelay:t}=this.jodit.o.aiAssistantPro;return t*Math.pow(2,e)+Math.random()*t}sleep(e){return new Promise(t=>setTimeout(t,e))}destruct(){this.abort()}constructor(e,t){(0,n._)(this,"jodit",void 0),(0,n._)(this,"toolRegistry",void 0),(0,n._)(this,"abortControllers",void 0),this.jodit=e,this.toolRegistry=t,this.abortControllers=new Set}}},86563:function(e,t,u){"use strict";u.d(t,{UIMessageList:function(){return l}});var s=u(82749),n=u(31635),i=u(51359),r=u(65478),o=u(62405),a=u(31356);class l extends o.UIGroup{className(){return"UIMessageList"}render(){return'<div class="&__scroll-container"></div>'}afterRender(){this.scrollContainer=this.container}onUserScroll(){if(!this.scrollContainer)return;let{scrollTop:e,scrollHeight:t,clientHeight:u}=this.scrollContainer;this.autoScrollEnabled=t-e-u<10}onMessageSent(){this.autoScrollEnabled=!0,this.scrollToBottom()}appendChildToContainer(e){this.scrollContainer&&this.scrollContainer.appendChild(e)}setMessages(e){let t=this.messages.slice();this.messages=e.slice(),this.updateMessageList(t),this.scrollToBottom()}updateMessageList(e){let t=a.ListReconciler.reconcile(e,this.messages,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.content===t.content&&e.timestamp===t.timestamp&&JSON.stringify(e.artifacts)===JSON.stringify(t.artifacts)&&JSON.stringify(e.toolCalls)===JSON.stringify(t.toolCalls),preserveOrder:!0});t.toRemove.forEach(e=>{let t=this.messageItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.messageItems.delete(e.id))}),t.toUpdate.forEach(({newItem:e,index:t})=>{let u=this.messageItems.get(e.id);u&&(u.updateMessage(e),this.elements.indexOf(u)!==t&&t<this.elements.length&&(this.remove(u),this.append(u,t)))}),t.toCreate.forEach(e=>{let t=new i.UIMessageListItem(this.j,e,this.params);this.messageItems.set(e.id,t);let u=this.messages.indexOf(e);this.append(t,u)})}scrollToBottom(){!this.j.isDestructed&&this.autoScrollEnabled&&(this.container.scrollTop=this.container.scrollHeight)}destruct(){this.messageItems.clear(),this.messages=[],super.destruct()}constructor(e,t){super(e),(0,s._)(this,"params",void 0),(0,s._)(this,"messages",void 0),(0,s._)(this,"messageItems",void 0),(0,s._)(this,"scrollContainer",void 0),(0,s._)(this,"autoScrollEnabled",void 0),this.params=t,this.messages=[],this.messageItems=new Map,this.autoScrollEnabled=!0}}(0,n.__decorate)([(0,r.hook)("ready")],l.prototype,"afterRender",null),(0,n.__decorate)([(0,r.watch)(["scrollContainer:wheel","scrollContainer:scroll","scrollContainer:touchmove"]),(0,r.throttle)(e=>e.defaultTimeout)],l.prototype,"onUserScroll",null),(0,n.__decorate)([(0,r.watch)(":messageSent.ai-assistant-pro")],l.prototype,"onMessageSent",null),(0,n.__decorate)([r.autobind],l.prototype,"setMessages",null),(0,n.__decorate)([(0,r.throttle)(e=>2*e.defaultTimeout)],l.prototype,"scrollToBottom",null),l=(0,n.__decorate)([r.component],l)},89929:function(e,t,u){"use strict";function s(e){var t,u,s,i=2;for("u">typeof Symbol&&(u=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(u&&null!=(t=e[u]))return t.call(e);if(s&&null!=(t=e[s]))return new n(t.call(e));u="@@asyncIterator",s="@@iterator"}throw TypeError("Object is not async iterable")}function n(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(n=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var u=this.s.return;return void 0===u?Promise.resolve({value:e,done:!0}):t(u.apply(this.s,arguments))},throw:function(e){var u=this.s.return;return void 0===u?Promise.reject(e):t(u.apply(this.s,arguments))}},new n(e)}u.d(t,{_:function(){return s}})},90022:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="writeDocument",n="Write (replace) the entire document content with new HTML",i=[{name:"html",type:"string",description:"HTML content to set as the document",required:!0}],r=!0},90991:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(52826),r=u(85130);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},91140:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(22732);function r(e,t,u){return(0,s._)(function*(){let{offset:s,limit:r,query:o}=t;(0,n.throwIfAborted)(u);let a=[];Array.from(e.editor.children).forEach((e,t)=>{i.Dom.isElement(e)&&a.push({blockIndex:t,tagName:e.tagName.toLowerCase(),content:e.innerHTML,textContent:e.textContent||"",classList:Array.from(e.classList)})});let l=a;if(o&&"string"==typeof o){let e=o.toLowerCase();l=a.filter(t=>t.textContent.toLowerCase().includes(e))}let c=Math.max(0,Math.min("number"==typeof s?s:0,l.length)),h=void 0!==r?Math.min(c+r,l.length):l.length;return{blocks:l.slice(c,h),total:a.length,offset:c,limit:void 0!==r?r:void 0}})()}},93677:function(e,t,u){"use strict";u.d(t,{UIPermissionRequest:function(){return l}});var s=u(82749),n=u(31635),i=u(65478),r=u(67510),o=u(62843),a=u(12234);class l extends r.UIElement{className(){return"UIPermissionRequest"}setToolCall(e){this.toolCall=e,this.updateContent()}setParentView(e){var t,u,s;return null==(t=this.scopeSelect)||t.setParentView(e),null==(u=this.approveButton)||u.setParentView(e),null==(s=this.denyButton)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
110
|
+
</div>`}updateContent(){return(0,s._)(function*(){let e=this.getElm("content");if(!e)return;e.innerHTML="";let t=this.options,u=t.allowEditDisplayMode||t.allowEditPanelWidth||t.allowEditTheme,s=t.allowEditDialogSettings;if(u){let t=document.createElement("div");t.className=this.getFullElName("section");let u=document.createElement("h4");u.className=this.getFullElName("section-title"),u.textContent=this.j.i18n("General Settings"),t.appendChild(u),this.globalSettings=new o.UIGlobalSettings(this.j,this.state,this.options),t.appendChild(this.globalSettings.container),e.appendChild(t)}let n=this.getConversation();if(s&&n){let t=document.createElement("div");t.className=this.getFullElName("section");let u=document.createElement("h4");u.className=this.getFullElName("section-title"),u.textContent=this.j.i18n("Conversation Settings"),t.appendChild(u),this.dialogSettings=new r.UIDialogSettings(this.j,()=>this.getConversation(),this.updateConversation,this.state,this.options),t.appendChild(this.dialogSettings.container),e.appendChild(t)}}).call(this)}destruct(){var e,t;null==(e=this.globalSettings)||e.destruct(),null==(t=this.dialogSettings)||t.destruct(),super.destruct()}constructor(e,t,u,s,i){super(e),(0,n._)(this,"state",void 0),(0,n._)(this,"options",void 0),(0,n._)(this,"getConversation",void 0),(0,n._)(this,"updateConversation",void 0),(0,n._)(this,"globalSettings",void 0),(0,n._)(this,"dialogSettings",void 0),this.state=t,this.options=u,this.getConversation=s,this.updateConversation=i,this.globalSettings=null,this.dialogSettings=null}}(0,i.__decorate)([(0,a.watch)("state.theme"),(0,a.hook)("ready")],c.prototype,"onChangeTheme",null),c=(0,i.__decorate)([a.component],c)},79766:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(49459);function r(e,t,u){return(0,s._)(function*(){let s=(0,i.requireString)(t,"html",{allowEmpty:!0});(0,n.throwIfAborted)(u);try{return e.s.focus(),e.value=s,e.synchronizeValues(),{success:!0,message:`Document content was replaced with provided HTML(${s.length} characters)`}}catch(e){throw Error(`Failed to replace HTML: ${(null==e?void 0:e.message)||"Unknown error"}`)}})()}},80453:function(e,t,u){"use strict";u.d(t,{UIConversationListItem:function(){return l}});var s=u(82749),n=u(31635),i=u(65478),r=u(67510),o=u(62843),a=u(26866);class l extends r.UIElement{className(){return"UIConversationListItem"}render(){return'<div class="jodit-ui-conversation-list__item"></div>'}setActive(e){this.isActive=e,this.updateContent()}updateContent(){let e=this.container;e.innerHTML="",e.setAttribute("data-id",this.conversation.id),this.isActive?e.classList.add("jodit-ui-conversation-list__item_active"):e.classList.remove("jodit-ui-conversation-list__item_active");let t=this.j.c.div("jodit-ui-conversation-list__item-avatar");t.textContent="AI",e.appendChild(t);let u=this.j.c.div("jodit-ui-conversation-list__item-wrapper"),s=this.j.c.div("jodit-ui-conversation-list__item-content"),n=this.j.c.div("jodit-ui-conversation-list__item-title");if(n.textContent=this.conversation.title,s.appendChild(n),this.opts.showTimestamps){let e=this.j.c.div("jodit-ui-conversation-list__item-meta");e.textContent=this.opts.formatTimestamp(this.conversation.updated,this.j.i18n.bind(this.j)),s.appendChild(e)}if(u.appendChild(s),this.conversation.messageCount>0){let e=this.j.c.div("jodit-ui-conversation-list__item-badge");e.textContent=String(this.conversation.messageCount),u.appendChild(e)}e.appendChild(u),this.deleteButton||(this.deleteButton=new o.UIButton(this.j,{icon:{name:"bin"},variant:"outline",size:"tiny",tooltip:"Delete conversation"}),this.deleteButton.container.classList.add("jodit-ui-conversation-list__item-delete"),this.deleteButton.onAction(e=>{e.stopPropagation(),this.onDelete()})),e.appendChild(this.deleteButton.container)}onClick(){this.j.e.fire("selectConversation.ai-assistant-pro",this.conversation.id)}onDelete(){a.Confirm.call(void 0,this.j.i18n("Are you sure you want to delete this conversation?"),this.j.i18n("Delete conversation"),e=>{e&&this.j.e.fire("deleteConversation.ai-assistant-pro",this.conversation.id)})}destruct(){var e;null==(e=this.deleteButton)||e.destruct(),super.destruct()}constructor(e,t,u=!1,n){super(e),(0,s._)(this,"opts",void 0),(0,s._)(this,"conversation",void 0),(0,s._)(this,"isActive",void 0),(0,s._)(this,"deleteButton",void 0),this.opts=n,this.conversation=t,this.isActive=u,this.updateContent()}}(0,n.__decorate)([(0,i.watch)("container:click")],l.prototype,"onClick",null),(0,n.__decorate)([i.autobind],l.prototype,"onDelete",null),l=(0,n.__decorate)([i.component],l)},81835:function(e,t,u){"use strict";u.d(t,{UIArtifact:function(){return a}});var s=u(82749),n=u(31635),i=u(65478),r=u(29960),o=u(67510);class a extends o.UIElement{className(){return"UIArtifact"}onReady(){this.renderArtifact()}renderArtifact(){let e=this.container;e.innerHTML="",(0,r.attr)(e,{"data-type":this.artifact.type,"data-status":this.artifact.status});let t=this.createStatusIndicator();if(e.appendChild(t),"pending"===this.artifact.status||"generating"===this.artifact.status)return void this.renderLoading();if("failed"===this.artifact.status)return void this.renderError();switch(this.artifact.type){case"image":this.renderImage();break;case"audio":this.renderAudio();break;case"file":this.renderFile();break;case"json":this.renderJSON();break;default:this.renderOther()}}createStatusIndicator(){let e=this.j.c.div(this.getFullElName("status"));e.setAttribute("data-status",this.artifact.status);let t=this.j.c.span(this.getFullElName("status-icon")),u=this.j.c.span(this.getFullElName("status-text"));switch(this.artifact.status){case"pending":t.textContent="⏳",u.textContent=this.j.i18n("Pending");break;case"generating":t.textContent="\uD83D\uDD04",u.textContent=this.j.i18n("Generating...");break;case"ready":t.textContent="✅",u.textContent=this.j.i18n("Ready");break;case"failed":t.textContent="❌",u.textContent=this.j.i18n("Failed")}return e.appendChild(t),e.appendChild(u),e}renderLoading(){let e=this.j.c.div(this.getFullElName("loader")),t=this.j.c.div(this.getFullElName("spinner")),u=this.j.c.div(this.getFullElName("loader-message"));u.textContent=this.j.i18n("Generating artifact..."),e.appendChild(t),e.appendChild(u),this.container.appendChild(e)}renderError(){var e;let t=this.j.c.div(this.getFullElName("error")),u=this.j.c.div(this.getFullElName("error-icon"));u.textContent="❌";let s=this.j.c.div(this.getFullElName("error-message"));s.textContent=(null==(e=this.artifact.metadata)?void 0:e.error)||this.j.i18n("Failed to generate artifact"),t.appendChild(u),t.appendChild(s),this.container.appendChild(t)}renderImage(){var e,t;if(!this.artifact.data)return;let u=this.j.c.div(this.getFullElName("content")),s=this.j.c.element("img",{class:this.getFullElName("image")});if("url"===this.artifact.data.kind)s.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"image/png";s.src=`data:${e};base64,${this.artifact.data.base64}`}if(s.alt=(null==(e=this.artifact.metadata)?void 0:e.alt)||"AI Generated Image",u.appendChild(s),null==(t=this.artifact.metadata)?void 0:t.caption){let e=this.j.c.div(this.getFullElName("caption"));e.textContent=this.artifact.metadata.caption,u.appendChild(e)}this.container.appendChild(u)}renderAudio(){if(!this.artifact.data)return;let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.element("audio",{class:this.getFullElName("audio"),controls:"controls"});if("url"===this.artifact.data.kind)t.src=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"audio/mpeg";t.src=`data:${e};base64,${this.artifact.data.base64}`}e.appendChild(t),this.container.appendChild(e)}renderFile(){var e,t,u;if(!this.artifact.data)return;let s=this.j.c.div(this.getFullElName("content")),n=this.j.c.div(this.getFullElName("file-card")),i=this.j.c.div(this.getFullElName("file-icon"));i.textContent="\uD83D\uDCC4";let r=this.j.c.div(this.getFullElName("file-info")),o=this.j.c.div(this.getFullElName("file-name"));o.textContent=(null==(e=this.artifact.metadata)?void 0:e.filename)||"download.file";let a=this.j.c.div(this.getFullElName("file-size"));(null==(t=this.artifact.metadata)?void 0:t.size)&&(a.textContent=this.formatFileSize(this.artifact.metadata.size)),r.appendChild(o),r.appendChild(a);let l=this.j.c.element("a",{class:this.getFullElName("download-btn"),download:(null==(u=this.artifact.metadata)?void 0:u.filename)||"download.file"});if(l.textContent=this.j.i18n("Download"),"url"===this.artifact.data.kind)l.href=this.artifact.data.url;else if("base64"===this.artifact.data.kind){let e=this.artifact.mimeType||"application/octet-stream";l.href=`data:${e};base64,${this.artifact.data.base64}`}n.appendChild(i),n.appendChild(r),n.appendChild(l),s.appendChild(n),this.container.appendChild(s)}renderJSON(){let e;if(!this.artifact.data)return;let t=this.j.c.div(this.getFullElName("content")),u=this.j.c.element("pre",{class:this.getFullElName("json")}),s=this.j.c.element("code");if("url"===this.artifact.data.kind)s.textContent=this.j.i18n("JSON data at URL");else if("base64"===this.artifact.data.kind)try{let t=atob(this.artifact.data.base64);e=JSON.parse(t),s.textContent=JSON.stringify(e,null,2)}catch(e){s.textContent=this.j.i18n("Invalid JSON data")}u.appendChild(s),t.appendChild(u),this.container.appendChild(t)}renderOther(){let e=this.j.c.div(this.getFullElName("content")),t=this.j.c.div(this.getFullElName("placeholder")),u=this.j.c.div(this.getFullElName("placeholder-icon"));u.textContent="\uD83D\uDCE6";let s=this.j.c.div(this.getFullElName("placeholder-text"));s.textContent=this.j.i18n("Unknown artifact type"),t.appendChild(u),t.appendChild(s),e.appendChild(t),this.container.appendChild(e)}formatFileSize(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(2)} KB`:e<0x40000000?`${(e/1048576).toFixed(2)} MB`:`${(e/0x40000000).toFixed(2)} GB`}updateArtifact(e){this.artifact=e,this.renderArtifact()}constructor(e,t){super(e),(0,s._)(this,"artifact",void 0),this.artifact=t}}(0,n.__decorate)([(0,i.hook)("ready")],a.prototype,"onReady",null),a=(0,n.__decorate)([i.component],a)},85130:function(e,t,u){"use strict";u.d(t,{execute:function(){return i}});var s=u(77688),n=u(6689);function i(e,t,u){return(0,s._)(function*(){let{contextCharsBefore:s,contextCharsAfter:i}=t;if((0,n.throwIfAborted)(u),e.s.restore(),e.s.isCollapsed())return{hasSelection:!1};let r=e.s.html,o=e.s.range,a=o.toString(),l={hasSelection:!0,html:r,text:a,startContainer:o.startContainer.nodeName,endContainer:o.endContainer.nodeName};if(s>0||i>0){let t=e.editor.textContent||"",u=t.substring(0,t.indexOf(a)),n=t.substring(t.indexOf(a)+a.length);s>0&&(l.contextBefore=u.slice(-s)),i>0&&(l.contextAfter=n.slice(0,i))}return l})()}},86428:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> \x3c!-- Background rounded rect --\x3e <rect x="1" y="1" width="22" height="22" rx="3"/> \x3c!-- Letter A - outer shape --\x3e <polygon points="8,5 2,19 5,19 6.5,16 11.5,16 13,19 16,19 10,5" fill="white"/> \x3c!-- Letter A - inner triangle (hole) --\x3e <polygon points="9,9 7.5,13 10.5,13" fill="currentColor"/> \x3c!-- Letter I --\x3e <rect x="17" y="5" width="3" height="14" fill="white"/> </svg>'},86449:function(e,t,u){"use strict";u.d(t,{APIClient:function(){return l}});var s=u(77688),n=u(82749),i=u(56075),r=u(11886),o=u(82758),a=u(21537);class l{sendRequest(e,t,u,n,i){return(0,s._)(function*(){let{apiRequest:s,requestTimeout:r,maxRetries:l}=this.jodit.o.aiAssistantPro;if(!s)throw Error("AI Assistant Pro callback is not configured");let c=new AbortController;this.abortControllers.add(c);try{let h=this.buildRequestContext(e,t,u,n,i),d=null;for(let e=0;l>=e;e++)try{if(c.signal.aborted)throw(0,a.abort)();let e=setTimeout(()=>{c.abort()},r);try{let t=yield s(h,c.signal);return clearTimeout(e),this.validateResponse(t),t}catch(t){throw clearTimeout(e),t}}catch(t){if(d=t,o.IS_PROD,l>e){let t=this.calculateRetryDelay(e);yield this.sleep(t)}else throw t}throw d||Error("API request failed after all retries")}finally{this.abortControllers.delete(c)}}).call(this)}abort(){this.abortControllers.forEach(e=>{e.abort()}),this.abortControllers.clear()}isInProgress(){return this.abortControllers.size>0}buildRequestContext(e,t,u,s,n){let{apiMode:o,instructions:a}=this.jodit.o.aiAssistantPro,l={mode:o,conversationId:e,tools:this.toolRegistry.getAllTools(),selectionContexts:s,conversationOptions:n,instructions:a},c=[];if("full"===o)c=t;else if(u){let e=t.findIndex(e=>e.id===u);c=-1!==e?t.slice(e+1):t,l=(0,r._)((0,i._)({},l),{parentMessageId:u})}else c=t;return(0,r._)((0,i._)({},l),{messages:this.expandToolMessages(c,t.find(e=>e.id===u))})}expandToolMessages(e,t){let u=[];for(let t of e)u.push(t),this.expandToolResultsMessage(t,u);return t&&this.expandToolResultsMessage(t,u),u}expandToolResultsMessage(e,t){if(e.toolCalls&&e.toolCalls.length>0)for(let s of e.toolCalls){var u;let n=null!=(u=s.result)?u:{error:"result not found"};if(t.find(e=>e.id===`${s.id}-result`))continue;let i={id:`${s.id}-result`,role:"tool",content:n.error?`Error: ${n.error}`:JSON.stringify(n.result),timestamp:e.timestamp,toolResults:[{toolCallId:s.id,result:n}]};t.push(i)}}validateResponse(e){if("final"!==e.mode)return;let t=e.response;if(!t)throw Error("API returned empty response");if(!t.responseId)throw Error("API response missing responseId");if(void 0===t.content)throw Error("API response missing content");if(void 0===t.finished)throw Error("API response missing finished flag");if(t.toolCalls){if(!Array.isArray(t.toolCalls))throw Error("API response toolCalls must be an array");t.toolCalls.forEach((e,t)=>{if(!e.id)throw Error(`Tool call at index ${t} is missing id`);if(!e.name)throw Error(`Tool call at index ${t} is missing name`);if(!e.arguments||"object"!=typeof e.arguments)throw Error(`Tool call at index ${t} has invalid arguments`)})}}calculateRetryDelay(e){let{retryDelay:t}=this.jodit.o.aiAssistantPro;return t*Math.pow(2,e)+Math.random()*t}sleep(e){return new Promise(t=>setTimeout(t,e))}destruct(){this.abort()}constructor(e,t){(0,n._)(this,"jodit",void 0),(0,n._)(this,"toolRegistry",void 0),(0,n._)(this,"abortControllers",void 0),this.jodit=e,this.toolRegistry=t,this.abortControllers=new Set}}},86563:function(e,t,u){"use strict";u.d(t,{UIMessageList:function(){return l}});var s=u(82749),n=u(31635),i=u(51359),r=u(65478),o=u(62405),a=u(31356);class l extends o.UIGroup{className(){return"UIMessageList"}render(){return'<div class="&__scroll-container"></div>'}afterRender(){this.scrollContainer=this.container}onUserScroll(){if(!this.scrollContainer)return;let{scrollTop:e,scrollHeight:t,clientHeight:u}=this.scrollContainer;this.autoScrollEnabled=t-e-u<10}onMessageSent(){this.autoScrollEnabled=!0,this.scrollToBottom()}appendChildToContainer(e){this.scrollContainer&&this.scrollContainer.appendChild(e)}setMessages(e){let t=this.messages.slice();this.messages=e.slice(),this.updateMessageList(t),this.scrollToBottom()}updateMessageList(e){let t=a.ListReconciler.reconcile(e,this.messages,{getId:e=>e.id,isEqual:(e,t)=>e.id===t.id&&e.content===t.content&&e.timestamp===t.timestamp&&JSON.stringify(e.artifacts)===JSON.stringify(t.artifacts)&&JSON.stringify(e.toolCalls)===JSON.stringify(t.toolCalls),preserveOrder:!0});t.toRemove.forEach(e=>{let t=this.messageItems.get(e.id);t&&(-1!==this.elements.indexOf(t)&&(this.remove(t),t.destruct()),this.messageItems.delete(e.id))}),t.toUpdate.forEach(({newItem:e,index:t})=>{let u=this.messageItems.get(e.id);u&&(u.updateMessage(e),this.elements.indexOf(u)!==t&&t<this.elements.length&&(this.remove(u),this.append(u,t)))}),t.toCreate.forEach(e=>{let t=new i.UIMessageListItem(this.j,e,this.params);this.messageItems.set(e.id,t);let u=this.messages.indexOf(e);this.append(t,u)})}scrollToBottom(){!this.j.isDestructed&&this.autoScrollEnabled&&(this.container.scrollTop=this.container.scrollHeight)}destruct(){this.messageItems.clear(),this.messages=[],super.destruct()}constructor(e,t){super(e),(0,s._)(this,"params",void 0),(0,s._)(this,"messages",void 0),(0,s._)(this,"messageItems",void 0),(0,s._)(this,"scrollContainer",void 0),(0,s._)(this,"autoScrollEnabled",void 0),this.params=t,this.messages=[],this.messageItems=new Map,this.autoScrollEnabled=!0}}(0,n.__decorate)([(0,r.hook)("ready")],l.prototype,"afterRender",null),(0,n.__decorate)([(0,r.watch)(["scrollContainer:wheel","scrollContainer:scroll","scrollContainer:touchmove"]),(0,r.throttle)(e=>e.defaultTimeout)],l.prototype,"onUserScroll",null),(0,n.__decorate)([(0,r.watch)(":messageSent.ai-assistant-pro")],l.prototype,"onMessageSent",null),(0,n.__decorate)([r.autobind],l.prototype,"setMessages",null),(0,n.__decorate)([(0,r.throttle)(e=>2*e.defaultTimeout)],l.prototype,"scrollToBottom",null),l=(0,n.__decorate)([r.component],l)},89929:function(e,t,u){"use strict";function s(e){var t,u,s,i=2;for("u">typeof Symbol&&(u=Symbol.asyncIterator,s=Symbol.iterator);i--;){if(u&&null!=(t=e[u]))return t.call(e);if(s&&null!=(t=e[s]))return new n(t.call(e));u="@@asyncIterator",s="@@iterator"}throw TypeError("Object is not async iterable")}function n(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(n=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var u=this.s.return;return void 0===u?Promise.resolve({value:e,done:!0}):t(u.apply(this.s,arguments))},throw:function(e){var u=this.s.return;return void 0===u?Promise.reject(e):t(u.apply(this.s,arguments))}},new n(e)}u.d(t,{_:function(){return s}})},90022:function(e,t,u){"use strict";u.r(t),u.d(t,{description:function(){return n},name:function(){return s},parameters:function(){return i},requiresPermission:function(){return r}});let s="writeDocument",n="Write (replace) the entire document content with new HTML",i=[{name:"html",type:"string",description:"HTML content to set as the document",required:!0}],r=!0},90991:function(e,t,u){"use strict";var s=u(56075),n=u(11886),i=u(52826),r=u(85130);t.default=(0,n._)((0,s._)({},i),{execute:r.execute})},91140:function(e,t,u){"use strict";u.d(t,{execute:function(){return r}});var s=u(77688),n=u(6689),i=u(22732);function r(e,t,u){return(0,s._)(function*(){let{offset:s,limit:r,query:o}=t;(0,n.throwIfAborted)(u);let a=[];Array.from(e.editor.children).forEach((e,t)=>{i.Dom.isElement(e)&&a.push({blockIndex:t,tagName:e.tagName.toLowerCase(),content:e.innerHTML,textContent:e.textContent||"",classList:Array.from(e.classList)})});let l=a;if(o&&"string"==typeof o){let e=o.toLowerCase();l=a.filter(t=>t.textContent.toLowerCase().includes(e))}let c=Math.max(0,Math.min("number"==typeof s?s:0,l.length)),h=void 0!==r?Math.min(c+r,l.length):l.length;return{blocks:l.slice(c,h),total:a.length,offset:c,limit:void 0!==r?r:void 0}})()}},93677:function(e,t,u){"use strict";u.d(t,{UIPermissionRequest:function(){return l}});var s=u(82749),n=u(31635),i=u(65478),r=u(67510),o=u(62843),a=u(12234);class l extends r.UIElement{className(){return"UIPermissionRequest"}setToolCall(e){this.toolCall=e,this.updateContent()}setParentView(e){var t,u,s;return null==(t=this.scopeSelect)||t.setParentView(e),null==(u=this.approveButton)||u.setParentView(e),null==(s=this.denyButton)||s.setParentView(e),super.setParentView(e)}render(){return`<div class="&__container">
|
|
111
111
|
<div class="&__header">
|
|
112
112
|
<div class="&__icon"></div>
|
|
113
113
|
<div class="&__title">~Permission Required~</div>
|