bto-md-editor 0.1.7 → 0.1.9
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.es.js +1998 -1950
- package/dist/md-editor.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +19 -20
package/dist/md-editor.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;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-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-8ea77a66]{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-8ea77a66]:hover{background:#0000000d}.font-size[data-v-8ea77a66]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-8ea77a66]{font-size:15px;color:#333}.dropdown[data-v-8ea77a66]{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-8ea77a66],.dropdown-slide-leave-to[data-v-8ea77a66]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-8ea77a66],.dropdown-slide-leave-active[data-v-8ea77a66]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-8ea77a66]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-8ea77a66]:hover{background:#0000000d}.text[data-v-8ea77a66]{flex:1}.icon[data-v-0f5572cb]{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-0f5572cb]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-0f5572cb]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-0f5572cb]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-0f5572cb]:hover{background:#0000000d}.underline[data-v-0f5572cb]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-0f5572cb]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-0f5572cb]{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-0f5572cb],.dropdown-slide-leave-to[data-v-0f5572cb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-0f5572cb],.dropdown-slide-leave-active[data-v-0f5572cb]{transition:opacity .18s ease,transform .18s ease}.section[data-v-0f5572cb]{margin-bottom:8px}.section-title[data-v-0f5572cb]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-0f5572cb]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-0f5572cb]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-0f5572cb]{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-0f5572cb]{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-0f5572cb]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-0f5572cb]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-0f5572cb]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-0f5572cb]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-0f5572cb]{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-620c7aa3]{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-620c7aa3]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-620c7aa3]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-620c7aa3]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-620c7aa3]:hover{background:#0000000d}.underline[data-v-620c7aa3]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-620c7aa3]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-620c7aa3]{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-620c7aa3]{margin-bottom:8px}.section-title[data-v-620c7aa3]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-620c7aa3]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-620c7aa3]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-620c7aa3]{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-620c7aa3]{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-620c7aa3]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-620c7aa3]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-620c7aa3]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-620c7aa3]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-620c7aa3]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-620c7aa3],.dropdown-slide-leave-to[data-v-620c7aa3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-620c7aa3],.dropdown-slide-leave-active[data-v-620c7aa3]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-e1c5f3df]{position:relative}.image-input-panel[data-v-e1c5f3df]{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-e1c5f3df]{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-e1c5f3df]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-e1c5f3df]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-e1c5f3df]:hover{background:#0000000d}.btn-primary[data-v-e1c5f3df]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-e1c5f3df]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-e1c5f3df],.img-panel-leave-active[data-v-e1c5f3df]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-e1c5f3df],.img-panel-leave-to[data-v-e1c5f3df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-e1c5f3df],.img-panel-leave-from[data-v-e1c5f3df]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-35a7027c]{position:relative}.video-input-panel[data-v-35a7027c]{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-35a7027c]{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-35a7027c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-35a7027c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-35a7027c]:hover{background:#0000000d}.btn-primary[data-v-35a7027c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-35a7027c]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-35a7027c],.video-panel-leave-active[data-v-35a7027c]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-35a7027c],.video-panel-leave-to[data-v-35a7027c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-35a7027c],.video-panel-leave-from[data-v-35a7027c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-750ee9bb]{position:relative}.find-input-panel[data-v-750ee9bb]{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}.fr-header[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-750ee9bb]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent}.fr-tab.active[data-v-750ee9bb]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-750ee9bb]{display:block;font-size:12px;color:#666;margin:6px 0 4px}.fr-input-row[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-750ee9bb]{flex:1;padding:8px;border:1px solid #e5e7eb;border-radius:8px}.fr-count[data-v-750ee9bb]{font-size:12px;color:#999}.fr-actions[data-v-750ee9bb]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-750ee9bb]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.fr-btn.primary[data-v-750ee9bb]{color:#fff;background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-750ee9bb],.find-panel-leave-active[data-v-750ee9bb]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-750ee9bb],.find-panel-leave-to[data-v-750ee9bb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-750ee9bb],.find-panel-leave-from[data-v-750ee9bb]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-47847dc2]{position:relative}.link-input-panel[data-v-47847dc2]{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-47847dc2]{margin-bottom:8px}.label[data-v-47847dc2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-47847dc2]{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-47847dc2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-47847dc2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-47847dc2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-47847dc2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-47847dc2],.link-panel-leave-active[data-v-47847dc2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-47847dc2],.link-panel-leave-to[data-v-47847dc2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-47847dc2],.link-panel-leave-from[data-v-47847dc2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-8a3a35f7]{position:relative}.table-panel[data-v-8a3a35f7]{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-8a3a35f7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-8a3a35f7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-8a3a35f7]{display:flex;gap:4px}.cell[data-v-8a3a35f7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-8a3a35f7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-8a3a35f7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-bbf06816]{position:relative}.tools-panel[data-v-bbf06816]{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-bbf06816]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-bbf06816]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-693f2c14]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-693f2c14]:hover{background:#0000000d}.icon[data-v-587fb9a8]{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-587fb9a8]:hover{background:#0000000d}.heading-select[data-v-aeb74f7c]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-aeb74f7c]{cursor:pointer;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-aeb74f7c]:hover{background:#0000000d}.label[data-v-aeb74f7c]{font-size:15px;color:#333}.dropdown[data-v-aeb74f7c]{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-aeb74f7c],.dropdown-slide-leave-to[data-v-aeb74f7c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-aeb74f7c],.dropdown-slide-leave-active[data-v-aeb74f7c]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-aeb74f7c]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-aeb74f7c]:hover{background:#0000000d}.item-label[data-v-aeb74f7c]{flex:1;color:#222}.item-label.paragraph[data-v-aeb74f7c]{font-size:15px}.item-label.level-1[data-v-aeb74f7c]{font-size:22px;font-weight:600}.item-label.level-2[data-v-aeb74f7c]{font-size:20px;font-weight:600}.item-label.level-3[data-v-aeb74f7c]{font-size:18px;font-weight:600}.item-label.level-4[data-v-aeb74f7c]{font-size:16px}.item-label.level-5[data-v-aeb74f7c]{font-size:15px}.item-label.level-6[data-v-aeb74f7c]{font-size:14px}.shortcut[data-v-aeb74f7c]{color:#999;font-size:12px}.align-select[data-v-f2f793f3]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-f2f793f3]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:#fff;gap:3px}.icon_box[data-v-f2f793f3]:hover{background:#0000000d}.dropdown[data-v-f2f793f3]{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-f2f793f3],.dropdown-slide-leave-to[data-v-f2f793f3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f2f793f3],.dropdown-slide-leave-active[data-v-f2f793f3]{transition:opacity .18s ease,transform .18s ease}.options[data-v-f2f793f3]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-f2f793f3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-f2f793f3]:hover{background:#0000000d}.option.active[data-v-f2f793f3]{background:#0000001a}.header_box[data-v-40d61df0]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box.disabled[data-v-40d61df0]{pointer-events:none;opacity:.5}.header_box .icon[data-v-40d61df0]{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-40d61df0]:hover{background:#0000000d}.header_box .icon.active[data-v-40d61df0]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-40d61df0]{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-c5cc8864]{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}.simple-editor.fullscreen[data-v-c5cc8864]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.simple-editor.readonly[data-v-c5cc8864] .tiptap-resize-handle,.simple-editor.readonly[data-v-c5cc8864] .tiptap-resize-wrapper{pointer-events:none}.editor_wrapper[data-v-c5cc8864]{position:relative;overflow-y:auto;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-c5cc8864]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-c5cc8864]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-c5cc8864]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-c5cc8864]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-c5cc8864]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-c5cc8864]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-c5cc8864]{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-c5cc8864]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-c5cc8864]{background:#22c55e}.content[data-v-c5cc8864]{padding:12px 24px}.content[data-v-c5cc8864] img{max-width:100%;height:auto;display:inline-block}.content[data-v-c5cc8864] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-c5cc8864] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-c5cc8864] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-c5cc8864] 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-c5cc8864] 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-c5cc8864 .18s ease both}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-c5cc8864] 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-c5cc8864 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-c5cc8864{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-c5cc8864{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-c5cc8864] 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-c5cc8864] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-c5cc8864] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-c5cc8864] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c5cc8864] [data-resize-wrapper]{display:inline-block}.content[data-v-c5cc8864] .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-c5cc8864] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-c5cc8864] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-c5cc8864] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-c5cc8864] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-c5cc8864] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-c5cc8864] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-c5cc8864] .tiptap-resize-wrapper:hover>img,.content[data-v-c5cc8864] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-c5cc8864] .tiptap-resize-wrapper{position:relative}.content[data-v-c5cc8864] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-c5cc8864] .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-c5cc8864] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-c5cc8864] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-c5cc8864] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-c5cc8864 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-c5cc8864{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-c5cc8864] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-c5cc8864] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-c5cc8864] .ProseMirror table th,.content[data-v-c5cc8864] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-c5cc8864] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-c5cc8864] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-c5cc8864] .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-c5cc8864] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-c5cc8864] .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-c5cc8864] 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-c5cc8864] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-c5cc8864] 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-c5cc8864] p{margin:12px 0}[data-v-c5cc8864] .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-c5cc8864] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-c5cc8864]{grid-template-columns:1fr}.outline-markers[data-v-c5cc8864]{display:none}}.link-modal-backdrop[data-v-c5cc8864]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-c5cc8864]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-c5cc8864]{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-c5cc8864]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-c5cc8864]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-c5cc8864]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-c5cc8864]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-c5cc8864]{display:block;width:640px;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
(function(R,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):(R=typeof globalThis<"u"?globalThis:R||self,e(R.MdEditor={},R.Vue,R.tiptapVue3,R.StarterKit,R.tiptapMarkdown,R.tiptapImage,R.tiptapCore,R.tiptapPlaceholder,R.tiptapLink,R.tiptapTextAlign,R.tiptapTextStyle,R.tiptapColor,R.tiptapUnderline,R.tiptapTable,R.extensions,R.extensionList))})(this,function(R,e,Ne,Fe,Ae,He,ge,Ue,je,Ie,ke,Oe,We,Ee,Re,ve){"use strict";var Te;function Pe(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(a,i,o.get?o:{enumerable:!0,get:()=>t[i]})}}return a.default=t,Object.freeze(a)}const we=Pe(ge),Ge=He.Image.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:a=>a.getAttribute("data-uploading")?!0:null,renderHTML:a=>a.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:a=>{const i=a.getAttribute("width")||a.style.width||"",o=String(i).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:a=>a.width?{width:a.width}:{}},height:{default:null,parseHTML:a=>{const i=a.getAttribute("height")||a.style.height||"",o=String(i).match(/^(\d+)(px)?$/);return o?Number(o[1]):null},renderHTML:a=>a.height?{height:a.height}:{}}}},addNodeView(){return({node:t,getPos:a,editor:i})=>{const o=document.createElement("img"),s=t.attrs;o.src=s.src||"",s.alt&&(o.alt=s.alt),s.title&&(o.title=s.title),typeof s.width=="number"&&(o.style.width=`${s.width}px`),typeof s.height=="number"&&(o.style.height=`${s.height}px`),o.style.maxWidth="100%",o.style.height=o.style.height||"auto",o.style.display="inline-block";const c=new ge.ResizableNodeView({element:o,node:t,getPos:a,onResize:(b,N)=>{o.style.width=`${b}px`,o.style.height=`${N}px`},onCommit:(b,N)=>{try{const m=i,_=a();if(_!==void 0){const{state:y}=m,x=y.schema.nodes.image,d=y.doc.nodeAt(_);if(x&&d){const p={...d.attrs||{},width:b,height:N},f=y.tr.setNodeMarkup(_,x,p,d.marks);m.view.dispatch(f)}}}catch{}},onUpdate:b=>{const N=b.attrs;return typeof N.src=="string"&&N.src&&o.src!==N.src&&(o.src=N.src),typeof N.width=="number"&&(o.style.width=`${N.width}px`),typeof N.height=="number"&&(o.style.height=`${N.height}px`),N.uploading?c.wrapper.setAttribute("data-uploading","true"):c.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{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const v=document.createElement("div");v.className="tiptap-upload-mask";const l=document.createElement("div");return l.className="tiptap-upload-progress",v.appendChild(l),c.wrapper.appendChild(v),s.uploading&&c.wrapper.setAttribute("data-uploading","true"),c}}}),qe=Ee.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:a=>a.getAttribute("data-background-color"),renderHTML:a=>{const i=a.backgroundColor;return i?{"data-background-color":i,style:`background-color: ${i}`}:{}}}}}}),Ye=(((Te=we==null?void 0:we.Node)==null?void 0:Te.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 a=t.getAttribute("width")||t.style.width||"",i=String(a).match(/^(\d+)(px)?$/);return i?Number(i[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const a=t.getAttribute("height")||t.style.height||"",i=String(a).match(/^(\d+)(px)?$/);return i?Number(i[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 a=(t==null?void 0:t.attrs)||{},i=typeof a.src=="string"?a.src:"";return i?`[video](${i})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const a=/^\[video\]\(([^)]+)\)/.exec(t);if(a)return{type:"video",raw:a[0],href:a[1]}}},parseMarkdown(t){const a=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return a?{type:"video",attrs:{src:a,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:a,editor:i})=>{var b;const o=document.createElement("video"),s=t.attrs;o.src=s.src||"",o.controls=s.controls!==!1,o.autoplay=!1,o.loop=!!s.loop,o.muted=!!s.muted,s.poster&&(o.poster=s.poster),o.setAttribute("playsinline","true"),s.class&&(o.className=String(s.class)),typeof s.width=="number"&&(o.style.width=`${s.width}px`),typeof s.height=="number"&&(o.style.height=`${s.height}px`),o.style.display="inline-block";const c=new ge.ResizableNodeView({element:o,node:t,getPos:a,onResize:(N,m)=>{o.style.width=`${N}px`,o.style.height=`${m}px`},onCommit:(N,m)=>{try{const _=i,y=a();if(y!==void 0){const{state:x}=_,d=x.schema.nodes.video,p=x.doc.nodeAt(y);if(d&&p){const f={...p.attrs||{},width:N,height:m},g=x.tr.setNodeMarkup(y,d,f,p.marks);_.view.dispatch(g)}}}catch{}},onUpdate:N=>{const m=N.attrs||{};if(typeof m.src=="string"&&m.src&&o.src!==m.src&&(o.src=m.src),typeof m.width=="number"&&(o.style.width=`${m.width}px`),typeof m.height=="number"&&(o.style.height=`${m.height}px`),m.uploading){c.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}else c.wrapper.removeAttribute("data-uploading"),o.controls=m.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{c.container.style.display="inline-block",c.wrapper.style.display="inline-block"}catch{}const v=document.createElement("div");v.className="tiptap-upload-mask";const l=document.createElement("div");if(l.className="tiptap-upload-progress",v.appendChild(l),c.wrapper.appendChild(v),(b=t.attrs)!=null&&b.uploading){c.wrapper.setAttribute("data-uploading","true"),o.controls=!1;try{o.pause()}catch{}o.style.pointerEvents="none"}return c}},addCommands(){return{setVideo:t=>({chain:a})=>{const{src:i,HTMLAttributes:o={}}=t||{};return a().insertContent({type:this.name,attrs:{src:i,...o}}).run()}}}}),Ke=ve.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:a,getPos:i})=>{const o=document.createElement("li");o.setAttribute("data-type","taskItem"),o.setAttribute("data-checked",t.attrs.checked?"true":"false");const s=document.createElement("span");s.className="todo-box",s.tabIndex=0,s.setAttribute("role","checkbox"),s.setAttribute("aria-checked",t.attrs.checked?"true":"false"),s.addEventListener("mousedown",l=>l.preventDefault());const c=()=>{const l=typeof i=="function"?i():null;if(l==null)return{pos:null,n:null};const b=a.view.state.doc.nodeAt(l);return{pos:l,n:b}};s.addEventListener("click",()=>{var x;const{pos:l,n:b}=c();if(l==null||!b)return;const N=a.view.state,m=N.schema.nodes.taskItem,_=!!((x=b.attrs)!=null&&x.checked),y=N.tr.setNodeMarkup(l,m,{...b.attrs||{},checked:!_});a.view.dispatch(y)}),s.addEventListener("keydown",l=>{var b;if(l.key==="Enter"||l.key===" "){l.preventDefault();const{pos:N,n:m}=c();if(N==null||!m)return;const _=a.view.state,y=_.schema.nodes.taskItem,x=!!((b=m.attrs)!=null&&b.checked),d=_.tr.setNodeMarkup(N,y,{...m.attrs||{},checked:!x});a.view.dispatch(d)}});const v=document.createElement("div");return v.className="task-content",o.appendChild(s),o.appendChild(v),{dom:o,contentDOM:v,update(l){return l.type!==t.type?!1:(o.setAttribute("data-checked",l.attrs.checked?"true":"false"),s.setAttribute("aria-checked",l.attrs.checked?"true":"false"),!0)}}}}});var Je={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 Ze(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Xe(t,a,i){var o=typeof a.fill=="string"?[a.fill]:a.fill||[],s=[],c=a.theme||i.theme;switch(c){case"outline":s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push("none"),s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push("none");break;case"filled":s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push("#FFF"),s.push("#FFF");break;case"two-tone":s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone),s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push(typeof o[1]=="string"?o[1]:i.colors.twoTone.twoTone);break;case"multi-color":s.push(typeof o[0]=="string"?o[0]:"currentColor"),s.push(typeof o[1]=="string"?o[1]:i.colors.multiColor.outFillColor),s.push(typeof o[2]=="string"?o[2]:i.colors.multiColor.innerStrokeColor),s.push(typeof o[3]=="string"?o[3]:i.colors.multiColor.innerFillColor);break}return{size:a.size||i.size,strokeWidth:a.strokeWidth||i.strokeWidth,strokeLinecap:a.strokeLinecap||i.strokeLinecap,strokeLinejoin:a.strokeLinejoin||i.strokeLinejoin,colors:s,id:t}}var Qe=Symbol("icon-context");function ee(t,a,i){var o={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(c){var v=Ze(),l=e.inject(Qe,Je);return function(){var b=c.size,N=c.strokeWidth,m=c.strokeLinecap,_=c.strokeLinejoin,y=c.theme,x=c.fill,d=c.spin,p=Xe(v,{size:b,strokeWidth:N,strokeLinecap:m,strokeLinejoin:_,theme:y,fill:x},l),f=[l.prefix+"-icon"];return f.push(l.prefix+"-icon-"+t),a&&l.rtl&&f.push(l.prefix+"-icon-rtl"),d&&f.push(l.prefix+"-icon-spin"),e.createVNode("span",{class:f.join(" ")},[i(p)])}}};return o}const ae=ee("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)])}),me=ee("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=ee("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=ee("full-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6H42V15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 33V42H33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42H6V33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 15V6H15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ot=ee("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)])}),nt=ee("off-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6V15H42",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 6V15H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42V33H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33 42V33H41.8995",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),rt=ee("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)])}),it=ee("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=ee("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=ee("search",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M21 38C30.3888 38 38 30.3888 38 21C38 11.6112 30.3888 4 21 4C11.6112 4 4 11.6112 4 21C4 30.3888 11.6112 38 21 38Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M26.657 14.3431C25.2093 12.8954 23.2093 12 21.0001 12C18.791 12 16.791 12.8954 15.3433 14.3431",stroke:t.colors[2],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33.2216 33.2217L41.7069 41.707",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),at=ee("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)])}),ct=ee("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)])}),dt=ee("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)])}),ft=ee("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)])}),pt={class:"label"},mt={key:0,class:"shortcut"},ut=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 a=t,i=e.ref(null),o=e.ref(null),s=e.ref(!1),c=e.ref(a.placement),v=e.ref({top:0,left:0});function l(){const m=i.value,_=o.value;if(!m||!_)return;let y=a.placement;const x=_.getBoundingClientRect(),d=x.top,p=window.innerHeight-x.bottom,f=m.offsetHeight+a.offset;y==="bottom"?p<f&&d>=f&&(y="top"):d<f&&p>=f&&(y="bottom"),c.value=y;const g=x.left+x.width/2,u=y==="bottom"?x.bottom+a.offset:x.top-a.offset-m.offsetHeight;v.value={top:u,left:g}}function b(){s.value=!0,e.nextTick(l)}function N(){s.value=!1}return e.onMounted(()=>{window.addEventListener("resize",l),window.addEventListener("scroll",l,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}),e.watch(()=>a.text,()=>e.nextTick(l)),(m,_)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:o,class:"tooltip-wrapper",onMouseenter:b,onMouseleave:N,onFocusin:b,onFocusout:N},[e.renderSlot(m.$slots,"default",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"tipRef",ref:i,class:e.normalizeClass(["tooltip",[c.value,{visible:s.value}]]),style:e.normalizeStyle({top:v.value.top+"px",left:v.value.left+"px"})},[e.createElementVNode("div",pt,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",mt,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),Y=(t,a)=>{const i=t.__vccOpts||t;for(const[o,s]of a)i[o]=s;return i},A=Y(ut,[["__scopeId","data-v-2e4633d5"]]),ht=["aria-expanded"],gt={class:"label"},kt={key:0,class:"dropdown",role:"listbox"},wt=["aria-selected","onClick"],Ct={class:"text"},Ce="md-toolbar-dropdown-open",Me="font-size-select",yt=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],o=e.computed(()=>{var y,x;const _=(x=(y=a.editor)==null?void 0:y.getAttributes("textStyle"))==null?void 0:x.fontSize;return typeof _=="string"&&_?_:"15px"}),s=e.ref(!1),c=e.ref(null);function v(){s.value||window.dispatchEvent(new CustomEvent(Ce,{detail:{id:Me}})),s.value=!s.value}function l(){s.value=!1}function b(_){var y;(y=a.editor)==null||y.chain().focus().setMark("textStyle",{fontSize:_}).run(),l()}function N(_){const y=_.target,x=c.value;x&&!x.contains(y)&&l()}e.onMounted(()=>{document.addEventListener("click",N),window.addEventListener(Ce,m)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",N),window.removeEventListener(Ce,m)});function m(_){var x;((x=_.detail)==null?void 0:x.id)!==Me&&(s.value=!1)}return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:c},[e.createVNode(e.unref(A),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(v,["stop"]),"aria-expanded":s.value},[e.createElementVNode("div",gt,e.toDisplayString(o.value),1),e.createVNode(e.unref(me),{theme:"filled",strokeWidth:3})],8,ht)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",kt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,x=>e.createElementVNode("div",{key:x,class:"dropdown-item","aria-selected":x===o.value,onClick:e.withModifiers(d=>b(x),["stop"])},[x===o.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",Ct,e.toDisplayString(x),1)],8,wt)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8ea77a66"]]),xt=["aria-expanded"],bt={key:0,class:"dropdown"},Vt={class:"section"},_t={class:"swatches"},Nt=["onClick"],Et={class:"section"},vt={class:"swatches grid"},Mt=["onClick"],Bt={key:0,class:"section"},Lt={class:"swatches"},zt=["onClick"],St={class:"section inline-actions"},$t={key:1,class:"advanced"},ye="md-toolbar-dropdown-open",Be="color-select",Tt=Y(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const a=t,i=["#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),s=e.ref(!1),c=e.ref(null),v=e.ref(a.currentColor||"#000000"),l=e.ref(f()),b=e.ref("#F5222D");function N(){o.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:Be}})),o.value=!o.value}function m(){o.value=!1}function _(){s.value=!s.value}function y(C){var h;(h=a.editor)==null||h.chain().focus().setColor(C).run(),b.value=C,g(C),m()}function x(){var C;(C=a.editor)==null||C.chain().focus().unsetColor().run(),m()}function d(C){const h=C.target,k=c.value;k&&!k.contains(h)&&m()}function p(){}function f(){try{const C=localStorage.getItem("md_color_recent");if(!C)return[];const h=JSON.parse(C);return Array.isArray(h)?h.slice(0,12):[]}catch{return[]}}function g(C){const h=[C,...l.value.filter(k=>k!==C)];l.value=h.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(l.value))}catch{}}let u=[];function E(){const C=a.editor;C&&(u=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],u.forEach(({event:h,handler:k})=>{C.on(h,k)}))}e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener(ye,T),E()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",d),window.removeEventListener(ye,T);const C=a.editor;C&&u.forEach(({event:h,handler:k})=>{C.off(h,k)}),u=[]}),e.watch(()=>a.editor,(C,h)=>{h&&u.forEach(({event:k,handler:L})=>{h.off(k,L)}),u=[],E()});function T(C){var k;((k=C.detail)==null?void 0:k.id)!==Be&&(o.value=!1)}return(C,h)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createVNode(e.unref(A),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:h[0]||(h[0]=e.withModifiers(k=>y(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)])]),_:1}),e.createVNode(e.unref(A),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(me),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,xt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",bt,[e.createElementVNode("div",Vt,[h[4]||(h[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",_t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},[k===b.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Nt))),128))])]),e.createElementVNode("div",Et,[h[5]||(h[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},[k===b.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Mt))),128))])]),l.value.length?(e.openBlock(),e.createElementBlock("div",Bt,[h[6]||(h[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},null,12,zt))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",St,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(x,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(_,["stop"])},"更多颜色")]),s.value?(e.openBlock(),e.createElementBlock("div",$t,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":h[1]||(h[1]=k=>v.value=k)},null,512),[[e.vModelText,v.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":h[2]||(h[2]=k=>v.value=k)},null,512),[[e.vModelText,v.value]]),e.createElementVNode("button",{class:"btn apply",onClick:h[3]||(h[3]=e.withModifiers(k=>y(v.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-0f5572cb"]]),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="1763565315763" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81778" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="81779"></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="1763565310640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81615" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h832v96H96zM96 800h832v96H96z" p-id="81616"></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="1763565296828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="81290"></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="1763565306218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81452" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="81453"></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="1763562183158" class="icon" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79129" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.37109375" height="18"><path d="M93.105231 187.943385a78.769231 78.769231 0 1 1 0-157.538462 78.769231 78.769231 0 0 1 0 157.538462z m0 393.846153a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461z m0 393.846154a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461zM276.243692 161.792v-118.153846h787.692308v118.153846h-787.692308z m0.472616 397.233231v-118.153846h788.007384v118.153846H276.716308z m-3.308308 397.154461v-118.153846h789.267692v118.153846H273.329231z" fill="#333333" p-id="79130"></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="1763566846467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="83576" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M477.098667 709.717333a46.805333 46.805333 0 0 0 69.802666 0l296.021334-340.736c24.32-28.032 3.328-70.314667-34.944-70.314666H216.021333c-38.272 0-59.306667 42.282667-34.944 70.314666l296.021334 340.736z" fill="#000000" p-id="83577"></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="1763568214776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="84748" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M682.666667 772.266667l332.8-247.466667-324.266667-435.2-409.6 307.2-256 192L260.266667 896h691.2v-85.333333h-324.266667l55.466667-38.4zM674.133333 213.333333l221.866667 294.4-260.266667 196.266667-38.4 25.6-230.4-285.866667L674.133333 213.333333zM145.066667 605.866667l149.333333-110.933334 230.4 285.866667-34.133333 29.866667H298.666667l-153.6-204.8z" fill="#333333" p-id="84749"></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="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>',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="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>',Rt='<?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="1763569611105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="87406" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 0.6 0.1 1.3 0.2 1.9-0.1 2-0.2 4.1-0.2 6.1 0 46.4 37.6 84 84 84s84-37.6 84-84c0-2.1-0.1-4.1-0.2-6.1 0.1-0.6 0.2-1.2 0.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z" p-id="87407"></path></svg>',Pt='<?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>',Gt='<?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>',qt='<?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>',Yt='<?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="1763562537529" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="80294" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M107.5 736c28.6 0 52.2 7.1 70.2 21.4 18.5 15.1 27.9 36 27.9 61.7 0 22.9-8.4 41.3-24.7 54.1 16 12 29.6 32.8 29.6 57.3 0 27-9.7 49.7-28.8 67.2-19.6 17.5-45 26.3-75.6 26.3-29.2 0-53.4-7.8-71.7-23.3C14 983.6 2.4 958.4 0 926.1v-14.5h69.7V925c0.6 12.9 4.2 21.8 10.9 27.8 6.2 5.7 14.4 8.6 25.2 8.6 12.1 0 21.3-3.2 27.6-9.2 5.6-5.6 8.2-11.9 8.2-19.9 0-10-2.7-16.6-7.9-20.8-5.4-4.5-14.5-6.9-27.8-6.9H74.3v-58.9h31.5c11.6 0 19.8-2.2 24.5-6.1 4.1-3.5 6.3-9.2 6.3-17.4 0-8.3-2-13.9-5.3-17-4.6-3.9-12.3-6.1-23.5-6.1-11.5 0-19.3 2.5-24.8 7.4-5.5 4.8-8.9 12.8-10 23.7v13.4H5.1l-0.2-7v-8.2c2.4-29.1 13.4-52.1 32.7-68.2C55.8 744 79.3 736 107.5 736z m916.5 96v128H384V832h640zM106.9 368c28 0 51.7 8.4 70.5 25.1 18.8 17.1 28.2 39.1 28.2 65.8 0 25.4-9.7 48.8-28.8 70-10.4 11.1-27.9 24.8-55.3 43.2-10.1 6.6-18.5 12.9-25.2 18.7h109.3V656l-7.1 0.1-185.2-0.1c-4.5-0.6-7.5-1.6-9.8-3.8-2.4-2.4-3.2-5.6-3.5-10.4 0-29.7 9.6-55.5 28.8-77.1 10.3-11.8 30.6-28.1 61.1-49.1 14.4-10 25.7-19.2 32.4-26.3 8.9-10 13.2-20.3 13.2-30.8 0-9.8-2.3-16.6-6.4-20.4-4.5-4.1-12.2-6.3-23.6-6.3-11.3 0-18.8 3.4-24.1 10.6-5.7 7.3-9.2 19.8-9.9 37.7-0.5 3.9-1.6 6.8-3.8 9-2.1 2-4.8 3-10.4 4l-43-0.1c-4.2-0.8-7.1-1.9-9.2-4-2.2-2.3-3.2-5.3-3.7-10.3 0.4-32.1 9.9-58.3 28.6-78.2 19.6-21.6 45.5-32.5 76.9-32.5z m917.1 80v128H384V448h640zM146.6 0v288H75.1V94.2c-16.7 10.2-35.9 18.3-50.9 20.3l-8.2 1.6V46l4.8-2C39.3 37.3 52.5 31.7 60 27.6 71 20.9 82.1 11.7 96.3 0.1h50.3zM1024 64v128H384V64h640z" fill="#333333" p-id="80295"></path></svg>',Kt='<?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>',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="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>',Zt='<?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>',Xt='<?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>',Qt='<?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>',eo=["innerHTML"],G=Y(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const a=t,i=e.useAttrs(),o=Object.assign({"/src/svg/alignCenter.svg":Dt,"/src/svg/alignJustify.svg":Ft,"/src/svg/alignLeft.svg":At,"/src/svg/alignRight.svg":Ht,"/src/svg/bulletList.svg":Ut,"/src/svg/caretDown.svg":jt,"/src/svg/clearFormat.svg":It,"/src/svg/code.svg":Ot,"/src/svg/codeBlock.svg":Wt,"/src/svg/formatBrush.svg":Rt,"/src/svg/highBg.svg":Pt,"/src/svg/img.svg":Gt,"/src/svg/link.svg":qt,"/src/svg/orderedList.svg":Yt,"/src/svg/quote.svg":Kt,"/src/svg/table.svg":Jt,"/src/svg/tableTools.svg":Zt,"/src/svg/task.svg":Xt,"/src/svg/video.svg":Qt}),s=(()=>{const m={};return Object.entries(o).forEach(([_,y])=>{const d=(_.split("/src/svg/")[1]||_).replace(/\.svg$/i,"");m[d]=y;const p=d.split("/").pop();p&&(m[p]=y)}),m})(),c=e.computed(()=>{const m=a.name.replace(/\.svg$/i,"");return s[m]||""});function v(m){if(!m)return"";let _=m.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return _=_.replace(/<svg([^>]*)>/i,(y,x)=>`<svg${x.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),_=_.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),_=_.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),_}const l=e.computed(()=>v(c.value));function b(m){if(m!=null)return typeof m=="number"?`${m}px`:m}const N=e.computed(()=>{const m={},_=b(a.size);_&&(m.fontSize=_),a.color&&(m.color=a.color);const y=i.style??void 0;return[m,y].filter(Boolean)});return(m,_)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(i).class]),style:e.normalizeStyle(N.value),innerHTML:l.value},null,14,eo))}}),[["__scopeId","data-v-c83ef2e3"]]),to=["aria-expanded"],oo={key:0,class:"dropdown"},no={class:"section"},ro={class:"swatches"},io={class:"section"},lo={class:"swatches"},so=["onClick"],ao={key:0,class:"check"},co={class:"section"},fo={class:"swatches grid"},po=["onClick"],mo={key:0,class:"section"},uo={class:"swatches"},ho=["onClick"],go={class:"section inline-actions"},ko={key:1,class:"advanced"},xe="md-toolbar-dropdown-open",Le="bg-color-select",wo=Y(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const a=t,i=["#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),s=e.ref(!1),c=e.ref(null),v=e.ref(a.currentBg||"#ffffff"),l=e.ref(f()),b=e.ref("#FADB14");function N(){o.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:Le}})),o.value=!o.value}function m(){o.value=!1}function _(){s.value=!s.value}function y(C){var h;(h=a.editor)==null||h.chain().focus().setMark("textStyle",{backgroundColor:C}).run(),b.value=C,g(C),m()}function x(){var C;(C=a.editor)==null||C.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),m()}function d(C){const h=C.target,k=c.value;k&&!k.contains(h)&&m()}function p(){}function f(){try{const C=localStorage.getItem("md_bg_recent");if(!C)return[];const h=JSON.parse(C);return Array.isArray(h)?h.slice(0,12):[]}catch{return[]}}function g(C){const h=[C,...l.value.filter(k=>k!==C)];l.value=h.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(l.value))}catch{}}let u=[];function E(){const C=a.editor;C&&(u=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],u.forEach(({event:h,handler:k})=>{C.on(h,k)}))}e.onMounted(()=>{document.addEventListener("click",d),window.addEventListener(xe,T),E()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",d),window.removeEventListener(xe,T);const C=a.editor;C&&u.forEach(({event:h,handler:k})=>{C.off(h,k)}),u=[]}),e.watch(()=>a.editor,(C,h)=>{h&&u.forEach(({event:k,handler:L})=>{h.off(k,L)}),u=[],E()});function T(C){var k;((k=C.detail)==null?void 0:k.id)!==Le&&(o.value=!1)}return(C,h)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:c},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":o.value},[e.createVNode(e.unref(A),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:h[0]||(h[0]=e.withModifiers(k=>y(b.value),["stop"]))},[e.createVNode(G,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:b.value})},null,4)])]),_:1}),e.createVNode(e.unref(A),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(me),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,to),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("div",no,[h[4]||(h[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",ro,[e.createElementVNode("div",{class:"swatch",style:{background:`linear-gradient(
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode(`.tooltip-wrapper[data-v-2e4633d5]{position:relative;display:inline-flex;align-items:center;line-height:0}.tooltip[data-v-2e4633d5]{position:fixed;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-2e4633d5]{opacity:1;visibility:visible}.shortcut[data-v-2e4633d5]{display:inline-block;margin-top:4px;opacity:.9;z-index:1000}.icon[data-v-8ea77a66]{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-8ea77a66]:hover{background:#0000000d}.font-size[data-v-8ea77a66]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.label[data-v-8ea77a66]{font-size:15px;color:#333}.dropdown[data-v-8ea77a66]{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-8ea77a66],.dropdown-slide-leave-to[data-v-8ea77a66]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-8ea77a66],.dropdown-slide-leave-active[data-v-8ea77a66]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-8ea77a66]{display:flex;align-items:center;gap:8px;padding:6px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-8ea77a66]:hover{background:#0000000d}.text[data-v-8ea77a66]{flex:1}.icon[data-v-0f5572cb]{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-0f5572cb]{width:auto;justify-content:space-between;background:#fff}.icon-stack[data-v-0f5572cb]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-0f5572cb]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-0f5572cb]:hover{background:#0000000d}.underline[data-v-0f5572cb]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#000}.color-select[data-v-0f5572cb]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none}.dropdown[data-v-0f5572cb]{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-0f5572cb],.dropdown-slide-leave-to[data-v-0f5572cb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-0f5572cb],.dropdown-slide-leave-active[data-v-0f5572cb]{transition:opacity .18s ease,transform .18s ease}.section[data-v-0f5572cb]{margin-bottom:8px}.section-title[data-v-0f5572cb]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-0f5572cb]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-0f5572cb]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-0f5572cb]{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-0f5572cb]{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-0f5572cb]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-0f5572cb]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-0f5572cb]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-0f5572cb]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-0f5572cb]{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-620c7aa3]{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-620c7aa3]{width:auto;padding:0 2px;min-width:20px;justify-content:space-between;background:#fff}.icon-stack[data-v-620c7aa3]{display:flex;flex-direction:column;align-items:center;line-height:1;border-radius:6px;padding:2px;cursor:pointer}.arrow[data-v-620c7aa3]{display:flex;align-items:center;justify-content:center;width:16px;height:27px;border-radius:4px;cursor:pointer}.hoverable[data-v-620c7aa3]:hover{background:#0000000d}.underline[data-v-620c7aa3]{width:16px;height:2px;border-radius:2px;margin-top:2px;background:#fff}.bg-color-select[data-v-620c7aa3]{position:relative;-webkit-user-select:none;user-select:none}.dropdown[data-v-620c7aa3]{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-620c7aa3]{margin-bottom:8px}.section-title[data-v-620c7aa3]{font-size:12px;color:#666;margin-bottom:6px}.swatches[data-v-620c7aa3]{display:flex;flex-wrap:wrap;gap:6px}.swatches.grid[data-v-620c7aa3]{grid-template-columns:repeat(10,1fr)}.swatch[data-v-620c7aa3]{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-620c7aa3]{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-620c7aa3]{display:flex;justify-content:space-between;gap:8px}.btn[data-v-620c7aa3]{padding:4px 8px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer;font-size:12px}.advanced[data-v-620c7aa3]{display:grid;grid-template-columns:auto 1fr auto;gap:4px;align-items:center;margin-top:8px}.hex[data-v-620c7aa3]{border:1px solid #e5e7eb;border-radius:8px;padding:4px 6px;font-size:12px}.apply[data-v-620c7aa3]{justify-self:end;flex-shrink:1}.dropdown-slide-enter-from[data-v-620c7aa3],.dropdown-slide-leave-to[data-v-620c7aa3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-620c7aa3],.dropdown-slide-leave-active[data-v-620c7aa3]{transition:opacity .18s ease,transform .18s ease}.image-icon[data-v-e1c5f3df]{position:relative}.image-input-panel[data-v-e1c5f3df]{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-e1c5f3df]{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-e1c5f3df]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-e1c5f3df]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-e1c5f3df]:hover{background:#0000000d}.btn-primary[data-v-e1c5f3df]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-e1c5f3df]:hover{background:#1677ff;opacity:.92}.img-panel-enter-active[data-v-e1c5f3df],.img-panel-leave-active[data-v-e1c5f3df]{transition:opacity .18s ease,transform .18s ease}.img-panel-enter-from[data-v-e1c5f3df],.img-panel-leave-to[data-v-e1c5f3df]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.img-panel-enter-to[data-v-e1c5f3df],.img-panel-leave-from[data-v-e1c5f3df]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.video-icon[data-v-35a7027c]{position:relative}.video-input-panel[data-v-35a7027c]{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-35a7027c]{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-35a7027c]{margin-top:8px;display:flex;gap:8px;justify-content:flex-end}.btn[data-v-35a7027c]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn[data-v-35a7027c]:hover{background:#0000000d}.btn-primary[data-v-35a7027c]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-35a7027c]:hover{background:#1677ff;opacity:.92}.video-panel-enter-active[data-v-35a7027c],.video-panel-leave-active[data-v-35a7027c]{transition:opacity .18s ease,transform .18s ease}.video-panel-enter-from[data-v-35a7027c],.video-panel-leave-to[data-v-35a7027c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.video-panel-enter-to[data-v-35a7027c],.video-panel-leave-from[data-v-35a7027c]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.find-icon[data-v-750ee9bb]{position:relative}.find-input-panel[data-v-750ee9bb]{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}.fr-header[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;margin-bottom:6px}.fr-tab[data-v-750ee9bb]{border:none;background:transparent;padding:6px 8px;cursor:pointer;border-bottom:2px solid transparent}.fr-tab.active[data-v-750ee9bb]{border-color:#1a69f8;font-weight:600}.fr-label[data-v-750ee9bb]{display:block;font-size:12px;color:#666;margin:6px 0 4px}.fr-input-row[data-v-750ee9bb]{display:flex;align-items:center;gap:6px;width:100%}.fr-input[data-v-750ee9bb]{flex:1;padding:8px;border:1px solid #e5e7eb;border-radius:8px}.fr-count[data-v-750ee9bb]{font-size:12px;color:#999}.fr-actions[data-v-750ee9bb]{display:flex;gap:8px;margin-top:10px;justify-content:flex-end}.fr-btn[data-v-750ee9bb]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.fr-btn.primary[data-v-750ee9bb]{color:#fff;background:#1a69f8;border-color:#1a69f8}.find-panel-enter-active[data-v-750ee9bb],.find-panel-leave-active[data-v-750ee9bb]{transition:opacity .18s ease,transform .18s ease}.find-panel-enter-from[data-v-750ee9bb],.find-panel-leave-to[data-v-750ee9bb]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.find-panel-enter-to[data-v-750ee9bb],.find-panel-leave-from[data-v-750ee9bb]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.link-icon[data-v-47847dc2]{position:relative}.link-input-panel[data-v-47847dc2]{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-47847dc2]{margin-bottom:8px}.label[data-v-47847dc2]{font-size:12px;color:#666;margin-bottom:6px}.input[data-v-47847dc2]{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-47847dc2]{display:flex;justify-content:flex-end;gap:8px}.btn[data-v-47847dc2]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.btn-primary[data-v-47847dc2]{border:none;background:#1677ff;color:#fff}.btn-primary[data-v-47847dc2]:hover{background:#1677ff;opacity:.92}.link-panel-enter-active[data-v-47847dc2],.link-panel-leave-active[data-v-47847dc2]{transition:opacity .18s ease,transform .18s ease}.link-panel-enter-from[data-v-47847dc2],.link-panel-leave-to[data-v-47847dc2]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.link-panel-enter-to[data-v-47847dc2],.link-panel-leave-from[data-v-47847dc2]{opacity:1;transform:translate(-50%) translateY(0) scale(1)}.table-icon[data-v-8a3a35f7]{position:relative}.table-panel[data-v-8a3a35f7]{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-8a3a35f7]{font-size:12px;color:#666;margin-bottom:6px}.grid[data-v-8a3a35f7]{display:flex;flex-direction:column;gap:4px;padding:8px;background:#f7f8fa;border-radius:8px}.row[data-v-8a3a35f7]{display:flex;gap:4px}.cell[data-v-8a3a35f7]{width:18px;height:18px;background:#fff;border:1px solid #e5e7eb;border-radius:3px;cursor:pointer}.cell.active[data-v-8a3a35f7]{background:#e8f1ff;border-color:#1677ff}.size[data-v-8a3a35f7]{margin-top:6px;font-size:12px;color:#333}.table-tools[data-v-bbf06816]{position:relative}.tools-panel[data-v-bbf06816]{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-bbf06816]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.btn[data-v-bbf06816]{padding:6px 10px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-size:13px}.icon[data-v-693f2c14]{cursor:default;border-radius:6px;display:flex;align-items:center;justify-content:center;transition:all .2s ease-in-out;position:relative}.icon[data-v-693f2c14]:hover{background:#0000000d}.icon[data-v-587fb9a8]{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-587fb9a8]:hover{background:#0000000d}.heading-select[data-v-aeb74f7c]{position:relative;margin:0 4px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon[data-v-aeb74f7c]{cursor:pointer;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-aeb74f7c]:hover{background:#0000000d}.label[data-v-aeb74f7c]{font-size:15px;color:#333}.dropdown[data-v-aeb74f7c]{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-aeb74f7c],.dropdown-slide-leave-to[data-v-aeb74f7c]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-aeb74f7c],.dropdown-slide-leave-active[data-v-aeb74f7c]{transition:opacity .18s ease,transform .18s ease}.dropdown-item[data-v-aeb74f7c]{display:flex;align-items:center;gap:8px;padding:10px 12px;cursor:pointer;font-size:14px}.dropdown-item[data-v-aeb74f7c]:hover{background:#0000000d}.item-label[data-v-aeb74f7c]{flex:1;color:#222}.item-label.paragraph[data-v-aeb74f7c]{font-size:15px}.item-label.level-1[data-v-aeb74f7c]{font-size:22px;font-weight:600}.item-label.level-2[data-v-aeb74f7c]{font-size:20px;font-weight:600}.item-label.level-3[data-v-aeb74f7c]{font-size:18px;font-weight:600}.item-label.level-4[data-v-aeb74f7c]{font-size:16px}.item-label.level-5[data-v-aeb74f7c]{font-size:15px}.item-label.level-6[data-v-aeb74f7c]{font-size:14px}.shortcut[data-v-aeb74f7c]{color:#999;font-size:12px}.align-select[data-v-f2f793f3]{position:relative;margin:0 2px;-webkit-user-select:none;user-select:none;word-break:keep-all}.icon_box[data-v-f2f793f3]{cursor:pointer;height:27px;border-radius:4px;display:flex;align-items:center;justify-content:space-between;transition:all .2s ease-in-out;padding:0 6px;background:#fff;gap:3px}.icon_box[data-v-f2f793f3]:hover{background:#0000000d}.dropdown[data-v-f2f793f3]{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-f2f793f3],.dropdown-slide-leave-to[data-v-f2f793f3]{opacity:0;transform:translate(-50%) translateY(-6px) scale(.98)}.dropdown-slide-enter-active[data-v-f2f793f3],.dropdown-slide-leave-active[data-v-f2f793f3]{transition:opacity .18s ease,transform .18s ease}.options[data-v-f2f793f3]{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.option[data-v-f2f793f3]{cursor:pointer;width:27px;height:27px;border-radius:6px;display:flex;align-items:center;justify-content:center}.option[data-v-f2f793f3]:hover{background:#0000000d}.option.active[data-v-f2f793f3]{background:#0000001a}.header_box[data-v-40d61df0]{display:flex;align-items:center;gap:3px;padding:8px;border-bottom:1px solid rgba(0,0,0,.1)}.header_box.disabled[data-v-40d61df0]{pointer-events:none;opacity:.5}.header_box .icon[data-v-40d61df0]{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-40d61df0]:hover{background:#0000000d}.header_box .icon.active[data-v-40d61df0]{background:#0000001a}.header_box .icon[aria-disabled=true][data-v-40d61df0]{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-cd057d93]{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}.simple-editor.fullscreen[data-v-cd057d93]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;border-radius:0}.simple-editor.readonly[data-v-cd057d93] .tiptap-resize-handle{pointer-events:none;display:none}.simple-editor.readonly[data-v-cd057d93] img,.simple-editor.readonly[data-v-cd057d93] video{-webkit-user-drag:none}.simple-editor.readonly[data-v-cd057d93] .tiptap-resize-wrapper,.simple-editor.readonly[data-v-cd057d93] .tiptap-resize-container{outline:none!important;border:none!important;width:100%!important;max-width:100%!important}.simple-editor.readonly[data-v-cd057d93] .tiptap-video{width:100%!important;max-width:100%!important}.editor_wrapper[data-v-cd057d93]{position:relative;overflow-y:auto;overflow-x:hidden;color:#333;align-items:stretch;flex:1 1 auto;min-height:0}.editor_wrapper[data-v-cd057d93]::-webkit-scrollbar{width:6px;height:1px}.editor_wrapper[data-v-cd057d93]::-webkit-scrollbar-thumb{border-radius:10px;box-shadow:inset 0 0 5px #1118181a;background:#787878}.editor_wrapper[data-v-cd057d93]::-webkit-scrollbar-track{border-radius:10px;background:transparent}.editor_main[data-v-cd057d93]{display:grid;grid-template-columns:1fr auto;align-items:stretch;flex:1 1 auto;min-height:0;position:relative}.outline-toggle-row[data-v-cd057d93]{position:sticky;top:12px;z-index:3;display:flex;justify-content:flex-end;padding-right:12px}.outline-markers[data-v-cd057d93]{position:absolute;right:0;top:0;bottom:0;width:18px;z-index:4}.outline-pin[data-v-cd057d93]{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-cd057d93]{position:absolute;right:3px;width:12px;height:2px;background:#d0d5dd;border-radius:2px}.outline-marker.active[data-v-cd057d93]{background:#22c55e}.content[data-v-cd057d93]{padding:12px 24px}.content[data-v-cd057d93] img{max-width:100%;height:auto;display:inline-block}.content[data-v-cd057d93] .ProseMirror{outline:none;caret-color:var(--editor-caret-color)}.content[data-v-cd057d93] .tiptap-resize-container,.content[data-v-cd057d93] .tiptap-resize-wrapper{max-width:100%!important;box-sizing:border-box}.content[data-v-cd057d93] .tiptap-video{max-width:100%!important;height:auto!important;display:block}.content[data-v-cd057d93] .drag-hover-target{background:#eef5ff;border-radius:8px}.content[data-v-cd057d93] ul[data-type=taskList]{list-style:none;padding-left:0;margin:12px 0}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem]{display:flex;align-items:flex-start;gap:8px;margin:6px 0}.content[data-v-cd057d93] 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-cd057d93] 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-cd057d93 .18s ease both}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] .todo-box{background:#22c55e;border-color:#22c55e}.content[data-v-cd057d93] 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-cd057d93 .22s cubic-bezier(.2,.7,.3,1.2) both}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .todo-box:focus{outline:2px solid #1677ff44}@keyframes todo-check-in-cd057d93{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-cd057d93{0%{transform:translate(-50%,-50%) scale(1);opacity:1}to{transform:translate(-50%,-50%) scale(.3);opacity:0}}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem]>label,.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .task-item__label{display:inline-flex;align-items:center;margin-right:6px}.content[data-v-cd057d93] 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-cd057d93] ul[data-type=taskList] li[data-type=taskItem][data-checked=true] input[type=checkbox]{accent-color:#22c55e}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .task-content,.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .task-item__content{flex:1;min-width:1px}.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .task-content p,.content[data-v-cd057d93] ul[data-type=taskList] li[data-type=taskItem] .task-item__content p{margin:0}.content[data-v-cd057d93] img.ProseMirror-selectednode{outline:2px solid #6366f1;border-radius:4px}.content[data-v-cd057d93] [data-resize-wrapper]{display:inline-block}.content[data-v-cd057d93] .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-cd057d93] .tiptap-resize-handle[data-resize-handle=top-left],.content[data-v-cd057d93] .tiptap-resize-handle[data-resize-handle=bottom-right]{cursor:nwse-resize}.content[data-v-cd057d93] .tiptap-resize-handle[data-resize-handle=top-right],.content[data-v-cd057d93] .tiptap-resize-handle[data-resize-handle=bottom-left]{cursor:nesw-resize}.content[data-v-cd057d93] .tiptap-resize-wrapper:hover .tiptap-resize-handle,.content[data-v-cd057d93] .tiptap-resize-container[data-resize-state=true] .tiptap-resize-handle{opacity:1;pointer-events:auto}.content[data-v-cd057d93] .tiptap-resize-wrapper:hover>img,.content[data-v-cd057d93] .tiptap-resize-wrapper:hover>video{outline:2px solid #6366f1;border-radius:4px}.content[data-v-cd057d93] .tiptap-resize-wrapper{position:relative}.content[data-v-cd057d93] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{pointer-events:auto}.content[data-v-cd057d93] .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-cd057d93] .tiptap-resize-wrapper[data-uploading=true] .tiptap-upload-mask{opacity:1}.content[data-v-cd057d93] .tiptap-upload-progress{width:66%;max-width:360px;height:6px;background:#0003;border-radius:4px;overflow:hidden;position:relative}.content[data-v-cd057d93] .tiptap-upload-progress:before{content:"";position:absolute;left:-40%;width:40%;height:100%;background:#1677ff;border-radius:4px;animation:tiptap-upload-indeterminate-cd057d93 1.1s ease-in-out infinite}@keyframes tiptap-upload-indeterminate-cd057d93{0%{left:-40%}50%{left:60%}to{left:100%}}.content[data-v-cd057d93] .tiptap-resize-container.is-resizing .tiptap-resize-handle{background:#1677ff}.content[data-v-cd057d93] .ProseMirror table{border-collapse:collapse;margin:12px 0;width:100%}.content[data-v-cd057d93] .ProseMirror table th,.content[data-v-cd057d93] .ProseMirror table td{border:1px solid #e5e7eb;padding:8px;text-align:left;position:relative}.content[data-v-cd057d93] .ProseMirror table thead th{background:#f7f9fc;font-weight:600}.content[data-v-cd057d93] .ProseMirror table .selectedCell{background:#1677ff0f;outline:2px solid #1677ff;outline-offset:-2px}.content[data-v-cd057d93] .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-cd057d93] .ProseMirror table .column-resize-handle:hover{background:#1677ff40}.content[data-v-cd057d93] .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-cd057d93] 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-cd057d93] blockquote{border-left:3px solid #e5e7eb;margin:12px 0;padding:4px 12px;color:#6b7280}.content[data-v-cd057d93] 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-cd057d93] p{margin:12px 0}[data-v-cd057d93] .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-cd057d93] .md-drag-handle:before{content:"···";letter-spacing:2px;color:#888;font-weight:700}@media (max-width: 900px){.editor_main[data-v-cd057d93]{grid-template-columns:1fr}.outline-markers[data-v-cd057d93]{display:none}}.link-modal-backdrop[data-v-cd057d93]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0003}.link-modal[data-v-cd057d93]{position:fixed;left:50%;top:20%;transform:translate(-50%);z-index:1000}.link-modal__content[data-v-cd057d93]{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-cd057d93]{font-weight:600;margin-bottom:8px}.link-modal__input[data-v-cd057d93]{width:100%;padding:8px;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:10px}.link-modal__actions[data-v-cd057d93]{display:flex;gap:8px;justify-content:flex-end}.link-modal__actions button[data-v-cd057d93]{padding:6px 10px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;cursor:pointer}.tiptap-video[data-v-cd057d93]{display:block;max-width:100%;height:auto}[data-format-brush=true] .ProseMirror{cursor:url("data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1763569611105'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='87406'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='18'%20height='18'%3e%3cpath%20d='M840%20192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3%200-24%2010.7-24%2024v272c0%2013.3%2010.7%2024%2024%2024h592c13.3%200%2024-10.7%2024-24V256h32v200H465c-22.1%200-40%2017.9-40%2040v136h-44c-4.4%200-8%203.6-8%208v228c0%200.6%200.1%201.3%200.2%201.9-0.1%202-0.2%204.1-0.2%206.1%200%2046.4%2037.6%2084%2084%2084s84-37.6%2084-84c0-2.1-0.1-4.1-0.2-6.1%200.1-0.6%200.2-1.2%200.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1%200%2040-17.9%2040-40V232c0-22.1-17.9-40-40-40zM720%20352H208V160h512v192zM477%20876c0%2011-9%2020-20%2020s-20-9-20-20V696h40v180z'%20p-id='87407'%3e%3c/path%3e%3c/svg%3e") 0 16,crosshair}[data-format-brush=true] .ProseMirror *{cursor:inherit}`)),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
(function(P,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):(P=typeof globalThis<"u"?globalThis:P||self,e(P.MdEditor={},P.Vue,P.tiptapVue3,P.StarterKit,P.tiptapMarkdown,P.tiptapImage,P.tiptapCore,P.tiptapPlaceholder,P.tiptapLink,P.tiptapTextAlign,P.tiptapTextStyle,P.tiptapColor,P.tiptapUnderline,P.tiptapTable,P.extensions,P.extensionList))})(this,function(P,e,Ne,Ae,He,Ue,ge,je,Ie,Oe,ke,We,Re,ve,Pe,Me){"use strict";var De;function Ge(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(c,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return c.default=t,Object.freeze(c)}const we=Ge(ge),qe=Ue.Image.extend({draggable:!1,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),uploading:{default:null,parseHTML:c=>c.getAttribute("data-uploading")?!0:null,renderHTML:c=>c.uploading?{"data-uploading":"true"}:{}},width:{default:null,parseHTML:c=>{const r=c.getAttribute("width")||c.style.width||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.width?{width:c.width}:{}},height:{default:null,parseHTML:c=>{const r=c.getAttribute("height")||c.style.height||"",n=String(r).match(/^(\d+)(px)?$/);return n?Number(n[1]):null},renderHTML:c=>c.height?{height:c.height}:{}}}},addNodeView(){return({node:t,getPos:c,editor:r})=>{const n=document.createElement("img"),a=t.attrs;n.src=a.src||"",a.alt&&(n.alt=a.alt),a.title&&(n.title=a.title),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.maxWidth="100%",n.style.height=n.style.height||"auto",n.style.display="inline-block";const l=new ge.ResizableNodeView({element:n,node:t,getPos:c,onResize:(x,N)=>{n.style.width=`${x}px`,n.style.height=`${N}px`},onCommit:(x,N)=>{try{const u=r,E=c();if(E!==void 0){const{state:C}=u,y=C.schema.nodes.image,i=C.doc.nodeAt(E);if(y&&i){const p={...i.attrs||{},width:x,height:N},f=C.tr.setNodeMarkup(E,y,p,i.marks);u.view.dispatch(f)}}}catch{}},onUpdate:x=>{const N=x.attrs;return typeof N.src=="string"&&N.src&&n.src!==N.src&&(n.src=N.src),typeof N.width=="number"&&(n.style.width=`${N.width}px`),typeof N.height=="number"&&(n.style.height=`${N.height}px`),N.uploading?l.wrapper.setAttribute("data-uploading","true"):l.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"}}});n.addEventListener("dragstart",x=>{const N=r;if(!(N!=null&&N.isEditable))try{x.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),l.wrapper.setAttribute("draggable","false"),l.container.setAttribute("draggable","false"),l.container.style.display="inline-block",l.wrapper.style.display="inline-block"}catch{}const B=document.createElement("div");B.className="tiptap-upload-mask";const s=document.createElement("div");return s.className="tiptap-upload-progress",B.appendChild(s),l.wrapper.appendChild(B),a.uploading&&l.wrapper.setAttribute("data-uploading","true"),l}}}),Ye=ve.TableCell.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),backgroundColor:{default:null,parseHTML:c=>c.getAttribute("data-background-color"),renderHTML:c=>{const r=c.backgroundColor;return r?{"data-background-color":r,style:`background-color: ${r}`}:{}}}}}}),Ke=(((De=we==null?void 0:we.Node)==null?void 0:De.create)??(t=>t))({name:"video",inline:!0,group:"inline",atom:!0,draggable:!1,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 c=t.getAttribute("width")||t.style.width||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[1]):null},renderHTML:t=>t.width?{width:t.width}:{}},height:{default:null,parseHTML:t=>{const c=t.getAttribute("height")||t.style.height||"",r=String(c).match(/^(\d+)(px)?$/);return r?Number(r[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 c=(t==null?void 0:t.attrs)||{},r=typeof c.src=="string"?c.src:"";return r?`[video](${r})`:""},markdownTokenizer:{name:"video",level:"inline",start:t=>t.indexOf("[video]("),tokenize:t=>{const c=/^\[video\]\(([^)]+)\)/.exec(t);if(c)return{type:"video",raw:c[0],href:c[1]}}},parseMarkdown(t){const c=(t==null?void 0:t.href)||(t==null?void 0:t.src)||"";return c?{type:"video",attrs:{src:c,controls:!0}}:{type:"paragraph"}},addNodeView(){return({node:t,getPos:c,editor:r})=>{var x,N,u,E,C;const n=document.createElement("video"),a=t.attrs;n.src=a.src||"",n.controls=a.controls!==!1,n.autoplay=!1,n.loop=!!a.loop,n.muted=!!a.muted,a.poster&&(n.poster=a.poster),n.setAttribute("playsinline","true"),a.class&&(n.className=String(a.class)),typeof a.width=="number"&&(n.style.width=`${a.width}px`),typeof a.height=="number"&&(n.style.height=`${a.height}px`),n.style.display="inline-block";const l=new ge.ResizableNodeView({element:n,node:t,getPos:c,onResize:(y,i)=>{n.style.width=`${y}px`,n.style.height=`${i}px`},onCommit:(y,i)=>{try{const p=r,f=c();if(f!==void 0){const{state:g}=p,m=g.schema.nodes.video,v=g.doc.nodeAt(f);if(m&&v){const $={...v.attrs||{},width:y,height:i},w=g.tr.setNodeMarkup(f,m,$,v.marks);p.view.dispatch(w)}}}catch{}},onUpdate:y=>{const i=y.attrs||{};if(typeof i.src=="string"&&i.src&&n.src!==i.src&&(n.src=i.src),typeof i.width=="number"&&(n.style.width=`${i.width}px`),typeof i.height=="number"&&(n.style.height=`${i.height}px`),i.uploading){l.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}else l.wrapper.removeAttribute("data-uploading"),n.controls=i.controls!==!1,n.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"}}});n.addEventListener("dragstart",y=>{const i=r;if(!(i!=null&&i.isEditable))try{y.preventDefault()}catch{}});try{n.setAttribute("draggable","false"),(N=(x=l==null?void 0:l.wrapper)==null?void 0:x.setAttribute)==null||N.call(x,"draggable","false"),(E=(u=l==null?void 0:l.container)==null?void 0:u.setAttribute)==null||E.call(u,"draggable","false")}catch{}try{l.container.style.display="inline-block",l.wrapper.style.display="inline-block"}catch{}const B=document.createElement("div");B.className="tiptap-upload-mask";const s=document.createElement("div");if(s.className="tiptap-upload-progress",B.appendChild(s),l.wrapper.appendChild(B),(C=t.attrs)!=null&&C.uploading){l.wrapper.setAttribute("data-uploading","true"),n.controls=!1;try{n.pause()}catch{}n.style.pointerEvents="none"}return l}},addCommands(){return{setVideo:t=>({chain:c})=>{const{src:r,HTMLAttributes:n={}}=t||{};return c().insertContent({type:this.name,attrs:{src:r,...n}}).run()}}}}),Je=Me.TaskItem.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),nested:!0}},addNodeView(){return({node:t,editor:c,getPos:r})=>{const n=document.createElement("li");n.setAttribute("data-type","taskItem"),n.setAttribute("data-checked",t.attrs.checked?"true":"false");const a=document.createElement("span");a.className="todo-box",a.tabIndex=0,a.setAttribute("role","checkbox"),a.setAttribute("aria-checked",t.attrs.checked?"true":"false"),a.addEventListener("mousedown",s=>s.preventDefault());const l=()=>{const s=typeof r=="function"?r():null;if(s==null)return{pos:null,n:null};const x=c.view.state.doc.nodeAt(s);return{pos:s,n:x}};a.addEventListener("click",()=>{var y;const{pos:s,n:x}=l();if(s==null||!x)return;const N=c.view.state,u=N.schema.nodes.taskItem,E=!!((y=x.attrs)!=null&&y.checked),C=N.tr.setNodeMarkup(s,u,{...x.attrs||{},checked:!E});c.view.dispatch(C)}),a.addEventListener("keydown",s=>{var x;if(s.key==="Enter"||s.key===" "){s.preventDefault();const{pos:N,n:u}=l();if(N==null||!u)return;const E=c.view.state,C=E.schema.nodes.taskItem,y=!!((x=u.attrs)!=null&&x.checked),i=E.tr.setNodeMarkup(N,C,{...u.attrs||{},checked:!y});c.view.dispatch(i)}});const B=document.createElement("div");return B.className="task-content",n.appendChild(a),n.appendChild(B),{dom:n,contentDOM:B,update(s){return s.type!==t.type?!1:(n.setAttribute("data-checked",s.attrs.checked?"true":"false"),a.setAttribute("aria-checked",s.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 Xe(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Qe(t,c,r){var n=typeof c.fill=="string"?[c.fill]:c.fill||[],a=[],l=c.theme||r.theme;switch(l){case"outline":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("none");break;case"filled":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push("#FFF"),a.push("#FFF");break;case"two-tone":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone),a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.twoTone.twoTone);break;case"multi-color":a.push(typeof n[0]=="string"?n[0]:"currentColor"),a.push(typeof n[1]=="string"?n[1]:r.colors.multiColor.outFillColor),a.push(typeof n[2]=="string"?n[2]:r.colors.multiColor.innerStrokeColor),a.push(typeof n[3]=="string"?n[3]:r.colors.multiColor.innerFillColor);break}return{size:c.size||r.size,strokeWidth:c.strokeWidth||r.strokeWidth,strokeLinecap:c.strokeLinecap||r.strokeLinecap,strokeLinejoin:c.strokeLinejoin||r.strokeLinejoin,colors:a,id:t}}var et=Symbol("icon-context");function Q(t,c,r){var n={name:"icon-"+t,props:["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","spin"],setup:function(l){var B=Xe(),s=e.inject(et,Ze);return function(){var x=l.size,N=l.strokeWidth,u=l.strokeLinecap,E=l.strokeLinejoin,C=l.theme,y=l.fill,i=l.spin,p=Qe(B,{size:x,strokeWidth:N,strokeLinecap:u,strokeLinejoin:E,theme:C,fill:y},s),f=[s.prefix+"-icon"];return f.push(s.prefix+"-icon-"+t),c&&s.rtl&&f.push(s.prefix+"-icon-rtl"),i&&f.push(s.prefix+"-icon-spin"),e.createVNode("span",{class:f.join(" ")},[r(p)])}}};return n}const de=Q("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)])}),ue=Q("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)])}),tt=Q("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)])}),ot=Q("full-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6H42V15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M42 33V42H33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42H6V33",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M6 15V6H15",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),nt=Q("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)])}),rt=Q("off-screen",!1,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M33 6V15H42",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 6V15H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M15 42V33H6",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33 42V33H41.8995",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),it=Q("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)])}),lt=Q("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)])}),st=Q("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)])}),at=Q("search",!0,function(t){return e.createVNode("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none"},[e.createVNode("path",{d:"M21 38C30.3888 38 38 30.3888 38 21C38 11.6112 30.3888 4 21 4C11.6112 4 4 11.6112 4 21C4 30.3888 11.6112 38 21 38Z",fill:t.colors[1],stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M26.657 14.3431C25.2093 12.8954 23.2093 12 21.0001 12C18.791 12 16.791 12.8954 15.3433 14.3431",stroke:t.colors[2],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null),e.createVNode("path",{d:"M33.2216 33.2217L41.7069 41.707",stroke:t.colors[0],"stroke-width":t.strokeWidth,"stroke-linecap":t.strokeLinecap,"stroke-linejoin":t.strokeLinejoin},null)])}),ct=Q("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)])}),dt=Q("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)])}),ft=Q("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)])}),pt=Q("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)])}),mt={class:"label"},ut={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 c=t,r=e.ref(null),n=e.ref(null),a=e.ref(!1),l=e.ref(c.placement),B=e.ref({top:0,left:0});function s(){const u=r.value,E=n.value;if(!u||!E)return;let C=c.placement;const y=E.getBoundingClientRect(),i=y.top,p=window.innerHeight-y.bottom,f=u.offsetHeight+c.offset;C==="bottom"?p<f&&i>=f&&(C="top"):i<f&&p>=f&&(C="bottom"),l.value=C;const g=y.left+y.width/2,m=C==="bottom"?y.bottom+c.offset:y.top-c.offset-u.offsetHeight;B.value={top:m,left:g}}function x(){a.value=!0,e.nextTick(s)}function N(){a.value=!1}return e.onMounted(()=>{window.addEventListener("resize",s),window.addEventListener("scroll",s,!0)}),e.onUnmounted(()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}),e.watch(()=>c.text,()=>e.nextTick(s)),(u,E)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:n,class:"tooltip-wrapper",onMouseenter:x,onMouseleave:N,onFocusin:x,onFocusout:N},[e.renderSlot(u.$slots,"default",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{ref_key:"tipRef",ref:r,class:e.normalizeClass(["tooltip",[l.value,{visible:a.value}]]),style:e.normalizeStyle({top:B.value.top+"px",left:B.value.left+"px"})},[e.createElementVNode("div",mt,e.toDisplayString(t.text),1),t.shortcut?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(t.shortcut),1)):e.createCommentVNode("",!0)],6)]))],544))}}),K=(t,c)=>{const r=t.__vccOpts||t;for(const[n,a]of c)r[n]=a;return r},U=K(ht,[["__scopeId","data-v-2e4633d5"]]),gt=["aria-expanded"],kt={class:"label"},wt={key:0,class:"dropdown",role:"listbox"},Ct=["aria-selected","onClick"],yt={class:"text"},Ce="md-toolbar-dropdown-open",Be="font-size-select",xt=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=["12px","13px","14px","15px","16px","19px","22px","24px","29px","32px","40px","48px"],n=e.computed(()=>{var C,y;const E=(y=(C=c.editor)==null?void 0:C.getAttributes("textStyle"))==null?void 0:y.fontSize;return typeof E=="string"&&E?E:"15px"}),a=e.ref(!1),l=e.ref(null);function B(){a.value||window.dispatchEvent(new CustomEvent(Ce,{detail:{id:Be}})),a.value=!a.value}function s(){a.value=!1}function x(E){var C;(C=c.editor)==null||C.chain().focus().setMark("textStyle",{fontSize:E}).run(),s()}function N(E){const C=E.target,y=l.value;y&&!y.contains(C)&&s()}e.onMounted(()=>{document.addEventListener("click",N),window.addEventListener(Ce,u)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",N),window.removeEventListener(Ce,u)});function u(E){var y;((y=E.detail)==null?void 0:y.id)!==Be&&(a.value=!1)}return(E,C)=>(e.openBlock(),e.createElementBlock("div",{class:"font-size",ref_key:"rootRef",ref:l},[e.createVNode(e.unref(U),{text:"字体大小",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(B,["stop"]),"aria-expanded":a.value},[e.createElementVNode("div",kt,e.toDisplayString(n.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,gt)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",wt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,y=>e.createElementVNode("div",{key:y,class:"dropdown-item","aria-selected":y===n.value,onClick:e.withModifiers(i=>x(y),["stop"])},[y===n.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",yt,e.toDisplayString(y),1)],8,Ct)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-8ea77a66"]]),bt=["aria-expanded"],Vt={key:0,class:"dropdown"},_t={class:"section"},Et={class:"swatches"},Nt=["onClick"],vt={class:"section"},Mt={class:"swatches grid"},Bt=["onClick"],Lt={key:0,class:"section"},zt={class:"swatches"},St=["onClick"],$t={class:"section inline-actions"},Tt={key:1,class:"advanced"},ye="md-toolbar-dropdown-open",Le="color-select",Dt=K(e.defineComponent({__name:"index",props:{editor:{},currentColor:{}},setup(t){const c=t,r=["#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"],n=e.ref(!1),a=e.ref(!1),l=e.ref(null),B=e.ref(c.currentColor||"#000000"),s=e.ref(f()),x=e.ref("#F5222D");function N(){n.value||window.dispatchEvent(new CustomEvent(ye,{detail:{id:Le}})),n.value=!n.value}function u(){n.value=!1}function E(){a.value=!a.value}function C(w){var h;(h=c.editor)==null||h.chain().focus().setColor(w).run(),x.value=w,g(w),u()}function y(){var w;(w=c.editor)==null||w.chain().focus().unsetColor().run(),u()}function i(w){const h=w.target,k=l.value;k&&!k.contains(h)&&u()}function p(){}function f(){try{const w=localStorage.getItem("md_color_recent");if(!w)return[];const h=JSON.parse(w);return Array.isArray(h)?h.slice(0,12):[]}catch{return[]}}function g(w){const h=[w,...s.value.filter(k=>k!==w)];s.value=h.slice(0,12);try{localStorage.setItem("md_color_recent",JSON.stringify(s.value))}catch{}}let m=[];function v(){const w=c.editor;w&&(m=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],m.forEach(({event:h,handler:k})=>{w.on(h,k)}))}e.onMounted(()=>{document.addEventListener("click",i),window.addEventListener(ye,$),v()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i),window.removeEventListener(ye,$);const w=c.editor;w&&m.forEach(({event:h,handler:k})=>{w.off(h,k)}),m=[]}),e.watch(()=>c.editor,(w,h)=>{h&&m.forEach(({event:k,handler:D})=>{h.off(k,D)}),m=[],v()});function $(w){var k;((k=w.detail)==null?void 0:k.id)!==Le&&(n.value=!1)}return(w,h)=>(e.openBlock(),e.createElementBlock("div",{class:"color-select",ref_key:"rootRef",ref:l},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"文字颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:h[0]||(h[0]=e.withModifiers(k=>C(x.value),["stop"]))},[e.createVNode(e.unref(tt),{theme:"filled",size:"14",fill:"#000",strokeWidth:3}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:x.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多颜色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,bt),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("div",_t,[h[4]||(h[4]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",Et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},[k===x.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Nt))),128))])]),e.createElementVNode("div",vt,[h[5]||(h[5]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},[k===x.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,Bt))),128))])]),s.value.length?(e.openBlock(),e.createElementBlock("div",Lt,[h[6]||(h[6]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},null,12,St))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$t,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(E,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",Tt,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":h[1]||(h[1]=k=>B.value=k)},null,512),[[e.vModelText,B.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":h[2]||(h[2]=k=>B.value=k)},null,512),[[e.vModelText,B.value]]),e.createElementVNode("button",{class:"btn apply",onClick:h[3]||(h[3]=e.withModifiers(k=>C(B.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-0f5572cb"]]),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="1763565315763" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81778" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM224 352h576v96H224zM224 800h576v96H224z" p-id="81779"></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="1763565310640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81615" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h832v96H96zM96 800h832v96H96z" p-id="81616"></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="1763565296828" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81289" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM96 352h576v96H96zM96 800h576v96H96z" p-id="81290"></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="1763565306218" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="81452" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M96 128h832v96H96zM96 576h832v96H96zM352 352h576v96H352zM352 800h576v96H352z" p-id="81453"></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="1763562183158" class="icon" viewBox="0 0 1102 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="79129" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.37109375" height="18"><path d="M93.105231 187.943385a78.769231 78.769231 0 1 1 0-157.538462 78.769231 78.769231 0 0 1 0 157.538462z m0 393.846153a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461z m0 393.846154a78.769231 78.769231 0 1 1 0-157.538461 78.769231 78.769231 0 0 1 0 157.538461zM276.243692 161.792v-118.153846h787.692308v118.153846h-787.692308z m0.472616 397.233231v-118.153846h788.007384v118.153846H276.716308z m-3.308308 397.154461v-118.153846h789.267692v118.153846H273.329231z" fill="#333333" p-id="79130"></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="1763566846467" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="83576" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M477.098667 709.717333a46.805333 46.805333 0 0 0 69.802666 0l296.021334-340.736c24.32-28.032 3.328-70.314667-34.944-70.314666H216.021333c-38.272 0-59.306667 42.282667-34.944 70.314666l296.021334 340.736z" fill="#000000" p-id="83577"></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="1763568214776" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="84748" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M682.666667 772.266667l332.8-247.466667-324.266667-435.2-409.6 307.2-256 192L260.266667 896h691.2v-85.333333h-324.266667l55.466667-38.4zM674.133333 213.333333l221.866667 294.4-260.266667 196.266667-38.4 25.6-230.4-285.866667L674.133333 213.333333zM145.066667 605.866667l149.333333-110.933334 230.4 285.866667-34.133333 29.866667H298.666667l-153.6-204.8z" fill="#333333" p-id="84749"></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="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>',Rt='<?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>',Pt='<?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="1763569611105" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="87406" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M840 192h-56v-72c0-13.3-10.7-24-24-24H168c-13.3 0-24 10.7-24 24v272c0 13.3 10.7 24 24 24h592c13.3 0 24-10.7 24-24V256h32v200H465c-22.1 0-40 17.9-40 40v136h-44c-4.4 0-8 3.6-8 8v228c0 0.6 0.1 1.3 0.2 1.9-0.1 2-0.2 4.1-0.2 6.1 0 46.4 37.6 84 84 84s84-37.6 84-84c0-2.1-0.1-4.1-0.2-6.1 0.1-0.6 0.2-1.2 0.2-1.9V640c0-4.4-3.6-8-8-8h-44V520h351c22.1 0 40-17.9 40-40V232c0-22.1-17.9-40-40-40zM720 352H208V160h512v192zM477 876c0 11-9 20-20 20s-20-9-20-20V696h40v180z" p-id="87407"></path></svg>',Gt='<?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>',qt='<?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>',Yt='<?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>',Kt='<?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="1763562537529" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="80294" xmlns:xlink="http://www.w3.org/1999/xlink" width="18" height="18"><path d="M107.5 736c28.6 0 52.2 7.1 70.2 21.4 18.5 15.1 27.9 36 27.9 61.7 0 22.9-8.4 41.3-24.7 54.1 16 12 29.6 32.8 29.6 57.3 0 27-9.7 49.7-28.8 67.2-19.6 17.5-45 26.3-75.6 26.3-29.2 0-53.4-7.8-71.7-23.3C14 983.6 2.4 958.4 0 926.1v-14.5h69.7V925c0.6 12.9 4.2 21.8 10.9 27.8 6.2 5.7 14.4 8.6 25.2 8.6 12.1 0 21.3-3.2 27.6-9.2 5.6-5.6 8.2-11.9 8.2-19.9 0-10-2.7-16.6-7.9-20.8-5.4-4.5-14.5-6.9-27.8-6.9H74.3v-58.9h31.5c11.6 0 19.8-2.2 24.5-6.1 4.1-3.5 6.3-9.2 6.3-17.4 0-8.3-2-13.9-5.3-17-4.6-3.9-12.3-6.1-23.5-6.1-11.5 0-19.3 2.5-24.8 7.4-5.5 4.8-8.9 12.8-10 23.7v13.4H5.1l-0.2-7v-8.2c2.4-29.1 13.4-52.1 32.7-68.2C55.8 744 79.3 736 107.5 736z m916.5 96v128H384V832h640zM106.9 368c28 0 51.7 8.4 70.5 25.1 18.8 17.1 28.2 39.1 28.2 65.8 0 25.4-9.7 48.8-28.8 70-10.4 11.1-27.9 24.8-55.3 43.2-10.1 6.6-18.5 12.9-25.2 18.7h109.3V656l-7.1 0.1-185.2-0.1c-4.5-0.6-7.5-1.6-9.8-3.8-2.4-2.4-3.2-5.6-3.5-10.4 0-29.7 9.6-55.5 28.8-77.1 10.3-11.8 30.6-28.1 61.1-49.1 14.4-10 25.7-19.2 32.4-26.3 8.9-10 13.2-20.3 13.2-30.8 0-9.8-2.3-16.6-6.4-20.4-4.5-4.1-12.2-6.3-23.6-6.3-11.3 0-18.8 3.4-24.1 10.6-5.7 7.3-9.2 19.8-9.9 37.7-0.5 3.9-1.6 6.8-3.8 9-2.1 2-4.8 3-10.4 4l-43-0.1c-4.2-0.8-7.1-1.9-9.2-4-2.2-2.3-3.2-5.3-3.7-10.3 0.4-32.1 9.9-58.3 28.6-78.2 19.6-21.6 45.5-32.5 76.9-32.5z m917.1 80v128H384V448h640zM146.6 0v288H75.1V94.2c-16.7 10.2-35.9 18.3-50.9 20.3l-8.2 1.6V46l4.8-2C39.3 37.3 52.5 31.7 60 27.6 71 20.9 82.1 11.7 96.3 0.1h50.3zM1024 64v128H384V64h640z" fill="#333333" p-id="80295"></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="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>',Zt='<?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>',Xt='<?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>',Qt='<?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>',eo='<?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>',to=["innerHTML"],q=K(e.defineComponent({__name:"SvgIcon",props:{name:{},color:{},size:{}},setup(t){const c=t,r=e.useAttrs(),n=Object.assign({"/src/svg/alignCenter.svg":Ft,"/src/svg/alignJustify.svg":At,"/src/svg/alignLeft.svg":Ht,"/src/svg/alignRight.svg":Ut,"/src/svg/bulletList.svg":jt,"/src/svg/caretDown.svg":It,"/src/svg/clearFormat.svg":Ot,"/src/svg/code.svg":Wt,"/src/svg/codeBlock.svg":Rt,"/src/svg/formatBrush.svg":Pt,"/src/svg/highBg.svg":Gt,"/src/svg/img.svg":qt,"/src/svg/link.svg":Yt,"/src/svg/orderedList.svg":Kt,"/src/svg/quote.svg":Jt,"/src/svg/table.svg":Zt,"/src/svg/tableTools.svg":Xt,"/src/svg/task.svg":Qt,"/src/svg/video.svg":eo}),a=(()=>{const u={};return Object.entries(n).forEach(([E,C])=>{const i=(E.split("/src/svg/")[1]||E).replace(/\.svg$/i,"");u[i]=C;const p=i.split("/").pop();p&&(u[p]=C)}),u})(),l=e.computed(()=>{const u=c.name.replace(/\.svg$/i,"");return a[u]||""});function B(u){if(!u)return"";let E=u.replace(/<\?xml[\s\S]*?\?>/gi,"").replace(/<!DOCTYPE[\s\S]*?>/gi,"");return E=E.replace(/<svg([^>]*)>/i,(C,y)=>`<svg${y.replace(/\s(width|height)="[^"]*"/gi,"").replace(/\s(fill|stroke)="[^"]*"/gi,"")} width="1em" height="1em" preserveAspectRatio="xMidYMid meet">`),E=E.replace(/fill="(?!none)[^"]*"/gi,'fill="currentColor"'),E=E.replace(/stroke="(?!none)[^"]*"/gi,'stroke="currentColor"'),E}const s=e.computed(()=>B(l.value));function x(u){if(u!=null)return typeof u=="number"?`${u}px`:u}const N=e.computed(()=>{const u={},E=x(c.size);E&&(u.fontSize=E),c.color&&(u.color=c.color);const C=r.style??void 0;return[u,C].filter(Boolean)});return(u,E)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(["svg-icon",e.unref(r).class]),style:e.normalizeStyle(N.value),innerHTML:s.value},null,14,to))}}),[["__scopeId","data-v-c83ef2e3"]]),oo=["aria-expanded"],no={key:0,class:"dropdown"},ro={class:"section"},io={class:"swatches"},lo={class:"section"},so={class:"swatches"},ao=["onClick"],co={key:0,class:"check"},fo={class:"section"},po={class:"swatches grid"},mo=["onClick"],uo={key:0,class:"section"},ho={class:"swatches"},go=["onClick"],ko={class:"section inline-actions"},wo={key:1,class:"advanced"},xe="md-toolbar-dropdown-open",ze="bg-color-select",Co=K(e.defineComponent({__name:"index",props:{editor:{},currentBg:{}},setup(t){const c=t,r=["#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"],n=e.ref(!1),a=e.ref(!1),l=e.ref(null),B=e.ref(c.currentBg||"#ffffff"),s=e.ref(f()),x=e.ref("#FADB14");function N(){n.value||window.dispatchEvent(new CustomEvent(xe,{detail:{id:ze}})),n.value=!n.value}function u(){n.value=!1}function E(){a.value=!a.value}function C(w){var h;(h=c.editor)==null||h.chain().focus().setMark("textStyle",{backgroundColor:w}).run(),x.value=w,g(w),u()}function y(){var w;(w=c.editor)==null||w.chain().focus().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run(),u()}function i(w){const h=w.target,k=l.value;k&&!k.contains(h)&&u()}function p(){}function f(){try{const w=localStorage.getItem("md_bg_recent");if(!w)return[];const h=JSON.parse(w);return Array.isArray(h)?h.slice(0,12):[]}catch{return[]}}function g(w){const h=[w,...s.value.filter(k=>k!==w)];s.value=h.slice(0,12);try{localStorage.setItem("md_bg_recent",JSON.stringify(s.value))}catch{}}let m=[];function v(){const w=c.editor;w&&(m=[{event:"selectionUpdate",handler:p},{event:"transaction",handler:p},{event:"update",handler:p}],m.forEach(({event:h,handler:k})=>{w.on(h,k)}))}e.onMounted(()=>{document.addEventListener("click",i),window.addEventListener(xe,$),v()}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i),window.removeEventListener(xe,$);const w=c.editor;w&&m.forEach(({event:h,handler:k})=>{w.off(h,k)}),m=[]}),e.watch(()=>c.editor,(w,h)=>{h&&m.forEach(({event:k,handler:D})=>{h.off(k,D)}),m=[],v()});function $(w){var k;((k=w.detail)==null?void 0:k.id)!==ze&&(n.value=!1)}return(w,h)=>(e.openBlock(),e.createElementBlock("div",{class:"bg-color-select",ref_key:"rootRef",ref:l},[e.createElementVNode("div",{class:"icon icon-dropdown","aria-expanded":n.value},[e.createVNode(e.unref(U),{text:"背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon-stack hoverable",onClick:h[0]||(h[0]=e.withModifiers(k=>C(x.value),["stop"]))},[e.createVNode(q,{name:"highBg",size:18}),e.createElementVNode("div",{class:"underline",style:e.normalizeStyle({background:x.value})},null,4)])]),_:1}),e.createVNode(e.unref(U),{text:"更多背景色",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"arrow hoverable",onClick:e.withModifiers(N,["stop"])},[e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3,size:"12"})])]),_:1})],8,oo),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,[h[4]||(h[4]=e.createElementVNode("div",{class:"section-title"},"无填充色",-1)),e.createElementVNode("div",io,[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(x,["stop"])})])]),e.createElementVNode("div",io,[h[5]||(h[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",lo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},[k===b.value?(e.openBlock(),e.createElementBlock("span",ao,"✓")):e.createCommentVNode("",!0)],12,so))),128))])]),e.createElementVNode("div",co,[h[6]||(h[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",fo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},[k===b.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,po))),128))])]),l.value.length?(e.openBlock(),e.createElementBlock("div",mo,[h[7]||(h[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",uo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(L=>y(k),["stop"])},null,12,ho))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",go,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(x,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(_,["stop"])},"更多颜色")]),s.value?(e.openBlock(),e.createElementBlock("div",ko,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":h[1]||(h[1]=k=>v.value=k)},null,512),[[e.vModelText,v.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":h[2]||(h[2]=k=>v.value=k)},null,512),[[e.vModelText,v.value]]),e.createElementVNode("button",{class:"btn apply",onClick:h[3]||(h[3]=e.withModifiers(k=>y(v.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-620c7aa3"]]),Co={class:"image-actions"},yo=["aria-disabled","disabled"],xo=Y(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const a=t,i=e.ref(!1),o=e.ref(""),s=e.ref(!1),c=e.ref(null),v=()=>{i.value=!i.value},l=()=>{var d,p,f,g,u,E;const x=o.value.trim();x&&((E=(u=((g=(p=(d=a.editor)==null?void 0:d.chain)==null?void 0:(f=p.call(d)).focus)==null?void 0:g.call(f)).setImage({src:x})).run)==null||E.call(u),i.value=!1,o.value="")},b=x=>{x.key==="Enter"&&l(),x.key==="Escape"&&(i.value=!1,o.value="")},N=()=>{var x;a.imageUploader&&((x=c.value)==null||x.click())},m=async x=>{var g,u,E,T,C,h,k,L;const d=x.target,p=(g=d.files)==null?void 0:g[0];if(d.value="",!p||!a.imageUploader)return;const f=(u=a.uploadSizeLimit)==null?void 0:u.image;if(typeof f=="number"&&f>0){const U=Math.max(1,f)*1024*1024;if(p.size>U){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${f}MB)`)}catch{}return}}try{s.value=!0;let U=null;U=URL.createObjectURL(p),(L=(k=((h=(T=(E=a.editor)==null?void 0:E.chain)==null?void 0:(C=T.call(E)).focus)==null?void 0:h.call(C)).setImage({src:U,uploading:!0})).run)==null||L.call(k);const M=await a.imageUploader(p);if(typeof M=="string"&&M){const D=a.editor,{state:j}=D,{doc:O}=j;let W=null;if(O.descendants((P,X)=>{var K,Q;return((K=P==null?void 0:P.type)==null?void 0:K.name)==="image"&&((Q=P==null?void 0:P.attrs)==null?void 0:Q.src)===U?(W=X,!1):!0}),W!=null){const P=O.nodeAt(W),X=j.schema.nodes.image;if(P&&X){const K={...P.attrs||{},src:M,uploading:null},Q=j.tr.setNodeMarkup(W,X,K,P.marks);D.view.dispatch(Q)}}i.value=!1,o.value=""}}finally{s.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},_=e.ref(null);let y=null;return e.onMounted(()=>{y=x=>{if(!i.value)return;const d=_.value,p=x.target;d&&p&&!d.contains(p)&&(i.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(x,d)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:v,ref_key:"rootRef",ref:_},[e.createVNode(e.unref(A),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"img",size:18})]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":d[0]||(d[0]=p=>o.value=p),onKeydown:b},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:c,type:"file",accept:"image/*",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",Co,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(l,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!a.imageUploader||s.value,disabled:!a.imageUploader||s.value,onClick:e.withModifiers(N,["stop"])},e.toDisplayString(s.value?"上传中…":"上传文件"),9,yo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-e1c5f3df"]]),bo={class:"video-actions"},Vo=["aria-disabled","disabled"],_o=Y(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const a=t,i=e.ref(!1),o=e.ref(""),s=e.ref(!1),c=e.ref(null),v=()=>{i.value=!i.value},l=()=>{const d=o.value.trim();if(!d)return;const p=a.editor,f=p==null?void 0:p.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(d)){const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{p.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{p.chain().focus().insertContent(u).run()}}else if(typeof(f==null?void 0:f.setVideo)=="function")p.chain().focus().setVideo({src:d,HTMLAttributes:{controls:!0,width:640}}).run();else{const u=String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{p.chain().focus().insertContent(`<p><a href="${u}" target="_blank" rel="noopener noreferrer">${u}</a></p>`).run()}catch{p.chain().focus().insertContent(u).run()}}i.value=!1,o.value=""},b=d=>{d.key==="Enter"&&l(),d.key==="Escape"&&(i.value=!1,o.value="")},N=()=>{var d;a.videoUploader&&((d=c.value)==null||d.click())},m=async d=>{var E,T;const p=d.target,f=(E=p.files)==null?void 0:E[0];if(p.value="",!f||!a.videoUploader)return;const g=(T=a.uploadSizeLimit)==null?void 0:T.video;if(typeof g=="number"&&g>0){const C=Math.max(1,g)*1024*1024;if(f.size>C){try{window.alert(`视频文件大小超限(${(f.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}let u=null;try{s.value=!0;const C=a.editor,h=C==null?void 0:C.commands;u=URL.createObjectURL(f);try{if(typeof(h==null?void 0:h.setVideo)=="function")C.chain().focus().setVideo({src:u,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const L=String(u).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{C.chain().focus().insertContent(`<p><a href="${L}" target="_blank" rel="noopener noreferrer">${L}</a></p>`).run()}catch{C.chain().focus().insertContent(L).run()}}}catch{}const k=await a.videoUploader(f);u&&_(u,k),i.value=!1,o.value=""}finally{s.value=!1;try{u&&URL.revokeObjectURL(u)}catch{}}};function _(d,p){const f=a.editor;if(!f)return;const{state:g}=f,{doc:u}=g;let E=null;if(u.descendants((T,C)=>{var h,k;return((h=T.type)==null?void 0:h.name)==="video"&&((k=T.attrs)==null?void 0:k.src)===d?(E=C,!1):!0}),E!=null){const T=u.nodeAt(E),C=g.schema.nodes.video;if(!T||!C)return;const h={...T.attrs||{},src:p,uploading:null},k=g.tr.setNodeMarkup(E,C,h,T.marks);f.view.dispatch(k)}}const y=e.ref(null);let x=null;return e.onMounted(()=>{x=d=>{if(!i.value)return;const p=y.value,f=d.target;p&&f&&!p.contains(f)&&(i.value=!1)},document.addEventListener("mousedown",x,!0)}),e.onBeforeUnmount(()=>{x&&(document.removeEventListener("mousedown",x,!0),x=null)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:v,ref_key:"rootRef",ref:y},[e.createVNode(e.unref(A),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"video",size:16})]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":p[0]||(p[0]=f=>o.value=f),onKeydown:b},null,544),[[e.vModelText,o.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:c,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:m},null,544),e.createElementVNode("div",bo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(l,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!a.videoUploader||s.value,disabled:!a.videoUploader||s.value,onClick:e.withModifiers(N,["stop"])},e.toDisplayString(s.value?"上传中…":"上传文件"),9,Vo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-35a7027c"]]),No={class:"fr-header"},Eo={key:0,class:"fr-body"},vo={class:"fr-input-row"},Mo=["value"],Bo={key:0,class:"fr-count"},Lo={class:"fr-actions"},zo={key:1,class:"fr-body"},So={class:"fr-input-row"},$o=["value"],To={key:0,class:"fr-count"},Do={class:"fr-actions"},Fo=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:a}){const i=t,o=e.ref(!1),s=e.ref("find"),c=e.ref(""),v=e.ref(""),l=e.ref([]),b=e.ref(0),N=e.computed(()=>{const M=l.value.length;return!c.value||!M?"0/0":`${Math.min(Math.max(b.value+1,1),M)}/${M}`}),m=typeof navigator<"u"&&navigator.platform.includes("Mac"),_=e.computed(()=>m?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),y=()=>o.value=!o.value,x=()=>o.value=!1;function d(){var M;return((M=i.editor)==null?void 0:M.view)||null}function p(){const M=d(),D=c.value;if(l.value=[],b.value=0,!M||!D)return;const j=M.dom,O=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let W;for(;W=O.nextNode();){const P=W,X=P.data||"";let K=0;for(;;){const Q=X.indexOf(D,K);if(Q===-1)break;const ne=M.posAtDOM(P,Q),se=M.posAtDOM(P,Q+D.length);typeof ne=="number"&&typeof se=="number"&&l.value.push({from:ne,to:se}),K=Q+D.length}}e.nextTick(()=>{l.value.length&&f(0)})}function f(M){const D=i.editor,j=d();if(!D||!j||!l.value.length)return;const O=l.value.length;b.value=(M%O+O)%O;const W=l.value[b.value];D.chain().focus().setTextSelection({from:W.from,to:W.to}).run()}const g=()=>l.value.length&&f(b.value+1),u=()=>l.value.length&&f(b.value-1);function E(){const M=i.editor;if(!M||!l.value.length)return;const D=l.value[b.value],j=M.state.tr.insertText(v.value,D.from,D.to);M.view.dispatch(j),p()}function T(){const M=i.editor;if(!M||!l.value.length)return;const D=[...l.value],j=M.state.tr;for(let O=D.length-1;O>=0;O--){const W=D[O];j.insertText(v.value,W.from,W.to)}M.view.dispatch(j),p()}function C(M){c.value=M.target.value,p()}function h(M){M.key==="Enter"&&g(),M.key==="Escape"&&x()}const k=e.ref(null);let L=null;e.onMounted(()=>{L=M=>{if(!o.value)return;const D=k.value,j=M.target;D&&j&&!D.contains(j)&&x()},document.addEventListener("mousedown",L,!0)}),e.onBeforeUnmount(()=>{L&&(document.removeEventListener("mousedown",L,!0),L=null)});function U(M){M&&(s.value=M),o.value=!0,e.nextTick(p)}return a({openPanel:U}),(M,D)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:k,onClick:y},[e.createVNode(e.unref(A),{text:"查找替换",shortcut:_.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:D[3]||(D[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",No,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:s.value==="find"}]),onClick:D[0]||(D[0]=e.withModifiers(j=>s.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:s.value==="replace"}]),onClick:D[1]||(D[1]=e.withModifiers(j=>s.value="replace",["stop"]))}," 替换 ",2)]),s.value==="find"?(e.openBlock(),e.createElementBlock("div",Eo,[D[4]||(D[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",vo,[e.createElementVNode("input",{class:"fr-input",value:c.value,placeholder:"输入关键字",onInput:C,onKeydown:h},null,40,Mo),c.value?(e.openBlock(),e.createElementBlock("span",Bo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lo,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",zo,[D[5]||(D[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",So,[e.createElementVNode("input",{class:"fr-input",value:c.value,placeholder:"输入关键字",onInput:C},null,40,$o),c.value?(e.openBlock(),e.createElementBlock("span",To,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),D[6]||(D[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":D[2]||(D[2]=j=>v.value=j),placeholder:"请输入"},null,512),[[e.vModelText,v.value]]),e.createElementVNode("div",Do,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(T,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(E,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(u,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-750ee9bb"]]),Ao={class:"field"},Ho={class:"field"},Uo={class:"actions"},jo=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=e.ref(!1),o=e.ref(""),s=e.ref("");e.ref(!1);const c=e.ref(null);function v(){const d=a.editor;if(!i.value&&d)try{const p=d.state.selection,f=p.from;p.to>f?b():(o.value="链接",d.chain().focus().insertContent("链接").setTextSelection({from:f,to:f+2}).run())}catch{}i.value=!i.value,i.value&&l()}function l(){setTimeout(()=>{var p;const d=(p=c.value)==null?void 0:p.querySelector('input[name="link-text"]');d==null||d.focus(),d==null||d.select()},0)}function b(){const d=a.editor;if(d)try{const p=d.state.selection,f=p.from,g=p.to,E=g>f?d.state.doc.textBetween(f,g):"";o.value=E||"";const T=d.getAttributes("link")||{};s.value=typeof T.href=="string"?T.href:""}catch{}}function N(){const d=a.editor;if(!d)return;const p=o.value.trim(),f=s.value.trim();if(f)try{const g=d.state.selection,u=g.from,E=g.to;if(E>u){const C=m(p||d.state.doc.textBetween(u,E)),h=m(f);d.chain().focus().insertContent(`<a href="${h}" target="_blank" rel="noopener noreferrer">${C}</a>`,{from:u,to:E}).run()}else{const C=m(f),h=m(p||f);d.chain().focus().insertContent(`<a href="${C}" target="_blank" rel="noopener noreferrer">${h}</a>`).run()}}finally{i.value=!1,o.value="",s.value=""}}function m(d){return String(d).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _(d){d.key==="Enter"&&N(),d.key==="Escape"&&(i.value=!1)}let y=null;e.onMounted(()=>{y=d=>{if(!i.value)return;const p=c.value,f=d.target;p&&f&&!p.contains(f)&&(i.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)});const x=e.ref({});return e.watch(i,async d=>{var f;if(!d)return;const p=a.editor;if(p){await e.nextTick();try{const g=p.state.selection,u=g.from,E=g.to;if(!(E>u)){x.value={};return}const C=p.view.coordsAtPos(u),h=p.view.coordsAtPos(E),k=(C.left+h.right)/2,L=Math.max(C.bottom,h.bottom)+8,U=(f=c.value)==null?void 0:f.querySelector(".link-input-panel"),M=U?U.getBoundingClientRect():{width:320,height:120},D=window.innerWidth,j=window.innerHeight,O=12,W=Math.max(O+M.width/2,Math.min(D-O-M.width/2,k)),P=L,X=Math.min(C.top,h.top)-M.height-8;let K=P;P+M.height+O>j&&X-O>=0&&(K=X),K=Math.max(O,Math.min(j-O-M.height,K)),x.value={position:"fixed",left:Math.round(W)+"px",top:Math.round(K)+"px"}}catch{}}}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:v,ref_key:"rootRef",ref:c},[e.createVNode(e.unref(A),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"link",size:16})]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(x.value),onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ao,[p[3]||(p[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":p[0]||(p[0]=f=>o.value=f),onKeydown:_},null,544),[[e.vModelText,o.value]])]),e.createElementVNode("div",Ho,[p[4]||(p[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":p[1]||(p[1]=f=>s.value=f),placeholder:"链接地址",onKeydown:_},null,544),[[e.vModelText,s.value]])]),e.createElementVNode("div",Uo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(N,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-47847dc2"]]),Io={class:"grid"},Oo=["onMouseenter"],Wo={class:"size"},Ro=10,Po=10,Go=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=e.ref(!1),o=e.ref(0),s=e.ref(0),c=e.computed(()=>{const N=Math.max(o.value,1),m=Math.max(s.value,1);return`${N} x ${m}`}),v=()=>{i.value=!i.value,i.value||(o.value=0,s.value=0)},l=(N,m)=>{o.value=N,s.value=m},b=()=>{var _,y,x,d,p,f,g,u;const N=Math.max(o.value,1),m=Math.max(s.value,1);(u=(f=(d=(y=(_=a.editor)==null?void 0:_.chain)==null?void 0:(x=y.call(_)).focus)==null?void 0:(p=d.call(x)).insertTable)==null?void 0:(g=f.call(p,{rows:N,cols:m,withHeaderRow:!0})).run)==null||u.call(g),i.value=!1,o.value=0,s.value=0};return(N,m)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:v},[e.createVNode(e.unref(A),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"table",size:16})]),_:1}),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"table-panel",onClick:m[0]||(m[0]=e.withModifiers(()=>{},["stop"]))},[m[1]||(m[1]=e.createElementVNode("div",{class:"panel-title"},"表格",-1)),e.createElementVNode("div",Io,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Ro,_=>e.createElementVNode("div",{key:"r-"+_,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Po,y=>e.createElementVNode("span",{key:"c-"+_+"-"+y,class:e.normalizeClass(["cell",{active:_<=o.value&&y<=s.value}]),onMouseenter:x=>l(_,y),onClick:e.withModifiers(b,["stop"])},null,42,Oo)),64))])),64))]),e.createElementVNode("div",Wo,e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8a3a35f7"]]),qo=["aria-disabled"],Yo={class:"tools-grid"},Ko=["disabled"],Jo=["disabled"],Zo=["disabled"],Xo=["disabled"],Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=e.ref(!1),o=()=>i.value=!i.value,s=(v,...l)=>{var N,m,_;const b=a.editor;return!!((_=(N=b==null?void 0:b.can)==null?void 0:(m=N.call(b))[v])!=null&&_.call(m,...l))},c=(v,...l)=>{var N,m,_,y,x,d,p;const b=a.editor;(p=(d=(x=(y=(_=(N=b==null?void 0:b.chain)==null?void 0:(m=N.call(b)).focus)==null?void 0:_.call(m))[v])==null?void 0:x.call(y,...l))==null?void 0:d.run)==null||p.call(d),i.value=!1};return(v,l)=>{var b,N;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:o,"aria-disabled":!((N=(b=a.editor)==null?void 0:b.isActive)!=null&&N.call(b,"table"))},[e.createVNode(e.unref(A),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"tableTools",size:15})]),_:1}),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:l[17]||(l[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Yo,[e.createElementVNode("button",{class:"btn",onClick:l[0]||(l[0]=e.withModifiers(m=>c("addColumnBefore"),["stop"])),disabled:!s("addColumnBefore")}," 前插列 ",8,Ko),e.createElementVNode("button",{class:"btn",onClick:l[1]||(l[1]=e.withModifiers(m=>c("addColumnAfter"),["stop"])),disabled:!s("addColumnAfter")}," 后插列 ",8,Jo),e.createElementVNode("button",{class:"btn",onClick:l[2]||(l[2]=e.withModifiers(m=>c("deleteColumn"),["stop"])),disabled:!s("deleteColumn")}," 删除列 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:l[3]||(l[3]=e.withModifiers(m=>c("addRowBefore"),["stop"])),disabled:!s("addRowBefore")}," 前插行 ",8,Xo),e.createElementVNode("button",{class:"btn",onClick:l[4]||(l[4]=e.withModifiers(m=>c("addRowAfter"),["stop"])),disabled:!s("addRowAfter")}," 后插行 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:l[5]||(l[5]=e.withModifiers(m=>c("deleteRow"),["stop"])),disabled:!s("deleteRow")}," 删除行 ",8,en),e.createElementVNode("button",{class:"btn",onClick:l[6]||(l[6]=e.withModifiers(m=>c("deleteTable"),["stop"])),disabled:!s("deleteTable")}," 删除表 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:l[7]||(l[7]=e.withModifiers(m=>c("mergeCells"),["stop"])),disabled:!s("mergeCells")}," 合并单元格 ",8,on),e.createElementVNode("button",{class:"btn",onClick:l[8]||(l[8]=e.withModifiers(m=>c("splitCell"),["stop"])),disabled:!s("splitCell")}," 拆分单元格 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:l[9]||(l[9]=e.withModifiers(m=>c("mergeOrSplit"),["stop"])),disabled:!s("mergeOrSplit")}," 合并/拆分 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:l[10]||(l[10]=e.withModifiers(m=>c("toggleHeaderRow"),["stop"])),disabled:!s("toggleHeaderRow")}," 切换表头行 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:l[11]||(l[11]=e.withModifiers(m=>c("toggleHeaderColumn"),["stop"])),disabled:!s("toggleHeaderColumn")}," 切换表头列 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:l[12]||(l[12]=e.withModifiers(m=>c("toggleHeaderCell"),["stop"])),disabled:!s("toggleHeaderCell")}," 切换表头单元 ",8,an),e.createElementVNode("button",{class:"btn",onClick:l[13]||(l[13]=e.withModifiers(m=>c("fixTables"),["stop"])),disabled:!s("fixTables")}," 修复表格 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:l[14]||(l[14]=e.withModifiers(m=>c("goToNextCell"),["stop"])),disabled:!s("goToNextCell")}," 下个单元格 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:l[15]||(l[15]=e.withModifiers(m=>c("goToPreviousCell"),["stop"])),disabled:!s("goToPreviousCell")}," 上个单元格 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:l[16]||(l[16]=e.withModifiers(m=>c("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!s("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,pn)])])):e.createCommentVNode("",!0)],8,qo)}}}),[["__scopeId","data-v-bbf06816"]]),un=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,o=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function s(){const c=a.editor;if(c){c.chain().focus().toggleTaskList().run();try{const{state:v}=c,l=v.selection;let b=null;v.doc.nodesBetween(Math.max(0,l.from-5),Math.min(v.doc.content.size,l.to+5),(N,m)=>{var _;return((_=N==null?void 0:N.type)==null?void 0:_.name)==="taskItem"&&b==null?(b=m,!1):!0}),b!=null&&c.commands.setTextSelection(b+1)}catch{}}}return(c,v)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:s},[e.createVNode(e.unref(A),{text:"任务列表",shortcut:e.unref(o),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"task",size:17})]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-693f2c14"]]),hn=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t;function i(){const o=a.editor;o&&o.chain().focus().toggleBlockquote().run()}return(o,s)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:i},[e.createVNode(e.unref(A),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"quote",size:18})]),_:1})]))}}),[["__scopeId","data-v-587fb9a8"]]),gn=["aria-expanded"],kn={class:"label"},wn={key:0,class:"dropdown",role:"listbox"},Cn=["aria-selected","onClick"],yn={class:"shortcut"},be="md-toolbar-dropdown-open",ze="heading-select",xn=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=typeof navigator<"u"&&navigator.platform.includes("Mac"),o={0:i?"⌥ ⌘ 0":"Ctrl Alt 0",1:i?"⌥ ⌘ 1":"Ctrl Alt 1",2:i?"⌥ ⌘ 2":"Ctrl Alt 2",3:i?"⌥ ⌘ 3":"Ctrl Alt 3",4:i?"⌥ ⌘ 4":"Ctrl Alt 4",5:i?"⌥ ⌘ 5":"Ctrl Alt 5",6:i?"⌥ ⌘ 6":"Ctrl Alt 6"},s=[{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]}],c=e.computed(()=>{var p,f;const d=a.editor;if(!d)return null;for(let g=1;g<=6;g++)if((p=d.isActive)!=null&&p.call(d,"heading",{level:g}))return g;return(f=d.isActive)!=null&&f.call(d,"paragraph"),null}),v=e.computed(()=>{const d=c.value;return d?`标题${d}`:"正文"}),l=e.ref(!1),b=e.ref(null);function N(){l.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:ze}})),l.value=!l.value}function m(){l.value=!1}function _(d){var f,g,u,E,T,C,h,k,L,U;const p=(E=(g=(f=a.editor)==null?void 0:f.chain)==null?void 0:(u=g.call(f)).focus)==null?void 0:E.call(u);p&&(d.level===null?(h=(T=p.setParagraph)==null?void 0:(C=T.call(p)).run)==null||h.call(C):(U=(L=(k=p.toggleHeading)==null?void 0:k.call(p,{level:d.level}))==null?void 0:L.run)==null||U.call(L),m())}function y(d){const p=d.target,f=b.value;f&&!f.contains(p)&&m()}function x(d){var f;((f=d.detail)==null?void 0:f.id)!==ze&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",y),window.addEventListener(be,x)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",y),window.removeEventListener(be,x)}),(d,p)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:b},[e.createVNode(e.unref(A),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":l.value},[e.createElementVNode("div",kn,e.toDisplayString(v.value),1),e.createVNode(e.unref(me),{theme:"filled",strokeWidth:3})],8,gn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",wn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,f=>e.createElementVNode("div",{key:f.label,class:"dropdown-item","aria-selected":f.level===c.value,onClick:e.withModifiers(g=>_(f),["stop"])},[f.level===c.value?(e.openBlock(),e.createBlock(e.unref(ae),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:f.level===null,"level-1":f.level===1,"level-2":f.level===2,"level-3":f.level===3,"level-4":f.level===4,"level-5":f.level===5,"level-6":f.level===6}])},e.toDisplayString(f.label),3),e.createElementVNode("span",yn,e.toDisplayString(f.shortcut),1)],8,Cn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-aeb74f7c"]]),bn=["aria-expanded"],Vn={key:0,class:"dropdown",role:"menu"},_n={class:"options"},Ve="md-toolbar-dropdown-open",Se="align-select",Nn=Y(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const a=t,i=e.computed(()=>{var u,E,T,C;const g=a.editor;return!g||(u=g.isActive)!=null&&u.call(g,{textAlign:"left"})?"left":(E=g.isActive)!=null&&E.call(g,{textAlign:"center"})?"center":(T=g.isActive)!=null&&T.call(g,{textAlign:"right"})?"right":(C=g.isActive)!=null&&C.call(g,{textAlign:"justify"})?"justify":"left"}),o=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[i.value]);function s(g){var u,E,T,C,h,k,L,U;(U=(k=(C=(E=(u=a.editor)==null?void 0:u.chain)==null?void 0:(T=E.call(u)).focus)==null?void 0:(h=C.call(T)).setTextAlign)==null?void 0:(L=k.call(h,g)).run)==null||U.call(L)}const c=e.ref(!1),v=e.ref(null),l=typeof navigator<"u"&&navigator.platform.includes("Mac"),b=l?"⇧ ⌘ L":"Ctrl Shift L",N=l?"⇧ ⌘ E":"Ctrl Shift E",m=l?"⇧ ⌘ R":"Ctrl Shift R",_=l?"⇧ ⌘ J":"Ctrl Shift J";function y(){c.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:Se}})),c.value=!c.value}function x(){c.value=!1}function d(g){s(g),x()}function p(g){const u=v.value,E=g.target;u&&!u.contains(E)&&x()}function f(g){var E;((E=g.detail)==null?void 0:E.id)!==Se&&(c.value=!1)}return e.onMounted(()=>{document.addEventListener("click",p),window.addEventListener(Ve,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",p),window.removeEventListener(Ve,f)}),(g,u)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:v},[e.createVNode(e.unref(A),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(y,["stop"]),"aria-expanded":c.value},[e.createVNode(G,{name:o.value,size:18},null,8,["name"]),e.createVNode(G,{name:"caretDown",size:12})],8,bn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Vn,[e.createElementVNode("div",_n,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:i.value==="left"}]),role:"menuitem",onClick:u[0]||(u[0]=e.withModifiers(E=>d("left"),["stop"]))},[e.createVNode(e.unref(A),{text:"左对齐",shortcut:e.unref(b),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"alignLeft",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:i.value==="center"}]),role:"menuitem",onClick:u[1]||(u[1]=e.withModifiers(E=>d("center"),["stop"]))},[e.createVNode(e.unref(A),{text:"居中对齐",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"alignCenter",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:i.value==="right"}]),role:"menuitem",onClick:u[2]||(u[2]=e.withModifiers(E=>d("right"),["stop"]))},[e.createVNode(e.unref(A),{text:"右对齐",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"alignRight",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:i.value==="justify"}]),role:"menuitem",onClick:u[3]||(u[3]=e.withModifiers(E=>d("justify"),["stop"]))},[e.createVNode(e.unref(A),{text:"两端对齐",shortcut:e.unref(_),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"alignJustify",size:16})]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f2f793f3"]]),En=["aria-disabled"],vn=["aria-disabled"],Mn=Y(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:a}){const i=t,o=a,s=(V,n)=>{var r,w;return(w=(r=i.editor)==null?void 0:r.isActive)==null?void 0:w.call(r,V,n)},c=(V,n)=>{var B,z,S,$,F,H;const r=i.editor;if(!r)return;const w=(S=(B=r.chain)==null?void 0:(z=B.call(r)).focus)==null?void 0:S.call(z);return(H=(F=($=w==null?void 0:w[V])==null?void 0:$.call(w))==null?void 0:F.run)==null?void 0:H.call(F)},v=()=>{var V,n,r,w;try{return!!((w=(n=(V=i.editor)==null?void 0:V.can)==null?void 0:(r=n.call(V)).undo)!=null&&w.call(r))}catch{return!1}},l=()=>{var V,n,r,w;try{return!!((w=(n=(V=i.editor)==null?void 0:V.can)==null?void 0:(r=n.call(V)).redo)!=null&&w.call(r))}catch{return!1}},b=()=>{var V,n,r;v()&&((r=(n=(V=i.editor)==null?void 0:V.commands)==null?void 0:n.undo)==null||r.call(n))},N=()=>{var V,n,r;return(r=(n=(V=i.editor)==null?void 0:V.commands)==null?void 0:n.redo)==null?void 0:r.call(n)},m=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",_=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",y=typeof navigator<"u"&&navigator.platform.includes("Mac"),x=y?"⌘ B":"Ctrl B",d=y?"⌘ I":"Ctrl I",p=y?"⌘ U":"Ctrl U",f=y?"⇧ ⌘ X":"Ctrl Shift X",g=y?"⌘ \\":"Ctrl \\",u=y?"⇧ ⌘ S":"Ctrl Shift S",E=y?"⇧ ⌘ 8":"Ctrl Shift 8",T=y?"⇧ ⌘ 7":"Ctrl Shift 7",C=y?"⇧ ⌘ C":"Ctrl Shift C",h=e.ref(null),k=()=>{var n,r,w,B,z,S,$;const V=i.editor;V&&(($=(S=(z=(B=(w=(r=(n=V.chain())==null?void 0:n.focus())==null?void 0:r.unsetAllMarks)==null?void 0:w.call(r))==null?void 0:B.removeEmptyTextStyle)==null?void 0:z.call(B))==null?void 0:S.run)==null||$.call(S))},L=e.ref(!1),U=e.ref(!1),M=e.ref({}),D=e.ref(null),j=()=>{var r,w,B,z,S,$;const V=i.editor;if(!V)return;const n=((r=V.getAttributes)==null?void 0:r.call(V,"textStyle"))||{};M.value={bold:!!((w=V.isActive)!=null&&w.call(V,"bold")),italic:!!((B=V.isActive)!=null&&B.call(V,"italic")),strike:!!((z=V.isActive)!=null&&z.call(V,"strike")),underline:!!((S=V.isActive)!=null&&S.call(V,"underline")),code:!!(($=V.isActive)!=null&&$.call(V,"code")),textStyle:{...n!=null&&n.color?{color:n.color}:{},...n!=null&&n.backgroundColor?{backgroundColor:n.backgroundColor}:{},...n!=null&&n.fontSize?{fontSize:n.fontSize}:{}}}},O=()=>{var z,S,$,F,H,I,Z,te,ie,de,q,J;const V=i.editor;if(!V)return;const n=M.value;let r=($=(z=V.chain)==null?void 0:(S=z.call(V)).focus)==null?void 0:$.call(S);const w=n.textStyle||{},B=(F=V.state)==null?void 0:F.selection;B&&B.from===B.to||(r=((H=r==null?void 0:r.unsetAllMarks)==null?void 0:H.call(r))||r,Object.keys(w).length&&(r=((I=r==null?void 0:r.setMark)==null?void 0:I.call(r,"textStyle",w))||r),n.bold&&(r=((Z=r==null?void 0:r.toggleBold)==null?void 0:Z.call(r))||r),n.italic&&(r=((te=r==null?void 0:r.toggleItalic)==null?void 0:te.call(r))||r),n.strike&&(r=((ie=r==null?void 0:r.toggleStrike)==null?void 0:ie.call(r))||r),n.underline&&(r=((de=r==null?void 0:r.toggleUnderline)==null?void 0:de.call(r))||r),n.code&&(r=((q=r==null?void 0:r.toggleCode)==null?void 0:q.call(r))||r),(J=r==null?void 0:r.run)==null||J.call(r))},W=V=>{var w;const n=i.editor;if(!n)return;j(),L.value=!0,U.value=!!V;const r=(w=n.state)==null?void 0:w.selection;D.value=r?{from:r.from,to:r.to}:null},P=()=>{L.value=!1,U.value=!1},X=()=>{re()},K=V=>{i.disabled||!((V.metaKey||V.ctrlKey)&&V.shiftKey&&(V.key==="s"||V.key==="S"))||!i.editor||(V.preventDefault(),W(!1))},Q=V=>{var $,F,H,I;if(i.disabled)return;const n=V.metaKey||V.ctrlKey,r=V.key==="c"||V.key==="C";if(n&&V.shiftKey&&r){V.preventDefault(),c("toggleCodeBlock");return}const w=V.key==="f"||V.key==="F";if(n&&w){V.preventDefault();try{(F=($=h.value)==null?void 0:$.openPanel)==null||F.call($,"find")}catch{}return}const B=V.key==="h"||V.key==="H",z=V.metaKey&&V.altKey&&w,S=V.ctrlKey&&B;if(z||S){V.preventDefault();try{(I=(H=h.value)==null?void 0:H.openPanel)==null||I.call(H,"replace")}catch{}return}};let ne=!1;const se=()=>{var n;const V=i.editor;!V||ne||(ne=!0,(n=V.on)==null||n.call(V,"selectionUpdate",X),window.addEventListener("keydown",K),window.addEventListener("keydown",Q),window.addEventListener("mouseup",ue,!0))},ce=()=>{var n;const V=i.editor;V&&((n=V.off)==null||n.call(V,"selectionUpdate",X),window.removeEventListener("keydown",K),window.removeEventListener("keydown",Q),window.removeEventListener("mouseup",ue,!0),ne=!1)};e.onMounted(()=>{se()}),e.onBeforeUnmount(()=>{ce()}),e.watch(()=>i.editor,(V,n)=>{var r;n&&((r=n.off)==null||r.call(n,"selectionUpdate",X)),ne=!1,se()});const re=()=>{try{L.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(L,re),e.onMounted(re),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const ue=()=>{var w;if(i.disabled||!L.value)return;const V=i.editor;if(!V)return;const n=(w=V.state)==null?void 0:w.selection;if(!n||n.from===n.to)return;const r=D.value;r&&r.from===n.from&&r.to===n.to||(O(),D.value={from:n.from,to:n.to},U.value||P())};return(V,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:!!i.disabled}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!v(),onClick:b},[e.createVNode(e.unref(A),{text:"撤销",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(lt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,En),e.createElementVNode("div",{class:"icon","aria-disabled":!l(),onClick:N},[e.createVNode(e.unref(A),{text:"重做",shortcut:e.unref(_),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ot),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,vn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:L.value}]),onClick:n[0]||(n[0]=r=>W(!1)),onDblclick:n[1]||(n[1]=r=>W(!0))},[e.createVNode(e.unref(A),{text:"格式刷",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"formatBrush",size:18})]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:k},[e.createVNode(e.unref(A),{text:"清除格式",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"clearFormat",size:18})]),_:1},8,["shortcut"])]),e.createVNode(e.unref(xn),{editor:i.editor},null,8,["editor"]),e.createVNode(e.unref(yt),{editor:i.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("bold")}]),onClick:n[2]||(n[2]=r=>c("toggleBold"))},[e.createVNode(e.unref(A),{text:"加粗",shortcut:e.unref(x),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:s("italic")}]),onClick:n[3]||(n[3]=r=>c("toggleItalic"))},[e.createVNode(e.unref(A),{text:"斜体",shortcut:e.unref(d),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("strike")}]),onClick:n[4]||(n[4]=r=>c("toggleStrike"))},[e.createVNode(e.unref(A),{text:"删除线",shortcut:e.unref(f),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:s("underline")}]),onClick:n[5]||(n[5]=r=>c("toggleUnderline"))},[e.createVNode(e.unref(A),{text:"下划线",shortcut:e.unref(p),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Tt),{editor:i.editor,currentColor:i.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(wo),{editor:i.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createVNode(e.unref(Nn),{editor:i.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("bulletList")}]),onClick:n[6]||(n[6]=r=>c("toggleBulletList"))},[e.createVNode(e.unref(A),{text:"无序列表",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"bulletList",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("orderedList")}]),onClick:n[7]||(n[7]=r=>c("toggleOrderedList"))},[e.createVNode(e.unref(A),{text:"有序列表",shortcut:e.unref(T),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"orderedList",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(un),{editor:i.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("code")}]),onClick:n[8]||(n[8]=r=>c("toggleCode"))},[e.createVNode(e.unref(A),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"code",size:18})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:s("codeBlock")}]),onClick:n[9]||(n[9]=r=>c("toggleCodeBlock"))},[e.createVNode(e.unref(A),{text:"代码块",shortcut:e.unref(C),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(G,{name:"codeBlock",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(hn),{editor:i.editor},null,8,["editor"]),e.createVNode(e.unref(jo),{editor:i.editor},null,8,["editor"]),e.createVNode(e.unref(xo),{editor:i.editor,imageUploader:i.imageUploader,uploadSizeLimit:i.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(_o),{editor:i.editor,videoUploader:i.videoUploader,uploadSizeLimit:i.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Fo),{ref_key:"findRef",ref:h,editor:i.editor},null,8,["editor"]),e.createVNode(e.unref(Go),{editor:i.editor},null,8,["editor"]),e.createVNode(e.unref(mn),{editor:i.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:n[10]||(n[10]=r=>o("toggleFullscreen"))},[e.createVNode(e.unref(A),{text:i.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.fullscreen?e.unref(nt):e.unref(tt)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])],2))}}),[["__scopeId","data-v-40d61df0"]]),Bn={class:"outline__header"},Ln={style:{cursor:"pointer","margin-top":"5px"}},zn={class:"outline__listWrap"},Sn={class:"outline__list"},$n=["onClick"],Tn=["onClick"],Dn=Y(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:a}){const i=t,o=a;function s(f){x(f),o("select",f)}function c(){o("update:open",!1),o("update:pinned",!1)}function v(){i.pinned||c()}function l(f){const g=[],u=[];for(const E of f){const T={...E,children:[]};for(;u.length&&u[u.length-1].level>=T.level;)u.pop();u.length?u[u.length-1].children.push(T):g.push(T),u.push(T)}return g}const b=e.ref(new Set);function N(f){return b.value.has(f.pos)}function m(f){const g=b.value;g.has(f.pos)?g.delete(f.pos):g.add(f.pos),b.value=new Set(g)}const _=e.computed(()=>l(i.items||[])),y=e.computed(()=>{const f=[],g=u=>{for(const E of u)f.push({node:E,level:E.level,hasChildren:E.children.length>0}),b.value.has(E.pos)||g(E.children)};return g(_.value),f});function x(f){const g=e.unref(i.editor);if(!g)return;const{doc:u}=g.state,E=u.nodeAt(f.pos),T=Math.max(1,u.content.size-1);let C=f.pos+1;E&&E.type.name==="heading"&&(C=f.pos+E.nodeSize-1),C=Math.min(Math.max(1,C),T),g.chain().focus().setTextSelection(C).run();const h=e.unref(i.container)??null,k=g.view.coordsAtPos(C),L=i.offset??8,U=i.duration??700;if(h){const M=h.getBoundingClientRect(),D=h.scrollTop+k.top-M.top-L;d(h,D,U)}else{const M=(window.scrollY||window.pageYOffset)+k.top-L;p(M,U)}}function d(f,g,u=600){const E=f.scrollTop,T=g-E,C=performance.now(),h=L=>L<.5?4*L*L*L:1-Math.pow(-2*L+2,3)/2;function k(L){const U=L-C,M=Math.min(1,U/u);f.scrollTop=E+T*h(M),M<1&&requestAnimationFrame(k)}requestAnimationFrame(k)}function p(f,g=600){const u=window.scrollY||window.pageYOffset,E=f-u,T=performance.now(),C=k=>k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2;function h(k){const L=k-T,U=Math.min(1,L/g),M=u+E*C(U);window.scrollTo(0,M),U<1&&requestAnimationFrame(h)}requestAnimationFrame(h)}return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:g[1]||(g[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:i.open}]),style:e.normalizeStyle({maxHeight:typeof i.maxHeight=="number"?i.maxHeight+"px":i.maxHeight}),onMouseleave:v},[e.createElementVNode("div",Bn,[g[2]||(g[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",Ln,[i.open&&!i.pinned?(e.openBlock(),e.createBlock(e.unref(it),{key:0,onClick:g[0]||(g[0]=u=>f.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),i.pinned?(e.openBlock(),e.createBlock(e.unref(rt),{key:1,onClick:c,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",zn,[e.createElementVNode("ul",Sn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(u,E)=>(e.openBlock(),e.createElementBlock("li",{key:u.node.pos+"-"+E,class:e.normalizeClass(["outline__item","lv-"+u.level])},[u.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:N(u.node),expanded:!N(u.node)}]),onClick:e.withModifiers(T=>m(u.node),["stop"]),title:"展开/收起"},[...g[3]||(g[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,$n)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:T=>s(u.node)},e.toDisplayString(u.node.text||"(无标题)"),9,Tn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[i.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:c})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-b5f802fc"]]),Fn=["onClick"],$e=Y(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean}},emits:["update:modelValue","update:markdown"],setup(t,{expose:a,emit:i}){const o=t,s=i,c=e.ref(null);let v=!1;const l=e.ref(!1),b=e.ref(!1),N=e.ref(""),m=e.ref([]),_=e.ref("#000000"),y=e.ref(!0),x=e.ref(!0),d=e.ref(null),p=e.ref(void 0),f=e.ref([]),g=e.ref(null),u=()=>{const n=d.value;p.value=n?n.clientHeight:void 0};let E=null;e.onMounted(()=>{u(),E=()=>u(),window.addEventListener("resize",E),e.nextTick(()=>{const n=d.value;n&&n.addEventListener("scroll",re,{passive:!0})})}),e.onBeforeUnmount(()=>{E&&(window.removeEventListener("resize",E),E=null);const n=d.value;n&&n.removeEventListener("scroll",re)}),e.watch([()=>o.height,y,l],async()=>{await e.nextTick(),u(),re()}),e.watch(l,n=>{try{document.body.style.overflow=n?"hidden":""}catch{}try{n?window.addEventListener("keydown",T):window.removeEventListener("keydown",T)}catch{}});function T(n){n.key==="Escape"&&l.value&&(n.preventDefault(),l.value=!1)}const C=e.computed(()=>{const n=w=>w==null?void 0:typeof w=="number"?`${w}px`:w,r=l.value?"100vh":n(o.height);return{height:r,"--editor-height":r,"--editor-caret-color":o.caretColor||"#000"}}),h=ke.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:n=>n.style.fontSize||null,renderHTML:n=>n.fontSize?{style:`font-size: ${n.fontSize}`}:{}}}},addCommands(){return{setFontSize:n=>({chain:r})=>r().setMark("textStyle",{fontSize:n}).run(),unsetFontSize:()=>({chain:n})=>n().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),k=ke.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:n=>n.style.backgroundColor||null,renderHTML:n=>n.backgroundColor?{style:`background-color: ${n.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:n=>({chain:r})=>r().setMark("textStyle",{backgroundColor:n}).run(),unsetBackgroundColor:()=>({chain:n})=>n().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{c.value=new Ne.Editor({extensions:[Fe.StarterKit.configure({dropcursor:!1}),Re.Dropcursor.configure({color:"#22c55e",width:2}),ve.TaskList,Ke,Ge.configure({inline:!0,allowBase64:!0}),Ye.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),Ae.Markdown,Ee.TableKit.configure({table:{resizable:!0},tableCell:!1}),qe,ke.TextStyle,h,k,Oe.Color,We.Underline,je.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Ie.TextAlign.configure({types:["heading","paragraph"]}),Ue.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:!o.readonly,autofocus:!o.readonly,editorProps:{handlePaste(n,r){var te,ie,de;if(o.readonly){try{r.preventDefault()}catch{}return!0}const w=r.clipboardData;if(!w)return!1;const B=w.files&&w.files.length?Array.from(w.files):[],z=B.find(q=>{var J;return(J=q.type)==null?void 0:J.startsWith("image/")});if(z){if(r.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return D(z),!0}const S=B.find(q=>{var J;return(J=q.type)==null?void 0:J.startsWith("video/")});if(S)return r.preventDefault(),Q(S),!0;const F=(w.items?Array.from(w.items):[]).find(q=>q.kind==="file"),H=F?F.getAsFile():null;if(H&&H.type.startsWith("image/")){if(r.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return D(H),!0}if(H&&H.type.startsWith("video/"))return r.preventDefault(),Q(H),!0;const I=w.getData("text/html");if(I){const q=I.match(/<img[^>]+src=["']([^"']+)["']/i),J=I.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(q&&J&&J[1]){r.preventDefault();const pe=J[1];if(o.imageUploader&&/^data:image\//i.test(pe)){const he=W(pe,"clipboard.png");D(he)}else{if(/^data:image\//i.test(pe)){const he=W(pe,"clipboard.png"),_e=(te=o.uploadSizeLimit)==null?void 0:te.image;if(_e){const Hn=Math.max(1,_e)*1024*1024;if(he.size>Hn){try{window.alert(`图片文件大小超限(${(he.size/1024/1024).toFixed(2)}MB > ${_e}MB)`)}catch{}return!0}}}L(pe)}return!0}const le=I.match(/<video[^>]+src=["']([^"']+)["']/i),oe=I.match(/<source[^>]+src=["']([^"']+)["']/i),fe=I.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),De=le&&le[1]||oe&&oe[1];if(De&&fe)return r.preventDefault(),M(De),!0}const Z=w.getData("text/plain");if(Z){const q=Z.trim(),J=K(q);if(P(q)&&q===Z.trim()){if(r.preventDefault(),/^data:image\//i.test(q)){const le=W(q,"clipboard.png"),oe=(ie=o.uploadSizeLimit)==null?void 0:ie.image;if(oe){const fe=Math.max(1,oe)*1024*1024;if(le.size>fe){try{window.alert(`图片文件大小超限(${(le.size/1024/1024).toFixed(2)}MB > ${oe}MB)`)}catch{}return!0}}}return L(q),!0}if(J){if(r.preventDefault(),/^data:image\//i.test(J)){const le=W(J,"clipboard.png"),oe=(de=o.uploadSizeLimit)==null?void 0:de.image;if(oe){const fe=Math.max(1,oe)*1024*1024;if(le.size>fe){try{window.alert(`图片文件大小超限(${(le.size/1024/1024).toFixed(2)}MB > ${oe}MB)`)}catch{}return!0}}}return L(J),!0}if(X(q)&&q===Z.trim())return r.preventDefault(),M(q),!0}return!1},handleDrop(n,r){if(o.readonly){try{r.preventDefault()}catch{}return!0}const w=r.dataTransfer;if(!w)return!1;const z=(w.files?Array.from(w.files):[]).find(S=>{var $;return($=S.type)==null?void 0:$.startsWith("image/")});if(z){if(r.preventDefault(),!o.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return D(z),!0}return!1},handleClick(n,r,w){const B=w,z=B.target,S=z?z.closest("a[href]"):null;if(S&&(B.ctrlKey||B.metaKey)){const $=S.getAttribute("href")||"";if($){B.preventDefault();try{window.open($,"_blank","noopener,noreferrer")}catch(F){console.warn("打开链接失败:",F)}return!0}}return!1},handleDOMEvents:{dragstart(n,r){if(o.readonly){try{r.preventDefault()}catch{}return!0}return!1},dragover(n,r){if(o.readonly){try{r.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:n=>{var B;const w=((B=n.editor.getAttributes("textStyle"))==null?void 0:B.color)||"#000000";_.value=typeof w=="string"?w:"#000000"},onUpdate:()=>{const n=c.value;v=!0,s("update:modelValue",n.getHTML()),s("update:markdown",n.getMarkdown()),ce()},onTransaction:()=>{ce()}}),e.nextTick(()=>{var n;ce();try{o.readonly||(n=c.value)==null||n.chain().focus().run()}catch{}})}),e.onBeforeUnmount(()=>{var n;(n=c.value)==null||n.destroy()}),e.watch(()=>o.modelValue,n=>{if(v){v=!1;return}n!=null&&c.value&&e.nextTick(()=>{try{const r=/<\s*(video|iframe)\b|data-youtube-video/i.test(n),w=n.match(/\[video\]\(([^)]+)\)/i);if(!r&&w){const B=w[1],z=n.replace(/\[video\]\(([^)]+)\)/gi,(S,$)=>`<video data-tiptap-video src="${$}" controls></video>`);c.value.commands.setContent(z,{contentType:"html"})}else c.value.commands.setContent(n,{contentType:r?"html":"markdown"})}catch(r){console.warn("setContent 失败,内容更新被忽略:",r)}})}),e.watch(()=>o.readonly,n=>{var r,w;try{(w=(r=c.value)==null?void 0:r.setEditable)==null||w.call(r,!n)}catch{}}),e.watch(()=>o.markdown,n=>{if(v){v=!1;return}n!=null&&c.value&&e.nextTick(()=>{try{c.value.commands.setContent(n,{contentType:"markdown"})}catch(r){console.warn("setContent 失败,内容更新被忽略:",r)}})});function L(n){var r;(r=c.value)==null||r.chain().focus().setImage({src:n}).run()}function U(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(n){const r=c.value;if(!r)return;if(typeof r.commands.setVideo=="function"){r.chain().focus().setVideo({src:n,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const B=U(n);try{r.chain().focus().insertContent(`<p><a href="${B}" target="_blank" rel="noopener noreferrer">${B}</a></p>`).run()}catch{r.chain().focus().insertContent(B).run()}}async function D(n){var w,B;const r=(w=o.uploadSizeLimit)==null?void 0:w.image;if(r){const z=Math.max(1,r)*1024*1024;if(n.size>z){try{window.alert(`图片文件大小超限(${(n.size/1024/1024).toFixed(2)}MB > ${r}MB)`)}catch{}return}}if(o.imageUploader){const z=URL.createObjectURL(n);(B=c.value)==null||B.chain().focus().setImage({src:z,uploading:!0}).run();try{const S=await o.imageUploader(n);if(typeof S=="string"&&S){j(z,S);return}O(n,$=>j(z,$))}catch(S){console.warn("图片上传失败,回退为 base64",S),O(n,$=>j(z,$))}finally{try{URL.revokeObjectURL(z)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function j(n,r){var $,F;const w=c.value;if(!w)return;const{state:B}=w,{doc:z}=B;let S=null;if(z.descendants((H,I)=>{var Z,te;return((Z=H.type)==null?void 0:Z.name)==="image"&&((te=H.attrs)==null?void 0:te.src)===n?(S=I,!1):!0}),S!=null){const H=z.nodeAt(S),I=B.schema.nodes.image;if(!H||!I)return;const Z={...H.attrs||{},src:r,uploading:null},te=B.tr.setNodeMarkup(S,I,Z,H.marks);w.view.dispatch(te);try{(F=($=w.options)==null?void 0:$.onUpdate)==null||F.call($,{editor:w})}catch{}}else L(r)}function O(n,r){const w=new FileReader;w.onload=()=>r(String(w.result||"")),w.readAsDataURL(n)}function W(n,r="image.png"){var F;const w=n.split(","),B=((F=w[0].match(/:(.*?);/))==null?void 0:F[1])||"image/png",z=atob(w[1]);let S=z.length;const $=new Uint8Array(S);for(;S--;)$[S]=z.charCodeAt(S);return new File([$],r,{type:B})}function P(n){return/^data:image\//i.test(n)||/^https?:\/\//i.test(n)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(n)}function X(n){return/^https?:\/\//i.test(n)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(n)}function K(n){const r=n.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!r)return null;const w=r[1].trim().replace(/^<|>$/g,"");return P(w)?w:null}async function Q(n){var B;const r=(B=o.uploadSizeLimit)==null?void 0:B.video;if(r){const z=Math.max(1,r)*1024*1024;if(n.size>z){try{window.alert(`视频文件大小超限(${(n.size/1024/1024).toFixed(2)}MB > ${r}MB)`)}catch{}return}}if(o.videoUploader){const z=URL.createObjectURL(n),S=c.value,$=S==null?void 0:S.commands;try{typeof($==null?void 0:$.setVideo)=="function"?S==null||S.chain().focus().setVideo({src:z,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():M(z)}catch{M(z)}try{const F=await o.videoUploader(n);ne(z,F)}catch(F){console.warn("视频上传失败,保留本地对象 URL 作为预览",F)}finally{try{URL.revokeObjectURL(z)}catch{}}return}const w=URL.createObjectURL(n);M(w)}function ne(n,r){const w=c.value;if(!w)return;const{state:B}=w,{doc:z}=B;let S=null;if(z.descendants(($,F)=>{var H,I;return((H=$.type)==null?void 0:H.name)==="video"&&((I=$.attrs)==null?void 0:I.src)===n?(S=F,!1):!0}),S!=null){const $=z.nodeAt(S),F=B.schema.nodes.video;if(!$||!F)return;const H={...$.attrs||{},src:r,uploading:null},I=B.tr.setNodeMarkup(S,F,H,$.marks);w.view.dispatch(I)}}function se(){var n,r;N.value=((r=(n=c.value)==null?void 0:n.getAttributes("link"))==null?void 0:r.href)||"",b.value=!0}function ce(){const n=c.value;if(!n)return;const r=[];n.state.doc.descendants((w,B)=>{if(w.type.name==="heading"){const z=w.attrs.level||1,S=w.textContent||"";r.push({text:S,level:z,pos:B})}}),m.value=r,re()}function re(){const n=c.value,r=d.value,w=m.value;if(!n||!r||!w.length){f.value=[],g.value=null;return}const B=r.getBoundingClientRect(),z=r.scrollHeight||r.clientHeight,S=r.clientHeight||1,$=w.map(I=>{const te=n.view.coordsAtPos(Math.min(I.pos+1,n.state.doc.content.size)).top-B.top+r.scrollTop,ie=z?Math.max(0,Math.min(1,te/z)):0;return Math.round(ie*S)});f.value=$;const F=r.scrollTop+8;let H=null;for(let I=0;I<w.length;I++){const Z=w[I];if(n.view.coordsAtPos(Math.min(Z.pos+1,n.state.doc.content.size)).top-B.top+r.scrollTop<=F)H=Z.pos;else break}g.value=H}function ue(n){const r=n.target;r.closest(".outline")||r.closest(".outline-toggle")||c.value&&c.value.chain().focus().run()}function V(){const n=c.value;return n?n.getMarkdown():""}return a({getMarkdown:V}),(n,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:l.value,readonly:!!o.readonly}]),style:e.normalizeStyle(C.value)},[e.createVNode(e.unref(Mn),{editor:c.value,currentColor:_.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":o.uploadSizeLimit,fullscreen:l.value,disabled:!!o.readonly,onToggleFullscreen:r[0]||(r[0]=w=>l.value=!l.value),onOpenLinkModal:se},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:y.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:d,class:"editor_wrapper",onClick:ue},[e.createVNode(e.unref(Ne.EditorContent),{editor:c.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Dn),{open:y.value,"onUpdate:open":r[1]||(r[1]=w=>y.value=w),items:m.value,editor:c.value,container:d.value,maxHeight:p.value,pinned:x.value,"onUpdate:pinned":r[2]||(r[2]=w=>x.value=w)},null,8,["open","items","editor","container","maxHeight","pinned"]),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:r[3]||(r[3]=w=>(y.value=!0,x.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(w,B)=>{var z;return e.openBlock(),e.createElementBlock("span",{key:B,class:e.normalizeClass(["outline-marker",{active:((z=m.value[B])==null?void 0:z.pos)===g.value}]),style:e.normalizeStyle({top:(w||0)+"px"}),onClick:e.withModifiers(S=>{var $,F;return(F=c.value)==null?void 0:F.chain().focus().setTextSelection(((($=m.value[B])==null?void 0:$.pos)||1)+1).run()},["stop"])},null,14,Fn)}),128))],32))],2)],6))}}),[["__scopeId","data-v-c5cc8864"]]),An={install(t){t.component("Editor",$e)}};R.Editor=$e,R.default=An,Object.defineProperties(R,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
8
|
+
)`,border:"1px dashed #ccc"},onClick:e.withModifiers(y,["stop"])})])]),e.createElementVNode("div",lo,[h[5]||(h[5]=e.createElementVNode("div",{class:"section-title"},"默认",-1)),e.createElementVNode("div",so,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(0,9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},[k===x.value?(e.openBlock(),e.createElementBlock("span",co,"✓")):e.createCommentVNode("",!0)],12,ao))),128))])]),e.createElementVNode("div",fo,[h[6]||(h[6]=e.createElementVNode("div",{class:"section-title"},"常用颜色",-1)),e.createElementVNode("div",po,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.slice(9),k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},[k===x.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0)],12,mo))),128))])]),s.value.length?(e.openBlock(),e.createElementBlock("div",uo,[h[7]||(h[7]=e.createElementVNode("div",{class:"section-title"},"最近使用自定义颜色",-1)),e.createElementVNode("div",ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"swatch",style:e.normalizeStyle({background:k}),onClick:e.withModifiers(D=>C(k),["stop"])},null,12,go))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",ko,[e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(y,["stop"])},"暂无"),e.createElementVNode("button",{class:"btn",onClick:e.withModifiers(E,["stop"])},"更多颜色")]),a.value?(e.openBlock(),e.createElementBlock("div",wo,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":h[1]||(h[1]=k=>B.value=k)},null,512),[[e.vModelText,B.value]]),e.withDirectives(e.createElementVNode("input",{class:"hex","onUpdate:modelValue":h[2]||(h[2]=k=>B.value=k)},null,512),[[e.vModelText,B.value]]),e.createElementVNode("button",{class:"btn apply",onClick:h[3]||(h[3]=e.withModifiers(k=>C(B.value),["stop"]))},"应用")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-620c7aa3"]]),yo={class:"image-actions"},xo=["aria-disabled","disabled"],bo=K(e.defineComponent({__name:"index",props:{editor:{},imageUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref(!1),l=e.ref(null),B=()=>{r.value=!r.value},s=()=>{var i,p,f,g,m,v;const y=n.value.trim();y&&((v=(m=((g=(p=(i=c.editor)==null?void 0:i.chain)==null?void 0:(f=p.call(i)).focus)==null?void 0:g.call(f)).setImage({src:y})).run)==null||v.call(m),r.value=!1,n.value="")},x=y=>{y.key==="Enter"&&s(),y.key==="Escape"&&(r.value=!1,n.value="")},N=()=>{var y;c.imageUploader&&((y=l.value)==null||y.click())},u=async y=>{var g,m,v,$,w,h,k,D;const i=y.target,p=(g=i.files)==null?void 0:g[0];if(i.value="",!p||!c.imageUploader)return;const f=(m=c.uploadSizeLimit)==null?void 0:m.image;if(typeof f=="number"&&f>0){const H=Math.max(1,f)*1024*1024;if(p.size>H){try{window.alert(`图片文件大小超限(${(p.size/1024/1024).toFixed(2)}MB > ${f}MB)`)}catch{}return}}try{a.value=!0;let H=null;H=URL.createObjectURL(p),(D=(k=((h=($=(v=c.editor)==null?void 0:v.chain)==null?void 0:(w=$.call(v)).focus)==null?void 0:h.call(w)).setImage({src:H,uploading:!0})).run)==null||D.call(k);const T=await c.imageUploader(p);if(typeof T=="string"&&T){const F=c.editor,{state:j}=F,{doc:O}=j;let G=null;if(O.descendants((R,Z)=>{var J,ee;return((J=R==null?void 0:R.type)==null?void 0:J.name)==="image"&&((ee=R==null?void 0:R.attrs)==null?void 0:ee.src)===H?(G=Z,!1):!0}),G!=null){const R=O.nodeAt(G),Z=j.schema.nodes.image;if(R&&Z){const J={...R.attrs||{},src:T,uploading:null},ee=j.tr.setNodeMarkup(G,Z,J,R.marks);F.view.dispatch(ee)}}r.value=!1,n.value=""}}finally{a.value=!1;try{objectUrl&&URL.revokeObjectURL(objectUrl)}catch{}}},E=e.ref(null);let C=null;return e.onMounted(()=>{C=y=>{if(!r.value)return;const i=E.value,p=y.target;i&&p&&!i.contains(p)&&(r.value=!1)},document.addEventListener("mousedown",C,!0)}),e.onBeforeUnmount(()=>{C&&(document.removeEventListener("mousedown",C,!0),C=null)}),(y,i)=>(e.openBlock(),e.createElementBlock("div",{class:"icon image-icon",onClick:B,ref_key:"rootRef",ref:E},[e.createVNode(e.unref(U),{text:"图片",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"img",size:18})]),_:1}),e.createVNode(e.Transition,{name:"img-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"image-input-panel",onClick:i[1]||(i[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"image-input",type:"text",placeholder:"粘贴图片链接(png/jpg/webp/svg 等)","onUpdate:modelValue":i[0]||(i[0]=p=>n.value=p),onKeydown:x},null,544),[[e.vModelText,n.value]]),e.createElementVNode("input",{ref_key:"imageUploadInput",ref:l,type:"file",accept:"image/*",style:{display:"none"},onChange:u},null,544),e.createElementVNode("div",yo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(s,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!c.imageUploader||a.value,disabled:!c.imageUploader||a.value,onClick:e.withModifiers(N,["stop"])},e.toDisplayString(a.value?"上传中…":"上传文件"),9,xo)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-e1c5f3df"]]),Vo={class:"video-actions"},_o=["aria-disabled","disabled"],Eo=K(e.defineComponent({__name:"index",props:{editor:{},videoUploader:{type:Function},uploadSizeLimit:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref(!1),l=e.ref(null),B=()=>{r.value=!r.value},s=()=>{const i=n.value.trim();if(!i)return;const p=c.editor,f=p==null?void 0:p.commands;if(/youtube\.com|youtu\.be|youtube-nocookie\.com/i.test(i)){const m=String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{p.chain().focus().insertContent(`<p><a href="${m}" target="_blank" rel="noopener noreferrer">${m}</a></p>`).run()}catch{p.chain().focus().insertContent(m).run()}}else if(typeof(f==null?void 0:f.setVideo)=="function")p.chain().focus().setVideo({src:i,HTMLAttributes:{controls:!0,width:640}}).run();else{const m=String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{p.chain().focus().insertContent(`<p><a href="${m}" target="_blank" rel="noopener noreferrer">${m}</a></p>`).run()}catch{p.chain().focus().insertContent(m).run()}}r.value=!1,n.value=""},x=i=>{i.key==="Enter"&&s(),i.key==="Escape"&&(r.value=!1,n.value="")},N=()=>{var i;c.videoUploader&&((i=l.value)==null||i.click())},u=async i=>{var v,$;const p=i.target,f=(v=p.files)==null?void 0:v[0];if(p.value="",!f||!c.videoUploader)return;const g=($=c.uploadSizeLimit)==null?void 0:$.video;if(typeof g=="number"&&g>0){const w=Math.max(1,g)*1024*1024;if(f.size>w){try{window.alert(`视频文件大小超限(${(f.size/1024/1024).toFixed(2)}MB > ${g}MB)`)}catch{}return}}let m=null;try{a.value=!0;const w=c.editor,h=w==null?void 0:w.commands;m=URL.createObjectURL(f);try{if(typeof(h==null?void 0:h.setVideo)=="function")w.chain().focus().setVideo({src:m,HTMLAttributes:{controls:!0,width:640,uploading:!0}}).run();else{const D=String(m).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");try{w.chain().focus().insertContent(`<p><a href="${D}" target="_blank" rel="noopener noreferrer">${D}</a></p>`).run()}catch{w.chain().focus().insertContent(D).run()}}}catch{}const k=await c.videoUploader(f);m&&E(m,k),r.value=!1,n.value=""}finally{a.value=!1;try{m&&URL.revokeObjectURL(m)}catch{}}};function E(i,p){const f=c.editor;if(!f)return;const{state:g}=f,{doc:m}=g;let v=null;if(m.descendants(($,w)=>{var h,k;return((h=$.type)==null?void 0:h.name)==="video"&&((k=$.attrs)==null?void 0:k.src)===i?(v=w,!1):!0}),v!=null){const $=m.nodeAt(v),w=g.schema.nodes.video;if(!$||!w)return;const h={...$.attrs||{},src:p,uploading:null},k=g.tr.setNodeMarkup(v,w,h,$.marks);f.view.dispatch(k)}}const C=e.ref(null);let y=null;return e.onMounted(()=>{y=i=>{if(!r.value)return;const p=C.value,f=i.target;p&&f&&!p.contains(f)&&(r.value=!1)},document.addEventListener("mousedown",y,!0)}),e.onBeforeUnmount(()=>{y&&(document.removeEventListener("mousedown",y,!0),y=null)}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon video-icon",onClick:B,ref_key:"rootRef",ref:C},[e.createVNode(e.unref(U),{text:"视频",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"video",size:16})]),_:1}),e.createVNode(e.Transition,{name:"video-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"video-input-panel",onClick:p[1]||(p[1]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{class:"video-input",type:"text",placeholder:"粘贴视频链接(mp4/webm/m3u8等)","onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),onKeydown:x},null,544),[[e.vModelText,n.value]]),e.createElementVNode("input",{ref_key:"videoUploadInput",ref:l,type:"file",accept:"video/*,application/x-mpegURL",style:{display:"none"},onChange:u},null,544),e.createElementVNode("div",Vo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(s,["stop"])},"插入"),e.createElementVNode("button",{class:"btn","aria-disabled":!c.videoUploader||a.value,disabled:!c.videoUploader||a.value,onClick:e.withModifiers(N,["stop"])},e.toDisplayString(a.value?"上传中…":"上传文件"),9,_o)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-35a7027c"]]),No={class:"fr-header"},vo={key:0,class:"fr-body"},Mo={class:"fr-input-row"},Bo=["value"],Lo={key:0,class:"fr-count"},zo={class:"fr-actions"},So={key:1,class:"fr-body"},$o={class:"fr-input-row"},To=["value"],Do={key:0,class:"fr-count"},Fo={class:"fr-actions"},Ao=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t,{expose:c}){const r=t,n=e.ref(!1),a=e.ref("find"),l=e.ref(""),B=e.ref(""),s=e.ref([]),x=e.ref(0),N=e.computed(()=>{const T=s.value.length;return!l.value||!T?"0/0":`${Math.min(Math.max(x.value+1,1),T)}/${T}`}),u=typeof navigator<"u"&&navigator.platform.includes("Mac"),E=e.computed(()=>u?"⌘ F / ⌥ ⌘ F":"Ctrl F / Ctrl H"),C=()=>n.value=!n.value,y=()=>n.value=!1;function i(){var T;return((T=r.editor)==null?void 0:T.view)||null}function p(){const T=i(),F=l.value;if(s.value=[],x.value=0,!T||!F)return;const j=T.dom,O=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,null);let G;for(;G=O.nextNode();){const R=G,Z=R.data||"";let J=0;for(;;){const ee=Z.indexOf(F,J);if(ee===-1)break;const ne=T.posAtDOM(R,ee),se=T.posAtDOM(R,ee+F.length);typeof ne=="number"&&typeof se=="number"&&s.value.push({from:ne,to:se}),J=ee+F.length}}e.nextTick(()=>{s.value.length&&f(0)})}function f(T){const F=r.editor,j=i();if(!F||!j||!s.value.length)return;const O=s.value.length;x.value=(T%O+O)%O;const G=s.value[x.value];F.chain().focus().setTextSelection({from:G.from,to:G.to}).run()}const g=()=>s.value.length&&f(x.value+1),m=()=>s.value.length&&f(x.value-1);function v(){const T=r.editor;if(!T||!s.value.length)return;const F=s.value[x.value],j=T.state.tr.insertText(B.value,F.from,F.to);T.view.dispatch(j),p()}function $(){const T=r.editor;if(!T||!s.value.length)return;const F=[...s.value],j=T.state.tr;for(let O=F.length-1;O>=0;O--){const G=F[O];j.insertText(B.value,G.from,G.to)}T.view.dispatch(j),p()}function w(T){l.value=T.target.value,p()}function h(T){T.key==="Enter"&&g(),T.key==="Escape"&&y()}const k=e.ref(null);let D=null;e.onMounted(()=>{D=T=>{if(!n.value)return;const F=k.value,j=T.target;F&&j&&!F.contains(j)&&y()},document.addEventListener("mousedown",D,!0)}),e.onBeforeUnmount(()=>{D&&(document.removeEventListener("mousedown",D,!0),D=null)});function H(T){T&&(a.value=T),n.value=!0,e.nextTick(p)}return c({openPanel:H}),(T,F)=>(e.openBlock(),e.createElementBlock("div",{class:"icon find-icon",ref_key:"rootRef",ref:k,onClick:C},[e.createVNode(e.unref(U),{text:"查找替换",shortcut:E.value,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(at),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"]),e.createVNode(e.Transition,{name:"find-panel",appear:""},{default:e.withCtx(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"find-input-panel",onClick:F[3]||(F[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",No,[e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="find"}]),onClick:F[0]||(F[0]=e.withModifiers(j=>a.value="find",["stop"]))}," 查找 ",2),e.createElementVNode("button",{class:e.normalizeClass(["fr-tab",{active:a.value==="replace"}]),onClick:F[1]||(F[1]=e.withModifiers(j=>a.value="replace",["stop"]))}," 替换 ",2)]),a.value==="find"?(e.openBlock(),e.createElementBlock("div",vo,[F[4]||(F[4]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",Mo,[e.createElementVNode("input",{class:"fr-input",value:l.value,placeholder:"输入关键字",onInput:w,onKeydown:h},null,40,Bo),l.value?(e.openBlock(),e.createElementBlock("span",Lo,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",zo,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(m,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])])):(e.openBlock(),e.createElementBlock("div",So,[F[5]||(F[5]=e.createElementVNode("label",{class:"fr-label"},"查找",-1)),e.createElementVNode("div",$o,[e.createElementVNode("input",{class:"fr-input",value:l.value,placeholder:"输入关键字",onInput:w},null,40,To),l.value?(e.openBlock(),e.createElementBlock("span",Do,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),F[6]||(F[6]=e.createElementVNode("label",{class:"fr-label"},"替换为",-1)),e.withDirectives(e.createElementVNode("input",{class:"fr-input",style:{width:"95%"},"onUpdate:modelValue":F[2]||(F[2]=j=>B.value=j),placeholder:"请输入"},null,512),[[e.vModelText,B.value]]),e.createElementVNode("div",Fo,[e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers($,["stop"])},"全部替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(v,["stop"])},"替换"),e.createElementVNode("button",{class:"fr-btn",onClick:e.withModifiers(m,["stop"])},"上一个"),e.createElementVNode("button",{class:"fr-btn primary",onClick:e.withModifiers(g,["stop"])},"下一个")])]))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-750ee9bb"]]),Ho={class:"field"},Uo={class:"field"},jo={class:"actions"},Io=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(""),a=e.ref("");e.ref(!1);const l=e.ref(null);function B(){const i=c.editor;if(!r.value&&i)try{const p=i.state.selection,f=p.from;p.to>f?x():(n.value="链接",i.chain().focus().insertContent("链接").setTextSelection({from:f,to:f+2}).run())}catch{}r.value=!r.value,r.value&&s()}function s(){setTimeout(()=>{var p;const i=(p=l.value)==null?void 0:p.querySelector('input[name="link-text"]');i==null||i.focus(),i==null||i.select()},0)}function x(){const i=c.editor;if(i)try{const p=i.state.selection,f=p.from,g=p.to,v=g>f?i.state.doc.textBetween(f,g):"";n.value=v||"";const $=i.getAttributes("link")||{};a.value=typeof $.href=="string"?$.href:""}catch{}}function N(){const i=c.editor;if(!i)return;const p=n.value.trim(),f=a.value.trim();if(f)try{const g=i.state.selection,m=g.from,v=g.to;if(v>m){const w=u(p||i.state.doc.textBetween(m,v)),h=u(f);i.chain().focus().insertContent(`<a href="${h}" target="_blank" rel="noopener noreferrer">${w}</a>`,{from:m,to:v}).run()}else{const w=u(f),h=u(p||f);i.chain().focus().insertContent(`<a href="${w}" target="_blank" rel="noopener noreferrer">${h}</a>`).run()}}finally{r.value=!1,n.value="",a.value=""}}function u(i){return String(i).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(i){i.key==="Enter"&&N(),i.key==="Escape"&&(r.value=!1)}let C=null;e.onMounted(()=>{C=i=>{if(!r.value)return;const p=l.value,f=i.target;p&&f&&!p.contains(f)&&(r.value=!1)},document.addEventListener("mousedown",C,!0)}),e.onBeforeUnmount(()=>{C&&(document.removeEventListener("mousedown",C,!0),C=null)});const y=e.ref({});return e.watch(r,async i=>{var f;if(!i)return;const p=c.editor;if(p){await e.nextTick();try{const g=p.state.selection,m=g.from,v=g.to;if(!(v>m)){y.value={};return}const w=p.view.coordsAtPos(m),h=p.view.coordsAtPos(v),k=(w.left+h.right)/2,D=Math.max(w.bottom,h.bottom)+8,H=(f=l.value)==null?void 0:f.querySelector(".link-input-panel"),T=H?H.getBoundingClientRect():{width:320,height:120},F=window.innerWidth,j=window.innerHeight,O=12,G=Math.max(O+T.width/2,Math.min(F-O-T.width/2,k)),R=D,Z=Math.min(w.top,h.top)-T.height-8;let J=R;R+T.height+O>j&&Z-O>=0&&(J=Z),J=Math.max(O,Math.min(j-O-T.height,J)),y.value={position:"fixed",left:Math.round(G)+"px",top:Math.round(J)+"px"}}catch{}}}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"icon link-icon",onClick:B,ref_key:"rootRef",ref:l},[e.createVNode(e.unref(U),{text:"链接",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"link",size:16})]),_:1}),e.createVNode(e.Transition,{name:"link-panel",appear:""},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"link-input-panel",style:e.normalizeStyle(y.value),onClick:p[2]||(p[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ho,[p[3]||(p[3]=e.createElementVNode("div",{class:"label"},"文本",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-text",class:"input",type:"text","onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),onKeydown:E},null,544),[[e.vModelText,n.value]])]),e.createElementVNode("div",Uo,[p[4]||(p[4]=e.createElementVNode("div",{class:"label"},"链接",-1)),e.withDirectives(e.createElementVNode("input",{name:"link-href",class:"input",type:"text","onUpdate:modelValue":p[1]||(p[1]=f=>a.value=f),placeholder:"链接地址",onKeydown:E},null,544),[[e.vModelText,a.value]])]),e.createElementVNode("div",jo,[e.createElementVNode("button",{class:"btn btn-primary",onClick:e.withModifiers(N,["stop"])},"确 定")])],4)):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-47847dc2"]]),Oo={class:"grid"},Wo=["onMouseenter"],Ro={class:"size"},Po=10,Go=10,qo=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=e.ref(0),a=e.ref(0),l=e.computed(()=>{const N=Math.max(n.value,1),u=Math.max(a.value,1);return`${N} x ${u}`}),B=()=>{r.value=!r.value,r.value||(n.value=0,a.value=0)},s=(N,u)=>{n.value=N,a.value=u},x=()=>{var E,C,y,i,p,f,g,m;const N=Math.max(n.value,1),u=Math.max(a.value,1);(m=(f=(i=(C=(E=c.editor)==null?void 0:E.chain)==null?void 0:(y=C.call(E)).focus)==null?void 0:(p=i.call(y)).insertTable)==null?void 0:(g=f.call(p,{rows:N,cols:u,withHeaderRow:!0})).run)==null||m.call(g),r.value=!1,n.value=0,a.value=0};return(N,u)=>(e.openBlock(),e.createElementBlock("div",{class:"icon table-icon",onClick:B},[e.createVNode(e.unref(U),{text:"表格",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"table",size:16})]),_:1}),r.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",Oo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Po,E=>e.createElementVNode("div",{key:"r-"+E,class:"row"},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Go,C=>e.createElementVNode("span",{key:"c-"+E+"-"+C,class:e.normalizeClass(["cell",{active:E<=n.value&&C<=a.value}]),onMouseenter:y=>s(E,C),onClick:e.withModifiers(x,["stop"])},null,42,Wo)),64))])),64))]),e.createElementVNode("div",Ro,e.toDisplayString(l.value),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-8a3a35f7"]]),Yo=["aria-disabled"],Ko={class:"tools-grid"},Jo=["disabled"],Zo=["disabled"],Xo=["disabled"],Qo=["disabled"],en=["disabled"],tn=["disabled"],on=["disabled"],nn=["disabled"],rn=["disabled"],ln=["disabled"],sn=["disabled"],an=["disabled"],cn=["disabled"],dn=["disabled"],fn=["disabled"],pn=["disabled"],mn=["disabled"],un=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.ref(!1),n=()=>r.value=!r.value,a=(B,...s)=>{var N,u,E;const x=c.editor;return!!((E=(N=x==null?void 0:x.can)==null?void 0:(u=N.call(x))[B])!=null&&E.call(u,...s))},l=(B,...s)=>{var N,u,E,C,y,i,p;const x=c.editor;(p=(i=(y=(C=(E=(N=x==null?void 0:x.chain)==null?void 0:(u=N.call(x)).focus)==null?void 0:E.call(u))[B])==null?void 0:y.call(C,...s))==null?void 0:i.run)==null||p.call(i),r.value=!1};return(B,s)=>{var x,N;return e.openBlock(),e.createElementBlock("div",{class:"icon table-tools",onClick:n,"aria-disabled":!((N=(x=c.editor)==null?void 0:x.isActive)!=null&&N.call(x,"table"))},[e.createVNode(e.unref(U),{text:"表格工具",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"tableTools",size:15})]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"tools-panel",onClick:s[17]||(s[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ko,[e.createElementVNode("button",{class:"btn",onClick:s[0]||(s[0]=e.withModifiers(u=>l("addColumnBefore"),["stop"])),disabled:!a("addColumnBefore")}," 前插列 ",8,Jo),e.createElementVNode("button",{class:"btn",onClick:s[1]||(s[1]=e.withModifiers(u=>l("addColumnAfter"),["stop"])),disabled:!a("addColumnAfter")}," 后插列 ",8,Zo),e.createElementVNode("button",{class:"btn",onClick:s[2]||(s[2]=e.withModifiers(u=>l("deleteColumn"),["stop"])),disabled:!a("deleteColumn")}," 删除列 ",8,Xo),e.createElementVNode("button",{class:"btn",onClick:s[3]||(s[3]=e.withModifiers(u=>l("addRowBefore"),["stop"])),disabled:!a("addRowBefore")}," 前插行 ",8,Qo),e.createElementVNode("button",{class:"btn",onClick:s[4]||(s[4]=e.withModifiers(u=>l("addRowAfter"),["stop"])),disabled:!a("addRowAfter")}," 后插行 ",8,en),e.createElementVNode("button",{class:"btn",onClick:s[5]||(s[5]=e.withModifiers(u=>l("deleteRow"),["stop"])),disabled:!a("deleteRow")}," 删除行 ",8,tn),e.createElementVNode("button",{class:"btn",onClick:s[6]||(s[6]=e.withModifiers(u=>l("deleteTable"),["stop"])),disabled:!a("deleteTable")}," 删除表 ",8,on),e.createElementVNode("button",{class:"btn",onClick:s[7]||(s[7]=e.withModifiers(u=>l("mergeCells"),["stop"])),disabled:!a("mergeCells")}," 合并单元格 ",8,nn),e.createElementVNode("button",{class:"btn",onClick:s[8]||(s[8]=e.withModifiers(u=>l("splitCell"),["stop"])),disabled:!a("splitCell")}," 拆分单元格 ",8,rn),e.createElementVNode("button",{class:"btn",onClick:s[9]||(s[9]=e.withModifiers(u=>l("mergeOrSplit"),["stop"])),disabled:!a("mergeOrSplit")}," 合并/拆分 ",8,ln),e.createElementVNode("button",{class:"btn",onClick:s[10]||(s[10]=e.withModifiers(u=>l("toggleHeaderRow"),["stop"])),disabled:!a("toggleHeaderRow")}," 切换表头行 ",8,sn),e.createElementVNode("button",{class:"btn",onClick:s[11]||(s[11]=e.withModifiers(u=>l("toggleHeaderColumn"),["stop"])),disabled:!a("toggleHeaderColumn")}," 切换表头列 ",8,an),e.createElementVNode("button",{class:"btn",onClick:s[12]||(s[12]=e.withModifiers(u=>l("toggleHeaderCell"),["stop"])),disabled:!a("toggleHeaderCell")}," 切换表头单元 ",8,cn),e.createElementVNode("button",{class:"btn",onClick:s[13]||(s[13]=e.withModifiers(u=>l("fixTables"),["stop"])),disabled:!a("fixTables")}," 修复表格 ",8,dn),e.createElementVNode("button",{class:"btn",onClick:s[14]||(s[14]=e.withModifiers(u=>l("goToNextCell"),["stop"])),disabled:!a("goToNextCell")}," 下个单元格 ",8,fn),e.createElementVNode("button",{class:"btn",onClick:s[15]||(s[15]=e.withModifiers(u=>l("goToPreviousCell"),["stop"])),disabled:!a("goToPreviousCell")}," 上个单元格 ",8,pn),e.createElementVNode("button",{class:"btn",onClick:s[16]||(s[16]=e.withModifiers(u=>l("setCellAttribute","backgroundColor","#FAF594"),["stop"])),disabled:!a("setCellAttribute","backgroundColor","#FAF594")}," 单元格着色 ",8,mn)])])):e.createCommentVNode("",!0)],8,Yo)}}}),[["__scopeId","data-v-bbf06816"]]),hn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,n=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ 9":"Ctrl Shift 9";function a(){const l=c.editor;if(l){l.chain().focus().toggleTaskList().run();try{const{state:B}=l,s=B.selection;let x=null;B.doc.nodesBetween(Math.max(0,s.from-5),Math.min(B.doc.content.size,s.to+5),(N,u)=>{var E;return((E=N==null?void 0:N.type)==null?void 0:E.name)==="taskItem"&&x==null?(x=u,!1):!0}),x!=null&&l.commands.setTextSelection(x+1)}catch{}}}return(l,B)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:a},[e.createVNode(e.unref(U),{text:"任务列表",shortcut:e.unref(n),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"task",size:17})]),_:1},8,["shortcut"])]))}}),[["__scopeId","data-v-693f2c14"]]),gn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t;function r(){const n=c.editor;n&&n.chain().focus().toggleBlockquote().run()}return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:"icon",onClick:r},[e.createVNode(e.unref(U),{text:"引用",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"quote",size:18})]),_:1})]))}}),[["__scopeId","data-v-587fb9a8"]]),kn=["aria-expanded"],wn={class:"label"},Cn={key:0,class:"dropdown",role:"listbox"},yn=["aria-selected","onClick"],xn={class:"shortcut"},be="md-toolbar-dropdown-open",Se="heading-select",bn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=typeof navigator<"u"&&navigator.platform.includes("Mac"),n={0:r?"⌥ ⌘ 0":"Ctrl Alt 0",1:r?"⌥ ⌘ 1":"Ctrl Alt 1",2:r?"⌥ ⌘ 2":"Ctrl Alt 2",3:r?"⌥ ⌘ 3":"Ctrl Alt 3",4:r?"⌥ ⌘ 4":"Ctrl Alt 4",5:r?"⌥ ⌘ 5":"Ctrl Alt 5",6:r?"⌥ ⌘ 6":"Ctrl Alt 6"},a=[{label:"正文",level:null,shortcut:n[0]},{label:"标题1",level:1,shortcut:n[1]},{label:"标题2",level:2,shortcut:n[2]},{label:"标题3",level:3,shortcut:n[3]},{label:"标题4",level:4,shortcut:n[4]},{label:"标题5",level:5,shortcut:n[5]},{label:"标题6",level:6,shortcut:n[6]}],l=e.computed(()=>{var p,f;const i=c.editor;if(!i)return null;for(let g=1;g<=6;g++)if((p=i.isActive)!=null&&p.call(i,"heading",{level:g}))return g;return(f=i.isActive)!=null&&f.call(i,"paragraph"),null}),B=e.computed(()=>{const i=l.value;return i?`标题${i}`:"正文"}),s=e.ref(!1),x=e.ref(null);function N(){s.value||window.dispatchEvent(new CustomEvent(be,{detail:{id:Se}})),s.value=!s.value}function u(){s.value=!1}function E(i){var f,g,m,v,$,w,h,k,D,H;const p=(v=(g=(f=c.editor)==null?void 0:f.chain)==null?void 0:(m=g.call(f)).focus)==null?void 0:v.call(m);p&&(i.level===null?(h=($=p.setParagraph)==null?void 0:(w=$.call(p)).run)==null||h.call(w):(H=(D=(k=p.toggleHeading)==null?void 0:k.call(p,{level:i.level}))==null?void 0:D.run)==null||H.call(D),u())}function C(i){const p=i.target,f=x.value;f&&!f.contains(p)&&u()}function y(i){var f;((f=i.detail)==null?void 0:f.id)!==Se&&(s.value=!1)}return e.onMounted(()=>{document.addEventListener("click",C),window.addEventListener(be,y)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",C),window.removeEventListener(be,y)}),(i,p)=>(e.openBlock(),e.createElementBlock("div",{class:"heading-select",ref_key:"rootRef",ref:x},[e.createVNode(e.unref(U),{text:"标题级别",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon",onClick:e.withModifiers(N,["stop"]),"aria-expanded":s.value},[e.createElementVNode("div",wn,e.toDisplayString(B.value),1),e.createVNode(e.unref(ue),{theme:"filled",strokeWidth:3})],8,kn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Cn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,f=>e.createElementVNode("div",{key:f.label,class:"dropdown-item","aria-selected":f.level===l.value,onClick:e.withModifiers(g=>E(f),["stop"])},[f.level===l.value?(e.openBlock(),e.createBlock(e.unref(de),{key:0,theme:"filled",strokeWidth:3})):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["item-label",{paragraph:f.level===null,"level-1":f.level===1,"level-2":f.level===2,"level-3":f.level===3,"level-4":f.level===4,"level-5":f.level===5,"level-6":f.level===6}])},e.toDisplayString(f.label),3),e.createElementVNode("span",xn,e.toDisplayString(f.shortcut),1)],8,yn)),64))])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-aeb74f7c"]]),Vn=["aria-expanded"],_n={key:0,class:"dropdown",role:"menu"},En={class:"options"},Ve="md-toolbar-dropdown-open",$e="align-select",Nn=K(e.defineComponent({__name:"index",props:{editor:{}},setup(t){const c=t,r=e.computed(()=>{var m,v,$,w;const g=c.editor;return!g||(m=g.isActive)!=null&&m.call(g,{textAlign:"left"})?"left":(v=g.isActive)!=null&&v.call(g,{textAlign:"center"})?"center":($=g.isActive)!=null&&$.call(g,{textAlign:"right"})?"right":(w=g.isActive)!=null&&w.call(g,{textAlign:"justify"})?"justify":"left"}),n=e.computed(()=>({left:"alignLeft",center:"alignCenter",right:"alignRight",justify:"alignJustify"})[r.value]);function a(g){var m,v,$,w,h,k,D,H;(H=(k=(w=(v=(m=c.editor)==null?void 0:m.chain)==null?void 0:($=v.call(m)).focus)==null?void 0:(h=w.call($)).setTextAlign)==null?void 0:(D=k.call(h,g)).run)==null||H.call(D)}const l=e.ref(!1),B=e.ref(null),s=typeof navigator<"u"&&navigator.platform.includes("Mac"),x=s?"⇧ ⌘ L":"Ctrl Shift L",N=s?"⇧ ⌘ E":"Ctrl Shift E",u=s?"⇧ ⌘ R":"Ctrl Shift R",E=s?"⇧ ⌘ J":"Ctrl Shift J";function C(){l.value||window.dispatchEvent(new CustomEvent(Ve,{detail:{id:$e}})),l.value=!l.value}function y(){l.value=!1}function i(g){a(g),y()}function p(g){const m=B.value,v=g.target;m&&!m.contains(v)&&y()}function f(g){var v;((v=g.detail)==null?void 0:v.id)!==$e&&(l.value=!1)}return e.onMounted(()=>{document.addEventListener("click",p),window.addEventListener(Ve,f)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",p),window.removeEventListener(Ve,f)}),(g,m)=>(e.openBlock(),e.createElementBlock("div",{class:"align-select",ref_key:"rootRef",ref:B},[e.createVNode(e.unref(U),{text:"对齐方式",placement:"bottom"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"icon_box",onClick:e.withModifiers(C,["stop"]),"aria-expanded":l.value},[e.createVNode(q,{name:n.value,size:18},null,8,["name"]),e.createVNode(q,{name:"caretDown",size:12})],8,Vn)]),_:1}),e.createVNode(e.Transition,{name:"dropdown-slide"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",_n,[e.createElementVNode("div",En,[e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="left"}]),role:"menuitem",onClick:m[0]||(m[0]=e.withModifiers(v=>i("left"),["stop"]))},[e.createVNode(e.unref(U),{text:"左对齐",shortcut:e.unref(x),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignLeft",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="center"}]),role:"menuitem",onClick:m[1]||(m[1]=e.withModifiers(v=>i("center"),["stop"]))},[e.createVNode(e.unref(U),{text:"居中对齐",shortcut:e.unref(N),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignCenter",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="right"}]),role:"menuitem",onClick:m[2]||(m[2]=e.withModifiers(v=>i("right"),["stop"]))},[e.createVNode(e.unref(U),{text:"右对齐",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignRight",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["option",{active:r.value==="justify"}]),role:"menuitem",onClick:m[3]||(m[3]=e.withModifiers(v=>i("justify"),["stop"]))},[e.createVNode(e.unref(U),{text:"两端对齐",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"alignJustify",size:16})]),_:1},8,["shortcut"])],2)])])):e.createCommentVNode("",!0)]),_:1})],512))}}),[["__scopeId","data-v-f2f793f3"]]),vn=["aria-disabled"],Mn=["aria-disabled"],Bn=K(e.defineComponent({__name:"index",props:{editor:{},currentColor:{},videoUploader:{type:Function},imageUploader:{type:Function},uploadSizeLimit:{},fullscreen:{type:Boolean},disabled:{type:Boolean}},emits:["openLinkModal","toggleFullscreen"],setup(t,{emit:c}){const r=t,n=c,a=(_,V)=>{var o,d;return(d=(o=r.editor)==null?void 0:o.isActive)==null?void 0:d.call(o,_,V)},l=(_,V)=>{var b,S,L,z,M,A;const o=r.editor;if(!o)return;const d=(L=(b=o.chain)==null?void 0:(S=b.call(o)).focus)==null?void 0:L.call(S);return(A=(M=(z=d==null?void 0:d[_])==null?void 0:z.call(d))==null?void 0:M.run)==null?void 0:A.call(M)},B=()=>{var _,V,o,d;try{return!!((d=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).undo)!=null&&d.call(o))}catch{return!1}},s=()=>{var _,V,o,d;try{return!!((d=(V=(_=r.editor)==null?void 0:_.can)==null?void 0:(o=V.call(_)).redo)!=null&&d.call(o))}catch{return!1}},x=()=>{var _,V,o;B()&&((o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.undo)==null||o.call(V))},N=()=>{var _,V,o;return(o=(V=(_=r.editor)==null?void 0:_.commands)==null?void 0:V.redo)==null?void 0:o.call(V)},u=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⌘ Z":"Ctrl Z",E=typeof navigator<"u"&&navigator.platform.includes("Mac")?"⇧ ⌘ Z":"Ctrl Y",C=typeof navigator<"u"&&navigator.platform.includes("Mac"),y=C?"⌘ B":"Ctrl B",i=C?"⌘ I":"Ctrl I",p=C?"⌘ U":"Ctrl U",f=C?"⇧ ⌘ X":"Ctrl Shift X",g=C?"⌘ \\":"Ctrl \\",m=C?"⇧ ⌘ S":"Ctrl Shift S",v=C?"⇧ ⌘ 8":"Ctrl Shift 8",$=C?"⇧ ⌘ 7":"Ctrl Shift 7",w=C?"⇧ ⌘ C":"Ctrl Shift C",h=e.ref(null),k=()=>{var V,o,d,b,S,L,z;const _=r.editor;_&&((z=(L=(S=(b=(d=(o=(V=_.chain())==null?void 0:V.focus())==null?void 0:o.unsetAllMarks)==null?void 0:d.call(o))==null?void 0:b.removeEmptyTextStyle)==null?void 0:S.call(b))==null?void 0:L.run)==null||z.call(L))},D=e.ref(!1),H=e.ref(!1),T=e.ref({}),F=e.ref(null),j=()=>{var o,d,b,S,L,z;const _=r.editor;if(!_)return;const V=((o=_.getAttributes)==null?void 0:o.call(_,"textStyle"))||{};T.value={bold:!!((d=_.isActive)!=null&&d.call(_,"bold")),italic:!!((b=_.isActive)!=null&&b.call(_,"italic")),strike:!!((S=_.isActive)!=null&&S.call(_,"strike")),underline:!!((L=_.isActive)!=null&&L.call(_,"underline")),code:!!((z=_.isActive)!=null&&z.call(_,"code")),textStyle:{...V!=null&&V.color?{color:V.color}:{},...V!=null&&V.backgroundColor?{backgroundColor:V.backgroundColor}:{},...V!=null&&V.fontSize?{fontSize:V.fontSize}:{}}}},O=()=>{var S,L,z,M,A,I,W,X,oe,ie,fe,Y;const _=r.editor;if(!_)return;const V=T.value;let o=(z=(S=_.chain)==null?void 0:(L=S.call(_)).focus)==null?void 0:z.call(L);const d=V.textStyle||{},b=(M=_.state)==null?void 0:M.selection;b&&b.from===b.to||(o=((A=o==null?void 0:o.unsetAllMarks)==null?void 0:A.call(o))||o,Object.keys(d).length&&(o=((I=o==null?void 0:o.setMark)==null?void 0:I.call(o,"textStyle",d))||o),V.bold&&(o=((W=o==null?void 0:o.toggleBold)==null?void 0:W.call(o))||o),V.italic&&(o=((X=o==null?void 0:o.toggleItalic)==null?void 0:X.call(o))||o),V.strike&&(o=((oe=o==null?void 0:o.toggleStrike)==null?void 0:oe.call(o))||o),V.underline&&(o=((ie=o==null?void 0:o.toggleUnderline)==null?void 0:ie.call(o))||o),V.code&&(o=((fe=o==null?void 0:o.toggleCode)==null?void 0:fe.call(o))||o),(Y=o==null?void 0:o.run)==null||Y.call(o))},G=_=>{var d;const V=r.editor;if(!V)return;j(),D.value=!0,H.value=!!_;const o=(d=V.state)==null?void 0:d.selection;F.value=o?{from:o.from,to:o.to}:null},R=()=>{D.value=!1,H.value=!1},Z=()=>{ae()},J=_=>{r.disabled||!((_.metaKey||_.ctrlKey)&&_.shiftKey&&(_.key==="s"||_.key==="S"))||!r.editor||(_.preventDefault(),G(!1))},ee=_=>{var z,M,A,I;if(r.disabled)return;const V=_.metaKey||_.ctrlKey,o=_.key==="c"||_.key==="C";if(V&&_.shiftKey&&o){_.preventDefault(),l("toggleCodeBlock");return}const d=_.key==="f"||_.key==="F";if(V&&d){_.preventDefault();try{(M=(z=h.value)==null?void 0:z.openPanel)==null||M.call(z,"find")}catch{}return}const b=_.key==="h"||_.key==="H",S=_.metaKey&&_.altKey&&d,L=_.ctrlKey&&b;if(S||L){_.preventDefault();try{(I=(A=h.value)==null?void 0:A.openPanel)==null||I.call(A,"replace")}catch{}return}};let ne=!1;const se=()=>{var V;const _=r.editor;!_||ne||(ne=!0,(V=_.on)==null||V.call(_,"selectionUpdate",Z),window.addEventListener("keydown",J),window.addEventListener("keydown",ee),window.addEventListener("mouseup",ce,!0))},_e=()=>{var V;const _=r.editor;_&&((V=_.off)==null||V.call(_,"selectionUpdate",Z),window.removeEventListener("keydown",J),window.removeEventListener("keydown",ee),window.removeEventListener("mouseup",ce,!0),ne=!1)};e.onMounted(()=>{se()}),e.onBeforeUnmount(()=>{_e()}),e.watch(()=>r.editor,(_,V)=>{var o;V&&((o=V.off)==null||o.call(V,"selectionUpdate",Z)),ne=!1,se()});const ae=()=>{try{D.value?document.body.setAttribute("data-format-brush","true"):document.body.removeAttribute("data-format-brush")}catch{}};e.watch(D,ae),e.onMounted(ae),e.onBeforeUnmount(()=>{try{document.body.removeAttribute("data-format-brush")}catch{}});const ce=()=>{var d;if(r.disabled||!D.value)return;const _=r.editor;if(!_)return;const V=(d=_.state)==null?void 0:d.selection;if(!V||V.from===V.to)return;const o=F.value;o&&o.from===V.from&&o.to===V.to||(O(),F.value={from:V.from,to:V.to},H.value||R())};return(_,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["header_box",{disabled:!!r.disabled}])},[e.createElementVNode("div",{class:"icon","aria-disabled":!B(),onClick:x},[e.createVNode(e.unref(U),{text:"撤销",shortcut:e.unref(u),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(st),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,vn),e.createElementVNode("div",{class:"icon","aria-disabled":!s(),onClick:N},[e.createVNode(e.unref(U),{text:"重做",shortcut:e.unref(E),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(nt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],8,Mn),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:D.value}]),onClick:V[0]||(V[0]=o=>G(!1)),onDblclick:V[1]||(V[1]=o=>G(!0))},[e.createVNode(e.unref(U),{text:"格式刷",shortcut:e.unref(m),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"formatBrush",size:18})]),_:1},8,["shortcut"])],34),e.createElementVNode("div",{class:"icon",onClick:k},[e.createVNode(e.unref(U),{text:"清除格式",shortcut:e.unref(g),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"clearFormat",size:18})]),_:1},8,["shortcut"])]),e.createVNode(e.unref(bn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(xt),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("bold")}]),onClick:V[2]||(V[2]=o=>l("toggleBold"))},[e.createVNode(e.unref(U),{text:"加粗",shortcut:e.unref(y),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(dt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("italic")}]),onClick:V[3]||(V[3]=o=>l("toggleItalic"))},[e.createVNode(e.unref(U),{text:"斜体",shortcut:e.unref(i),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(ft),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("strike")}]),onClick:V[4]||(V[4]=o=>l("toggleStrike"))},[e.createVNode(e.unref(U),{text:"删除线",shortcut:e.unref(f),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:a("underline")}]),onClick:V[5]||(V[5]=o=>l("toggleUnderline"))},[e.createVNode(e.unref(U),{text:"下划线",shortcut:e.unref(p),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(pt),{theme:"outline",strokeWidth:3})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(Dt),{editor:r.editor,currentColor:r.currentColor},null,8,["editor","currentColor"]),e.createVNode(e.unref(Co),{editor:r.editor,style:{"margin-left":"-6px"}},null,8,["editor"]),e.createVNode(e.unref(Nn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("bulletList")}]),onClick:V[6]||(V[6]=o=>l("toggleBulletList"))},[e.createVNode(e.unref(U),{text:"无序列表",shortcut:e.unref(v),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"bulletList",size:16})]),_:1},8,["shortcut"])],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("orderedList")}]),onClick:V[7]||(V[7]=o=>l("toggleOrderedList"))},[e.createVNode(e.unref(U),{text:"有序列表",shortcut:e.unref($),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"orderedList",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(hn),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("code")}]),onClick:V[8]||(V[8]=o=>l("toggleCode"))},[e.createVNode(e.unref(U),{text:"行内代码",placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"code",size:18})]),_:1})],2),e.createElementVNode("div",{class:e.normalizeClass(["icon",{active:a("codeBlock")}]),onClick:V[9]||(V[9]=o=>l("toggleCodeBlock"))},[e.createVNode(e.unref(U),{text:"代码块",shortcut:e.unref(w),placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(q,{name:"codeBlock",size:16})]),_:1},8,["shortcut"])],2),e.createVNode(e.unref(gn),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(Io),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(bo),{editor:r.editor,imageUploader:r.imageUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","imageUploader","uploadSizeLimit"]),e.createVNode(e.unref(Eo),{editor:r.editor,videoUploader:r.videoUploader,uploadSizeLimit:r.uploadSizeLimit},null,8,["editor","videoUploader","uploadSizeLimit"]),e.createVNode(e.unref(Ao),{ref_key:"findRef",ref:h,editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(qo),{editor:r.editor},null,8,["editor"]),e.createVNode(e.unref(un),{editor:r.editor},null,8,["editor"]),e.createElementVNode("div",{class:"icon",onClick:V[10]||(V[10]=o=>n("toggleFullscreen"))},[e.createVNode(e.unref(U),{text:r.fullscreen?"退出全屏":"全屏编辑",placement:"bottom"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.fullscreen?e.unref(rt):e.unref(ot)),{theme:"outline",strokeWidth:3}))]),_:1},8,["text"])])],2))}}),[["__scopeId","data-v-40d61df0"]]),Ln={class:"outline__header"},zn={style:{cursor:"pointer","margin-top":"5px"}},Sn={class:"outline__listWrap"},$n={class:"outline__list"},Tn=["onClick"],Dn=["onClick"],Fn=K(e.defineComponent({__name:"index",props:{items:{},maxHeight:{},editor:{},container:{},duration:{},offset:{},open:{type:Boolean},pinned:{type:Boolean}},emits:["select","update:open"],setup(t,{emit:c}){const r=t,n=c;function a(f){y(f),n("select",f)}function l(){n("update:open",!1),n("update:pinned",!1)}function B(){r.pinned||l()}function s(f){const g=[],m=[];for(const v of f){const $={...v,children:[]};for(;m.length&&m[m.length-1].level>=$.level;)m.pop();m.length?m[m.length-1].children.push($):g.push($),m.push($)}return g}const x=e.ref(new Set);function N(f){return x.value.has(f.pos)}function u(f){const g=x.value;g.has(f.pos)?g.delete(f.pos):g.add(f.pos),x.value=new Set(g)}const E=e.computed(()=>s(r.items||[])),C=e.computed(()=>{const f=[],g=m=>{for(const v of m)f.push({node:v,level:v.level,hasChildren:v.children.length>0}),x.value.has(v.pos)||g(v.children)};return g(E.value),f});function y(f){const g=e.unref(r.editor);if(!g)return;const{doc:m}=g.state,v=m.nodeAt(f.pos),$=Math.max(1,m.content.size-1);let w=f.pos+1;v&&v.type.name==="heading"&&(w=f.pos+v.nodeSize-1),w=Math.min(Math.max(1,w),$),g.chain().focus().setTextSelection(w).run();const h=e.unref(r.container)??null,k=g.view.coordsAtPos(w),D=r.offset??8,H=r.duration??700;if(h){const T=h.getBoundingClientRect(),F=h.scrollTop+k.top-T.top-D;i(h,F,H)}else{const T=(window.scrollY||window.pageYOffset)+k.top-D;p(T,H)}}function i(f,g,m=600){const v=f.scrollTop,$=g-v,w=performance.now(),h=D=>D<.5?4*D*D*D:1-Math.pow(-2*D+2,3)/2;function k(D){const H=D-w,T=Math.min(1,H/m);f.scrollTop=v+$*h(T),T<1&&requestAnimationFrame(k)}requestAnimationFrame(k)}function p(f,g=600){const m=window.scrollY||window.pageYOffset,v=f-m,$=performance.now(),w=k=>k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2;function h(k){const D=k-$,H=Math.min(1,D/g),T=m+v*w(H);window.scrollTo(0,T),H<1&&requestAnimationFrame(h)}requestAnimationFrame(h)}return(f,g)=>(e.openBlock(),e.createElementBlock("div",{class:"outline-wrapper",onClick:g[1]||(g[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("aside",{class:e.normalizeClass(["outline",{isOpen:r.open}]),style:e.normalizeStyle({maxHeight:typeof r.maxHeight=="number"?r.maxHeight+"px":r.maxHeight}),onMouseleave:B},[e.createElementVNode("div",Ln,[g[2]||(g[2]=e.createElementVNode("div",{style:{"margin-right":"6px"}},"大纲",-1)),e.createElementVNode("div",zn,[r.open&&!r.pinned?(e.openBlock(),e.createBlock(e.unref(lt),{key:0,onClick:g[0]||(g[0]=m=>f.$emit("update:pinned",!0)),theme:"outline",size:16,strokeWidth:3})):e.createCommentVNode("",!0),r.pinned?(e.openBlock(),e.createBlock(e.unref(it),{key:1,onClick:l,theme:"outline",size:"16",strokeWidth:3})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Sn,[e.createElementVNode("ul",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(m,v)=>(e.openBlock(),e.createElementBlock("li",{key:m.node.pos+"-"+v,class:e.normalizeClass(["outline__item","lv-"+m.level])},[m.hasChildren?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["outline__caret",{collapsed:N(m.node),expanded:!N(m.node)}]),onClick:e.withModifiers($=>u(m.node),["stop"]),title:"展开/收起"},[...g[3]||(g[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,Tn)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:"outline__text",onClick:$=>a(m.node)},e.toDisplayString(m.node.text||"(无标题)"),9,Dn)],2))),128))])])],38),e.createVNode(e.Transition,{name:"outline-mask"},{default:e.withCtx(()=>[r.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-drawer-mask",onClick:l})):e.createCommentVNode("",!0)]),_:1})]))}}),[["__scopeId","data-v-b5f802fc"]]),An=["onClick"],Te=K(e.defineComponent({__name:"index",props:{modelValue:{},markdown:{},height:{},placeholder:{},imageUploader:{type:Function},videoUploader:{type:Function},caretColor:{},uploadSizeLimit:{},readonly:{type:Boolean}},emits:["update:modelValue","update:markdown"],setup(t,{expose:c,emit:r}){const n=t,a=r,l=e.ref(null);let B=!1;const s=e.ref(!1),x=e.ref(!1),N=e.ref(""),u=e.ref([]),E=e.ref("#000000"),C=e.ref(!0),y=e.ref(!0),i=e.ref(null),p=e.ref(void 0),f=e.ref([]),g=e.ref(null),m=o=>{var d;if(n.readonly)try{o.preventDefault(),(d=o.stopPropagation)==null||d.call(o)}catch{}},v=()=>{const o=i.value;p.value=o?o.clientHeight:void 0};let $=null;e.onMounted(()=>{v(),$=()=>v(),window.addEventListener("resize",$),e.nextTick(()=>{const o=i.value;o&&o.addEventListener("scroll",ce,{passive:!0})})}),e.onBeforeUnmount(()=>{$&&(window.removeEventListener("resize",$),$=null);const o=i.value;o&&o.removeEventListener("scroll",ce)}),e.watch([()=>n.height,C,s],async()=>{await e.nextTick(),v(),ce()}),e.watch(s,o=>{try{document.body.style.overflow=o?"hidden":""}catch{}try{o?window.addEventListener("keydown",w):window.removeEventListener("keydown",w)}catch{}});function w(o){o.key==="Escape"&&s.value&&(o.preventDefault(),s.value=!1)}const h=e.computed(()=>{const o=b=>b==null?void 0:typeof b=="number"?`${b}px`:b,d=s.value?"100vh":o(n.height);return{height:d,"--editor-height":d,"--editor-caret-color":n.caretColor||"#000"}}),k=ke.TextStyle.extend({addAttributes(){return{fontSize:{default:null,parseHTML:o=>o.style.fontSize||null,renderHTML:o=>o.fontSize?{style:`font-size: ${o.fontSize}`}:{}}}},addCommands(){return{setFontSize:o=>({chain:d})=>d().setMark("textStyle",{fontSize:o}).run(),unsetFontSize:()=>({chain:o})=>o().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),D=ke.TextStyle.extend({addAttributes(){return{backgroundColor:{default:null,parseHTML:o=>o.style.backgroundColor||null,renderHTML:o=>o.backgroundColor?{style:`background-color: ${o.backgroundColor}`}:{}}}},addCommands(){return{setBackgroundColor:o=>({chain:d})=>d().setMark("textStyle",{backgroundColor:o}).run(),unsetBackgroundColor:()=>({chain:o})=>o().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}});e.onMounted(()=>{l.value=new Ne.Editor({extensions:[Ae.StarterKit.configure({dropcursor:!1}),Pe.Dropcursor.configure({color:"#22c55e",width:2}),Me.TaskList,Je,qe.configure({inline:!0,allowBase64:!0}),Ke.configure({HTMLAttributes:{class:"tiptap-video",controls:!0}}),He.Markdown,ve.TableKit.configure({table:{resizable:!0},tableCell:!1}),Ye,ke.TextStyle,k,D,We.Color,Re.Underline,Ie.Link.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1,HTMLAttributes:{target:"_blank",rel:"noopener noreferrer"}}),Oe.TextAlign.configure({types:["heading","paragraph"]}),je.Placeholder.configure({placeholder:n.placeholder??"输入 / 以插入块"})],content:n.modelValue!=null?String(n.modelValue||""):String(n.markdown||""),contentType:n.modelValue!=null&&/<\s*(video|iframe)\b|data-youtube-video|<\w+/i.test(String(n.modelValue||""))?"html":"markdown",editable:!n.readonly,autofocus:!n.readonly,editorProps:{handlePaste(o,d){var oe,ie,fe;if(n.readonly){try{d.preventDefault()}catch{}return!0}const b=d.clipboardData;if(!b)return!1;const S=b.files&&b.files.length?Array.from(b.files):[],L=S.find(Y=>{var te;return(te=Y.type)==null?void 0:te.startsWith("image/")});if(L){if(d.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return j(L),!0}const z=S.find(Y=>{var te;return(te=Y.type)==null?void 0:te.startsWith("video/")});if(z)return d.preventDefault(),ne(z),!0;const A=(b.items?Array.from(b.items):[]).find(Y=>Y.kind==="file"),I=A?A.getAsFile():null;if(I&&I.type.startsWith("image/")){if(d.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return j(I),!0}if(I&&I.type.startsWith("video/"))return d.preventDefault(),ne(I),!0;const W=b.getData("text/html");if(W){const Y=W.match(/<img[^>]+src=["']([^"']+)["']/i),te=W.replace(/\s+/g,"").match(/^<img[^>]+src=["']([^"']+)["'][^>]*>$/i);if(Y&&te&&te[1]){d.preventDefault();const me=te[1];if(n.imageUploader&&/^data:image\//i.test(me)){const he=R(me,"clipboard.png");j(he)}else{if(/^data:image\//i.test(me)){const he=R(me,"clipboard.png"),Ee=(oe=n.uploadSizeLimit)==null?void 0:oe.image;if(Ee){const Un=Math.max(1,Ee)*1024*1024;if(he.size>Un){try{window.alert(`图片文件大小超限(${(he.size/1024/1024).toFixed(2)}MB > ${Ee}MB)`)}catch{}return!0}}}H(me)}return!0}const le=W.match(/<video[^>]+src=["']([^"']+)["']/i),re=W.match(/<source[^>]+src=["']([^"']+)["']/i),pe=W.replace(/\s+/g,"").match(/^<video[^>]*>.*<\/video>$/i),Fe=le&&le[1]||re&&re[1];if(Fe&&pe)return d.preventDefault(),F(Fe),!0}const X=b.getData("text/plain");if(X){const Y=X.trim(),te=ee(Y);if(Z(Y)&&Y===X.trim()){if(d.preventDefault(),/^data:image\//i.test(Y)){const le=R(Y,"clipboard.png"),re=(ie=n.uploadSizeLimit)==null?void 0:ie.image;if(re){const pe=Math.max(1,re)*1024*1024;if(le.size>pe){try{window.alert(`图片文件大小超限(${(le.size/1024/1024).toFixed(2)}MB > ${re}MB)`)}catch{}return!0}}}return H(Y),!0}if(te){if(d.preventDefault(),/^data:image\//i.test(te)){const le=R(te,"clipboard.png"),re=(fe=n.uploadSizeLimit)==null?void 0:fe.image;if(re){const pe=Math.max(1,re)*1024*1024;if(le.size>pe){try{window.alert(`图片文件大小超限(${(le.size/1024/1024).toFixed(2)}MB > ${re}MB)`)}catch{}return!0}}}return H(te),!0}if(J(Y)&&Y===X.trim())return d.preventDefault(),F(Y),!0}return!1},handleDrop(o,d){if(n.readonly){try{d.preventDefault()}catch{}return!0}const b=d.dataTransfer;if(!b)return!1;const L=(b.files?Array.from(b.files):[]).find(z=>{var M;return(M=z.type)==null?void 0:M.startsWith("image/")});if(L){if(d.preventDefault(),!n.imageUploader){try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}return!0}return j(L),!0}return!1},handleClick(o,d,b){const S=b,L=S.target,z=L?L.closest("a[href]"):null;if(z&&(S.ctrlKey||S.metaKey)){const M=z.getAttribute("href")||"";if(M){S.preventDefault();try{window.open(M,"_blank","noopener,noreferrer")}catch(A){console.warn("打开链接失败:",A)}return!0}}return!1},handleDOMEvents:{dragstart(o,d){if(n.readonly){try{d.preventDefault()}catch{}return!0}return!1},dragover(o,d){if(n.readonly){try{d.preventDefault()}catch{}return!0}return!1},drop(o,d){if(n.readonly){try{d.preventDefault()}catch{}return!0}return!1}}},onSelectionUpdate:o=>{var S;const b=((S=o.editor.getAttributes("textStyle"))==null?void 0:S.color)||"#000000";E.value=typeof b=="string"?b:"#000000"},onUpdate:()=>{const o=l.value;B=!0,a("update:modelValue",o.getHTML()),a("update:markdown",o.getMarkdown()),ae()},onTransaction:()=>{ae()}}),e.nextTick(()=>{var o,d,b,S,L,z;ae();try{n.readonly||(o=l.value)==null||o.chain().focus().run()}catch{}try{const M=((b=(d=l.value)==null?void 0:d.view)==null?void 0:b.dom)||null;(S=M==null?void 0:M.addEventListener)==null||S.call(M,"dragstart",m,!0),(L=M==null?void 0:M.addEventListener)==null||L.call(M,"dragover",m,!0),(z=M==null?void 0:M.addEventListener)==null||z.call(M,"drop",m,!0)}catch{}})}),e.onBeforeUnmount(()=>{var o,d,b,S,L,z;try{const M=((d=(o=l.value)==null?void 0:o.view)==null?void 0:d.dom)||null;(b=M==null?void 0:M.removeEventListener)==null||b.call(M,"dragstart",m,!0),(S=M==null?void 0:M.removeEventListener)==null||S.call(M,"dragover",m,!0),(L=M==null?void 0:M.removeEventListener)==null||L.call(M,"drop",m,!0)}catch{}(z=l.value)==null||z.destroy()}),e.watch(()=>n.modelValue,o=>{if(B){B=!1;return}o!=null&&l.value&&e.nextTick(()=>{try{const d=/<\s*(video|iframe)\b|data-youtube-video/i.test(o),b=o.match(/\[video\]\(([^)]+)\)/i);if(!d&&b){const S=b[1],L=o.replace(/\[video\]\(([^)]+)\)/gi,(z,M)=>`<video data-tiptap-video src="${M}" controls></video>`);l.value.commands.setContent(L,{contentType:"html"})}else l.value.commands.setContent(o,{contentType:d?"html":"markdown"})}catch(d){console.warn("setContent 失败,内容更新被忽略:",d)}})}),e.watch(()=>n.readonly,o=>{var d,b;try{(b=(d=l.value)==null?void 0:d.setEditable)==null||b.call(d,!o)}catch{}}),e.watch(()=>n.markdown,o=>{if(B){B=!1;return}n.modelValue==null&&o!=null&&l.value&&e.nextTick(()=>{try{l.value.commands.setContent(o,{contentType:"markdown"})}catch(d){console.warn("setContent 失败,内容更新被忽略:",d)}})});function H(o){var d;(d=l.value)==null||d.chain().focus().setImage({src:o}).run()}function T(o){return String(o).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function F(o){const d=l.value;if(!d)return;if(typeof d.commands.setVideo=="function"){d.chain().focus().setVideo({src:o,HTMLAttributes:{controls:!0,autoplay:!1,width:640}}).run();return}const S=T(o);try{d.chain().focus().insertContent(`<p><a href="${S}" target="_blank" rel="noopener noreferrer">${S}</a></p>`).run()}catch{d.chain().focus().insertContent(S).run()}}async function j(o){var b,S;const d=(b=n.uploadSizeLimit)==null?void 0:b.image;if(d){const L=Math.max(1,d)*1024*1024;if(o.size>L){try{window.alert(`图片文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${d}MB)`)}catch{}return}}if(n.imageUploader){const L=URL.createObjectURL(o);(S=l.value)==null||S.chain().focus().setImage({src:L,uploading:!0}).run();try{const z=await n.imageUploader(o);if(typeof z=="string"&&z){O(L,z);return}G(o,M=>O(L,M))}catch(z){console.warn("图片上传失败,回退为 base64",z),G(o,M=>O(L,M))}finally{try{URL.revokeObjectURL(L)}catch{}}return}try{window.alert("未设置图片上传方法(image-uploader),无法上传图片文件")}catch{}}function O(o,d){var M,A;const b=l.value;if(!b)return;const{state:S}=b,{doc:L}=S;let z=null;if(L.descendants((I,W)=>{var X,oe;return((X=I.type)==null?void 0:X.name)==="image"&&((oe=I.attrs)==null?void 0:oe.src)===o?(z=W,!1):!0}),z!=null){const I=L.nodeAt(z),W=S.schema.nodes.image;if(!I||!W)return;const X={...I.attrs||{},src:d,uploading:null},oe=S.tr.setNodeMarkup(z,W,X,I.marks);b.view.dispatch(oe);try{(A=(M=b.options)==null?void 0:M.onUpdate)==null||A.call(M,{editor:b})}catch{}}else H(d)}function G(o,d){const b=new FileReader;b.onload=()=>d(String(b.result||"")),b.readAsDataURL(o)}function R(o,d="image.png"){var A;const b=o.split(","),S=((A=b[0].match(/:(.*?);/))==null?void 0:A[1])||"image/png",L=atob(b[1]);let z=L.length;const M=new Uint8Array(z);for(;z--;)M[z]=L.charCodeAt(z);return new File([M],d,{type:S})}function Z(o){return/^data:image\//i.test(o)||/^https?:\/\//i.test(o)&&/\.(png|jpe?g|gif|webp|svg)(\?.*)?$/i.test(o)}function J(o){return/^https?:\/\//i.test(o)&&/\.(mp4|webm|m3u8|mov|ogv?)(\?.*)?$/i.test(o)}function ee(o){const d=o.match(/^!\[[^\]]*\]\(([^)]+)\)\s*$/);if(!d)return null;const b=d[1].trim().replace(/^<|>$/g,"");return Z(b)?b:null}async function ne(o){var S;const d=(S=n.uploadSizeLimit)==null?void 0:S.video;if(d){const L=Math.max(1,d)*1024*1024;if(o.size>L){try{window.alert(`视频文件大小超限(${(o.size/1024/1024).toFixed(2)}MB > ${d}MB)`)}catch{}return}}if(n.videoUploader){const L=URL.createObjectURL(o),z=l.value,M=z==null?void 0:z.commands;try{typeof(M==null?void 0:M.setVideo)=="function"?z==null||z.chain().focus().setVideo({src:L,HTMLAttributes:{controls:!0,autoplay:!1,width:640,uploading:!0}}).run():F(L)}catch{F(L)}try{const A=await n.videoUploader(o);se(L,A)}catch(A){console.warn("视频上传失败,保留本地对象 URL 作为预览",A)}finally{try{URL.revokeObjectURL(L)}catch{}}return}const b=URL.createObjectURL(o);F(b)}function se(o,d){const b=l.value;if(!b)return;const{state:S}=b,{doc:L}=S;let z=null;if(L.descendants((M,A)=>{var I,W;return((I=M.type)==null?void 0:I.name)==="video"&&((W=M.attrs)==null?void 0:W.src)===o?(z=A,!1):!0}),z!=null){const M=L.nodeAt(z),A=S.schema.nodes.video;if(!M||!A)return;const I={...M.attrs||{},src:d,uploading:null},W=S.tr.setNodeMarkup(z,A,I,M.marks);b.view.dispatch(W)}}function _e(){var o,d;N.value=((d=(o=l.value)==null?void 0:o.getAttributes("link"))==null?void 0:d.href)||"",x.value=!0}function ae(){const o=l.value;if(!o)return;const d=[];o.state.doc.descendants((b,S)=>{if(b.type.name==="heading"){const L=b.attrs.level||1,z=b.textContent||"";d.push({text:z,level:L,pos:S})}}),u.value=d,ce()}function ce(){const o=l.value,d=i.value,b=u.value;if(!o||!d||!b.length){f.value=[],g.value=null;return}const S=d.getBoundingClientRect(),L=d.scrollHeight||d.clientHeight,z=d.clientHeight||1,M=b.map(W=>{const oe=o.view.coordsAtPos(Math.min(W.pos+1,o.state.doc.content.size)).top-S.top+d.scrollTop,ie=L?Math.max(0,Math.min(1,oe/L)):0;return Math.round(ie*z)});f.value=M;const A=d.scrollTop+8;let I=null;for(let W=0;W<b.length;W++){const X=b[W];if(o.view.coordsAtPos(Math.min(X.pos+1,o.state.doc.content.size)).top-S.top+d.scrollTop<=A)I=X.pos;else break}g.value=I}function _(o){const d=o.target;d.closest(".outline")||d.closest(".outline-toggle")||l.value&&l.value.chain().focus().run()}function V(){const o=l.value;return o?o.getMarkdown():""}return c({getMarkdown:V}),(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["simple-editor",{fullscreen:s.value,readonly:!!n.readonly}]),style:e.normalizeStyle(h.value)},[e.createVNode(e.unref(Bn),{editor:l.value,currentColor:E.value,imageUploader:t.imageUploader,videoUploader:t.videoUploader,"upload-size-limit":n.uploadSizeLimit,fullscreen:s.value,disabled:!!n.readonly,onToggleFullscreen:d[0]||(d[0]=b=>s.value=!s.value),onOpenLinkModal:_e},null,8,["editor","currentColor","imageUploader","videoUploader","upload-size-limit","fullscreen","disabled"]),e.createElementVNode("div",{class:e.normalizeClass(["editor_main",{hasOutline:C.value}])},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:i,class:"editor_wrapper",onClick:_},[e.createVNode(e.unref(Ne.EditorContent),{editor:l.value,class:"content"},null,8,["editor"])],512),e.createVNode(e.unref(Fn),{open:C.value,"onUpdate:open":d[1]||(d[1]=b=>C.value=b),items:u.value,editor:l.value,container:i.value,maxHeight:p.value,pinned:y.value,"onUpdate:pinned":d[2]||(d[2]=b=>y.value=b)},null,8,["open","items","editor","container","maxHeight","pinned"]),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"outline-markers",onMouseenter:d[3]||(d[3]=b=>(C.value=!0,y.value=!1))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(b,S)=>{var L;return e.openBlock(),e.createElementBlock("span",{key:S,class:e.normalizeClass(["outline-marker",{active:((L=u.value[S])==null?void 0:L.pos)===g.value}]),style:e.normalizeStyle({top:(b||0)+"px"}),onClick:e.withModifiers(z=>{var M,A;return(A=l.value)==null?void 0:A.chain().focus().setTextSelection((((M=u.value[S])==null?void 0:M.pos)||1)+1).run()},["stop"])},null,14,An)}),128))],32))],2)],6))}}),[["__scopeId","data-v-cd057d93"]]),Hn={install(t){t.component("Editor",Te)}};P.Editor=Te,P.default=Hn,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|