bto-md-editor 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/md-editor.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.tooltip-wrapper[data-v-8b180ffc]{position:relative;display:inline-block}.tooltip[data-v-8b180ffc]{position:absolute;left:50%;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-8b180ffc]{opacity:1;visibility:visible}.tooltip.bottom[data-v-8b180ffc]{top:calc(100% + 6px)}.tooltip.top[data-v-8b180ffc]{bottom:calc(100% + 6px)}.shortcut[data-v-8b180ffc]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-6882ea42]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:#fff}.icon[data-v-6882ea42]:hover{background:#0000000d}.font-size[data-v-6882ea42]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-6882ea42]{font-size:15px;color:#333}.dropdown[data-v-6882ea42]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-6882ea42],.dropdown-slide-leave-to[data-v-6882ea42]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-6882ea42],.dropdown-slide-leave-active[data-v-6882ea42]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-6882ea42]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-6882ea42]:hover{background:#0000000d}.text[data-v-6882ea42]{flex:1}.icon[data-v-570f2a96]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-570f2a96]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-570f2a96]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-570f2a96]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-570f2a96]:hover{background:#0000000d}.underline[data-v-570f2a96]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-570f2a96]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-570f2a96]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-570f2a96],.dropdown-slide-leave-to[data-v-570f2a96]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-570f2a96],.dropdown-slide-leave-active[data-v-570f2a96]{transition:opacity .18s ease,transform .18s ease}.section[data-v-570f2a96]{margin-bottom:8px}.section-title[data-v-570f2a96]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-570f2a96]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-570f2a96]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-570f2a96]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-570f2a96]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-570f2a96]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-570f2a96]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-570f2a96]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-570f2a96]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-570f2a96]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-5ec8a99f]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-5ec8a99f]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-5ec8a99f]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-5ec8a99f]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-5ec8a99f]:hover{background:#0000000d}.underline[data-v-5ec8a99f]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-5ec8a99f]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-5ec8a99f]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-5ec8a99f]{margin-bottom:8px}.section-title[data-v-5ec8a99f]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-5ec8a99f]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-5ec8a99f]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-5ec8a99f]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-5ec8a99f]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-5ec8a99f]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-5ec8a99f]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-5ec8a99f]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-5ec8a99f]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-5ec8a99f]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-5ec8a99f],.dropdown-slide-leave-to[data-v-5ec8a99f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-5ec8a99f],.dropdown-slide-leave-active[data-v-5ec8a99f]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-3208357f]{position:relative}.image-input-panel[data-v-3208357f]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-3208357f]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-3208357f]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-3208357f]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-3208357f]:hover{background:#0000000d}.btn-primary[data-v-3208357f]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-3208357f]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-3208357f],.img-panel-leave-active[data-v-3208357f]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-3208357f],.img-panel-leave-to[data-v-3208357f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-3208357f],.img-panel-leave-from[data-v-3208357f]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-eef6665b]{position:relative}.video-input-panel[data-v-eef6665b]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-eef6665b]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-eef6665b]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-eef6665b]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-eef6665b]:hover{background:#0000000d}.btn-primary[data-v-eef6665b]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-eef6665b]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-eef6665b],.video-panel-leave-active[data-v-eef6665b]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-eef6665b],.video-panel-leave-to[data-v-eef6665b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-eef6665b],.video-panel-leave-from[data-v-eef6665b]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-b5bf35e2]{position:relative}.link-input-panel[data-v-b5bf35e2]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-b5bf35e2]{margin-bottom:8px}.label[data-v-b5bf35e2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-b5bf35e2]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-b5bf35e2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-b5bf35e2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-b5bf35e2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-b5bf35e2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-b5bf35e2],.link-panel-leave-active[data-v-b5bf35e2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-b5bf35e2],.link-panel-leave-to[data-v-b5bf35e2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-b5bf35e2],.link-panel-leave-from[data-v-b5bf35e2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-ad6f66b7]{position:relative}.table-panel[data-v-ad6f66b7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-ad6f66b7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-ad6f66b7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-ad6f66b7]{display:flex;gap:4px}.cell[data-v-ad6f66b7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-ad6f66b7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-ad6f66b7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-89ddb4db]{position:relative}.tools-panel[data-v-89ddb4db]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-89ddb4db]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-89ddb4db]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-0b74c17c]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0b74c17c]:hover{background:#0000000d}.icon[data-v-bf6f40c3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;color:#404040;position:relative}.icon[data-v-bf6f40c3]:hover{background:#0000000d}.heading-select[data-v-fceb28df]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.icon[data-v-fceb28df]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:60px;justify-content:space-between;background:#fff}.icon[data-v-fceb28df]:hover{background:#0000000d}.label[data-v-fceb28df]{font-size:15px;color:#333}.dropdown[data-v-fceb28df]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-fceb28df],.dropdown-slide-leave-to[data-v-fceb28df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-fceb28df],.dropdown-slide-leave-active[data-v-fceb28df]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-fceb28df]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-fceb28df]:hover{background:#0000000d}.item-label[data-v-fceb28df]{flex:1;color:#222}.item-label.paragraph[data-v-fceb28df]{font-size:15px}.item-label.level-1[data-v-fceb28df]{font-size:22px;font-weight:600}.item-label.level-2[data-v-fceb28df]{font-size:20px;font-weight:600}.item-label.level-3[data-v-fceb28df]{font-size:18px;font-weight:600}.item-label.level-4[data-v-fceb28df]{font-size:16px}.item-label.level-5[data-v-fceb28df]{font-size:15px}.item-label.level-6[data-v-fceb28df]{font-size:14px}.shortcut[data-v-fceb28df]{color:#999;font-size:12px}.header_box[data-v-6cce30ab]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box .icon[data-v-6cce30ab]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.header_box .icon[data-v-6cce30ab]:hover{background:#0000000d}.header_box .icon.active[data-v-6cce30ab]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-6cce30ab]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-c9ed96a6]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.editor_wrapper[data-v-c9ed96a6]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-c9ed96a6]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-c9ed96a6]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-c9ed96a6]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-c9ed96a6]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-c9ed96a6]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-c9ed96a6]{background:#22c55e}.content[data-v-c9ed96a6]{padding:12px 24px}.content[data-v-c9ed96a6] img{max-width:100%;height:auto;display:inline-block}.content[data-v-c9ed96a6] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-c9ed96a6] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-c9ed96a6] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-c9ed96a6 .18s ease both}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-c9ed96a6 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-c9ed96a6{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-c9ed96a6{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;margin-top:2px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-c9ed96a6] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c9ed96a6] [data-resize-wrapper]{display:inline-block}.content[data-v-c9ed96a6] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-c9ed96a6] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover>img,.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c9ed96a6] .tiptap-resize-wrapper{position:relative}.content[data-v-c9ed96a6] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-c9ed96a6] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-c9ed96a6] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-c9ed96a6] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-c9ed96a6] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-c9ed96a6 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-c9ed96a6{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-c9ed96a6] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-c9ed96a6] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-c9ed96a6] .ProseMirror table th,.content[data-v-c9ed96a6] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-c9ed96a6] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-c9ed96a6] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-c9ed96a6] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-c9ed96a6] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-c9ed96a6] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-c9ed96a6] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-c9ed96a6] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-c9ed96a6] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-c9ed96a6] p{margin:12px 0}[data-v-c9ed96a6] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid #e5e7eb;cursor:grab;z-index:5}[data-v-c9ed96a6] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-c9ed96a6]{grid-template-columns:1fr}.outline-markers[data-v-c9ed96a6]{display:none}}.link-modal-backdrop[data-v-c9ed96a6]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-c9ed96a6]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-c9ed96a6]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-c9ed96a6]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-c9ed96a6]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-c9ed96a6]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-c9ed96a6]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-c9ed96a6]{display:block;width:640px;height:auto}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
(function(j,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/vue-3"),require("@tiptap/starter-kit"),require("@tiptap/markdown"),require("@tiptap/extension-image"),require("@tiptap/core"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-link"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-color"),require("@tiptap/extension-underline"),require("@tiptap/extension-table"),require("@tiptap/extensions"),require("@tiptap/extension-list")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/vue-3","@tiptap/starter-kit","@tiptap/markdown","@tiptap/extension-image","@tiptap/core","@tiptap/extension-placeholder","@tiptap/extension-link","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-underline","@tiptap/extension-table","@tiptap/extensions","@tiptap/extension-list"],e):(j=typeof globalThis<"u"?globalThis:j||self,e(j.MdEditor={},j.Vue,j.tiptapVue3,j.StarterKit,j.tiptapMarkdown,j.tiptapImage,j.tiptapCore,j.tiptapPlaceholder,j.tiptapLink,j.tiptapTextAlign,j.tiptapTextStyle,j.tiptapColor,j.tiptapUnderline,j.tiptapTable,j.extensions,j.extensionList))})(this,function(j,e,Ce,ze,$e,ve,de,Se,Te,Fe,fe,je,He,ye,De,be){"use strict";var Ee;function Ae(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const me=Ae(de),Ue=ve.Image.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:s=>s.getAttribute("data-uploading")?!0:null,renderHTML:s=>s.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:s=>{const n=s.getAttribute("width")||s.style.width||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:s=>s.width?{width:s.width}:{}},height:{default:null,parseHTML:s=>{const n=s.getAttribute("height")||s.style.height||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:s=>s.height?{height:s.height}:{}}}},addNodeView(){return({node:t,getPos:s,editor:n})=>{const o=document.createElement("img"),l=t.attrs;o.src=l.src||"",l.alt&&(o.alt=l.alt),l.title&&(o.title=l.title),typeof l.width=="number"&&(o.style.width=`${l.width}px`),typeof l.height=="number"&&(o.style.height=`${l.height}px`),o.style.maxWidth="100%",o.style.height=o.style.height||"auto",o.style.display="inline-block";const h=new de.ResizableNodeView({element:o,node:t,getPos:s,onResize:(V,y)=>{o.style.width=`${V}px`,o.style.height=`${y}px`},onCommit:(V,y)=>{try{const u=n,w=s();if(w!==void 0){const{state:b}=u,g=b.schema.nodes.image,a=b.doc.nodeAt(w);if(g&&a){const f={...a.attrs||{},width:V,height:y},c=b.tr.setNodeMarkup(w,g,f,a.marks);u.view.dispatch(c)}}}catch{}},onUpdate:V=>{const y=V.attrs;return typeof y.src=="string"&&y.src&&o.src!==y.src&&(o.src=y.src),typeof y.width=="number"&&(o.style.width=`${y.width}px`),typeof y.height=="number"&&(o.style.height=`${y.height}px`),y.uploading?h.wrapper.setAttribute("data-uploading","true"):h.wrapper.removeAttribute("data-uploading"),!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:32,height:32},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});try{h.container.style.display="inline-block",h.wrapper.style.display="inline-block"}catch{}const N=document.createElement("div");N.className="tiptap-upload-mask";const d=document.createElement("div");return d.className="tiptap-upload-progress",N.appendChild(d),h.wrapper.appendChild(N),l.uploading&&h.wrapper.setAttribute("data-uploading","true"),h}}}),We=ye.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:s=>s.getAttribute("data-background-color"),renderHTML:s=>{const n=s.backgroundColor;return n?{"data-background-color":n,style:`background-color: ${n}`}:{}}}}}}),Ie=(((Ee=me==null?void 0:me.Node)==null?void 0:Ee.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!0,selectable:!0,addAttributes(){return{src:{default:null},controls:{default:!0},autoplay:{default:!1},loop:{default:!1},muted:{default:!1},poster:{default:null},playsinline:{default:!0},uploading:{default:null,parseHTML:t=>t.getAttribute("data-uploading")?!0:null,renderHTML:t=>t.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:t=>{const s=t.getAttribute("width")||t.style.width||"",n=String(s).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const s=t.getAttribute("height")||t.style.height||"",n=String(s).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.height?{height:t.height}:{}},class:{default:"tiptap-video"}}},parseHTML(){return[{tag:"video[data-tiptap-video]"},{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",{"data-tiptap-video":"",...t}]},renderMarkdown(t){const s=(t==null?void 0:t.attrs)||{},n=typeof s.src=="string"?s.src:"";return n?`[video](${n})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const s=/^\[video\]\(([^)]+)\)/.exec(t);if(s)return{type:"video",raw:s[0],href:s[1]}}},parseMarkdown(t){const s=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return s?{type:"video",attrs:{src:s,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:s,editor:n})=>{var V;const o=document.createElement("video"),l=t.attrs;o.src=l.src||"",o.controls=l.controls!==!1,o.autoplay=!1,o.loop=!!l.loop,o.muted=!!l.muted,l.poster&&(o.poster=l.poster),o.setAttribute("playsinline","true"),l.class&&(o.className=String(l.class)),typeof l.width=="number"&&(o.style.width=`${l.width}px`),typeof l.height=="number"&&(o.style.height=`${l.height}px`),o.style.display="inline-block";const h=new de.ResizableNodeView({element:o,node:t,getPos:s,onResize:(y,u)=>{o.style.width=`${y}px`,o.style.height=`${u}px`},onCommit:(y,u)=>{try{const w=n,b=s();if(b!==void 0){const{state:g}=w,a=g.schema.nodes.video,f=g.doc.nodeAt(b);if(a&&f){const c={...f.attrs||{},width:y,height:u},x=g.tr.setNodeMarkup(b,a,c,f.marks);w.view.dispatch(x)}}}catch{}},onUpdate:y=>{const u=y.attrs||{};if(typeof u.src=="string"&&u.src&&o.src!==u.src&&(o.src=u.src),typeof u.width=="number"&&(o.style.width=`${u.width}px`),typeof u.height=="number"&&(o.style.height=`${u.height}px`),u.uploading){h.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}else h.wrapper.removeAttribute("data-uploading"),o.controls=u.controls!==!1,o.style.pointerEvents="";return!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:120,height:80},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});try{h.container.style.display="inline-block",h.wrapper.style.display="inline-block"}catch{}const N=document.createElement("div");N.className="tiptap-upload-mask";const d=document.createElement("div");if(d.className="tiptap-upload-progress",N.appendChild(d),h.wrapper.appendChild(N),(V=t.attrs)!=null&&V.uploading){h.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}return h}},addCommands(){return{setVideo:t=>({chain:s})=>{const{src:n,HTMLAttributes:o={}}=t||{};return s().insertContent({type:this.name,attrs:{src:n,...o}}).run()}}}}),Oe=be.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:s,getPos:n})=>{const o=document.createElement("li");o.setAttribute("data-type","taskItem"),o.setAttribute("data-checked",t.attrs.checked?"true":"false");const l=document.createElement("span");l.className="todo-box",l.tabIndex=0,l.setAttribute("role","checkbox"),l.setAttribute("aria-checked",t.attrs.checked?"true":"false"),l.addEventListener("mousedown",d=>d.preventDefault());const h=()=>{const d=typeof n=="function"?n():null;if(d==null)return{pos:null,n:null};const V=s.view.state.doc.nodeAt(d);return{pos:d,n:V}};l.addEventListener("click",()=>{var g;const{pos:d,n:V}=h();if(d==null||!V)return;const y=s.view.state,u=y.schema.nodes.taskItem,w=!!((g=V.attrs)!=null&&g.checked),b=y.tr.setNodeMarkup(d,u,{...V.attrs||{},checked:!w});s.view.dispatch(b)}),l.addEventListener("keydown",d=>{var V;if(d.key==="Enter"||d.key===" "){d.preventDefault();const{pos:y,n:u}=h();if(y==null||!u)return;const w=s.view.state,b=w.schema.nodes.taskItem,g=!!((V=u.attrs)!=null&&V.checked),a=w.tr.setNodeMarkup(y,b,{...u.attrs||{},checked:!g});s.view.dispatch(a)}});const N=document.createElement("div");return N.className="task-content",o.appendChild(l),o.appendChild(N),{dom:o,contentDOM:N,update(d){return d.type!==t.type?!1:(o.setAttribute("data-checked",d.attrs.checked?"true":"false"),l.setAttribute("aria-checked",d.attrs.checked?"true":"false"),!0)}}}}});var Re={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Pe(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Ge(t,s,n){var o=typeof s.fill=="string"?[s.fill]:s.fill||[],l=[],h=s.theme||n.theme;switch(h){case"outline":l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push("none"),l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push("none");break;case"filled":l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push("#FFF"),l.push("#FFF");break;case"two-tone":l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone),l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone);break;case"multi-color":l.push(typeof o[0]=="string"?o[0]:"currentColor"),l.push(typeof o[1]=="string"?o[1]:n.colors.multiColor.outFillColor),l.push(typeof o[2]=="string"?o[2]:n.colors.multiColor.innerStrokeColor),l.push(typeof o[3]=="string"?o[3]:n.colors.multiColor.innerFillColor);break}return{size:s.size||n.size,strokeWidth:s.strokeWidth||n.strokeWidth,strokeLinecap:s.strokeLinecap||n.strokeLinecap,strokeLinejoin:s.strokeLinejoin||n.strokeLinejoin,colors:l,id:t}}var qe=Symbol("icon-context");function U(t,s,n){var o={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(h){var N=Pe(),d=e.inject(qe,Re);return function(){var V=h.size,y=h.strokeWidth,u=h.strokeLinecap,w=h.strokeLinejoin,b=h.theme,g=h.fill,a=h.spin,f=Ge(N,{size:V,strokeWidth:y,strokeLinecap:u,strokeLinejoin:w,theme:b,fill:g},d),c=[d.prefix+"-icon"];return c.push(d.prefix+"-icon-"+t),s&&d.rtl&&c.push(d.prefix+"-icon-rtl"),a&&c.push(d.prefix+"-icon-spin"),e.createVNode("span",{class:c.join(" ")},[n(f)])}}};return o}const Ye=U("align-text-both",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 19H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 39H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Ke=U("align-text-center",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19H12",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M36 39H12",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Ze=U("align-text-left",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M34 19H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M34 39H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Je=U("align-text-right",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 19H14",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 39H14",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),oe=U("check",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M43 11L16.875 37L5 25.1818",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),se=U("down-one",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19L24 31L12 19H36Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null)])}),Xe=U("font-size-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M4 44L24 4L44 44",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 28H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Qe=U("go-on",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 7L43 13.4615L36 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M40 14H17.0062C10.1232 14 4.27787 19.6204 4.00964 26.5C3.72612 33.7696 9.73291 40 17.0062 40H34.0016",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),et=U("list-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9 42C11.2091 42 13 40.2091 13 38C13 35.7909 11.2091 34 9 34C6.79086 34 5 35.7909 5 38C5 40.2091 6.79086 42 9 42Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 14C11.2091 14 13 12.2092 13 10C13 7.79086 11.2091 6 9 6C6.79086 6 5 7.79086 5 10C5 12.2092 6.79086 14 9 14Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 28C11.2091 28 13 26.2092 13 24C13 21.7908 11.2091 20 9 20C6.79086 20 5 21.7908 5 24C5 26.2092 6.79086 28 9 28Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 38H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 10H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),tt=U("ordered-list",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9 4V13",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 13H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 27H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 19.9998C6 19.9998 9 16.9998 11 19.9998C13 22.9999 6 26.9998 6 26.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6.00016 34.5001C6.00016 34.5001 8.00016 31.5 11.0002 33.5C14.0002 35.5 11.0002 38 11.0002 38C11.0002 38 14.0002 40.5 11.0002 42.5C8.00015 44.5 6.00015 41.5 6.00015 41.5",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M11 38H9",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 4L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 38H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 10H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=U("preview-close-one",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 42L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),nt=U("pushpin",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M32 4H16L20 7L16 20C16 20 10 24 10 28H20L24 44L28 28H38C38 24 34 21.1667 32 20L28 7L32 4Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=U("return",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=U("strikethrough",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M5 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M24 24C40 30 34 44 24 44C13.9999 44 12 36 12 36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M35.9999 12C35.9999 12 33 4 23.9999 4C14.9999 4 11.4359 11.5995 15.6096 18",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 36C12 36 15.9999 44 24 44C32 44 36.564 36.4005 32.3903 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),lt=U("text-bold",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 24C29.5056 24 33.9688 19.5228 33.9688 14C33.9688 8.47715 29.5056 4 24 4H11V24H24Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.0312 44C33.5368 44 38 39.5228 38 34C38 28.4772 33.5368 24 28.0312 24H11V44H28.0312Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=U("text-italic",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M20 6H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 42H28",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M29 5.95215L19 41.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=U("text-underline",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M8 44H40",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M37 6.09717C37 12.7638 37 15.3335 37 22.0002C37 29.1799 31.1797 35.0002 24 35.0002C16.8203 35.0002 11 29.1799 11 22.0002C11 15.3335 11 12.7638 11 6.09717",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap},null)])}),ct={class:"label"},dt={key:0,class:"shortcut"},ft=e.defineComponent({__name:"Tooltip",props:{text:{type:String,required:!0},shortcut:{type:String,default:""},placement:{type:String,default:"bottom"},offset:{type:Number,default:6}},setup(t){const s=t,n=e.ref(null),o=e.ref(null),l=e.ref(!1),h=e.ref(s.placement);function N(){const y=n.value,u=o.value;if(!y||!u)return;let w=s.placement;const b=u.getBoundingClientRect(),g=b.top,a=window.innerHeight-b.bottom,f=y.offsetHeight+s.offset;w==="bottom"?a<f&&g>=f&&(w="top"):g<f&&a>=f&&(w="bottom"),h.value=w}function d(){l.value=!0,e.nextTick(N)}function V(){l.value=!1}return e.onMounted(()=>{window.addEventListener("resize",N)}),e.watch(()=>s.text,()=>e.nextTick(N)),(y,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:o,class:"tooltip-wrapper",onMouseenter:d,onMouseleave:V,onFocusin:d,onFocusout:V},[e.renderSlot(y.$slots,"default",{},void 0,!0),e.createElementVNode("div",{ref_key:"tipRef",ref:n,class:e.normalizeClass(["tooltip",[h.value,{visible:l.value}]])},[e.createElementVNode("div",ct,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],2)],544))}}),I=(t,s)=>{const n=t.__vccOpts||t;for(const[o,l]of s)n[o]=l;return n},q=I(ft,[["__scopeId","data-v-8b180ffc"]]),mt=["aria-expanded"],ht={class:"label"},ut={key:0,class:"dropdown",role:"listbox"},pt=["aria-selected","onClick"],kt={class:"text"},he="md-toolbar-dropdown-open",xe="font-size-select",gt=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],o=e.computed(()=>{var b,g;const w=(g=(b=s.editor)==null?void 0:b.getAttributes("textStyle"))==null?void 0:g.fontSize;return typeof w=="string"&&w?w:"15px"}),l=e.ref(!1),h=e.ref(null);function N(){l.value||window.dispatchEvent(new CustomEvent(he,{detail:{id:xe}})),l.value=!l.value}function d(){l.value=!1}function V(w){var b;(b=s.editor)==null||b.chain().focus().setMark("textStyle",{fontSize:w}).run(),d()}function y(w){const b=w.target,g=h.value;g&&!g.contains(b)&&d()}e.onMounted(()=>{document.addEventListener("click",y),window.addEventListener(he,u)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",y),window.removeEventListener(he,u)});function u(w){var g;((g=w.detail)==null?void 0:g.id)!==xe&&(l.value=!1)}return(w,b)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:h},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":l.value},[e.createElementVNode("div",ht,e.toDisplayString(o.value),1),e.createVNode(e.unref(se),{theme:"filled",strokeWidth:3})],8,mt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",ut,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,g=>e.createElementVNode("div",{key:g,class:"dropdown-item","aria-selected":g===o.value,onClick:e.withModifiers(a=>V(g),["stop"])},[g===o.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",kt,e.toDisplayString(g),1)],8,pt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-6882ea42"]]),wt=["aria-expanded"],Ct={key:0,class:"dropdown"},yt={class:"section"},bt={class:"swatches"},xt=["onClick"],Vt={class:"section"},Nt={class:"swatches grid"},_t=["onClick"],Lt={key:0,class:"section"},Et={class:"swatches"},Mt=["onClick"],Bt={class:"section inline-actions"},zt={key:1,class:"advanced"},ue="md-toolbar-dropdown-open",Ve="color-select",$t=I(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const s=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),l=e.ref(!1),h=e.ref(null),N=e.ref(s.currentColor||"#000000"),d=e.ref(c()),V=e.ref("#F5222D");function y(){o.value||window.dispatchEvent(new CustomEvent(ue,{detail:{id:Ve}})),o.value=!o.value}function u(){o.value=!1}function w(){l.value=!l.value}function b(r){var i;(i=s.editor)==null||i.chain().focus().setColor(r).run(),V.value=r,x(r),u()}function g(){var r;(r=s.editor)==null||r.chain().focus().unsetColor().run(),u()}function a(r){const i=r.target,m=h.value;m&&!m.contains(i)&&u()}function f(){}function c(){try{const r=localStorage.getItem("md_color_recent");if(!r)return[];const i=JSON.parse(r);return Array.isArray(i)?i.slice(0,12):[]}catch{return[]}}function x(r){const i=[r,...d.value.filter(m=>m!==r)];d.value=i.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(d.value))}catch{}}let k=[];function E(){const r=s.editor;r&&(k=[{event:"selectionUpdate",handler:f},{event:"transaction",handler:f},{event:"update",handler:f}],k.forEach(({event:i,handler:m})=>{r.on(i,m)}))}e.onMounted(()=>{document.addEventListener("click",a),window.addEventListener(ue,_),E()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",a),window.removeEventListener(ue,_);const r=s.editor;r&&k.forEach(({event:i,handler:m})=>{r.off(i,m)}),k=[]}),e.watch(()=>s.editor,(r,i)=>{i&&k.forEach(({event:m,handler:M})=>{i.off(m,M)}),k=[],E()});function _(r){var m;((m=r.detail)==null?void 0:m.id)!==Ve&&(o.value=!1)}return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:h},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:i[0]||(i[0]=e.withModifiers(m=>b(V.value),["stop"]))},[e.createVNode(e.unref(Xe),{theme:"filled",size:"14",fill:"#000",strokeWidth:3}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:V.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(y,["stop"])},[e.createVNode(e.unref(se),{theme:"filled",strokeWidth:3,size:"12"})])],8,wt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Ct,[e.createElementVNode("div",yt,[i[4]||(i[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},[m===V.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,xt))),128))])]),e.createElementVNode("div",Vt,[i[5]||(i[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},[m===V.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,_t))),128))])]),d.value.length?(e.openBlock(),e.createElementBlock("div",Lt,[i[6]||(i[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},null,12,Mt))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(g,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(w,["stop"])},"更多颜色")]),l.value?(e.openBlock(),e.createElementBlock("div",zt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i[1]||(i[1]=m=>N.value=m)},null,512),[[e.vModelText,N.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":i[2]||(i[2]=m=>N.value=m)},null,512),[[e.vModelText,N.value]]),e.createElementVNode("button",{class:"btn apply",onClick:i[3]||(i[3]=e.withModifiers(m=>b(N.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-570f2a96"]]),vt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763479929532" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52528" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M621.568 208.299a38.101 38.101 0 0 0-73.941-18.518L386.773 833.28a38.101 38.101 0 0 0 73.899 18.475l160.853-643.456zM325.632 294.4a38.101 38.101 0 0 1 0 53.888L162.347 511.573 325.632 674.86a38.101 38.101 0 0 1-53.845 53.888L81.493 538.539a38.101 38.101 0 0 1 0-53.931L271.787 294.4a38.101 38.101 0 0 1 53.888 0z m372.736 0a38.101 38.101 0 0 0 0 53.888l163.285 163.285L698.368 674.86a38.101 38.101 0 0 0 53.888 53.888l190.25-190.208a38.101 38.101 0 0 0 0-53.931L752.257 294.4a38.101 38.101 0 0 0-53.888 0z" fill="#333333" p-id="52529"></path></svg>',St='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480012496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="54461" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M338.986667 59.413333h52.586666a21.333333 21.333333 0 0 1 21.333334 21.333334V115.84a21.333333 21.333333 0 0 1-21.333334 21.333333H356.266667c-36.48 0-53.76 20.16-53.76 62.4v188.16c0 59.52-27.84 99.84-82.56 120 54.72 23.04 82.56 62.4 82.56 120v189.12c0 40.32 17.28 61.44 53.76 61.44h35.306666a21.333333 21.333333 0 0 1 21.333334 21.333334v35.093333a21.333333 21.333333 0 0 1-21.333334 21.333333H338.986667c-42.24 0-74.88-14.4-97.92-41.28-21.12-24.96-31.68-59.52-31.68-101.76v-180.48c0-27.84-5.76-48-17.28-60.48-11.178667-12.778667-29.653333-20.245333-55.466667-23.488a18.901333 18.901333 0 0 1-16.533333-18.773333v-43.221333c0-10.005333 7.381333-18.474667 17.28-19.84 25.408-3.498667 43.648-11.456 54.72-23.317334 11.52-13.44 17.28-33.6 17.28-60.48V203.413333c0-43.2 10.56-77.76 31.68-102.72 23.04-27.84 55.68-41.28 97.92-41.28z m292.48 0h52.586666c42.24 0 74.88 13.44 97.92 41.28 21.12 24.96 31.68 59.52 31.68 102.72v179.52c0 26.88 5.76 48 18.24 61.44 10.24 11.029333 28.224 18.816 53.418667 22.314667 10.112 1.408 17.621333 10.026667 17.621333 20.245333v40.746667a21.333333 21.333333 0 0 1-18.88 21.184c-24.576 3.413333-42.282667 10.794667-53.12 23.189333-11.52 12.48-17.28 32.64-17.28 60.48v180.48c0 42.24-10.56 76.8-31.68 101.76-23.04 26.88-55.68 41.28-97.92 41.28H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V899.626667a21.333333 21.333333 0 0 1 21.333334-21.333334h35.306666c35.52 0 53.76-21.12 53.76-61.44v-189.12c0-57.6 26.88-96.96 82.56-120-55.68-20.16-82.56-60.48-82.56-120v-188.16c0-42.24-18.24-62.4-53.76-62.4H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V80.746667a21.333333 21.333333 0 0 1 21.333334-21.333334z" fill="#000000" p-id="54462"></path></svg>',Tt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763473363174" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28322" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M957.610667 507.434667L603.221333 158.293333a7.893333 7.893333 0 0 0-11.221333 0L353.28 393.386667a8.021333 8.021333 0 0 0-0.085333 11.306666l0.085333 0.128 40.021333 39.381334-117.205333 115.285333a8.021333 8.021333 0 0 0-0.085333 11.306667l0.085333 0.128 39.509333 38.869333-189.098666 187.008H72.106667a8.106667 8.106667 0 0 0-8.106667 8.021333v55.168c0 4.394667 3.584 8.021333 8.021333 8.021334H416.853333c2.133333 0 4.096-0.810667 5.589334-2.304l76.117333-75.605334 40.405333 39.808a7.936 7.936 0 0 0 11.178667 0l117.12-115.626666 40.106667 39.509333a7.893333 7.893333 0 0 0 11.178666 0l238.72-235.178667a7.68 7.68 0 0 0 0.298667-11.221333z m-567.808 288.853333H229.546667l134.4-133.034667 80.128 78.933334-54.314667 54.058666z m154.794666-62.122667l-171.392-168.917333 68.608-67.584 171.392 168.874667-68.608 67.626666z m168.533334-76.117333l-262.826667-258.901333 147.285333-145.066667 262.826667 258.986667-147.328 144.981333z" fill="#999999" p-id="28323"></path></svg>',Ft='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480451042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="58395" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="58396"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480387136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="57289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M213.972 214.906l0.934-0.934c27.606-27.606 68.674-30.581 92.168-7.087l225.23 225.23c29.72-40.254 30.733-93.311-0.599-124.643L345.639 121.406c-35.132-35.132-97.076-30.148-138.356 11.132l-74.744 74.744c-41.28 41.28-46.264 103.224-11.132 138.356l186.065 186.065c31.332 31.332 84.389 30.319 124.643 0.599l-225.23-225.23c-23.494-23.492-20.519-64.56 7.087-92.166zM808.745 809.679l0.934-0.934c27.606-27.606 31.18-68.074 7.686-91.568l-225.23-225.23c40.254-29.72 93.311-30.733 124.643 0.599l186.065 186.065c35.132 35.132 29.548 96.477-11.732 137.757l-74.744 74.744c-41.28 41.28-102.625 46.863-137.757 11.732L492.546 716.779c-31.332-31.332-31.909-82.799-0.599-124.643l225.23 225.23c23.494 23.494 63.962 19.92 91.568-7.687z" fill="#666666" p-id="57290"></path><path d="M627.123 628.713c-12.296 12.296-32.232 12.296-44.528 0L394.938 441.057c-12.296-12.296-12.296-32.232 0-44.528s32.232-12.296 44.528 0l187.656 187.656c12.297 12.296 12.297 32.232 0.001 44.528z" fill="#666666" p-id="57291"></path></svg>',Ht='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480239307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="56277" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M849.6 231v109.5c-46.4 14.9-84.6 41.5-114.4 81.3-29.9 36.5-44.8 76.3-43.1 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 91.2 36.5 23.2 24.9 36.5 56.4 36.5 94.5S848 732 821.5 756.8C795 780 761.8 793.3 722 793.3c-46.4 0-82.9-19.9-112.8-56.4s-43.1-84.6-43.1-141c0-89.6 24.9-165.8 76.3-230.5C692 299 761.7 254.2 849.6 231z m-403 0v109.5c-46.4 14.9-82.9 41.5-112.8 81.3-31.5 36.5-46.4 76.3-44.8 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 89.6 36.5 24.9 24.9 38.1 56.4 38.1 94.5s-13.3 69.7-38.1 94.5c-26.5 23.2-61.4 36.5-101.2 36.5-46.4 0-82.9-19.9-111.1-56.4-29.9-36.5-44.8-84.6-44.8-141 0-89.6 24.9-165.8 76.3-230.5C289 299 358.7 254.2 446.6 231z" p-id="56278"></path></svg>',Dt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480808376" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="61532" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M959.825 384.002V191.94c0-70.692-57.308-128-128-128H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V384.002z m-813.16-237.337a63.738 63.738 0 0 1 45.336-18.785H832a63.962 63.962 0 0 1 63.886 64.121v128.061H127.88v-128.06a63.738 63.738 0 0 1 18.785-45.337z m269.127 461.308v-223.97h192.181v223.97H415.792z m192.181 63.94v223.972H415.792V671.914h192.181z m-256.121-63.94H127.88v-223.97h223.972v223.97zM146.665 877.21a63.467 63.467 0 0 1-18.785-45.21V671.914h223.972v223.97h-159.85a63.626 63.626 0 0 1-45.337-18.675z m749.22-45.21a63.763 63.763 0 0 1-63.886 63.886H671.914V671.914h223.97v160.085z m0-224.026H671.914v-223.97h223.97v223.97z" p-id="61533"></path></svg>',At='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480994147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="73821" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M933.529779 1022.701142H87.673207c-48.357498 0-87.523075-39.165577-87.523075-87.523076V1.798419h729.259049c48.357498 0 87.523075 39.165577 87.523076 87.523076v320.818031h204.220509V935.178066c-0.099912 48.357498-39.265489 87.523075-87.622987 87.523076z m-175.046151-904.205289c0-32.171724-26.077081-58.348717-58.348717-58.348717H58.498849v845.856572c0 32.171724 26.077081 58.348717 58.348717 58.348717h583.387257c32.171724 0 58.348717-26.077081 58.348717-58.348717V118.495853zM962.704137 468.588155h-145.871792v495.864182h87.523075c32.171724 0 58.348717-26.077081 58.348717-58.348717V468.588155z m-729.25905 0h379.166748v58.348717H233.445087V468.588155z m0-233.394868h379.166748v58.348717H233.445087v-58.348717z m262.569227 525.03854H233.445087v-58.348716h262.469314v58.348716z m0 0" p-id="73822"></path></svg>',Ut='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763477549677" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31202" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M828.6 75C889.572 75 939 124.428 939 185.4v676.2c0 60.972-49.428 110.4-110.4 110.4H152.4C91.428 972 42 922.572 42 861.6V185.4C42 124.428 91.428 75 152.4 75z m0 59.8H152.4c-27.946 0-50.6 22.654-50.6 50.6v676.2c0 27.946 22.654 50.6 50.6 50.6h676.2c27.946 0 50.6-22.654 50.6-50.6V185.4c0-27.946-22.654-50.6-50.6-50.6z m-20.56 167.48c11.48 11.504 11.641 30.022 0.502 41.725l-0.548 0.56L477.473 674.37c-11.251 11.227-29.274 11.663-41.05 1.123l-0.574-0.527L260.695 509.93c-12.018-11.325-12.581-30.248-1.257-42.266 11.145-11.828 29.65-12.56 41.69-1.788l0.577 0.53L455.756 611.56l310-309.325c11.689-11.664 30.62-11.644 42.284 0.045z" fill="#333333" p-id="31203"></path></svg>',Wt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480631673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="60480" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M960 192h-28.384c-16.8 0-32.928 6.624-44.928 18.432L800 295.936V256a96 96 0 0 0-96-96H96C43.072 160 0 203.04 0 256v512a96 96 0 0 0 96 96h608c52.992 0 96-43.008 96-96v-39.072l86.688 85.504c12 11.808 28.128 18.432 44.928 18.432H960a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64zM96 800c-17.664 0-32-14.368-32-32V256a32 32 0 0 1 32-32h608c17.632 0 32 14.336 32 32v512c0 17.632-14.368 32-32 32H96z m864-31.136h-32l-128-128V640l-32-32v-192l160-160h32v512.864z" fill="#333333" p-id="60481"></path></svg>',It=["innerHTML"],K=I(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const s=t,n=e.useAttrs(),o=Object.assign({"/src/svg/code.svg":vt,"/src/svg/codeBlock.svg":St,"/src/svg/highBg.svg":Tt,"/src/svg/img.svg":Ft,"/src/svg/link.svg":jt,"/src/svg/quote.svg":Ht,"/src/svg/table.svg":Dt,"/src/svg/tableTools.svg":At,"/src/svg/task.svg":Ut,"/src/svg/video.svg":Wt}),l=(()=>{const u={};return Object.entries(o).forEach(([w,b])=>{const a=(w.split("/src/svg/")[1]||w).replace(/\.svg$/i,"");u[a]=b;const f=a.split("/").pop();f&&(u[f]=b)}),u})(),h=e.computed(()=>{const u=s.name.replace(/\.svg$/i,"");return l[u]||""});function N(u){if(!u)return"";let w=u.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return w=w.replace(/<svg([^>]*)>/i,(b,g)=>`<svg${g.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),w=w.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),w=w.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),w}const d=e.computed(()=>N(h.value));function V(u){if(u!=null)return typeof u=="number"?`${u}px`:u}const y=e.computed(()=>{const u={},w=V(s.size);w&&(u.fontSize=w),s.color&&(u.color=s.color);const b=n.style??void 0;return[u,b].filter(Boolean)});return(u,w)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(n).class]),style:e.normalizeStyle(y.value),innerHTML:d.value},null,14,It))}}),[["__scopeId","data-v-c83ef2e3"]]),Ot=["aria-expanded"],Rt={key:0,class:"dropdown"},Pt={class:"section"},Gt={class:"swatches"},qt={class:"section"},Yt={class:"swatches"},Kt=["onClick"],Zt={key:0,class:"check"},Jt={class:"section"},Xt={class:"swatches grid"},Qt=["onClick"],eo={key:0,class:"section"},to={class:"swatches"},oo=["onClick"],no={class:"section inline-actions"},io={key:1,class:"advanced"},pe="md-toolbar-dropdown-open",Ne="bg-color-select",ro=I(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const s=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),l=e.ref(!1),h=e.ref(null),N=e.ref(s.currentBg||"#ffffff"),d=e.ref(c()),V=e.ref("#FADB14");function y(){o.value||window.dispatchEvent(new CustomEvent(pe,{detail:{id:Ne}})),o.value=!o.value}function u(){o.value=!1}function w(){l.value=!l.value}function b(r){var i;(i=s.editor)==null||i.chain().focus().setMark("textStyle",{backgroundColor:r}).run(),V.value=r,x(r),u()}function g(){var r;(r=s.editor)==null||r.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),u()}function a(r){const i=r.target,m=h.value;m&&!m.contains(i)&&u()}function f(){}function c(){try{const r=localStorage.getItem("md_bg_recent");if(!r)return[];const i=JSON.parse(r);return Array.isArray(i)?i.slice(0,12):[]}catch{return[]}}function x(r){const i=[r,...d.value.filter(m=>m!==r)];d.value=i.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(d.value))}catch{}}let k=[];function E(){const r=s.editor;r&&(k=[{event:"selectionUpdate",handler:f},{event:"transaction",handler:f},{event:"update",handler:f}],k.forEach(({event:i,handler:m})=>{r.on(i,m)}))}e.onMounted(()=>{document.addEventListener("click",a),window.addEventListener(pe,_),E()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",a),window.removeEventListener(pe,_);const r=s.editor;r&&k.forEach(({event:i,handler:m})=>{r.off(i,m)}),k=[]}),e.watch(()=>s.editor,(r,i)=>{i&&k.forEach(({event:m,handler:M})=>{i.off(m,M)}),k=[],E()});function _(r){var m;((m=r.detail)==null?void 0:m.id)!==Ne&&(o.value=!1)}return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:h},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:i[0]||(i[0]=e.withModifiers(m=>b(V.value),["stop"]))},[e.createVNode(K,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:V.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(y,["stop"])},[e.createVNode(e.unref(se),{theme:"filled",strokeWidth:3,size:"12"})])],8,Ot),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Rt,[e.createElementVNode("div",Pt,[i[4]||(i[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",Gt,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.tooltip-wrapper[data-v-8b180ffc]{position:relative;display:inline-block}.tooltip[data-v-8b180ffc]{position:absolute;left:50%;transform:translate(-50%);background:#3c3c3cf2;color:#fff;border-radius:8px;padding:6px 8px;font-size:12px;line-height:1.2;box-shadow:0 6px 20px #0003;white-space:nowrap;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s ease;pointer-events:none;z-index:1000}.tooltip.visible[data-v-8b180ffc]{opacity:1;visibility:visible}.tooltip.bottom[data-v-8b180ffc]{top:calc(100% + 6px)}.tooltip.top[data-v-8b180ffc]{bottom:calc(100% + 6px)}.shortcut[data-v-8b180ffc]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-6882ea42]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:50px;justify-content:space-between;background:#fff}.icon[data-v-6882ea42]:hover{background:#0000000d}.font-size[data-v-6882ea42]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-6882ea42]{font-size:15px;color:#333}.dropdown[data-v-6882ea42]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-6882ea42],.dropdown-slide-leave-to[data-v-6882ea42]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-6882ea42],.dropdown-slide-leave-active[data-v-6882ea42]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-6882ea42]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-6882ea42]:hover{background:#0000000d}.text[data-v-6882ea42]{flex:1}.icon[data-v-570f2a96]{cursor:default;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-570f2a96]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-570f2a96]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-570f2a96]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-570f2a96]:hover{background:#0000000d}.underline[data-v-570f2a96]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-570f2a96]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-570f2a96]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-570f2a96],.dropdown-slide-leave-to[data-v-570f2a96]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-570f2a96],.dropdown-slide-leave-active[data-v-570f2a96]{transition:opacity .18s ease,transform .18s ease}.section[data-v-570f2a96]{margin-bottom:8px}.section-title[data-v-570f2a96]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-570f2a96]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-570f2a96]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-570f2a96]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-570f2a96]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-570f2a96]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-570f2a96]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-570f2a96]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-570f2a96]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-570f2a96]{justify-self:end;flex-shrink:1}.svg-icon[data-v-c83ef2e3]{display:inline-block;line-height:0;vertical-align:middle}.svg-icon svg[data-v-c83ef2e3]{width:1em;height:1em;display:block}.icon[data-v-5ec8a99f]{cursor:default;width:19px;height:19px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.icon-dropdown[data-v-5ec8a99f]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-5ec8a99f]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-5ec8a99f]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-5ec8a99f]:hover{background:#0000000d}.underline[data-v-5ec8a99f]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-5ec8a99f]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-5ec8a99f]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:280px;max-width:320px;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;padding:8px;z-index:20;will-change:opacity,transform}.section[data-v-5ec8a99f]{margin-bottom:8px}.section-title[data-v-5ec8a99f]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-5ec8a99f]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-5ec8a99f]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-5ec8a99f]{width:18px;height:18px;border-radius:4px;cursor:pointer;position:relative;border:1px solid rgba(0,0,0,.08);display:flex;align-items:center;font-size:12px;justify-content:center}.swatch .check[data-v-5ec8a99f]{position:absolute;top:0;right:2px;font-size:12px;color:#000;text-shadow:0 1px 2px rgba(255,255,255,.8)}.inline-actions[data-v-5ec8a99f]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-5ec8a99f]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-5ec8a99f]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-5ec8a99f]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-5ec8a99f]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-5ec8a99f],.dropdown-slide-leave-to[data-v-5ec8a99f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-5ec8a99f],.dropdown-slide-leave-active[data-v-5ec8a99f]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-3208357f]{position:relative}.image-input-panel[data-v-3208357f]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.image-input[data-v-3208357f]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.image-actions[data-v-3208357f]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-3208357f]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-3208357f]:hover{background:#0000000d}.btn-primary[data-v-3208357f]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-3208357f]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-3208357f],.img-panel-leave-active[data-v-3208357f]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-3208357f],.img-panel-leave-to[data-v-3208357f]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-3208357f],.img-panel-leave-from[data-v-3208357f]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-eef6665b]{position:relative}.video-input-panel[data-v-eef6665b]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.video-input[data-v-eef6665b]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.video-actions[data-v-eef6665b]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-eef6665b]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-eef6665b]:hover{background:#0000000d}.btn-primary[data-v-eef6665b]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-eef6665b]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-eef6665b],.video-panel-leave-active[data-v-eef6665b]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-eef6665b],.video-panel-leave-to[data-v-eef6665b]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-eef6665b],.video-panel-leave-from[data-v-eef6665b]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-b5bf35e2]{position:relative}.link-input-panel[data-v-b5bf35e2]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:320px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20;will-change:opacity,transform}.field[data-v-b5bf35e2]{margin-bottom:8px}.label[data-v-b5bf35e2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-b5bf35e2]{width:100%;padding:8px 10px;box-sizing:border-box;max-width:100%;border:1px solid #e5e7eb;border-radius:8px;outline:none;font-size:14px}.actions[data-v-b5bf35e2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-b5bf35e2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-b5bf35e2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-b5bf35e2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-b5bf35e2],.link-panel-leave-active[data-v-b5bf35e2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-b5bf35e2],.link-panel-leave-to[data-v-b5bf35e2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-b5bf35e2],.link-panel-leave-from[data-v-b5bf35e2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-ad6f66b7]{position:relative}.table-panel[data-v-ad6f66b7]{position:absolute;top:32px;right:0;min-width:220px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.panel-title[data-v-ad6f66b7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-ad6f66b7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-ad6f66b7]{display:flex;gap:4px}.cell[data-v-ad6f66b7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-ad6f66b7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-ad6f66b7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-89ddb4db]{position:relative}.tools-panel[data-v-89ddb4db]{position:absolute;top:32px;right:0;min-width:280px;padding:10px;border:1px solid rgba(0,0,0,.1);background:#fff;border-radius:8px;box-shadow:0 6px 24px #0000001f;z-index:20}.tools-grid[data-v-89ddb4db]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-89ddb4db]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-0b74c17c]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-0b74c17c]:hover{background:#0000000d}.icon[data-v-bf6f40c3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;color:#404040;position:relative}.icon[data-v-bf6f40c3]:hover{background:#0000000d}.heading-select[data-v-3d649d22]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-3d649d22]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;font-size:12px;transition:all .2s ease-in-out;position:relative;padding:0 6px;min-width:70px;justify-content:space-between;background:#fff}.icon[data-v-3d649d22]:hover{background:#0000000d}.label[data-v-3d649d22]{font-size:15px;color:#333}.dropdown[data-v-3d649d22]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:220px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform}.dropdown-slide-enter-from[data-v-3d649d22],.dropdown-slide-leave-to[data-v-3d649d22]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-3d649d22],.dropdown-slide-leave-active[data-v-3d649d22]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-3d649d22]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-3d649d22]:hover{background:#0000000d}.item-label[data-v-3d649d22]{flex:1;color:#222}.item-label.paragraph[data-v-3d649d22]{font-size:15px}.item-label.level-1[data-v-3d649d22]{font-size:22px;font-weight:600}.item-label.level-2[data-v-3d649d22]{font-size:20px;font-weight:600}.item-label.level-3[data-v-3d649d22]{font-size:18px;font-weight:600}.item-label.level-4[data-v-3d649d22]{font-size:16px}.item-label.level-5[data-v-3d649d22]{font-size:15px}.item-label.level-6[data-v-3d649d22]{font-size:14px}.shortcut[data-v-3d649d22]{color:#999;font-size:12px}.align-select[data-v-ff7bd7b9]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-ff7bd7b9]{cursor:pointer;width:27px;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;font-size:16px;transition:all .2s ease-in-out;padding:0 6px;background:#fff}.icon[data-v-ff7bd7b9]:hover{background:#0000000d}.dropdown[data-v-ff7bd7b9]{position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);min-width:160px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;box-shadow:0 6px 24px #00000014;z-index:10;-webkit-user-select:none;user-select:none;will-change:opacity,transform;padding:6px}.dropdown-slide-enter-from[data-v-ff7bd7b9],.dropdown-slide-leave-to[data-v-ff7bd7b9]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-ff7bd7b9],.dropdown-slide-leave-active[data-v-ff7bd7b9]{transition:opacity .18s ease,transform .18s ease}.options[data-v-ff7bd7b9]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-ff7bd7b9]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-ff7bd7b9]:hover{background:#0000000d}.option.active[data-v-ff7bd7b9]{background:#0000001a}.header_box[data-v-e5da0a17]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box .icon[data-v-e5da0a17]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:16px;transition:all .2s ease-in-out;position:relative}.header_box .icon[data-v-e5da0a17]:hover{background:#0000000d}.header_box .icon.active[data-v-e5da0a17]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-e5da0a17]{cursor:not-allowed;opacity:.5}.outline-wrapper[data-v-b5f802fc]{position:relative;-webkit-user-select:none;user-select:none}.outline[data-v-b5f802fc]{border-left:1px solid #e5e7eb;padding:8px;font-size:14px;position:sticky;top:0;align-self:start;max-height:100%;background:#fff;display:flex;flex-direction:column;width:0;opacity:0;overflow:hidden;transform:scaleX(0);transform-origin:right center;transition:width .2s ease,transform .2s ease,opacity .2s ease;border-left:none}.outline.isOpen[data-v-b5f802fc]{width:240px;opacity:1;transform:scaleX(1);border-left:1px solid #e5e7eb}.outline__listWrap[data-v-b5f802fc]{overflow-y:auto;overflow-x:hidden;flex:1 1 auto;min-height:0}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar{width:6px;height:1px}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.outline__listWrap[data-v-b5f802fc]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.outline__header[data-v-b5f802fc]{display:flex;align-items:center;font-weight:600;margin-bottom:8px}.outline__header[data-v-b5f802fc]>*{display:inline-flex;gap:6px}.outline__list[data-v-b5f802fc]{list-style:none;padding:0;margin:0}.outline__item[data-v-b5f802fc]{cursor:pointer;padding:4px 0;color:#333}.outline__caret[data-v-b5f802fc]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:4px;color:#666;transition:transform .12s ease}.outline__caret.collapsed[data-v-b5f802fc]{transform:rotate(0)}.outline__caret.expanded[data-v-b5f802fc]{transform:rotate(90deg)}.outline__item[data-v-b5f802fc]:hover{color:#6366f1}.outline__item.lv-1[data-v-b5f802fc]{padding-left:0}.outline__item.lv-2[data-v-b5f802fc]{padding-left:8px}.outline__item.lv-3[data-v-b5f802fc]{padding-left:16px}.outline__item.lv-4[data-v-b5f802fc]{padding-left:24px}.outline__item.lv-5[data-v-b5f802fc]{padding-left:32px}.outline__item.lv-6[data-v-b5f802fc]{padding-left:40px}.outline__text[data-v-b5f802fc]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.outline__close[data-v-b5f802fc]{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline__close[data-v-b5f802fc]:hover{color:#6366f1}.outline__title[data-v-b5f802fc]{display:inline-flex;align-items:center;gap:6px}.outline__pinIcon[data-v-b5f802fc]{display:inline-flex;width:16px;height:16px;color:#666;cursor:pointer}.outline-drawer-mask[data-v-b5f802fc]{display:none}@media (max-width: 900px){.outline[data-v-b5f802fc]{position:absolute;right:0;top:0;bottom:0;width:0;max-width:85vw;box-shadow:-6px 0 24px #00000014;z-index:10}.outline.isOpen[data-v-b5f802fc]{width:min(85vw,280px)}.outline-drawer-mask[data-v-b5f802fc]{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:#00000029;z-index:10}}.outline-slide-enter-active[data-v-b5f802fc],.outline-slide-leave-active[data-v-b5f802fc]{transition:transform .18s ease,opacity .18s ease}.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{opacity:0;transform:translate(16px)}@media (max-width: 900px){.outline-slide-enter-from[data-v-b5f802fc],.outline-slide-leave-to[data-v-b5f802fc]{transform:translate(100%)}}.outline-mask-enter-active[data-v-b5f802fc],.outline-mask-leave-active[data-v-b5f802fc]{transition:opacity .18s ease}.outline-mask-enter-from[data-v-b5f802fc],.outline-mask-leave-to[data-v-b5f802fc]{opacity:0}.simple-editor[data-v-c9ed96a6]{height:var(--editor-height, auto);min-height:var(--editor-min-height, 100px);display:flex;flex-direction:column;border-radius:8px;background:#fff;box-sizing:border-box;border:1px solid #e5e7eb}.editor_wrapper[data-v-c9ed96a6]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-c9ed96a6]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-c9ed96a6]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-c9ed96a6]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-c9ed96a6]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-c9ed96a6]{position:absolute;right:3px;top:8px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e7eb;background:#fff;border-radius:50%;box-shadow:0 2px 10px #00000014;color:#666;cursor:pointer}.outline-marker[data-v-c9ed96a6]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-c9ed96a6]{background:#22c55e}.content[data-v-c9ed96a6]{padding:12px 24px}.content[data-v-c9ed96a6] img{max-width:100%;height:auto;display:inline-block}.content[data-v-c9ed96a6] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-c9ed96a6] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-c9ed96a6] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box{width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;background:#fff;box-shadow:inset 0 1px 2px #0000000f;margin-top:2px;flex-shrink:0;cursor:pointer;position:relative;display:inline-flex;align-items:center;justify-content:center;transition:background-color .16s ease,border-color .16s ease}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box:after{content:"✓";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(.3);opacity:0;color:#fff;font-size:12px;font-weight:700;transition:transform .18s ease,opacity .18s ease;animation:todo-check-out-c9ed96a6 .18s ease both}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box:after{transform:translate(-50%,-50%) scale(1);opacity:1;animation:todo-check-in-c9ed96a6 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-c9ed96a6{0%{transform:translate(-50%,-50%) scale(.3);opacity:0}60%{transform:translate(-50%,-50%) scale(1.15);opacity:1}to{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes todo-check-out-c9ed96a6{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] input[type=checkbox]{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;position:static;opacity:1;pointer-events:auto;width:16px;height:16px;border-radius:4px;border:1px solid #e5e7eb;margin-top:2px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-c9ed96a6] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-c9ed96a6] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c9ed96a6] [data-resize-wrapper]{display:inline-block}.content[data-v-c9ed96a6] .tiptap-resize-handle{width:10px;height:10px;background:#1677ffd9;border-radius:2px;box-shadow:0 0 0 1px #fff;cursor:nwse-resize;z-index:4;opacity:0;pointer-events:none;transition:opacity .12s ease}.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-c9ed96a6] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-c9ed96a6] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover>img,.content[data-v-c9ed96a6] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c9ed96a6] .tiptap-resize-wrapper{position:relative}.content[data-v-c9ed96a6] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-c9ed96a6] .tiptap-upload-mask{position:absolute;top:0;right:0;bottom:0;left:0;background:transparent;display:flex;align-items:center;justify-content:center;color:#1677ff;font-size:12px;border-radius:4px;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:2}.content[data-v-c9ed96a6] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-c9ed96a6] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-c9ed96a6] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-c9ed96a6 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-c9ed96a6{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-c9ed96a6] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-c9ed96a6] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-c9ed96a6] .ProseMirror table th,.content[data-v-c9ed96a6] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-c9ed96a6] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-c9ed96a6] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-c9ed96a6] .ProseMirror table .column-resize-handle{position:absolute;right:-3px;top:0;bottom:0;width:8px;background:transparent;cursor:col-resize;z-index:3;-webkit-user-select:none;user-select:none;pointer-events:auto}.content[data-v-c9ed96a6] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-c9ed96a6] .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);color:#999;pointer-events:none;float:left;height:0;white-space:pre-line}.content[data-v-c9ed96a6] code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f2f4f7;padding:2px 4px;border-radius:4px}.content[data-v-c9ed96a6] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-c9ed96a6] pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;background:#f6f8fa;padding:12px;border-radius:6px;border:1px solid #e5e7eb;overflow:auto}.content[data-v-c9ed96a6] p{margin:12px 0}[data-v-c9ed96a6] .md-drag-handle{width:22px;height:22px;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 2px 10px #00000014;background:#fff;border:1px solid #e5e7eb;cursor:grab;z-index:5}[data-v-c9ed96a6] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-c9ed96a6]{grid-template-columns:1fr}.outline-markers[data-v-c9ed96a6]{display:none}}.link-modal-backdrop[data-v-c9ed96a6]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-c9ed96a6]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-c9ed96a6]{background:#fff;border:1px solid #e5e7eb;border-radius:8px;min-width:360px;padding:12px;box-shadow:0 6px 24px #00000014}.link-modal__title[data-v-c9ed96a6]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-c9ed96a6]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-c9ed96a6]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-c9ed96a6]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-c9ed96a6]{display:block;width:640px;height:auto}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
+
(function(j,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@tiptap/vue-3"),require("@tiptap/starter-kit"),require("@tiptap/markdown"),require("@tiptap/extension-image"),require("@tiptap/core"),require("@tiptap/extension-placeholder"),require("@tiptap/extension-link"),require("@tiptap/extension-text-align"),require("@tiptap/extension-text-style"),require("@tiptap/extension-color"),require("@tiptap/extension-underline"),require("@tiptap/extension-table"),require("@tiptap/extensions"),require("@tiptap/extension-list")):typeof define=="function"&&define.amd?define(["exports","vue","@tiptap/vue-3","@tiptap/starter-kit","@tiptap/markdown","@tiptap/extension-image","@tiptap/core","@tiptap/extension-placeholder","@tiptap/extension-link","@tiptap/extension-text-align","@tiptap/extension-text-style","@tiptap/extension-color","@tiptap/extension-underline","@tiptap/extension-table","@tiptap/extensions","@tiptap/extension-list"],e):(j=typeof globalThis<"u"?globalThis:j||self,e(j.MdEditor={},j.Vue,j.tiptapVue3,j.StarterKit,j.tiptapMarkdown,j.tiptapImage,j.tiptapCore,j.tiptapPlaceholder,j.tiptapLink,j.tiptapTextAlign,j.tiptapTextStyle,j.tiptapColor,j.tiptapUnderline,j.tiptapTable,j.extensions,j.extensionList))})(this,function(j,e,ye,je,Ae,De,de,He,Ue,We,fe,Ie,Oe,Ve,Re,xe){"use strict";var Se;function Pe(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const me=Pe(de),Ge=De.Image.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:r=>r.getAttribute("data-uploading")?!0:null,renderHTML:r=>r.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:r=>{const n=r.getAttribute("width")||r.style.width||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:r=>r.width?{width:r.width}:{}},height:{default:null,parseHTML:r=>{const n=r.getAttribute("height")||r.style.height||"",o=String(n).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:r=>r.height?{height:r.height}:{}}}},addNodeView(){return({node:t,getPos:r,editor:n})=>{const o=document.createElement("img"),i=t.attrs;o.src=i.src||"",i.alt&&(o.alt=i.alt),i.title&&(o.title=i.title),typeof i.width=="number"&&(o.style.width=`${i.width}px`),typeof i.height=="number"&&(o.style.height=`${i.height}px`),o.style.maxWidth="100%",o.style.height=o.style.height||"auto",o.style.display="inline-block";const d=new de.ResizableNodeView({element:o,node:t,getPos:r,onResize:(b,V)=>{o.style.width=`${b}px`,o.style.height=`${V}px`},onCommit:(b,V)=>{try{const f=n,m=r();if(m!==void 0){const{state:g}=f,C=g.schema.nodes.image,l=g.doc.nodeAt(m);if(C&&l){const a={...l.attrs||{},width:b,height:V},s=g.tr.setNodeMarkup(m,C,a,l.marks);f.view.dispatch(s)}}}catch{}},onUpdate:b=>{const V=b.attrs;return typeof V.src=="string"&&V.src&&o.src!==V.src&&(o.src=V.src),typeof V.width=="number"&&(o.style.width=`${V.width}px`),typeof V.height=="number"&&(o.style.height=`${V.height}px`),V.uploading?d.wrapper.setAttribute("data-uploading","true"):d.wrapper.removeAttribute("data-uploading"),!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:32,height:32},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});try{d.container.style.display="inline-block",d.wrapper.style.display="inline-block"}catch{}const E=document.createElement("div");E.className="tiptap-upload-mask";const c=document.createElement("div");return c.className="tiptap-upload-progress",E.appendChild(c),d.wrapper.appendChild(E),i.uploading&&d.wrapper.setAttribute("data-uploading","true"),d}}}),qe=Ve.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:r=>r.getAttribute("data-background-color"),renderHTML:r=>{const n=r.backgroundColor;return n?{"data-background-color":n,style:`background-color: ${n}`}:{}}}}}}),Ye=(((Se=me==null?void 0:me.Node)==null?void 0:Se.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!0,selectable:!0,addAttributes(){return{src:{default:null},controls:{default:!0},autoplay:{default:!1},loop:{default:!1},muted:{default:!1},poster:{default:null},playsinline:{default:!0},uploading:{default:null,parseHTML:t=>t.getAttribute("data-uploading")?!0:null,renderHTML:t=>t.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:t=>{const r=t.getAttribute("width")||t.style.width||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const r=t.getAttribute("height")||t.style.height||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:t=>t.height?{height:t.height}:{}},class:{default:"tiptap-video"}}},parseHTML(){return[{tag:"video[data-tiptap-video]"},{tag:"video"}]},renderHTML({HTMLAttributes:t}){return["video",{"data-tiptap-video":"",...t}]},renderMarkdown(t){const r=(t==null?void 0:t.attrs)||{},n=typeof r.src=="string"?r.src:"";return n?`[video](${n})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const r=/^\[video\]\(([^)]+)\)/.exec(t);if(r)return{type:"video",raw:r[0],href:r[1]}}},parseMarkdown(t){const r=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return r?{type:"video",attrs:{src:r,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:r,editor:n})=>{var b;const o=document.createElement("video"),i=t.attrs;o.src=i.src||"",o.controls=i.controls!==!1,o.autoplay=!1,o.loop=!!i.loop,o.muted=!!i.muted,i.poster&&(o.poster=i.poster),o.setAttribute("playsinline","true"),i.class&&(o.className=String(i.class)),typeof i.width=="number"&&(o.style.width=`${i.width}px`),typeof i.height=="number"&&(o.style.height=`${i.height}px`),o.style.display="inline-block";const d=new de.ResizableNodeView({element:o,node:t,getPos:r,onResize:(V,f)=>{o.style.width=`${V}px`,o.style.height=`${f}px`},onCommit:(V,f)=>{try{const m=n,g=r();if(g!==void 0){const{state:C}=m,l=C.schema.nodes.video,a=C.doc.nodeAt(g);if(l&&a){const s={...a.attrs||{},width:V,height:f},N=C.tr.setNodeMarkup(g,l,s,a.marks);m.view.dispatch(N)}}}catch{}},onUpdate:V=>{const f=V.attrs||{};if(typeof f.src=="string"&&f.src&&o.src!==f.src&&(o.src=f.src),typeof f.width=="number"&&(o.style.width=`${f.width}px`),typeof f.height=="number"&&(o.style.height=`${f.height}px`),f.uploading){d.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}else d.wrapper.removeAttribute("data-uploading"),o.controls=f.controls!==!1,o.style.pointerEvents="";return!0},options:{directions:["bottom-right","bottom-left","top-right","top-left"],min:{width:120,height:80},preserveAspectRatio:!0,className:{container:"tiptap-resize-container",wrapper:"tiptap-resize-wrapper",handle:"tiptap-resize-handle",resizing:"is-resizing"}}});try{d.container.style.display="inline-block",d.wrapper.style.display="inline-block"}catch{}const E=document.createElement("div");E.className="tiptap-upload-mask";const c=document.createElement("div");if(c.className="tiptap-upload-progress",E.appendChild(c),d.wrapper.appendChild(E),(b=t.attrs)!=null&&b.uploading){d.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}return d}},addCommands(){return{setVideo:t=>({chain:r})=>{const{src:n,HTMLAttributes:o={}}=t||{};return r().insertContent({type:this.name,attrs:{src:n,...o}}).run()}}}}),Ke=xe.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:r,getPos:n})=>{const o=document.createElement("li");o.setAttribute("data-type","taskItem"),o.setAttribute("data-checked",t.attrs.checked?"true":"false");const i=document.createElement("span");i.className="todo-box",i.tabIndex=0,i.setAttribute("role","checkbox"),i.setAttribute("aria-checked",t.attrs.checked?"true":"false"),i.addEventListener("mousedown",c=>c.preventDefault());const d=()=>{const c=typeof n=="function"?n():null;if(c==null)return{pos:null,n:null};const b=r.view.state.doc.nodeAt(c);return{pos:c,n:b}};i.addEventListener("click",()=>{var C;const{pos:c,n:b}=d();if(c==null||!b)return;const V=r.view.state,f=V.schema.nodes.taskItem,m=!!((C=b.attrs)!=null&&C.checked),g=V.tr.setNodeMarkup(c,f,{...b.attrs||{},checked:!m});r.view.dispatch(g)}),i.addEventListener("keydown",c=>{var b;if(c.key==="Enter"||c.key===" "){c.preventDefault();const{pos:V,n:f}=d();if(V==null||!f)return;const m=r.view.state,g=m.schema.nodes.taskItem,C=!!((b=f.attrs)!=null&&b.checked),l=m.tr.setNodeMarkup(V,g,{...f.attrs||{},checked:!C});r.view.dispatch(l)}});const E=document.createElement("div");return E.className="task-content",o.appendChild(i),o.appendChild(E),{dom:o,contentDOM:E,update(c){return c.type!==t.type?!1:(o.setAttribute("data-checked",c.attrs.checked?"true":"false"),i.setAttribute("aria-checked",c.attrs.checked?"true":"false"),!0)}}}}});var Ze={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function Je(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Xe(t,r,n){var o=typeof r.fill=="string"?[r.fill]:r.fill||[],i=[],d=r.theme||n.theme;switch(d){case"outline":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("none");break;case"filled":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push("#FFF"),i.push("#FFF");break;case"two-tone":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone),i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.twoTone.twoTone);break;case"multi-color":i.push(typeof o[0]=="string"?o[0]:"currentColor"),i.push(typeof o[1]=="string"?o[1]:n.colors.multiColor.outFillColor),i.push(typeof o[2]=="string"?o[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof o[3]=="string"?o[3]:n.colors.multiColor.innerFillColor);break}return{size:r.size||n.size,strokeWidth:r.strokeWidth||n.strokeWidth,strokeLinecap:r.strokeLinecap||n.strokeLinecap,strokeLinejoin:r.strokeLinejoin||n.strokeLinejoin,colors:i,id:t}}var Qe=Symbol("icon-context");function H(t,r,n){var o={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(d){var E=Je(),c=e.inject(Qe,Ze);return function(){var b=d.size,V=d.strokeWidth,f=d.strokeLinecap,m=d.strokeLinejoin,g=d.theme,C=d.fill,l=d.spin,a=Xe(E,{size:b,strokeWidth:V,strokeLinecap:f,strokeLinejoin:m,theme:g,fill:C},c),s=[c.prefix+"-icon"];return s.push(c.prefix+"-icon-"+t),r&&c.rtl&&s.push(c.prefix+"-icon-rtl"),l&&s.push(c.prefix+"-icon-spin"),e.createVNode("span",{class:s.join(" ")},[n(a)])}}};return o}const be=H("align-text-both",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 19H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 39H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Ne=H("align-text-center",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19H12",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M36 39H12",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),_e=H("align-text-left",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M34 19H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M34 39H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),Ee=H("align-text-right",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M42 9H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 19H14",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 29H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 39H14",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),oe=H("check",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M43 11L16.875 37L5 25.1818",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ne=H("down-one",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 19L24 31L12 19H36Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null)])}),et=H("font-size-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M4 44L24 4L44 44",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 28H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),tt=H("go-on",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M36 7L43 13.4615L36 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M40 14H17.0062C10.1232 14 4.27787 19.6204 4.00964 26.5C3.72612 33.7696 9.73291 40 17.0062 40H34.0016",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=H("list-two",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9 42C11.2091 42 13 40.2091 13 38C13 35.7909 11.2091 34 9 34C6.79086 34 5 35.7909 5 38C5 40.2091 6.79086 42 9 42Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 14C11.2091 14 13 12.2092 13 10C13 7.79086 11.2091 6 9 6C6.79086 6 5 7.79086 5 10C5 12.2092 6.79086 14 9 14Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 28C11.2091 28 13 26.2092 13 24C13 21.7908 11.2091 20 9 20C6.79086 20 5 21.7908 5 24C5 26.2092 6.79086 28 9 28Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 38H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 10H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),nt=H("ordered-list",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9 4V13",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 13H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 27H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 19.9998C6 19.9998 9 16.9998 11 19.9998C13 22.9999 6 26.9998 6 26.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6.00016 34.5001C6.00016 34.5001 8.00016 31.5 11.0002 33.5C14.0002 35.5 11.0002 38 11.0002 38C11.0002 38 14.0002 40.5 11.0002 42.5C8.00015 44.5 6.00015 41.5 6.00015 41.5",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M11 38H9",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M9 4L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 38H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M21 10H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=H("preview-close-one",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M9.85786 18C6.23858 21 4 24 4 24C4 24 12.9543 36 24 36C25.3699 36 26.7076 35.8154 28 35.4921M20.0318 12.5C21.3144 12.1816 22.6414 12 24 12C35.0457 12 44 24 44 24C44 24 41.7614 27 38.1421 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M20.3142 20.6211C19.4981 21.5109 19 22.6972 19 23.9998C19 26.7612 21.2386 28.9998 24 28.9998C25.3627 28.9998 26.5981 28.4546 27.5 27.5705",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 42L6 6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=H("pushpin",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M32 4H16L20 7L16 20C16 20 10 24 10 28H20L24 44L28 28H38C38 24 34 21.1667 32 20L28 7L32 4Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),lt=H("return",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),st=H("strikethrough",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M5 24H43",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M24 24C40 30 34 44 24 44C13.9999 44 12 36 12 36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M35.9999 12C35.9999 12 33 4 23.9999 4C14.9999 4 11.4359 11.5995 15.6096 18",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 36C12 36 15.9999 44 24 44C32 44 36.564 36.4005 32.3903 30",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=H("text-bold",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 24C29.5056 24 33.9688 19.5228 33.9688 14C33.9688 8.47715 29.5056 4 24 4H11V24H24Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M28.0312 44C33.5368 44 38 39.5228 38 34C38 28.4772 33.5368 24 28.0312 24H11V44H28.0312Z",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ct=H("text-italic",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M20 6H36",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M12 42H28",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M29 5.95215L19 41.9998",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),dt=H("text-underline",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M8 44H40",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M37 6.09717C37 12.7638 37 15.3335 37 22.0002C37 29.1799 31.1797 35.0002 24 35.0002C16.8203 35.0002 11 29.1799 11 22.0002C11 15.3335 11 12.7638 11 6.09717",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap},null)])}),ft={class:"label"},mt={key:0,class:"shortcut"},ht=e.defineComponent({__name:"Tooltip",props:{text:{type:String,required:!0},shortcut:{type:String,default:""},placement:{type:String,default:"bottom"},offset:{type:Number,default:6}},setup(t){const r=t,n=e.ref(null),o=e.ref(null),i=e.ref(!1),d=e.ref(r.placement);function E(){const V=n.value,f=o.value;if(!V||!f)return;let m=r.placement;const g=f.getBoundingClientRect(),C=g.top,l=window.innerHeight-g.bottom,a=V.offsetHeight+r.offset;m==="bottom"?l<a&&C>=a&&(m="top"):C<a&&l>=a&&(m="bottom"),d.value=m}function c(){i.value=!0,e.nextTick(E)}function b(){i.value=!1}return e.onMounted(()=>{window.addEventListener("resize",E)}),e.watch(()=>r.text,()=>e.nextTick(E)),(V,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:o,class:"tooltip-wrapper",onMouseenter:c,onMouseleave:b,onFocusin:c,onFocusout:b},[e.renderSlot(V.$slots,"default",{},void 0,!0),e.createElementVNode("div",{ref_key:"tipRef",ref:n,class:e.normalizeClass(["tooltip",[d.value,{visible:i.value}]])},[e.createElementVNode("div",ft,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",mt,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],2)],544))}}),U=(t,r)=>{const n=t.__vccOpts||t;for(const[o,i]of r)n[o]=i;return n},J=U(ht,[["__scopeId","data-v-8b180ffc"]]),ut=["aria-expanded"],pt={class:"label"},kt={key:0,class:"dropdown",role:"listbox"},gt=["aria-selected","onClick"],wt={class:"text"},he="md-toolbar-dropdown-open",Le="font-size-select",Ct=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],o=e.computed(()=>{var g,C;const m=(C=(g=r.editor)==null?void 0:g.getAttributes("textStyle"))==null?void 0:C.fontSize;return typeof m=="string"&&m?m:"15px"}),i=e.ref(!1),d=e.ref(null);function E(){i.value||window.dispatchEvent(new CustomEvent(he,{detail:{id:Le}})),i.value=!i.value}function c(){i.value=!1}function b(m){var g;(g=r.editor)==null||g.chain().focus().setMark("textStyle",{fontSize:m}).run(),c()}function V(m){const g=m.target,C=d.value;C&&!C.contains(g)&&c()}e.onMounted(()=>{document.addEventListener("click",V),window.addEventListener(he,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",V),window.removeEventListener(he,f)});function f(m){var C;((C=m.detail)==null?void 0:C.id)!==Le&&(i.value=!1)}return(m,g)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:d},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(E,["stop"]),"aria-expanded":i.value},[e.createElementVNode("div",pt,e.toDisplayString(o.value),1),e.createVNode(e.unref(ne),{theme:"filled",strokeWidth:3})],8,ut),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",kt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,C=>e.createElementVNode("div",{key:C,class:"dropdown-item","aria-selected":C===o.value,onClick:e.withModifiers(l=>b(C),["stop"])},[C===o.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",wt,e.toDisplayString(C),1)],8,gt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-6882ea42"]]),yt=["aria-expanded"],Vt={key:0,class:"dropdown"},xt={class:"section"},bt={class:"swatches"},Nt=["onClick"],_t={class:"section"},Et={class:"swatches grid"},Lt=["onClick"],Mt={key:0,class:"section"},Bt={class:"swatches"},zt=["onClick"],$t={class:"section inline-actions"},vt={key:1,class:"advanced"},ue="md-toolbar-dropdown-open",Me="color-select",St=U(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const r=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),i=e.ref(!1),d=e.ref(null),E=e.ref(r.currentColor||"#000000"),c=e.ref(s()),b=e.ref("#F5222D");function V(){o.value||window.dispatchEvent(new CustomEvent(ue,{detail:{id:Me}})),o.value=!o.value}function f(){o.value=!1}function m(){i.value=!i.value}function g(k){var u;(u=r.editor)==null||u.chain().focus().setColor(k).run(),b.value=k,N(k),f()}function C(){var k;(k=r.editor)==null||k.chain().focus().unsetColor().run(),f()}function l(k){const u=k.target,w=d.value;w&&!w.contains(u)&&f()}function a(){}function s(){try{const k=localStorage.getItem("md_color_recent");if(!k)return[];const u=JSON.parse(k);return Array.isArray(u)?u.slice(0,12):[]}catch{return[]}}function N(k){const u=[k,...c.value.filter(w=>w!==k)];c.value=u.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(c.value))}catch{}}let h=[];function y(){const k=r.editor;k&&(h=[{event:"selectionUpdate",handler:a},{event:"transaction",handler:a},{event:"update",handler:a}],h.forEach(({event:u,handler:w})=>{k.on(u,w)}))}e.onMounted(()=>{document.addEventListener("click",l),window.addEventListener(ue,_),y()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",l),window.removeEventListener(ue,_);const k=r.editor;k&&h.forEach(({event:u,handler:w})=>{k.off(u,w)}),h=[]}),e.watch(()=>r.editor,(k,u)=>{u&&h.forEach(({event:w,handler:M})=>{u.off(w,M)}),h=[],y()});function _(k){var w;((w=k.detail)==null?void 0:w.id)!==Me&&(o.value=!1)}return(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:d},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:u[0]||(u[0]=e.withModifiers(w=>g(b.value),["stop"]))},[e.createVNode(e.unref(et),{theme:"filled",size:"14",fill:"#000",strokeWidth:3}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:b.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(V,["stop"])},[e.createVNode(e.unref(ne),{theme:"filled",strokeWidth:3,size:"12"})])],8,yt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",xt,[u[4]||(u[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},[w===b.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Nt))),128))])]),e.createElementVNode("div",_t,[u[5]||(u[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},[w===b.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Lt))),128))])]),c.value.length?(e.openBlock(),e.createElementBlock("div",Mt,[u[6]||(u[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",Bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},null,12,zt))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(C,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(m,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",vt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":u[1]||(u[1]=w=>E.value=w)},null,512),[[e.vModelText,E.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":u[2]||(u[2]=w=>E.value=w)},null,512),[[e.vModelText,E.value]]),e.createElementVNode("button",{class:"btn apply",onClick:u[3]||(u[3]=e.withModifiers(w=>g(E.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-570f2a96"]]),Tt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763479929532" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="52528" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M621.568 208.299a38.101 38.101 0 0 0-73.941-18.518L386.773 833.28a38.101 38.101 0 0 0 73.899 18.475l160.853-643.456zM325.632 294.4a38.101 38.101 0 0 1 0 53.888L162.347 511.573 325.632 674.86a38.101 38.101 0 0 1-53.845 53.888L81.493 538.539a38.101 38.101 0 0 1 0-53.931L271.787 294.4a38.101 38.101 0 0 1 53.888 0z m372.736 0a38.101 38.101 0 0 0 0 53.888l163.285 163.285L698.368 674.86a38.101 38.101 0 0 0 53.888 53.888l190.25-190.208a38.101 38.101 0 0 0 0-53.931L752.257 294.4a38.101 38.101 0 0 0-53.888 0z" fill="#333333" p-id="52529"></path></svg>',Ft='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480012496" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="54461" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M338.986667 59.413333h52.586666a21.333333 21.333333 0 0 1 21.333334 21.333334V115.84a21.333333 21.333333 0 0 1-21.333334 21.333333H356.266667c-36.48 0-53.76 20.16-53.76 62.4v188.16c0 59.52-27.84 99.84-82.56 120 54.72 23.04 82.56 62.4 82.56 120v189.12c0 40.32 17.28 61.44 53.76 61.44h35.306666a21.333333 21.333333 0 0 1 21.333334 21.333334v35.093333a21.333333 21.333333 0 0 1-21.333334 21.333333H338.986667c-42.24 0-74.88-14.4-97.92-41.28-21.12-24.96-31.68-59.52-31.68-101.76v-180.48c0-27.84-5.76-48-17.28-60.48-11.178667-12.778667-29.653333-20.245333-55.466667-23.488a18.901333 18.901333 0 0 1-16.533333-18.773333v-43.221333c0-10.005333 7.381333-18.474667 17.28-19.84 25.408-3.498667 43.648-11.456 54.72-23.317334 11.52-13.44 17.28-33.6 17.28-60.48V203.413333c0-43.2 10.56-77.76 31.68-102.72 23.04-27.84 55.68-41.28 97.92-41.28z m292.48 0h52.586666c42.24 0 74.88 13.44 97.92 41.28 21.12 24.96 31.68 59.52 31.68 102.72v179.52c0 26.88 5.76 48 18.24 61.44 10.24 11.029333 28.224 18.816 53.418667 22.314667 10.112 1.408 17.621333 10.026667 17.621333 20.245333v40.746667a21.333333 21.333333 0 0 1-18.88 21.184c-24.576 3.413333-42.282667 10.794667-53.12 23.189333-11.52 12.48-17.28 32.64-17.28 60.48v180.48c0 42.24-10.56 76.8-31.68 101.76-23.04 26.88-55.68 41.28-97.92 41.28H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V899.626667a21.333333 21.333333 0 0 1 21.333334-21.333334h35.306666c35.52 0 53.76-21.12 53.76-61.44v-189.12c0-57.6 26.88-96.96 82.56-120-55.68-20.16-82.56-60.48-82.56-120v-188.16c0-42.24-18.24-62.4-53.76-62.4H631.466667a21.333333 21.333333 0 0 1-21.333334-21.333333V80.746667a21.333333 21.333333 0 0 1 21.333334-21.333334z" fill="#000000" p-id="54462"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763473363174" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28322" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M957.610667 507.434667L603.221333 158.293333a7.893333 7.893333 0 0 0-11.221333 0L353.28 393.386667a8.021333 8.021333 0 0 0-0.085333 11.306666l0.085333 0.128 40.021333 39.381334-117.205333 115.285333a8.021333 8.021333 0 0 0-0.085333 11.306667l0.085333 0.128 39.509333 38.869333-189.098666 187.008H72.106667a8.106667 8.106667 0 0 0-8.106667 8.021333v55.168c0 4.394667 3.584 8.021333 8.021333 8.021334H416.853333c2.133333 0 4.096-0.810667 5.589334-2.304l76.117333-75.605334 40.405333 39.808a7.936 7.936 0 0 0 11.178667 0l117.12-115.626666 40.106667 39.509333a7.893333 7.893333 0 0 0 11.178666 0l238.72-235.178667a7.68 7.68 0 0 0 0.298667-11.221333z m-567.808 288.853333H229.546667l134.4-133.034667 80.128 78.933334-54.314667 54.058666z m154.794666-62.122667l-171.392-168.917333 68.608-67.584 171.392 168.874667-68.608 67.626666z m168.533334-76.117333l-262.826667-258.901333 147.285333-145.066667 262.826667 258.986667-147.328 144.981333z" fill="#999999" p-id="28323"></path></svg>',At='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480451042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="58395" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="58396"></path></svg>',Dt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480387136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="57289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M213.972 214.906l0.934-0.934c27.606-27.606 68.674-30.581 92.168-7.087l225.23 225.23c29.72-40.254 30.733-93.311-0.599-124.643L345.639 121.406c-35.132-35.132-97.076-30.148-138.356 11.132l-74.744 74.744c-41.28 41.28-46.264 103.224-11.132 138.356l186.065 186.065c31.332 31.332 84.389 30.319 124.643 0.599l-225.23-225.23c-23.494-23.492-20.519-64.56 7.087-92.166zM808.745 809.679l0.934-0.934c27.606-27.606 31.18-68.074 7.686-91.568l-225.23-225.23c40.254-29.72 93.311-30.733 124.643 0.599l186.065 186.065c35.132 35.132 29.548 96.477-11.732 137.757l-74.744 74.744c-41.28 41.28-102.625 46.863-137.757 11.732L492.546 716.779c-31.332-31.332-31.909-82.799-0.599-124.643l225.23 225.23c23.494 23.494 63.962 19.92 91.568-7.687z" fill="#666666" p-id="57290"></path><path d="M627.123 628.713c-12.296 12.296-32.232 12.296-44.528 0L394.938 441.057c-12.296-12.296-12.296-32.232 0-44.528s32.232-12.296 44.528 0l187.656 187.656c12.297 12.296 12.297 32.232 0.001 44.528z" fill="#666666" p-id="57291"></path></svg>',Ht='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480239307" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="56277" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M849.6 231v109.5c-46.4 14.9-84.6 41.5-114.4 81.3-29.9 36.5-44.8 76.3-43.1 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 91.2 36.5 23.2 24.9 36.5 56.4 36.5 94.5S848 732 821.5 756.8C795 780 761.8 793.3 722 793.3c-46.4 0-82.9-19.9-112.8-56.4s-43.1-84.6-43.1-141c0-89.6 24.9-165.8 76.3-230.5C692 299 761.7 254.2 849.6 231z m-403 0v109.5c-46.4 14.9-82.9 41.5-112.8 81.3-31.5 36.5-46.4 76.3-44.8 116.1 8.3-5 21.6-6.6 41.5-6.6 34.8 0 64.7 11.6 89.6 36.5 24.9 24.9 38.1 56.4 38.1 94.5s-13.3 69.7-38.1 94.5c-26.5 23.2-61.4 36.5-101.2 36.5-46.4 0-82.9-19.9-111.1-56.4-29.9-36.5-44.8-84.6-44.8-141 0-89.6 24.9-165.8 76.3-230.5C289 299 358.7 254.2 446.6 231z" p-id="56278"></path></svg>',Ut='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480808376" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="61532" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M959.825 384.002V191.94c0-70.692-57.308-128-128-128H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V384.002z m-813.16-237.337a63.738 63.738 0 0 1 45.336-18.785H832a63.962 63.962 0 0 1 63.886 64.121v128.061H127.88v-128.06a63.738 63.738 0 0 1 18.785-45.337z m269.127 461.308v-223.97h192.181v223.97H415.792z m192.181 63.94v223.972H415.792V671.914h192.181z m-256.121-63.94H127.88v-223.97h223.972v223.97zM146.665 877.21a63.467 63.467 0 0 1-18.785-45.21V671.914h223.972v223.97h-159.85a63.626 63.626 0 0 1-45.337-18.675z m749.22-45.21a63.763 63.763 0 0 1-63.886 63.886H671.914V671.914h223.97v160.085z m0-224.026H671.914v-223.97h223.97v223.97z" p-id="61533"></path></svg>',Wt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480994147" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="73821" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M933.529779 1022.701142H87.673207c-48.357498 0-87.523075-39.165577-87.523075-87.523076V1.798419h729.259049c48.357498 0 87.523075 39.165577 87.523076 87.523076v320.818031h204.220509V935.178066c-0.099912 48.357498-39.265489 87.523075-87.622987 87.523076z m-175.046151-904.205289c0-32.171724-26.077081-58.348717-58.348717-58.348717H58.498849v845.856572c0 32.171724 26.077081 58.348717 58.348717 58.348717h583.387257c32.171724 0 58.348717-26.077081 58.348717-58.348717V118.495853zM962.704137 468.588155h-145.871792v495.864182h87.523075c32.171724 0 58.348717-26.077081 58.348717-58.348717V468.588155z m-729.25905 0h379.166748v58.348717H233.445087V468.588155z m0-233.394868h379.166748v58.348717H233.445087v-58.348717z m262.569227 525.03854H233.445087v-58.348716h262.469314v58.348716z m0 0" p-id="73822"></path></svg>',It='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763477549677" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31202" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M828.6 75C889.572 75 939 124.428 939 185.4v676.2c0 60.972-49.428 110.4-110.4 110.4H152.4C91.428 972 42 922.572 42 861.6V185.4C42 124.428 91.428 75 152.4 75z m0 59.8H152.4c-27.946 0-50.6 22.654-50.6 50.6v676.2c0 27.946 22.654 50.6 50.6 50.6h676.2c27.946 0 50.6-22.654 50.6-50.6V185.4c0-27.946-22.654-50.6-50.6-50.6z m-20.56 167.48c11.48 11.504 11.641 30.022 0.502 41.725l-0.548 0.56L477.473 674.37c-11.251 11.227-29.274 11.663-41.05 1.123l-0.574-0.527L260.695 509.93c-12.018-11.325-12.581-30.248-1.257-42.266 11.145-11.828 29.65-12.56 41.69-1.788l0.577 0.53L455.756 611.56l310-309.325c11.689-11.664 30.62-11.644 42.284 0.045z" fill="#333333" p-id="31203"></path></svg>',Ot='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763480631673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="60480" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M960 192h-28.384c-16.8 0-32.928 6.624-44.928 18.432L800 295.936V256a96 96 0 0 0-96-96H96C43.072 160 0 203.04 0 256v512a96 96 0 0 0 96 96h608c52.992 0 96-43.008 96-96v-39.072l86.688 85.504c12 11.808 28.128 18.432 44.928 18.432H960a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64zM96 800c-17.664 0-32-14.368-32-32V256a32 32 0 0 1 32-32h608c17.632 0 32 14.336 32 32v512c0 17.632-14.368 32-32 32H96z m864-31.136h-32l-128-128V640l-32-32v-192l160-160h32v512.864z" fill="#333333" p-id="60481"></path></svg>',Rt=["innerHTML"],Y=U(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const r=t,n=e.useAttrs(),o=Object.assign({"/src/svg/code.svg":Tt,"/src/svg/codeBlock.svg":Ft,"/src/svg/highBg.svg":jt,"/src/svg/img.svg":At,"/src/svg/link.svg":Dt,"/src/svg/quote.svg":Ht,"/src/svg/table.svg":Ut,"/src/svg/tableTools.svg":Wt,"/src/svg/task.svg":It,"/src/svg/video.svg":Ot}),i=(()=>{const f={};return Object.entries(o).forEach(([m,g])=>{const l=(m.split("/src/svg/")[1]||m).replace(/\.svg$/i,"");f[l]=g;const a=l.split("/").pop();a&&(f[a]=g)}),f})(),d=e.computed(()=>{const f=r.name.replace(/\.svg$/i,"");return i[f]||""});function E(f){if(!f)return"";let m=f.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return m=m.replace(/<svg([^>]*)>/i,(g,C)=>`<svg${C.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),m=m.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),m=m.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),m}const c=e.computed(()=>E(d.value));function b(f){if(f!=null)return typeof f=="number"?`${f}px`:f}const V=e.computed(()=>{const f={},m=b(r.size);m&&(f.fontSize=m),r.color&&(f.color=r.color);const g=n.style??void 0;return[f,g].filter(Boolean)});return(f,m)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(n).class]),style:e.normalizeStyle(V.value),innerHTML:c.value},null,14,Rt))}}),[["__scopeId","data-v-c83ef2e3"]]),Pt=["aria-expanded"],Gt={key:0,class:"dropdown"},qt={class:"section"},Yt={class:"swatches"},Kt={class:"section"},Zt={class:"swatches"},Jt=["onClick"],Xt={key:0,class:"check"},Qt={class:"section"},eo={class:"swatches grid"},to=["onClick"],oo={key:0,class:"section"},no={class:"swatches"},io=["onClick"],ro={class:"section inline-actions"},lo={key:1,class:"advanced"},pe="md-toolbar-dropdown-open",Be="bg-color-select",so=U(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const r=t,n=["#000000","#262626","#595959","#8C8C8C","#BFBFBF","#D9D9D9","#E9E9E9","#F5F5F5","#FFFFFF","#F5222D","#FA541C","#FA8C16","#FADB14","#52C41A","#13C2C2","#1677FF","#2F54EB","#722ED1","#EB2F96","#FF4D4F","#FF7A45","#FFA940","#FFD666","#73D13D","#36CFC9","#69C0FF","#85A5FF","#B37FEB","#F759AB"],o=e.ref(!1),i=e.ref(!1),d=e.ref(null),E=e.ref(r.currentBg||"#ffffff"),c=e.ref(s()),b=e.ref("#FADB14");function V(){o.value||window.dispatchEvent(new CustomEvent(pe,{detail:{id:Be}})),o.value=!o.value}function f(){o.value=!1}function m(){i.value=!i.value}function g(k){var u;(u=r.editor)==null||u.chain().focus().setMark("textStyle",{backgroundColor:k}).run(),b.value=k,N(k),f()}function C(){var k;(k=r.editor)==null||k.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),f()}function l(k){const u=k.target,w=d.value;w&&!w.contains(u)&&f()}function a(){}function s(){try{const k=localStorage.getItem("md_bg_recent");if(!k)return[];const u=JSON.parse(k);return Array.isArray(u)?u.slice(0,12):[]}catch{return[]}}function N(k){const u=[k,...c.value.filter(w=>w!==k)];c.value=u.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(c.value))}catch{}}let h=[];function y(){const k=r.editor;k&&(h=[{event:"selectionUpdate",handler:a},{event:"transaction",handler:a},{event:"update",handler:a}],h.forEach(({event:u,handler:w})=>{k.on(u,w)}))}e.onMounted(()=>{document.addEventListener("click",l),window.addEventListener(pe,_),y()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",l),window.removeEventListener(pe,_);const k=r.editor;k&&h.forEach(({event:u,handler:w})=>{k.off(u,w)}),h=[]}),e.watch(()=>r.editor,(k,u)=>{u&&h.forEach(({event:w,handler:M})=>{u.off(w,M)}),h=[],y()});function _(k){var w;((w=k.detail)==null?void 0:w.id)!==Be&&(o.value=!1)}return(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:d},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:u[0]||(u[0]=e.withModifiers(w=>g(b.value),["stop"]))},[e.createVNode(Y,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:b.value})},null,4)]),e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(V,["stop"])},[e.createVNode(e.unref(ne),{theme:"filled",strokeWidth:3,size:"12"})])],8,Pt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",Gt,[e.createElementVNode("div",qt,[u[4]||(u[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",Yt,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
3
3
|
45deg,
|
|
4
4
|
#fff 45%,
|
|
5
5
|
transparent 45%,
|
|
6
6
|
transparent 55%,
|
|
7
7
|
#fff 55%
|
|
8
|
-
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(g,["stop"])})])]),e.createElementVNode("div",qt,[i[5]||(i[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},[m===V.value?(e.openBlock(),e.createElementBlock("span",Zt,"✓")):e.createCommentVNode("",!0)],12,Kt))),128))])]),e.createElementVNode("div",Jt,[i[6]||(i[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},[m===V.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Qt))),128))])]),d.value.length?(e.openBlock(),e.createElementBlock("div",eo,[i[7]||(i[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",to,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"swatch",style:e.normalizeStyle({background:m}),onClick:e.withModifiers(M=>b(m),["stop"])},null,12,oo))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",no,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(g,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(w,["stop"])},"更多颜色")]),l.value?(e.openBlock(),e.createElementBlock("div",io,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":i[1]||(i[1]=m=>N.value=m)},null,512),[[e.vModelText,N.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":i[2]||(i[2]=m=>N.value=m)},null,512),[[e.vModelText,N.value]]),e.createElementVNode("button",{class:"btn apply",onClick:i[3]||(i[3]=e.withModifiers(m=>b(N.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-5ec8a99f"]]),lo={class:"image-actions"},so=["aria-disabled","disabled"],ao=I(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),l=e.ref(!1),h=e.ref(null),N=()=>{n.value=!n.value},d=()=>{var a,f,c,x,k,E;const g=o.value.trim();g&&((E=(k=((x=(f=(a=s.editor)==null?void 0:a.chain)==null?void 0:(c=f.call(a)).focus)==null?void 0:x.call(c)).setImage({src:g})).run)==null||E.call(k),n.value=!1,o.value="")},V=g=>{g.key==="Enter"&&d(),g.key==="Escape"&&(n.value=!1,o.value="")},y=()=>{var g;s.imageUploader&&((g=h.value)==null||g.click())},u=async g=>{var x,k,E,_,r,i,m,M;const a=g.target,f=(x=a.files)==null?void 0:x[0];if(a.value="",!f||!s.imageUploader)return;const c=(k=s.uploadSizeLimit)==null?void 0:k.image;if(typeof c=="number"&&c>0){const S=Math.max(1,c)*1024*1024;if(f.size>S){try{window.alert(`图片文件大小超限(${(f.size/1024/1024).toFixed(2)}MB > ${c}MB)`)}catch{}return}}try{l.value=!0;let S=null;S=URL.createObjectURL(f),(M=(m=((i=(_=(E=s.editor)==null?void 0:E.chain)==null?void 0:(r=_.call(E)).focus)==null?void 0:i.call(r)).setImage({src:S,uploading:!0})).run)==null||M.call(m);const T=await s.imageUploader(f);if(typeof T=="string"&&T){const O=s.editor,{state:D}=O,{doc:R}=D;let X=null;if(R.descendants((P,Z)=>{var Y,te;return((Y=P==null?void 0:P.type)==null?void 0:Y.name)==="image"&&((te=P==null?void 0:P.attrs)==null?void 0:te.src)===S?(X=Z,!1):!0}),X!=null){const P=R.nodeAt(X),Z=D.schema.nodes.image;if(P&&Z){const Y={...P.attrs||{},src:T,uploading:null},te=D.tr.setNodeMarkup(X,Z,Y,P.marks);O.view.dispatch(te)}}n.value=!1,o.value=""}}finally{l.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},w=e.ref(null);let b=null;return e.onMounted(()=>{b=g=>{if(!n.value)return;const a=w.value,f=g.target;a&&f&&!a.contains(f)&&(n.value=!1)},document.addEventListener("mousedown",b,!0)}),e.onBeforeUnmount(()=>{b&&(document.removeEventListener("mousedown",b,!0),b=null)}),(g,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:N,ref_key:"rootRef",ref:w},[e.createVNode(K,{name:"img",size:18}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":a[0]||(a[0]=f=>o.value=f),onKeydown:V},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:h,type:"file",accept:"image/*",style:{display:"none"},onChange:u},null,544),e.createElementVNode("div",lo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(d,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!s.imageUploader||l.value,disabled:!s.imageUploader||l.value,onClick:e.withModifiers(y,["stop"])},e.toDisplayString(l.value?"上传中…":"上传文件"),9,so)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-3208357f"]]),co={class:"video-actions"},fo=["aria-disabled","disabled"],mo=I(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),l=e.ref(!1),h=e.ref(null),N=()=>{n.value=!n.value},d=()=>{const a=o.value.trim();if(!a)return;const f=s.editor,c=f==null?void 0:f.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(a)){const k=String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{f.chain().focus().insertContent(`<p><a href="${k}" target="_blank" rel="noopener noreferrer">${k}</a></p>`).run()}catch{f.chain().focus().insertContent(k).run()}}else if(typeof(c==null?void 0:c.setVideo)=="function")f.chain().focus().setVideo({src:a,HTMLAttributes:{controls:!0,width:640}}).run();else{const k=String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{f.chain().focus().insertContent(`<p><a href="${k}" target="_blank" rel="noopener noreferrer">${k}</a></p>`).run()}catch{f.chain().focus().insertContent(k).run()}}n.value=!1,o.value=""},V=a=>{a.key==="Enter"&&d(),a.key==="Escape"&&(n.value=!1,o.value="")},y=()=>{var a;s.videoUploader&&((a=h.value)==null||a.click())},u=async a=>{var E,_;const f=a.target,c=(E=f.files)==null?void 0:E[0];if(f.value="",!c||!s.videoUploader)return;const x=(_=s.uploadSizeLimit)==null?void 0:_.video;if(typeof x=="number"&&x>0){const r=Math.max(1,x)*1024*1024;if(c.size>r){try{window.alert(`视频文件大小超限(${(c.size/1024/1024).toFixed(2)}MB > ${x}MB)`)}catch{}return}}let k=null;try{l.value=!0;const r=s.editor,i=r==null?void 0:r.commands;k=URL.createObjectURL(c);try{if(typeof(i==null?void 0:i.setVideo)=="function")r.chain().focus().setVideo({src:k,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const M=String(k).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{r.chain().focus().insertContent(`<p><a href="${M}" target="_blank" rel="noopener noreferrer">${M}</a></p>`).run()}catch{r.chain().focus().insertContent(M).run()}}}catch{}const m=await s.videoUploader(c);k&&w(k,m),n.value=!1,o.value=""}finally{l.value=!1;try{k&&URL.revokeObjectURL(k)}catch{}}};function w(a,f){const c=s.editor;if(!c)return;const{state:x}=c,{doc:k}=x;let E=null;if(k.descendants((_,r)=>{var i,m;return((i=_.type)==null?void 0:i.name)==="video"&&((m=_.attrs)==null?void 0:m.src)===a?(E=r,!1):!0}),E!=null){const _=k.nodeAt(E),r=x.schema.nodes.video;if(!_||!r)return;const i={..._.attrs||{},src:f,uploading:null},m=x.tr.setNodeMarkup(E,r,i,_.marks);c.view.dispatch(m)}}const b=e.ref(null);let g=null;return e.onMounted(()=>{g=a=>{if(!n.value)return;const f=b.value,c=a.target;f&&c&&!f.contains(c)&&(n.value=!1)},document.addEventListener("mousedown",g,!0)}),e.onBeforeUnmount(()=>{g&&(document.removeEventListener("mousedown",g,!0),g=null)}),(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:N,ref_key:"rootRef",ref:b},[e.createVNode(K,{name:"video",size:16}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:f[1]||(f[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":f[0]||(f[0]=c=>o.value=c),onKeydown:V},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:h,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:u},null,544),e.createElementVNode("div",co,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(d,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!s.videoUploader||l.value,disabled:!s.videoUploader||l.value,onClick:e.withModifiers(y,["stop"])},e.toDisplayString(l.value?"上传中…":"上传文件"),9,fo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-eef6665b"]]),ho={class:"field"},uo={class:"field"},po={class:"actions"},ko=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(""),l=e.ref("");e.ref(!1);const h=e.ref(null);function N(){const a=s.editor;if(!n.value&&a)try{const f=a.state.selection,c=f.from;f.to>c?V():(o.value="链接",a.chain().focus().insertContent("链接").setTextSelection({from:c,to:c+2}).run())}catch{}n.value=!n.value,n.value&&d()}function d(){setTimeout(()=>{var f;const a=(f=h.value)==null?void 0:f.querySelector('input[name="link-text"]');a==null||a.focus(),a==null||a.select()},0)}function V(){const a=s.editor;if(a)try{const f=a.state.selection,c=f.from,x=f.to,E=x>c?a.state.doc.textBetween(c,x):"";o.value=E||"";const _=a.getAttributes("link")||{};l.value=typeof _.href=="string"?_.href:""}catch{}}function y(){const a=s.editor;if(!a)return;const f=o.value.trim(),c=l.value.trim();if(c)try{const x=a.state.selection,k=x.from,E=x.to;if(E>k){const r=u(f||a.state.doc.textBetween(k,E)),i=u(c);a.chain().focus().insertContent(`<a href="${i}" target="_blank" rel="noopener noreferrer">${r}</a>`,{from:k,to:E}).run()}else{const r=u(c),i=u(f||c);a.chain().focus().insertContent(`<a href="${r}" target="_blank" rel="noopener noreferrer">${i}</a>`).run()}}finally{n.value=!1,o.value="",l.value=""}}function u(a){return String(a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w(a){a.key==="Enter"&&y(),a.key==="Escape"&&(n.value=!1)}let b=null;e.onMounted(()=>{b=a=>{if(!n.value)return;const f=h.value,c=a.target;f&&c&&!f.contains(c)&&(n.value=!1)},document.addEventListener("mousedown",b,!0)}),e.onBeforeUnmount(()=>{b&&(document.removeEventListener("mousedown",b,!0),b=null)});const g=e.ref({});return e.watch(n,async a=>{var c;if(!a)return;const f=s.editor;if(f){await e.nextTick();try{const x=f.state.selection,k=x.from,E=x.to;if(!(E>k)){g.value={};return}const r=f.view.coordsAtPos(k),i=f.view.coordsAtPos(E),m=(r.left+i.right)/2,M=Math.max(r.bottom,i.bottom)+8,S=(c=h.value)==null?void 0:c.querySelector(".link-input-panel"),T=S?S.getBoundingClientRect():{width:320,height:120},O=window.innerWidth,D=window.innerHeight,R=12,X=Math.max(R+T.width/2,Math.min(O-R-T.width/2,m)),P=M,Z=Math.min(r.top,i.top)-T.height-8;let Y=P;P+T.height+R>D&&Z-R>=0&&(Y=Z),Y=Math.max(R,Math.min(D-R-T.height,Y)),g.value={position:"fixed",left:Math.round(X)+"px",top:Math.round(Y)+"px"}}catch{}}}),(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:N,ref_key:"rootRef",ref:h},[e.createVNode(K,{name:"link",size:16}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(g.value),onClick:f[2]||(f[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ho,[f[3]||(f[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":f[0]||(f[0]=c=>o.value=c),onKeydown:w},null,544),[[e.vModelText,o.value]])]),e.createElementVNode("div",uo,[f[4]||(f[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":f[1]||(f[1]=c=>l.value=c),placeholder:"链接地址",onKeydown:w},null,544),[[e.vModelText,l.value]])]),e.createElementVNode("div",po,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(y,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b5bf35e2"]]),go={class:"grid"},wo=["onMouseenter"],Co={class:"size"},yo=10,bo=10,xo=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=e.ref(0),l=e.ref(0),h=e.computed(()=>{const y=Math.max(o.value,1),u=Math.max(l.value,1);return`${y} x ${u}`}),N=()=>{n.value=!n.value,n.value||(o.value=0,l.value=0)},d=(y,u)=>{o.value=y,l.value=u},V=()=>{var w,b,g,a,f,c,x,k;const y=Math.max(o.value,1),u=Math.max(l.value,1);(k=(c=(a=(b=(w=s.editor)==null?void 0:w.chain)==null?void 0:(g=b.call(w)).focus)==null?void 0:(f=a.call(g)).insertTable)==null?void 0:(x=c.call(f,{rows:y,cols:u,withHeaderRow:!0})).run)==null||k.call(x),n.value=!1,o.value=0,l.value=0};return(y,u)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:N},[e.createVNode(K,{name:"table",size:16}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},[u[1]||(u[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",go,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(yo,w=>e.createElementVNode("div",{key:"r-"+w,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(bo,b=>e.createElementVNode("span",{key:"c-"+w+"-"+b,class:e.normalizeClass(["cell",{active:w<=o.value&&b<=l.value}]),onMouseenter:g=>d(w,b),onClick:e.withModifiers(V,["stop"])},null,42,wo)),64))])),64))]),e.createElementVNode("div",Co,e.toDisplayString(h.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ad6f66b7"]]),Vo=["aria-disabled"],No={class:"tools-grid"},_o=["disabled"],Lo=["disabled"],Eo=["disabled"],Mo=["disabled"],Bo=["disabled"],zo=["disabled"],$o=["disabled"],vo=["disabled"],So=["disabled"],To=["disabled"],Fo=["disabled"],jo=["disabled"],Ho=["disabled"],Do=["disabled"],Ao=["disabled"],Uo=["disabled"],Wo=["disabled"],Io=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=e.ref(!1),o=()=>n.value=!n.value,l=(N,...d)=>{var y,u,w;const V=s.editor;return!!((w=(y=V==null?void 0:V.can)==null?void 0:(u=y.call(V))[N])!=null&&w.call(u,...d))},h=(N,...d)=>{var y,u,w,b,g,a,f;const V=s.editor;(f=(a=(g=(b=(w=(y=V==null?void 0:V.chain)==null?void 0:(u=y.call(V)).focus)==null?void 0:w.call(u))[N])==null?void 0:g.call(b,...d))==null?void 0:a.run)==null||f.call(a),n.value=!1};return(N,d)=>{var V,y;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:o,"aria-disabled":!((y=(V=s.editor)==null?void 0:V.isActive)!=null&&y.call(V,"table"))},[e.createVNode(K,{name:"tableTools",size:15}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:d[17]||(d[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",No,[e.createElementVNode("button",{class:"btn",onClick:d[0]||(d[0]=e.withModifiers(u=>h("addColumnBefore"),["stop"])),disabled:!l("addColumnBefore")}," 前插列 ",8,_o),e.createElementVNode("button",{class:"btn",onClick:d[1]||(d[1]=e.withModifiers(u=>h("addColumnAfter"),["stop"])),disabled:!l("addColumnAfter")}," 后插列 ",8,Lo),e.createElementVNode("button",{class:"btn",onClick:d[2]||(d[2]=e.withModifiers(u=>h("deleteColumn"),["stop"])),disabled:!l("deleteColumn")}," 删除列 ",8,Eo),e.createElementVNode("button",{class:"btn",onClick:d[3]||(d[3]=e.withModifiers(u=>h("addRowBefore"),["stop"])),disabled:!l("addRowBefore")}," 前插行 ",8,Mo),e.createElementVNode("button",{class:"btn",onClick:d[4]||(d[4]=e.withModifiers(u=>h("addRowAfter"),["stop"])),disabled:!l("addRowAfter")}," 后插行 ",8,Bo),e.createElementVNode("button",{class:"btn",onClick:d[5]||(d[5]=e.withModifiers(u=>h("deleteRow"),["stop"])),disabled:!l("deleteRow")}," 删除行 ",8,zo),e.createElementVNode("button",{class:"btn",onClick:d[6]||(d[6]=e.withModifiers(u=>h("deleteTable"),["stop"])),disabled:!l("deleteTable")}," 删除表 ",8,$o),e.createElementVNode("button",{class:"btn",onClick:d[7]||(d[7]=e.withModifiers(u=>h("mergeCells"),["stop"])),disabled:!l("mergeCells")}," 合并单元格 ",8,vo),e.createElementVNode("button",{class:"btn",onClick:d[8]||(d[8]=e.withModifiers(u=>h("splitCell"),["stop"])),disabled:!l("splitCell")}," 拆分单元格 ",8,So),e.createElementVNode("button",{class:"btn",onClick:d[9]||(d[9]=e.withModifiers(u=>h("mergeOrSplit"),["stop"])),disabled:!l("mergeOrSplit")}," 合并/拆分 ",8,To),e.createElementVNode("button",{class:"btn",onClick:d[10]||(d[10]=e.withModifiers(u=>h("toggleHeaderRow"),["stop"])),disabled:!l("toggleHeaderRow")}," 切换表头行 ",8,Fo),e.createElementVNode("button",{class:"btn",onClick:d[11]||(d[11]=e.withModifiers(u=>h("toggleHeaderColumn"),["stop"])),disabled:!l("toggleHeaderColumn")}," 切换表头列 ",8,jo),e.createElementVNode("button",{class:"btn",onClick:d[12]||(d[12]=e.withModifiers(u=>h("toggleHeaderCell"),["stop"])),disabled:!l("toggleHeaderCell")}," 切换表头单元 ",8,Ho),e.createElementVNode("button",{class:"btn",onClick:d[13]||(d[13]=e.withModifiers(u=>h("fixTables"),["stop"])),disabled:!l("fixTables")}," 修复表格 ",8,Do),e.createElementVNode("button",{class:"btn",onClick:d[14]||(d[14]=e.withModifiers(u=>h("goToNextCell"),["stop"])),disabled:!l("goToNextCell")}," 下个单元格 ",8,Ao),e.createElementVNode("button",{class:"btn",onClick:d[15]||(d[15]=e.withModifiers(u=>h("goToPreviousCell"),["stop"])),disabled:!l("goToPreviousCell")}," 上个单元格 ",8,Uo),e.createElementVNode("button",{class:"btn",onClick:d[16]||(d[16]=e.withModifiers(u=>h("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!l("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,Wo)])])):e.createCommentVNode("",!0)],8,Vo)}}}),[["__scopeId","data-v-89ddb4db"]]),Oo=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t;typeof navigator<"u"&&navigator.platform.includes("Mac");function n(){const o=s.editor;if(o){o.chain().focus().toggleTaskList().run();try{const{state:l}=o,h=l.selection;let N=null;l.doc.nodesBetween(Math.max(0,h.from-5),Math.min(l.doc.content.size,h.to+5),(d,V)=>{var y;return((y=d==null?void 0:d.type)==null?void 0:y.name)==="taskItem"&&N==null?(N=V,!1):!0}),N!=null&&o.commands.setTextSelection(N+1)}catch{}}}return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(K,{name:"task",size:17})]))}}),[["__scopeId","data-v-0b74c17c"]]),Ro=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t;function n(){const o=s.editor;o&&o.chain().focus().toggleBlockquote().run()}return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(K,{name:"quote",size:18})]))}}),[["__scopeId","data-v-bf6f40c3"]]),Po=["aria-expanded"],Go={class:"label"},qo={key:0,class:"dropdown",role:"listbox"},Yo=["aria-selected","onClick"],Ko={class:"shortcut"},ke="md-toolbar-dropdown-open",_e="heading-select",Zo=I(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const s=t,n=typeof navigator<"u"&&navigator.platform.includes("Mac"),o={0:n?"⌥ ⌘ 0":"Ctrl Alt 0",1:n?"⌥ ⌘ 1":"Ctrl Alt 1",2:n?"⌥ ⌘ 2":"Ctrl Alt 2",3:n?"⌥ ⌘ 3":"Ctrl Alt 3",4:n?"⌥ ⌘ 4":"Ctrl Alt 4",5:n?"⌥ ⌘ 5":"Ctrl Alt 5",6:n?"⌥ ⌘ 6":"Ctrl Alt 6"},l=[{label:"正文",level:null,shortcut:o[0]},{label:"标题1",level:1,shortcut:o[1]},{label:"标题2",level:2,shortcut:o[2]},{label:"标题3",level:3,shortcut:o[3]},{label:"标题4",level:4,shortcut:o[4]},{label:"标题5",level:5,shortcut:o[5]},{label:"标题6",level:6,shortcut:o[6]}],h=e.computed(()=>{var f,c;const a=s.editor;if(!a)return null;for(let x=1;x<=6;x++)if((f=a.isActive)!=null&&f.call(a,"heading",{level:x}))return x;return(c=a.isActive)!=null&&c.call(a,"paragraph"),null}),N=e.computed(()=>{const a=h.value;return a?`标题${a}`:"正文"}),d=e.ref(!1),V=e.ref(null);function y(){d.value||window.dispatchEvent(new CustomEvent(ke,{detail:{id:_e}})),d.value=!d.value}function u(){d.value=!1}function w(a){var c,x,k,E,_,r,i,m,M,S;const f=(E=(x=(c=s.editor)==null?void 0:c.chain)==null?void 0:(k=x.call(c)).focus)==null?void 0:E.call(k);f&&(a.level===null?(i=(_=f.setParagraph)==null?void 0:(r=_.call(f)).run)==null||i.call(r):(S=(M=(m=f.toggleHeading)==null?void 0:m.call(f,{level:a.level}))==null?void 0:M.run)==null||S.call(M),u())}function b(a){const f=a.target,c=V.value;c&&!c.contains(f)&&u()}function g(a){var c;((c=a.detail)==null?void 0:c.id)!==_e&&(d.value=!1)}return e.onMounted(()=>{document.addEventListener("click",b),window.addEventListener(ke,g)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",b),window.removeEventListener(ke,g)}),(a,f)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:V},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(y,["stop"]),"aria-expanded":d.value},[e.createElementVNode("div",Go,e.toDisplayString(N.value),1),e.createVNode(e.unref(se),{theme:"filled",strokeWidth:3})],8,Po),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",qo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(l,c=>e.createElementVNode("div",{key:c.label,class:"dropdown-item","aria-selected":c.level===h.value,onClick:e.withModifiers(x=>w(c),["stop"])},[c.level===h.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:c.level===null,"level-1":c.level===1,"level-2":c.level===2,"level-3":c.level===3,"level-4":c.level===4,"level-5":c.level===5,"level-6":c.level===6}])},e.toDisplayString(c.label),3),e.createElementVNode("span",Ko,e.toDisplayString(c.shortcut),1)],8,Yo)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-fceb28df"]]),Jo={class:"header_box"},Xo=["aria-disabled"],Qo=["aria-disabled"],en=I(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{}},emits:["openLinkModal"],setup(t,{emit:s}){const n=t,o=(_,r)=>{var i,m;return(m=(i=n.editor)==null?void 0:i.isActive)==null?void 0:m.call(i,_,r)},l=(_,r)=>{var M,S,T,O,D,R;const i=n.editor;if(!i)return;const m=(T=(M=i.chain)==null?void 0:(S=M.call(i)).focus)==null?void 0:T.call(S);return(R=(D=(O=m==null?void 0:m[_])==null?void 0:O.call(m))==null?void 0:D.run)==null?void 0:R.call(D)},h=_=>{var r,i,m,M,S,T,O,D;return(D=(T=(M=(i=(r=n.editor)==null?void 0:r.chain)==null?void 0:(m=i.call(r)).focus)==null?void 0:(S=M.call(m)).setTextAlign)==null?void 0:(O=T.call(S,_)).run)==null?void 0:D.call(O)},N=_=>{var r,i;return!!((i=(r=n.editor)==null?void 0:r.isActive)!=null&&i.call(r,{textAlign:_}))},d=()=>{var _,r,i,m;try{return!!((m=(r=(_=n.editor)==null?void 0:_.can)==null?void 0:(i=r.call(_)).undo)!=null&&m.call(i))}catch{return!1}},V=()=>{var _,r,i,m;try{return!!((m=(r=(_=n.editor)==null?void 0:_.can)==null?void 0:(i=r.call(_)).redo)!=null&&m.call(i))}catch{return!1}},y=()=>{var _,r,i;d()&&((i=(r=(_=n.editor)==null?void 0:_.commands)==null?void 0:r.undo)==null||i.call(r))},u=()=>{var _,r,i;return(i=(r=(_=n.editor)==null?void 0:_.commands)==null?void 0:r.redo)==null?void 0:i.call(r)},w=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",b=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",g=typeof navigator<"u"&&navigator.platform.includes("Mac"),a=g?"⌘ B":"Ctrl B",f=g?"⌘ I":"Ctrl I",c=g?"⌘ U":"Ctrl U",x=g?"⇧ ⌘ X":"Ctrl Shift X",k=g?"⇧ ⌘ 8":"Ctrl Shift 8",E=g?"⇧ ⌘ 7":"Ctrl Shift 7";return(_,r)=>(e.openBlock(),e.createElementBlock("div",Jo,[e.createElementVNode("div",{class:"icon","aria-disabled":!d(),onClick:y},[e.createVNode(e.unref(q),{text:"撤销",shortcut:e.unref(w),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(it),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Xo),e.createElementVNode("div",{class:"icon","aria-disabled":!V(),onClick:u},[e.createVNode(e.unref(q),{text:"重做",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Qe),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Qo),e.createVNode(e.unref(Zo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(gt),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bold")}]),onClick:r[0]||(r[0]=i=>l("toggleBold"))},[e.createVNode(e.unref(q),{text:"加粗",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(lt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("italic")}]),onClick:r[1]||(r[1]=i=>l("toggleItalic"))},[e.createVNode(e.unref(q),{text:"斜体",shortcut:e.unref(f),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("strike")}]),onClick:r[2]||(r[2]=i=>l("toggleStrike"))},[e.createVNode(e.unref(q),{text:"删除线",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(rt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("underline")}]),onClick:r[3]||(r[3]=i=>l("toggleUnderline"))},[e.createVNode(e.unref(q),{text:"下划线",shortcut:e.unref(c),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref($t),{editor:n.editor,currentColor:n.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(ro),{editor:n.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:N("left")}]),onClick:r[4]||(r[4]=i=>h("left"))},[e.createVNode(e.unref(q),{text:"左对齐",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ze),{theme:"outline",strokeWidth:3})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:N("center")}]),onClick:r[5]||(r[5]=i=>h("center"))},[e.createVNode(e.unref(q),{text:"居中对齐",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ke),{theme:"outline",strokeWidth:3})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:N("right")}]),onClick:r[6]||(r[6]=i=>h("right"))},[e.createVNode(e.unref(q),{text:"右对齐",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Je),{theme:"outline",strokeWidth:3})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:N("justify")}]),onClick:r[7]||(r[7]=i=>h("justify"))},[e.createVNode(e.unref(q),{text:"两端对齐",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ye),{theme:"outline",strokeWidth:3})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bulletList")}]),onClick:r[8]||(r[8]=i=>l("toggleBulletList"))},[e.createVNode(e.unref(q),{text:"无序列表",shortcut:e.unref(k),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(et),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("orderedList")}]),onClick:r[9]||(r[9]=i=>l("toggleOrderedList"))},[e.createVNode(e.unref(q),{text:"有序列表",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(tt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Oo),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("code")}]),onClick:r[10]||(r[10]=i=>l("toggleCode"))},[e.createVNode(K,{name:"code",size:18})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("codeBlock")}]),onClick:r[11]||(r[11]=i=>l("toggleCodeBlock"))},[e.createVNode(K,{name:"codeBlock",size:16})],2),e.createVNode(e.unref(Ro),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(ko),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(ao),{editor:n.editor,imageUploader:n.imageUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(mo),{editor:n.editor,videoUploader:n.videoUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(xo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Io),{editor:n.editor},null,8,["editor"])]))}}),[["__scopeId","data-v-6cce30ab"]]),tn={class:"outline__header"},on={style:{cursor:"pointer","margin-top":"5px"}},nn={class:"outline__listWrap"},rn={class:"outline__list"},ln=["onClick"],sn=["onClick"],an=I(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:s}){const n=t,o=s;function l(c){g(c),o("select",c)}function h(){o("update:open",!1),o("update:pinned",!1)}function N(){n.pinned||h()}function d(c){const x=[],k=[];for(const E of c){const _={...E,children:[]};for(;k.length&&k[k.length-1].level>=_.level;)k.pop();k.length?k[k.length-1].children.push(_):x.push(_),k.push(_)}return x}const V=e.ref(new Set);function y(c){return V.value.has(c.pos)}function u(c){const x=V.value;x.has(c.pos)?x.delete(c.pos):x.add(c.pos),V.value=new Set(x)}const w=e.computed(()=>d(n.items||[])),b=e.computed(()=>{const c=[],x=k=>{for(const E of k)c.push({node:E,level:E.level,hasChildren:E.children.length>0}),V.value.has(E.pos)||x(E.children)};return x(w.value),c});function g(c){const x=e.unref(n.editor);if(!x)return;const{doc:k}=x.state,E=k.nodeAt(c.pos),_=Math.max(1,k.content.size-1);let r=c.pos+1;E&&E.type.name==="heading"&&(r=c.pos+E.nodeSize-1),r=Math.min(Math.max(1,r),_),x.chain().focus().setTextSelection(r).run();const i=e.unref(n.container)??null,m=x.view.coordsAtPos(r),M=n.offset??8,S=n.duration??700;if(i){const T=i.getBoundingClientRect(),O=i.scrollTop+m.top-T.top-M;a(i,O,S)}else{const T=(window.scrollY||window.pageYOffset)+m.top-M;f(T,S)}}function a(c,x,k=600){const E=c.scrollTop,_=x-E,r=performance.now(),i=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function m(M){const S=M-r,T=Math.min(1,S/k);c.scrollTop=E+_*i(T),T<1&&requestAnimationFrame(m)}requestAnimationFrame(m)}function f(c,x=600){const k=window.scrollY||window.pageYOffset,E=c-k,_=performance.now(),r=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2;function i(m){const M=m-_,S=Math.min(1,M/x),T=k+E*r(S);window.scrollTo(0,T),S<1&&requestAnimationFrame(i)}requestAnimationFrame(i)}return(c,x)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:x[1]||(x[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:n.open}]),style:e.normalizeStyle({maxHeight:typeof n.maxHeight=="number"?n.maxHeight+"px":n.maxHeight}),onMouseleave:N},[e.createElementVNode("div",tn,[x[2]||(x[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",on,[n.open&&!n.pinned?(e.openBlock(),e.createBlock(e.unref(nt),{key:0,onClick:x[0]||(x[0]=k=>c.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),n.pinned?(e.openBlock(),e.createBlock(e.unref(ot),{key:1,onClick:h,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",nn,[e.createElementVNode("ul",rn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(k,E)=>(e.openBlock(),e.createElementBlock("li",{key:k.node.pos+"-"+E,class:e.normalizeClass(["outline__item","lv-"+k.level])},[k.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:y(k.node),expanded:!y(k.node)}]),onClick:e.withModifiers(_=>u(k.node),["stop"]),title:"展开/收起"},[...x[3]||(x[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,ln)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:_=>l(k.node)},e.toDisplayString(k.node.text||"(无标题)"),9,sn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[n.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:h})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-b5f802fc"]]),cn=["onClick"],Le=I(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:s,emit:n}){const o=t,l=n,h=e.ref(null);let N=!1;const d=e.ref(!1),V=e.ref(""),y=e.ref([]),u=e.ref("#000000"),w=e.ref(!0),b=e.ref(!0),g=e.ref(null),a=e.ref(void 0),f=e.ref([]),c=e.ref(null),x=()=>{const p=g.value;a.value=p?p.clientHeight:void 0};let k=null;e.onMounted(()=>{x(),k=()=>x(),window.addEventListener("resize",k),e.nextTick(()=>{const p=g.value;p&&p.addEventListener("scroll",ae,{passive:!0})})}),e.onBeforeUnmount(()=>{k&&(window.removeEventListener("resize",k),k=null);const p=g.value;p&&p.removeEventListener("scroll",ae)}),e.watch([()=>o.height,w],async()=>{await e.nextTick(),x(),ae()});const E=e.computed(()=>{const C=(L=>L==null?void 0:typeof L=="number"?`${L}px`:L)(o.height);return{height:C,"--editor-height":C,"--editor-caret-color":o.caretColor||"#000"}}),_=fe.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:p=>p.style.fontSize||null,renderHTML:p=>p.fontSize?{style:`font-size: ${p.fontSize}`}:{}}}},addCommands(){return{setFontSize:p=>({chain:C})=>C().setMark("textStyle",{fontSize:p}).run(),unsetFontSize:()=>({chain:p})=>p().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),r=fe.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:p=>p.style.backgroundColor||null,renderHTML:p=>p.backgroundColor?{style:`background-color: ${p.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:p=>({chain:C})=>C().setMark("textStyle",{backgroundColor:p}).run(),unsetBackgroundColor:()=>({chain:p})=>p().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{h.value=new Ce.Editor({extensions:[ze.StarterKit.configure({dropcursor:!1}),De.Dropcursor.configure({color:"#22c55e",width:2}),be.TaskList,Oe,Ue.configure({inline:!0,allowBase64:!0}),Ie.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),$e.Markdown,ye.TableKit.configure({table:{resizable:!0},tableCell:!1}),We,fe.TextStyle,_,r,je.Color,He.Underline,Te.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Fe.TextAlign.configure({types:["heading","paragraph"]}),Se.Placeholder.configure({placeholder:o.placeholder??"输入 / 以插入块"})],content:o.markdown!=null?String(o.markdown||""):String(o.modelValue||""),contentType:o.markdown!=null?"markdown":/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(o.modelValue||""))?"html":"markdown",editable:!0,autofocus:!0,editorProps:{handlePaste(p,C){var ne,ie,Me;const L=C.clipboardData;if(!L)return!1;const z=L.files&&L.files.length?Array.from(L.files):[],B=z.find(W=>{var G;return(G=W.type)==null?void 0:G.startsWith("image/")});if(B){if(C.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(B),!0}const $=z.find(W=>{var G;return(G=W.type)==null?void 0:G.startsWith("video/")});if($)return C.preventDefault(),Z($),!0;const F=(L.items?Array.from(L.items):[]).find(W=>W.kind==="file"),A=F?F.getAsFile():null;if(A&&A.type.startsWith("image/")){if(C.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(A),!0}if(A&&A.type.startsWith("video/"))return C.preventDefault(),Z(A),!0;const H=L.getData("text/html");if(H){const W=H.match(/<img[^>]+src=["']([^"']+)["']/i),G=H.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(W&&G&&G[1]){C.preventDefault();const le=G[1];if(o.imageUploader&&/^data:image\//i.test(le)){const ce=D(le,"clipboard.png");S(ce)}else{if(/^data:image\//i.test(le)){const ce=D(le,"clipboard.png"),we=(ne=o.uploadSizeLimit)==null?void 0:ne.image;if(we){const hn=Math.max(1,we)*1024*1024;if(ce.size>hn){try{window.alert(`图片文件大小超限(${(ce.size/1024/1024).toFixed(2)}MB > ${we}MB)`)}catch{}return!0}}}i(le)}return!0}const ee=H.match(/<video[^>]+src=["']([^"']+)["']/i),J=H.match(/<source[^>]+src=["']([^"']+)["']/i),re=H.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Be=ee&&ee[1]||J&&J[1];if(Be&&re)return C.preventDefault(),M(Be),!0}const Q=L.getData("text/plain");if(Q){const W=Q.trim(),G=P(W);if(R(W)&&W===Q.trim()){if(C.preventDefault(),/^data:image\//i.test(W)){const ee=D(W,"clipboard.png"),J=(ie=o.uploadSizeLimit)==null?void 0:ie.image;if(J){const re=Math.max(1,J)*1024*1024;if(ee.size>re){try{window.alert(`图片文件大小超限(${(ee.size/1024/1024).toFixed(2)}MB > ${J}MB)`)}catch{}return!0}}}return i(W),!0}if(G){if(C.preventDefault(),/^data:image\//i.test(G)){const ee=D(G,"clipboard.png"),J=(Me=o.uploadSizeLimit)==null?void 0:Me.image;if(J){const re=Math.max(1,J)*1024*1024;if(ee.size>re){try{window.alert(`图片文件大小超限(${(ee.size/1024/1024).toFixed(2)}MB > ${J}MB)`)}catch{}return!0}}}return i(G),!0}if(X(W)&&W===Q.trim())return C.preventDefault(),M(W),!0}return!1},handleDrop(p,C){const L=C.dataTransfer;if(!L)return!1;const B=(L.files?Array.from(L.files):[]).find($=>{var v;return(v=$.type)==null?void 0:v.startsWith("image/")});if(B){if(C.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(B),!0}return!1},handleClick(p,C,L){const z=L,B=z.target,$=B?B.closest("a[href]"):null;if($&&(z.ctrlKey||z.metaKey)){const v=$.getAttribute("href")||"";if(v){z.preventDefault();try{window.open(v,"_blank","noopener,noreferrer")}catch(F){console.warn("打开链接失败:",F)}return!0}}return!1}},onSelectionUpdate:p=>{var z;const L=((z=p.editor.getAttributes("textStyle"))==null?void 0:z.color)||"#000000";u.value=typeof L=="string"?L:"#000000"},onUpdate:()=>{const p=h.value;N=!0,l("update:modelValue",p.getHTML()),l("update:markdown",p.getMarkdown()),ge()},onTransaction:()=>{ge()}}),e.nextTick(()=>{var p;ge();try{(p=h.value)==null||p.chain().focus().run()}catch{}})}),e.onBeforeUnmount(()=>{var p;(p=h.value)==null||p.destroy()}),e.watch(()=>o.modelValue,p=>{if(N){N=!1;return}p!=null&&h.value&&e.nextTick(()=>{try{const C=/<\s*(video|iframe)\b|data-youtube-video/i.test(p),L=p.match(/\[video\]\(([^)]+)\)/i);if(!C&&L){const z=L[1],B=p.replace(/\[video\]\(([^)]+)\)/gi,($,v)=>`<video data-tiptap-video src="${v}" controls></video>`);h.value.commands.setContent(B,{contentType:"html"})}else h.value.commands.setContent(p,{contentType:C?"html":"markdown"})}catch(C){console.warn("setContent 失败,内容更新被忽略:",C)}})}),e.watch(()=>o.markdown,p=>{if(N){N=!1;return}p!=null&&h.value&&e.nextTick(()=>{try{h.value.commands.setContent(p,{contentType:"markdown"})}catch(C){console.warn("setContent 失败,内容更新被忽略:",C)}})});function i(p){var C;(C=h.value)==null||C.chain().focus().setImage({src:p}).run()}function m(p){return String(p).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(p){const C=h.value;if(!C)return;if(typeof C.commands.setVideo=="function"){C.chain().focus().setVideo({src:p,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const z=m(p);try{C.chain().focus().insertContent(`<p><a href="${z}" target="_blank" rel="noopener noreferrer">${z}</a></p>`).run()}catch{C.chain().focus().insertContent(z).run()}}async function S(p){var L,z;const C=(L=o.uploadSizeLimit)==null?void 0:L.image;if(C){const B=Math.max(1,C)*1024*1024;if(p.size>B){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${C}MB)`)}catch{}return}}if(o.imageUploader){const B=URL.createObjectURL(p);(z=h.value)==null||z.chain().focus().setImage({src:B,uploading:!0}).run();try{const $=await o.imageUploader(p);if(typeof $=="string"&&$){T(B,$);return}O(p,v=>T(B,v))}catch($){console.warn("图片上传失败,回退为 base64",$),O(p,v=>T(B,v))}finally{try{URL.revokeObjectURL(B)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function T(p,C){const L=h.value;if(!L)return;const{state:z}=L,{doc:B}=z;let $=null;if(B.descendants((v,F)=>{var A,H;return((A=v.type)==null?void 0:A.name)==="image"&&((H=v.attrs)==null?void 0:H.src)===p?($=F,!1):!0}),$!=null){const v=B.nodeAt($),F=z.schema.nodes.image;if(!v||!F)return;const A={...v.attrs||{},src:C,uploading:null},H=z.tr.setNodeMarkup($,F,A,v.marks);L.view.dispatch(H)}else i(C)}function O(p,C){const L=new FileReader;L.onload=()=>C(String(L.result||"")),L.readAsDataURL(p)}function D(p,C="image.png"){var F;const L=p.split(","),z=((F=L[0].match(/:(.*?);/))==null?void 0:F[1])||"image/png",B=atob(L[1]);let $=B.length;const v=new Uint8Array($);for(;$--;)v[$]=B.charCodeAt($);return new File([v],C,{type:z})}function R(p){return/^data:image\//i.test(p)||/^https?:\/\//i.test(p)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(p)}function X(p){return/^https?:\/\//i.test(p)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(p)}function P(p){const C=p.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!C)return null;const L=C[1].trim().replace(/^<|>$/g,"");return R(L)?L:null}async function Z(p){var z;const C=(z=o.uploadSizeLimit)==null?void 0:z.video;if(C){const B=Math.max(1,C)*1024*1024;if(p.size>B){try{window.alert(`视频文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${C}MB)`)}catch{}return}}if(o.videoUploader){const B=URL.createObjectURL(p),$=h.value,v=$==null?void 0:$.commands;try{typeof(v==null?void 0:v.setVideo)=="function"?$==null||$.chain().focus().setVideo({src:B,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():M(B)}catch{M(B)}try{const F=await o.videoUploader(p);Y(B,F)}catch(F){console.warn("视频上传失败,保留本地对象 URL 作为预览",F)}finally{try{URL.revokeObjectURL(B)}catch{}}return}const L=URL.createObjectURL(p);M(L)}function Y(p,C){const L=h.value;if(!L)return;const{state:z}=L,{doc:B}=z;let $=null;if(B.descendants((v,F)=>{var A,H;return((A=v.type)==null?void 0:A.name)==="video"&&((H=v.attrs)==null?void 0:H.src)===p?($=F,!1):!0}),$!=null){const v=B.nodeAt($),F=z.schema.nodes.video;if(!v||!F)return;const A={...v.attrs||{},src:C,uploading:null},H=z.tr.setNodeMarkup($,F,A,v.marks);L.view.dispatch(H)}}function te(){var p,C;V.value=((C=(p=h.value)==null?void 0:p.getAttributes("link"))==null?void 0:C.href)||"",d.value=!0}function ge(){const p=h.value;if(!p)return;const C=[];p.state.doc.descendants((L,z)=>{if(L.type.name==="heading"){const B=L.attrs.level||1,$=L.textContent||"";C.push({text:$,level:B,pos:z})}}),y.value=C,ae()}function ae(){const p=h.value,C=g.value,L=y.value;if(!p||!C||!L.length){f.value=[],c.value=null;return}const z=C.getBoundingClientRect(),B=C.scrollHeight||C.clientHeight,$=C.clientHeight||1,v=L.map(H=>{const ne=p.view.coordsAtPos(Math.min(H.pos+1,p.state.doc.content.size)).top-z.top+C.scrollTop,ie=B?Math.max(0,Math.min(1,ne/B)):0;return Math.round(ie*$)});f.value=v;const F=C.scrollTop+8;let A=null;for(let H=0;H<L.length;H++){const Q=L[H];if(p.view.coordsAtPos(Math.min(Q.pos+1,p.state.doc.content.size)).top-z.top+C.scrollTop<=F)A=Q.pos;else break}c.value=A}function fn(p){const C=p.target;C.closest(".outline")||C.closest(".outline-toggle")||h.value&&h.value.chain().focus().run()}function mn(){const p=h.value;return p?p.getMarkdown():""}return s({getMarkdown:mn}),(p,C)=>(e.openBlock(),e.createElementBlock("div",{class:"simple-editor",style:e.normalizeStyle(E.value)},[e.createVNode(e.unref(en),{editor:h.value,currentColor:u.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":o.uploadSizeLimit,onOpenLinkModal:te},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:w.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:g,class:"editor_wrapper",onClick:fn},[e.createVNode(e.unref(Ce.EditorContent),{editor:h.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(an),{open:w.value,"onUpdate:open":C[0]||(C[0]=L=>w.value=L),items:y.value,editor:h.value,container:g.value,maxHeight:a.value,pinned:b.value,"onUpdate:pinned":C[1]||(C[1]=L=>b.value=L)},null,8,["open","items","editor","container","maxHeight","pinned"]),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:C[2]||(C[2]=L=>(w.value=!0,b.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(L,z)=>{var B;return e.openBlock(),e.createElementBlock("span",{key:z,class:e.normalizeClass(["outline-marker",{active:((B=y.value[z])==null?void 0:B.pos)===c.value}]),style:e.normalizeStyle({top:(L||0)+"px"}),onClick:e.withModifiers($=>{var v,F;return(F=h.value)==null?void 0:F.chain().focus().setTextSelection((((v=y.value[z])==null?void 0:v.pos)||1)+1).run()},["stop"])},null,14,cn)}),128))],32))],2)],4))}}),[["__scopeId","data-v-c9ed96a6"]]),dn={install(t){t.component("Editor",Le)}};j.Editor=Le,j.default=dn,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
8
|
+
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(C,["stop"])})])]),e.createElementVNode("div",Kt,[u[5]||(u[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(0,9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},[w===b.value?(e.openBlock(),e.createElementBlock("span",Xt,"✓")):e.createCommentVNode("",!0)],12,Jt))),128))])]),e.createElementVNode("div",Qt,[u[6]||(u[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",eo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.slice(9),w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},[w===b.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,to))),128))])]),c.value.length?(e.openBlock(),e.createElementBlock("div",oo,[u[7]||(u[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",no,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"swatch",style:e.normalizeStyle({background:w}),onClick:e.withModifiers(M=>g(w),["stop"])},null,12,io))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ro,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(C,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(m,["stop"])},"更多颜色")]),i.value?(e.openBlock(),e.createElementBlock("div",lo,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":u[1]||(u[1]=w=>E.value=w)},null,512),[[e.vModelText,E.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":u[2]||(u[2]=w=>E.value=w)},null,512),[[e.vModelText,E.value]]),e.createElementVNode("button",{class:"btn apply",onClick:u[3]||(u[3]=e.withModifiers(w=>g(E.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-5ec8a99f"]]),ao={class:"image-actions"},co=["aria-disabled","disabled"],fo=U(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const r=t,n=e.ref(!1),o=e.ref(""),i=e.ref(!1),d=e.ref(null),E=()=>{n.value=!n.value},c=()=>{var l,a,s,N,h,y;const C=o.value.trim();C&&((y=(h=((N=(a=(l=r.editor)==null?void 0:l.chain)==null?void 0:(s=a.call(l)).focus)==null?void 0:N.call(s)).setImage({src:C})).run)==null||y.call(h),n.value=!1,o.value="")},b=C=>{C.key==="Enter"&&c(),C.key==="Escape"&&(n.value=!1,o.value="")},V=()=>{var C;r.imageUploader&&((C=d.value)==null||C.click())},f=async C=>{var N,h,y,_,k,u,w,M;const l=C.target,a=(N=l.files)==null?void 0:N[0];if(l.value="",!a||!r.imageUploader)return;const s=(h=r.uploadSizeLimit)==null?void 0:h.image;if(typeof s=="number"&&s>0){const S=Math.max(1,s)*1024*1024;if(a.size>S){try{window.alert(`图片文件大小超限(${(a.size/1024/1024).toFixed(2)}MB > ${s}MB)`)}catch{}return}}try{i.value=!0;let S=null;S=URL.createObjectURL(a),(M=(w=((u=(_=(y=r.editor)==null?void 0:y.chain)==null?void 0:(k=_.call(y)).focus)==null?void 0:u.call(k)).setImage({src:S,uploading:!0})).run)==null||M.call(w);const T=await r.imageUploader(a);if(typeof T=="string"&&T){const R=r.editor,{state:G}=R,{doc:P}=G;let X=null;if(P.descendants((I,K)=>{var q,te;return((q=I==null?void 0:I.type)==null?void 0:q.name)==="image"&&((te=I==null?void 0:I.attrs)==null?void 0:te.src)===S?(X=K,!1):!0}),X!=null){const I=P.nodeAt(X),K=G.schema.nodes.image;if(I&&K){const q={...I.attrs||{},src:T,uploading:null},te=G.tr.setNodeMarkup(X,K,q,I.marks);R.view.dispatch(te)}}n.value=!1,o.value=""}}finally{i.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},m=e.ref(null);let g=null;return e.onMounted(()=>{g=C=>{if(!n.value)return;const l=m.value,a=C.target;l&&a&&!l.contains(a)&&(n.value=!1)},document.addEventListener("mousedown",g,!0)}),e.onBeforeUnmount(()=>{g&&(document.removeEventListener("mousedown",g,!0),g=null)}),(C,l)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:E,ref_key:"rootRef",ref:m},[e.createVNode(Y,{name:"img",size:18}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":l[0]||(l[0]=a=>o.value=a),onKeydown:b},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:d,type:"file",accept:"image/*",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",ao,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(c,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.imageUploader||i.value,disabled:!r.imageUploader||i.value,onClick:e.withModifiers(V,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,co)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-3208357f"]]),mo={class:"video-actions"},ho=["aria-disabled","disabled"],uo=U(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const r=t,n=e.ref(!1),o=e.ref(""),i=e.ref(!1),d=e.ref(null),E=()=>{n.value=!n.value},c=()=>{const l=o.value.trim();if(!l)return;const a=r.editor,s=a==null?void 0:a.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(l)){const h=String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{a.chain().focus().insertContent(`<p><a href="${h}" target="_blank" rel="noopener noreferrer">${h}</a></p>`).run()}catch{a.chain().focus().insertContent(h).run()}}else if(typeof(s==null?void 0:s.setVideo)=="function")a.chain().focus().setVideo({src:l,HTMLAttributes:{controls:!0,width:640}}).run();else{const h=String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{a.chain().focus().insertContent(`<p><a href="${h}" target="_blank" rel="noopener noreferrer">${h}</a></p>`).run()}catch{a.chain().focus().insertContent(h).run()}}n.value=!1,o.value=""},b=l=>{l.key==="Enter"&&c(),l.key==="Escape"&&(n.value=!1,o.value="")},V=()=>{var l;r.videoUploader&&((l=d.value)==null||l.click())},f=async l=>{var y,_;const a=l.target,s=(y=a.files)==null?void 0:y[0];if(a.value="",!s||!r.videoUploader)return;const N=(_=r.uploadSizeLimit)==null?void 0:_.video;if(typeof N=="number"&&N>0){const k=Math.max(1,N)*1024*1024;if(s.size>k){try{window.alert(`视频文件大小超限(${(s.size/1024/1024).toFixed(2)}MB > ${N}MB)`)}catch{}return}}let h=null;try{i.value=!0;const k=r.editor,u=k==null?void 0:k.commands;h=URL.createObjectURL(s);try{if(typeof(u==null?void 0:u.setVideo)=="function")k.chain().focus().setVideo({src:h,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const M=String(h).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{k.chain().focus().insertContent(`<p><a href="${M}" target="_blank" rel="noopener noreferrer">${M}</a></p>`).run()}catch{k.chain().focus().insertContent(M).run()}}}catch{}const w=await r.videoUploader(s);h&&m(h,w),n.value=!1,o.value=""}finally{i.value=!1;try{h&&URL.revokeObjectURL(h)}catch{}}};function m(l,a){const s=r.editor;if(!s)return;const{state:N}=s,{doc:h}=N;let y=null;if(h.descendants((_,k)=>{var u,w;return((u=_.type)==null?void 0:u.name)==="video"&&((w=_.attrs)==null?void 0:w.src)===l?(y=k,!1):!0}),y!=null){const _=h.nodeAt(y),k=N.schema.nodes.video;if(!_||!k)return;const u={..._.attrs||{},src:a,uploading:null},w=N.tr.setNodeMarkup(y,k,u,_.marks);s.view.dispatch(w)}}const g=e.ref(null);let C=null;return e.onMounted(()=>{C=l=>{if(!n.value)return;const a=g.value,s=l.target;a&&s&&!a.contains(s)&&(n.value=!1)},document.addEventListener("mousedown",C,!0)}),e.onBeforeUnmount(()=>{C&&(document.removeEventListener("mousedown",C,!0),C=null)}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:E,ref_key:"rootRef",ref:g},[e.createVNode(Y,{name:"video",size:16}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":a[0]||(a[0]=s=>o.value=s),onKeydown:b},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:d,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:f},null,544),e.createElementVNode("div",mo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(c,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!r.videoUploader||i.value,disabled:!r.videoUploader||i.value,onClick:e.withModifiers(V,["stop"])},e.toDisplayString(i.value?"上传中…":"上传文件"),9,ho)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-eef6665b"]]),po={class:"field"},ko={class:"field"},go={class:"actions"},wo=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=e.ref(!1),o=e.ref(""),i=e.ref("");e.ref(!1);const d=e.ref(null);function E(){const l=r.editor;if(!n.value&&l)try{const a=l.state.selection,s=a.from;a.to>s?b():(o.value="链接",l.chain().focus().insertContent("链接").setTextSelection({from:s,to:s+2}).run())}catch{}n.value=!n.value,n.value&&c()}function c(){setTimeout(()=>{var a;const l=(a=d.value)==null?void 0:a.querySelector('input[name="link-text"]');l==null||l.focus(),l==null||l.select()},0)}function b(){const l=r.editor;if(l)try{const a=l.state.selection,s=a.from,N=a.to,y=N>s?l.state.doc.textBetween(s,N):"";o.value=y||"";const _=l.getAttributes("link")||{};i.value=typeof _.href=="string"?_.href:""}catch{}}function V(){const l=r.editor;if(!l)return;const a=o.value.trim(),s=i.value.trim();if(s)try{const N=l.state.selection,h=N.from,y=N.to;if(y>h){const k=f(a||l.state.doc.textBetween(h,y)),u=f(s);l.chain().focus().insertContent(`<a href="${u}" target="_blank" rel="noopener noreferrer">${k}</a>`,{from:h,to:y}).run()}else{const k=f(s),u=f(a||s);l.chain().focus().insertContent(`<a href="${k}" target="_blank" rel="noopener noreferrer">${u}</a>`).run()}}finally{n.value=!1,o.value="",i.value=""}}function f(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function m(l){l.key==="Enter"&&V(),l.key==="Escape"&&(n.value=!1)}let g=null;e.onMounted(()=>{g=l=>{if(!n.value)return;const a=d.value,s=l.target;a&&s&&!a.contains(s)&&(n.value=!1)},document.addEventListener("mousedown",g,!0)}),e.onBeforeUnmount(()=>{g&&(document.removeEventListener("mousedown",g,!0),g=null)});const C=e.ref({});return e.watch(n,async l=>{var s;if(!l)return;const a=r.editor;if(a){await e.nextTick();try{const N=a.state.selection,h=N.from,y=N.to;if(!(y>h)){C.value={};return}const k=a.view.coordsAtPos(h),u=a.view.coordsAtPos(y),w=(k.left+u.right)/2,M=Math.max(k.bottom,u.bottom)+8,S=(s=d.value)==null?void 0:s.querySelector(".link-input-panel"),T=S?S.getBoundingClientRect():{width:320,height:120},R=window.innerWidth,G=window.innerHeight,P=12,X=Math.max(P+T.width/2,Math.min(R-P-T.width/2,w)),I=M,K=Math.min(k.top,u.top)-T.height-8;let q=I;I+T.height+P>G&&K-P>=0&&(q=K),q=Math.max(P,Math.min(G-P-T.height,q)),C.value={position:"fixed",left:Math.round(X)+"px",top:Math.round(q)+"px"}}catch{}}}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:E,ref_key:"rootRef",ref:d},[e.createVNode(Y,{name:"link",size:16}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(C.value),onClick:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",po,[a[3]||(a[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":a[0]||(a[0]=s=>o.value=s),onKeydown:m},null,544),[[e.vModelText,o.value]])]),e.createElementVNode("div",ko,[a[4]||(a[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":a[1]||(a[1]=s=>i.value=s),placeholder:"链接地址",onKeydown:m},null,544),[[e.vModelText,i.value]])]),e.createElementVNode("div",go,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(V,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-b5bf35e2"]]),Co={class:"grid"},yo=["onMouseenter"],Vo={class:"size"},xo=10,bo=10,No=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=e.ref(!1),o=e.ref(0),i=e.ref(0),d=e.computed(()=>{const V=Math.max(o.value,1),f=Math.max(i.value,1);return`${V} x ${f}`}),E=()=>{n.value=!n.value,n.value||(o.value=0,i.value=0)},c=(V,f)=>{o.value=V,i.value=f},b=()=>{var m,g,C,l,a,s,N,h;const V=Math.max(o.value,1),f=Math.max(i.value,1);(h=(s=(l=(g=(m=r.editor)==null?void 0:m.chain)==null?void 0:(C=g.call(m)).focus)==null?void 0:(a=l.call(C)).insertTable)==null?void 0:(N=s.call(a,{rows:V,cols:f,withHeaderRow:!0})).run)==null||h.call(N),n.value=!1,o.value=0,i.value=0};return(V,f)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:E},[e.createVNode(Y,{name:"table",size:16}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:f[0]||(f[0]=e.withModifiers(()=>{},["stop"]))},[f[1]||(f[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Co,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(xo,m=>e.createElementVNode("div",{key:"r-"+m,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(bo,g=>e.createElementVNode("span",{key:"c-"+m+"-"+g,class:e.normalizeClass(["cell",{active:m<=o.value&&g<=i.value}]),onMouseenter:C=>c(m,g),onClick:e.withModifiers(b,["stop"])},null,42,yo)),64))])),64))]),e.createElementVNode("div",Vo,e.toDisplayString(d.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ad6f66b7"]]),_o=["aria-disabled"],Eo={class:"tools-grid"},Lo=["disabled"],Mo=["disabled"],Bo=["disabled"],zo=["disabled"],$o=["disabled"],vo=["disabled"],So=["disabled"],To=["disabled"],Fo=["disabled"],jo=["disabled"],Ao=["disabled"],Do=["disabled"],Ho=["disabled"],Uo=["disabled"],Wo=["disabled"],Io=["disabled"],Oo=["disabled"],Ro=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=e.ref(!1),o=()=>n.value=!n.value,i=(E,...c)=>{var V,f,m;const b=r.editor;return!!((m=(V=b==null?void 0:b.can)==null?void 0:(f=V.call(b))[E])!=null&&m.call(f,...c))},d=(E,...c)=>{var V,f,m,g,C,l,a;const b=r.editor;(a=(l=(C=(g=(m=(V=b==null?void 0:b.chain)==null?void 0:(f=V.call(b)).focus)==null?void 0:m.call(f))[E])==null?void 0:C.call(g,...c))==null?void 0:l.run)==null||a.call(l),n.value=!1};return(E,c)=>{var b,V;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:o,"aria-disabled":!((V=(b=r.editor)==null?void 0:b.isActive)!=null&&V.call(b,"table"))},[e.createVNode(Y,{name:"tableTools",size:15}),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:c[17]||(c[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Eo,[e.createElementVNode("button",{class:"btn",onClick:c[0]||(c[0]=e.withModifiers(f=>d("addColumnBefore"),["stop"])),disabled:!i("addColumnBefore")}," 前插列 ",8,Lo),e.createElementVNode("button",{class:"btn",onClick:c[1]||(c[1]=e.withModifiers(f=>d("addColumnAfter"),["stop"])),disabled:!i("addColumnAfter")}," 后插列 ",8,Mo),e.createElementVNode("button",{class:"btn",onClick:c[2]||(c[2]=e.withModifiers(f=>d("deleteColumn"),["stop"])),disabled:!i("deleteColumn")}," 删除列 ",8,Bo),e.createElementVNode("button",{class:"btn",onClick:c[3]||(c[3]=e.withModifiers(f=>d("addRowBefore"),["stop"])),disabled:!i("addRowBefore")}," 前插行 ",8,zo),e.createElementVNode("button",{class:"btn",onClick:c[4]||(c[4]=e.withModifiers(f=>d("addRowAfter"),["stop"])),disabled:!i("addRowAfter")}," 后插行 ",8,$o),e.createElementVNode("button",{class:"btn",onClick:c[5]||(c[5]=e.withModifiers(f=>d("deleteRow"),["stop"])),disabled:!i("deleteRow")}," 删除行 ",8,vo),e.createElementVNode("button",{class:"btn",onClick:c[6]||(c[6]=e.withModifiers(f=>d("deleteTable"),["stop"])),disabled:!i("deleteTable")}," 删除表 ",8,So),e.createElementVNode("button",{class:"btn",onClick:c[7]||(c[7]=e.withModifiers(f=>d("mergeCells"),["stop"])),disabled:!i("mergeCells")}," 合并单元格 ",8,To),e.createElementVNode("button",{class:"btn",onClick:c[8]||(c[8]=e.withModifiers(f=>d("splitCell"),["stop"])),disabled:!i("splitCell")}," 拆分单元格 ",8,Fo),e.createElementVNode("button",{class:"btn",onClick:c[9]||(c[9]=e.withModifiers(f=>d("mergeOrSplit"),["stop"])),disabled:!i("mergeOrSplit")}," 合并/拆分 ",8,jo),e.createElementVNode("button",{class:"btn",onClick:c[10]||(c[10]=e.withModifiers(f=>d("toggleHeaderRow"),["stop"])),disabled:!i("toggleHeaderRow")}," 切换表头行 ",8,Ao),e.createElementVNode("button",{class:"btn",onClick:c[11]||(c[11]=e.withModifiers(f=>d("toggleHeaderColumn"),["stop"])),disabled:!i("toggleHeaderColumn")}," 切换表头列 ",8,Do),e.createElementVNode("button",{class:"btn",onClick:c[12]||(c[12]=e.withModifiers(f=>d("toggleHeaderCell"),["stop"])),disabled:!i("toggleHeaderCell")}," 切换表头单元 ",8,Ho),e.createElementVNode("button",{class:"btn",onClick:c[13]||(c[13]=e.withModifiers(f=>d("fixTables"),["stop"])),disabled:!i("fixTables")}," 修复表格 ",8,Uo),e.createElementVNode("button",{class:"btn",onClick:c[14]||(c[14]=e.withModifiers(f=>d("goToNextCell"),["stop"])),disabled:!i("goToNextCell")}," 下个单元格 ",8,Wo),e.createElementVNode("button",{class:"btn",onClick:c[15]||(c[15]=e.withModifiers(f=>d("goToPreviousCell"),["stop"])),disabled:!i("goToPreviousCell")}," 上个单元格 ",8,Io),e.createElementVNode("button",{class:"btn",onClick:c[16]||(c[16]=e.withModifiers(f=>d("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!i("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,Oo)])])):e.createCommentVNode("",!0)],8,_o)}}}),[["__scopeId","data-v-89ddb4db"]]),Po=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t;typeof navigator<"u"&&navigator.platform.includes("Mac");function n(){const o=r.editor;if(o){o.chain().focus().toggleTaskList().run();try{const{state:i}=o,d=i.selection;let E=null;i.doc.nodesBetween(Math.max(0,d.from-5),Math.min(i.doc.content.size,d.to+5),(c,b)=>{var V;return((V=c==null?void 0:c.type)==null?void 0:V.name)==="taskItem"&&E==null?(E=b,!1):!0}),E!=null&&o.commands.setTextSelection(E+1)}catch{}}}return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(Y,{name:"task",size:17})]))}}),[["__scopeId","data-v-0b74c17c"]]),Go=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t;function n(){const o=r.editor;o&&o.chain().focus().toggleBlockquote().run()}return(o,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:n},[e.createVNode(Y,{name:"quote",size:18})]))}}),[["__scopeId","data-v-bf6f40c3"]]),qo=["aria-expanded"],Yo={class:"label"},Ko={key:0,class:"dropdown",role:"listbox"},Zo=["aria-selected","onClick"],Jo={class:"shortcut"},ke="md-toolbar-dropdown-open",ze="heading-select",Xo=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=typeof navigator<"u"&&navigator.platform.includes("Mac"),o={0:n?"⌥ ⌘ 0":"Ctrl Alt 0",1:n?"⌥ ⌘ 1":"Ctrl Alt 1",2:n?"⌥ ⌘ 2":"Ctrl Alt 2",3:n?"⌥ ⌘ 3":"Ctrl Alt 3",4:n?"⌥ ⌘ 4":"Ctrl Alt 4",5:n?"⌥ ⌘ 5":"Ctrl Alt 5",6:n?"⌥ ⌘ 6":"Ctrl Alt 6"},i=[{label:"正文",level:null,shortcut:o[0]},{label:"标题1",level:1,shortcut:o[1]},{label:"标题2",level:2,shortcut:o[2]},{label:"标题3",level:3,shortcut:o[3]},{label:"标题4",level:4,shortcut:o[4]},{label:"标题5",level:5,shortcut:o[5]},{label:"标题6",level:6,shortcut:o[6]}],d=e.computed(()=>{var a,s;const l=r.editor;if(!l)return null;for(let N=1;N<=6;N++)if((a=l.isActive)!=null&&a.call(l,"heading",{level:N}))return N;return(s=l.isActive)!=null&&s.call(l,"paragraph"),null}),E=e.computed(()=>{const l=d.value;return l?`标题${l}`:"正文"}),c=e.ref(!1),b=e.ref(null);function V(){c.value||window.dispatchEvent(new CustomEvent(ke,{detail:{id:ze}})),c.value=!c.value}function f(){c.value=!1}function m(l){var s,N,h,y,_,k,u,w,M,S;const a=(y=(N=(s=r.editor)==null?void 0:s.chain)==null?void 0:(h=N.call(s)).focus)==null?void 0:y.call(h);a&&(l.level===null?(u=(_=a.setParagraph)==null?void 0:(k=_.call(a)).run)==null||u.call(k):(S=(M=(w=a.toggleHeading)==null?void 0:w.call(a,{level:l.level}))==null?void 0:M.run)==null||S.call(M),f())}function g(l){const a=l.target,s=b.value;s&&!s.contains(a)&&f()}function C(l){var s;((s=l.detail)==null?void 0:s.id)!==ze&&(c.value=!1)}return e.onMounted(()=>{document.addEventListener("click",g),window.addEventListener(ke,C)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",g),window.removeEventListener(ke,C)}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:b},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(V,["stop"]),"aria-expanded":c.value},[e.createElementVNode("div",Yo,e.toDisplayString(E.value),1),e.createVNode(e.unref(ne),{theme:"filled",strokeWidth:3})],8,qo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Ko,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,s=>e.createElementVNode("div",{key:s.label,class:"dropdown-item","aria-selected":s.level===d.value,onClick:e.withModifiers(N=>m(s),["stop"])},[s.level===d.value?(e.openBlock(),e.createBlock(e.unref(oe),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:s.level===null,"level-1":s.level===1,"level-2":s.level===2,"level-3":s.level===3,"level-4":s.level===4,"level-5":s.level===5,"level-6":s.level===6}])},e.toDisplayString(s.label),3),e.createElementVNode("span",Jo,e.toDisplayString(s.shortcut),1)],8,Zo)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-3d649d22"]]),Qo=["aria-expanded"],en={key:0,class:"dropdown",role:"menu"},tn={class:"options"},ge="md-toolbar-dropdown-open",$e="align-select",on=U(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const r=t,n=e.computed(()=>{var g,C,l,a;const m=r.editor;return!m||(g=m.isActive)!=null&&g.call(m,{textAlign:"left"})?"left":(C=m.isActive)!=null&&C.call(m,{textAlign:"center"})?"center":(l=m.isActive)!=null&&l.call(m,{textAlign:"right"})?"right":(a=m.isActive)!=null&&a.call(m,{textAlign:"justify"})?"justify":"left"});function o(m){var g,C,l,a,s,N,h,y;(y=(N=(a=(C=(g=r.editor)==null?void 0:g.chain)==null?void 0:(l=C.call(g)).focus)==null?void 0:(s=a.call(l)).setTextAlign)==null?void 0:(h=N.call(s,m)).run)==null||y.call(h)}const i=e.ref(!1),d=e.ref(null);function E(){i.value||window.dispatchEvent(new CustomEvent(ge,{detail:{id:$e}})),i.value=!i.value}function c(){i.value=!1}function b(m){o(m),c()}function V(m){const g=d.value,C=m.target;g&&!g.contains(C)&&c()}function f(m){var C;((C=m.detail)==null?void 0:C.id)!==$e&&(i.value=!1)}return e.onMounted(()=>{document.addEventListener("click",V),window.addEventListener(ge,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",V),window.removeEventListener(ge,f)}),(m,g)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:d},[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(E,["stop"]),"aria-expanded":i.value},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value==="left"?e.unref(_e):n.value==="center"?e.unref(Ne):n.value==="right"?e.unref(Ee):e.unref(be)),{theme:"outline",strokeWidth:3})),e.createVNode(e.unref(ne),{theme:"filled",strokeWidth:3})],8,Qo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",en,[e.createElementVNode("div",tn,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="left"}]),role:"menuitem",onClick:g[0]||(g[0]=e.withModifiers(C=>b("left"),["stop"]))},[e.createVNode(e.unref(_e),{theme:"outline",strokeWidth:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="center"}]),role:"menuitem",onClick:g[1]||(g[1]=e.withModifiers(C=>b("center"),["stop"]))},[e.createVNode(e.unref(Ne),{theme:"outline",strokeWidth:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="right"}]),role:"menuitem",onClick:g[2]||(g[2]=e.withModifiers(C=>b("right"),["stop"]))},[e.createVNode(e.unref(Ee),{theme:"outline",strokeWidth:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:n.value==="justify"}]),role:"menuitem",onClick:g[3]||(g[3]=e.withModifiers(C=>b("justify"),["stop"]))},[e.createVNode(e.unref(be),{theme:"outline",strokeWidth:3})],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-ff7bd7b9"]]),nn={class:"header_box"},rn=["aria-disabled"],ln=["aria-disabled"],sn=U(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{}},emits:["openLinkModal"],setup(t,{emit:r}){const n=t,o=(h,y)=>{var _,k;return(k=(_=n.editor)==null?void 0:_.isActive)==null?void 0:k.call(_,h,y)},i=(h,y)=>{var u,w,M,S,T,R;const _=n.editor;if(!_)return;const k=(M=(u=_.chain)==null?void 0:(w=u.call(_)).focus)==null?void 0:M.call(w);return(R=(T=(S=k==null?void 0:k[h])==null?void 0:S.call(k))==null?void 0:T.run)==null?void 0:R.call(T)},d=()=>{var h,y,_,k;try{return!!((k=(y=(h=n.editor)==null?void 0:h.can)==null?void 0:(_=y.call(h)).undo)!=null&&k.call(_))}catch{return!1}},E=()=>{var h,y,_,k;try{return!!((k=(y=(h=n.editor)==null?void 0:h.can)==null?void 0:(_=y.call(h)).redo)!=null&&k.call(_))}catch{return!1}},c=()=>{var h,y,_;d()&&((_=(y=(h=n.editor)==null?void 0:h.commands)==null?void 0:y.undo)==null||_.call(y))},b=()=>{var h,y,_;return(_=(y=(h=n.editor)==null?void 0:h.commands)==null?void 0:y.redo)==null?void 0:_.call(y)},V=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",f=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",m=typeof navigator<"u"&&navigator.platform.includes("Mac"),g=m?"⌘ B":"Ctrl B",C=m?"⌘ I":"Ctrl I",l=m?"⌘ U":"Ctrl U",a=m?"⇧ ⌘ X":"Ctrl Shift X",s=m?"⇧ ⌘ 8":"Ctrl Shift 8",N=m?"⇧ ⌘ 7":"Ctrl Shift 7";return(h,y)=>(e.openBlock(),e.createElementBlock("div",nn,[e.createElementVNode("div",{class:"icon","aria-disabled":!d(),onClick:c},[e.createVNode(e.unref(J),{text:"撤销",shortcut:e.unref(V),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(lt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,rn),e.createElementVNode("div",{class:"icon","aria-disabled":!E(),onClick:b},[e.createVNode(e.unref(J),{text:"重做",shortcut:e.unref(f),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(tt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,ln),e.createVNode(e.unref(Xo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Ct),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bold")}]),onClick:y[0]||(y[0]=_=>i("toggleBold"))},[e.createVNode(e.unref(J),{text:"加粗",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("italic")}]),onClick:y[1]||(y[1]=_=>i("toggleItalic"))},[e.createVNode(e.unref(J),{text:"斜体",shortcut:e.unref(C),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ct),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("strike")}]),onClick:y[2]||(y[2]=_=>i("toggleStrike"))},[e.createVNode(e.unref(J),{text:"删除线",shortcut:e.unref(a),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("underline")}]),onClick:y[3]||(y[3]=_=>i("toggleUnderline"))},[e.createVNode(e.unref(J),{text:"下划线",shortcut:e.unref(l),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(St),{editor:n.editor,currentColor:n.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(so),{editor:n.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createVNode(e.unref(on),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("bulletList")}]),onClick:y[4]||(y[4]=_=>i("toggleBulletList"))},[e.createVNode(e.unref(J),{text:"无序列表",shortcut:e.unref(s),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ot),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("orderedList")}]),onClick:y[5]||(y[5]=_=>i("toggleOrderedList"))},[e.createVNode(e.unref(J),{text:"有序列表",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(nt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Po),{editor:n.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("code")}]),onClick:y[6]||(y[6]=_=>i("toggleCode"))},[e.createVNode(Y,{name:"code",size:18})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:o("codeBlock")}]),onClick:y[7]||(y[7]=_=>i("toggleCodeBlock"))},[e.createVNode(Y,{name:"codeBlock",size:16})],2),e.createVNode(e.unref(Go),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(wo),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(fo),{editor:n.editor,imageUploader:n.imageUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(uo),{editor:n.editor,videoUploader:n.videoUploader,uploadSizeLimit:n.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(No),{editor:n.editor},null,8,["editor"]),e.createVNode(e.unref(Ro),{editor:n.editor},null,8,["editor"])]))}}),[["__scopeId","data-v-e5da0a17"]]),an={class:"outline__header"},cn={style:{cursor:"pointer","margin-top":"5px"}},dn={class:"outline__listWrap"},fn={class:"outline__list"},mn=["onClick"],hn=["onClick"],un=U(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:r}){const n=t,o=r;function i(s){C(s),o("select",s)}function d(){o("update:open",!1),o("update:pinned",!1)}function E(){n.pinned||d()}function c(s){const N=[],h=[];for(const y of s){const _={...y,children:[]};for(;h.length&&h[h.length-1].level>=_.level;)h.pop();h.length?h[h.length-1].children.push(_):N.push(_),h.push(_)}return N}const b=e.ref(new Set);function V(s){return b.value.has(s.pos)}function f(s){const N=b.value;N.has(s.pos)?N.delete(s.pos):N.add(s.pos),b.value=new Set(N)}const m=e.computed(()=>c(n.items||[])),g=e.computed(()=>{const s=[],N=h=>{for(const y of h)s.push({node:y,level:y.level,hasChildren:y.children.length>0}),b.value.has(y.pos)||N(y.children)};return N(m.value),s});function C(s){const N=e.unref(n.editor);if(!N)return;const{doc:h}=N.state,y=h.nodeAt(s.pos),_=Math.max(1,h.content.size-1);let k=s.pos+1;y&&y.type.name==="heading"&&(k=s.pos+y.nodeSize-1),k=Math.min(Math.max(1,k),_),N.chain().focus().setTextSelection(k).run();const u=e.unref(n.container)??null,w=N.view.coordsAtPos(k),M=n.offset??8,S=n.duration??700;if(u){const T=u.getBoundingClientRect(),R=u.scrollTop+w.top-T.top-M;l(u,R,S)}else{const T=(window.scrollY||window.pageYOffset)+w.top-M;a(T,S)}}function l(s,N,h=600){const y=s.scrollTop,_=N-y,k=performance.now(),u=M=>M<.5?4*M*M*M:1-Math.pow(-2*M+2,3)/2;function w(M){const S=M-k,T=Math.min(1,S/h);s.scrollTop=y+_*u(T),T<1&&requestAnimationFrame(w)}requestAnimationFrame(w)}function a(s,N=600){const h=window.scrollY||window.pageYOffset,y=s-h,_=performance.now(),k=w=>w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2;function u(w){const M=w-_,S=Math.min(1,M/N),T=h+y*k(S);window.scrollTo(0,T),S<1&&requestAnimationFrame(u)}requestAnimationFrame(u)}return(s,N)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:N[1]||(N[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:n.open}]),style:e.normalizeStyle({maxHeight:typeof n.maxHeight=="number"?n.maxHeight+"px":n.maxHeight}),onMouseleave:E},[e.createElementVNode("div",an,[N[2]||(N[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",cn,[n.open&&!n.pinned?(e.openBlock(),e.createBlock(e.unref(rt),{key:0,onClick:N[0]||(N[0]=h=>s.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),n.pinned?(e.openBlock(),e.createBlock(e.unref(it),{key:1,onClick:d,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",dn,[e.createElementVNode("ul",fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(h,y)=>(e.openBlock(),e.createElementBlock("li",{key:h.node.pos+"-"+y,class:e.normalizeClass(["outline__item","lv-"+h.level])},[h.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:V(h.node),expanded:!V(h.node)}]),onClick:e.withModifiers(_=>f(h.node),["stop"]),title:"展开/收起"},[...N[3]||(N[3]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8 5l8 7-8 7V5z",fill:"currentColor"})],-1)])],10,mn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:_=>i(h.node)},e.toDisplayString(h.node.text||"(无标题)"),9,hn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[n.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:d})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-b5f802fc"]]),pn=["onClick"],ve=U(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{}},emits:["update:modelValue","update:markdown"],setup(t,{expose:r,emit:n}){const o=t,i=n,d=e.ref(null);let E=!1;const c=e.ref(!1),b=e.ref(""),V=e.ref([]),f=e.ref("#000000"),m=e.ref(!0),g=e.ref(!0),C=e.ref(null),l=e.ref(void 0),a=e.ref([]),s=e.ref(null),N=()=>{const p=C.value;l.value=p?p.clientHeight:void 0};let h=null;e.onMounted(()=>{N(),h=()=>N(),window.addEventListener("resize",h),e.nextTick(()=>{const p=C.value;p&&p.addEventListener("scroll",ae,{passive:!0})})}),e.onBeforeUnmount(()=>{h&&(window.removeEventListener("resize",h),h=null);const p=C.value;p&&p.removeEventListener("scroll",ae)}),e.watch([()=>o.height,m],async()=>{await e.nextTick(),N(),ae()});const y=e.computed(()=>{const x=(L=>L==null?void 0:typeof L=="number"?`${L}px`:L)(o.height);return{height:x,"--editor-height":x,"--editor-caret-color":o.caretColor||"#000"}}),_=fe.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:p=>p.style.fontSize||null,renderHTML:p=>p.fontSize?{style:`font-size: ${p.fontSize}`}:{}}}},addCommands(){return{setFontSize:p=>({chain:x})=>x().setMark("textStyle",{fontSize:p}).run(),unsetFontSize:()=>({chain:p})=>p().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),k=fe.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:p=>p.style.backgroundColor||null,renderHTML:p=>p.backgroundColor?{style:`background-color: ${p.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:p=>({chain:x})=>x().setMark("textStyle",{backgroundColor:p}).run(),unsetBackgroundColor:()=>({chain:p})=>p().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{d.value=new ye.Editor({extensions:[je.StarterKit.configure({dropcursor:!1}),Re.Dropcursor.configure({color:"#22c55e",width:2}),xe.TaskList,Ke,Ge.configure({inline:!0,allowBase64:!0}),Ye.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ae.Markdown,Ve.TableKit.configure({table:{resizable:!0},tableCell:!1}),qe,fe.TextStyle,_,k,Ie.Color,Oe.Underline,Ue.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),We.TextAlign.configure({types:["heading","paragraph"]}),He.Placeholder.configure({placeholder:o.placeholder??"输入 / 以插入块"})],content:o.markdown!=null?String(o.markdown||""):String(o.modelValue||""),contentType:o.markdown!=null?"markdown":/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(o.modelValue||""))?"html":"markdown",editable:!0,autofocus:!0,editorProps:{handlePaste(p,x){var ie,re,Te;const L=x.clipboardData;if(!L)return!1;const z=L.files&&L.files.length?Array.from(L.files):[],B=z.find(W=>{var O;return(O=W.type)==null?void 0:O.startsWith("image/")});if(B){if(x.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(B),!0}const $=z.find(W=>{var O;return(O=W.type)==null?void 0:O.startsWith("video/")});if($)return x.preventDefault(),K($),!0;const F=(L.items?Array.from(L.items):[]).find(W=>W.kind==="file"),D=F?F.getAsFile():null;if(D&&D.type.startsWith("image/")){if(x.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(D),!0}if(D&&D.type.startsWith("video/"))return x.preventDefault(),K(D),!0;const A=L.getData("text/html");if(A){const W=A.match(/<img[^>]+src=["']([^"']+)["']/i),O=A.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(W&&O&&O[1]){x.preventDefault();const se=O[1];if(o.imageUploader&&/^data:image\//i.test(se)){const ce=G(se,"clipboard.png");S(ce)}else{if(/^data:image\//i.test(se)){const ce=G(se,"clipboard.png"),Ce=(ie=o.uploadSizeLimit)==null?void 0:ie.image;if(Ce){const Cn=Math.max(1,Ce)*1024*1024;if(ce.size>Cn){try{window.alert(`图片文件大小超限(${(ce.size/1024/1024).toFixed(2)}MB > ${Ce}MB)`)}catch{}return!0}}}u(se)}return!0}const ee=A.match(/<video[^>]+src=["']([^"']+)["']/i),Z=A.match(/<source[^>]+src=["']([^"']+)["']/i),le=A.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Fe=ee&&ee[1]||Z&&Z[1];if(Fe&&le)return x.preventDefault(),M(Fe),!0}const Q=L.getData("text/plain");if(Q){const W=Q.trim(),O=I(W);if(P(W)&&W===Q.trim()){if(x.preventDefault(),/^data:image\//i.test(W)){const ee=G(W,"clipboard.png"),Z=(re=o.uploadSizeLimit)==null?void 0:re.image;if(Z){const le=Math.max(1,Z)*1024*1024;if(ee.size>le){try{window.alert(`图片文件大小超限(${(ee.size/1024/1024).toFixed(2)}MB > ${Z}MB)`)}catch{}return!0}}}return u(W),!0}if(O){if(x.preventDefault(),/^data:image\//i.test(O)){const ee=G(O,"clipboard.png"),Z=(Te=o.uploadSizeLimit)==null?void 0:Te.image;if(Z){const le=Math.max(1,Z)*1024*1024;if(ee.size>le){try{window.alert(`图片文件大小超限(${(ee.size/1024/1024).toFixed(2)}MB > ${Z}MB)`)}catch{}return!0}}}return u(O),!0}if(X(W)&&W===Q.trim())return x.preventDefault(),M(W),!0}return!1},handleDrop(p,x){const L=x.dataTransfer;if(!L)return!1;const B=(L.files?Array.from(L.files):[]).find($=>{var v;return(v=$.type)==null?void 0:v.startsWith("image/")});if(B){if(x.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return S(B),!0}return!1},handleClick(p,x,L){const z=L,B=z.target,$=B?B.closest("a[href]"):null;if($&&(z.ctrlKey||z.metaKey)){const v=$.getAttribute("href")||"";if(v){z.preventDefault();try{window.open(v,"_blank","noopener,noreferrer")}catch(F){console.warn("打开链接失败:",F)}return!0}}return!1}},onSelectionUpdate:p=>{var z;const L=((z=p.editor.getAttributes("textStyle"))==null?void 0:z.color)||"#000000";f.value=typeof L=="string"?L:"#000000"},onUpdate:()=>{const p=d.value;E=!0,i("update:modelValue",p.getHTML()),i("update:markdown",p.getMarkdown()),we()},onTransaction:()=>{we()}}),e.nextTick(()=>{var p;we();try{(p=d.value)==null||p.chain().focus().run()}catch{}})}),e.onBeforeUnmount(()=>{var p;(p=d.value)==null||p.destroy()}),e.watch(()=>o.modelValue,p=>{if(E){E=!1;return}p!=null&&d.value&&e.nextTick(()=>{try{const x=/<\s*(video|iframe)\b|data-youtube-video/i.test(p),L=p.match(/\[video\]\(([^)]+)\)/i);if(!x&&L){const z=L[1],B=p.replace(/\[video\]\(([^)]+)\)/gi,($,v)=>`<video data-tiptap-video src="${v}" controls></video>`);d.value.commands.setContent(B,{contentType:"html"})}else d.value.commands.setContent(p,{contentType:x?"html":"markdown"})}catch(x){console.warn("setContent 失败,内容更新被忽略:",x)}})}),e.watch(()=>o.markdown,p=>{if(E){E=!1;return}p!=null&&d.value&&e.nextTick(()=>{try{d.value.commands.setContent(p,{contentType:"markdown"})}catch(x){console.warn("setContent 失败,内容更新被忽略:",x)}})});function u(p){var x;(x=d.value)==null||x.chain().focus().setImage({src:p}).run()}function w(p){return String(p).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(p){const x=d.value;if(!x)return;if(typeof x.commands.setVideo=="function"){x.chain().focus().setVideo({src:p,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const z=w(p);try{x.chain().focus().insertContent(`<p><a href="${z}" target="_blank" rel="noopener noreferrer">${z}</a></p>`).run()}catch{x.chain().focus().insertContent(z).run()}}async function S(p){var L,z;const x=(L=o.uploadSizeLimit)==null?void 0:L.image;if(x){const B=Math.max(1,x)*1024*1024;if(p.size>B){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${x}MB)`)}catch{}return}}if(o.imageUploader){const B=URL.createObjectURL(p);(z=d.value)==null||z.chain().focus().setImage({src:B,uploading:!0}).run();try{const $=await o.imageUploader(p);if(typeof $=="string"&&$){T(B,$);return}R(p,v=>T(B,v))}catch($){console.warn("图片上传失败,回退为 base64",$),R(p,v=>T(B,v))}finally{try{URL.revokeObjectURL(B)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function T(p,x){const L=d.value;if(!L)return;const{state:z}=L,{doc:B}=z;let $=null;if(B.descendants((v,F)=>{var D,A;return((D=v.type)==null?void 0:D.name)==="image"&&((A=v.attrs)==null?void 0:A.src)===p?($=F,!1):!0}),$!=null){const v=B.nodeAt($),F=z.schema.nodes.image;if(!v||!F)return;const D={...v.attrs||{},src:x,uploading:null},A=z.tr.setNodeMarkup($,F,D,v.marks);L.view.dispatch(A)}else u(x)}function R(p,x){const L=new FileReader;L.onload=()=>x(String(L.result||"")),L.readAsDataURL(p)}function G(p,x="image.png"){var F;const L=p.split(","),z=((F=L[0].match(/:(.*?);/))==null?void 0:F[1])||"image/png",B=atob(L[1]);let $=B.length;const v=new Uint8Array($);for(;$--;)v[$]=B.charCodeAt($);return new File([v],x,{type:z})}function P(p){return/^data:image\//i.test(p)||/^https?:\/\//i.test(p)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(p)}function X(p){return/^https?:\/\//i.test(p)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(p)}function I(p){const x=p.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!x)return null;const L=x[1].trim().replace(/^<|>$/g,"");return P(L)?L:null}async function K(p){var z;const x=(z=o.uploadSizeLimit)==null?void 0:z.video;if(x){const B=Math.max(1,x)*1024*1024;if(p.size>B){try{window.alert(`视频文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${x}MB)`)}catch{}return}}if(o.videoUploader){const B=URL.createObjectURL(p),$=d.value,v=$==null?void 0:$.commands;try{typeof(v==null?void 0:v.setVideo)=="function"?$==null||$.chain().focus().setVideo({src:B,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():M(B)}catch{M(B)}try{const F=await o.videoUploader(p);q(B,F)}catch(F){console.warn("视频上传失败,保留本地对象 URL 作为预览",F)}finally{try{URL.revokeObjectURL(B)}catch{}}return}const L=URL.createObjectURL(p);M(L)}function q(p,x){const L=d.value;if(!L)return;const{state:z}=L,{doc:B}=z;let $=null;if(B.descendants((v,F)=>{var D,A;return((D=v.type)==null?void 0:D.name)==="video"&&((A=v.attrs)==null?void 0:A.src)===p?($=F,!1):!0}),$!=null){const v=B.nodeAt($),F=z.schema.nodes.video;if(!v||!F)return;const D={...v.attrs||{},src:x,uploading:null},A=z.tr.setNodeMarkup($,F,D,v.marks);L.view.dispatch(A)}}function te(){var p,x;b.value=((x=(p=d.value)==null?void 0:p.getAttributes("link"))==null?void 0:x.href)||"",c.value=!0}function we(){const p=d.value;if(!p)return;const x=[];p.state.doc.descendants((L,z)=>{if(L.type.name==="heading"){const B=L.attrs.level||1,$=L.textContent||"";x.push({text:$,level:B,pos:z})}}),V.value=x,ae()}function ae(){const p=d.value,x=C.value,L=V.value;if(!p||!x||!L.length){a.value=[],s.value=null;return}const z=x.getBoundingClientRect(),B=x.scrollHeight||x.clientHeight,$=x.clientHeight||1,v=L.map(A=>{const ie=p.view.coordsAtPos(Math.min(A.pos+1,p.state.doc.content.size)).top-z.top+x.scrollTop,re=B?Math.max(0,Math.min(1,ie/B)):0;return Math.round(re*$)});a.value=v;const F=x.scrollTop+8;let D=null;for(let A=0;A<L.length;A++){const Q=L[A];if(p.view.coordsAtPos(Math.min(Q.pos+1,p.state.doc.content.size)).top-z.top+x.scrollTop<=F)D=Q.pos;else break}s.value=D}function gn(p){const x=p.target;x.closest(".outline")||x.closest(".outline-toggle")||d.value&&d.value.chain().focus().run()}function wn(){const p=d.value;return p?p.getMarkdown():""}return r({getMarkdown:wn}),(p,x)=>(e.openBlock(),e.createElementBlock("div",{class:"simple-editor",style:e.normalizeStyle(y.value)},[e.createVNode(e.unref(sn),{editor:d.value,currentColor:f.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":o.uploadSizeLimit,onOpenLinkModal:te},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:m.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:C,class:"editor_wrapper",onClick:gn},[e.createVNode(e.unref(ye.EditorContent),{editor:d.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(un),{open:m.value,"onUpdate:open":x[0]||(x[0]=L=>m.value=L),items:V.value,editor:d.value,container:C.value,maxHeight:l.value,pinned:g.value,"onUpdate:pinned":x[1]||(x[1]=L=>g.value=L)},null,8,["open","items","editor","container","maxHeight","pinned"]),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:x[2]||(x[2]=L=>(m.value=!0,g.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(L,z)=>{var B;return e.openBlock(),e.createElementBlock("span",{key:z,class:e.normalizeClass(["outline-marker",{active:((B=V.value[z])==null?void 0:B.pos)===s.value}]),style:e.normalizeStyle({top:(L||0)+"px"}),onClick:e.withModifiers($=>{var v,F;return(F=d.value)==null?void 0:F.chain().focus().setTextSelection((((v=V.value[z])==null?void 0:v.pos)||1)+1).run()},["stop"])},null,14,pn)}),128))],32))],2)],4))}}),[["__scopeId","data-v-c9ed96a6"]]),kn={install(t){t.component("Editor",ve)}};j.Editor=ve,j.default=kn,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|