/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index2.css');require('./index.css');const e=require("vue"),t=require("../../node_modules/@tiptap/vue-3/dist/index.js"),i=require("../../node_modules/@tiptap/starter-kit/dist/index.js"),s=require("../../node_modules/@tiptap/extension-text-align/dist/index.js"),o=require("../../node_modules/@tiptap/extension-task-list/dist/index.js"),a=require("../../node_modules/@tiptap/extension-task-item/dist/index.js"),r=require("../../node_modules/@tiptap/extension-image/dist/index.js"),l=require("../../node_modules/@tiptap/extension-highlight/dist/index.js"),d=require("../../node_modules/@tiptap/extension-table/dist/index.js"),n=require("../../node_modules/@tiptap/extension-text-style/dist/index.js"),u=require("../../node_modules/@tiptap/extension-character-count/dist/index.js"),c=require("../../node_modules/@tiptap/extension-underline/dist/index.js"),p=require("../../node_modules/@tiptap/extension-superscript/dist/index.js"),f=require("../../node_modules/@tiptap/extension-subscript/dist/index.js"),x=require("./ToolbarPanel.vue.js"),m=require("./extensions/video.js"),b=require("../../hooks/useNamespace.js"),v=require("./props.js");/* empty css             */;/* empty css            */const g=require("../../_virtual/_plugin-vue_export-helper.js"),h={class:"gsc-flex-center gsc-rich-text-footer"},j=Object.assign({name:"GscRichTextEditor"},{__name:"index",props:v.basicProps,emits:["update:modelValue","change","init","focus","blur"],setup(v,{expose:g,emit:j}){const q=v,_=j,{prefixCls:k}=b.useNamespace("ellipsis"),C=e.ref(!1),y=e.ref(!1),V=e.ref(""),E=e.ref(0);function S(e){if(!e)return;const{state:t}=e,{selection:i}=t,{$from:s}=i,o=[];for(let a=s.depth;a>=0;a--){const e=s.node(a),t=e.type.name;if("doc"!==t&&"text"!==t){let i=t;const s={paragraph:"p",blockquote:"blockquote",codeBlock:"code",bulletList:"ul",orderedList:"ol",taskList:"tasklist",listItem:"li",table:"table",tableRow:"tr",tableCell:"td",image:"img",video:"video"};if("heading"===t){i=`h${e.attrs.level||1}`}else s[t]&&(i=s[t]);o.unshift(i)}}V.value=o.join(" > ")}const N=[i.default,s.default.configure({types:["heading","paragraph"]}),o.default,a.default.configure({nested:!0}),r.default,l.default.configure({multicolor:!0}),c.default,p.default,f.default,n.TextStyle,n.FontSize,n.Color.configure({types:["textStyle"]}),d.TableKit.configure({table:{resizable:!0}}),m.Video,u.default],T=t.useEditor({content:q.modelValue,extensions:N,editable:q.editable&&!q.disabled,editorProps:{attributes:{class:k}},onUpdate:({editor:t})=>{if(e.unref(C))return;const i=t.getHTML();_("update:modelValue",i),_("change",i,t),E.value=t.storage.characterCount?.characters()||0,S(t)},onCreate:({editor:e})=>{_("init",e),E.value=e.storage.characterCount?.characters()||0},onFocus:()=>{y.value=!0,_("focus")},onBlur:()=>{y.value=!1,_("blur")},onSelectionUpdate:({editor:e})=>{S(e)}});return e.watch(()=>q.modelValue,e=>{T.value&&e!==T.value.getHTML()&&!C.value&&(C.value=!0,T.value.commands.setContent(e,!1),C.value=!1)}),e.watch(()=>q.disabled,e=>{T.value&&T.value.setEditable(!e&&q.editable)}),e.watch(()=>q.editable,e=>{T.value&&T.value.setEditable(e&&!q.disabled)}),g({editor:T}),(i,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["gsc-tiptap-editor",[i.disabled&&"bg-gray-100",i.isDarkMode&&"dark-theme"]])},[i.toolbar&&e.unref(T)?(e.openBlock(),e.createBlock(x.default,{key:0,editor:e.unref(T),disabled:i.disabled,"prefix-cls":e.unref(k)},{toolbar:e.withCtx(()=>[e.renderSlot(i.$slots,"toolbar",{},void 0,!0)]),_:3},8,["editor","disabled","prefix-cls"])):e.createCommentVNode("",!0),e.createVNode(e.unref(t.EditorContent),{class:e.normalizeClass(["gsc-tiptap-editor-content",[`${e.unref(k)}-content`]]),editor:e.unref(T)},null,8,["class","editor"]),e.createElementVNode("div",h,[e.createElementVNode("span",null,e.toDisplayString(V.value),1),e.createElementVNode("span",null,e.toDisplayString(E.value)+"字",1)])],2))}}),q=g.default(j,[["__scopeId","data-v-0e86ce6f"]]);exports.default=q;