vue-element-ui-x 1.0.51 → 1.1.1

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.
Files changed (38) hide show
  1. package/README.md +140 -140
  2. package/components.json +12 -12
  3. package/lib/components/Attachments/index.js +17 -17
  4. package/lib/components/EditorSender/index.js +1508 -0
  5. package/lib/components/FilesCard/index.js +16 -16
  6. package/lib/components/Prompts/index.js +21 -21
  7. package/lib/index.common.js +1 -1
  8. package/lib/index.esm.js +1 -1
  9. package/lib/index.js +1274 -287
  10. package/lib/index.umd.js +1 -1
  11. package/lib/locale/index.js +97 -97
  12. package/lib/locale/lang/ar.js +18 -18
  13. package/lib/locale/lang/ar.umd.js +17 -17
  14. package/lib/locale/lang/de.js +18 -18
  15. package/lib/locale/lang/de.umd.js +17 -17
  16. package/lib/locale/lang/en.js +18 -18
  17. package/lib/locale/lang/en.umd.js +17 -17
  18. package/lib/locale/lang/es.js +18 -18
  19. package/lib/locale/lang/es.umd.js +17 -17
  20. package/lib/locale/lang/fr.js +18 -18
  21. package/lib/locale/lang/fr.umd.js +17 -17
  22. package/lib/locale/lang/it.js +18 -18
  23. package/lib/locale/lang/it.umd.js +17 -17
  24. package/lib/locale/lang/ja.js +18 -18
  25. package/lib/locale/lang/ja.umd.js +17 -17
  26. package/lib/locale/lang/ko.js +18 -18
  27. package/lib/locale/lang/ko.umd.js +17 -17
  28. package/lib/locale/lang/pt-br.js +18 -18
  29. package/lib/locale/lang/pt-br.umd.js +17 -17
  30. package/lib/locale/lang/ru-RU.js +18 -18
  31. package/lib/locale/lang/ru-RU.umd.js +17 -17
  32. package/lib/locale/lang/zh-CN.js +18 -18
  33. package/lib/locale/lang/zh-CN.umd.js +17 -17
  34. package/lib/locale/lang/zh-TW.js +18 -18
  35. package/lib/locale/lang/zh-TW.umd.js +17 -17
  36. package/lib/locale/mixin.js +9 -9
  37. package/lib/mixins/index.js +250 -250
  38. package/package.json +77 -76
package/lib/index.js CHANGED
@@ -1262,71 +1262,71 @@ render._withStripped = true;
1262
1262
  /* harmony default export */ const mainvue_type_script_lang_js = ({
1263
1263
  name: 'ElXPrompts',
1264
1264
  props: {
1265
- /**
1266
- * 包含多个提示项的列表
1265
+ /**
1266
+ * 包含多个提示项的列表
1267
1267
  */
1268
1268
  items: {
1269
1269
  type: Array,
1270
1270
  default: () => []
1271
1271
  },
1272
- /**
1273
- * 显示在提示列表顶部的标题
1272
+ /**
1273
+ * 显示在提示列表顶部的标题
1274
1274
  */
1275
1275
  title: {
1276
1276
  type: String,
1277
1277
  default: ''
1278
1278
  },
1279
- /**
1280
- * Item 提示项被点击时的回调函数
1279
+ /**
1280
+ * Item 提示项被点击时的回调函数
1281
1281
  */
1282
1282
  onItemClick: {
1283
1283
  type: Function,
1284
1284
  default: null
1285
1285
  },
1286
- /**
1287
- * 提示列表是否垂直排列
1286
+ /**
1287
+ * 提示列表是否垂直排列
1288
1288
  */
1289
1289
  vertical: {
1290
1290
  type: Boolean,
1291
1291
  default: false
1292
1292
  },
1293
- /**
1294
- * 提示列表是否换行
1293
+ /**
1294
+ * 提示列表是否换行
1295
1295
  */
1296
1296
  wrap: {
1297
1297
  type: Boolean,
1298
1298
  default: false
1299
1299
  },
1300
- /**
1301
- * 自定义样式,用于各个提示项的不同部分
1300
+ /**
1301
+ * 自定义样式,用于各个提示项的不同部分
1302
1302
  */
1303
1303
  styles: {
1304
1304
  type: Object,
1305
1305
  default: () => ({})
1306
1306
  },
1307
- /**
1308
- * 自定义样式类名,用于各个提示项的不同部分
1307
+ /**
1308
+ * 自定义样式类名,用于各个提示项的不同部分
1309
1309
  */
1310
1310
  classNames: {
1311
1311
  type: Object,
1312
1312
  default: () => ({})
1313
1313
  },
1314
- /**
1315
- * 根节点的样式类名
1314
+ /**
1315
+ * 根节点的样式类名
1316
1316
  */
1317
1317
  rootClassName: {
1318
1318
  type: String,
1319
1319
  default: ''
1320
1320
  },
1321
- /**
1322
- * 自定义样式
1321
+ /**
1322
+ * 自定义样式
1323
1323
  */
1324
1324
  customStyle: {
1325
1325
  type: Object,
1326
1326
  default: () => ({})
1327
1327
  },
1328
- /**
1329
- * 方向
1328
+ /**
1329
+ * 方向
1330
1330
  */
1331
1331
  direction: {
1332
1332
  type: String,
@@ -5579,6 +5579,912 @@ module.exports = [
5579
5579
  ];
5580
5580
 
5581
5581
 
5582
+ /***/ }),
5583
+
5584
+ /***/ 1433:
5585
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5586
+
5587
+ "use strict";
5588
+
5589
+ // EXPORTS
5590
+ __webpack_require__.d(__webpack_exports__, {
5591
+ "default": () => (/* binding */ EditorSender)
5592
+ });
5593
+
5594
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=template&id=8ce301dc&scoped=true
5595
+ var render = function render() {
5596
+ var _vm = this,
5597
+ _c = _vm._self._c;
5598
+ return _c("div", {
5599
+ staticClass: "el-editor-sender-wrap",
5600
+ style: {
5601
+ "--el-editor-sender-header-duration": `${_vm.headerAnimationTimer}ms`
5602
+ }
5603
+ }, [_c("transition", {
5604
+ attrs: {
5605
+ name: "slide"
5606
+ }
5607
+ }, [_vm.$slots.header ? _c("div", {
5608
+ staticClass: "el-editor-sender-header"
5609
+ }, [_c("div", {
5610
+ staticClass: "el-editor-sender-header-container"
5611
+ }, [_vm._t("header")], 2)]) : _vm._e()]), _vm._v(" "), _c("div", {
5612
+ staticClass: "el-editor-sender-content",
5613
+ class: {
5614
+ "content-variant-updown": _vm.variant === "updown"
5615
+ },
5616
+ on: {
5617
+ mousedown: _vm.onContentMouseDown
5618
+ }
5619
+ }, [_vm.$slots.prefix && _vm.variant === "default" ? _c("div", {
5620
+ staticClass: "el-editor-sender-prefix"
5621
+ }, [_vm._t("prefix")], 2) : _vm._e(), _vm._v(" "), _c("div", {
5622
+ staticClass: "el-editor-sender-chat-room",
5623
+ on: {
5624
+ mousedown: function ($event) {
5625
+ $event.stopPropagation();
5626
+ return (() => {}).apply(null, arguments);
5627
+ }
5628
+ }
5629
+ }, [_c("div", {
5630
+ ref: "container",
5631
+ staticClass: "el-editor-sender-chat",
5632
+ style: {
5633
+ ..._vm.customStyle
5634
+ }
5635
+ })]), _vm._v(" "), _vm.variant === "default" ? _c("div", {
5636
+ staticClass: "el-editor-sender-action-list"
5637
+ }, [_vm._t("action-list", function () {
5638
+ return [_c("div", {
5639
+ staticClass: "el-editor-sender-action-list-presets"
5640
+ }, [!_vm.loading ? _c("SendButton", {
5641
+ attrs: {
5642
+ disabled: _vm.chatState.isEmpty || _vm.disabled
5643
+ },
5644
+ on: {
5645
+ submit: _vm.onSubmit
5646
+ }
5647
+ }) : _vm._e(), _vm._v(" "), _vm.loading ? _c("LoadingButton", {
5648
+ on: {
5649
+ cancel: _vm.onCancel
5650
+ }
5651
+ }) : _vm._e(), _vm._v(" "), _vm.clearable ? _c("ClearButton", {
5652
+ attrs: {
5653
+ disabled: _vm.chatState.isEmpty || _vm.disabled
5654
+ },
5655
+ on: {
5656
+ clear: _vm.onClear
5657
+ }
5658
+ }) : _vm._e()], 1)];
5659
+ })], 2) : _vm.variant === "updown" ? _c("div", {
5660
+ staticClass: "el-editor-sender-updown-action-list"
5661
+ }, [_vm.$slots.prefix ? _c("div", {
5662
+ staticClass: "el-editor-sender-prefix"
5663
+ }, [_vm._t("prefix")], 2) : _vm._e(), _vm._v(" "), _c("div", {
5664
+ staticClass: "el-editor-sender-action-list"
5665
+ }, [_vm._t("action-list", function () {
5666
+ return [_c("div", {
5667
+ staticClass: "el-editor-sender-action-list-presets"
5668
+ }, [!_vm.loading ? _c("SendButton", {
5669
+ attrs: {
5670
+ disabled: _vm.chatState.isEmpty || _vm.disabled
5671
+ },
5672
+ on: {
5673
+ submit: _vm.onSubmit
5674
+ }
5675
+ }) : _vm._e(), _vm._v(" "), _vm.loading ? _c("LoadingButton", {
5676
+ on: {
5677
+ cancel: _vm.onCancel
5678
+ }
5679
+ }) : _vm._e(), _vm._v(" "), _vm.clearable ? _c("ClearButton", {
5680
+ attrs: {
5681
+ disabled: _vm.chatState.isEmpty || _vm.disabled
5682
+ },
5683
+ on: {
5684
+ clear: _vm.onClear
5685
+ }
5686
+ }) : _vm._e()], 1)];
5687
+ })], 2)]) : _vm._e()]), _vm._v(" "), _c("transition", {
5688
+ attrs: {
5689
+ name: "slide"
5690
+ }
5691
+ }, [_vm.$slots.footer ? _c("div", {
5692
+ staticClass: "el-editor-sender-footer"
5693
+ }, [_vm._t("footer")], 2) : _vm._e()])], 1);
5694
+ };
5695
+ var staticRenderFns = [];
5696
+ render._withStripped = true;
5697
+
5698
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=template&id=8ce301dc&scoped=true
5699
+
5700
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=template&id=3e37542a&scoped=true
5701
+ var ClearButtonvue_type_template_id_3e37542a_scoped_true_render = function render() {
5702
+ var _vm = this,
5703
+ _c = _vm._self._c;
5704
+ return _c("div", {
5705
+ staticClass: "el-x-send-button"
5706
+ }, [_c("el-button", {
5707
+ attrs: {
5708
+ circle: "",
5709
+ disabled: _vm.disabled,
5710
+ size: "small"
5711
+ },
5712
+ on: {
5713
+ click: function ($event) {
5714
+ return _vm.$emit("clear");
5715
+ }
5716
+ }
5717
+ }, [_c("i", {
5718
+ staticClass: "el-icon-brush"
5719
+ })])], 1);
5720
+ };
5721
+ var ClearButtonvue_type_template_id_3e37542a_scoped_true_staticRenderFns = [];
5722
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_render._withStripped = true;
5723
+
5724
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=template&id=3e37542a&scoped=true
5725
+
5726
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=script&lang=js
5727
+ /* harmony default export */ const ClearButtonvue_type_script_lang_js = ({
5728
+ name: 'ClearButton',
5729
+ props: {
5730
+ disabled: {
5731
+ type: Boolean,
5732
+ default: false
5733
+ }
5734
+ }
5735
+ });
5736
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=script&lang=js
5737
+ /* harmony default export */ const components_ClearButtonvue_type_script_lang_js = (ClearButtonvue_type_script_lang_js);
5738
+ // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
5739
+ var injectStylesIntoStyleTag = __webpack_require__(5072);
5740
+ var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
5741
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
5742
+ var ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss = __webpack_require__(6021);
5743
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
5744
+
5745
+
5746
+
5747
+ var options = {};
5748
+
5749
+ options.insert = "head";
5750
+ options.singleton = false;
5751
+
5752
+ var update = injectStylesIntoStyleTag_default()(ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss/* default */.A, options);
5753
+
5754
+
5755
+
5756
+ /* harmony default export */ const components_ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss = (ClearButtonvue_type_style_index_0_id_3e37542a_prod_scoped_true_lang_scss/* default */.A.locals || {});
5757
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue?vue&type=style&index=0&id=3e37542a&prod&scoped=true&lang=scss
5758
+
5759
+ // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
5760
+ var componentNormalizer = __webpack_require__(4486);
5761
+ ;// ./src/components/EditorSender/src/components/ClearButton.vue
5762
+
5763
+
5764
+
5765
+ ;
5766
+
5767
+
5768
+ /* normalize component */
5769
+
5770
+ var component = (0,componentNormalizer/* default */.A)(
5771
+ components_ClearButtonvue_type_script_lang_js,
5772
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_render,
5773
+ ClearButtonvue_type_template_id_3e37542a_scoped_true_staticRenderFns,
5774
+ false,
5775
+ null,
5776
+ "3e37542a",
5777
+ null
5778
+
5779
+ )
5780
+
5781
+ /* harmony default export */ const ClearButton = (component.exports);
5782
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=template&id=353808b6&scoped=true
5783
+ var LoadingButtonvue_type_template_id_353808b6_scoped_true_render = function render() {
5784
+ var _vm = this,
5785
+ _c = _vm._self._c;
5786
+ return _c("div", {
5787
+ staticClass: "el-x-send-button"
5788
+ }, [_c("el-button", {
5789
+ attrs: {
5790
+ circle: "",
5791
+ size: "small"
5792
+ },
5793
+ on: {
5794
+ click: function ($event) {
5795
+ return _vm.$emit("cancel");
5796
+ }
5797
+ }
5798
+ }, [_c("loading", {
5799
+ staticClass: "loading-svg"
5800
+ })], 1)], 1);
5801
+ };
5802
+ var LoadingButtonvue_type_template_id_353808b6_scoped_true_staticRenderFns = [];
5803
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_render._withStripped = true;
5804
+
5805
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=template&id=353808b6&scoped=true
5806
+
5807
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/Loading.vue?vue&type=template&id=0c9c176e&scoped=true
5808
+ var Loadingvue_type_template_id_0c9c176e_scoped_true_render = function render() {
5809
+ var _vm = this,
5810
+ _c = _vm._self._c;
5811
+ return _c("svg", {
5812
+ attrs: {
5813
+ viewBox: "0 0 1000 1000",
5814
+ xmlns: "http://www.w3.org/2000/svg",
5815
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
5816
+ }
5817
+ }, [_c("title", [_vm._v("Loading")]), _vm._v(" "), _c("rect", {
5818
+ attrs: {
5819
+ fill: "currentColor",
5820
+ height: "250",
5821
+ rx: "24",
5822
+ ry: "24",
5823
+ width: "250",
5824
+ x: "375",
5825
+ y: "375"
5826
+ }
5827
+ }), _vm._v(" "), _c("circle", {
5828
+ attrs: {
5829
+ cx: "500",
5830
+ cy: "500",
5831
+ fill: "none",
5832
+ r: "450",
5833
+ stroke: "currentColor",
5834
+ "stroke-width": "100",
5835
+ opacity: "0.45"
5836
+ }
5837
+ }), _vm._v(" "), _c("circle", {
5838
+ attrs: {
5839
+ cx: "500",
5840
+ cy: "500",
5841
+ fill: "none",
5842
+ r: "450",
5843
+ stroke: "currentColor",
5844
+ "stroke-width": "100",
5845
+ "stroke-dasharray": "600 9999999"
5846
+ }
5847
+ }, [_c("animateTransform", {
5848
+ attrs: {
5849
+ attributeName: "transform",
5850
+ dur: "1s",
5851
+ from: "0 500 500",
5852
+ repeatCount: "indefinite",
5853
+ to: "360 500 500",
5854
+ type: "rotate"
5855
+ }
5856
+ })], 1)]);
5857
+ };
5858
+ var Loadingvue_type_template_id_0c9c176e_scoped_true_staticRenderFns = [];
5859
+ Loadingvue_type_template_id_0c9c176e_scoped_true_render._withStripped = true;
5860
+
5861
+ ;// ./src/components/EditorSender/src/components/Loading.vue?vue&type=template&id=0c9c176e&scoped=true
5862
+
5863
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/Loading.vue?vue&type=script&lang=js
5864
+ /* harmony default export */ const Loadingvue_type_script_lang_js = ({
5865
+ name: 'Loading'
5866
+ });
5867
+ ;// ./src/components/EditorSender/src/components/Loading.vue?vue&type=script&lang=js
5868
+ /* harmony default export */ const components_Loadingvue_type_script_lang_js = (Loadingvue_type_script_lang_js);
5869
+ ;// ./src/components/EditorSender/src/components/Loading.vue
5870
+
5871
+
5872
+
5873
+
5874
+
5875
+ /* normalize component */
5876
+ ;
5877
+ var Loading_component = (0,componentNormalizer/* default */.A)(
5878
+ components_Loadingvue_type_script_lang_js,
5879
+ Loadingvue_type_template_id_0c9c176e_scoped_true_render,
5880
+ Loadingvue_type_template_id_0c9c176e_scoped_true_staticRenderFns,
5881
+ false,
5882
+ null,
5883
+ "0c9c176e",
5884
+ null
5885
+
5886
+ )
5887
+
5888
+ /* harmony default export */ const Loading = (Loading_component.exports);
5889
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=script&lang=js
5890
+
5891
+ /* harmony default export */ const LoadingButtonvue_type_script_lang_js = ({
5892
+ name: 'LoadingButton',
5893
+ components: {
5894
+ Loading: Loading
5895
+ }
5896
+ });
5897
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=script&lang=js
5898
+ /* harmony default export */ const components_LoadingButtonvue_type_script_lang_js = (LoadingButtonvue_type_script_lang_js);
5899
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
5900
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss = __webpack_require__(2351);
5901
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
5902
+
5903
+
5904
+
5905
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options = {};
5906
+
5907
+ LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options.insert = "head";
5908
+ LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options.singleton = false;
5909
+
5910
+ var LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_update = injectStylesIntoStyleTag_default()(LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss/* default */.A, LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss_options);
5911
+
5912
+
5913
+
5914
+ /* harmony default export */ const components_LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss = (LoadingButtonvue_type_style_index_0_id_353808b6_prod_scoped_true_lang_scss/* default */.A.locals || {});
5915
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue?vue&type=style&index=0&id=353808b6&prod&scoped=true&lang=scss
5916
+
5917
+ ;// ./src/components/EditorSender/src/components/LoadingButton.vue
5918
+
5919
+
5920
+
5921
+ ;
5922
+
5923
+
5924
+ /* normalize component */
5925
+
5926
+ var LoadingButton_component = (0,componentNormalizer/* default */.A)(
5927
+ components_LoadingButtonvue_type_script_lang_js,
5928
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_render,
5929
+ LoadingButtonvue_type_template_id_353808b6_scoped_true_staticRenderFns,
5930
+ false,
5931
+ null,
5932
+ "353808b6",
5933
+ null
5934
+
5935
+ )
5936
+
5937
+ /* harmony default export */ const LoadingButton = (LoadingButton_component.exports);
5938
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/SendButton.vue?vue&type=template&id=2e5f663d&scoped=true
5939
+ var SendButtonvue_type_template_id_2e5f663d_scoped_true_render = function render() {
5940
+ var _vm = this,
5941
+ _c = _vm._self._c;
5942
+ return _c("div", {
5943
+ staticClass: "el-x-send-button"
5944
+ }, [_c("el-button", {
5945
+ attrs: {
5946
+ circle: "",
5947
+ disabled: _vm.disabled,
5948
+ size: "small"
5949
+ },
5950
+ on: {
5951
+ click: function ($event) {
5952
+ return _vm.$emit("submit");
5953
+ }
5954
+ }
5955
+ }, [_c("i", {
5956
+ staticClass: "el-icon-top"
5957
+ })])], 1);
5958
+ };
5959
+ var SendButtonvue_type_template_id_2e5f663d_scoped_true_staticRenderFns = [];
5960
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_render._withStripped = true;
5961
+
5962
+ ;// ./src/components/EditorSender/src/components/SendButton.vue?vue&type=template&id=2e5f663d&scoped=true
5963
+
5964
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/components/SendButton.vue?vue&type=script&lang=js
5965
+ /* harmony default export */ const SendButtonvue_type_script_lang_js = ({
5966
+ name: 'SendButton',
5967
+ props: {
5968
+ disabled: {
5969
+ type: Boolean,
5970
+ default: false
5971
+ }
5972
+ }
5973
+ });
5974
+ ;// ./src/components/EditorSender/src/components/SendButton.vue?vue&type=script&lang=js
5975
+ /* harmony default export */ const components_SendButtonvue_type_script_lang_js = (SendButtonvue_type_script_lang_js);
5976
+ ;// ./src/components/EditorSender/src/components/SendButton.vue
5977
+
5978
+
5979
+
5980
+
5981
+
5982
+ /* normalize component */
5983
+ ;
5984
+ var SendButton_component = (0,componentNormalizer/* default */.A)(
5985
+ components_SendButtonvue_type_script_lang_js,
5986
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_render,
5987
+ SendButtonvue_type_template_id_2e5f663d_scoped_true_staticRenderFns,
5988
+ false,
5989
+ null,
5990
+ "2e5f663d",
5991
+ null
5992
+
5993
+ )
5994
+
5995
+ /* harmony default export */ const SendButton = (SendButton_component.exports);
5996
+ ;// ./node_modules/chatarea/lib/ChatArea.mjs
5997
+ var __defProp=Object.defineProperty,__defNormalProp=(t,e,i)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,__publicField=(t,e,i)=>__defNormalProp(t,"symbol"!=typeof e?e+"":e,i);function os(){const t=navigator.userAgent,e=/(?:Windows Phone)/.test(t),i=/(?:SymbianOS)/.test(t)||e,n=/(?:Android)/.test(t),s=/(?:Firefox)/.test(t),a=/(?:iPad|PlayBook)/.test(t)||n&&!/(?:Mobile)/.test(t)||s&&/(?:Tablet)/.test(t),l=/(?:iPhone)/.test(t)&&!a;return{isTablet:a,isPhone:l,isAndroid:n,isPc:!l&&!n&&!i}}function domItVisible(t,e=!1,i="block"){t&&(t.className=t.className.replace(/ chat-view-show| chat-view-hidden/g,""),e?(t.style.display=i,t.className+=" chat-view-show"):(t.className+=" chat-view-hidden",t.style.display="none"))}function hasElmShow(t){return t&&t.classList.contains("chat-view-show")}function updateElmClass(t,e,i){t.classList[i?"add":"remove"](e)}const ELEMENT_EMPTY_KEY="data-set-empty",ELEMENT_RICH_TYPE_KEY="data-set-richType",RICH_WRAP="richWrap",RICH_GRID="richGrid",RICH_MARK="richMark",RICH_INPUT="richInput",RICH_TAG="richTag",CHAT_COPY_KEY="application/chatarea-custom-format",ELEMENT_COMPONENT_KEY="data-set-component",checkEmptySvg='<svg class="check-empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',searchEmptySvg='<svg class="empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',searchSvg='<svg class="icon-search" style="vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M684.8 223.530667a326.272 326.272 0 0 1 24.96 433.621333c2.645333 2.133333 5.290667 4.48 7.850667 7.04L870.4 817.066667c24.789333 24.746667 32.896 56.832 18.133333 71.594666-14.762667 14.805333-46.848 6.656-71.637333-18.090666l-152.789333-152.832a106.282667 106.282667 0 0 1-7.210667-7.936 326.101333 326.101333 0 0 1-433.109333-25.173334c-127.445333-127.445333-127.573333-333.952-0.256-461.269333 127.36-127.36 333.866667-127.232 461.269333 0.213333zM275.328 275.114667a252.885333 252.885333 0 0 0 0.256 357.632 252.885333 252.885333 0 0 0 357.632 0.256 252.885333 252.885333 0 0 0-0.256-357.632 252.885333 252.885333 0 0 0-357.632-0.256z" fill="#9B9B9B"></path></svg>',antdLoading='<div class="ant-spin ant-spin-spinning" aria-live="polite" aria-busy="true"><span class="ant-spin-dot ant-spin-dot-spin"><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i><i class="ant-spin-dot-item"></i></span></div>',matchEmptySvg='<svg class="match-empty-svg" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg"><g transform="translate(0 1)" fill="none" fill-rule="evenodd"><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7"></ellipse><g fill-rule="nonzero" stroke="#d9d9d9"><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa"></path></g></g></svg>',checkSvg='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="M9.218 17.41 19.83 6.796a.99.99 0 1 1 1.389 1.415c-3.545 3.425-4.251 4.105-11.419 11.074a.997.997 0 0 1-1.375.018c-1.924-1.801-3.709-3.568-5.573-5.43a.999.999 0 0 1 1.414-1.413z"></path></svg>',arrowSvg='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 24 24"><path fill="currentColor" d="m20.23 8.653-7.795 9.685a1.2 1.2 0 0 1-1.87 0L2.771 8.652C2.14 7.867 2.698 6.7 3.706 6.7h15.588c1.008 0 1.567 1.167.935 1.952"></path></svg>',closeSvg='<svg focusable="false" data-icon="close-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true" fill-rule="evenodd" viewBox="64 64 896 896"><path d="M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"></path></svg>',sleep=(t=50)=>new Promise(e=>{setTimeout(e,t)}),getBoolean=t=>"false"!==String(t)&&"null"!==String(t)&&"0"!==String(t),debounce=(t,e,i=!1)=>{let n;return function(...s){const a=this,l=i&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,i||t.apply(a,s)},e),l&&t.apply(a,s)}},throttle=(t,e)=>{let i;return function(...n){const s=this;i||(t.apply(s,n),i=!0,setTimeout(function(){i=!1},e))}},upFindElm=(t,e)=>{const i=t.getAttribute("data-set-richType");return i===RICH_GRID?null:i===RICH_MARK||i===RICH_TAG?t:t.parentElement&&e>0?upFindElm(t.parentElement,e-1):null},getObjValue=(t,e,i)=>t&&t[e]?t[e]:i,strictMinifyHtml=t=>t.replace(/\n+/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><").trim(),convertBlocksToSpans=(t,e)=>{const i=document.createElement("div");i.innerHTML=t;i.querySelectorAll("div, p, h1, h2, h3, h4, h5, h6, section, article, header, footer, aside, nav").forEach(t=>{const e=document.createElement("span");for(e.style.display="block",Array.from(t.attributes).forEach(t=>{e.setAttribute(t.name,t.value)});t.firstChild;)e.appendChild(t.firstChild);t.parentNode.replaceChild(e,t)});const n=i.children[0];if(n&&"block"===n.style.display&&(n.style.display="inline-block"),n){for(const t in e)n.dataset[t]="{{"+t+"}}";n.setAttribute("data-set-component","{{data-set-component}}")}return i.innerHTML};function replaceTemplateVariables(t,e){let i=t;for(const[t,n]of Object.entries(e)){const e=`{{${t}}}`;i=i.replace(new RegExp(e,"g"),String(n))}return i}function escapeHtml(t){let e=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return e=e.replace(/[&<>"']/g,t=>{switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case'"':return"&quot;";case"'":return"&#039;";default:return t}}),e=e.replace(/ /g,"&nbsp;"),e}function unescapeHtml(t){let e=t.replace(/&nbsp;/g," ");return e=e.replace(/&amp;|&lt;|&gt;|&quot;|&#039;/g,t=>{switch(t){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&#039;":return"'";default:return t}}),e}function escapeChatHtml(t){return parseHtml(t).map(t=>extractPChildren(t)).map(t=>t.map(t=>{let e="",i="",n="",s="",a="",l="";switch(getOuterSpanClass(t)){case"chat-grid-input":n=removeOuterTag(t,"span",1),s=getCustomAttributeValue(n,"data-set-empty"),i=removeOuterTag(n,"span",1),e="false"===String(s)?replaceNativeNodeContent(t,i):t;break;case"chat-tag":switch(a=removeOuterTag(t,"span",1),l=getOuterSpanClass(a),l){case"at-user":case"at-tag":i=removeOuterTag(a,"span",1),e=replaceNativeNodeContent(t,i);break;case"at-select":i=removeOuterTag(a.replace(arrowSvg,""),"span",1),e=replaceNativeNodeContent(t,i+arrowSvg,escapeHtml(i)+arrowSvg);break;case"at-input":e=replaceSpecificContent(t);break;default:e=t}}return e})).map(t=>t.join("")).map(t=>'<p class="chat-grid-wrap" data-set-richtype="richGrid">'+t+"</p>").join("")}function parseHtml(t){const e=[];let i=[],n=0;const s=t.split(/(<\/?p[^>]*>)/gi);for(const t of s)t&&(t.startsWith("<p")&&!t.startsWith("</p")?(n++,i.push(t),1===n&&i.length>1&&(i=[t])):t.startsWith("</p")?(i.push(t),n--,0===n&&(e.push(i.join("").trim()),i=[])):n>0&&i.push(t));return e}function extractPChildren(t){const e=[];let i=[],n=0;const s=t.replace(/^<p[^>]*>/,"").replace(/<\/p>\s*$/,"").split(/(<\/?[^>]+\/?>)/g);for(const t of s){const s=t.trim();s&&(s.startsWith("<")&&s.endsWith("/>")?0===n?e.push(t):i.push(t):!s.startsWith("<")||s.startsWith("</")||s.startsWith("<!")?s.startsWith("</")?(n--,i.push(t),0===n&&(e.push(i.join("").trim()),i=[])):n>0&&i.push(t):(n++,i.push(t)))}if(i.length>0){const t=i.join("").trim();t&&e.push(t)}return e}function getOuterSpanClass(t){const e=t.match(/<span[^>]*?class="([^"]*)"/i);return e?e[1]:null}function getCustomAttributeValue(t,e){const i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`${i}=("([^"]*)"|'([^']*)'|([^\\s>]+))`),s=t.match(n);return s&&(s[2]||s[3]||s[4])||null}function removeOuterTag(t,e,i=1){const n=t.indexOf(">")+1,s=t.lastIndexOf(`</${e}`),a=t.substring(n,s);return i<=1?a:removeOuterTag(a,e,i-1)}function replaceNativeNodeContent(t,e,i){return t.replace(e,i||escapeHtml(e))}function replaceSpecificContent(t){let e=t.replace(/(<span class="input-write" contenteditable="true">)(.*?)(<\/span>)/,(t,e,i,n)=>`${e}${escapeHtml(i)}${n}`);return e=e.replace(/(<span class="[^"]*input-tip[^"]*"[^>]*>)(.*?)(<\/span>)/,(t,e,i,n)=>`${e}${escapeHtml(i)}${n}`),e}function isKeyType(t,e){switch(e){case"text-delete":return"Backspace"===t.key||"Backspace"===t.code;case"text-move":return"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowLeft"===t.code||"ArrowRight"===t.code;case"text-select-all":return(t.ctrlKey||t.metaKey)&&("A"===t.key||"a"===t.key||"KeyA"===t.code);case"text-undo":return(t.ctrlKey||t.metaKey)&&("Z"===t.key||"z"===t.key||"KeyZ"===t.code);case"text-redo":return(t.ctrlKey||t.metaKey)&&("Y"===t.key||"y"===t.key||"KeyY"===t.code);case"text-write":return t.isComposing||!t.ctrlKey&&!t.altKey&&!t.metaKey&&!["Backspace","Shift","Tab","CapsLock","Control","Meta","Alt","ContextMenu","Enter","NumpadEnter","Escape","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Home","End","PageUp","PageDown","Insert","Delete","NumLock"].includes(t.key);case"dialog-options":return"ArrowUp"===t.key||"ArrowDown"===t.key||"Enter"===t.key||"ArrowUp"===t.code||"ArrowDown"===t.code||"Enter"===t.code||"NumpadEnter"===t.code;case"IME":return"Unidentified"===t.key||229===t.keyCode;default:return!1}}function pinyinMatch(t,e,i){const n=e.split(/\s+/),s=t.split("").map((t,i)=>{let s=n[i]||"";return""===e&&""===s&&(s=t),{char:t,pinyin:s.toLowerCase(),initial:s?s[0].toLowerCase():""}}),a=(t=>{const e=[];let i="";for(const n of t)/[a-zA-Z]/.test(n)?i+=n.toLowerCase():(i&&(e.push({type:"pinyin",value:i}),i=""),e.push({type:"char",value:n}));return i&&e.push({type:"pinyin",value:i}),e})(i),l=s.length,o=a.length,r=Array.from({length:l+1},()=>Array(o+1).fill(!1));r[0][0]=!0;for(let t=0;t<=l;t++)for(let e=0;e<=o;e++)if(r[t][e]&&e<o){const i=a[e];for(let n=t;n<l;n++){const t=s[n];if("char"===i.type)t.char===i.value&&(r[n+1][e+1]=!0);else{const a=t.pinyin.toLowerCase(),o=t.initial,c=i.value;if(c===o)r[n+1][e+1]=!0;else if(c===a)r[n+1][e+1]=!0;else if(isSubsequence(c,a))r[n+1][e+1]=!0;else for(let t=2;t<=l-n;t++){const i=s.slice(n,n+t),a=i.map(t=>t.pinyin.toLowerCase()).join(""),l=i.map(t=>t.initial).join("");if(c===a||c===l||isSubsequence(c,a)){r[n+t][e+1]=!0;break}}}}}for(let t=0;t<=l;t++)if(r[t][o])return!0;return!1}function isSubsequence(t,e){let i=0,n=0;for(;i<t.length&&n<e.length;)t[i]===e[n]&&i++,n++;return i===t.length}class ChatElement{constructor(t){__publicField(this,"target"),__publicField(this,"richText",document.createElement("div")),__publicField(this,"placeholderElm",document.createElement("div")),__publicField(this,"tipElm",null),__publicField(this,"isExternalCallPopup",!1),__publicField(this,"isPointSearchMode",!1),__publicField(this,"checkboxRows",[]),__publicField(this,"customTags",{}),__publicField(this,"selectTags",{}),__publicField(this,"rects",{}),__publicField(this,"pcElms",{containerDialogElm:null,pointDialogElm:null,pointDialogCheckElm:null,pointDialogMainElm:null,pointDialogUsersElm:[],pointDialogActiveElm:null,pointDialogLoadingElm:null,pointDialogEmptyElm:null,checkDialogElm:null,checkDialogSearchResultElm:null,checkDialogUsersElm:null,checkDialogSearchInputElm:null,checkDialogTagsElm:null,customTagDialogElms:{},customTagDialogTagKey:"",customTagDialogActiveElm:null,selectDialogElms:{},selectDialogKey:"",selectDialogAim:null,tipContainerPopoverElm:null,tipPopoverElm:null}),__publicField(this,"h5Elms",{dialogElm:null,dialogMainElm:null,dialogCheckElm:null,dialogShowElm:null,dialogSearchElm:null,dialogEmptyElm:null,dialogLoadingElm:null}),this.target=t,this.createRichText(),this.createPlaceholder(),t.deviceInfo.isPc?this.createPCDialog():this.createH5Dialog()}createRichText(){const{options:t,deviceInfo:e}=this.target,{elm:i}=t;updateElmClass(i,"chat-area-"+(e.isPc?"pc":"h5"),!0),updateElmClass(this.richText,"chat-rich-text",!0),this.richText.setAttribute("data-set-richType",RICH_WRAP),this.richText.setAttribute("contenteditable","true"),i.appendChild(this.richText)}createPlaceholder(){const{options:t}=this.target,{elm:e}=t;updateElmClass(this.placeholderElm,"chat-placeholder-wrap",!0),domItVisible(this.placeholderElm,!0),e.appendChild(this.placeholderElm),this.rects.plaRect=this.placeholderElm.getBoundingClientRect()}createPCDialog(){const{options:t}=this.target,{needDialog:e,elm:i,asyncMatch:n}=t;if(!e)return;const{pcElms:s}=this;s.containerDialogElm=document.createElement("div"),updateElmClass(this.pcElms.containerDialogElm,"chat-dialog",!0),i.nextElementSibling?i.parentElement.insertBefore(s.containerDialogElm,i.nextElementSibling):i.parentElement.appendChild(s.containerDialogElm),n||this.createPCCheckDialog(),this.createPCPointDialog()}createPCCheckDialog(){const{options:t}=this.target,e=this.target.options.dialogLabels.pcPCheckDialog,{pcElms:i}=this;i.checkDialogElm=document.createElement("div"),updateElmClass(i.checkDialogElm,"checkbox-dialog",!0),domItVisible(i.checkDialogElm),i.checkDialogElm.innerHTML=`\n <div class="checkbox-dialog-container">\n <div class="checkbox-dialog-container-header">\n <span>${e.title}</span>\n <span class="checkbox-dialog-container-header-close">⛌</span>\n </div>\n <div class="checkbox-dialog-container-body">\n <div class="checkbox-dialog-left-box">\n <div class="checkbox-dialog-search">\n <input class="checkbox-dialog-search-input" placeholder="${e.searchPlaceholder}" type="text">\n <div class="checkbox-dialog-search-group"></div>\n </div>\n <div class="checkbox-dialog-tags"></div>\n <div class="checkbox-dialog-option">\n <button class="checkbox-dialog-option-btn btn-submit disabled">${e.confirmLabel}</button>\n <button class="checkbox-dialog-option-btn btn-close">${e.cancelLabel}</button>\n </div>\n </div>\n <div class="checkbox-dialog-right-box">\n <div class="checkbox-dialog-right-box-title">${e.userTagTitle}</div>\n <div class="checkbox-dialog-check-group"></div>\n </div>\n </div>\n </div>\n `,i.containerDialogElm.appendChild(i.checkDialogElm),i.checkDialogUsersElm=i.checkDialogElm.querySelector(".checkbox-dialog-check-group"),i.checkDialogSearchResultElm=i.checkDialogElm.querySelector(".checkbox-dialog-search-group"),i.checkDialogSearchInputElm=i.checkDialogElm.querySelector(".checkbox-dialog-search-input"),i.checkDialogTagsElm=i.checkDialogElm.querySelector(".checkbox-dialog-tags");const n=()=>{domItVisible(i.checkDialogElm),updateElmClass(document.body,"disable-scroll")};i.checkDialogElm.querySelector(".checkbox-dialog-container-header-close").onclick=n,i.checkDialogElm.querySelector(".btn-close").onclick=n;const s=i.checkDialogElm.querySelector(".btn-submit");s.onclick=async()=>{if(s.classList.contains("disabled"))return;const e=this.checkboxRows.map(e=>{const i=Object.create(null);return i[t.userProps.id]=e.id,i[t.userProps.name]=e.name,i});await this.target.batchSetTag(e),n()},domItVisible(i.checkDialogSearchResultElm),i.checkDialogSearchResultElm.onclick=t=>{t.stopPropagation()},i.checkDialogSearchInputElm.onclick=t=>{t.stopPropagation()};const a=debounce(t=>{const e=String(t.target.value||"").replace(/'/g,"").trim();if(!e)return void domItVisible(i.checkDialogSearchResultElm);const n=this.target.searchUserList(e).map(t=>t.id);Array.from(i.checkDialogSearchResultElm.children,(t,e)=>{if(e===i.checkDialogSearchResultElm.children.length-1)domItVisible(t,0===n.length);else{const e=t.getAttribute("data-set-id");domItVisible(t,-1!==n.indexOf(e),"flex")}}),domItVisible(i.checkDialogSearchResultElm,!0)},200);i.checkDialogSearchInputElm.oninput=a,i.checkDialogSearchInputElm.onfocus=a}createPCPointDialog(){const{pcElms:t,target:e}=this;t.pointDialogElm=document.createElement("div"),updateElmClass(t.pointDialogElm,"call-user-dialog",!0),domItVisible(t.pointDialogElm);const i=document.createElement("div");updateElmClass(i,"call-user-dialog-header",!0),i.innerHTML=`<span class="call-user-dialog-header-title">${e.options.dialogLabels.pcPointDialog.title}</span>`,t.pointDialogCheckElm=document.createElement("span"),updateElmClass(t.pointDialogCheckElm,"call-user-dialog-header-check",!0),t.pointDialogCheckElm.innerText=e.options.dialogLabels.pcPointDialog.checkLabel,t.pointDialogCheckElm.onclick=()=>{this.target.showPCCheckDialog(),this.isExternalCallPopup=!1},i.appendChild(t.pointDialogCheckElm),t.pointDialogElm.appendChild(i),t.pointDialogMainElm=document.createElement("div"),updateElmClass(t.pointDialogMainElm,"call-user-dialog-main",!0),t.pointDialogElm.appendChild(t.pointDialogMainElm),e.options.asyncMatch&&(t.pointDialogLoadingElm=document.createElement("div"),updateElmClass(t.pointDialogLoadingElm,"call-user-dialog-loading",!0),t.pointDialogLoadingElm.innerHTML=antdLoading,t.pointDialogElm.appendChild(t.pointDialogLoadingElm),domItVisible(t.pointDialogLoadingElm),t.pointDialogEmptyElm=document.createElement("div"),updateElmClass(t.pointDialogEmptyElm,"call-user-dialog-empty",!0),t.pointDialogEmptyElm.innerHTML=`\n ${matchEmptySvg}\n <span class="empty-label">${e.options.dialogLabels.pcPointDialog.emptyLabel}</span>\n `,t.pointDialogElm.appendChild(t.pointDialogEmptyElm),domItVisible(t.pointDialogEmptyElm)),t.containerDialogElm.appendChild(t.pointDialogElm)}createH5Dialog(){const{options:t,chatEvent:e}=this.target,{needDialog:i,dialogLabels:n}=t;if(!i)return;const{h5Elms:s}=this;s.dialogElm=document.createElement("div"),updateElmClass(s.dialogElm,"call-user-popup",!0),s.dialogElm.innerHTML=`\n <div class="call-user-popup-main">\n <div class="call-user-popup-header">\n <span class="popup-show">${n.h5Dialog.cancelLabel}</span>\n <span class="popup-title">${n.h5Dialog.title}</span>\n <span class="popup-check">${n.h5Dialog.confirmLabel}</span>\n </div>\n <div class="call-user-popup-search">\n ${searchSvg}\n <input class="call-user-popup-search-input"\n placeholder="${n.h5Dialog.searchPlaceholder}"\n type="text">\n </div>\n <div class="call-user-popup-body"></div>\n </div>\n `;const a=async()=>{s.dialogElm.className=s.dialogElm.className.replace(/ chat-view-show/g," chat-view-hidden"),s.dialogSearchElm.value="",await sleep(260),domItVisible(s.dialogElm),updateElmClass(document.body,"disable-scroll"),t.asyncMatch&&this.target.updateUserList([]),this.target.chatInput.restCursorPos(this.target.chatInput.vnode,this.target.chatInput.cursorIndex),this.target.chatInput.viewIntoPoint()};s.dialogElm.onclick=a;const l=s.dialogElm.querySelector(".call-user-popup-main");l.onclick=t=>{t.stopPropagation()},s.dialogShowElm=s.dialogElm.querySelector(".popup-show"),s.dialogShowElm.onclick=a,s.dialogCheckElm=s.dialogElm.querySelector(".popup-check"),s.dialogCheckElm.onclick=async()=>{if(s.dialogCheckElm.classList.contains("disabled"))return;const e=s.dialogElm.querySelectorAll(".user-popup-check-item-check")||[];if(0===e.length)return void await a();if(Array.prototype.some.call(e,t=>"isALL"===t.getAttribute("data-set-id")))return await this.target.onceSetTag({[t.userProps.id]:"isALL",[t.userProps.name]:t.dialogLabels.h5Dialog.callEveryLabel}),void await a();const i=Array.from(e,t=>t.getAttribute("data-set-id")),n=t.userList.filter(e=>-1!==i.indexOf(String(e[t.userProps.id])));await this.target.batchSetTag(n),await a()},s.dialogMainElm=s.dialogElm.querySelector(".call-user-popup-body"),s.dialogEmptyElm=document.createElement("div"),updateElmClass(s.dialogEmptyElm,"call-user-popup-empty",!0),this.h5Elms.dialogEmptyElm.innerHTML=`\n ${searchEmptySvg}\n <span class="empty-label">${t.dialogLabels.h5Dialog.searchEmptyLabel}</span>\n `,domItVisible(s.dialogEmptyElm),l.appendChild(s.dialogEmptyElm),t.asyncMatch&&(s.dialogLoadingElm=document.createElement("div"),updateElmClass(s.dialogLoadingElm,"call-user-popup-loading",!0),s.dialogLoadingElm.innerHTML=antdLoading,domItVisible(s.dialogLoadingElm),l.appendChild(s.dialogLoadingElm)),s.dialogSearchElm=s.dialogElm.querySelector(".call-user-popup-search-input"),s.dialogSearchElm.oninput=debounce(i=>{const n=String(i.target.value||"").replace(/'/g,"").trim();if(t.asyncMatch){e.matchKey++;const t=e.matchKey;this.target.updateUserList([]),domItVisible(s.dialogLoadingElm,!0),domItVisible(s.dialogEmptyElm);const i=e.triggerChatEvent("atMatch",n).find(t=>t&&t instanceof Promise);return void(i&&i.then(i=>{t===e.matchKey&&(domItVisible(s.dialogLoadingElm),!i||i.length<=0?domItVisible(s.dialogEmptyElm,!0,"flex"):this.target.updateUserList(i))}))}const a=[];Array.from(this.h5Elms.dialogMainElm.children,t=>{if(!n)return domItVisible(t,!0,"flex"),void a.push(t);pinyinMatch(t.getAttribute("data-set-name")||"",t.getAttribute("data-set-pinyin")||"",n)?(domItVisible(t,!0,"flex"),a.push(t)):domItVisible(t)}),domItVisible(this.h5Elms.dialogEmptyElm,!a.length,"flex")},200),domItVisible(s.dialogElm),document.body.appendChild(s.dialogElm)}updatePCUser(){const{pcElms:t,target:e}=this;t.pointDialogMainElm.innerHTML="",t.pointDialogActiveElm=void 0;const i=document.createDocumentFragment();if(this.target.options.needCallEvery){const t=document.createElement("div");updateElmClass(t,"call-user-dialog-item",!0),t.setAttribute("data-set-id","isALL"),this.userSelectStyleAndEvent(t,{id:"isALL",name:e.options.dialogLabels.pcPointDialog.callEveryLabel}),t.innerHTML=`\n <span class="call-user-dialog-item-sculpture">\n <span style="transform: scale(0.75)">@</span>\n </span>\n <span class="call-user-dialog-item-name">${e.options.dialogLabels.pcPointDialog.callEveryLabel}(${e.options.reformList.length})</span>\n `,i.appendChild(t)}if(e.options.reformList.forEach(t=>{const e=document.createElement("div");updateElmClass(e,"call-user-dialog-item",!0),e.setAttribute("data-set-id",t.id),this.userSelectStyleAndEvent(e,t),this.getUserHtmlTemplate(e,t),i.appendChild(e)}),t.pointDialogMainElm.appendChild(i),t.pointDialogUsersElm=[],Array.from(t.pointDialogMainElm.children||[],(e,i)=>{t.pointDialogUsersElm.push({index:i,elm:e})}),e.options.asyncMatch)return;t.checkDialogUsersElm.innerHTML=`\n <div class="checkbox-dialog-check-item" data-set-value="ALL">\n <input type="checkbox" value>\n <span class="checkbox-dialog-check-item-inner"></span>\n <div class="checkbox-dialog-check-item-label">${e.options.dialogLabels.pcPCheckDialog.checkAllLabel}</div>\n </div>\n `;const n=document.createDocumentFragment();e.options.reformList.forEach(t=>{const e=document.createElement("div");updateElmClass(e,"checkbox-dialog-check-item",!0),e.setAttribute("data-set-value",t.id),e.innerHTML='\n <input type="checkbox" value>\n <span class="checkbox-dialog-check-item-inner"></span>\n ',this.getUserHtmlTemplate(e,t),n.appendChild(e)}),t.checkDialogUsersElm.appendChild(n),t.checkDialogUsersElm&&t.checkDialogUsersElm.children.length&&Array.from(t.checkDialogUsersElm.children,t=>{t.onclick=()=>{const i=t.getAttribute("data-set-value")||"",n=e.options.reformList.find(t=>t.id===i),s=-1===t.className.indexOf("checkbox-dialog-check-item-check");"ALL"===i?this.checkboxRows=s?e.options.reformList.map(t=>t):[]:s?this.checkboxRows.push(n):this.checkboxRows=this.checkboxRows.filter(t=>t.id!==i),this.updateCheckDialogTags()}}),t.checkDialogSearchResultElm.innerHTML="";const s=document.createDocumentFragment();e.options.reformList.forEach(t=>{const i=document.createElement("div");updateElmClass(i,"checkbox-dialog-check-item",!0),i.setAttribute("data-set-id",t.id);const n=document.createElement("div");updateElmClass(n,"checkbox-dialog-check-item-label",!0),this.getUserHtmlTemplate(n,t),i.appendChild(n),i.onclick=()=>{domItVisible(this.pcElms.checkDialogSearchResultElm);const t=i.getAttribute("data-set-id")||"";if(this.pcElms.checkDialogSearchInputElm.value="",this.pcElms.checkDialogSearchInputElm.focus(),this.checkboxRows.some(e=>e.id===t))return;const n=e.options.reformList.find(e=>e.id===t);n&&this.checkboxRows.push(n),this.updateCheckDialogTags()},s.appendChild(i)});const a=document.createElement("div");updateElmClass(a,"checkbox-dialog-search-empty",!0),a.innerText=e.options.dialogLabels.pcPCheckDialog.searchEmptyLabel,s.appendChild(a),t.checkDialogSearchResultElm.appendChild(s)}updateH5User(){const{h5Elms:t,target:e}=this;t.dialogMainElm.innerHTML="";const i=e.options.reformList&&e.options.reformList.length>0,n=document.createDocumentFragment(),s=document.createElement("span");if(s.innerHTML='\n <input type="checkbox" value>\n <span class="user-popup-check-item-inner"></span>\n ',i){const t=document.createElement("div");e.options.needCallEvery&&(updateElmClass(t,"call-user-popup-item",!0),t.setAttribute("data-set-id","isALL"),t.innerHTML=`\n <span class="call-user-dialog-item-sculpture">\n <span style="transform: scale(0.75)">@</span>\n </span>\n <span class="call-user-dialog-item-name">${e.options.dialogLabels.h5Dialog.callEveryLabel}(${e.options.reformList.length})</span>\n `,t.appendChild(s.cloneNode(!0)),t.onclick=()=>{const e=!t.classList.contains("user-popup-check-item-check");Array.from(this.h5Elms.dialogMainElm.children,t=>{updateElmClass(t,"user-popup-check-item-check",e)}),updateElmClass(this.h5Elms.dialogCheckElm,"disabled",!e)},n.appendChild(t)),e.options.reformList.forEach((e,i)=>{const a=document.createElement("div");updateElmClass(a,"call-user-popup-item",!0),a.setAttribute("data-set-id",e.id),a.setAttribute("data-set-name",e.name),a.setAttribute("data-set-pinyin",e.pinyin||""),this.getUserHtmlTemplate(a,e),a.appendChild(s.cloneNode(!0)),n.appendChild(a),a.onclick=e=>{const i=!a.classList.contains("user-popup-check-item-check");updateElmClass(a,"user-popup-check-item-check",i);const n=Array.prototype.every.call(this.h5Elms.dialogMainElm.children,t=>t.classList.contains("user-popup-check-item-check")||"isALL"===t.getAttribute("data-set-id"));updateElmClass(t,"user-popup-check-item-check",n);const s=Array.prototype.some.call(this.h5Elms.dialogMainElm.children,t=>t.classList.contains("user-popup-check-item-check"));updateElmClass(this.h5Elms.dialogCheckElm,"disabled",!s)}})}t.dialogMainElm.appendChild(n)}updateCheckDialogTags(){const t=this.checkboxRows.map(t=>t.id),e=[],i=[],n=document.createElement("div");n.className="check-empty",n.innerHTML=`\n ${checkEmptySvg}\n <span class="check-empty-label">${this.target.options.dialogLabels.pcPCheckDialog.checkEmptyLabel}</span>\n `,Array.from(this.pcElms.checkDialogTagsElm.children,n=>{const s=n.getAttribute("data-set-value");-1===t.indexOf(s)?i.push(n):e.push(s)}),Array.from(this.pcElms.checkDialogUsersElm.children,(e,i)=>{if(0===i)return void updateElmClass(e,"checkbox-dialog-check-item-check",t.length===this.target.options.reformList.length);const n=e.getAttribute("data-set-value");updateElmClass(e,"checkbox-dialog-check-item-check",-1!==t.indexOf(n))}),i.forEach(t=>{this.pcElms.checkDialogTagsElm.removeChild(t)});updateElmClass(this.pcElms.checkDialogElm.querySelector(".btn-submit"),"disabled",t.length<=0),t.length||this.pcElms.checkDialogTagsElm.appendChild(n);const s=this.checkboxRows.filter(t=>-1===e.indexOf(t.id));if(!s.length)return;const a=document.createDocumentFragment();s.forEach(t=>{const e=document.createElement("div");e.setAttribute("class","checkbox-dialog-tag-item"),e.setAttribute("data-set-value",t.id),e.innerHTML=`\n <span>${t.name}</span>\n `;const i=document.createElement("span");i.setAttribute("class","checkbox-dialog-tag-item-close"),i.innerHTML="⛌",i.onclick=()=>{const t=e.getAttribute("data-set-value");this.checkboxRows=this.checkboxRows.filter(e=>e.id!==t),this.updateCheckDialogTags()},e.appendChild(i),a.appendChild(e)}),this.pcElms.checkDialogTagsElm.appendChild(a)}userSelectStyleAndEvent(t,e){t.addEventListener("click",async i=>{const{options:n}=this.target;if(i.stopPropagation(),this.updatePointActiveUserElm(t),this.isPointSearchMode||n.asyncMatch)await this.target.matchSetTag(e);else{const t=n.userList.find(t=>String(t[n.userProps.id])===e.id);await this.target.onceSetTag(t)}this.exitPointDialog()})}bindCustomTrigger(){Object.values(this.pcElms.customTagDialogElms).forEach(t=>{this.pcElms.containerDialogElm.removeChild(t)}),this.pcElms.customTagDialogElms={},this.customTags={},this.target.options.customTrigger.forEach(t=>{t.tagList&&t.tagList.length>0&&(this.customTags[t.prefix]=t.tagList.map(t=>({id:String(t.id),name:String(t.name),pinyin:String(t.pinyin||"")})),this.createCustomTagDialog(t))})}createCustomTagDialog(t){const e=document.createElement("div");e.setAttribute("class","call-tag-dialog"),domItVisible(e);const i=document.createElement("div");i.setAttribute("class","call-tag-dialog-header"),i.innerHTML=`<span class="call-tag-dialog-header-title">${t.dialogTitle||t.prefix}</span>`,e.appendChild(i);const n=document.createElement("div");n.setAttribute("class","call-tag-dialog-main"),t.tagList.forEach(t=>{const e=document.createElement("div");e.setAttribute("class","call-tag-dialog-item"),e.setAttribute("data-set-id",t.id);const i=document.createElement("span");i.setAttribute("class","call-tag-dialog-item-name"),i.innerHTML=t.name,e.appendChild(i),e.addEventListener("click",async i=>{i.stopPropagation(),this.updateActiveCustomTagElm(e),this.isPointSearchMode?await this.target.matchSetCustomTag(t):await this.target.onceSetCustomTag(t),this.exitCustomTagDialog()}),n.appendChild(e)}),e.appendChild(n),this.pcElms.containerDialogElm.appendChild(e),this.pcElms.customTagDialogElms[t.prefix]=e}getUserHtmlTemplate(t,e){const i=document.createElement("span");if(i.setAttribute("class","call-user-dialog-item-sculpture "+(e.avatar?"is-avatar":"")),e.avatar){const t=new Image;t.alt="",t.src=String(e.avatar),i.appendChild(t)}else i.innerHTML=`<span style="transform: scale(0.75)">${e.name.slice(-2)}</span>`;t.appendChild(i);const n=document.createElement("span");n.setAttribute("class","call-user-dialog-item-name"),n.innerHTML=e.name,t.appendChild(n)}updatePointActiveUserElm(t,e=!1){if(this.pcElms.pointDialogActiveElm&&updateElmClass(this.pcElms.pointDialogActiveElm,"call-user-dialog-item-active"),this.pcElms.pointDialogActiveElm=t,t&&(updateElmClass(t,"call-user-dialog-item-active",!0),e)){const e=Array.prototype.filter.call(this.pcElms.pointDialogMainElm.children,t=>-1===t.className.indexOf("user-no-match")),i=t.clientHeight,n=Array.prototype.indexOf.call(e,t)+1-Math.ceil(Math.floor(this.pcElms.pointDialogMainElm.clientHeight/i)/2);this.pcElms.pointDialogMainElm.scrollTop=n>0?n*i:0}}updateActiveCustomTagElm(t,e=!1){if(this.pcElms.customTagDialogActiveElm&&updateElmClass(this.pcElms.customTagDialogActiveElm,"call-tag-dialog-item-active"),this.pcElms.customTagDialogActiveElm=t,t&&(updateElmClass(t,"call-tag-dialog-item-active",!0),e)){const e=this.pcElms.customTagDialogElms[this.pcElms.customTagDialogTagKey].children[1],i=Array.prototype.filter.call(e.children,t=>-1===t.className.indexOf("tag-no-match")),n=t.clientHeight,s=Array.prototype.indexOf.call(i,t)+1-Math.ceil(Math.floor(e.clientHeight/n)/2);e.scrollTop=s>0?s*n:0}}showPointDialog(t){this.exitSelectDialog(),this.exitCustomTagDialog(),this.exitPointDialog(),this.isPointSearchMode=!!t;let e=null;this.pcElms.pointDialogUsersElm.forEach(i=>{const n=i.elm,s=n.getAttribute("data-set-id"),a=t&&t.every(t=>t.id!==s);e||a||(e=n),updateElmClass(n,"user-no-match",a)}),null!==e&&this.updatePointActiveUserElm(e),domItVisible(this.pcElms.pointDialogCheckElm,!this.target.options.asyncMatch&&!this.isPointSearchMode),domItVisible(this.pcElms.pointDialogElm,!0),this.target.chatEvent.debounceEvents.dialogMoveToRange(this.pcElms.pointDialogElm),this.pcElms.pointDialogMainElm.scrollTop=0}showCustomTagDialog(t,e){this.exitSelectDialog(),this.exitCustomTagDialog(),this.exitPointDialog(),this.isPointSearchMode=!!e,this.pcElms.customTagDialogTagKey=t;const i=this.pcElms.customTagDialogElms[t],n=i.children[1];let s=null;Array.from(n.children,t=>{const i=t.getAttribute("data-set-id"),n=e&&e.every(t=>t.id!==i);s||n||(s=t),updateElmClass(t,"tag-no-match",n)}),null!==s&&this.updateActiveCustomTagElm(s),domItVisible(i,!0),this.target.chatEvent.debounceEvents.dialogMoveToRange(i),i.children[1].scrollTop=0}exitPointDialog(){this.updatePointActiveUserElm(),this.target.options.asyncMatch&&this.target.updateUserList([]),domItVisible(this.pcElms.pointDialogElm)}exitCustomTagDialog(){this.updateActiveCustomTagElm();for(const t in this.pcElms.customTagDialogElms)domItVisible(this.pcElms.customTagDialogElms[t])}ruleShowPointDialog(){const{options:t}=this.target;t.needDialog&&t.reformList.length>0&&(this.isExternalCallPopup=!1,this.showPointDialog())}showPlaceholder(){domItVisible(this.placeholderElm,this.target.isEmpty()),this.offsetTipElm()}bindSelectList(){Object.values(this.pcElms.selectDialogElms).forEach(t=>{this.pcElms.containerDialogElm.removeChild(t)}),this.pcElms.selectDialogElms={},this.selectTags={},this.target.options.selectList.forEach(t=>{t.options&&t.options.length>0&&(this.selectTags[t.key]=t.options.map(t=>({id:String(t.id),name:String(t.name),preview:String(t.preview||"")})),this.createSelectDialog(t))})}createSelectDialog(t){const e=document.createElement("div");e.setAttribute("class","chat-select-dialog"),domItVisible(e);const i=document.createElement("div");i.setAttribute("class","chat-select-dialog-header"),i.innerHTML=`<span class="chat-select-dialog-header-title">${t.dialogTitle||t.key}</span>`,e.appendChild(i);const n=document.createElement("div");n.setAttribute("class","chat-select-dialog-main"),t.options.forEach(t=>{const e=document.createElement("div");if(e.setAttribute("class","chat-select-dialog-item"),e.setAttribute("data-set-id",t.id),t.preview){const i=document.createElement("img");i.setAttribute("class","chat-select-dialog-preview"),i.src=String(t.preview),e.appendChild(i)}const i=document.createElement("span");i.setAttribute("class","chat-select-dialog-name"),i.textContent=t.name;const s=document.createElement("span");s.setAttribute("class","chat-select-dialog-check"),s.innerHTML=checkSvg,domItVisible(s),i.appendChild(s),e.appendChild(i),e.onclick=async()=>{await this.target.setSelectTag(t)},n.appendChild(e)}),e.appendChild(n);const s=document.createElement("div");s.setAttribute("class","chat-select-arrow"),e.appendChild(s),this.pcElms.containerDialogElm.appendChild(e),this.pcElms.selectDialogElms[t.key]=e}exitSelectDialog(){for(const t in this.pcElms.selectDialogElms)domItVisible(this.pcElms.selectDialogElms[t]);this.pcElms.selectDialogKey="",this.pcElms.selectDialogAim&&(updateElmClass(this.pcElms.selectDialogAim,"aim"),this.pcElms.selectDialogAim=null)}createTipElm(t){this.tipElm||(this.tipElm=document.createElement("div")),updateElmClass(this.tipElm,"chat-tip-wrap",!0),this.tipElm.innerHTML=`\n <div class="chat-tip-tag">\n <span class="chat-tip-tag-txt">${t.tagLabel||"--"}</span>\n <span class="chat-tip-tag-close">\n ${this.target.deviceInfo.isPc?closeSvg:""}\n </span>\n </div>\n `,this.target.options.elm.appendChild(this.tipElm);const e=this.tipElm.children[0],i=(e.clientHeight-this.target.chatInput.NODE_HEIGHT)/2;if(this.tipElm.style.top=`-${i}px`,e.onclick=()=>{this.target.deviceInfo.isPc&&this.target.closeTipTag()},e.onmouseenter=()=>{if(this.pcElms.tipContainerPopoverElm&&this.pcElms.tipPopoverElm){domItVisible(this.pcElms.tipPopoverElm,!0);const t=this.pcElms.tipContainerPopoverElm.getBoundingClientRect();this.rects.tipRect=this.tipElm.getBoundingClientRect();const i=(this.pcElms.tipPopoverElm.clientWidth-(this.tipElm.clientWidth+(this.tipElm.clientWidth-e.clientWidth)))/2;this.pcElms.tipPopoverElm.style.left=-i+"px",this.pcElms.tipPopoverElm.style.bottom=t.y-this.rects.tipRect.y+"px",this.pcElms.tipPopoverElm.style.transform=e.style.transform}},e.onmouseleave=()=>{this.pcElms.tipPopoverElm&&domItVisible(this.pcElms.tipPopoverElm)},this.offsetApplyElm(),this.target.deviceInfo.isPc){this.pcElms.tipContainerPopoverElm||(this.pcElms.tipContainerPopoverElm=document.createElement("div"),updateElmClass(this.pcElms.tipContainerPopoverElm,"chat-tip-dialog",!0)),this.pcElms.tipPopoverElm||(this.pcElms.tipPopoverElm=document.createElement("div")),updateElmClass(this.pcElms.tipPopoverElm,"chat-tip-popover",!0),this.pcElms.tipPopoverElm.innerHTML=`\n <div class="chat-tip-popover-main">\n <span class="chat-tip-popover-txt">${t.popoverLabel||"--"}</span>\n <span class="chat-tip-popover-code ${t.codeLabel?"":"chat-view-show"}">${t.codeLabel||"--"}</span>\n </div>\n <div class="chat-tip-popover-arrow"></div>\n `,this.pcElms.tipContainerPopoverElm.appendChild(this.pcElms.tipPopoverElm),domItVisible(this.pcElms.tipPopoverElm);const{elm:e}=this.target.options;e.parentElement&&(e.nextElementSibling?e.parentElement.insertBefore(this.pcElms.tipContainerPopoverElm,e.nextElementSibling):e.parentElement.appendChild(this.pcElms.tipContainerPopoverElm))}this.target.chatEvent.triggerChatEvent("tipTagState",!0)}createCustomTipElm(t){this.tipElm||(this.tipElm=document.createElement("div")),updateElmClass(this.tipElm,"chat-tip-wrap",!0),this.tipElm.innerHTML=`<div class="chat-custom-tip">${t}</div>`,this.target.options.elm.appendChild(this.tipElm);const e=this.tipElm.children[0],i=(e.clientHeight-this.target.chatInput.NODE_HEIGHT)/2;return this.tipElm.style.top=`-${i}px`,this.offsetApplyElm(),this.target.chatEvent.triggerChatEvent("tipTagState",!0),e.children[0]}offsetApplyElm(){if(!this.tipElm)return;const t=this.richText.children[0].children[0];this.rects.tipRect=this.tipElm.getBoundingClientRect();const e=this.rects.tipRect;this.placeholderElm.style.paddingLeft=e.width+"px",t.style.paddingLeft=e.width-t.offsetLeft+"px",this.offsetTipElm()}offsetTipElm(){if(this.tipElm){const t=this.richText.children[0].children[0];t.style.paddingLeft=this.rects.tipRect.width-t.offsetLeft+"px",this.target.nextTick(()=>{if(this.tipElm){const t=this.tipElm.children[0],e=this.richText.children[0].children[0];t.style.transform=`translateY(${e.offsetTop-this.target.chatInput.NODE_PADDING_DIFF}px)`}})}}removeTipElm(){this.tipElm&&(this.target.options.elm.removeChild(this.tipElm),this.tipElm=null),this.pcElms.tipContainerPopoverElm&&(this.pcElms.tipContainerPopoverElm.removeChild(this.pcElms.tipPopoverElm),this.target.options.elm.parentElement.removeChild(this.pcElms.tipContainerPopoverElm),this.pcElms.tipContainerPopoverElm=null,this.pcElms.tipPopoverElm=null);const t=this.richText.children[0].children[0];this.placeholderElm.style.removeProperty("padding-left"),t.style.removeProperty("padding-left"),this.target.chatInput.setRangeLastRecord(),this.target.chatEvent.triggerChatEvent("tipTagState",!1)}}class ChatInput{constructor(t){__publicField(this,"target"),__publicField(this,"richText"),__publicField(this,"vnode"),__publicField(this,"cursorIndex"),__publicField(this,"inputTag_vnode"),__publicField(this,"inputTag_cursorIndex"),__publicField(this,"lastCursorType","gridInput"),__publicField(this,"needCallSpace",!1),__publicField(this,"VOID_KEY","\ufeff"),__publicField(this,"ZERO_WIDTH_KEY","​"),__publicField(this,"INPUT_TAG_WRAP_KEY","​\n​"),__publicField(this,"NODE_HEIGHT",24),__publicField(this,"NODE_PADDING_DIFF",10),this.target=t,this.richText=t.chatElement.richText,this.initEditor()}initEditor(t=!1,e){if(t||this.getNodeEmpty(this.richText)){this.richText.innerHTML="";const i=this.getGridElm();this.richText.appendChild(i);const n=i.children[0].children[0];e&&(n.textContent=e,n.setAttribute("data-set-empty","false"));const s=n.childNodes[0];t||this.target.options.autoFocus?this.restCursorPos(s,s.textContent===this.VOID_KEY?1:s.textContent.length):this.updateGridInputCursor(s,s.textContent.length),this.target.nextTick(()=>{const t=i.getBoundingClientRect();this.NODE_HEIGHT=t.height,this.NODE_PADDING_DIFF=t.top-this.target.options.elm.getBoundingClientRect().top})}}onceCall(t){return new Promise(e=>{const i=this.createChatTagElm(t,"@","at-user","user-id");this.replaceRegContent(i),e()})}onceSearchCall(t,e){return new Promise(i=>{const n=this.createChatTagElm(t,"@","at-user","user-id");this.replaceRegContent(n,e),i()})}onceCustomCall(t,e,i){return new Promise(n=>{const s=this.createChatTagElm(t,i,"at-tag","tag-id");s.children[0].setAttribute("data-set-prefix",i),this.replaceRegContent(s,e),n()})}getCurrentCursorKey(){if(this.updateNodeCursor(),!this.vnode||this.vnode.nodeType!==Node.TEXT_NODE)return"";return(this.vnode.textContent||"")[this.cursorIndex-1]}getRangeRect(){let t=0,e=0;const i=getSelection();if(i.focusNode.nodeType!==Node.TEXT_NODE)return null;const n=i.getRangeAt(0).getClientRects()[0];return n&&(t=n.x,e=n.y),{x:t,y:e}}createChatTagElm(t,e,i,n){const s=document.createElement("span");return s.className=i,s.setAttribute(`data-${n}`,String(t.id)),s.textContent=`${e}${t.name}${this.needCallSpace?" ":""}`,this.createNewDom(s)}createNewDom(t){const e=document.createElement("span");return e.className="chat-tag",e.setAttribute("contenteditable","false"),e.setAttribute("data-set-richType",RICH_TAG),e.appendChild(t),e}replaceRegContent(t,e=!0){const i=this.vnode.textContent;let n;n="boolean"==typeof e?i.slice(0,e?this.cursorIndex-1:this.cursorIndex):i.slice(0,e-1),0===n.length?(this.vnode.parentElement.setAttribute("data-set-empty","true"),this.vnode.textContent=this.VOID_KEY):this.vnode.textContent=n;let s=i.slice(this.cursorIndex);const a=this.vnode.parentNode.parentNode,l=a.nextSibling;l?a.parentNode.insertBefore(t,l):a.parentNode.appendChild(t);const o=t.previousSibling.childNodes[0],r=o.childNodes[1];r&&o.removeChild(r);const c=this.getGridElm(!0),h=c.childNodes[0];s&&s!==this.VOID_KEY&&(h.setAttribute("data-set-empty","false"),h.innerHTML=s);const d=h.childNodes[1];t.nextSibling?(d&&h.removeChild(d),a.parentNode.insertBefore(c,t.nextSibling)):a.parentNode.appendChild(c),this.restCursorPos(h.childNodes[0])}batchReplaceRegContent(t=[],e=!0){return new Promise(i=>{let n=`<span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}</span></span>`;t.forEach(t=>{n+=`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-user" data-user-id="${t.id}" contentEditable="false">@${t.name}${this.needCallSpace?" ":""}</span></span><span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}</span></span>`});const s=document.createElement("div");s.innerHTML=n,this.insetRangeGrid(s,e?1:0),i()})}switchRange(t){var e,i;let{focusNode:n,focusOffset:s}=getSelection();n.getAttribute&&n.getAttribute("data-set-richType")===RICH_INPUT&&(n=n.childNodes[0]);let a,l,o=!1;if(n.nodeType===Node.TEXT_NODE){const r=n.textContent.length,c=n.parentNode.parentNode;switch(t){case"ArrowLeft":if(s>0&&n.textContent!==this.VOID_KEY){l=s-1,a=n;break}const t=c.previousSibling;if(t&&t.children[0].classList.contains("at-input")){a=t.children[0].children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:a.textContent.length,o=!0;break}const h=null==(e=null==c?void 0:c.previousSibling)?void 0:e.previousSibling;if(h)a=h.childNodes[0].childNodes[0],l=a.textContent.length;else{const t=c.parentNode.previousSibling;if(t){a=t.lastChild.childNodes[0].childNodes[0],l=a.textContent.length}}break;case"ArrowRight":if(s<r&&n.textContent!==this.VOID_KEY){l=s+1,a=n;break}const d=c.nextSibling;if(d&&d.children[0].classList.contains("at-input")){a=d.children[0].children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0,o=!0;break}const p=null==(i=null==c?void 0:c.nextSibling)?void 0:i.nextSibling;if(p)a=p.childNodes[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0;else{const t=c.parentNode.nextSibling;t&&(a=t.childNodes[0].childNodes[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0)}}}(l||0===l)&&(o?this.setInputTagRange(a,l):this.restCursorPos(a,l))}getGridElm(t=!1){const e=document.createElement("span");if(e.setAttribute("data-set-richType",RICH_MARK),e.innerHTML=`<span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="true">${this.VOID_KEY}<br></span>`,t)return e;const i=document.createElement("p");return i.className="chat-grid-wrap",i.setAttribute("data-set-richType",RICH_GRID),i.appendChild(e),i}updateGrid(){const t=getSelection(),e=t.focusNode;if(!e)return;const i=e.parentNode;let n,s,a,l;switch(i.getAttribute("data-set-richType")){case RICH_WRAP:if(!e.getAttribute||e.getAttribute("data-set-richType")!==RICH_GRID)break;if(n=e.childNodes[t.focusOffset],!n||n.getAttribute("data-set-richType")===RICH_TAG){const t=this.getGridElm(!0),i=t.children[0];n?(i.removeChild(i.childNodes[1]),e.insertBefore(t,n)):e.appendChild(t),this.restCursorPos(i.childNodes[0]);break}if(n.tagName&&"BR"===n.tagName.toLocaleUpperCase()){const t=this.getGridElm(!0),i=t.children[0];e.insertBefore(t,n),e.removeChild(n),t.nextElementSibling&&t.children[0].removeChild(t.children[0].childNodes[1]),this.restCursorPos(i.childNodes[0],i.childNodes[0].textContent.length)}break;case RICH_MARK:const o=i.parentNode,r=Array.prototype.indexOf.call(o.childNodes,i);if(-1===r)break;if(0===r){const e=t.focusNode;e.setAttribute("data-set-empty","true"),e.innerHTML=`${this.VOID_KEY}<br>`,n=e.childNodes[0],this.restCursorPos(n,n.textContent.length);break}let c,h=i.previousSibling;h.getAttribute("data-set-richType")===RICH_TAG?(c=h.previousSibling,o.removeChild(h),o.removeChild(i)):(c=i.previousSibling,o.removeChild(i));n=c.childNodes[0].childNodes[0],n.textContent===this.VOID_KEY&&n.parentNode.appendChild(document.createElement("br")),this.restCursorPos(n,n.textContent.length);break;case RICH_INPUT:if(l=i.parentNode,a=l.parentNode,this.getNodeEmpty(i)){i.setAttribute("data-set-empty","true"),a.childNodes[a.childNodes.length-1]===l&&(i.innerHTML=`${this.VOID_KEY}<br>`),n=i.childNodes[0],this.restCursorPos(n,n.textContent.length);break}if("true"===String(i.getAttribute("data-set-empty"))){i.setAttribute("data-set-empty","false"),n=i.childNodes[0],this.target.chatEvent.isIMEModel?(i.childNodes[1]&&i.removeChild(i.childNodes[1]),n.textContent===this.VOID_KEY&&i.setAttribute("data-set-empty","true")):i.textContent=n.textContent.replace(new RegExp(this.VOID_KEY,"g"),"");const t=i.childNodes[0];this.restCursorPos(t,t.textContent.length)}if(s=i.parentNode.nextSibling,s&&s.nodeType===Node.TEXT_NODE){let t=s.textContent,e=this.getGridElm(!0);e.childNodes[0].textContent=t,e.childNodes[0].setAttribute("data-set-empty","false"),s.parentNode.insertBefore(e,s),s.parentNode.removeChild(s),s=e}s&&s.getAttribute("data-set-richType")===RICH_MARK&&this.markMerge(i.parentNode,s)}}getNodeEmpty(t){const e=new RegExp(`^(${this.ZERO_WIDTH_KEY}|<br>|${this.VOID_KEY})+$`);return!t.innerHTML||e.test(t.innerHTML)}setWrap(t=!0){const e=getSelection();let{focusNode:i,focusOffset:n}=e;if(i.nodeType!==Node.TEXT_NODE){if(!i.getAttribute||i.getAttribute("data-set-richType")!==RICH_INPUT)return;i=i.childNodes[0]}const s=i.textContent.slice(n),a=i.parentNode.parentNode,l=a.parentNode,o=Array.prototype.indexOf.call(l.childNodes,a),r=Array.prototype.slice.call(l.childNodes,o+1),c=this.getGridElm();let h=c.children[0].children[0].childNodes[0];(s||r.length>0)&&h.parentNode.removeChild(h.parentNode.childNodes[1]),s&&s!==this.VOID_KEY&&(i.textContent=i.textContent.slice(0,n),h.textContent=s,h.parentElement.setAttribute("data-set-empty","false")),r.forEach(t=>{l.removeChild(t),c.appendChild(t)});const d=l.lastChild.childNodes[0],p=c.lastChild.childNodes[0];if(d.childNodes.length<=1){const t=d.childNodes[0];t.textContent&&t.textContent!==this.VOID_KEY||(d.innerHTML=`${this.VOID_KEY}<br>`,d.setAttribute("data-set-empty","true"))}if(p.parentElement.getAttribute("data-set-richType")!==RICH_MARK)c.appendChild(this.getGridElm(!0));else if(p.childNodes.length<=1){const t=p.childNodes[0];t.textContent&&t.textContent!==this.VOID_KEY||(p.innerHTML=`${this.VOID_KEY}<br>`,p.setAttribute("data-set-empty","true"),h=c.children[0].children[0].childNodes[0])}l.nextSibling?this.richText.insertBefore(c,l.nextSibling):this.richText.appendChild(c),t&&this.restCursorPos(h,h.textContent===this.VOID_KEY?1:0)}selectAll(){const t=document.createRange(),e=this.richText.children[0].children[0].childNodes[0].childNodes[0],i=this.richText.lastElementChild.lastElementChild.childNodes[0].childNodes[0];t.setStart(e,0),t.setEnd(i,i.textContent.length);const n=getSelection();n.removeAllRanges(),n.addRange(t)}selectRegionMerge(){const t=getSelection();if(t.isCollapsed||t.rangeCount<=0)return;const e=t.getRangeAt(0);if(e.startContainer.nodeType===Node.TEXT_NODE&&e.startContainer===e.endContainer){const t=e.startContainer;if(t.length===e.endOffset-e.startOffset){const e=t.parentNode,i=e.parentNode===e.parentNode.parentNode.lastChild;e.setAttribute("data-set-empty","true"),e.innerHTML="\ufeff"+(i?"<br>":""),this.restCursorPos(e.childNodes[0])}else e.deleteContents()}else if(e.commonAncestorContainer&&e.commonAncestorContainer.getAttribute("data-set-richType")===RICH_GRID){const t=e.startContainer.nodeType===Node.TEXT_NODE?e.startContainer.parentNode.parentNode:e.startContainer,i=e.endContainer.nodeType===Node.TEXT_NODE?e.endContainer.parentNode.parentNode:e.endContainer;e.deleteContents(),t.getAttribute("data-set-richType")===i.getAttribute("data-set-richType")&&this.markMerge(t,i)}else if(e.commonAncestorContainer===e.startContainer&&e.startContainer===e.endContainer)this.initEditor(!0);else{const t=t=>{if(t.nodeType===Node.TEXT_NODE)return t.parentNode.parentNode.parentNode;switch(t.getAttribute("data-set-richType")){case RICH_INPUT:return t.parentNode.parentNode;case RICH_MARK:return t.parentNode;case RICH_GRID:return t;default:return null}},i=t(e.startContainer),n=t(e.endContainer);if(!i||!n)return;e.deleteContents(),this.gridMerge(i,n)}return!0}gridElmMerge(){const t=getSelection(),{focusNode:e,focusOffset:i,isCollapsed:n}=t;if(!e)return this.restCursorPos(this.vnode,this.cursorIndex),!1;if(i>1)return!1;if(!n)return!1;const s=(t,e)=>(t.parentNode===this.richText||t===t.parentNode.childNodes[0])&&(-1!==Array.prototype.indexOf.call(this.richText.childNodes,t)?t:!(e>=6)&&s(t.parentNode,e+1)),a=s(e,0);if(!a||a===this.richText.childNodes[0]||1===i&&"false"===a.children[0].children[0].getAttribute("data-set-empty"))return!1;const l=a.previousSibling;return this.gridMerge(l,a),!0}delMarkRule(){const t=getSelection(),e=t.focusNode;if(!e)return this.restCursorPos(this.vnode,this.cursorIndex),!1;const i=e.textContent,n=e.parentNode,s=n.parentNode,a=s.parentNode;if(!t.isCollapsed||n.getAttribute("data-set-richType")!==RICH_INPUT)return!1;if(i&&1===i.length&&s!==a.childNodes[0]&&(0!==t.focusOffset||i===this.VOID_KEY)){if(i===this.VOID_KEY){const t=s.previousSibling;if(t.children[0].classList.contains("at-input")&&t.children[0].children[0].textContent!==this.VOID_KEY)return this.rangeToInputTag(t.children[0]),!0;const e=t.previousSibling;a.removeChild(t),a.removeChild(s);const i=e.childNodes[0],n=i.childNodes[0];n.textContent===this.VOID_KEY&&e===a.lastChild&&i.appendChild(document.createElement("br")),this.restCursorPos(n,n.textContent.length)}else{n.innerHTML=s===a.lastChild?`${this.VOID_KEY}<br>`:this.VOID_KEY,n.setAttribute("data-set-empty","true");const t=n.childNodes[0];this.restCursorPos(t,1)}return!0}if(0===t.focusOffset){const t=n.parentNode,e=null==t?void 0:t.previousSibling;return!(!e||e.getAttribute("data-set-richType")!==RICH_TAG)&&(e.children[0].classList.contains("at-input")&&e.children[0].children[0].textContent!==this.VOID_KEY?(this.rangeToInputTag(e.children[0]),!0):(this.delTag(e),!0))}}delTag(t){const e=t.previousSibling,i=t.nextSibling;t.parentNode.removeChild(t),this.markMerge(e,i)}gridMerge(t,e,i=!0){t.lastChild.getAttribute("data-set-richType")!==RICH_MARK&&t.appendChild(this.getGridElm(!0)),e.childNodes[0].getAttribute("data-set-richType")!==RICH_MARK&&e.insertBefore(this.getGridElm(!0),e.childNodes[0]);const n=t.lastChild.childNodes[0],s=n.childNodes[0];let a=s.textContent.length;Array.from(e.childNodes,e=>{t.appendChild(e.cloneNode(!0))}),e.childNodes.length>1&&n.childNodes[1]&&n.removeChild(n.childNodes[1]);const l=n.parentNode.nextSibling;if(l){const e=l.children[0].childNodes[0];e&&e.textContent!==this.VOID_KEY&&(n.childNodes[1]&&n.removeChild(n.childNodes[1]),s.textContent=(s.textContent+e.textContent).replace(new RegExp(this.VOID_KEY,"g"),()=>(a--,"")),s.parentElement.setAttribute("data-set-empty","false")),t.removeChild(l)}""===s.textContent&&(s.textContent=this.VOID_KEY,s.parentNode.setAttribute("data-set-empty","true"),a=1),this.richText.removeChild(e),i&&this.restCursorPos(s,a)}markMerge(t,e){const i=t.children[0].childNodes[0];let n=i.textContent.length;if(e){const t=e.children[0].childNodes[0];t&&t.textContent!==this.VOID_KEY&&(i.textContent=(i.textContent+t.textContent).replace(new RegExp(this.VOID_KEY,"g"),()=>(n--,"")),i.parentElement.setAttribute("data-set-empty","false")),e.parentNode.removeChild(e)}""===i.textContent&&(i.textContent=this.VOID_KEY,i.parentNode.setAttribute("data-set-empty","true"),n=1);const s=t.parentNode;i.textContent===this.VOID_KEY&&t===s.lastChild&&(i.parentNode.appendChild(document.createElement("br")),i.parentNode.setAttribute("data-set-empty","true"),n=1),this.restCursorPos(i,n)}setCallSpace(t){this.needCallSpace=t}getWrapNode(t,e=!1){if(t.nodeType===Node.TEXT_NODE)return t.parentNode.parentNode.parentNode;const i=t.getAttribute("data-set-richType");if(e&&i===RICH_TAG)return t.parentNode;switch(i){case RICH_INPUT:return t.parentNode.parentNode;case RICH_MARK:return t.parentNode;case RICH_GRID:return t}}getMarkNode(t,e=!1){if(t.nodeType===Node.TEXT_NODE)return t.parentNode?t.parentNode.parentNode:null;const i=t.getAttribute("data-set-richType");if(e&&i===RICH_TAG)return t;switch(i){case RICH_INPUT:return t.parentNode;case RICH_MARK:return t}}getRichTextNodeIndex(){let t,e,i,n=null,s=null,a=null;switch(this.lastCursorType){case"inputTag":if(!this.inputTag_vnode)break;if(e=upFindElm(this.inputTag_vnode.parentElement,5),!e)break;i=e.parentElement,n=Array.prototype.indexOf.call(this.richText.children,i),a=Array.prototype.indexOf.call(i.children,e);break;case"gridInput":if(!this.vnode)break;if(t=upFindElm(this.vnode.parentElement,5),!t)break;i=t.parentElement,n=Array.prototype.indexOf.call(this.richText.children,i),s=Array.prototype.indexOf.call(i.children,t)}return{gridIndex:n,markIndex:s,tagIndex:a}}setWrapNodeByMark(t){const e=document.createElement("p");return e.className="chat-grid-wrap",e.setAttribute("data-set-richType",RICH_GRID),Array.from(t,t=>{e.appendChild(t)}),e}insetRangeGrid(t,e=0){const i=this.vnode.textContent,n=i.slice(0,this.cursorIndex-e);0===n.length?(this.vnode.parentElement.setAttribute("data-set-empty","true"),this.vnode.textContent=this.VOID_KEY):this.vnode.textContent=n;let s=i.slice(this.cursorIndex);const a=[],l=document.createDocumentFragment();Array.from(t.children).forEach((t,e)=>{a.push(t),0!==e&&l.appendChild(t)});const o=a[a.length-1].children[0];s&&s.length>0&&s!==this.VOID_KEY?(o.setAttribute("data-set-empty","false"),o.textContent=o.textContent+s):o.setAttribute("data-set-empty","true");const r=this.getMarkNode(this.vnode),c=r.parentElement,h=r.children[0],d=a[0].textContent;d&&d.length>0&&d!==this.VOID_KEY&&(h.setAttribute("data-set-empty","false"),h.textContent=(h.textContent+d).replace(new RegExp(this.VOID_KEY,"g"),"")),h.childNodes[1]&&h.removeChild(h.childNodes[1]),r.nextElementSibling?(o.childNodes[1]&&o.removeChild(o.childNodes[1]),c.insertBefore(l,r.nextElementSibling)):c.appendChild(l);const p=s&&s!==this.VOID_KEY?s.length:0;if(a.length>1){const t=o.childNodes[0];this.restCursorPos(t,t.textContent===this.VOID_KEY?1:t.textContent.length-p)}else{const t=h.childNodes[0];this.restCursorPos(t,t.textContent===this.VOID_KEY?1:t.textContent.length-p)}}insetRangeGrids(t){const e=document.createDocumentFragment();Array.from(t).forEach(t=>{e.appendChild(t)});const i=this.getWrapNode(this.vnode);this.restCursorPos(this.vnode,this.cursorIndex),this.setWrap(!1);const n=i.nextElementSibling;n&&this.richText.insertBefore(e,n);n&&n.previousElementSibling?(this.gridMerge(i,i.nextElementSibling,!1),this.gridMerge(n.previousElementSibling,n,!0)):this.gridMerge(i,i.nextElementSibling,!0)}getOffsetRange(t,e,i=!1){const n=e.children[0].childNodes[0],s=n.textContent;if(0===t)return{rangeNode:n,rangeIndex:i?s.length:s===this.VOID_KEY?1:0};if(s!==this.VOID_KEY&&s.length>=t)return{rangeNode:n,rangeIndex:i?s.length-t:t};let a,l;if(i?(a=Boolean(e.previousElementSibling&&e.previousElementSibling.previousElementSibling),l=Boolean(e.parentElement.previousElementSibling)):(a=Boolean(e.nextElementSibling&&e.nextElementSibling.nextElementSibling),l=Boolean(e.parentElement.nextElementSibling)),!a&&!l)return{rangeNode:n,rangeIndex:i?s.length===this.VOID_KEY?1:0:s.length===this.VOID_KEY?1:s.length};const o=t-s.length,r=i?a?e.previousElementSibling.previousElementSibling:e.parentElement.previousElementSibling.lastElementChild:a?e.nextElementSibling.nextElementSibling:e.parentElement.nextElementSibling.children[0];return this.getOffsetRange(o,r,i)}isInInputTag(){const t=getSelection().focusNode;return!!t&&(t.classList&&t.classList.contains("input-write")?t:t.nodeType===Node.TEXT_NODE&&(!!(t.parentElement&&t.parentElement.classList&&t.parentElement.classList.contains("input-write"))&&t.parentElement))}rangeToInputTag(t){const e=t.children[0].childNodes[0];this.setInputTagRange(e,e.textContent===this.VOID_KEY?1:e.textContent.length)}watchInputTag(t){if(0===t.childNodes.length||0===t.textContent.length)t.textContent=this.VOID_KEY,this.rangeToInputTag(t.parentElement);else{const e=t.childNodes[0];this.target.nextTick(()=>{if(!this.target.chatEvent.isComposition){const i=getSelection().focusOffset,n=t.textContent===this.VOID_KEY||-1===t.textContent.indexOf(this.VOID_KEY)?0:1;let s=!1;1===n&&(e.textContent=e.textContent.replace(this.VOID_KEY,""),s=!0),-1!==t.textContent.indexOf(this.INPUT_TAG_WRAP_KEY[1])&&(t.textContent=t.textContent.replace(new RegExp(this.INPUT_TAG_WRAP_KEY[0],"g"),"").replace(new RegExp(this.INPUT_TAG_WRAP_KEY[1],"g"),this.INPUT_TAG_WRAP_KEY),s=!0),s&&this.setInputTagRange(t.childNodes[0],i-n)}})}domItVisible(t.nextElementSibling,t.textContent===this.VOID_KEY,"inline")}backRuleInputTag(t){if(t.textContent===this.VOID_KEY)return this.delTag(t.parentElement.parentElement),!0;const e=getSelection();if(0===e.focusOffset&&e.isCollapsed){const e=t.parentElement.parentElement.previousElementSibling.children[0].childNodes[0];return this.restCursorPos(e,e.textContent===this.VOID_KEY?1:e.textContent.length),!0}if(-1!==e.focusNode.textContent.indexOf(this.INPUT_TAG_WRAP_KEY[1])){const t=this.getDiffInputTagOffset(e.focusNode,e.focusOffset,"left");if(t>0){const i=e.focusNode.textContent.slice(0,e.focusOffset-1-t),n=e.focusNode.textContent.slice(e.focusOffset);return e.focusNode.textContent=i+n,e.focusNode.textContent?this.setInputTagRange(e.focusNode,i.length):(e.focusNode.textContent=this.VOID_KEY,this.watchInputTag(e.focusNode.parentElement),this.setInputTagRange(e.focusNode,1)),!0}}return!1}mergeRuleInputTag(t){this.target.nextTick(()=>{t.childNodes.length>1&&(t.removeChild(t.childNodes[1]),this.watchInputTag(t))})}inputTagSwitchRange(t){const{focusNode:e,focusOffset:i}=getSelection(),n=e.textContent.length,s=e.parentElement.parentElement.parentElement;let a,l,o,r=!1;switch(t){case"ArrowLeft":i>0&&e.textContent!==this.VOID_KEY?(o=this.getDiffInputTagOffset(e,i,"left"),l=i-1-o,a=e):(a=s.previousElementSibling.children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:a.textContent.length,r=!0);break;case"ArrowRight":i<n&&e.textContent!==this.VOID_KEY?(o=this.getDiffInputTagOffset(e,i,"right"),l=i+1+o,a=e):(a=s.nextElementSibling.children[0].childNodes[0],l=a.textContent===this.VOID_KEY?1:0,r=!0)}r?this.restCursorPos(a,l):this.setInputTagRange(a,l)}pasteInputTag(t){t=t.replace(new RegExp(this.INPUT_TAG_WRAP_KEY[0],"g"),"").replace(new RegExp(this.INPUT_TAG_WRAP_KEY[1],"g"),this.INPUT_TAG_WRAP_KEY);const e=getSelection(),{focusNode:i,focusOffset:n,anchorOffset:s}=e;let a="",l="";e.isCollapsed?(a=i.textContent.slice(0,n)||"",l=i.textContent.slice(n)||""):(a=i.textContent.slice(0,s<n?s:n)||"",l=i.textContent.slice(n>s?n:s)||""),i.textContent=a+t+l,this.setInputTagRange(i,(s<n?s:n)+t.length);const o=i.parentElement;this.watchInputTag(o)}setInputTagWrap(t){const e=getSelection(),{focusOffset:i}=e,n=t.textContent,s=n.slice(0,i),a=n.slice(i);t.textContent=s+this.INPUT_TAG_WRAP_KEY+a,this.setInputTagRange(t.childNodes[0],i+this.INPUT_TAG_WRAP_KEY.length),this.watchInputTag(t)}getDiffInputTagOffset(t,e,i){const n="left"===i?t.textContent[e-1]:t.textContent[e];if(-1===this.INPUT_TAG_WRAP_KEY.indexOf(n))return 0;switch(i){case"left":return t.textContent[e-2]===this.INPUT_TAG_WRAP_KEY[1]?2:t.textContent[e-2]===this.INPUT_TAG_WRAP_KEY[0]?3:1;case"right":return t.textContent[e+1]===this.INPUT_TAG_WRAP_KEY[1]?2:t.textContent[e+1]===this.INPUT_TAG_WRAP_KEY[0]?3:1}}updateNodeCursor(){const{focusNode:t,focusOffset:e}=getSelection();if(!t||t.nodeType!==Node.TEXT_NODE)return;const i=upFindElm(t.parentElement,5);if(!i)return;const n=i.getAttribute("data-set-richType");if(n&&i.parentElement.parentElement===this.richText)switch(n){case RICH_MARK:this.updateGridInputCursor(t,e);break;case RICH_TAG:i.children[0].classList.contains("at-input")&&this.updateInputTagCursor(t,e)}}updateGridInputCursor(t,e){this.lastCursorType="gridInput",this.vnode=t,this.cursorIndex=t.textContent===this.VOID_KEY?1:e}updateInputTagCursor(t,e){this.lastCursorType="inputTag",this.inputTag_vnode=t,this.inputTag_cursorIndex=t.textContent===this.VOID_KEY?1:e}restCursorPos(t,e){null==e?e=t.textContent===this.VOID_KEY?1:0:e>t.textContent.length&&(e=t.textContent.length);const i=new Range;i.setStart(t,e),i.setEnd(t,e);const n=getSelection();n.removeAllRanges(),n.addRange(i),this.updateGridInputCursor(t,e)}setInputTagRange(t,e){null==e?e=t.textContent===this.VOID_KEY?1:0:e>t.textContent.length&&(e=t.textContent.length);const i=new Range;i.setStart(t,e),i.setEnd(t,e);const n=getSelection();n.removeAllRanges(),n.addRange(i),this.updateInputTagCursor(t,e)}setRangeLastRecord(){switch(this.lastCursorType){case"gridInput":this.restCursorPos(this.vnode,this.cursorIndex);break;case"inputTag":this.setInputTagRange(this.inputTag_vnode,this.inputTag_cursorIndex)}}setRangeLastText(){const t=this.richText.childNodes[this.richText.childNodes.length-1],e=t.childNodes[t.childNodes.length-1].children[0].childNodes[0];this.restCursorPos(e,e.textContent===this.VOID_KEY?1:e.textContent.length),this.viewIntoPoint()}viewIntoPoint(){let t,e;const i=getSelection(),{focusNode:n,focusOffset:s}=i;if(n&&n.parentElement&&n.parentElement.classList.contains("input-write"))t=n.parentElement.parentElement,e=s;else{if(!this.vnode)return;t=this.getMarkNode(this.vnode),e=this.cursorIndex}if(!t)return;const a=t.getBoundingClientRect(),l=Math.ceil(a.height/this.NODE_HEIGHT),o=Math.floor(t.textContent.length/l)||1,r=(Math.floor(e/o)||1)*this.NODE_HEIGHT,c=a.top+(r-this.NODE_HEIGHT),h=this.richText.parentElement,d=h.getBoundingClientRect(),p=d.top,g=d.top+d.height;if(c<p+this.NODE_PADDING_DIFF){const t=p-c;h.scrollTo(0,h.scrollTop-t)}else if(c>g-this.NODE_HEIGHT){const t=c-g+this.NODE_HEIGHT;h.scrollTo(0,h.scrollTop+t)}}}class ChatEvent{constructor(t){__publicField(this,"target"),__publicField(this,"outerApply",!1),__publicField(this,"isComposition",!1),__publicField(this,"matchKey",0),__publicField(this,"startOpenIndex",0),__publicField(this,"textLength",0),__publicField(this,"isIMEModel",!1),__publicField(this,"takeIMEModel",!1),__publicField(this,"undoHistory",[]),__publicField(this,"redoHistory",[]),__publicField(this,"doOverHistory",!0),__publicField(this,"chatEventModule",{enterSend:[],operate:[],defaultAction:[],atMatch:[],atCheck:[],tagCheck:[],selectCheck:[],tipTagState:[],afterAtCheck:[],afterTagCheck:[],afterSelectCheck:[],showAtDialog:[],showTagDialog:[],showSelectDialog:[],elementClicked:[]}),__publicField(this,"debounceEvents",{recordHistory:()=>{},dialogMoveToRange:t=>{},selectDialogToAim:()=>{},matchPointDialog:()=>{},movePointActiveUserElm:t=>{},moveCustomActiveTagElm:t=>{}}),this.target=t,this.registerEvent(),this.otherEvent()}registerEvent(){const{chatElement:t,options:e,chatInput:i}=this.target;t.richText.addEventListener("keyup",this.onKeyUp.bind(this)),t.richText.addEventListener("keydown",this.onKeyDown.bind(this)),t.richText.addEventListener("beforeinput",this.onBeforeinput.bind(this)),t.richText.addEventListener("input",this.onInput.bind(this)),t.richText.addEventListener("copy",t=>{t.preventDefault(),this.ruleChatEvent(()=>{this.copyRange(t)},"defaultAction","COPY")}),t.richText.addEventListener("cut",t=>{t.preventDefault(),this.ruleChatEvent(()=>{this.copyRange(t),this.removeRange(),t.target.classList.contains("input-write")&&this.target.chatInput.watchInputTag(t.target)},"defaultAction","CUT")}),t.richText.addEventListener("paste",t=>{t.preventDefault();const{options:e,chatInput:i}=this.target;this.ruleChatEvent(()=>{const n=t.clipboardData.getData("text/plain");if("string"==typeof n&&""!==n){if(-1===e.copyType.indexOf("text"))return;if(this.removeRange(),t.target.classList.contains("input-write"))return i.pasteInputTag(n),void this.richTextInput();const s=t.clipboardData.getData(CHAT_COPY_KEY)||"";if(s&&-1!==s.indexOf(RICH_GRID))return void this.insertInsideHtml(escapeChatHtml(s));this.target.insertText(n)}else{if(-1===e.copyType.indexOf("image"))return;this.removeRange();const i=(t.clipboardData||t.originalEvent.clipboardData).items||[];Array.from(i,async t=>{if(-1===t.type.indexOf("image"))return;const i=t.getAsFile();if(e.uploadImage){const t=await e.uploadImage(i);this.target.insertHtml(`<img class="chat-img" src="${t}" alt="" />`)}else{const t=new FileReader;t.onload=t=>{this.target.insertHtml(`<img class="chat-img" src="${t.target.result}" alt="" />`)},t.readAsDataURL(i)}})}},"defaultAction","PASTE")}),t.richText.addEventListener("blur",()=>{i.updateNodeCursor()}),t.richText.addEventListener("focus",()=>{i.updateNodeCursor()}),t.richText.addEventListener("click",t=>{i.updateNodeCursor();const n=upFindElm(t.target,10);if(n){const t=n.children[0];if(t.classList.contains("chat-grid-input"))return void this.triggerChatEvent("elementClicked","gridInput",t);if(t.classList.contains("at-input"))return t.children[0].textContent===i.VOID_KEY&&i.rangeToInputTag(t),void this.triggerChatEvent("elementClicked","inputTag",t);if(t.classList.contains("at-select")){const i=t.getAttribute("data-select-key");return this.triggerChatEvent("showSelectDialog",i,t),e.needDialog&&this.target.showPCSelectDialog(i,t),void this.triggerChatEvent("elementClicked","selectTag",t)}if(t.classList.contains("at-user"))return void this.triggerChatEvent("elementClicked","userTag",t);if(t.classList.contains("at-tag"))return void this.triggerChatEvent("elementClicked","customTag",t);if(t.classList.contains("chat-set-html"))return void this.triggerChatEvent("elementClicked","htmlTag",t.children[0])}}),t.richText.addEventListener("dragstart",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("dragover",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("drop",t=>{t.stopPropagation(),t.preventDefault()}),t.richText.addEventListener("compositionstart",()=>{this.isComposition=!0}),t.richText.addEventListener("compositionend",()=>{this.isComposition=!1}),window.addEventListener("click",this.winClick.bind(this)),window.addEventListener("keydown",this.winKeydown.bind(this))}onKeyUp(t){if(this.target.chatInput.isInInputTag())return;t.stopPropagation();const e=this.target.chatInput.getCurrentCursorKey();if(this.target.deviceInfo.isPc)if("@"!==t.key&&"2"!==String(t.key)||"@"!==e){this.target.options.customTrigger.filter(e=>e.keyMap.includes(String(t.key))).map(t=>t.prefix).forEach(t=>{e===t&&(this.triggerChatEvent("showTagDialog",t),this.target.options.needDialog&&this.target.chatElement.showCustomTagDialog(t))})}else this.triggerChatEvent("showAtDialog"),this.target.options.needDialog&&this.target.chatElement.ruleShowPointDialog();else if((this.target.options.reformList.length>0||this.target.options.asyncMatch)&&"@"===e)this.triggerChatEvent("showAtDialog"),this.target.options.needDialog&&this.target.showH5Dialog(),this.target.chatElement.isExternalCallPopup=!1;else{this.target.options.customTrigger.map(t=>t.prefix).forEach(t=>{e===t&&this.triggerChatEvent("showTagDialog",t)})}}onKeyDown(t){const e=this.target.chatInput.isInInputTag();if(!this.target.deviceInfo.isPc&&isKeyType(t,"IME"))return e&&this.target.chatInput.mergeRuleInputTag(e),void(this.isIMEModel=!0);this.isIMEModel||(hasElmShow(this.target.chatElement.pcElms.pointDialogElm)?isKeyType(t,"dialog-options")?t.preventDefault():isKeyType(t,"text-move")&&this.target.chatElement.exitPointDialog():this.target.chatElement.pcElms.customTagDialogTagKey&&hasElmShow(this.target.chatElement.pcElms.customTagDialogElms[this.target.chatElement.pcElms.customTagDialogTagKey])?isKeyType(t,"dialog-options")?t.preventDefault():isKeyType(t,"text-move")&&this.target.chatElement.exitCustomTagDialog():(!this.isComposition&&isKeyType(t,"text-delete")?e?(this.target.chatInput.backRuleInputTag(e)&&(t.preventDefault(),this.richTextInput()),this.target.chatInput.mergeRuleInputTag(e)):this.target.chatInput.selectRegionMerge()||this.target.chatInput.gridElmMerge()||this.target.chatInput.delMarkRule()?(t.preventDefault(),this.richTextInput()):this.target.chatElement.tipElm&&this.target.isEmpty()&&this.target.chatElement.removeTipElm():this.target.options.wrapKeyFun(t)||!this.target.deviceInfo.isPc&&"Enter"===t.key?(t.preventDefault(),this.isComposition||(e?this.target.chatInput.setInputTagWrap(e):this.target.chatInput.setWrap(),this.richTextInput())):this.target.options.sendKeyFun(t)?(t.preventDefault(),this.isComposition||this.triggerChatEvent("enterSend")):isKeyType(t,"text-move")?(t.preventDefault(),this.isComposition||(e?this.target.chatInput.inputTagSwitchRange(t.code):this.target.chatInput.switchRange(t.code))):isKeyType(t,"text-select-all")?(t.preventDefault(),this.isComposition||this.target.isEmpty()||this.target.chatInput.selectAll()):isKeyType(t,"text-undo")?(t.preventDefault(),this.isComposition||this.ruleChatEvent(()=>{this.target.undo()},"defaultAction","UNDO")):isKeyType(t,"text-redo")&&(t.preventDefault(),this.isComposition||this.ruleChatEvent(()=>{this.target.redo()},"defaultAction","REDO")),this.target.deviceInfo.isPc&&!getSelection().isCollapsed&&isKeyType(t,"text-write")&&this.target.chatInput.selectRegionMerge()))}onBeforeinput(t){const e=this.target.chatInput.isInInputTag();if(this.isIMEModel){if("insertParagraph"===t.inputType)return t.preventDefault(),e?this.target.chatInput.setInputTagWrap(e):this.target.chatInput.setWrap(),void this.richTextInput();if("deleteContentBackward"===t.inputType){this.takeIMEModel=!0,t.preventDefault();const i=this.target.chatElement.richText.innerHTML,n=getSelection(),s=n.focusNode,a=n.focusOffset;let l=-1,o=-1;if(s.nodeType!==Node.TEXT_NODE){const t=s;if(!t||!t.getAttribute||t.getAttribute("data-set-richType")!==RICH_GRID)return;l=Array.prototype.indexOf.call(this.target.chatElement.richText.children,t),o=0}else{const t=e?s.parentElement.parentElement.parentElement:s.parentElement.parentElement,i=t.parentElement;l=Array.prototype.indexOf.call(this.target.chatElement.richText.children,i),o=Array.prototype.indexOf.call(i.children,t)}this.target.nextTick(()=>{if(this.target.chatElement.richText.innerHTML=i,-1===l||-1===o)return this.takeIMEModel=!1,void(this.isIMEModel=!1);const t=this.target.chatElement.richText.children[l].children[o],n=e?t.children[0].children[0].childNodes[0]:t.children[0].childNodes[0];e?(this.target.chatInput.setInputTagRange(n,a),this.target.chatInput.backRuleInputTag(n.parentElement)||(n.textContent=n.textContent.slice(0,a-1)+n.textContent.slice(a),this.target.chatInput.setInputTagRange(n,a-1)),this.target.chatInput.watchInputTag(n.parentElement)):(this.target.chatInput.restCursorPos(n,a),this.target.chatInput.selectRegionMerge()||this.target.chatInput.gridElmMerge()||this.target.chatInput.delMarkRule()||(n.textContent=n.textContent.slice(0,a-1)+n.textContent.slice(a),this.target.chatInput.restCursorPos(n,a-1))),this.target.nextTick(async()=>{await this.richTextInput(),this.takeIMEModel=!1,this.isIMEModel=!1})})}}}onInput(){const t=this.target.chatInput.isInInputTag();if(this.isIMEModel){if(this.takeIMEModel)return;this.target.nextTick(()=>{t&&this.target.chatInput.watchInputTag(t),this.richTextInput()})}else{if(t)return this.target.chatInput.watchInputTag(t),void this.richTextInput();this.richTextInput().then(()=>{this.target.deviceInfo.isPc&&!this.isComposition&&this.debounceEvents.matchPointDialog()})}}winClick(){if(!this.target||this.outerApply)return;const{chatElement:t}=this.target;hasElmShow(t.pcElms.pointDialogElm)&&t.exitPointDialog(),t.pcElms.checkDialogSearchResultElm&&domItVisible(t.pcElms.checkDialogSearchResultElm),t.pcElms.customTagDialogTagKey&&hasElmShow(t.pcElms.customTagDialogElms[t.pcElms.customTagDialogTagKey])&&t.exitCustomTagDialog(),t.pcElms.selectDialogKey&&hasElmShow(t.pcElms.selectDialogElms[t.pcElms.selectDialogKey])&&t.exitSelectDialog()}async winKeydown(t){if(!this.target)return;const{chatElement:e,options:i}=this.target;if((t.ctrlKey||t.metaKey)&&"KeyZ"===t.code&&t.preventDefault(),!this.isComposition)if(hasElmShow(e.pcElms.pointDialogElm)){if("ArrowDown"===t.code)return t.preventDefault(),void this.debounceEvents.movePointActiveUserElm("down");if("ArrowUp"===t.code)return t.preventDefault(),void this.debounceEvents.movePointActiveUserElm("up");if(("Enter"===t.code||"NumpadEnter"===t.code)&&e.pcElms.pointDialogActiveElm){t.preventDefault();const n=e.pcElms.pointDialogActiveElm.getAttribute("data-set-id");if(await sleep(100),e.isPointSearchMode||i.asyncMatch)await this.target.matchSetTag(i.reformList.find(t=>t.id===n));else{const t=i.userList.find(t=>String(t[i.userProps.id])===n);await this.target.onceSetTag(t)}e.exitPointDialog()}}else if(e.pcElms.customTagDialogTagKey&&hasElmShow(e.pcElms.customTagDialogElms[e.pcElms.customTagDialogTagKey])){if("ArrowDown"===t.code)return t.preventDefault(),void this.debounceEvents.moveCustomActiveTagElm("down");if("ArrowUp"===t.code)return t.preventDefault(),void this.debounceEvents.moveCustomActiveTagElm("up");if(("Enter"===t.code||"NumpadEnter"===t.code)&&e.pcElms.customTagDialogActiveElm){t.preventDefault();const i=e.pcElms.customTagDialogActiveElm.getAttribute("data-set-id");await sleep(100);const n=e.customTags[e.pcElms.customTagDialogTagKey].find(t=>t.id===i);e.isPointSearchMode?await this.target.matchSetCustomTag(n):await this.target.onceSetCustomTag(n),e.exitCustomTagDialog()}}}otherEvent(){const{options:t,chatInput:e,chatElement:i}=this.target,{needDebounce:n}=t,s=()=>{const{gridIndex:t,markIndex:n,tagIndex:s}=e.getRichTextNodeIndex();null!==n?this.undoHistory.push({html:i.richText.innerHTML,gridIndex:t,markIndex:n,tagIndex:s,cursorIndex:e.cursorIndex,inputTag_cursorIndex:e.inputTag_cursorIndex,type:"gridInput"}):null!==s&&this.undoHistory.push({html:i.richText.innerHTML,gridIndex:t,markIndex:n,tagIndex:s,cursorIndex:e.cursorIndex,inputTag_cursorIndex:e.inputTag_cursorIndex,type:"inputTag"}),this.undoHistory.length>50&&this.undoHistory.shift()};this.debounceEvents.recordHistory=n?debounce(s,200):s;const a=t=>{let n="0",s="100%";const a=e.getRangeRect();if(!a)return;const l=i.pcElms.containerDialogElm.getBoundingClientRect();let o=a.x-l.x,r=l.y-a.y;const{clientWidth:c,clientHeight:h}=t;a.x>window.innerWidth-c-30&&(o=a.x-c-l.x-16,n="100%"),a.y<h&&(r-=h,s="0"),t.style.transform="translate(0, 0)",t.style.transformOrigin=`${n} ${s}`,t.style.left=o+6+"px",t.style.bottom=`${r}px`,t.style.opacity="1"};this.debounceEvents.dialogMoveToRange=n?debounce(a,120,!0):a;const l=()=>{if(!t.needDialog||!t.asyncMatch&&0===t.reformList.length&&0===t.customTrigger.length)return;const n=e.getCurrentCursorKey();if(!t.asyncMatch&&"@"===n)return void i.ruleShowPointDialog();if(t.customTrigger.some(t=>{if(n===t.prefix)return i.showCustomTagDialog(t.prefix),!0}))return;const s=e.vnode.textContent||"",a=e.cursorIndex,l=s.slice(0,a);let o=-1,r=-1,c="userTag";if(-1!==l.lastIndexOf("@")&&(o=l.lastIndexOf("@")),i.pcElms.customTagDialogTagKey&&-1!==l.lastIndexOf(i.pcElms.customTagDialogTagKey)&&(r=l.lastIndexOf(i.pcElms.customTagDialogTagKey)),r>o&&(c="customTag"),"userTag"===c&&t.asyncMatch){if(o<0)return void i.exitPointDialog();this.matchKey++;const t=this.matchKey;this.startOpenIndex=o+1;const e=l.slice(this.startOpenIndex)||"";if(/\s/gi.test(e))return void i.exitPointDialog();this.target.updateUserList([]),domItVisible(i.pcElms.pointDialogLoadingElm,!0,"flex"),domItVisible(i.pcElms.pointDialogEmptyElm),i.showPointDialog();const n=this.triggerChatEvent("atMatch",e).find(t=>t&&t instanceof Promise);return void(n&&n.then(e=>{t===this.matchKey&&(domItVisible(i.pcElms.pointDialogLoadingElm),!e||e.length<=0?domItVisible(i.pcElms.pointDialogEmptyElm,!0,"flex"):(this.target.updateUserList(e),i.pcElms.pointDialogUsersElm&&i.pcElms.pointDialogUsersElm.length>0&&i.updatePointActiveUserElm(i.pcElms.pointDialogUsersElm[0].elm)))}))}if("userTag"===c&&t.reformList.length<=0)return void i.exitCustomTagDialog();if("customTag"===c&&i.customTags[i.pcElms.customTagDialogTagKey].length<=0)return;const h=()=>{"userTag"===c?i.exitPointDialog():i.exitCustomTagDialog()};if(o<0&&r<0)return i.exitPointDialog(),void i.exitCustomTagDialog();this.startOpenIndex="userTag"===c?o+1:r+1;const d=new RegExp(`^([${e.ZERO_WIDTH_KEY}${e.VOID_KEY}])+$`);if(!l||d.test(l)||a<this.startOpenIndex)return void h();const p=l.slice(this.startOpenIndex)||"";if(/\s/gi.test(p))h();else if(p)if("userTag"===c){i.isExternalCallPopup=!1;const t=this.target.searchUserList(p);t.length>0?i.showPointDialog(t):h()}else{const t=i.customTags[i.pcElms.customTagDialogTagKey].filter(t=>pinyinMatch(t.name,t.pinyin||"",p));t.length>0?i.showCustomTagDialog(i.pcElms.customTagDialogTagKey,t):h()}else"userTag"===c?i.ruleShowPointDialog():i.showCustomTagDialog(i.pcElms.customTagDialogTagKey)};this.debounceEvents.matchPointDialog=n?debounce(l,200):l;this.debounceEvents.movePointActiveUserElm=throttle(t=>{if(!i.pcElms.pointDialogActiveElm)return;let e=0;const n=i.pcElms.pointDialogActiveElm.getAttribute("data-set-id");i.pcElms.pointDialogUsersElm.some(t=>{const i=t.elm.getAttribute("data-set-id");return e=t.index,n===i});const s=i.pcElms.pointDialogUsersElm.filter(t=>!t.elm.classList.contains("user-no-match")),a=s.map(t=>t.index);let l;"down"===t?l=e===s[s.length-1].index?s[0]:s[a.indexOf(e)+1]:"up"===t&&(l=e===s[0].index?s[s.length-1]:s[a.indexOf(e)-1]),l&&i.updatePointActiveUserElm(l.elm,!0)},80);this.debounceEvents.moveCustomActiveTagElm=throttle(t=>{if(!i.pcElms.customTagDialogActiveElm)return;const e=i.customTags[i.pcElms.customTagDialogTagKey].map(t=>t.id),n=i.pcElms.customTagDialogActiveElm.getAttribute("data-set-id"),s=e.indexOf(n),a=Array.from(i.pcElms.customTagDialogElms[i.pcElms.customTagDialogTagKey].children[1].children,(t,e)=>({elm:t,index:e})).filter(t=>!t.elm.classList.contains("tag-no-match")),l=a.map(t=>t.index);let o;"down"===t?o=s===a[a.length-1].index?a[0]:a[l.indexOf(s)+1]:"up"===t&&(o=s===a[0].index?a[a.length-1]:a[l.indexOf(s)-1]),o&&i.updateActiveCustomTagElm(o.elm,!0)},80);const o=()=>{const t=i.pcElms.selectDialogAim.getClientRects()[0],e=i.pcElms.selectDialogElms[i.pcElms.selectDialogKey];domItVisible(e,!0);const n=e.querySelector(".chat-select-arrow");let s=e.clientHeight+16;if(s>t.y?(s=-(t.height+16),n.style.top="-16px",n.style.bottom="auto",n.style.transform="rotate(0deg)"):(n.style.transform="rotate(180deg)",n.style.bottom="-16px",n.style.top="auto"),window.innerWidth-t.x<e.clientWidth){const i=e.clientWidth-(window.innerWidth-t.x)-10;e.style.left="auto",e.style.right="10px",n.style.left="auto",n.style.right=i-n.clientWidth/2+t.width/2+"px"}else e.style.left=t.x+"px",e.style.right="auto",n.style.left=t.width/2-n.clientWidth/2+"px",n.style.right="auto";e.style.top=t.y+"px",e.style.transform=`translateY(${-s}px)`;const a=e.children[1],l=a.children;let o=0,r=!1,c=0;if(i.pcElms.selectDialogAim.classList.contains("at-select")){const t=i.pcElms.selectDialogAim.getAttribute("data-select-id");updateElmClass(i.pcElms.selectDialogAim,"aim",!0),Array.from(l,e=>{const i=e.lastChild.lastChild,n=t===e.getAttribute("data-set-id");n&&(c=e.clientHeight,r=!0),n||r||(o+=e.clientHeight),domItVisible(i,n,"inline-block")});const e=o-a.clientHeight/2+c/2;a.scrollTop=e>0?e:0}else Array.from(l,t=>{domItVisible(t.lastChild.lastChild,!1,"inline-block")})};this.debounceEvents.selectDialogToAim=n?debounce(o,120):o;const r={html:i.richText.innerHTML,gridIndex:0,markIndex:0,tagIndex:0,type:e.lastCursorType,cursorIndex:e.cursorIndex,inputTag_cursorIndex:e.inputTag_cursorIndex};this.undoHistory=[r]}async richTextInput(t=!0){const{chatInput:e,deviceInfo:i,chatElement:n,options:s}=this.target;return e.updateNodeCursor(),i.isPc&&e.selectRegionMerge(),await this.target.nextTick(()=>{this.isComposition||e.updateGrid(),this.fixEditor()||(-1!==s.maxLength&&this.ruleMaxLength(),n.showPlaceholder(),this.triggerChatEvent("operate"),i.isPc&&t&&this.doOverHistory&&!this.isComposition&&this.debounceEvents.recordHistory(),e.viewIntoPoint())}),!0}ruleMaxLength(){const{options:t,chatElement:e}=this.target;if(this.target.isEmpty()||-1===t.maxLength)return void(this.textLength=0);let i=0,n=0;const s=[];Array.prototype.some.call(e.richText.children,(e,a)=>{const{nodeInfos:l,nodeTextLength:o}=this.getGirdNodeTextInfo(e);if(i+=o,s.push(l),n=a,i>=t.maxLength)return!0});const a=[];Array.from(e.richText.children,(t,e)=>{e>n&&a.push(t)}),a.forEach(t=>e.richText.removeChild(t)),this.deepDelGirdText(s,i)}getGirdNodeTextInfo(t){const{chatInput:e}=this.target,i=[];let n=0;if(1===t.children.length&&t!==t.parentElement.children[0]){const s=t.children[0],a=(s.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length||1,i[0]={node:s,textLength:a.length||1,type:RICH_MARK}}else Array.from(t.children,(t,s)=>{if(t.getAttribute("data-set-richType")===RICH_MARK){const a=(t.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length,i[s]={node:t,textLength:a.length,type:RICH_MARK}}else{const a=(t.textContent||"").replace(new RegExp(e.VOID_KEY,"g"),"");n+=a.length||1,i[s]={node:t,textLength:a.length||1,type:RICH_TAG}}});return{nodeInfos:i,nodeTextLength:n}}deepDelGirdText(t,e){if(e>this.target.options.maxLength){const i=t[t.length-1];t.pop(),this.deepDelNode(i,t,e)}else this.textLength=e}deepDelNode(t,e,i){const n=t[0].node.parentElement;if(i>this.target.options.maxLength){let s=i-this.target.options.maxLength,a=t[t.length-1];if(a.type===RICH_MARK)if(0===a.textLength||s>=a.textLength)n.removeChild(a.node),t.pop(),s-=a.textLength,a=t[t.length-1],n.removeChild(a.node),t.pop(),s-=a.textLength;else{const t=a.node.childNodes[0];t.textContent=t.textContent.slice(0,a.textLength-s),0===t.textContent&&(t.setAttribute("data-set-empty","true"),t.innerHTML=`${this.target.chatInput.VOID_KEY}<br>`),s=0}else n.removeChild(a.node),t.pop(),s-=a.textLength;s>0?t.length>0?this.deepDelNode(t,e,s+this.target.options.maxLength):(this.target.chatElement.richText.appendChild(n),this.deepDelGirdText(e,s+this.target.options.maxLength)):(this.textLength=this.target.options.maxLength+s,this.target.chatInput.setRangeLastText())}}copyRange(t){const e=getSelection();if(e.isCollapsed||e.rangeCount<=0)return t.clipboardData.setData(CHAT_COPY_KEY,""),void t.clipboardData.setData("text/plain","");const{chatElement:i,chatInput:n}=this.target,s=e.toString()||"";let a=document.createElement("div");a.innerHTML=escapeHtml(s);const l=a.textContent.replace(/\n\n/g,"\n");a=null,t.clipboardData.setData("text/plain",l);const o=e.anchorNode,r=e.focusNode;if(o===r&&o.nodeType===Node.TEXT_NODE)return void t.clipboardData.setData(CHAT_COPY_KEY,l);if(o===i.richText&&r===i.richText)return void t.clipboardData.setData(CHAT_COPY_KEY,i.richText.innerHTML);const c=n.getWrapNode(o,!0),h=n.getWrapNode(r,!0),d=n.getMarkNode(o,!0),p=n.getMarkNode(r,!0),g=d.getAttribute("data-set-richType")===RICH_MARK,u=p.getAttribute("data-set-richType")===RICH_MARK,m=Array.prototype.indexOf.call(c.childNodes,d),E=Array.prototype.indexOf.call(h.childNodes,p);if(c===h&&c.parentNode===i.richText){const i=m>E,s=Array.prototype.filter.call(c.childNodes,(t,e)=>i?e<m&&e>E:e>m&&e<E).map(t=>t.cloneNode(!0)),a=g?i?o.textContent.slice(0,e.anchorOffset):o.textContent.slice(e.anchorOffset):"",l=u?i?r.textContent.slice(e.focusOffset):r.textContent.slice(0,e.focusOffset):"",h=n.getGridElm(!0),d=n.getGridElm(!0);a&&(h.childNodes[0].innerHTML=a,h.childNodes[0].setAttribute("data-set-empty","false")),l&&(d.childNodes[0].innerHTML=l,d.childNodes[0].setAttribute("data-set-empty","false")),i?(s[0].getAttribute("data-set-richType")!==RICH_MARK&&s.unshift(d),s[s.length-1].getAttribute("data-set-richType")!==RICH_MARK&&s.push(h)):(s[0].getAttribute("data-set-richType")!==RICH_MARK&&s.unshift(h),s[s.length-1].getAttribute("data-set-richType")!==RICH_MARK&&s.push(d));let p=document.createElement("div");const C=n.setWrapNodeByMark(s);return p.appendChild(C),t.clipboardData.setData(CHAT_COPY_KEY,p.innerHTML),void(p=null)}if(c.parentNode===i.richText&&h.parentNode===i.richText){const s=Array.prototype.indexOf.call(i.richText.childNodes,c),a=Array.prototype.indexOf.call(i.richText.childNodes,h),l=s>a,d=Array.prototype.filter.call(i.richText.childNodes,(t,e)=>l?e<s&&e>a:e>s&&e<a).map(t=>t.cloneNode(!0)),p=g?l?o.textContent.slice(0,e.anchorOffset):o.textContent.slice(e.anchorOffset):"",C=u?l?r.textContent.slice(e.focusOffset):r.textContent.slice(0,e.focusOffset):"",f=n.getGridElm(!0),T=n.getGridElm(!0);p&&(f.childNodes[0].innerHTML=p,f.childNodes[0].setAttribute("data-set-empty","false")),C&&(T.childNodes[0].innerHTML=C,T.childNodes[0].setAttribute("data-set-empty","false"));const x=Array.prototype.filter.call(c.childNodes,(t,e)=>l?e<m:e>m).map(t=>t.cloneNode(!0)),y=Array.prototype.filter.call(h.childNodes,(t,e)=>l?e>E:e<E).map(t=>t.cloneNode(!0));if(l){x.push(f),y.unshift(T);const t=n.setWrapNodeByMark(x),e=n.setWrapNodeByMark(y);d.push(t),d.unshift(e)}else{x.unshift(f),y.push(T);const t=n.setWrapNodeByMark(x),e=n.setWrapNodeByMark(y);d.unshift(t),d.push(e)}let I=document.createElement("div");return Array.from(d,t=>{I.appendChild(t)}),t.clipboardData.setData(CHAT_COPY_KEY,I.innerHTML),void(I=null)}}async removeRange(){const t=getSelection().getRangeAt(0);t&&!t.collapsed&&(this.target.chatInput.selectRegionMerge(),await this.richTextInput())}async setChatHistory(t){const{chatElement:e,chatInput:i}=this.target;this.doOverHistory=!1;const{html:n,gridIndex:s,markIndex:a,tagIndex:l,cursorIndex:o,inputTag_cursorIndex:r,type:c}=t;if(e.richText.innerHTML=n,"inputTag"===c){const t=e.richText.children[s].children[l].children[0].children[0].childNodes[0];i.setInputTagRange(t,r)}else{const t=e.richText.children[s].children[a].children[0].childNodes[0];i.restCursorPos(t,o)}await this.richTextInput(),this.doOverHistory=!0}async insertInsideHtml(t,e=!0){const{chatInput:i}=this.target;i.updateNodeCursor();let n=document.createElement("div");n.innerHTML=t,n.children.length&&(e&&Array.from(n.children,t=>{Array.from(t.children,(e,n)=>{const s=e.getAttribute("data-set-richType");if(s===RICH_MARK){const s=e.children[0];s.textContent&&s.textContent!==i.VOID_KEY?s.textContent=unescapeHtml(s.textContent):(s.setAttribute("data-set-empty","true"),s.innerHTML=n===t.children.length-1?`${i.VOID_KEY}<br>`:i.VOID_KEY)}else if(s===RICH_TAG){const t=e.children[0];t.classList.contains("at-input")?(t.children[1].textContent=unescapeHtml(t.children[1].textContent),t.children[0].textContent&&t.children[0].textContent!==i.VOID_KEY?t.children[0].textContent=unescapeHtml(t.children[0].textContent):(t.children[0].textContent=i.VOID_KEY,domItVisible(t.children[1],!0,"inline"))):t.classList.contains("at-user")||t.classList.contains("at-tag")?t.textContent=unescapeHtml(t.textContent):t.classList.contains("at-select")&&(t.childNodes[0].textContent=unescapeHtml(t.childNodes[0].textContent))}})}),1===n.children.length?i.insetRangeGrid(n.children[0]):i.insetRangeGrids(n.children),n=null,await this.richTextInput())}triggerChatEvent(t,...e){const i=[];return this.chatEventModule[t].forEach(t=>{t&&i.push(t(...e))}),i}ruleChatEvent(t,e,...i){this.triggerChatEvent(e,...i).some(t=>t&&"PREVENT"===t)||(t&&t.bind(this)(),t=null)}fixEditor(){const t=()=>{this.target.chatInput.initEditor(!0),this.target.chatElement.showPlaceholder(),this.textLength=0,this.triggerChatEvent("operate")};if(0===this.target.chatElement.richText.childNodes.length)return t(),!0;const e=this.target.chatElement.richText.childNodes[0];if(!e.getAttribute||e.getAttribute("data-set-richType")!==RICH_GRID||0===e.childNodes.length)return t(),!0;const i=e.childNodes[0];if(!i.getAttribute||i.getAttribute("data-set-richType")!==RICH_MARK||0===i.childNodes.length)return t(),!0;const n=i.childNodes[0];if(!n.getAttribute||n.getAttribute("data-set-richType")!==RICH_INPUT||0===n.childNodes.length)return t(),!0;return 0===n.childNodes[0].textContent.length?(t(),!0):void 0}}class ChatOperateNode{constructor(t){__publicField(this,"target"),__publicField(this,"rankLen",4),this.target=t}getCurrentNodes(){const t=[];return Array.from(this.target.chatElement.richText.children,(e,i)=>{t.push(this.analyzeGrid(e,i))}),t}getRank(t){let e=t+1+"";const i=this.rankLen-e.length;for(let t=0;t<i;t++)e="0"+e;return e}analyzeGrid(t,e){const i={type:"gridBox",rank:this.getRank(e),children:[]};return Array.from(t.children,(t,e)=>{switch(t.getAttribute("data-set-richType")){case RICH_MARK:i.children.push(this.analyzeMark(t,e,i.rank));break;case RICH_TAG:i.children.push(this.analyzeTag(t,e,i.rank))}}),i}analyzeMark(t,e,i){return{type:"gridInput",rank:i+this.getRank(e),text:t.textContent.replace(new RegExp(this.target.chatInput.VOID_KEY,"g"),"")}}analyzeTag(t,e,i){const n=t.children[0],s={type:"htmlTag",rank:i+this.getRank(e)};return n.classList.contains("at-user")?(s.type="userTag",s.dataset={[this.target.options.userProps.id]:n.getAttribute("data-user-id"),[this.target.options.userProps.name]:n.textContent.slice(1)}):n.classList.contains("at-tag")?(s.type="customTag",s.dataset={id:n.getAttribute("data-tag-id"),name:n.textContent.slice(1),prefix:n.getAttribute("data-set-prefix")}):n.classList.contains("at-select")?(s.type="selectTag",s.dataset={id:n.getAttribute("data-select-id"),name:n.textContent,key:n.getAttribute("data-select-key")}):n.classList.contains("at-input")?(s.type="inputTag",s.dataset={key:n.getAttribute("data-input-key"),placeholder:n.children[1].textContent,value:n.children[0].textContent===this.target.chatInput.VOID_KEY?"":n.children[0].textContent.replace(new RegExp(this.target.chatInput.INPUT_TAG_WRAP_KEY[0],"g"),"")}):(s.type="htmlTag",s.html=t.children[0].innerHTML),s}analyzeGridNodes(t){t.children=t.children||[];const e=t.children;if(0===e.length)return void e.push({type:"gridInput",rank:t.rank+this.getRank(0),text:""});const i=[];e.forEach((t,n)=>{if(n===e.length-1)return;const s=n+1;if("gridInput"===t.type&&"gridInput"===e[s].type){let t=s-i.length;i.push(t)}}),i.forEach(t=>{const i=e[t];e[t-1].text+=i.text,e.splice(t,1)});const n=[];e.forEach((t,i)=>{if(i===e.length-1)return;const s=i+1;if("gridInput"!==t.type&&"gridInput"!==e[s].type){let t=s+n.length;n.push(t)}}),n.forEach(t=>{e.splice(t,0,{type:"gridInput",rank:"",text:""})}),"gridInput"!==e[0].type&&e.unshift({type:"gridInput",rank:"",text:""}),"gridInput"!==e[e.length-1].type&&e.push({type:"gridInput",rank:"",text:""}),e.forEach((e,i)=>{e.rank=t.rank+this.getRank(i)})}analyzeNode(t,e=!1){switch(t.type){case"gridInput":return`<span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="${String(""===t.text)}">${""===t.text?this.target.chatInput.VOID_KEY:escapeHtml(t.text)}${e&&""===t.text?"<br>":""}</span></span>`;case"userTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-user" data-user-id="${t.dataset[this.target.options.userProps.id]}">@${escapeHtml(t.dataset[this.target.options.userProps.name])}</span></span>`;case"customTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-tag" data-tag-id="${t.dataset.id}" data-set-prefix="${t.dataset.prefix}">${t.dataset.prefix}${escapeHtml(t.dataset.name)}</span></span>`;case"selectTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-select" data-select-id="${t.dataset.id}" data-select-key="${t.dataset.key}">${escapeHtml(t.dataset.name)}${arrowSvg}</span></span>`;case"htmlTag":return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="chat-set-html">${t.html}</span></span>`;case"inputTag":const i=!Boolean(t.dataset.value),n=escapeHtml(t.dataset.placeholder),s=escapeHtml((t.dataset.value||"").replace(new RegExp(this.target.chatInput.INPUT_TAG_WRAP_KEY[1],"g"),this.target.chatInput.INPUT_TAG_WRAP_KEY)),a=i?`<span class="input-tip">${n}</span>`:`<span class="input-tip chat-view-show" style="display: none">${n}</span>`;return`<span class="chat-tag" contenteditable="false" data-set-richType="${RICH_TAG}"><span class="at-input" contenteditable="false" data-input-key="${t.dataset.key}"><span class="input-write" contenteditable="true">${i?this.target.chatInput.VOID_KEY:s}</span>${a}</span></span>`;case"gridBox":let l="";return this.analyzeGridNodes(t),t.children.forEach((e,i)=>{l+=this.analyzeNode(e,i===t.children.length-1)}),`<p class="chat-grid-wrap" data-set-richType="${RICH_GRID}">${l}</p>`;default:return""}}async insertNode(t){if("gridBox"===t.type){const e=this.analyzeNode(t);let i=document.createElement("div");i.innerHTML=e;const n=i.children[0],s=parseFloat(t.rank)-1;if(-1===s||s>this.target.chatElement.richText.children.length-1)this.target.chatElement.richText.appendChild(n);else{const t=this.target.chatElement.richText.children[s];if(!t)return;this.target.chatElement.richText.insertBefore(n,t)}const a=n.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(a,a.textContent===this.target.chatInput.VOID_KEY?1:a.textContent.length),i=null,await this.target.chatEvent.richTextInput()}else{const e=(t.text||"").length,i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=this.getNodeByRank(i[0]);if(!n)return;const s=parseFloat(i[1])-1;-1==s?n.children.push(t):n.children.splice(s,0,t),await this.updateNode(n,()=>{if("gridInput"===t.type){const t=-1===s||s>n.children.length-1,i=!t&&s%2==0,a=t?n.children[n.children.length-1]:n.children[i?s:s-1];this.setCursorNode(a,i?e:-1)}else if("inputTag"===t.type){const e=this.getElmByRank(t.rank).nextElementSibling;this.target.chatInput.updateGridInputCursor(e.children[0].childNodes[0],0),this.setCursorNode(t,-1)}else{const e=n.children.indexOf(t);this.setCursorNode(n.children[e+1],0)}})}}async updateNode(t,e){const i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=parseFloat(i[0])-1,s=this.target.chatElement.richText.children[n];if("gridBox"===t.type){if(!s)return;this.analyzeGridNodes(t);let i="";if(t.children.forEach((e,n)=>{i+=this.analyzeNode(e,n===t.children.length-1)}),s.innerHTML=i,e)e();else{const t=s.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:t.textContent.length)}return void await this.target.chatEvent.richTextInput()}const a=parseFloat(i[1])-1,l=s.children[a],o=this.getNodeByRank(t.rank);if(!o||t.type!==o.type)return;let r,c;if("gridInput"===t.type){const e=l.children[0];e.innerHTML=escapeHtml(t.text);const i=""!==e.textContent;e.setAttribute("data-set-empty",String(!i)),i||(e.innerHTML=l.nextElementSibling?this.target.chatInput.VOID_KEY:`${this.target.chatInput.VOID_KEY}<br>`),r=e.childNodes[0],c=r.textContent.length}else if("userTag"===t.type){const e=l.children[0];e.setAttribute("data-user-id",t.dataset[this.target.options.userProps.id]),e.textContent=`@${t.dataset[this.target.options.userProps.name]}`;r=l.nextElementSibling.children[0].childNodes[0]}else if("customTag"===t.type){const e=l.children[0];e.setAttribute("data-tag-id",t.dataset.id),e.setAttribute("data-set-prefix",t.dataset.prefix),e.textContent=`${t.dataset.prefix}${t.dataset.name}`;r=l.nextElementSibling.children[0].childNodes[0]}else if("selectTag"===t.type){const e=l.children[0];e.setAttribute("data-select-id",t.dataset.id),e.setAttribute("data-select-key",t.dataset.key),e.childNodes[0].textContent=t.dataset.name;r=l.nextElementSibling.children[0].childNodes[0]}else if("inputTag"===t.type){const i=l.children[0];i.setAttribute("data-input-key",t.dataset.key),i.children[0].textContent=""===t.dataset.value?this.target.chatInput.VOID_KEY:t.dataset.value,i.children[1].textContent=t.dataset.placeholder,domItVisible(i.children[1],""===t.dataset.value,"inline-block"),e=()=>{this.target.chatInput.rangeToInputTag(i)}}else if("htmlTag"===t.type){l.children[0].innerHTML=t.html;r=l.nextElementSibling.children[0].childNodes[0]}e?e():this.target.chatInput.restCursorPos(r,c),await this.target.chatEvent.richTextInput()}getNodeByRank(t){if(!t)return null;const e=t.match(new RegExp(`.{1,${this.rankLen}}`,"g"));if(0===e.length)return null;const i=parseFloat(e[0])-1,n=-1===i?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[i];if(!n)return null;if(1===e.length)return this.analyzeGrid(n,-1===i?this.target.chatElement.richText.children.length-1:i);-1===i&&(e[0]=this.getRank(this.target.chatElement.richText.children.length-1));const s=parseFloat(e[1])-1,a=-1===s?n.lastElementChild:n.children[s];if(!a)return null;return a.getAttribute("data-set-richType")===RICH_MARK?this.analyzeMark(a,-1===s?n.children.length-1:s,e[0]):this.analyzeTag(a,-1===s?n.children.length-1:s,e[0])}async delNodeByRank(t){const e=this.getNodeByRank(t);if(e)if("gridBox"===e.type){const e=parseFloat(t)-1,i=this.target.chatElement.richText.children[e],n=i.nextElementSibling||i.previousElementSibling;if(n){const t=n.lastElementChild.children[0].childNodes[0];this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:t.textContent.length)}this.target.chatElement.richText.removeChild(i),0===this.target.chatElement.richText.children.length&&this.target.chatInput.initEditor(!0),await this.target.chatEvent.richTextInput()}else if("gridInput"===e.type)e.text="",await this.updateNode(e);else{const i=e.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=this.getNodeByRank(i[0]),s=n.children[parseFloat(i[1])-1-1],a=s.text.length;n.children=n.children.filter(e=>e.rank!==t),await this.updateNode(n,()=>{this.setCursorNode(s,a)})}}async coverNodes(t){if(t.length<0)return;let e="";t.forEach(t=>{e+=this.analyzeNode(t)}),this.target.chatElement.richText.innerHTML=e,this.target.chatInput.setRangeLastText(),await this.target.chatEvent.richTextInput()}setCursorNode(t,e=-1){const i=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),n=parseFloat(i[0])-1,s=-1===n?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[n];let a=null;if("gridInput"===t.type){const t=parseFloat(i[1])-1;a=-1===t?s.lastElementChild:s.children[t]}else if("gridBox"===t.type)a=-1===e?s.lastElementChild:s.children[0];else if("inputTag"===t.type){const t=parseFloat(i[1])-1,n=s.children[t].children[0].children[0].childNodes[0],a=n.textContent===this.target.chatInput.VOID_KEY?1:-1===e?n.textContent.length:e;this.target.chatInput.setInputTagRange(n,a)}else{const t=parseFloat(i[1])-1,n=s.children[t];a=-1===e?n.nextElementSibling:n.previousElementSibling,e=-1===e?0:-1}if(a){const t=a.children[0].childNodes[0];-1===e&&(e=t.textContent.length),this.target.chatInput.restCursorPos(t,t.textContent===this.target.chatInput.VOID_KEY?1:e)}}getCursorNode(){const t=getSelection(),e=t.focusNode;if(e&&e.parentElement&&e.parentElement.classList.contains("input-write")){const i=e.parentElement.parentElement.parentElement;return{node:this.analyzeTag(i,Array.prototype.indexOf.call(i.parentElement.children,i),this.getRank(Array.prototype.indexOf.call(this.target.chatElement.richText.children,i.parentElement))),offset:e.textContent===this.target.chatInput.VOID_KEY?0:t.focusOffset}}const i=this.target.chatInput.vnode.parentElement.parentElement;return{node:this.analyzeMark(i,Array.prototype.indexOf.call(i.parentElement.children,i),this.getRank(Array.prototype.indexOf.call(this.target.chatElement.richText.children,i.parentElement))),offset:this.target.chatInput.vnode.textContent===this.target.chatInput.VOID_KEY?0:this.target.chatInput.cursorIndex}}setSelectNodes(t,e,i=0,n=-1){let s,a;const l=t.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),o=e.rank.match(new RegExp(`.{1,${this.rankLen}}`,"g")),r=this.target.chatElement.richText.children[parseFloat(l[0])-1],c=this.target.chatElement.richText.children[parseFloat(o[0])-1];if("gridInput"===t.type)s=r.children[parseFloat(l[1])-1];else if("gridBox"===t.type)s=-1===i?r.lastElementChild:r.children[0];else{const t=parseFloat(l[1])-1,e=r.children[t];s=-1===i?e.nextElementSibling:e.previousElementSibling,i=-1===i?0:-1}if("gridInput"===e.type)a=c.children[parseFloat(o[1])-1];else if("gridBox"===t.type)a=-1===n?c.lastElementChild:c.children[0];else{const t=parseFloat(o[1])-1,e=c.children[t];a=-1===n?e.nextElementSibling:e.previousElementSibling,n=-1===n?0:-1}const h=s.children[0].childNodes[0],d=a.children[0].childNodes[0],p=document.createRange(),g=parseFloat(t.rank)>parseFloat(e.rank);p[g?"setEnd":"setStart"](h,h.textContent===this.target.chatInput.VOID_KEY?1:-1===i?h.textContent.length:i),p[g?"setStart":"setEnd"](d,d.textContent===this.target.chatInput.VOID_KEY?1:-1===n?d.textContent.length:n);const u=getSelection();u.removeAllRanges(),u.addRange(p)}getElmByRank(t){const e=t.match(new RegExp(`.{1,${this.rankLen}}`,"g")),i=parseFloat(e[0])-1,n=-1===i?this.target.chatElement.richText.lastElementChild:this.target.chatElement.richText.children[i];if(1===e.length)return n;const s=parseFloat(e[1])-1;return-1===s?n.lastElementChild:n.children[s]}getRankByElm(t){const e=this.target.chatElement.richText.children;let i=null,n=null;return Array.prototype.find.call(e,(e,s)=>t===e?(i=s,!0):Array.prototype.find.call(e.children,(e,a)=>e===t&&(i=s,n=a,!0))),(null!==i?this.getRank(i):"")+(null!==n?this.getRank(n):"")}}class ChatComponent{constructor(t){__publicField(this,"target"),__publicField(this,"components",{}),__publicField(this,"eventTypes",[]),this.target=t}useComponent(t){t.props=t.props||{},t.template=strictMinifyHtml(t.template||""),t.template=convertBlocksToSpans(t.template||"",t.props),this.components[t.name]=t;const e=/bind-([a-zA-Z]+)="([^"]*)"/g,i=[];let n;for(;null!==(n=e.exec(t.template));)i.push({eventType:n[1],handlerName:n[2]});i.forEach(t=>{this.useComponentEvent(t.eventType)})}useComponentEvent(t){if(this.eventTypes.includes(t))return;this.eventTypes.push(t);this.target.chatElement.richText.addEventListener(t,e=>{this.componentEventRecognizer(e,t)})}componentEventRecognizer(t,e){const i=t.target,n=upFindElm(i,20);if(!n||!n.classList.contains("chat-tag")||!n.children[0].classList.contains("chat-set-html"))return;const s=n.children[0].children[0],a=s.getAttribute("data-set-component");if(!a)return;const l=this.components[a];if(!l)return;const o=l.methods,r=this.deppComponentEvent(s,e).reverse();let c=!1,h=0;const d=()=>{if(c)return;const n=r[h];if(i===n||n.contains(i)){const i=n.getAttribute("bind-"+e),a=Object.create(null);for(const t in s.dataset)t in l.props&&(a[t]=s.dataset[t]);const r={componentElm:s,targetElm:n,data:a,eventType:e,eventName:i,stopPropagation:()=>{c=!0}};o[i]&&o[i](r,t)}h<r.length-1&&(h++,d())};d()}deppComponentEvent(t,e){const i=[];return t.getAttribute("bind-"+e)&&i.push(t),t.children&&t.children.length>0&&Array.from(t.children).forEach(t=>{i.push(...this.deppComponentEvent(t,e))}),i}async insertComponent(t,e){const i=this.components[t];if(!i)return;const n=Object.assign({},i.props,e),s=replaceTemplateVariables(i.template,{...n,[ELEMENT_COMPONENT_KEY]:i.name}),a=await this.target.insertHtml(s);return await this.target.chatEvent.richTextInput(),a}async removeComponentElm(t){const e=upFindElm(t,20);e&&(this.target.chatInput.delTag(e),await this.target.chatEvent.richTextInput())}async updateComponentElm(t,e){var i,n;const s=upFindElm(t,20);if(!s)return;const a=null==(n=null==(i=null==s?void 0:s.children[0])?void 0:i.children[0])?void 0:n.getAttribute("data-set-component");if(!a)return;const l=this.components[a];if(!l)return;const o=Object.assign({},l.props,e);s.children[0].innerHTML=replaceTemplateVariables(l.template,{...o,[ELEMENT_COMPONENT_KEY]:l.name}),await this.target.chatEvent.richTextInput()}getComponentElms(t){const e=[],i=this.target.chatElement.richText.querySelectorAll(".chat-tag");return Array.from(i,i=>{this.isComponentElm(i,t)&&e.push(i)}),e}isComponentElm(t,e){return!!(t&&t.children[0]&&t.children[0].children[0])&&t.children[0].children[0].getAttribute("data-set-component")===e}}const DEFAULT_OPTIONS={device:"auto",autoFocus:!0,needDialog:!0,needDebounce:!0,asyncMatch:!1,userList:[],reformList:[],placeholder:"",maxLength:-1,copyType:["text"],uploadImage:void 0,needCallEvery:!0,needCallSpace:!1,userProps:{},customTrigger:[],dialogLabels:{pcPointDialog:{},pcPCheckDialog:{},h5Dialog:{}},wrapKeyFun:t=>t.ctrlKey&&["Enter"].includes(t.key),sendKeyFun:t=>!t.ctrlKey&&["Enter"].includes(t.key)},DEFAULT_USER_PROPS={id:"id",name:"name",avatar:"avatar",pinyin:"pinyin"},DEFAULT_PC_POINT_DIALOG={title:"群成员",callEveryLabel:"所有人",checkLabel:"多选",emptyLabel:"暂无数据"},DEFAULT_PC_CHECK_DIALOG={title:"选择要@的人",searchPlaceholder:"搜素人员名称",searchEmptyLabel:"没有匹配到任何结果",userTagTitle:"研讨成员列表",checkAllLabel:"全选",checkEmptyLabel:"请选择需要@的成员",confirmLabel:"确定",cancelLabel:"取消"},DEFAULT_H5_DIALOG={title:"选择提醒的人",callEveryLabel:"所有人",searchPlaceholder:"搜素人员名称",searchEmptyLabel:"没有匹配到任何结果",confirmLabel:"确定",cancelLabel:"收起"},DEFAULT_REDUCE_CONFIG={saveTagData:!1,needUserId:!1,needTagId:!1,needSelectId:!1,needTipKey:!1,wrapClassName:void 0,rowClassName:void 0,imgToText:!1,identifyLink:!1},KEY_CODE_MAP={"`":["`","~"],"~":["`","~"],1:["1","!"],"!":["1","!"],3:["3","#"],"#":["3","#"],4:["4","$"],$:["4","$"],5:["5","%"],"%":["5","%"],6:["6","^"],"^":["6","^"],7:["7","&"],"&":["7","&"],8:["8","*"],"*":["8","*"],";":[";",":"],":":[";",":"],"/":["/","?"],"?":["/","?"],"\\":["\\","|"],"|":["\\","|"]},arrObSort=function(t,e,i){return t.forEach(t=>{if(i in t){const n=e.indexOf(String(t[i]));-1!==n&&(e[n]=t)}}),e.filter(t=>t[i])};class ChatArea{constructor(t){switch(__publicField(this,"options"),__publicField(this,"deviceInfo",os()),__publicField(this,"chatElement"),__publicField(this,"chatInput"),__publicField(this,"chatEvent"),this.options=Object.assign({},DEFAULT_OPTIONS,t),this.options.device=this.options.device.toLocaleLowerCase(),this.deviceInfo.isTablet&&(this.deviceInfo.isPc=!1),this.options.device){case"pc":this.deviceInfo.isPc=!0;break;case"h5":this.deviceInfo.isPc=!1}this.options.userProps=Object.assign({},DEFAULT_USER_PROPS,t.userProps||{}),this.options.dialogLabels.pcPointDialog=Object.assign({},DEFAULT_PC_POINT_DIALOG,getObjValue(t.dialogLabels,"pcPointDialog",{})),this.options.dialogLabels.pcPCheckDialog=Object.assign({},DEFAULT_PC_CHECK_DIALOG,getObjValue(t.dialogLabels,"pcPCheckDialog",{})),this.options.dialogLabels.h5Dialog=Object.assign({},DEFAULT_H5_DIALOG,getObjValue(t.dialogLabels,"h5Dialog",{})),this.chatElement=new ChatElement(this),this.chatInput=new ChatInput(this),this.chatEvent=new ChatEvent(this),this.updateConfig(t);const e=this;Object.defineProperty(this,"richText",{get:()=>e.chatElement.richText}),Object.defineProperty(this,"textLength",{get:()=>e.chatEvent.textLength}),this.options.autoFocus&&this.nextTick(()=>{this.chatElement.richText.focus()})}updateConfig(t){void 0!==t.copyType&&(this.options.copyType=t.copyType),t.userProps&&(this.options.userProps=Object.assign({},DEFAULT_USER_PROPS,t.userProps)),void 0!==t.uploadImage&&(this.options.uploadImage=t.uploadImage),void 0!==t.placeholder&&(this.chatElement.placeholderElm.textContent=t.placeholder),void 0!==t.maxLength&&(this.options.maxLength=t.maxLength<=0?-1:t.maxLength,this.chatEvent.ruleMaxLength()),this.options.asyncMatch?(this.options.needCallEvery=!1,this.updateUserList([])):(void 0!==t.needCallEvery||t.userList)&&(this.options.needCallEvery=getBoolean(void 0===t.needCallEvery?this.options.needCallEvery:t.needCallEvery),this.updateUserList(t.userList)),void 0!==t.needCallSpace&&this.chatInput.setCallSpace(getBoolean(t.needCallSpace)),void 0!==t.wrapKeyFun&&(this.options.wrapKeyFun=t.wrapKeyFun),void 0!==t.sendKeyFun&&(this.options.sendKeyFun=t.sendKeyFun),t.customTrigger&&(this.options.customTrigger=t.customTrigger.map(t=>(t.keyMap||(t.keyMap=KEY_CODE_MAP[t.prefix]||[]),t)),this.options.needDialog&&this.deviceInfo.isPc&&this.chatElement.bindCustomTrigger()),t.selectList&&(this.options.selectList=t.selectList,this.options.needDialog&&this.deviceInfo.isPc&&this.chatElement.bindSelectList())}updateUserList(t=void 0){const{options:e,chatElement:i}=this;if(t){e.userList=JSON.parse(JSON.stringify(t));const i={[e.userProps.id]:"isALL",[e.userProps.name]:""};e.userList.unshift(i),e.reformList=t.map(t=>({id:String(t[e.userProps.id]),name:String(t[e.userProps.name]||""),avatar:String(t[e.userProps.avatar]||""),pinyin:String(t[e.userProps.pinyin]||"")}))}const n=e.userList[0];n&&"isALL"===n[e.userProps.id]&&(n[e.userProps.name]=this.deviceInfo.isPc?e.dialogLabels.pcPointDialog.callEveryLabel:e.dialogLabels.h5Dialog.callEveryLabel),e.needDialog&&(this.deviceInfo.isPc?i.updatePCUser():i.updateH5User())}searchUserList(t){return this.options.reformList.filter(e=>pinyinMatch(e.name,e.pinyin||"",t))}getReduceNode(t){const e=Object.assign({},DEFAULT_REDUCE_CONFIG,t||{});e.saveTagData&&(e.needUserId=!0,e.needTagId=!0,e.needSelectId=!0,e.needTipKey=!0);const i=/(https?|http|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g,n=this.chatElement.richText.cloneNode(!0).children||[],s=document.createElement("div");return e.wrapClassName&&(s.className=e.wrapClassName),Array.from(n,(t,n)=>{const a=document.createElement("p");Array.from(t.children,t=>{const n=t.children[0];this.chatInput.getNodeEmpty(n)||(n.removeAttribute("data-set-richType"),n.removeAttribute("contenteditable"),n.removeAttribute("data-set-empty"),e.needUserId||n.removeAttribute("data-user-id"),e.needTagId||(n.removeAttribute("data-set-prefix"),n.removeAttribute("data-tag-id")),e.needSelectId||(n.removeAttribute("data-select-id"),n.removeAttribute("data-select-key")),e.imgToText&&n.firstChild&&"IMG"===n.firstChild.tagName&&(n.classList.add("img-to-text"),n.innerHTML=`[${n.firstChild.getAttribute("data-img-text")||"you need set data-img-text"}]`),e.identifyLink&&n.classList.contains("chat-grid-input")&&(n.innerHTML=n.innerHTML.replace(i,t=>`<a class="chat-grid-link" href="${t}" target="_blank">${t}</a>`)),n.classList.contains("at-select")&&(n.classList.remove("aim"),n.removeChild(n.lastChild)),n.classList.contains("at-input")&&(e.needTipKey?n.setAttribute("data-input-tip",n.children[1].textContent):n.removeAttribute("data-input-key"),n.textContent=n.children[0].textContent!==this.chatInput.VOID_KEY?n.children[0].textContent:n.children[1].textContent,n.textContent=n.textContent.replace(new RegExp(this.chatInput.INPUT_TAG_WRAP_KEY[0],"g"),"")),a.appendChild(n))}),e.rowClassName&&(a.className=e.rowClassName),a.innerHTML||(a.innerHTML="<br>"),s.appendChild(a)}),s}getText(t){let e="";const i=this.getReduceNode(t);return Array.from(i.children,(t,i)=>{e=e+(i>0?"\n":"")+t.textContent}),e}getHtml(t){return this.getReduceNode(t).innerHTML}async reverseAnalysis(t,e){if(!t)return;const i=document.createElement("div");i.innerHTML=t;const n=i.children;Array.from(n,t=>{t.className="chat-grid-wrap",t.setAttribute("data-set-richType",RICH_GRID);const e=t.children,i={},n=[];Array.from(e,(s,a)=>{if(-1!==s.className.indexOf("chat-grid-input")){const t=s.textContent||"";return s.hasAttribute("class")&&s.removeAttribute("class"),s.setAttribute("data-set-richType",RICH_MARK),void(s.innerHTML=`<span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="false">${escapeHtml(t)}</span>`)}if(s.tagName&&"BR"===s.tagName.toLocaleUpperCase()){const e=this.chatInput.getGridElm(!0);return t.removeChild(s),void t.appendChild(e)}const l=s.cloneNode(!0);l.setAttribute("contenteditable","false");const o=document.createElement("span");if(o.className="chat-tag",o.setAttribute("contenteditable","false"),o.setAttribute("data-set-richType",RICH_TAG),o.appendChild(l),i[a]=o,a!==e.length-1){-1===e[a+1].className.indexOf("chat-grid-input")&&n.push(a)}else n.push(a);0===a&&n.push(-1)});for(const n in i){const s=Number(n),a=i[n].lastChild;if(a.classList.contains("at-select"))a.innerHTML=`${escapeHtml(a.textContent)}${arrowSvg}`;else if(a.classList.contains("at-input")){const t=escapeHtml(a.getAttribute("data-input-tip")),e=escapeHtml((a.textContent||"").replace(new RegExp(this.chatInput.INPUT_TAG_WRAP_KEY[1],"g"),this.chatInput.INPUT_TAG_WRAP_KEY)),i=""===a.textContent,n=i?`<span class="input-tip">${t}</span>`:`<span class="input-tip chat-view-hidden" style="display: none">${t}</span>`;a.innerHTML=`<span class="input-write" contenteditable="true">${i?this.chatInput.VOID_KEY:e}</span>${n}`,a.removeAttribute("data-input-tip")}s===e.length-1?(t.removeChild(e[s]),t.appendChild(i[n])):(t.insertBefore(i[n],e[s+1]),t.removeChild(e[s]))}const s=[],a=t.children;n.forEach(t=>{t===a.length-1?s.push("isEnd"):s.push(a[t+1])}),s.forEach(e=>{const i=this.chatInput.getGridElm(!0);if("isEnd"===e)t.appendChild(i);else{const n=i.children[0];n.childNodes.length>1&&n.removeChild(n.childNodes[1]),t.insertBefore(i,e)}})}),e?(this.chatInput.setRangeLastText(),await this.chatEvent.insertInsideHtml(i.innerHTML,!1)):(this.chatElement.richText.innerHTML=i.innerHTML,this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput())}async insertHtml(t){if(!t)return;const e=document.createElement("span");e.innerHTML=t,e.className="chat-set-html";const i=this.chatInput.createNewDom(e);return this.chatInput.replaceRegContent(i,!1),await this.chatEvent.richTextInput(),i}async insertText(t){if(!t)return;t=escapeHtml(t);const e=new RegExp(`[${this.chatInput.ZERO_WIDTH_KEY}|${this.chatInput.VOID_KEY}]`,"ig"),i=t.replace(e,"");if(!i)return;const n=i.split("\n");let s="";n.forEach(t=>{const e=""!==t;s+=`<p class="chat-grid-wrap" data-set-richType="${RICH_GRID}"><span data-set-richType="${RICH_MARK}"><span class="chat-grid-input" data-set-richType="${RICH_INPUT}" data-set-empty="${e?"false":"true"}">${e?t:this.chatInput.VOID_KEY+"<br>"}</span></span></p>`}),await this.chatEvent.insertInsideHtml(s)}getCallUserList(){const t=this.chatElement.richText.querySelectorAll(".at-user");if(t&&t.length>0){const e=Array.from(t,t=>t.dataset.userId);return arrObSort(this.options.userList,e,this.options.userProps.id)}return[]}getCallUserTagList(){const t=this.chatElement.richText.querySelectorAll(".at-user");if(t&&t.length>0){const e=[];return Array.from(t,t=>{e.some(e=>e[this.options.userProps.id]===t.dataset.userId)||e.push({[this.options.userProps.id]:t.dataset.userId,[this.options.userProps.name]:t.textContent.slice(1)})}),e}return[]}getCustomTagList(){const t=Object.keys(this.chatElement.customTags),e={},i=this.chatElement.richText.querySelectorAll(".at-tag");return t.forEach(t=>{let n=Array.prototype.filter.call(i,e=>e.getAttribute("data-set-prefix")===String(t)).map(t=>t.getAttribute("data-tag-id"));n=n.filter((t,e)=>n.indexOf(t)===e),e[t]=arrObSort(this.chatElement.customTags[t],n,"id")}),e}getSelectTagList(){const t=Object.keys(this.chatElement.selectTags),e={},i=this.chatElement.richText.querySelectorAll(".at-select");return t.forEach(t=>{let n=Array.prototype.filter.call(i,e=>e.getAttribute("data-select-key")===String(t)).map(t=>t.getAttribute("data-select-id"));n=n.filter((t,e)=>n.indexOf(t)===e),e[t]=arrObSort(this.chatElement.selectTags[t],n,"id")}),e}getInputTagList(){const t={},e=this.chatElement.richText.querySelectorAll(".at-input");return Array.from(e,e=>{const i=e.getAttribute("data-input-key"),n=e.children[0].textContent===this.chatInput.VOID_KEY?null:e.children[0].textContent;t[i]||(t[i]=[]),t[i].push(n)}),t}async clear(t){this.chatInput.initEditor(!0,t),this.clearHistory(),await this.chatEvent.richTextInput(!1)}lineBreak(){this.cursorToLastRecord(),"inputTag"===this.chatInput.lastCursorType?this.chatInput.setInputTagWrap(this.chatInput.inputTag_vnode.parentElement):this.chatInput.setWrap(!0)}isEmpty(t=!1){if(0===this.chatElement.richText.children.length)return!0;if(-1!==this.chatElement.richText.innerHTML.indexOf("chat-tag"))return!1;if(1===this.chatElement.richText.children.length){const t=this.chatElement.richText.children[0],e=t.children[0].children[0];if(1===t.children.length&&(0===e.textContent.length||e.textContent===this.chatInput.VOID_KEY))return!0}return!!t&&""===this.chatElement.richText.textContent.trim()}dispose(){if(this.options.elm.removeChild(this.chatElement.richText),this.options.elm.removeChild(this.chatElement.placeholderElm),this.options.needDialog)if(this.deviceInfo.isPc){const t=this.chatElement.pcElms.containerDialogElm.parentElement;t&&t.removeChild(this.chatElement.pcElms.containerDialogElm)}else document.body.removeChild(this.chatElement.h5Elms.dialogElm)}showPCPointDialog(){this.options.needDialog&&(this.insertText("@"),this.options.asyncMatch&&domItVisible(this.chatElement.pcElms.pointDialogEmptyElm,!0,"flex"),this.chatEvent.outerApply=!0,this.chatElement.showPointDialog(),sleep(50).then(()=>{this.chatEvent.outerApply=!1}))}showPCCheckDialog(){this.options.needDialog&&!this.options.asyncMatch&&(this.chatEvent.winClick(),this.chatElement.checkboxRows=[],domItVisible(this.chatElement.pcElms.checkDialogElm,!0),updateElmClass(document.body,"disable-scroll",!0),this.chatElement.pcElms.checkDialogTagsElm.scrollTop=0,this.chatElement.pcElms.checkDialogUsersElm.scrollTop=0,this.chatElement.pcElms.checkDialogSearchInputElm.value="",this.chatElement.updateCheckDialogTags(),this.chatElement.isExternalCallPopup=!0)}showPCCustomTagDialog(t){this.options.needDialog&&!this.options.asyncMatch&&(this.insertText(t),this.chatEvent.outerApply=!0,this.chatElement.showCustomTagDialog(t),sleep(50).then(()=>{this.chatEvent.outerApply=!1}))}showPCSelectDialog(t,e){this.chatElement.exitCustomTagDialog(),this.chatElement.exitPointDialog(),this.chatEvent.outerApply=!0,e&&(this.chatElement.exitSelectDialog(),this.chatElement.pcElms.selectDialogAim=e),this.chatElement.pcElms.selectDialogKey=t,this.chatEvent.debounceEvents.selectDialogToAim(),sleep(50).then(()=>{this.chatEvent.outerApply=!1})}showH5Dialog(){this.chatElement.richText&&this.chatElement.richText.blur(),Array.from(this.chatElement.h5Elms.dialogMainElm.children,t=>{t.style.display="",updateElmClass(t,"user-popup-check-item-check")}),updateElmClass(this.chatElement.h5Elms.dialogCheckElm,"disabled",!0),domItVisible(this.chatElement.h5Elms.dialogElm,!0),updateElmClass(document.body,"disable-scroll",!0),this.options.asyncMatch&&domItVisible(this.chatElement.h5Elms.dialogEmptyElm,!0,"flex"),this.chatElement.h5Elms.dialogMainElm.scrollTop=0,this.chatElement.isExternalCallPopup=!0}disabled(){this.chatElement.richText.setAttribute("contenteditable","false"),updateElmClass(this.chatElement.richText,"chat-rich-text-disabled",!0)}enable(){this.chatElement.richText.setAttribute("contenteditable","true"),updateElmClass(this.chatElement.richText,"chat-rich-text-disabled"),this.chatInput.setRangeLastText()}async setUserTag(t){this.chatInput.updateNodeCursor(),this.chatEvent.triggerChatEvent("atCheck",[t]);const e=this.chatInput.createChatTagElm({id:t[this.options.userProps.id],name:t[this.options.userProps.name]},"@","at-user","user-id");this.chatInput.replaceRegContent(e,!1),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async setCustomTag(t,e){this.chatInput.updateNodeCursor(),this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,!1,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",t,e)}async setSelectTag(t,e){if(this.chatInput.updateNodeCursor(),e||(e=this.chatElement.pcElms.selectDialogKey),this.chatEvent.triggerChatEvent("selectCheck",t,e),this.chatElement.pcElms.selectDialogAim&&this.chatElement.pcElms.selectDialogAim.classList.contains("at-select")){const e=this.chatElement.pcElms.selectDialogAim.getAttribute("data-select-id"),i=this.chatElement.pcElms.selectDialogAim.parentElement.nextElementSibling.childNodes[0].childNodes[0];if(this.chatInput.restCursorPos(i),e===t.id)return;this.chatElement.pcElms.selectDialogAim.setAttribute("data-select-id",t.id),this.chatElement.pcElms.selectDialogAim.childNodes[0].textContent=t.name}else{const i=document.createElement("span");i.setAttribute("class","at-select"),i.setAttribute("data-select-key",e),i.setAttribute("data-select-id",t.id),i.innerHTML=`${escapeHtml(t.name)}${arrowSvg}`;const n=this.chatInput.createNewDom(i);this.chatInput.replaceRegContent(n,!1)}await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterSelectCheck",t,e)}async setInputTag(t,e,i=""){this.chatInput.updateNodeCursor();const n=document.createElement("span");n.setAttribute("class","at-input"),n.setAttribute("contenteditable","false"),n.setAttribute("data-input-key",t);const s=document.createElement("span");s.setAttribute("class","input-write"),s.setAttribute("contenteditable","true"),s.textContent=i||this.chatInput.VOID_KEY;const a=document.createElement("span");a.setAttribute("class","input-tip"),a.textContent="["+(e||"Please input")+"]",n.appendChild(s),n.appendChild(a);const l=this.chatInput.createNewDom(n);this.chatInput.replaceRegContent(l,!1),i&&this.chatInput.watchInputTag(s),this.chatInput.rangeToInputTag(n),await this.chatEvent.richTextInput()}async matchSetTag(t){this.chatInput.updateNodeCursor(),this.chatEvent.triggerChatEvent("atCheck",[t]),await this.chatInput.onceSearchCall(t,this.chatEvent.startOpenIndex),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async onceSetTag(t){this.chatInput.updateNodeCursor(),this.chatEvent.triggerChatEvent("atCheck",[t]),await this.chatInput.onceCall({id:t[this.options.userProps.id],name:t[this.options.userProps.name]}),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",[t])}async batchSetTag(t){this.chatInput.updateNodeCursor(),this.chatEvent.triggerChatEvent("atCheck",t);const e=[];for(let i=0;i<=t.length-1;)e.push({id:t[i][this.options.userProps.id],name:t[i][this.options.userProps.name]}),i++;await this.chatInput.batchReplaceRegContent(e,!this.chatElement.isExternalCallPopup),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterAtCheck",t)}async onceSetCustomTag(t,e){this.chatInput.updateNodeCursor(),e||(e=this.chatElement.pcElms.customTagDialogTagKey),this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,!0,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",t,e)}async matchSetCustomTag(t,e){this.chatInput.updateNodeCursor(),e||(e=this.chatElement.pcElms.customTagDialogTagKey),this.chatEvent.triggerChatEvent("tagCheck",t,e),await this.chatInput.onceCustomCall(t,this.chatEvent.startOpenIndex,e),await this.chatEvent.richTextInput(),this.chatEvent.triggerChatEvent("afterTagCheck",e)}async undo(){const{chatEvent:t}=this;if(!t.doOverHistory||!t.undoHistory||t.undoHistory.length<=1)return;const e=t.undoHistory[t.undoHistory.length-2],i=t.undoHistory[t.undoHistory.length-1];t.redoHistory.push(i),t.undoHistory.pop(),await t.setChatHistory(e)}async redo(){const{chatEvent:t}=this;if(!t.doOverHistory||!t.redoHistory||t.redoHistory.length<1)return;const e=t.redoHistory[t.redoHistory.length-1];t.redoHistory.pop(),t.undoHistory.push(e),await t.setChatHistory(e)}clearHistory(){const{gridIndex:t,markIndex:e,tagIndex:i}=this.chatInput.getRichTextNodeIndex();this.chatEvent.undoHistory=[{html:this.chatElement.richText.innerHTML,gridIndex:t||0,markIndex:e||0,tagIndex:i||0,type:this.chatInput.lastCursorType,cursorIndex:this.chatInput.cursorIndex,inputTag_cursorIndex:this.chatInput.inputTag_cursorIndex}],this.chatEvent.redoHistory=[]}cursorMove(t){if(0===t)return void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const e=new RegExp(`[${this.chatInput.ZERO_WIDTH_KEY}|${this.chatInput.VOID_KEY}]`,"ig");if(t>0){const i=this.chatInput.vnode.textContent.replace(e,"").slice(this.chatInput.cursorIndex);if(i.length>=t)return this.chatInput.cursorIndex+=t,void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const n=this.chatInput.vnode.parentElement.parentElement,s=n.parentElement;let a=Boolean(n.nextElementSibling&&n.nextElementSibling.nextElementSibling);const l=Boolean(s.nextElementSibling);if(!a&&!l)return this.chatInput.cursorIndex+=i.length,0===this.chatInput.cursorIndex&&(this.chatInput.cursorIndex=1),void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const o=t-i.length-1,r=a?n.nextElementSibling.nextElementSibling:s.nextElementSibling.children[0],{rangeNode:c,rangeIndex:h}=this.chatInput.getOffsetRange(o,r);this.chatInput.restCursorPos(c,h)}else if(t<0){let i=Math.abs(t);const n=this.chatInput.vnode.textContent.replace(e,"").slice(0,this.chatInput.cursorIndex);if(n.length>=i)return this.chatInput.cursorIndex-=i,void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const s=this.chatInput.vnode.parentElement.parentElement,a=s.parentElement,l=Boolean(s.previousElementSibling&&s.previousElementSibling.previousElementSibling),o=Boolean(a.previousElementSibling);if(!l&&!o)return void this.chatInput.restCursorPos(this.chatInput.vnode);i=i-n.length-1;const r=l?s.previousElementSibling.previousElementSibling:a.previousElementSibling.lastElementChild,{rangeNode:c,rangeIndex:h}=this.chatInput.getOffsetRange(i,r,!0);this.chatInput.restCursorPos(c,h)}}async cursorDel(t){if(0===t)return void this.chatInput.restCursorPos(this.chatInput.vnode,this.chatInput.cursorIndex);const e=this.chatInput.vnode,i=this.chatInput.cursorIndex;this.cursorMove(t);const n=this.chatInput.vnode,s=this.chatInput.cursorIndex,a=document.createRange();t<0?(a.setStart(n,s),a.setEnd(e,i)):(a.setStart(e,i),a.setEnd(n,s));const l=getSelection();l.removeAllRanges(),l.addRange(a),await this.chatEvent.removeRange()}cursorToLastRecord(){this.chatInput.setRangeLastRecord()}async delUserTags(t){const e=t||this.options.userList.map(t=>t[this.options.userProps.id]),i=this.chatElement.richText.querySelectorAll(".at-user"),n=[];Array.from(i,t=>{const i=t.getAttribute("data-user-id");e.some(t=>String(t)===i)&&n.push(t.parentElement)});for(let t=0;t<n.length;){const e=n[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delCustomTags(t,e){const i=this.options.customTrigger.find(e=>e.prefix===t);if(!i||0===i.tagList.length)return;const n=e||i.tagList.map(t=>t.id),s=this.chatElement.richText.querySelectorAll(".at-tag"),a=[];Array.from(s,e=>{const i=e.getAttribute("data-set-prefix"),s=e.getAttribute("data-tag-id");i===t&&n.some(t=>String(t)===s)&&a.push(e.parentElement)});for(let t=0;t<a.length;){const e=a[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delSelectTags(t,e){const i=this.options.selectList.find(e=>e.key===t);if(!i||0===i.options.length)return;const n=e||i.options.map(t=>t.id),s=this.chatElement.richText.querySelectorAll(".at-select"),a=[];Array.from(s,e=>{const i=e.getAttribute("data-select-key"),s=e.getAttribute("data-select-id");i===t&&n.some(t=>String(t)===s)&&a.push(e.parentElement)});for(let t=0;t<a.length;){const e=a[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}async delInputTags(t){const e=this.chatElement.richText.querySelectorAll(".at-input"),i=[];Array.from(e,e=>{if(t){const n=e.getAttribute("data-input-key");t.some(t=>String(t)===n)&&i.push(e.parentElement)}else i.push(e.parentElement)});for(let t=0;t<i.length;){const e=i[t];this.chatInput.delTag(e),t++}this.chatInput.setRangeLastText(),await this.chatEvent.richTextInput()}openTipTag(t){this.chatElement.createTipElm(t),this.cursorToLastRecord()}openCustomTipTag(t){const e=this.chatElement.createCustomTipElm(t);return this.cursorToLastRecord(),e}closeTipTag(){this.chatElement.tipElm&&this.chatElement.removeTipElm()}addEventListener(t,e){this.chatEvent.chatEventModule[t].push(e)}removeEventListener(t,e){const i=this.chatEvent.chatEventModule[t],n=i.indexOf(e);-1!==n&&i.splice(n,1)}revisePCPointDialogLabel(t){this.options.needDialog&&(this.options.dialogLabels.pcPointDialog=Object.assign({},DEFAULT_PC_POINT_DIALOG,t||{}),this.chatElement.pcElms.pointDialogElm.querySelector(".call-user-dialog-header-title").textContent=this.options.dialogLabels.pcPointDialog.title,this.chatElement.pcElms.pointDialogCheckElm.textContent=this.options.dialogLabels.pcPointDialog.checkLabel,this.chatElement.pcElms.pointDialogEmptyElm&&(this.chatElement.pcElms.pointDialogEmptyElm.children[1].textContent=this.options.dialogLabels.pcPointDialog.emptyLabel),this.options.asyncMatch||this.updateUserList())}revisePCCheckDialogLabel(t){this.options.needDialog&&!this.options.asyncMatch&&(this.options.dialogLabels.pcPCheckDialog=Object.assign({},DEFAULT_PC_CHECK_DIALOG,t||{}),this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-container-header").children[0].textContent=this.options.dialogLabels.pcPCheckDialog.title,this.chatElement.pcElms.checkDialogSearchInputElm.setAttribute("placeholder",this.options.dialogLabels.pcPCheckDialog.searchPlaceholder),this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-search-empty").textContent=this.options.dialogLabels.pcPCheckDialog.searchEmptyLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".checkbox-dialog-right-box-title").textContent=this.options.dialogLabels.pcPCheckDialog.userTagTitle,this.chatElement.pcElms.checkDialogUsersElm.children[0].children[2].textContent=this.options.dialogLabels.pcPCheckDialog.checkAllLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".btn-submit").textContent=this.options.dialogLabels.pcPCheckDialog.confirmLabel,this.chatElement.pcElms.checkDialogElm.querySelector(".btn-close").textContent=this.options.dialogLabels.pcPCheckDialog.cancelLabel)}reviseH5DialogLabel(t){this.options.needDialog&&(this.options.dialogLabels.h5Dialog=Object.assign({},DEFAULT_H5_DIALOG,t||{}),this.chatElement.h5Elms.dialogElm.querySelector(".popup-title").textContent=this.options.dialogLabels.h5Dialog.title,this.chatElement.h5Elms.dialogSearchElm.setAttribute("placeholder",this.options.dialogLabels.h5Dialog.searchPlaceholder),this.chatElement.h5Elms.dialogEmptyElm.children[1].textContent=this.options.dialogLabels.h5Dialog.searchEmptyLabel,this.chatElement.h5Elms.dialogCheckElm.textContent=this.options.dialogLabels.h5Dialog.confirmLabel,this.chatElement.h5Elms.dialogShowElm.textContent=this.options.dialogLabels.h5Dialog.cancelLabel,this.options.asyncMatch||this.updateUserList())}async nextTick(t){return new Promise(e=>{requestAnimationFrame(()=>{const i=t();i instanceof Promise?i.then(()=>{e()}):e()})})}createOperateNode(){return new ChatOperateNode(this)}createChatComponent(){return new ChatComponent(this)}}__publicField(ChatArea,"version","6.0.3");
5998
+ // EXTERNAL MODULE: ./node_modules/chatarea/lib/ChatArea.css
5999
+ var lib_ChatArea = __webpack_require__(2736);
6000
+ ;// ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=script&lang=js
6001
+
6002
+
6003
+
6004
+
6005
+
6006
+ /* harmony default export */ const mainvue_type_script_lang_js = ({
6007
+ name: 'ElXEditorSender',
6008
+ components: {
6009
+ ClearButton: ClearButton,
6010
+ LoadingButton: LoadingButton,
6011
+ SendButton: SendButton
6012
+ },
6013
+ props: {
6014
+ // 输入框提示占位语
6015
+ placeholder: {
6016
+ type: String,
6017
+ default: '请输入内容'
6018
+ },
6019
+ // 使用编辑器设备类型 pc内置了很多丰富的弹出选择功能,如果用户传入了h5,弹出交互需要参考自定义弹出去支持
6020
+ device: {
6021
+ type: String,
6022
+ default: 'pc' // pc|h5
6023
+ },
6024
+ // 是否在聊天框生成后自动聚焦
6025
+ autoFocus: {
6026
+ type: Boolean,
6027
+ default: false
6028
+ },
6029
+ // 输入框的变体类型
6030
+ variant: {
6031
+ type: String,
6032
+ default: 'default' // default|updown
6033
+ },
6034
+ // 配置标签下拉选择的选项
6035
+ selectList: {
6036
+ type: Array,
6037
+ default: () => []
6038
+ },
6039
+ // @研讨群成员列表
6040
+ userList: {
6041
+ type: Array,
6042
+ default: () => []
6043
+ },
6044
+ // 扩展自定义弹窗列表
6045
+ customTrigger: {
6046
+ type: Array,
6047
+ default: () => []
6048
+ },
6049
+ // 限制输入框最大字数 *注 该配置项性能开销较大 非必要情况请别设置(像豆包和文心一言都不对这块做限制,不应因小失大)
6050
+ maxLength: {
6051
+ type: Number,
6052
+ default: undefined
6053
+ },
6054
+ // 控制换行与提交模式
6055
+ submitType: {
6056
+ type: String,
6057
+ default: 'enter' // enter|shiftEnter
6058
+ },
6059
+ // 修改输入样式
6060
+ customStyle: {
6061
+ type: Object,
6062
+ default: () => ({})
6063
+ },
6064
+ // 发送按钮加载状态
6065
+ loading: {
6066
+ type: Boolean,
6067
+ default: false
6068
+ },
6069
+ // 是否禁用输入框
6070
+ disabled: {
6071
+ type: Boolean,
6072
+ default: false
6073
+ },
6074
+ // 是否显示清空按钮
6075
+ clearable: {
6076
+ type: Boolean,
6077
+ default: false
6078
+ },
6079
+ // 展开动画事件/ms
6080
+ headerAnimationTimer: {
6081
+ type: Number,
6082
+ default: 300
6083
+ },
6084
+ // 异步加载群成员方法
6085
+ asyncMatchFun: {
6086
+ type: Function,
6087
+ default: undefined
6088
+ },
6089
+ // 是否需要自定义弹窗 开启后内部弹窗将不会再创建了
6090
+ customDialog: {
6091
+ type: Boolean,
6092
+ default: false
6093
+ }
6094
+ },
6095
+ emits: ['submit', 'change', 'cancel', 'show-at-dialog', 'show-select-dialog', 'show-tag-dialog'],
6096
+ data() {
6097
+ return {
6098
+ chat: null,
6099
+ opNode: null,
6100
+ chatState: {
6101
+ isEmpty: true,
6102
+ textLength: 0,
6103
+ // 该属性值只会在配置了maxLength情况下才拥有赋值
6104
+ lastFocusNode: null,
6105
+ lastOffset: 0,
6106
+ wrapCallSelectDialog: false,
6107
+ // 记录是否是外部调用了选择弹窗进行插值行为操作
6108
+ beforeText: '',
6109
+ afterText: ''
6110
+ }
6111
+ };
6112
+ },
6113
+ watch: {
6114
+ disabled(val) {
6115
+ val ? this.chat?.disabled() : this.chat?.enable();
6116
+ },
6117
+ placeholder(val) {
6118
+ this.chat?.updateConfig({
6119
+ placeholder: val
6120
+ });
6121
+ },
6122
+ maxLength(val) {
6123
+ this.chat?.updateConfig({
6124
+ maxLength: val
6125
+ });
6126
+ },
6127
+ submitType(val) {
6128
+ this.chat?.updateConfig({
6129
+ sendKeyFun: val === 'enter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter',
6130
+ wrapKeyFun: val === 'shiftEnter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter'
6131
+ });
6132
+ },
6133
+ userList: {
6134
+ handler(val) {
6135
+ this.chat?.updateConfig({
6136
+ userList: JSON.parse(JSON.stringify(val))
6137
+ });
6138
+ },
6139
+ deep: true
6140
+ },
6141
+ selectList: {
6142
+ handler(val) {
6143
+ this.chat?.updateConfig({
6144
+ selectList: val
6145
+ });
6146
+ },
6147
+ deep: true
6148
+ },
6149
+ customTrigger: {
6150
+ handler(val) {
6151
+ this.chat?.updateConfig({
6152
+ customTrigger: val
6153
+ });
6154
+ },
6155
+ deep: true
6156
+ }
6157
+ },
6158
+ mounted() {
6159
+ this.createChat();
6160
+ },
6161
+ beforeDestroy() {
6162
+ if (this.chat) {
6163
+ this.chat.dispose();
6164
+ this.chat = null;
6165
+ this.opNode = null;
6166
+ window.removeEventListener('keydown', this.keydownESC);
6167
+ }
6168
+ },
6169
+ methods: {
6170
+ // 创建输入框
6171
+ createChat() {
6172
+ this.chat = new ChatArea({
6173
+ elm: this.$refs.container,
6174
+ ...this.$props,
6175
+ userList: JSON.parse(JSON.stringify(this.userList)),
6176
+ needDialog: !this.customDialog && this.device === 'pc',
6177
+ copyType: ['text'],
6178
+ asyncMatch: Boolean(this.asyncMatchFun),
6179
+ needDebounce: true,
6180
+ needCallSpace: false,
6181
+ sendKeyFun: this.submitType === 'enter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter',
6182
+ wrapKeyFun: this.submitType === 'shiftEnter' ? event => !event.shiftKey && event.key === 'Enter' : event => event.shiftKey && event.key === 'Enter'
6183
+ });
6184
+ this.opNode = this.chat.createOperateNode();
6185
+ // 订阅发送事件
6186
+ this.chat.addEventListener('enterSend', this.onSubmit);
6187
+ // 对输入框进行操作事件
6188
+ this.chat.addEventListener('operate', () => {
6189
+ this.chatState.isEmpty = this.chat.isEmpty(true);
6190
+ this.chatState.textLength = this.chat.textLength;
6191
+ this.$emit('change');
6192
+ });
6193
+ // 失去焦点记录最后一次光标Node节点
6194
+ this.chat.richText.addEventListener('blur', () => {
6195
+ const sel = getSelection();
6196
+ this.chatState.lastFocusNode = sel.focusNode;
6197
+ this.chatState.lastOffset = sel.focusOffset;
6198
+ }, true);
6199
+ // 订阅标签选择事件
6200
+ this.chat.addEventListener('selectCheck', () => {
6201
+ if (this.chatState.wrapCallSelectDialog && this.chatState.beforeText) {
6202
+ this.chat.insertText(this.chatState.beforeText);
6203
+ this.chatState.beforeText = '';
6204
+ }
6205
+ });
6206
+ this.chat.addEventListener('afterSelectCheck', () => {
6207
+ if (this.chatState.wrapCallSelectDialog && this.chatState.afterText) {
6208
+ this.chat.insertText(this.chatState.afterText);
6209
+ this.chatState.afterText = '';
6210
+ this.chatState.wrapCallSelectDialog = false;
6211
+ }
6212
+ });
6213
+ // 接管异步匹配
6214
+ if (this.asyncMatchFun) {
6215
+ this.chat.addEventListener('atMatch', this.asyncMatchFun);
6216
+ }
6217
+ // 检测多种弹窗唤起事件
6218
+ this.chat.addEventListener('showAtDialog', () => {
6219
+ this.$emit('show-at-dialog');
6220
+ });
6221
+ this.chat.addEventListener('showSelectDialog', (key, elm) => {
6222
+ this.$emit('show-select-dialog', key, elm);
6223
+ });
6224
+ this.chat.addEventListener('showTagDialog', prefix => {
6225
+ this.$emit('show-tag-dialog', prefix);
6226
+ });
6227
+ // 禁用编辑器
6228
+ if (this.disabled) {
6229
+ this.chat.disabled();
6230
+ }
6231
+ // 绑定ESC按键关闭提示标签
6232
+ window.addEventListener('keydown', this.keydownESC);
6233
+ },
6234
+ // 获取输入框当前内容
6235
+ getCurrentValue() {
6236
+ const text = this.chat.getText();
6237
+ const html = this.chat.getHtml();
6238
+ const inputTags = this.chat.getInputTagList();
6239
+ const userTags = this.userList.length > 0 ? this.chat.getCallUserTagList() : undefined;
6240
+ const selectTags = this.selectList.length > 0 ? this.chat.getSelectTagList() : undefined;
6241
+ const customTags = this.customTrigger.length > 0 ? this.chat.getCustomTagList() : undefined;
6242
+ return {
6243
+ text,
6244
+ html,
6245
+ inputTags,
6246
+ userTags,
6247
+ selectTags,
6248
+ customTags
6249
+ };
6250
+ },
6251
+ // 提交发送方法
6252
+ onSubmit() {
6253
+ // 内容纯空 拦截发送
6254
+ if (this.chatState.isEmpty) {
6255
+ return;
6256
+ }
6257
+ this.$emit('submit', this.getCurrentValue());
6258
+ },
6259
+ // 取消发送方法
6260
+ onCancel() {
6261
+ this.$emit('cancel');
6262
+ },
6263
+ // 清空输入框方法
6264
+ onClear(txt) {
6265
+ this.chat.clear(txt);
6266
+ // 将光标移动到末尾
6267
+ this.focusToEnd();
6268
+ },
6269
+ // 点击内容区域聚焦输入框
6270
+ onContentMouseDown() {
6271
+ requestAnimationFrame(() => {
6272
+ const focusElm = this.chatState.lastFocusNode?.parentElement;
6273
+ const chatInput = this.chat.chatInput;
6274
+ if (focusElm && focusElm.classList.contains('input-write')) {
6275
+ chatInput.setInputTagRange(this.chatState.lastFocusNode, this.chatState.lastOffset);
6276
+ } else {
6277
+ chatInput.restCursorPos(chatInput.vnode, chatInput.cursorIndex);
6278
+ }
6279
+ });
6280
+ },
6281
+ // 聚焦到文本最前方
6282
+ focusToStart() {
6283
+ if (this.chat && this.opNode) {
6284
+ this.opNode.setCursorNode(this.opNode.getNodeByRank(this.opNode.getRank(0) + this.opNode.getRank(0)), 0);
6285
+ }
6286
+ },
6287
+ // 聚焦到文本最后方
6288
+ focusToEnd() {
6289
+ if (this.chat && this.opNode) {
6290
+ this.opNode.setCursorNode(this.opNode.getNodeByRank(this.opNode.getRank(-1) + this.opNode.getRank(-1)));
6291
+ }
6292
+ },
6293
+ // 失去焦点
6294
+ onBlur() {
6295
+ if (this.chat) {
6296
+ const selection = getSelection();
6297
+ selection.removeAllRanges();
6298
+ this.chat.richText.blur();
6299
+ }
6300
+ },
6301
+ // 内容全选
6302
+ selectAll() {
6303
+ if (this.chat && this.opNode) {
6304
+ const firstNode = this.opNode.getNodeByRank(this.opNode.getRank(0) + this.opNode.getRank(0));
6305
+ const lastNode = this.opNode.getNodeByRank(this.opNode.getRank(-1) + this.opNode.getRank(-1));
6306
+ this.opNode.setSelectNodes(firstNode, lastNode);
6307
+ }
6308
+ },
6309
+ // 插入一个选择标签
6310
+ setSelectTag(key, tagId) {
6311
+ this.chatState.wrapCallSelectDialog = false;
6312
+ const tag = this.selectList?.find(option => option.key === key)?.options.find(tag => tag.id === tagId);
6313
+ if (tag) {
6314
+ this.chat.setSelectTag(tag, key);
6315
+ }
6316
+ },
6317
+ // 插入一个输入标签
6318
+ setInputTag(key, placeholder, defaultValue) {
6319
+ this.chat.setInputTag(key, placeholder, defaultValue);
6320
+ },
6321
+ // 插入一个@提及标签
6322
+ setUserTag(userId) {
6323
+ const user = this.userList?.find(user => user.id === userId);
6324
+ if (user) {
6325
+ this.chat.setUserTag(user);
6326
+ }
6327
+ },
6328
+ // 插入一个自定义触发符标签
6329
+ setCustomTag(prefix, id) {
6330
+ const custom = this.customTrigger?.find(option => option.prefix === prefix)?.tagList.find(tag => tag.id === id);
6331
+ if (custom) {
6332
+ this.chat.setCustomTag(custom, prefix);
6333
+ }
6334
+ },
6335
+ // 混合式插入
6336
+ setMixTags(tags) {
6337
+ // 整合ChatNode
6338
+ const chatNodes = tags.map((row, index) => {
6339
+ return {
6340
+ type: 'gridBox',
6341
+ rank: this.opNode.getRank(index),
6342
+ children: row.map(cRow => {
6343
+ return {
6344
+ type: cRow.type,
6345
+ text: cRow.value,
6346
+ html: cRow.value,
6347
+ dataset: {
6348
+ id: cRow.value,
6349
+ name: this.getNameByTypeId(cRow),
6350
+ prefix: cRow.key,
6351
+ key: cRow.key,
6352
+ placeholder: cRow.placeholder,
6353
+ value: cRow.value
6354
+ }
6355
+ };
6356
+ })
6357
+ };
6358
+ });
6359
+ this.opNode.coverNodes(chatNodes);
6360
+ },
6361
+ // 根据id和类型捕获目标name
6362
+ getNameByTypeId(mixTag) {
6363
+ const {
6364
+ type,
6365
+ value,
6366
+ key
6367
+ } = mixTag;
6368
+ switch (type) {
6369
+ case 'userTag':
6370
+ return this.userList?.find(user => user.id === value)?.name || '';
6371
+ case 'selectTag':
6372
+ return this.selectList?.find(row => row.key === key)?.options.find(select => select.id === value)?.name || '';
6373
+ case 'customTag':
6374
+ return this.customTrigger?.find(row => row.prefix === key)?.tagList.find(custom => custom.id === value)?.name || '';
6375
+ default:
6376
+ return '';
6377
+ }
6378
+ },
6379
+ // 在当前光标处插入html片段
6380
+ setHtml(html) {
6381
+ // 注* 插入的html标签必须是 行内 或 行内块元素,如果需要块级元素标签 请自行插入行内元素然后修改其css属性为块级元素
6382
+ this.chat.insertHtml(html);
6383
+ },
6384
+ // 在当前光标处插入text内容
6385
+ setText(txt) {
6386
+ this.chat.insertText(txt);
6387
+ },
6388
+ // 外部调用唤起标签选择弹窗
6389
+ openSelectDialog(option) {
6390
+ this.chatState.beforeText = option.beforeText || '';
6391
+ this.chatState.afterText = option.afterText || '';
6392
+ this.chatState.wrapCallSelectDialog = true;
6393
+ this.chat.showPCSelectDialog(option.key, option.elm);
6394
+ },
6395
+ // 打开前置提示标签
6396
+ openTipTag(options) {
6397
+ this.chat.openTipTag({
6398
+ ...options,
6399
+ codeLabel: 'ESC'
6400
+ });
6401
+ },
6402
+ // 关闭前置提示标签
6403
+ closeTipTag() {
6404
+ this.chat.closeTipTag();
6405
+ },
6406
+ // 绑定ESC按键关闭提示标签
6407
+ keydownESC(event) {
6408
+ if (event.key === 'Escape') {
6409
+ this.closeTipTag();
6410
+ }
6411
+ },
6412
+ // 用户自定义弹窗写入@提及标签
6413
+ customSetUser(user) {
6414
+ // 该方法并未写入ts 因为是一个私有api没暴露给用户 其区别 setUserTag 相比会去向前截取掉触发符
6415
+ this.chat.onceSetTag(user);
6416
+ },
6417
+ // 用户自定义弹窗写入自定义触发符号标签
6418
+ customSetTag(prefix, tag) {
6419
+ this.chat.onceSetCustomTag(tag, prefix);
6420
+ },
6421
+ // 用户自定义弹窗更新选择标签
6422
+ updateSelectTag(elm, tag) {
6423
+ const rank = this.opNode.getRankByElm(elm.parentElement);
6424
+ if (!rank) {
6425
+ return;
6426
+ }
6427
+ const chatNode = this.opNode.getNodeByRank(rank);
6428
+ if (!chatNode) {
6429
+ return;
6430
+ }
6431
+ const dataset = chatNode.dataset;
6432
+ dataset.id = tag.id;
6433
+ dataset.name = tag.name;
6434
+ this.opNode.updateNode(chatNode);
6435
+ }
6436
+ }
6437
+ });
6438
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=script&lang=js
6439
+ /* harmony default export */ const src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
6440
+ // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
6441
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true = __webpack_require__(9125);
6442
+ ;// ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
6443
+
6444
+
6445
+
6446
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options = {};
6447
+
6448
+ mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options.insert = "head";
6449
+ mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options.singleton = false;
6450
+
6451
+ var mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_update = injectStylesIntoStyleTag_default()(mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true/* default */.A, mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true_options);
6452
+
6453
+
6454
+
6455
+ /* harmony default export */ const src_mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true = (mainvue_type_style_index_0_id_8ce301dc_prod_lang_scss_scoped_true/* default */.A.locals || {});
6456
+ ;// ./src/components/EditorSender/src/main.vue?vue&type=style&index=0&id=8ce301dc&prod&lang=scss&scoped=true
6457
+
6458
+ ;// ./src/components/EditorSender/src/main.vue
6459
+
6460
+
6461
+
6462
+ ;
6463
+
6464
+
6465
+ /* normalize component */
6466
+
6467
+ var main_component = (0,componentNormalizer/* default */.A)(
6468
+ src_mainvue_type_script_lang_js,
6469
+ render,
6470
+ staticRenderFns,
6471
+ false,
6472
+ null,
6473
+ "8ce301dc",
6474
+ null
6475
+
6476
+ )
6477
+
6478
+ /* harmony default export */ const main = (main_component.exports);
6479
+ ;// ./src/components/EditorSender/index.js
6480
+
6481
+
6482
+ /* istanbul ignore next */
6483
+ main.install = function (Vue) {
6484
+ Vue.component(main.name, main);
6485
+ };
6486
+ /* harmony default export */ const EditorSender = (main);
6487
+
5582
6488
  /***/ }),
5583
6489
 
5584
6490
  /***/ 1519:
@@ -5992,6 +6898,26 @@ module.exports = function text(state, silent) {
5992
6898
  };*/
5993
6899
 
5994
6900
 
6901
+ /***/ }),
6902
+
6903
+ /***/ 2351:
6904
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
6905
+
6906
+ "use strict";
6907
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6908
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
6909
+ /* harmony export */ });
6910
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
6911
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
6912
+ // Imports
6913
+
6914
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
6915
+ // Module
6916
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-353808b6]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-x-send-button[data-v-353808b6]{height:32px}.el-x-send-button .el-button[data-v-353808b6]{padding:0;width:32px;height:32px}.el-x-send-button .loading-svg[data-v-353808b6]{color:#409eff;width:100%}", ""]);
6917
+ // Exports
6918
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
6919
+
6920
+
5995
6921
  /***/ }),
5996
6922
 
5997
6923
  /***/ 2373:
@@ -23729,6 +24655,23 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/**
23729
24655
 
23730
24656
  module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/
23731
24657
 
24658
+ /***/ }),
24659
+
24660
+ /***/ 2736:
24661
+ /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
24662
+
24663
+ "use strict";
24664
+ /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
24665
+ /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
24666
+ // Imports
24667
+
24668
+ var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
24669
+ // Module
24670
+ ___CSS_LOADER_EXPORT___.push([module.id, ":root{--chat-primary: #1890ff;--chat-disabled: #e8e8e8;--chat-highlight: #40A9FF;--chat-text: #333;--chat-text-assistant: #666;--chat-text-secondary: #ccc;--chat-text-placeholder: #bfbfbf;--chat-box: #fff;--chat-box-shadow: 1px 3px 10px 2px rgba(6, 21, 50, .2);--chat-box-mark: rgba(0, 0, 0, .5);--chat-input: #F9F9F9;--chat-card: #F2F6FC;--chat-highlight-card: #E6F7FF;--chat-border: #f1f1f2;--chat-popover: #000;--chat-popover-text: #fff}@-webkit-keyframes antSpinMove{to{opacity:1}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antRotate{to{transform:rotate(405deg)}}@keyframes antRotate{to{transform:rotate(405deg)}}.ant-spin{font-size:14px;line-height:1.5;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol,\"Noto Color Emoji\";position:absolute;display:none;text-align:center;vertical-align:middle;opacity:0;transition:transform .3s cubic-bezier(.78,.14,.15,.86)}.ant-spin .ant-spin-dot{position:relative;display:inline-block;font-size:20px;width:1em;height:1em}.ant-spin .ant-spin-dot-spin{transform:rotate(45deg);animation-name:antRotate;animation-duration:1.2s;animation-iteration-count:infinite;animation-timing-function:linear}.ant-spin .ant-spin-dot-item{position:absolute;display:block;width:9px;height:9px;background-color:var(--chat-primary);border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation-name:antSpinMove;animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear;animation-direction:alternate}.ant-spin .ant-spin-dot-item:nth-child(1){top:0;inset-inline-start:0}.ant-spin .ant-spin-dot-item:nth-child(2){top:0;inset-inline-end:0;animation-delay:.4s}.ant-spin .ant-spin-dot-item:nth-child(3){inset-inline-end:0;bottom:0;animation-delay:.8s}.ant-spin .ant-spin-dot-item:nth-child(4){bottom:0;inset-inline-start:0;animation-delay:1.2s}.ant-spin-spinning{position:static;display:inline-block;opacity:1}.chat-area-pc{position:relative;z-index:10}.chat-area-pc *{margin:0;padding:0;box-sizing:border-box;outline:none;text-indent:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:16px}@keyframes a-chat-dialog{0%{transform:scale(.6);opacity:.4}to{opacity:1;transform:scale(1)}}@keyframes a-chat-check-pc{0%{transform:scale(.4) translate(-50%,-50%);opacity:.4}to{opacity:1;transform:scale(1) translate(-50%,-50%)}}.chat-area-h5{position:relative;z-index:10}.chat-area-h5 *{margin:0;padding:0;box-sizing:border-box;outline:none;text-indent:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:16px}@keyframes a-popup-mark{0%{background:#0000}to{background:var(--chat-box-mark)}}@keyframes a-popup-mark-leave{0%{background:var(--chat-box-mark)}to{background:#0000}}@keyframes a-popup-main{0%{bottom:-100%}to{bottom:0}}@keyframes a-popup-main-leave{0%{bottom:0}to{bottom:-100%}}.chat-rich-text{width:100%;padding:10px;margin:0;background:transparent;border-radius:4px;outline:none;box-sizing:border-box;overflow-y:auto;font-size:16px;color:var(--chat-text);vertical-align:text-bottom;transition:all .4s ease;word-break:break-all}.chat-rich-text-disabled{cursor:not-allowed}.chat-dialog{position:relative;z-index:20;width:100%;height:0}.chat-tip-dialog{position:relative;z-index:21;width:100%;height:0}.call-user-dialog{position:absolute;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:180px;overflow:hidden;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.call-user-dialog *{margin:0;padding:0;box-sizing:border-box}.call-user-dialog.chat-view-show{animation:a-chat-dialog .2s ease}.call-user-dialog .call-user-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px 4px}.call-user-dialog .call-user-dialog-header .call-user-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.call-user-dialog .call-user-dialog-header .call-user-dialog-header-check{color:var(--chat-primary);font-size:12px;cursor:pointer}.call-user-dialog .call-user-dialog-main{max-height:240px;overflow-y:auto}.call-user-dialog .call-user-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:4px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:4px}.call-user-dialog .call-user-dialog-item .call-user-dialog-item-name{transition:all .3s ease;color:var(--chat-text-secondary)}.call-user-dialog .call-user-dialog-item:hover{background:var(--chat-card);opacity:.7}.call-user-dialog .call-user-dialog-item:hover .call-user-dialog-item-name{color:var(--chat-primary)}.call-user-dialog .call-user-dialog-item.call-user-dialog-item-active{background:var(--chat-card);opacity:1}.call-user-dialog .call-user-dialog-item.call-user-dialog-item-active .call-user-dialog-item-name{color:var(--chat-primary)}.call-user-dialog .call-user-dialog-item.user-no-match{display:none}.call-user-dialog .call-user-dialog-loading{display:flex;align-items:center;justify-content:center;height:36px}.call-user-dialog .call-user-dialog-empty{display:flex;align-items:center;flex-direction:column;justify-content:center;padding:10px 0}.call-user-dialog .call-user-dialog-empty .match-empty-svg{width:auto;height:40px;margin-bottom:2px}.call-user-dialog .call-user-dialog-empty .empty-label{font-size:12px;color:var(--chat-text-secondary)}.call-user-popup{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;background:var(--chat-box-mark)}.call-user-popup div,.call-user-popup p,.call-user-popup span,.call-user-popup label,.call-user-popup a,.call-user-popup ul,.call-user-popup li{margin:0;padding:0;box-sizing:border-box}.call-user-popup .call-user-popup-main{position:absolute;left:0;bottom:0;width:100%;height:86%;display:flex;flex-direction:column;background:var(--chat-box);border-radius:16px 16px 0 0;overflow:hidden;padding:14px}.call-user-popup .call-user-popup-header{display:flex;align-items:center}.call-user-popup .call-user-popup-header .popup-show{font-size:16px;color:var(--chat-text-assistant)}.call-user-popup .call-user-popup-header .popup-check{font-size:18px;color:var(--chat-primary);transition:color .3s ease}.call-user-popup .call-user-popup-header .popup-check.disabled{color:var(--chat-disabled)}.call-user-popup .call-user-popup-header .popup-title{flex:1;font-weight:700;font-size:21px;text-align:center;color:var(--chat-text)}.call-user-popup .call-user-popup-search{display:flex;align-items:center;margin-top:20px;background:var(--chat-input);height:44px;border-radius:4px;padding:0 15px}.call-user-popup .call-user-popup-search .call-user-popup-search-input{width:100%;height:100%;background:transparent;padding-left:8px;outline:none;border:none;font-size:16px;color:var(--chat-text)}.call-user-popup .call-user-popup-search .call-user-popup-search-input::-moz-placeholder{color:var(--chat-text-placeholder);opacity:1}.call-user-popup .call-user-popup-search .call-user-popup-search-input:-ms-input-placeholder{color:var(--chat-text-placeholder)}.call-user-popup .call-user-popup-search .call-user-popup-search-input::-webkit-input-placeholder{color:var(--chat-text-placeholder)}.call-user-popup .call-user-popup-search .call-user-popup-search-input:placeholder-shown{text-overflow:ellipsis}.call-user-popup .call-user-popup-search .icon-search{width:auto;height:30px}.call-user-popup .call-user-popup-body{flex:1;padding-top:25px;overflow-y:auto}.call-user-popup .call-user-popup-body .call-user-popup-item{position:relative;padding:15px 10px;display:flex;align-items:center;border-bottom:1px solid var(--chat-border)}.call-user-popup .call-user-popup-body .call-user-popup-item input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;opacity:0;box-sizing:border-box}.call-user-popup .call-user-popup-body .call-user-popup-item .user-popup-check-item-inner{position:relative;top:0;left:0;display:block;width:25px;height:25px;border-radius:50%;background-color:var(--chat-box);border:1px solid var(--chat-border);border-collapse:separate;transition:all .3s;box-sizing:border-box}.call-user-popup .call-user-popup-body .call-user-popup-item .user-popup-check-item-inner:after{position:absolute;top:50%;left:30%;display:table;width:5px;height:9px;border:3px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-60%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:\" \"}.call-user-popup .call-user-popup-body .call-user-popup-item.user-popup-check-item-check .user-popup-check-item-inner{background-color:var(--chat-primary);border-color:var(--chat-primary)}.call-user-popup .call-user-popup-body .call-user-popup-item.user-popup-check-item-check .user-popup-check-item-inner:after{position:absolute;display:table;border:3px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-60%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:\" \"}.call-user-popup .call-user-popup-body .call-user-dialog-item-sculpture{width:35px;height:35px;border-radius:4px}.call-user-popup .call-user-popup-body .call-user-dialog-item-sculpture span{font-size:16px}.call-user-popup .call-user-popup-body .call-user-dialog-item-name{padding-left:8px;font-size:16px;line-height:35px;color:var(--chat-text)}.call-user-popup .call-user-popup-empty{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center}.call-user-popup .call-user-popup-empty .empty-svg{width:auto;height:60px}.call-user-popup .call-user-popup-empty .empty-label{margin-top:10px;font-size:12px;color:var(--chat-text-secondary)}.call-user-popup .call-user-popup-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;height:36px}.call-user-popup .call-user-popup-loading .ant-spin{transform:scale(1.5)}.call-user-popup.chat-view-show{animation:a-popup-mark .3s ease}.call-user-popup.chat-view-show .call-user-popup-main{animation:a-popup-main .3s ease}.call-user-popup.chat-view-hidden{animation:a-popup-mark-leave .3s ease-in}.call-user-popup.chat-view-hidden .call-user-popup-main{animation:a-popup-main-leave .3s ease-in}.checkbox-dialog{position:fixed;top:0;left:0;margin:0;padding:0;width:100vw;height:100vh;box-sizing:border-box;background:var(--chat-box-mark);z-index:10000}.checkbox-dialog.chat-view-show .checkbox-dialog-container{transform-origin:0 0 0;animation:a-chat-check-pc .3s ease}.checkbox-dialog *{margin:0;padding:0;box-sizing:border-box}.checkbox-dialog .checkbox-dialog-container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:684px;height:540px;padding:14px 14px 0;border-radius:4px;background:var(--chat-box);box-shadow:var(--chat-box-shadow);overflow:hidden}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header{display:flex;align-items:center;justify-content:space-between;height:22px;color:var(--chat-text-secondary);font-size:16px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header .checkbox-dialog-container-header-close{cursor:pointer;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-header .checkbox-dialog-container-header-close:hover{color:var(--chat-text-assistant)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body{display:flex;flex-direction:row;width:100%;height:calc(100% - 22px);padding-top:16px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box{position:relative;width:50%;height:100%;padding-top:20px;padding-bottom:20px;padding-left:20px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search{position:relative;padding-right:20px;margin-bottom:20px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input{position:relative;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:\"tnum\";display:inline-block;width:100%;height:32px;padding:4px 11px;color:var(--chat-text);font-size:14px;line-height:1.5;background-color:var(--chat-box);background-image:none;border:1px solid var(--chat-border);border-radius:4px;transition:all .3s}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input::-moz-placeholder{color:var(--chat-text-placeholder);opacity:1}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:-ms-input-placeholder{color:var(--chat-text-placeholder)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input::-webkit-input-placeholder{color:var(--chat-text-placeholder)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:placeholder-shown{text-overflow:ellipsis}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:focus,.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:hover{border-color:var(--chat-primary);border-right-width:1px!important}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search .checkbox-dialog-search-input:focus{outline:0}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags{width:100%;height:calc(100% - 98px);overflow-y:auto;overflow-x:hidden}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags:after{display:block;content:\"\";clear:both}@keyframes tag-scale{0%{transform:scale(0)}to{transform:scale(1)}}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item{float:left;display:flex;align-items:center;justify-content:center;margin-right:8px;margin-bottom:6px;background:var(--chat-card);border-radius:4px;font-size:12px;color:var(--chat-text-assistant);padding:4px 8px;cursor:default;animation:tag-scale .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item .checkbox-dialog-tag-item-close{cursor:pointer;margin-left:6px;color:var(--chat-text-secondary);transform:scale(.7);transition:color .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .checkbox-dialog-tag-item .checkbox-dialog-tag-item-close:hover{color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty{height:40%;display:flex;flex-direction:column;align-items:center;justify-content:center}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty .check-empty-svg{width:auto;height:60px}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-tags .check-empty .check-empty-label{margin-top:10px;font-size:12px;color:var(--chat-text-secondary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option{position:absolute;left:20px;bottom:20px;display:flex;align-items:center}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn{position:relative;width:76px;height:36px;text-align:center;color:var(--chat-text-assistant);border:1px solid var(--chat-border);background:transparent;cursor:pointer;outline:none;text-indent:8px;letter-spacing:8px;border-radius:4px;font-size:14px;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-submit{border:none;margin-right:16px;background:var(--chat-primary);color:var(--chat-box)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-submit.disabled{background:var(--chat-primary);opacity:.4;cursor:not-allowed}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-option .checkbox-dialog-option-btn.btn-close:hover{border-color:var(--chat-primary);color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search-group{color:var(--chat-text-assistant);line-height:1.5;list-style:none;font-feature-settings:\"tnum\";position:absolute;width:calc(100% - 20px);max-height:250px;top:calc(100% + 2px);left:0;z-index:1050;box-sizing:border-box;font-size:14px;font-variant:normal;background-color:var(--chat-box);border-radius:4px;outline:none;box-shadow:var(--chat-box-shadow);overflow-y:auto}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-left-box .checkbox-dialog-search-group .checkbox-dialog-search-empty{padding:34px 0;text-align:center;color:var(--chat-text-secondary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box{width:50%;height:100%;padding-top:20px;border-left:1px solid var(--chat-border)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box .checkbox-dialog-right-box-title{padding-left:20px;font-size:16px;height:22px;color:var(--chat-text-assistant);font-weight:700}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-right-box .checkbox-dialog-check-group{width:calc(100% + 14px);height:calc(100% - 22px);padding-top:8px;overflow-x:hidden;overflow-y:auto}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item{position:relative;display:flex;align-items:center;padding-left:20px;height:44px;font-size:14px;transition:all .3s ease}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item:hover{background:var(--chat-card);cursor:pointer}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item input{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;width:100%;height:100%;cursor:pointer;opacity:0;box-sizing:border-box;touch-action:manipulation}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-inner{position:relative;top:0;left:0;display:block;width:18px;height:18px;margin-right:12px;border-radius:50%;background-color:var(--chat-box);border:1px solid var(--chat-border);border-collapse:separate;transition:all .3s;box-sizing:border-box}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-inner:after{position:absolute;top:50%;left:22%;display:table;width:4px;height:8px;border:2px solid var(--chat-border);border-top:0;border-left:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;content:\" \"}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item.checkbox-dialog-check-item-check .checkbox-dialog-check-item-inner{background-color:var(--chat-primary);border-color:var(--chat-primary)}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item.checkbox-dialog-check-item-check .checkbox-dialog-check-item-inner:after{position:absolute;display:table;border:2px solid var(--chat-box);border-top:0;border-left:0;transform:rotate(45deg) scale(1) translate(-50%,-50%);opacity:1;transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s;content:\" \"}.checkbox-dialog .checkbox-dialog-container .checkbox-dialog-container-body .checkbox-dialog-check-item .checkbox-dialog-check-item-label{display:flex;align-items:center;font-size:14px}.call-tag-dialog{position:absolute;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:180px;overflow:hidden;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.call-tag-dialog.chat-view-show{animation:a-chat-dialog .2s ease}.call-tag-dialog .call-tag-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px 4px}.call-tag-dialog .call-tag-dialog-header .call-tag-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.call-tag-dialog .call-tag-dialog-main{max-height:240px;overflow-y:auto}.call-tag-dialog .call-tag-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:4px 8px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:4px}.call-tag-dialog .call-tag-dialog-item .call-tag-dialog-item-name{transition:all .3s ease;color:var(--chat-text-secondary)}.call-tag-dialog .call-tag-dialog-item:hover{background:var(--chat-card);opacity:.7}.call-tag-dialog .call-tag-dialog-item:hover .call-tag-dialog-item-name{color:var(--chat-primary)}.call-tag-dialog .call-tag-dialog-item.call-tag-dialog-item-active{background:var(--chat-card);opacity:1}.call-tag-dialog .call-tag-dialog-item.call-tag-dialog-item-active .call-tag-dialog-item-name{color:var(--chat-primary)}.call-tag-dialog .call-tag-dialog-item.tag-no-match{display:none}.chat-select-dialog{position:fixed;min-width:180px;z-index:2024;border-radius:4px;padding:4px;box-sizing:border-box;width:auto;background:var(--chat-box);box-shadow:var(--chat-box-shadow)}.chat-select-dialog .chat-select-dialog-header{display:flex;align-items:center;justify-content:space-between;background:var(--chat-box);padding:6px}.chat-select-dialog .chat-select-dialog-header .chat-select-dialog-header-title{color:var(--chat-text);font-weight:700;font-size:14px}.chat-select-dialog .chat-select-dialog-main{position:relative;z-index:3;max-height:280px;overflow-y:auto}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item{display:flex;align-items:center;color:var(--chat-text-secondary);background:transparent;cursor:pointer;padding:8px;transition:all .3s ease;font-weight:700;font-size:14px;border-radius:6px;min-height:42px}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-preview{width:42px;height:42px;border-radius:6px;flex-shrink:0;margin-right:12px}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-name{flex:1;transition:all .3s ease;color:var(--chat-text-secondary)}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item .chat-select-dialog-check{display:inline-block;margin-left:6px;font-size:12px;color:var(--chat-primary)}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item:hover{background:var(--chat-card);opacity:.8}.chat-select-dialog .chat-select-dialog-main .chat-select-dialog-item:hover .chat-select-dialog-name{color:var(--chat-primary)}.chat-select-dialog .chat-select-arrow{position:absolute;z-index:2;pointer-events:none;width:16px;height:16px;overflow:hidden}.chat-select-dialog .chat-select-arrow:before{box-sizing:border-box;background:var(--chat-box);position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;clip-path:path(\"M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z\");content:\"\"}.chat-select-dialog .chat-select-arrow:after{box-sizing:border-box;content:\"\";position:absolute;width:9px;height:9px;bottom:0;inset-inline:0;margin:auto;border-radius:0 0 2px;transform:translateY(50%) rotate(-135deg);box-shadow:var(--chat-box-shadow);z-index:0;background:transparent;opacity:.25}.call-user-dialog-item-sculpture{display:flex;align-items:center;justify-content:center;width:24px;height:24px;margin-right:8px;border-radius:4px;overflow:hidden;background:var(--chat-primary);color:var(--chat-box);white-space:nowrap;font-size:12px}.call-user-dialog-item-sculpture *{margin:0;padding:0;box-sizing:border-box}.call-user-dialog-item-sculpture.is-avatar{background:var(--chat-box)}.call-user-dialog-item-sculpture.is-avatar img{width:100%;height:100%}.call-user-dialog-item-sculpture span{font-size:12px;color:var(--chat-box)}.call-user-dialog-item-name{flex:1;white-space:nowrap;line-height:24px;overflow:hidden;text-overflow:ellipsis;padding-right:10px;color:var(--chat-text-assistant);font-size:14px}.chat-select-dialog-main::-webkit-scrollbar,.call-user-dialog-main::-webkit-scrollbar,.call-tag-dialog-main::-webkit-scrollbar,.checkbox-dialog-check-group::-webkit-scrollbar,.checkbox-dialog-tags::-webkit-scrollbar{width:6px;height:6px}.chat-select-dialog-main::-webkit-scrollbar-thumb,.call-user-dialog-main::-webkit-scrollbar-thumb,.call-tag-dialog-main::-webkit-scrollbar-thumb,.checkbox-dialog-check-group::-webkit-scrollbar-thumb,.checkbox-dialog-tags::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #61b8b31a;background-color:#0003}.chat-select-dialog-main::-webkit-scrollbar-track,.call-user-dialog-main::-webkit-scrollbar-track,.call-tag-dialog-main::-webkit-scrollbar-track,.checkbox-dialog-check-group::-webkit-scrollbar-track,.checkbox-dialog-tags::-webkit-scrollbar-track{box-shadow:inset 0 0 5px #57afbb1a;border-radius:10px;background:#ededed}.disable-scroll{overflow-y:hidden!important}.chat-placeholder-wrap{position:absolute;top:0;left:0;width:100%;margin:0;padding:10px;box-sizing:border-box;color:var(--chat-text-placeholder);pointer-events:none;font-style:oblique;word-break:break-all;z-index:11}.chat-tip-wrap{position:absolute;top:0;left:0;width:auto;height:100%;margin:0;padding:10px 6px 10px 10px;box-sizing:border-box;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:21}.chat-tip-wrap .chat-tip-tag{position:relative;padding:2px 6px;color:var(--chat-primary);border-radius:8px;pointer-events:visible;cursor:pointer;transition:background .3s ease}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-txt{font-size:18px;font-weight:600;font-family:宋体,serif}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-close{top:-4px;right:-4px;position:absolute;font-size:12px;opacity:0;transition:all .3s ease;color:var(--chat-text)}.chat-tip-wrap .chat-tip-tag .chat-tip-tag-close svg{font-size:inherit}.chat-tip-wrap .chat-tip-tag:hover{background:var(--chat-card)}.chat-tip-wrap .chat-tip-tag:hover .chat-tip-tag-close{opacity:1}.chat-tip-wrap .chat-custom-tip{pointer-events:visible}.chat-tip-popover{position:absolute}.chat-tip-popover .chat-tip-popover-main{display:flex;align-items:center;padding:8px 10px;background:var(--chat-popover);color:var(--chat-popover-text);font-size:13px;border-radius:8px}.chat-tip-popover .chat-tip-popover-main .chat-tip-popover-code{margin-left:4px;opacity:.7;font-size:12px}.chat-tip-popover .chat-tip-popover-main .chat-tip-popover-code.chat-view-show{display:none}.chat-tip-popover .chat-tip-popover-arrow{position:absolute;z-index:2;pointer-events:none;width:16px;height:16px;overflow:hidden;left:50%;transform:translate(-50%) rotate(-180deg)}.chat-tip-popover .chat-tip-popover-arrow:before{box-sizing:border-box;background:var(--chat-popover);position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;clip-path:path(\"M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z\");content:\"\"}.chat-img{min-width:20px;min-height:20px;max-width:100px;max-height:100px;vertical-align:bottom}.chat-tag{margin:0 1px}.chat-grid-input{word-break:break-all}.at-user,.at-tag{color:var(--chat-primary)}.at-select{display:inline-block;cursor:pointer;background:var(--chat-card);color:var(--chat-primary);padding:2px 6px;border-radius:10px;margin:2px;transition:all .3s ease}.at-select svg{margin-left:4px;font-size:12px;transition:all .3s ease}.at-select:hover{color:var(--chat-highlight);background:var(--chat-highlight-card)}.at-select.aim svg{transform:rotate(-180deg)}.at-input{padding:2px 6px;border-radius:10px;margin:0 2px;color:var(--chat-primary);cursor:text;background:var(--chat-card);line-height:1.8}.at-input .input-write{white-space:pre-wrap;word-break:break-all;word-wrap:break-word;padding-left:.1px}.at-input .input-tip{pointer-events:none;-webkit-user-select:none;user-select:none;opacity:.35;word-break:break-all}\n", ""]);
24671
+ // Exports
24672
+ /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ((/* unused pure expression or super */ null && (___CSS_LOADER_EXPORT___)));
24673
+
24674
+
23732
24675
  /***/ }),
23733
24676
 
23734
24677
  /***/ 2828:
@@ -26424,7 +27367,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-eaf958fa]:root{--color-primary
26424
27367
 
26425
27368
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
26426
27369
  // Module
26427
- ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-ee2290d4]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-x-prompts[data-v-ee2290d4]{max-width:100%}.el-x-prompts[data-v-ee2290d4],.el-x-prompts *[data-v-ee2290d4]{box-sizing:border-box}.el-x-prompts.el-x-prompts-rtl[data-v-ee2290d4]{direction:rtl}.el-x-prompts .el-x-prompts-title[data-v-ee2290d4]{font-weight:normal;font-size:16px;color:#909399;margin-top:0;margin-bottom:.5em}.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none;list-style:none;padding-left:0;margin:0;align-items:stretch}.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]::-webkit-scrollbar{display:none}.el-x-prompts .el-x-prompts-list-wrap[data-v-ee2290d4]{flex-wrap:wrap}.el-x-prompts .el-x-prompts-list-vertical[data-v-ee2290d4]{flex-direction:column;align-items:flex-start}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]{flex-wrap:wrap;gap:8px}.el-x-prompts .el-x-prompts-list-wrap[data-v-ee2290d4]{justify-content:space-between}}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{flex:none;display:flex;gap:4px;height:auto;padding:12px 18px;align-items:flex-start;justify-content:flex-start;background:#fff;border-radius:8px;transition:border all .3s cubic-bezier(0.645, 0.045, 0.355, 1),background all .3s cubic-bezier(0.645, 0.045, 0.355, 1);border:1px solid #ebeef5}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:calc(50% - 4px);min-width:150px;padding:8px 12px}.el-x-prompts-list-wrap .el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:calc(50% - 4px);margin-bottom:8px}.el-x-prompts-list-vertical .el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:100%}}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]:not(.el-x-prompts-item-has-nest):hover{cursor:pointer;background:#f5f7fa}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]:not(.el-x-prompts-item-has-nest):active{background:#ecf5ff}.el-x-prompts .el-x-prompts-item .el-x-prompts-content[data-v-ee2290d4]{flex:auto;min-width:0;display:flex;gap:4px;flex-direction:column;align-items:flex-start}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item .el-x-prompts-content[data-v-ee2290d4]{width:100%;gap:2px}}.el-x-prompts .el-x-prompts-item .el-x-prompts-icon[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-desc[data-v-ee2290d4]{margin:0;padding:0;font-size:14px;line-height:24px;text-align:start;white-space:normal}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item .el-x-prompts-icon[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-desc[data-v-ee2290d4]{font-size:14px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4]{color:#303133;font-weight:500}.el-x-prompts .el-x-prompts-item .el-x-prompts-label+.el-x-prompts-desc[data-v-ee2290d4]{color:#909399}.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled[data-v-ee2290d4]{pointer-events:none;background:#f5f7fa}.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled .el-x-prompts-desc[data-v-ee2290d4]{color:#909399}.el-x-prompts .el-x-prompts-item-has-nest>.el-x-prompts-content>.el-x-prompts-label[data-v-ee2290d4]{font-size:18px;line-height:24px}.el-x-prompts.el-x-prompts-nested[data-v-ee2290d4]{margin-top:5px;align-self:stretch}.el-x-prompts.el-x-prompts-nested .el-x-prompts-list[data-v-ee2290d4]{align-items:stretch}.el-x-prompts.el-x-prompts-nested .el-x-prompts-item[data-v-ee2290d4]{border:0;background:#f5f7fa}", ""]);
27370
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-ee2290d4]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-x-prompts[data-v-ee2290d4]{max-width:100%}.el-x-prompts[data-v-ee2290d4],.el-x-prompts *[data-v-ee2290d4]{box-sizing:border-box}.el-x-prompts.el-x-prompts-rtl[data-v-ee2290d4]{direction:rtl}.el-x-prompts .el-x-prompts-title[data-v-ee2290d4]{font-weight:normal;font-size:16px;color:#909399;margin-top:0;margin-bottom:.5em}.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]::-webkit-scrollbar{display:none}.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]{list-style:none;padding-left:0;margin:0;align-items:stretch}.el-x-prompts .el-x-prompts-list-wrap[data-v-ee2290d4]{flex-wrap:wrap}.el-x-prompts .el-x-prompts-list-vertical[data-v-ee2290d4]{flex-direction:column;align-items:flex-start}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-list[data-v-ee2290d4]{flex-wrap:wrap;gap:8px}.el-x-prompts .el-x-prompts-list-wrap[data-v-ee2290d4]{justify-content:space-between}}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{flex:none;display:flex;gap:4px;height:auto;padding:12px 18px;align-items:flex-start;justify-content:flex-start;background:#fff;border-radius:8px;transition:border all .3s cubic-bezier(0.645, 0.045, 0.355, 1),background all .3s cubic-bezier(0.645, 0.045, 0.355, 1);border:1px solid #ebeef5}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:calc(50% - 4px);min-width:150px;padding:8px 12px}.el-x-prompts-list-wrap .el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:calc(50% - 4px);margin-bottom:8px}.el-x-prompts-list-vertical .el-x-prompts .el-x-prompts-item[data-v-ee2290d4]{width:100%}}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]:not(.el-x-prompts-item-has-nest):hover{cursor:pointer;background:#f5f7fa}.el-x-prompts .el-x-prompts-item[data-v-ee2290d4]:not(.el-x-prompts-item-has-nest):active{background:#ecf5ff}.el-x-prompts .el-x-prompts-item .el-x-prompts-content[data-v-ee2290d4]{flex:auto;min-width:0;display:flex;gap:4px;flex-direction:column;align-items:flex-start}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item .el-x-prompts-content[data-v-ee2290d4]{width:100%;gap:2px}}.el-x-prompts .el-x-prompts-item .el-x-prompts-icon[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-desc[data-v-ee2290d4]{margin:0;padding:0;font-size:14px;line-height:24px;text-align:start;white-space:normal}@media screen and (max-width: 768px){.el-x-prompts .el-x-prompts-item .el-x-prompts-icon[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item .el-x-prompts-desc[data-v-ee2290d4]{font-size:14px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}}.el-x-prompts .el-x-prompts-item .el-x-prompts-label[data-v-ee2290d4]{color:#303133;font-weight:500}.el-x-prompts .el-x-prompts-item .el-x-prompts-label+.el-x-prompts-desc[data-v-ee2290d4]{color:#909399}.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled[data-v-ee2290d4]{pointer-events:none;background:#f5f7fa}.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled .el-x-prompts-label[data-v-ee2290d4],.el-x-prompts .el-x-prompts-item.el-x-prompts-item-disabled .el-x-prompts-desc[data-v-ee2290d4]{color:#909399}.el-x-prompts .el-x-prompts-item-has-nest>.el-x-prompts-content>.el-x-prompts-label[data-v-ee2290d4]{font-size:18px;line-height:24px}.el-x-prompts.el-x-prompts-nested[data-v-ee2290d4]{margin-top:5px;align-self:stretch}.el-x-prompts.el-x-prompts-nested .el-x-prompts-list[data-v-ee2290d4]{align-items:stretch}.el-x-prompts.el-x-prompts-nested .el-x-prompts-item[data-v-ee2290d4]{border:0;background:#f5f7fa}", ""]);
26428
27371
  // Exports
26429
27372
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
26430
27373
 
@@ -28262,7 +29205,7 @@ module.exports = function smartquotes(state) {
28262
29205
 
28263
29206
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
28264
29207
  // Module
28265
- ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-6eb5751e]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.card-motion-enter-active[data-v-6eb5751e],.card-motion-move[data-v-6eb5751e],.card-motion-leave-active[data-v-6eb5751e]{transition:all .3s ease;opacity:1;transform:translateX(0)}.card-motion-enter[data-v-6eb5751e],.card-motion-leave-to[data-v-6eb5751e]{opacity:0;transform:translateX(-100%)}.card-motion-leave-active[data-v-6eb5751e]{transform:translateX(100%);opacity:0}.el-x-attachments-file-card-wrap[data-v-6eb5751e]{display:flex;height:100%;align-items:center}.el-x-attachments-upload-placeholder[data-v-6eb5751e]{display:inline-block;width:fit-content;align-self:center;margin:6px}.el-x-attachments-card[data-v-6eb5751e]{display:inline-block;vertical-align:top}.el-x-attachments-card-item[data-v-6eb5751e]{margin:6px}.el-x-attachments-prev-btn[data-v-6eb5751e],.el-x-attachments-next-btn[data-v-6eb5751e]{position:absolute;top:50%;transform:translateY(-50%);z-index:10;background-color:rgba(0,0,0,.3);color:#fff;border:none;padding:4px 0px;border-radius:3px;transition:background-color .3s ease}.el-x-attachments-prev-btn[data-v-6eb5751e]:hover,.el-x-attachments-next-btn[data-v-6eb5751e]:hover{background-color:rgba(0,0,0,.5)}.el-x-attachments-prev-btn[data-v-6eb5751e]:active,.el-x-attachments-next-btn[data-v-6eb5751e]:active{background-color:rgba(0,0,0,.7)}.el-x-attachments-prev-btn[data-v-6eb5751e]{left:8px;border-top-left-radius:0px;border-bottom-left-radius:0px}.el-x-attachments-next-btn[data-v-6eb5751e]{right:8px;border-top-right-radius:0px;border-bottom-right-radius:0px}.el-x-attachments-background[data-v-6eb5751e]{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;pointer-events:none}.el-x-attachments-background-start[data-v-6eb5751e]{position:absolute;top:0;left:0;bottom:0;width:50px;background:linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));z-index:5}.el-x-attachments-background-end[data-v-6eb5751e]{position:absolute;top:0;right:0;bottom:0;width:50px;background:linear-gradient(to left, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));z-index:5}.el-x-attachments-overflow-scrollX[data-v-6eb5751e]{height:100%;scrollbar-width:none}.el-x-attachments-overflow-scrollX[data-v-6eb5751e]::-webkit-scrollbar{display:none}.el-x-attachments-overflow-scrollY[data-v-6eb5751e]{width:100%;height:100%}.el-x-attachments-wrapper[data-v-6eb5751e]{position:relative;display:block}.el-x-attachments-upload-btn[data-v-6eb5751e]{display:flex}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload{border:1px dashed #dcdfe6;border-radius:6px;cursor:pointer;position:relative;overflow:hidden;transition:all .3s cubic-bezier(0.645, 0.045, 0.355, 1);box-sizing:border-box;text-align:center}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload:hover{border-color:#409eff}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload:hover .uploader-icon{color:#409eff}.el-x-attachments-upload-btn .uploader-icon[data-v-6eb5751e]{font-size:28px;color:#8c939d;text-align:center;width:var(--el-x-attachments-upload-icon-size);height:var(--el-x-attachments-upload-icon-size);line-height:var(--el-x-attachments-upload-icon-size)}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload-dragger{padding:0;width:auto !important;height:auto !important;background-color:rgba(0,0,0,0)}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload-dragger:hover .el-icon{color:#409eff}.el-x-attachments-drop-area[data-v-6eb5751e]{position:absolute !important;top:0 !important;left:0 !important;width:calc(100% - 4px) !important;height:calc(100% - 4px) !important;border-radius:15px !important;border:2px dashed #409eff !important;z-index:9999 !important;display:flex !important;align-items:center !important;justify-content:center !important;flex-direction:column !important;background:rgba(225,225,225,.8) !important;backdrop-filter:blur(4px) !important;animation:dragAreaShow-6eb5751e .3s ease-in-out !important;pointer-events:none !important}.el-x-attachments-drop-area-icon[data-v-6eb5751e]{font-size:50px !important;color:#409eff !important;animation:bounce-6eb5751e 1s infinite alternate !important}.el-x-attachments-drop-area-text[data-v-6eb5751e]{font-size:16px !important;color:#409eff !important;margin-top:10px !important;text-align:center !important;width:100% !important;max-width:300px !important;font-weight:bold !important}@keyframes dragAreaShow-6eb5751e{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}@keyframes bounce-6eb5751e{from{transform:translateY(0)}to{transform:translateY(-10px)}}", ""]);
29208
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-6eb5751e]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.card-motion-enter-active[data-v-6eb5751e],.card-motion-move[data-v-6eb5751e],.card-motion-leave-active[data-v-6eb5751e]{transition:all .3s ease;opacity:1;transform:translateX(0)}.card-motion-enter[data-v-6eb5751e],.card-motion-leave-to[data-v-6eb5751e]{opacity:0;transform:translateX(-100%)}.card-motion-leave-active[data-v-6eb5751e]{transform:translateX(100%);opacity:0}.el-x-attachments-file-card-wrap[data-v-6eb5751e]{display:flex;height:100%;align-items:center}.el-x-attachments-upload-placeholder[data-v-6eb5751e]{display:inline-block;width:fit-content;align-self:center;margin:6px}.el-x-attachments-card[data-v-6eb5751e]{display:inline-block;vertical-align:top}.el-x-attachments-card-item[data-v-6eb5751e]{margin:6px}.el-x-attachments-prev-btn[data-v-6eb5751e],.el-x-attachments-next-btn[data-v-6eb5751e]{position:absolute;top:50%;transform:translateY(-50%);z-index:10;background-color:rgba(0,0,0,.3);color:#fff;border:none;padding:4px 0px;border-radius:3px;transition:background-color .3s ease}.el-x-attachments-prev-btn[data-v-6eb5751e]:hover,.el-x-attachments-next-btn[data-v-6eb5751e]:hover{background-color:rgba(0,0,0,.5)}.el-x-attachments-prev-btn[data-v-6eb5751e]:active,.el-x-attachments-next-btn[data-v-6eb5751e]:active{background-color:rgba(0,0,0,.7)}.el-x-attachments-prev-btn[data-v-6eb5751e]{left:8px;border-top-left-radius:0px;border-bottom-left-radius:0px}.el-x-attachments-next-btn[data-v-6eb5751e]{right:8px;border-top-right-radius:0px;border-bottom-right-radius:0px}.el-x-attachments-background[data-v-6eb5751e]{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;pointer-events:none}.el-x-attachments-background-start[data-v-6eb5751e]{position:absolute;top:0;left:0;bottom:0;width:50px;background:linear-gradient(to right, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));z-index:5}.el-x-attachments-background-end[data-v-6eb5751e]{position:absolute;top:0;right:0;bottom:0;width:50px;background:linear-gradient(to left, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));z-index:5}.el-x-attachments-overflow-scrollX[data-v-6eb5751e]{height:100%}.el-x-attachments-overflow-scrollX[data-v-6eb5751e]::-webkit-scrollbar{display:none}.el-x-attachments-overflow-scrollX[data-v-6eb5751e]{scrollbar-width:none}.el-x-attachments-overflow-scrollY[data-v-6eb5751e]{width:100%;height:100%}.el-x-attachments-wrapper[data-v-6eb5751e]{position:relative;display:block}.el-x-attachments-upload-btn[data-v-6eb5751e]{display:flex}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload{border:1px dashed #dcdfe6;border-radius:6px;cursor:pointer;position:relative;overflow:hidden;transition:all .3s cubic-bezier(0.645, 0.045, 0.355, 1);box-sizing:border-box;text-align:center}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload:hover{border-color:#409eff}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload:hover .uploader-icon{color:#409eff}.el-x-attachments-upload-btn .uploader-icon[data-v-6eb5751e]{font-size:28px;color:#8c939d;text-align:center;width:var(--el-x-attachments-upload-icon-size);height:var(--el-x-attachments-upload-icon-size);line-height:var(--el-x-attachments-upload-icon-size)}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload-dragger{padding:0;width:auto !important;height:auto !important;background-color:rgba(0,0,0,0)}.el-x-attachments-upload-btn[data-v-6eb5751e] .el-upload-dragger:hover .el-icon{color:#409eff}.el-x-attachments-drop-area[data-v-6eb5751e]{position:absolute !important;top:0 !important;left:0 !important;width:calc(100% - 4px) !important;height:calc(100% - 4px) !important;border-radius:15px !important;border:2px dashed #409eff !important;z-index:9999 !important;display:flex !important;align-items:center !important;justify-content:center !important;flex-direction:column !important;background:rgba(225,225,225,.8) !important;backdrop-filter:blur(4px) !important;animation:dragAreaShow-6eb5751e .3s ease-in-out !important;pointer-events:none !important}.el-x-attachments-drop-area-icon[data-v-6eb5751e]{font-size:50px !important;color:#409eff !important;animation:bounce-6eb5751e 1s infinite alternate !important}.el-x-attachments-drop-area-text[data-v-6eb5751e]{font-size:16px !important;color:#409eff !important;margin-top:10px !important;text-align:center !important;width:100% !important;max-width:300px !important;font-weight:bold !important}@keyframes dragAreaShow-6eb5751e{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}@keyframes bounce-6eb5751e{from{transform:translateY(0)}to{transform:translateY(-10px)}}", ""]);
28266
29209
  // Exports
28267
29210
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
28268
29211
 
@@ -28784,6 +29727,26 @@ module.exports = function link_pairs(state) {
28784
29727
  };
28785
29728
 
28786
29729
 
29730
+ /***/ }),
29731
+
29732
+ /***/ 6021:
29733
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
29734
+
29735
+ "use strict";
29736
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29737
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
29738
+ /* harmony export */ });
29739
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
29740
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
29741
+ // Imports
29742
+
29743
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
29744
+ // Module
29745
+ ___CSS_LOADER_EXPORT___.push([module.id, ".el-x-send-button .el-button .el-icon-brush[data-v-3e37542a]{transform:rotate(180deg)}", ""]);
29746
+ // Exports
29747
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
29748
+
29749
+
28787
29750
  /***/ }),
28788
29751
 
28789
29752
  /***/ 6027:
@@ -34679,6 +35642,26 @@ module.exports = function parseLinkDestination(str, pos, max) {
34679
35642
  };
34680
35643
 
34681
35644
 
35645
+ /***/ }),
35646
+
35647
+ /***/ 9125:
35648
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
35649
+
35650
+ "use strict";
35651
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35652
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
35653
+ /* harmony export */ });
35654
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6314);
35655
+ /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
35656
+ // Imports
35657
+
35658
+ var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
35659
+ // Module
35660
+ ___CSS_LOADER_EXPORT___.push([module.id, "[data-v-8ce301dc]:root{--color-primary: #409eff;--color-success: #67c23a;--color-warning: #e6a23c;--color-danger: #f56c6c;--color-info: #909399}.el-editor-sender-wrap[data-v-8ce301dc]{position:relative;width:100%;box-sizing:border-box;transition:background .3s;border-radius:calc(4px*2);border-color:#dcdfe6;box-shadow:0 1px 2px 0 rgba(0,0,0,.03),0 1px 6px -1px rgba(0,0,0,.02),0 2px 4px 0 rgba(0,0,0,.02);border-width:0;border-style:solid}.el-editor-sender-wrap[data-v-8ce301dc]:after{content:\"\";position:absolute;inset:0;pointer-events:none;transition:border-color .3s;border-radius:inherit;border-style:inherit;border-color:inherit;border-width:1px}.el-editor-sender-wrap[data-v-8ce301dc]:focus-within{box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);border-color:#409eff}.el-editor-sender-wrap[data-v-8ce301dc]:focus-within::after{border-width:2px}.el-editor-sender-wrap .el-editor-sender-header[data-v-8ce301dc]{display:flex;flex-direction:column;gap:8px;width:100%;margin:0;padding:0}.el-editor-sender-wrap .el-editor-sender-header .el-editor-sender-header-container[data-v-8ce301dc]{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#dcdfe6}.el-editor-sender-wrap .el-editor-sender-content[data-v-8ce301dc]{display:flex;width:100%;gap:8px;padding-block:12px;padding-inline-start:16px;padding-inline-end:12px;box-sizing:border-box;align-items:flex-end}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-prefix[data-v-8ce301dc]{flex:none}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room[data-v-8ce301dc]{position:relative;width:100%;height:100%;display:flex;align-items:center;flex-direction:column;align-self:center;box-sizing:border-box}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc]{flex-shrink:0;width:100%;font-size:14px;min-height:26px;line-height:24px;box-sizing:border-box;overflow-y:auto;overflow-x:hidden}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text{font-family:inherit;padding:0;font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text .chat-grid-wrap{font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-rich-text .chat-grid-wrap span{font-size:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-placeholder-wrap{font-family:inherit;font-style:normal;color:#c0c4cc;padding:0;font-weight:bold;font-size:inherit;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-tip-wrap{transform:translateY(-2px);padding:0 6px 0 0}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room .el-editor-sender-chat[data-v-8ce301dc] .chat-tip-wrap .chat-tip-tag-txt{font-size:16px;font-family:inherit}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-chat-room[data-v-8ce301dc] .chat-tip-popover{padding-bottom:10px}.el-editor-sender-wrap .el-editor-sender-content .el-editor-sender-action-list .el-editor-sender-action-list-presets[data-v-8ce301dc]{display:flex;gap:8px;flex-direction:row-reverse}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown[data-v-8ce301dc]{display:flex;flex-direction:column;align-items:initial}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list[data-v-8ce301dc]{display:flex;justify-content:space-between;gap:8px}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list .el-editor-sender-prefix[data-v-8ce301dc]{flex:initial}.el-editor-sender-wrap .el-editor-sender-content.content-variant-updown .el-editor-sender-updown-action-list .el-editor-sender-action-list[data-v-8ce301dc]{margin-left:auto}.el-editor-sender-wrap .el-editor-sender-footer[data-v-8ce301dc]{border-top-width:1px;border-top-style:solid;border-top-color:#dcdfe6}.el-editor-sender-wrap .slide-enter-active[data-v-8ce301dc],.el-editor-sender-wrap .slide-leave-active[data-v-8ce301dc]{height:calc-size(max-content,size);opacity:1;transition:height var(--el-editor-sender-header-duration),opacity var(--el-editor-sender-header-duration),border var(--el-editor-sender-header-duration);overflow:hidden}.el-editor-sender-wrap .slide-enter[data-v-8ce301dc],.el-editor-sender-wrap .slide-leave-to[data-v-8ce301dc]{height:0;opacity:0 !important}", ""]);
35661
+ // Exports
35662
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
35663
+
35664
+
34682
35665
  /***/ }),
34683
35666
 
34684
35667
  /***/ 9295:
@@ -34876,18 +35859,18 @@ render._withStripped = true;
34876
35859
  ;// ./src/components/FilesCard/src/main.vue?vue&type=template&id=eaf958fa&scoped=true
34877
35860
 
34878
35861
  ;// ./src/utils/index.js
34879
- /**
34880
- * 判断文件类型是否为图片
34881
- * @param {string} type 文件类型
34882
- * @returns {boolean} 是否为图片类型
35862
+ /**
35863
+ * 判断文件类型是否为图片
35864
+ * @param {string} type 文件类型
35865
+ * @returns {boolean} 是否为图片类型
34883
35866
  */
34884
35867
  const isImageFileType = type => type.indexOf('image/') === 0;
34885
35868
  const MEASURE_SIZE = 200;
34886
35869
 
34887
- /**
34888
- * 预览图片文件并生成预览URL
34889
- * @param {File|Blob} file 图片文件对象
34890
- * @returns {Promise<string>} 返回图片预览URL的Promise
35870
+ /**
35871
+ * 预览图片文件并生成预览URL
35872
+ * @param {File|Blob} file 图片文件对象
35873
+ * @returns {Promise<string>} 返回图片预览URL的Promise
34891
35874
  */
34892
35875
  function previewImage(file) {
34893
35876
  return new Promise(resolve => {
@@ -34939,10 +35922,10 @@ function previewImage(file) {
34939
35922
  });
34940
35923
  }
34941
35924
 
34942
- /**
34943
- * 根据文件后缀名获取文件类型
34944
- * @param {string} fileExtension 文件后缀名
34945
- * @returns {{lowerCase: string, upperCase: string}} 返回文件类型对象
35925
+ /**
35926
+ * 根据文件后缀名获取文件类型
35927
+ * @param {string} fileExtension 文件后缀名
35928
+ * @returns {{lowerCase: string, upperCase: string}} 返回文件类型对象
34946
35929
  */
34947
35930
  function getFileType(fileExtension) {
34948
35931
  // 去除后缀名开头的点,并转换为小写
@@ -35053,10 +36036,10 @@ function getFileType(fileExtension) {
35053
36036
  };
35054
36037
  }
35055
36038
 
35056
- /**
35057
- * 获取文件大小
35058
- * @param {number} size 文件大小
35059
- * @returns {string} 返回文件大小
36039
+ /**
36040
+ * 获取文件大小
36041
+ * @param {number} size 文件大小
36042
+ * @returns {string} 返回文件大小
35060
36043
  */
35061
36044
  function getSize(size) {
35062
36045
  let retSize = size;
@@ -37138,6 +38121,7 @@ __webpack_require__.d(__webpack_exports__, {
37138
38121
  ElXBubble: () => (/* reexport */ Bubble["default"]),
37139
38122
  ElXBubbleList: () => (/* reexport */ BubbleList["default"]),
37140
38123
  ElXConversations: () => (/* reexport */ Conversations["default"]),
38124
+ ElXEditorSender: () => (/* reexport */ EditorSender["default"]),
37141
38125
  ElXFilesCard: () => (/* reexport */ FilesCard["default"]),
37142
38126
  ElXPrompts: () => (/* reexport */ Prompts["default"]),
37143
38127
  ElXSender: () => (/* reexport */ Sender["default"]),
@@ -37179,9 +38163,11 @@ var ThoughtChain = __webpack_require__(6765);
37179
38163
  var Typewriter = __webpack_require__(1207);
37180
38164
  // EXTERNAL MODULE: ./src/components/Welcome/index.js + 7 modules
37181
38165
  var Welcome = __webpack_require__(7795);
38166
+ // EXTERNAL MODULE: ./src/components/EditorSender/index.js + 32 modules
38167
+ var EditorSender = __webpack_require__(1433);
37182
38168
  ;// ./src/mixins/sendMixin.js
37183
- /**
37184
- * XRequest 类 - 用于处理 SSE 和 Fetch 请求
38169
+ /**
38170
+ * XRequest 类 - 用于处理 SSE 和 Fetch 请求
37185
38171
  */
37186
38172
  class XRequest {
37187
38173
  constructor(options = {}) {
@@ -37279,10 +38265,10 @@ class XRequest {
37279
38265
  this._controller && this._controller.abort();
37280
38266
  });
37281
38267
  }
37282
- /**
37283
- * 处理缓冲区数据,提取完整的行
37284
- * @param {string} buffer - 缓冲区数据
37285
- * @returns {string} 剩余的不完整数据
38268
+ /**
38269
+ * 处理缓冲区数据,提取完整的行
38270
+ * @param {string} buffer - 缓冲区数据
38271
+ * @returns {string} 剩余的不完整数据
37286
38272
  */
37287
38273
  processBuffer(buffer) {
37288
38274
  const lines = buffer.split('\n');
@@ -37297,9 +38283,9 @@ class XRequest {
37297
38283
  return remainingData || '';
37298
38284
  }
37299
38285
 
37300
- /**
37301
- * 处理单行数据
37302
- * @param {string} line - 单行数据
38286
+ /**
38287
+ * 处理单行数据
38288
+ * @param {string} line - 单行数据
37303
38289
  */
37304
38290
  processLine(line) {
37305
38291
  // 跳过空行
@@ -37350,9 +38336,9 @@ class XRequest {
37350
38336
  }
37351
38337
  }
37352
38338
 
37353
- /**
37354
- * 处理缓冲区中剩余的数据(在流结束时调用)
37355
- * @param {string} buffer - 剩余的缓冲区数据
38339
+ /**
38340
+ * 处理缓冲区中剩余的数据(在流结束时调用)
38341
+ * @param {string} buffer - 剩余的缓冲区数据
37356
38342
  */
37357
38343
  processBufferData(buffer) {
37358
38344
  const lines = buffer.split('\n');
@@ -37454,9 +38440,9 @@ class XRequest {
37454
38440
  }
37455
38441
  }
37456
38442
 
37457
- /**
37458
- * sendMixin -
37459
- * 用于处理发送操作管理请求状态的 mixin,支持可选的中止功能,同时支持 Promise 和 SSE(服务端事件)
38443
+ /**
38444
+ * sendMixin -
38445
+ * 用于处理发送操作管理请求状态的 mixin,支持可选的中止功能,同时支持 Promise 和 SSE(服务端事件)
37460
38446
  */
37461
38447
  const sendMixin = {
37462
38448
  data() {
@@ -37467,13 +38453,13 @@ const sendMixin = {
37467
38453
  };
37468
38454
  },
37469
38455
  methods: {
37470
- /**
37471
- * 初始化发送配置
37472
- * @param {Object} options - 配置选项
37473
- * @param {Function} options.onAbort - 中止回调
37474
- * @param {Function} options.sendHandler - 发送处理器
37475
- * @param {Function} options.abortHandler - 中止处理器
37476
- * @param {Function} options.finishHandler - 完成处理器
38456
+ /**
38457
+ * 初始化发送配置
38458
+ * @param {Object} options - 配置选项
38459
+ * @param {Function} options.onAbort - 中止回调
38460
+ * @param {Function} options.sendHandler - 发送处理器
38461
+ * @param {Function} options.abortHandler - 中止处理器
38462
+ * @param {Function} options.finishHandler - 完成处理器
37477
38463
  */
37478
38464
  initSend(options = {}) {
37479
38465
  this._sendOptions = {
@@ -37483,9 +38469,9 @@ const sendMixin = {
37483
38469
  finishHandler: options.finishHandler
37484
38470
  };
37485
38471
  },
37486
- /**
37487
- * 发送操作
37488
- * @param {...any} args - 传递给 sendHandler 的参数
38472
+ /**
38473
+ * 发送操作
38474
+ * @param {...any} args - 传递给 sendHandler 的参数
37489
38475
  */
37490
38476
  handleSend(...args) {
37491
38477
  if (this.loading) {
@@ -37496,8 +38482,8 @@ const sendMixin = {
37496
38482
  }
37497
38483
  this.loading = true;
37498
38484
  },
37499
- /**
37500
- * 中止操作
38485
+ /**
38486
+ * 中止操作
37501
38487
  */
37502
38488
  handleAbort() {
37503
38489
  this.loading = false;
@@ -37508,8 +38494,8 @@ const sendMixin = {
37508
38494
  this._sendOptions.onAbort();
37509
38495
  }
37510
38496
  },
37511
- /**
37512
- * 完成操作
38497
+ /**
38498
+ * 完成操作
37513
38499
  */
37514
38500
  handleFinish() {
37515
38501
  this.loading = false;
@@ -37517,10 +38503,10 @@ const sendMixin = {
37517
38503
  this._sendOptions.finishHandler();
37518
38504
  }
37519
38505
  },
37520
- /**
37521
- * 创建 XRequest 实例的便捷方法
37522
- * @param {Object} options - XRequest 配置选项
37523
- * @returns {XRequest} XRequest 实例
38506
+ /**
38507
+ * 创建 XRequest 实例的便捷方法
38508
+ * @param {Object} options - XRequest 配置选项
38509
+ * @returns {XRequest} XRequest 实例
37524
38510
  */
37525
38511
  createXRequest(options = {}) {
37526
38512
  return new XRequest({
@@ -37548,10 +38534,10 @@ const sendMixin = {
37548
38534
  }
37549
38535
  };
37550
38536
 
37551
- /**
37552
- * 工具函数版本 - 用于非组件场景
37553
- * @param {Object} options - 配置选项
37554
- * @returns {Object} 包含发送相关方法的对象
38537
+ /**
38538
+ * 工具函数版本 - 用于非组件场景
38539
+ * @param {Object} options - 配置选项
38540
+ * @returns {Object} 包含发送相关方法的对象
37555
38541
  */
37556
38542
  function createSendUtils(options = {}) {
37557
38543
  const state = {
@@ -37590,99 +38576,99 @@ function createSendUtils(options = {}) {
37590
38576
  }
37591
38577
  /* harmony default export */ const mixins_sendMixin = ((/* unused pure expression or super */ null && (sendMixin)));
37592
38578
  ;// ./src/mixins/streamMixin.js
37593
- /**
37594
- * @fileoverview 流式数据处理 Mixin
37595
- * 支持 SSE 数据解析和中断功能
38579
+ /**
38580
+ * @fileoverview 流式数据处理 Mixin
38581
+ * 支持 SSE 数据解析和中断功能
37596
38582
  */
37597
38583
 
37598
- /**
37599
- * 默认流分隔符
37600
- * @type {string}
37601
- * @constant
38584
+ /**
38585
+ * 默认流分隔符
38586
+ * @type {string}
38587
+ * @constant
37602
38588
  */
37603
38589
  const DEFAULT_STREAM_SEPARATOR = '\n\n';
37604
38590
 
37605
- /**
37606
- * 默认部分分隔符
37607
- * @type {string}
37608
- * @constant
38591
+ /**
38592
+ * 默认部分分隔符
38593
+ * @type {string}
38594
+ * @constant
37609
38595
  */
37610
38596
  const DEFAULT_PART_SEPARATOR = '\n';
37611
38597
 
37612
- /**
37613
- * 默认键值分隔符
37614
- * @type {string}
37615
- * @constant
38598
+ /**
38599
+ * 默认键值分隔符
38600
+ * @type {string}
38601
+ * @constant
37616
38602
  */
37617
38603
  const DEFAULT_KV_SEPARATOR = ':';
37618
38604
 
37619
- /**
37620
- * SSE 字段类型定义
37621
- * @typedef {'data'|'event'|'id'|'retry'} SSEFields
38605
+ /**
38606
+ * SSE 字段类型定义
38607
+ * @typedef {'data'|'event'|'id'|'retry'} SSEFields
37622
38608
  */
37623
38609
 
37624
- /**
37625
- * SSE 输出对象类型
37626
- * @typedef {Object} SSEOutput
37627
- * @property {string} [data] - 数据字段
37628
- * @property {string} [event] - 事件字段
37629
- * @property {string} [id] - ID字段
37630
- * @property {string} [retry] - 重试字段
38610
+ /**
38611
+ * SSE 输出对象类型
38612
+ * @typedef {Object} SSEOutput
38613
+ * @property {string} [data] - 数据字段
38614
+ * @property {string} [event] - 事件字段
38615
+ * @property {string} [id] - ID字段
38616
+ * @property {string} [retry] - 重试字段
37631
38617
  */
37632
38618
 
37633
- /**
37634
- * 流配置选项
37635
- * @typedef {Object} XStreamOptions
37636
- * @property {ReadableStream<Uint8Array>} readableStream - 可读流
37637
- * @property {TransformStream<string, *>} [transformStream] - 可选的转换流
38619
+ /**
38620
+ * 流配置选项
38621
+ * @typedef {Object} XStreamOptions
38622
+ * @property {ReadableStream<Uint8Array>} readableStream - 可读流
38623
+ * @property {TransformStream<string, *>} [transformStream] - 可选的转换流
37638
38624
  */
37639
38625
 
37640
- /**
37641
- * 流状态对象
37642
- * @typedef {Object} StreamState
37643
- * @property {Array<*>} data - 流数据数组
37644
- * @property {Error|null} error - 错误信息
37645
- * @property {boolean} loading - 加载状态
38626
+ /**
38627
+ * 流状态对象
38628
+ * @typedef {Object} StreamState
38629
+ * @property {Array<*>} data - 流数据数组
38630
+ * @property {Error|null} error - 错误信息
38631
+ * @property {boolean} loading - 加载状态
37646
38632
  */
37647
38633
 
37648
- /**
37649
- * 流回调函数配置
37650
- * @typedef {Object} StreamCallbacks
37651
- * @property {function(*): void} [onData] - 数据回调函数
37652
- * @property {function(Array<*>): void} [onComplete] - 完成回调函数
37653
- * @property {function(Error): void} [onError] - 错误回调函数
37654
- * @property {function(): void} [onCancel] - 取消回调函数
37655
- * @property {function(): void} [onFinish] - 结束回调函数
38634
+ /**
38635
+ * 流回调函数配置
38636
+ * @typedef {Object} StreamCallbacks
38637
+ * @property {function(*): void} [onData] - 数据回调函数
38638
+ * @property {function(Array<*>): void} [onComplete] - 完成回调函数
38639
+ * @property {function(Error): void} [onError] - 错误回调函数
38640
+ * @property {function(): void} [onCancel] - 取消回调函数
38641
+ * @property {function(): void} [onFinish] - 结束回调函数
37656
38642
  */
37657
38643
 
37658
- /**
37659
- * 流工具函数返回对象
37660
- * @typedef {Object} StreamUtils
37661
- * @property {StreamState} state - 流状态
37662
- * @property {function(XStreamOptions): Promise<void>} startStream - 启动流处理
37663
- * @property {function(): void} cancel - 取消流处理
37664
- * @property {function(): void} reset - 重置流状态
38644
+ /**
38645
+ * 流工具函数返回对象
38646
+ * @typedef {Object} StreamUtils
38647
+ * @property {StreamState} state - 流状态
38648
+ * @property {function(XStreamOptions): Promise<void>} startStream - 启动流处理
38649
+ * @property {function(): void} cancel - 取消流处理
38650
+ * @property {function(): void} reset - 重置流状态
37665
38651
  */
37666
38652
 
37667
- /**
37668
- * 验证字符串是否有效(非空且非空白)
37669
- * @param {string} str - 待验证的字符串
37670
- * @returns {boolean} 是否为有效字符串
38653
+ /**
38654
+ * 验证字符串是否有效(非空且非空白)
38655
+ * @param {string} str - 待验证的字符串
38656
+ * @returns {boolean} 是否为有效字符串
37671
38657
  */
37672
38658
  const isValidString = str => (str === null || str === undefined ? '' : str).trim() !== '';
37673
38659
 
37674
- /**
37675
- * 创建流分割转换器
37676
- * 按照默认分隔符分割流数据
37677
- * @returns {TransformStream<string, string>} 流分割转换器
38660
+ /**
38661
+ * 创建流分割转换器
38662
+ * 按照默认分隔符分割流数据
38663
+ * @returns {TransformStream<string, string>} 流分割转换器
37678
38664
  */
37679
38665
  function splitStream() {
37680
38666
  let buffer = '';
37681
38667
  return new TransformStream({
37682
- /**
37683
- * 转换函数
37684
- * @param {string} chunk - 数据块
37685
- * @param {TransformStreamDefaultController<string>} controller - 控制器
38668
+ /**
38669
+ * 转换函数
38670
+ * @param {string} chunk - 数据块
38671
+ * @param {TransformStreamDefaultController<string>} controller - 控制器
37686
38672
  */
37687
38673
  transform(chunk, controller) {
37688
38674
  buffer += chunk;
@@ -37692,9 +38678,9 @@ function splitStream() {
37692
38678
  });
37693
38679
  buffer = parts[parts.length - 1];
37694
38680
  },
37695
- /**
37696
- * 刷新函数
37697
- * @param {TransformStreamDefaultController<string>} controller - 控制器
38681
+ /**
38682
+ * 刷新函数
38683
+ * @param {TransformStreamDefaultController<string>} controller - 控制器
37698
38684
  */
37699
38685
  flush(controller) {
37700
38686
  if (isValidString(buffer)) controller.enqueue(buffer);
@@ -37702,17 +38688,17 @@ function splitStream() {
37702
38688
  });
37703
38689
  }
37704
38690
 
37705
- /**
37706
- * 创建 SSE 数据解析转换器
37707
- * 将文本数据解析为 SSE 格式对象
37708
- * @returns {TransformStream<string, SSEOutput>} SSE 解析转换器
38691
+ /**
38692
+ * 创建 SSE 数据解析转换器
38693
+ * 将文本数据解析为 SSE 格式对象
38694
+ * @returns {TransformStream<string, SSEOutput>} SSE 解析转换器
37709
38695
  */
37710
38696
  function splitPart() {
37711
38697
  return new TransformStream({
37712
- /**
37713
- * 转换函数
37714
- * @param {string} partChunk - 数据块
37715
- * @param {TransformStreamDefaultController<SSEOutput>} controller - 控制器
38698
+ /**
38699
+ * 转换函数
38700
+ * @param {string} partChunk - 数据块
38701
+ * @param {TransformStreamDefaultController<SSEOutput>} controller - 控制器
37716
38702
  */
37717
38703
  transform(partChunk, controller) {
37718
38704
  const lines = partChunk.split(DEFAULT_PART_SEPARATOR);
@@ -37732,14 +38718,14 @@ function splitPart() {
37732
38718
  });
37733
38719
  }
37734
38720
 
37735
- /**
37736
- * 核心流处理函数(支持中断)
37737
- * @param {XStreamOptions} options - 配置选项
37738
- * @param {ReadableStream<Uint8Array>} options.readableStream - 可读流
37739
- * @param {TransformStream<string, *>} [options.transformStream] - 可选的转换流
37740
- * @param {AbortSignal} [signal] - 中断信号
37741
- * @returns {ReadableStream<*>} 处理后的流,支持异步迭代
37742
- * @throws {TypeError} 当 readableStream 不是 ReadableStream 实例时抛出
38721
+ /**
38722
+ * 核心流处理函数(支持中断)
38723
+ * @param {XStreamOptions} options - 配置选项
38724
+ * @param {ReadableStream<Uint8Array>} options.readableStream - 可读流
38725
+ * @param {TransformStream<string, *>} [options.transformStream] - 可选的转换流
38726
+ * @param {AbortSignal} [signal] - 中断信号
38727
+ * @returns {ReadableStream<*>} 处理后的流,支持异步迭代
38728
+ * @throws {TypeError} 当 readableStream 不是 ReadableStream 实例时抛出
37743
38729
  */
37744
38730
  function XStream(options, signal) {
37745
38731
  const {
@@ -37776,21 +38762,21 @@ function XStream(options, signal) {
37776
38762
  return processedStream;
37777
38763
  }
37778
38764
 
37779
- /**
37780
- * streamMixin
37781
- * 用于处理流式数据的 mixin,支持 SSE 数据解析和中断功能
37782
- * @namespace streamMixin
37783
- * @type {Object}
38765
+ /**
38766
+ * streamMixin
38767
+ * 用于处理流式数据的 mixin,支持 SSE 数据解析和中断功能
38768
+ * @namespace streamMixin
38769
+ * @type {Object}
37784
38770
  */
37785
38771
  const streamMixin = {
37786
- /**
37787
- * 组件数据
37788
- * @returns {Object} 响应式数据对象
37789
- * @property {Array<*>} streamData - 流数据数组
37790
- * @property {Error|null} streamError - 流错误信息
37791
- * @property {boolean} streamLoading - 流处理状态
37792
- * @property {AbortController|null} _abortController - 私有:中断控制器
37793
- * @property {ReadableStream|null} _currentStream - 私有:当前流引用
38772
+ /**
38773
+ * 组件数据
38774
+ * @returns {Object} 响应式数据对象
38775
+ * @property {Array<*>} streamData - 流数据数组
38776
+ * @property {Error|null} streamError - 流错误信息
38777
+ * @property {boolean} streamLoading - 流处理状态
38778
+ * @property {AbortController|null} _abortController - 私有:中断控制器
38779
+ * @property {ReadableStream|null} _currentStream - 私有:当前流引用
37794
38780
  */
37795
38781
  data() {
37796
38782
  return {
@@ -37802,28 +38788,28 @@ const streamMixin = {
37802
38788
  };
37803
38789
  },
37804
38790
  methods: {
37805
- /**
37806
- * 启动流式请求
37807
- * @async
37808
- * @param {XStreamOptions} options - 流配置选项
37809
- * @param {ReadableStream<Uint8Array>} options.readableStream - 可读流
37810
- * @param {TransformStream<string, *>} [options.transformStream] - 可选的转换流
37811
- * @returns {Promise<void>} 流处理完成的 Promise
37812
- * @fires streamMixin#stream-data - 收到新数据时触发
37813
- * @fires streamMixin#stream-complete - 流完成时触发
37814
- * @fires streamMixin#stream-error - 流错误时触发
37815
- * @fires streamMixin#stream-finish - 流处理结束时触发
37816
- * @example
37817
- * // 基础使用
37818
- * const response = await fetch('/api/stream')
37819
- * await this.startStream({ readableStream: response.body })
37820
- *
37821
- * // 使用自定义转换流
37822
- * const customTransform = new TransformStream({ ... })
37823
- * await this.startStream({
37824
- * readableStream: response.body,
37825
- * transformStream: customTransform
37826
- * })
38791
+ /**
38792
+ * 启动流式请求
38793
+ * @async
38794
+ * @param {XStreamOptions} options - 流配置选项
38795
+ * @param {ReadableStream<Uint8Array>} options.readableStream - 可读流
38796
+ * @param {TransformStream<string, *>} [options.transformStream] - 可选的转换流
38797
+ * @returns {Promise<void>} 流处理完成的 Promise
38798
+ * @fires streamMixin#stream-data - 收到新数据时触发
38799
+ * @fires streamMixin#stream-complete - 流完成时触发
38800
+ * @fires streamMixin#stream-error - 流错误时触发
38801
+ * @fires streamMixin#stream-finish - 流处理结束时触发
38802
+ * @example
38803
+ * // 基础使用
38804
+ * const response = await fetch('/api/stream')
38805
+ * await this.startStream({ readableStream: response.body })
38806
+ *
38807
+ * // 使用自定义转换流
38808
+ * const customTransform = new TransformStream({ ... })
38809
+ * await this.startStream({
38810
+ * readableStream: response.body,
38811
+ * transformStream: customTransform
38812
+ * })
37827
38813
  */
37828
38814
  async startStream(options) {
37829
38815
  this.streamLoading = true;
@@ -37835,27 +38821,27 @@ const streamMixin = {
37835
38821
  for await (const item of this._currentStream) {
37836
38822
  this.streamData.push(item);
37837
38823
  // 触发数据更新事件
37838
- /**
37839
- * 流数据事件
37840
- * @event streamMixin#stream-data
37841
- * @type {*} 流数据项
38824
+ /**
38825
+ * 流数据事件
38826
+ * @event streamMixin#stream-data
38827
+ * @type {*} 流数据项
37842
38828
  */
37843
38829
  this.$emit('stream-data', item);
37844
38830
  }
37845
38831
  // 流完成事件
37846
- /**
37847
- * 流完成事件
37848
- * @event streamMixin#stream-complete
37849
- * @type {Array<*>} 所有流数据
38832
+ /**
38833
+ * 流完成事件
38834
+ * @event streamMixin#stream-complete
38835
+ * @type {Array<*>} 所有流数据
37850
38836
  */
37851
38837
  this.$emit('stream-complete', this.streamData);
37852
38838
  } catch (err) {
37853
38839
  if (err instanceof Error) {
37854
38840
  this.streamError = err;
37855
- /**
37856
- * 流错误事件
37857
- * @event streamMixin#stream-error
37858
- * @type {Error} 错误对象
38841
+ /**
38842
+ * 流错误事件
38843
+ * @event streamMixin#stream-error
38844
+ * @type {Error} 错误对象
37859
38845
  */
37860
38846
  this.$emit('stream-error', err);
37861
38847
  }
@@ -37863,36 +38849,36 @@ const streamMixin = {
37863
38849
  this.streamLoading = false;
37864
38850
  this._currentStream = null; // 释放流引用
37865
38851
  this._abortController = null; // 释放控制器
37866
- /**
37867
- * 流处理结束事件
37868
- * @event streamMixin#stream-finish
38852
+ /**
38853
+ * 流处理结束事件
38854
+ * @event streamMixin#stream-finish
37869
38855
  */
37870
38856
  this.$emit('stream-finish');
37871
38857
  }
37872
38858
  },
37873
- /**
37874
- * 中断流式请求(强制关闭流)
37875
- * @returns {void}
37876
- * @fires streamMixin#stream-cancel - 流被中断时触发
37877
- * @example
37878
- * this.cancelStream()
38859
+ /**
38860
+ * 中断流式请求(强制关闭流)
38861
+ * @returns {void}
38862
+ * @fires streamMixin#stream-cancel - 流被中断时触发
38863
+ * @example
38864
+ * this.cancelStream()
37879
38865
  */
37880
38866
  cancelStream() {
37881
38867
  if (this._abortController) {
37882
38868
  this._abortController.abort();
37883
- /**
37884
- * 流取消事件
37885
- * @event streamMixin#stream-cancel
38869
+ /**
38870
+ * 流取消事件
38871
+ * @event streamMixin#stream-cancel
37886
38872
  */
37887
38873
  this.$emit('stream-cancel');
37888
38874
  }
37889
38875
  },
37890
- /**
37891
- * 重置流状态
37892
- * 清空所有数据和状态,但不触发事件
37893
- * @returns {void}
37894
- * @example
37895
- * this.resetStream()
38876
+ /**
38877
+ * 重置流状态
38878
+ * 清空所有数据和状态,但不触发事件
38879
+ * @returns {void}
38880
+ * @example
38881
+ * this.resetStream()
37896
38882
  */
37897
38883
  resetStream() {
37898
38884
  this.streamData = [];
@@ -37901,14 +38887,14 @@ const streamMixin = {
37901
38887
  this._abortController = null;
37902
38888
  this._currentStream = null;
37903
38889
  },
37904
- /**
37905
- * 创建流处理器的便捷方法
37906
- * @param {ReadableStream<Uint8Array>} readableStream - 可读流
37907
- * @param {TransformStream<string, *>} [transformStream] - 可选的转换流
37908
- * @returns {XStreamOptions} 流处理器配置对象
37909
- * @example
37910
- * const processor = this.createStreamProcessor(response.body)
37911
- * await this.startStream(processor)
38890
+ /**
38891
+ * 创建流处理器的便捷方法
38892
+ * @param {ReadableStream<Uint8Array>} readableStream - 可读流
38893
+ * @param {TransformStream<string, *>} [transformStream] - 可选的转换流
38894
+ * @returns {XStreamOptions} 流处理器配置对象
38895
+ * @example
38896
+ * const processor = this.createStreamProcessor(response.body)
38897
+ * await this.startStream(processor)
37912
38898
  */
37913
38899
  createStreamProcessor(readableStream, transformStream) {
37914
38900
  return {
@@ -37917,10 +38903,10 @@ const streamMixin = {
37917
38903
  };
37918
38904
  }
37919
38905
  },
37920
- /**
37921
- * 组件销毁前的生命周期钩子
37922
- * 自动清理流资源
37923
- * @returns {void}
38906
+ /**
38907
+ * 组件销毁前的生命周期钩子
38908
+ * 自动清理流资源
38909
+ * @returns {void}
37924
38910
  */
37925
38911
  beforeDestroy() {
37926
38912
  // 组件销毁时清理资源
@@ -37928,30 +38914,30 @@ const streamMixin = {
37928
38914
  }
37929
38915
  };
37930
38916
 
37931
- /**
37932
- * 工具函数版本 - 用于非组件场景
37933
- * @param {StreamCallbacks} [callbacks={}] - 回调函数配置
37934
- * @param {function(*): void} [callbacks.onData] - 数据回调函数
37935
- * @param {function(Array<*>): void} [callbacks.onComplete] - 完成回调函数
37936
- * @param {function(Error): void} [callbacks.onError] - 错误回调函数
37937
- * @param {function(): void} [callbacks.onCancel] - 取消回调函数
37938
- * @param {function(): void} [callbacks.onFinish] - 结束回调函数
37939
- * @returns {StreamUtils} 包含流处理相关方法的对象
37940
- * @example
37941
- * // 基础使用
37942
- * const streamUtils = createStreamUtils({
37943
- * onData: (item) => console.log('数据:', item),
37944
- * onComplete: (allData) => console.log('完成:', allData),
37945
- * onError: (error) => console.error('错误:', error)
37946
- * })
37947
- *
37948
- * const response = await fetch('/api/stream')
37949
- * await streamUtils.startStream({ readableStream: response.body })
38917
+ /**
38918
+ * 工具函数版本 - 用于非组件场景
38919
+ * @param {StreamCallbacks} [callbacks={}] - 回调函数配置
38920
+ * @param {function(*): void} [callbacks.onData] - 数据回调函数
38921
+ * @param {function(Array<*>): void} [callbacks.onComplete] - 完成回调函数
38922
+ * @param {function(Error): void} [callbacks.onError] - 错误回调函数
38923
+ * @param {function(): void} [callbacks.onCancel] - 取消回调函数
38924
+ * @param {function(): void} [callbacks.onFinish] - 结束回调函数
38925
+ * @returns {StreamUtils} 包含流处理相关方法的对象
38926
+ * @example
38927
+ * // 基础使用
38928
+ * const streamUtils = createStreamUtils({
38929
+ * onData: (item) => console.log('数据:', item),
38930
+ * onComplete: (allData) => console.log('完成:', allData),
38931
+ * onError: (error) => console.error('错误:', error)
38932
+ * })
38933
+ *
38934
+ * const response = await fetch('/api/stream')
38935
+ * await streamUtils.startStream({ readableStream: response.body })
37950
38936
  */
37951
38937
  function createStreamUtils(callbacks = {}) {
37952
- /**
37953
- * 流状态对象
37954
- * @type {StreamState}
38938
+ /**
38939
+ * 流状态对象
38940
+ * @type {StreamState}
37955
38941
  */
37956
38942
  const state = {
37957
38943
  data: [],
@@ -37961,11 +38947,11 @@ function createStreamUtils(callbacks = {}) {
37961
38947
  let abortController = null;
37962
38948
  let currentStream = null;
37963
38949
 
37964
- /**
37965
- * 启动流处理
37966
- * @async
37967
- * @param {XStreamOptions} options - 流配置选项
37968
- * @returns {Promise<void>} 流处理完成的 Promise
38950
+ /**
38951
+ * 启动流处理
38952
+ * @async
38953
+ * @param {XStreamOptions} options - 流配置选项
38954
+ * @returns {Promise<void>} 流处理完成的 Promise
37969
38955
  */
37970
38956
  const startStream = async options => {
37971
38957
  state.loading = true;
@@ -38000,9 +38986,9 @@ function createStreamUtils(callbacks = {}) {
38000
38986
  }
38001
38987
  };
38002
38988
 
38003
- /**
38004
- * 取消流处理
38005
- * @returns {void}
38989
+ /**
38990
+ * 取消流处理
38991
+ * @returns {void}
38006
38992
  */
38007
38993
  const cancel = () => {
38008
38994
  if (abortController) {
@@ -38013,9 +38999,9 @@ function createStreamUtils(callbacks = {}) {
38013
38999
  }
38014
39000
  };
38015
39001
 
38016
- /**
38017
- * 重置流状态
38018
- * @returns {void}
39002
+ /**
39003
+ * 重置流状态
39004
+ * @returns {void}
38019
39005
  */
38020
39006
  const reset = () => {
38021
39007
  state.data = [];
@@ -38035,15 +39021,15 @@ function createStreamUtils(callbacks = {}) {
38035
39021
  // 导出常量和工具函数
38036
39022
 
38037
39023
 
38038
- /**
38039
- * 默认导出 streamMixin
38040
- * @type {Object}
39024
+ /**
39025
+ * 默认导出 streamMixin
39026
+ * @type {Object}
38041
39027
  */
38042
39028
  /* harmony default export */ const mixins_streamMixin = ((/* unused pure expression or super */ null && (streamMixin)));
38043
39029
  ;// ./src/mixins/recordMixin.js
38044
- /**
38045
- * @description 提供语音识别的混入,允许语音输入并处理开始、结束、结果及错误等各种事件。
38046
- * @mixin recordMixin
39030
+ /**
39031
+ * @description 提供语音识别的混入,允许语音输入并处理开始、结束、结果及错误等各种事件。
39032
+ * @mixin recordMixin
38047
39033
  */
38048
39034
 
38049
39035
  /* harmony default export */ const recordMixin = ({
@@ -38065,13 +39051,13 @@ function createStreamUtils(callbacks = {}) {
38065
39051
  };
38066
39052
  },
38067
39053
  methods: {
38068
- /**
38069
- * 初始化语音识别配置
38070
- * @param {Object} options - 配置选项
38071
- * @param {Function} [options.onError] - 错误回调
38072
- * @param {Function} [options.onStart] - 开始回调
38073
- * @param {Function} [options.onEnd] - 结束回调
38074
- * @param {Function} [options.onResult] - 结果回调
39054
+ /**
39055
+ * 初始化语音识别配置
39056
+ * @param {Object} options - 配置选项
39057
+ * @param {Function} [options.onError] - 错误回调
39058
+ * @param {Function} [options.onStart] - 开始回调
39059
+ * @param {Function} [options.onEnd] - 结束回调
39060
+ * @param {Function} [options.onResult] - 结果回调
38075
39061
  */
38076
39062
  initRecord(options = {}) {
38077
39063
  this.recordOptions = {
@@ -38079,8 +39065,8 @@ function createStreamUtils(callbacks = {}) {
38079
39065
  ...options
38080
39066
  };
38081
39067
  },
38082
- /**
38083
- * 开始语音识别
39068
+ /**
39069
+ * 开始语音识别
38084
39070
  */
38085
39071
  startRecord() {
38086
39072
  if ('webkitSpeechRecognition' in window) {
@@ -38128,16 +39114,16 @@ function createStreamUtils(callbacks = {}) {
38128
39114
  }
38129
39115
  }
38130
39116
  },
38131
- /**
38132
- * 停止语音识别
39117
+ /**
39118
+ * 停止语音识别
38133
39119
  */
38134
39120
  stopRecord() {
38135
39121
  if (this.recordRecognition) {
38136
39122
  this.recordRecognition.stop();
38137
39123
  }
38138
39124
  },
38139
- /**
38140
- * 清理语音识别资源
39125
+ /**
39126
+ * 清理语音识别资源
38141
39127
  */
38142
39128
  cleanupRecord() {
38143
39129
  this.stopRecord();
@@ -38448,12 +39434,13 @@ var zh_CN = __webpack_require__(6449);
38448
39434
 
38449
39435
 
38450
39436
 
39437
+
38451
39438
  // 导入 mixins
38452
39439
 
38453
39440
  // 导入国际化功能
38454
39441
 
38455
39442
 
38456
- const components = [Typewriter["default"], Bubble["default"], BubbleList["default"], Prompts["default"], Conversations["default"], Thinking["default"], ThoughtChain["default"], Sender["default"], FilesCard["default"], Attachments["default"], Welcome["default"]];
39443
+ const components = [Typewriter["default"], Bubble["default"], BubbleList["default"], Prompts["default"], Conversations["default"], Thinking["default"], ThoughtChain["default"], Sender["default"], FilesCard["default"], Attachments["default"], Welcome["default"], EditorSender["default"]];
38457
39444
  const install = function (Vue, opts = {}) {
38458
39445
  // 处理国际化配置
38459
39446
  if (opts.locale) {