@blocknote/core 0.26.0 → 0.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote.cjs +11 -10
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +3685 -9960
- package/dist/blocknote.js.map +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js.map +1 -1
- package/dist/en-B7ycW7c8.js +360 -0
- package/dist/en-B7ycW7c8.js.map +1 -0
- package/dist/en-D4taoCs4.cjs +2 -0
- package/dist/en-D4taoCs4.cjs.map +1 -0
- package/dist/locales.cjs +2 -0
- package/dist/locales.cjs.map +1 -0
- package/dist/locales.js +6129 -0
- package/dist/locales.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +36 -31
- package/src/api/clipboard/__snapshots__/internal/basicBlocks.html +1 -1
- package/src/api/clipboard/__snapshots__/internal/basicBlocksWithProps.html +1 -1
- package/src/api/clipboard/clipboardExternal.test.ts +1 -1
- package/src/api/clipboard/clipboardInternal.test.ts +1 -1
- package/src/api/clipboard/fromClipboard/acceptedMIMETypes.ts +1 -0
- package/src/api/clipboard/fromClipboard/pasteExtension.ts +96 -42
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/defaultLanguage/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/empty/internal.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/external.html +1 -1
- package/src/api/exporters/html/__snapshots__/codeBlock/python/internal.html +1 -1
- package/src/api/exporters/html/htmlConversion.test.ts +2 -2
- package/src/api/exporters/html/util/serializeBlocksExternalHTML.ts +4 -4
- package/src/api/exporters/markdown/__snapshots__/codeBlock/defaultLanguage/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/codeBlock/empty/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/complex/misc/markdown.md +1 -1
- package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -6
- package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +6 -6
- package/src/api/exporters/markdown/markdownExporter.test.ts +2 -2
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +2 -2
- package/src/api/parsers/html/__snapshots__/parse-codeblocks.json +1 -1
- package/src/api/parsers/html/parseHTML.test.ts +1 -1
- package/src/api/parsers/markdown/__snapshots__/pasted/whitespace bold.json +42 -0
- package/src/api/parsers/markdown/__snapshots__/whitespace bold.json +19 -0
- package/src/api/parsers/markdown/detectMarkdown.ts +60 -0
- package/src/api/parsers/markdown/parseMarkdown.test.ts +7 -2
- package/src/api/parsers/markdown/parseMarkdown.ts +19 -18
- package/src/api/testUtil/cases/defaultSchema.ts +13 -0
- package/src/blocks/CodeBlockContent/CodeBlockContent.ts +100 -69
- package/src/blocks/QuoteBlockContent/QuoteBlockContent.ts +98 -0
- package/src/blocks/TableBlockContent/TableExtension.ts +1 -1
- package/src/blocks/defaultBlocks.ts +2 -2
- package/src/editor/Block.css +13 -0
- package/src/editor/BlockNoteEditor.ts +102 -10
- package/src/editor/BlockNoteExtensions.ts +18 -4
- package/src/extensions/Comments/CommentsPlugin.ts +1 -1
- package/src/extensions/HardBreak/HardBreak.ts +35 -0
- package/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +100 -3
- package/src/extensions/SuggestionMenu/SuggestionPlugin.ts +3 -1
- package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +12 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/locales/ar.ts +6 -0
- package/src/i18n/locales/de.ts +6 -0
- package/src/i18n/locales/en.ts +6 -0
- package/src/i18n/locales/es.ts +6 -0
- package/src/i18n/locales/fr.ts +6 -0
- package/src/i18n/locales/hr.ts +6 -0
- package/src/i18n/locales/is.ts +6 -0
- package/src/i18n/locales/it.ts +6 -0
- package/src/i18n/locales/ja.ts +6 -0
- package/src/i18n/locales/ko.ts +6 -0
- package/src/i18n/locales/nl.ts +6 -0
- package/src/i18n/locales/no.ts +6 -0
- package/src/i18n/locales/pl.ts +6 -0
- package/src/i18n/locales/pt.ts +6 -0
- package/src/i18n/locales/ru.ts +6 -0
- package/src/i18n/locales/uk.ts +6 -0
- package/src/i18n/locales/vi.ts +6 -0
- package/src/i18n/locales/zh.ts +6 -0
- package/src/index.ts +2 -3
- package/src/locales.ts +1 -0
- package/src/schema/blocks/types.ts +1 -0
- package/types/src/api/blockManipulation/commands/updateBlock/updateBlock.d.ts +1 -1
- package/types/src/api/blockManipulation/setupTestEnv.d.ts +34 -2
- package/types/src/api/clipboard/fromClipboard/acceptedMIMETypes.d.ts +1 -1
- package/types/src/api/clipboard/fromClipboard/fileDropExtension.d.ts +2 -2
- package/types/src/api/clipboard/fromClipboard/pasteExtension.d.ts +3 -3
- package/types/src/api/clipboard/testUtil.d.ts +66 -34
- package/types/src/api/clipboard/toClipboard/copyExtension.d.ts +1 -1
- package/types/src/api/exporters/html/externalHTMLExporter.d.ts +2 -2
- package/types/src/api/exporters/html/internalHTMLSerializer.d.ts +2 -2
- package/types/src/api/exporters/html/util/serializeBlocksExternalHTML.d.ts +1 -1
- package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
- package/types/src/api/parsers/markdown/detectMarkdown.d.ts +6 -0
- package/types/src/api/parsers/markdown/parseMarkdown.d.ts +1 -0
- package/types/src/api/testUtil/cases/customBlocks.d.ts +72 -40
- package/types/src/api/testUtil/cases/customInlineContent.d.ts +34 -2
- package/types/src/api/testUtil/cases/customStyles.d.ts +34 -2
- package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +3 -3
- package/types/src/blocks/CodeBlockContent/CodeBlockContent.d.ts +46 -34
- package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +3 -3
- package/types/src/blocks/FileBlockContent/helpers/render/createFileBlockWrapper.d.ts +1 -1
- package/types/src/blocks/HeadingBlockContent/HeadingBlockContent.d.ts +2 -2
- package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.d.ts +2 -2
- package/types/src/blocks/PageBreakBlockContent/PageBreakBlockContent.d.ts +2 -2
- package/types/src/blocks/PageBreakBlockContent/schema.d.ts +13 -13
- package/types/src/blocks/ParagraphBlockContent/ParagraphBlockContent.d.ts +2 -2
- package/types/src/blocks/QuoteBlockContent/QuoteBlockContent.d.ts +52 -0
- package/types/src/blocks/TableBlockContent/TableBlockContent.d.ts +2 -2
- package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +2 -2
- package/types/src/blocks/defaultBlockHelpers.d.ts +2 -2
- package/types/src/blocks/defaultBlocks.d.ts +107 -44
- package/types/src/comments/threadstore/yjs/YjsThreadStore.d.ts +3 -3
- package/types/src/editor/BlockNoteEditor.d.ts +58 -0
- package/types/src/editor/BlockNoteExtensions.d.ts +3 -2
- package/types/src/exporter/mapping.d.ts +2 -2
- package/types/src/extensions/BackgroundColor/BackgroundColorMark.d.ts +1 -1
- package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +1 -1
- package/types/src/extensions/HardBreak/HardBreak.d.ts +2 -0
- package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +4 -4
- package/types/src/extensions/TextColor/TextColorMark.d.ts +1 -1
- package/types/src/i18n/index.d.ts +2 -0
- package/types/src/i18n/locales/en.d.ts +7 -1
- package/types/src/index.d.ts +1 -2
- package/types/src/locales.d.ts +1 -0
- package/types/src/pm-nodes/BlockContainer.d.ts +2 -7
- package/types/src/pm-nodes/BlockGroup.d.ts +2 -7
- package/types/src/schema/blocks/types.d.ts +1 -0
- package/types/src/schema/inlineContent/internal.d.ts +1 -1
- package/README.md +0 -125
- package/src/blocks/CodeBlockContent/defaultSupportedLanguages.ts +0 -116
- package/types/src/blocks/CodeBlockContent/defaultSupportedLanguages.d.ts +0 -6
- package/types/src/extensions/Comments/threadstore/DefaultThreadStoreAuth.d.ts +0 -47
- package/types/src/extensions/Comments/threadstore/ThreadStore.d.ts +0 -121
- package/types/src/extensions/Comments/threadstore/ThreadStoreAuth.d.ts +0 -12
- package/types/src/extensions/Comments/threadstore/TipTapThreadStore.d.ts +0 -97
- package/types/src/extensions/Comments/threadstore/yjs/RESTYjsThreadStore.d.ts +0 -83
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.d.ts +0 -79
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStore.test.d.ts +0 -1
- package/types/src/extensions/Comments/threadstore/yjs/YjsThreadStoreBase.d.ts +0 -15
- package/types/src/extensions/Comments/threadstore/yjs/yjsHelpers.d.ts +0 -13
- package/types/src/extensions/Comments/types.d.ts +0 -109
- package/types/src/models/User.d.ts +0 -5
package/dist/blocknote.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
"use strict";var zi=Object.create;var Ve=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var Ki=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var Wi=(e,o,t)=>o in e?Ve(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var qi=(e,o,t,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of $i(o))!Gi.call(e,n)&&n!==t&&Ve(e,n,{get:()=>o[n],enumerable:!(i=Fi(o,n))||i.enumerable});return e};var H=(e,o,t)=>(t=e!=null?zi(Ki(e)):{},qi(o||!e||!e.__esModule?Ve(t,"default",{value:e,enumerable:!0}):t,e));var p=(e,o,t)=>Wi(e,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("prosemirror-model"),Be=require("prosemirror-transform"),k=require("@tiptap/core"),y=require("prosemirror-state"),zt=require("uuid"),Zi=require("prosemirror-highlight"),Xi=require("prosemirror-highlight/shiki"),Ke=require("shiki"),L=require("prosemirror-tables"),Ji=require("@tiptap/extension-bold"),Yi=require("@tiptap/extension-code"),Qi=require("@tiptap/extension-italic"),en=require("@tiptap/extension-strike"),tn=require("@tiptap/extension-underline"),on=require("@tiptap/extension-table-cell"),nn=require("@tiptap/extension-table-header"),rn=require("@tiptap/extension-table-row"),an=require("@tiptap/extension-gapcursor"),sn=require("@tiptap/extension-hard-break"),ln=require("@tiptap/extension-history"),dn=require("@tiptap/extension-link"),cn=require("@tiptap/extension-text"),un=require("@tiptap/extension-collaboration"),pn=require("@tiptap/extension-collaboration-cursor"),T=require("prosemirror-view"),Ge=require("y-prosemirror"),mn=require("prosemirror-dropcursor"),oe=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},hn=oe(Ji),fn=oe(Yi),gn=oe(Qi),bn=oe(en),kn=oe(tn),_n=oe(un),yn=oe(pn),wn={slash_menu:{heading:{title:"عنوان 1",subtext:"يستخدم لعناوين المستوى الأعلى",aliases:["ع","عنوان1","ع1"],group:"العناوين"},heading_2:{title:"عنوان 2",subtext:"يستخدم للأقسام الرئيسية",aliases:["ع2","عنوان2","عنوان فرعي"],group:"العناوين"},heading_3:{title:"عنوان 3",subtext:"يستخدم للأقسام الفرعية والعناوين المجموعة",aliases:["ع3","عنوان3","عنوان فرعي"],group:"العناوين"},numbered_list:{title:"قائمة مرقمة",subtext:"تستخدم لعرض قائمة مرقمة",aliases:["ق","عناصر قائمة","قائمة","قائمة مرقمة"],group:"الكتل الأساسية"},bullet_list:{title:"قائمة نقطية",subtext:"تستخدم لعرض قائمة غير مرتبة",aliases:["ق","عناصر قائمة","قائمة","قائمة نقطية"],group:"الكتل الأساسية"},check_list:{title:"قائمة تحقق",subtext:"تستخدم لعرض قائمة بمربعات التحقق",aliases:["قوائم غير مرتبة","عناصر قائمة","قائمة","قائمة تحقق","قائمة التحقق","قائمة مشطوبة","مربع التحقق"],group:"الكتل الأساسية"},paragraph:{title:"فقرة",subtext:"تستخدم لنص الوثيقة الأساسي",aliases:["ف","فقرة"],group:"الكتل الأساسية"},code_block:{title:"كود",subtext:"يستخدم لعرض الكود مع تحديد الصيغة",aliases:["كود","مسبق"],group:"الكتل الأساسية"},page_break:{title:"فاصل الصفحة",subtext:"فاصل الصفحة",aliases:["page","break","separator","فاصل","الصفحة"],group:"الكتل الأساسية"},table:{title:"جدول",subtext:"يستخدم للجداول",aliases:["جدول"],group:"متقدم"},image:{title:"صورة",subtext:"إدراج صورة",aliases:["صورة","رفع صورة","تحميل","صورة","صورة","وسائط","رابط"],group:"وسائط"},video:{title:"فيديو",subtext:"إدراج فيديو",aliases:["فيديو","رفع فيديو","تحميل","فيديو","فيلم","وسائط","رابط"],group:"وسائط"},audio:{title:"صوت",subtext:"إدراج صوت",aliases:["صوت","رفع صوت","تحميل","صوت","صوت","وسائط","رابط"],group:"وسائط"},file:{title:"ملف",subtext:"إدراج ملف",aliases:["ملف","تحميل","تضمين","وسائط","رابط"],group:"وسائط"},emoji:{title:"الرموز التعبيرية",subtext:"تُستخدم لإدراج رمز تعبيري",aliases:["رمز تعبيري","إيموجي","إيموت","عاطفة","وجه"],group:"آخرون"}},placeholders:{default:"أدخل نصًا أو اكتب '/' للأوامر",heading:"عنوان",bulletListItem:"قائمة",numberedListItem:"قائمة",checkListItem:"قائمة",new_comment:"اكتب تعليقًا...",edit_comment:"تحرير التعليق...",comment_reply:"أضف تعليقًا..."},file_blocks:{image:{add_button_text:"إضافة صورة"},video:{add_button_text:"إضافة فيديو"},audio:{add_button_text:"إضافة صوت"},file:{add_button_text:"إضافة ملف"}},side_menu:{add_block_label:"إضافة محتوي",drag_handle_label:"فتح قائمة المحتويات"},drag_handle:{delete_menuitem:"حذف",colors_menuitem:"ألوان",header_row_menuitem:"عنوان الصف",header_column_menuitem:"عنوان العمود"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_menuitem:"إضافة صف أسفل",split_cell_menuitem:"تقسيم الخلية",merge_cells_menuitem:"جمع الخلايا",background_color_menuitem:"لون الخلفية"},suggestion_menu:{no_items_title:"لم يتم العثور على عناصر",loading:"جارٍ التحميل…"},color_picker:{text_title:"نص",background_title:"خلفية",colors:{default:"افتراضي",gray:"رمادي",brown:"بني",red:"أحمر",orange:"برتقالي",yellow:"أصفر",green:"أخضر",blue:"أزرق",purple:"أرجواني",pink:"وردي"}},formatting_toolbar:{bold:{tooltip:"عريض",secondary_tooltip:"Mod+B"},italic:{tooltip:"مائل",secondary_tooltip:"Mod+I"},underline:{tooltip:"تحته خط",secondary_tooltip:"Mod+U"},strike:{tooltip:"مشطوب",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"كود",secondary_tooltip:""},colors:{tooltip:"ألوان"},link:{tooltip:"إنشاء رابط",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"تحرير التسمية التوضيحية",input_placeholder:"تحرير التسمية التوضيحية"},file_replace:{tooltip:{image:"استبدال الصورة",video:"استبدال الفيديو",audio:"استبدال الصوت",file:"استبدال الملف"}},file_rename:{tooltip:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"},input_placeholder:{image:"إعادة تسمية الصورة",video:"إعادة تسمية الفيديو",audio:"إعادة تسمية الصوت",file:"إعادة تسمية الملف"}},file_download:{tooltip:{image:"تنزيل الصورة",video:"تنزيل الفيديو",audio:"تنزيل الصوت",file:"تنزيل الملف"}},file_delete:{tooltip:{image:"حذف الصورة",video:"حذف الفيديو",audio:"حذف الصوت",file:"حذف الملف"}},file_preview_toggle:{tooltip:"تبديل المعاينة"},nest:{tooltip:"محتويات متداخلة",secondary_tooltip:"Tab"},unnest:{tooltip:"إلغاء التداخل",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"محاذاة النص إلى اليسار"},align_center:{tooltip:"محاذاة النص في المنتصف"},align_right:{tooltip:"محاذاة النص إلى اليمين"},align_justify:{tooltip:"ضبط النص"},table_cell_merge:{tooltip:"جمع الخلايا"},comment:{tooltip:"إضافة ملاحظة"}},file_panel:{upload:{title:"تحميل",file_placeholder:{image:"تحميل صورة",video:"تحميل فيديو",audio:"تحميل صوت",file:"تحميل ملف"},upload_error:"خطأ: فشل التحميل"},embed:{title:"تضمين",embed_button:{image:"تضمين صورة",video:"تضمين فيديو",audio:"تضمين صوت",file:"تضمين ملف"},url_placeholder:"أدخل الرابط"}},link_toolbar:{delete:{tooltip:"إزالة الرابط"},edit:{text:"تحرير الرابط",tooltip:"تحرير"},open:{tooltip:"فتح في تبويب جديد"},form:{title_placeholder:"تحرير العنوان",url_placeholder:"تحرير الرابط"}},comments:{actions:{add_reaction:"أضف تفاعلًا",resolve:"حل",edit_comment:"تحرير التعليق",delete_comment:"حذف التعليق",more_actions:"المزيد من الإجراءات"},reactions:{reacted_by:"تفاعل بواسطة"},sidebar:{marked_as_resolved:"تم وضع علامة كتم الحل",more_replies:e=>`${e} ردود أخرى`}},generic:{ctrl_shortcut:"Ctrl"}},vn={slash_menu:{heading:{title:"Überschrift 1",subtext:"Hauptebene Überschrift",aliases:["h","überschrift1","h1"],group:"Überschriften"},heading_2:{title:"Überschrift 2",subtext:"Wichtige Abschnittsüberschrift",aliases:["h2","überschrift2","unterüberschrift"],group:"Überschriften"},heading_3:{title:"Überschrift 3",subtext:"Unterabschnitts- und Gruppenüberschrift",aliases:["h3","überschrift3","unterüberschrift"],group:"Überschriften"},numbered_list:{title:"Nummerierte Liste",subtext:"Liste mit nummerierten Elementen",aliases:["ol","li","liste","nummerierteliste","nummerierte liste"],group:"Grundlegende blöcke"},bullet_list:{title:"Aufzählungsliste",subtext:"Liste mit unnummerierten Elementen",aliases:["ul","li","liste","aufzählungsliste","aufzählung liste"],group:"Grundlegende blöcke"},check_list:{title:"Checkliste",subtext:"Liste mit Kontrollkästchen",aliases:["ul","li","liste","checkliste","check liste","geprüfte liste","kontrollkästchen"],group:"Grundlegende blöcke"},paragraph:{title:"Absatz",subtext:"Der Hauptteil Ihres Dokuments",aliases:["p","absatz"],group:"Grundlegende blöcke"},code_block:{title:"Codeblock",subtext:"Codeblock mit Syntaxhervorhebung",aliases:["code","pre"],group:"Grundlegende blöcke"},page_break:{title:"Seitenumbruch",subtext:"Seitentrenner",aliases:["page","break","separator","seitenumbruch","trenner"],group:"Grundlegende Blöcke"},table:{title:"Tabelle",subtext:"Tabelle mit editierbaren Zellen",aliases:["tabelle"],group:"Erweitert"},image:{title:"Bild",subtext:"Größenveränderbares Bild mit Beschriftung",aliases:["bild","bildhochladen","hochladen","img","bild","medien","url"],group:"Medien"},video:{title:"Video",subtext:"Größenveränderbares Video mit Beschriftung",aliases:["video","videoupload","hochladen","mp4","film","medien","url"],group:"Medien"},audio:{title:"Audio",subtext:"Eingebettetes Audio mit Beschriftung",aliases:["audio","audioupload","hochladen","mp3","ton","medien","url"],group:"Medien"},file:{title:"Datei",subtext:"Eingebettete Datei",aliases:["datei","hochladen","einbetten","medien","url"],group:"Medien"},emoji:{title:"Emoji",subtext:"Nach Emoji suchen und einfügen",aliases:["emoji","emote","emotion","gesicht"],group:"Andere"}},placeholders:{default:"Text eingeben oder '/' für Befehle tippen",heading:"Überschrift",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste",new_comment:"Einen Kommentar schreiben...",edit_comment:"Kommentar bearbeiten...",comment_reply:"Kommentar hinzufügen..."},file_blocks:{image:{add_button_text:"Bild hinzufügen"},video:{add_button_text:"Video hinzufügen"},audio:{add_button_text:"Audio hinzufügen"},file:{add_button_text:"Datei hinzufügen"}},side_menu:{add_block_label:"Block hinzufügen",drag_handle_label:"Blockmenü öffnen"},drag_handle:{delete_menuitem:"Löschen",colors_menuitem:"Farben",header_row_menuitem:"Kopfzeile",header_column_menuitem:"Kopfspalte"},table_handle:{delete_column_menuitem:"Spalte löschen",delete_row_menuitem:"Zeile löschen",add_left_menuitem:"Spalte links hinzufügen",add_right_menuitem:"Spalte rechts hinzufügen",add_above_menuitem:"Zeile oberhalb hinzufügen",add_below_menuitem:"Zeile unterhalb hinzufügen",split_cell_menuitem:"Zelle teilen",merge_cells_menuitem:"Zellen zusammenführen",background_color_menuitem:"Hintergrundfarbe"},suggestion_menu:{no_items_title:"Keine Elemente gefunden",loading:"Laden…"},color_picker:{text_title:"Text",background_title:"Hintergrund",colors:{default:"Standard",gray:"Grau",brown:"Braun",red:"Rot",orange:"Orange",yellow:"Gelb",green:"Grün",blue:"Blau",purple:"Lila",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Fett",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursiv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Unterstrichen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Durchgestrichen",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Farben"},link:{tooltip:"Link erstellen",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Beschriftung bearbeiten",input_placeholder:"Beschriftung bearbeiten"},file_replace:{tooltip:{image:"Bild ersetzen",video:"Video ersetzen",audio:"Audio ersetzen",file:"Datei ersetzen"}},file_rename:{tooltip:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"},input_placeholder:{image:"Bild umbenennen",video:"Video umbenennen",audio:"Audio umbenennen",file:"Datei umbenennen"}},file_download:{tooltip:{image:"Bild herunterladen",video:"Video herunterladen",audio:"Audio herunterladen",file:"Datei herunterladen"}},file_delete:{tooltip:{image:"Bild löschen",video:"Video löschen",audio:"Audio löschen",file:"Datei löschen"}},file_preview_toggle:{tooltip:"Vorschau umschalten"},nest:{tooltip:"Block verschachteln",secondary_tooltip:"Tab"},unnest:{tooltip:"Block entnesten",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Text linksbündig"},align_center:{tooltip:"Text zentrieren"},align_right:{tooltip:"Text rechtsbündig"},align_justify:{tooltip:"Text Blocksatz"},table_cell_merge:{tooltip:"Zellen zusammenführen"},comment:{tooltip:"Kommentar hinzufügen"}},file_panel:{upload:{title:"Hochladen",file_placeholder:{image:"Bild hochladen",video:"Video hochladen",audio:"Audio hochladen",file:"Datei hochladen"},upload_error:"Fehler: Hochladen fehlgeschlagen"},embed:{title:"Einbetten",embed_button:{image:"Bild einbetten",video:"Video einbetten",audio:"Audio einbetten",file:"Datei einbetten"},url_placeholder:"URL eingeben"}},link_toolbar:{delete:{tooltip:"Link entfernen"},edit:{text:"Link bearbeiten",tooltip:"Bearbeiten"},open:{tooltip:"In neuem Tab öffnen"},form:{title_placeholder:"Titel bearbeiten",url_placeholder:"URL bearbeiten"}},comments:{actions:{add_reaction:"Reaktion hinzufügen",resolve:"Lösen",edit_comment:"Kommentar bearbeiten",delete_comment:"Kommentar löschen",more_actions:"Weitere Aktionen"},reactions:{reacted_by:"Reagiert von"},sidebar:{marked_as_resolved:"Als gelöst markiert",more_replies:e=>`${e} weitere Antworten`}},generic:{ctrl_shortcut:"Strg"}},Ft={slash_menu:{heading:{title:"Heading 1",subtext:"Top-level heading",aliases:["h","heading1","h1"],group:"Headings"},heading_2:{title:"Heading 2",subtext:"Key section heading",aliases:["h2","heading2","subheading"],group:"Headings"},heading_3:{title:"Heading 3",subtext:"Subsection and group heading",aliases:["h3","heading3","subheading"],group:"Headings"},numbered_list:{title:"Numbered List",subtext:"List with ordered items",aliases:["ol","li","list","numberedlist","numbered list"],group:"Basic blocks"},bullet_list:{title:"Bullet List",subtext:"List with unordered items",aliases:["ul","li","list","bulletlist","bullet list"],group:"Basic blocks"},check_list:{title:"Check List",subtext:"List with checkboxes",aliases:["ul","li","list","checklist","check list","checked list","checkbox"],group:"Basic blocks"},paragraph:{title:"Paragraph",subtext:"The body of your document",aliases:["p","paragraph"],group:"Basic blocks"},code_block:{title:"Code Block",subtext:"Code block with syntax highlighting",aliases:["code","pre"],group:"Basic blocks"},page_break:{title:"Page Break",subtext:"Page separator",aliases:["page","break","separator"],group:"Basic blocks"},table:{title:"Table",subtext:"Table with editable cells",aliases:["table"],group:"Advanced"},image:{title:"Image",subtext:"Resizable image with caption",aliases:["image","imageUpload","upload","img","picture","media","url"],group:"Media"},video:{title:"Video",subtext:"Resizable video with caption",aliases:["video","videoUpload","upload","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Embedded audio with caption",aliases:["audio","audioUpload","upload","mp3","sound","media","url"],group:"Media"},file:{title:"File",subtext:"Embedded file",aliases:["file","upload","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Search for and insert an emoji",aliases:["emoji","emote","emotion","face"],group:"Others"}},placeholders:{default:"Enter text or type '/' for commands",heading:"Heading",bulletListItem:"List",numberedListItem:"List",checkListItem:"List",emptyDocument:void 0,new_comment:"Write a comment...",edit_comment:"Edit comment...",comment_reply:"Add comment..."},file_blocks:{image:{add_button_text:"Add image"},video:{add_button_text:"Add video"},audio:{add_button_text:"Add audio"},file:{add_button_text:"Add file"}},side_menu:{add_block_label:"Add block",drag_handle_label:"Open block menu"},drag_handle:{delete_menuitem:"Delete",colors_menuitem:"Colors",header_row_menuitem:"Header row",header_column_menuitem:"Header column"},table_handle:{delete_column_menuitem:"Delete column",delete_row_menuitem:"Delete row",add_left_menuitem:"Add column left",add_right_menuitem:"Add column right",add_above_menuitem:"Add row above",add_below_menuitem:"Add row below",split_cell_menuitem:"Split cell",merge_cells_menuitem:"Merge cells",background_color_menuitem:"Background color"},suggestion_menu:{no_items_title:"No items found",loading:"Loading…"},color_picker:{text_title:"Text",background_title:"Background",colors:{default:"Default",gray:"Gray",brown:"Brown",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",pink:"Pink"}},formatting_toolbar:{bold:{tooltip:"Bold",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italic",secondary_tooltip:"Mod+I"},underline:{tooltip:"Underline",secondary_tooltip:"Mod+U"},strike:{tooltip:"Strike",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Colors"},link:{tooltip:"Create link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Edit caption",input_placeholder:"Edit caption"},file_replace:{tooltip:{image:"Replace image",video:"Replace video",audio:"Replace audio",file:"Replace file"}},file_rename:{tooltip:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"},input_placeholder:{image:"Rename image",video:"Rename video",audio:"Rename audio",file:"Rename file"}},file_download:{tooltip:{image:"Download image",video:"Download video",audio:"Download audio",file:"Download file"}},file_delete:{tooltip:{image:"Delete image",video:"Delete video",audio:"Delete audio",file:"Delete file"}},file_preview_toggle:{tooltip:"Toggle preview"},nest:{tooltip:"Nest block",secondary_tooltip:"Tab"},unnest:{tooltip:"Unnest block",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Align text left"},align_center:{tooltip:"Align text center"},align_right:{tooltip:"Align text right"},align_justify:{tooltip:"Justify text"},table_cell_merge:{tooltip:"Merge cells"},comment:{tooltip:"Add comment"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload image",video:"Upload video",audio:"Upload audio",file:"Upload file"},upload_error:"Error: Upload failed"},embed:{title:"Embed",embed_button:{image:"Embed image",video:"Embed video",audio:"Embed audio",file:"Embed file"},url_placeholder:"Enter URL"}},link_toolbar:{delete:{tooltip:"Remove link"},edit:{text:"Edit link",tooltip:"Edit"},open:{tooltip:"Open in new tab"},form:{title_placeholder:"Edit title",url_placeholder:"Edit URL"}},comments:{actions:{add_reaction:"Add reaction",resolve:"Resolve",edit_comment:"Edit comment",delete_comment:"Delete comment",more_actions:"More actions"},reactions:{reacted_by:"Reacted by"},sidebar:{marked_as_resolved:"Marked as resolved",more_replies:e=>`${e} more replies`}},generic:{ctrl_shortcut:"Ctrl"}},Cn={slash_menu:{heading:{title:"Encabezado 1",subtext:"Encabezado de primer nivel",aliases:["h","encabezado1","h1"],group:"Encabezados"},heading_2:{title:"Encabezado 2",subtext:"Encabezado de sección principal",aliases:["h2","encabezado2","subencabezado"],group:"Encabezados"},heading_3:{title:"Encabezado 3",subtext:"Encabezado de subsección y grupo",aliases:["h3","encabezado3","subencabezado"],group:"Encabezados"},numbered_list:{title:"Lista Numerada",subtext:"Lista con elementos ordenados",aliases:["ol","li","lista","lista numerada"],group:"Bloques básicos"},bullet_list:{title:"Lista con Viñetas",subtext:"Lista con elementos no ordenados",aliases:["ul","li","lista","lista con viñetas"],group:"Bloques básicos"},check_list:{title:"Lista de Verificación",subtext:"Lista con casillas de verificación",aliases:["ul","li","lista","lista de verificación","lista de chequeo","checkbox"],group:"Bloques básicos"},paragraph:{title:"Párrafo",subtext:"El cuerpo de tu documento",aliases:["p","párrafo"],group:"Bloques básicos"},code_block:{title:"Bloque de Código",subtext:"Bloque de código con resaltado de sintaxis",aliases:["code","pre"],group:"Bloques básicos"},page_break:{title:"Salto de página",subtext:"Separador de página",aliases:["page","break","separator","salto","separador"],group:"Bloques básicos"},table:{title:"Tabla",subtext:"Tabla con celdas editables",aliases:["tabla"],group:"Avanzado"},image:{title:"Imagen",subtext:"Imagen redimensionable con leyenda",aliases:["imagen","subir imagen","cargar","img","foto","media","url"],group:"Medios"},video:{title:"Vídeo",subtext:"Vídeo redimensionable con leyenda",aliases:["video","subir vídeo","cargar","mp4","película","media","url"],group:"Medios"},audio:{title:"Audio",subtext:"Audio incrustado con leyenda",aliases:["audio","subir audio","cargar","mp3","sonido","media","url"],group:"Medios"},file:{title:"Archivo",subtext:"Archivo incrustado",aliases:["archivo","cargar","incrustar","media","url"],group:"Medios"},emoji:{title:"Emoji",subtext:"Busca e inserta un emoji",aliases:["emoji","emoticono","emoción","cara"],group:"Otros"}},placeholders:{default:"Escribe o teclea '/' para comandos",heading:"Encabezado",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista",new_comment:"Escribe un comentario...",edit_comment:"Editar comentario...",comment_reply:"Agregar comentario..."},file_blocks:{image:{add_button_text:"Agregar imagen"},video:{add_button_text:"Agregar vídeo"},audio:{add_button_text:"Agregar audio"},file:{add_button_text:"Agregar archivo"}},side_menu:{add_block_label:"Agregar bloque",drag_handle_label:"Abrir menú de bloque"},drag_handle:{delete_menuitem:"Eliminar",colors_menuitem:"Colores",header_row_menuitem:"Fila de encabezado",header_column_menuitem:"Columna de encabezado"},table_handle:{delete_column_menuitem:"Eliminar columna",delete_row_menuitem:"Eliminar fila",add_left_menuitem:"Agregar columna a la izquierda",add_right_menuitem:"Agregar columna a la derecha",add_above_menuitem:"Agregar fila arriba",add_below_menuitem:"Agregar fila abajo",split_cell_menuitem:"Dividir celda",merge_cells_menuitem:"Combinar celdas",background_color_menuitem:"Color de fondo"},suggestion_menu:{no_items_title:"No se encontraron elementos",loading:"Cargando…"},color_picker:{text_title:"Texto",background_title:"Fondo",colors:{default:"Por defecto",gray:"Gris",brown:"Marrón",red:"Rojo",orange:"Naranja",yellow:"Amarillo",green:"Verde",blue:"Azul",purple:"Morado",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrita",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursiva",secondary_tooltip:"Mod+I"},underline:{tooltip:"Subrayado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Tachado",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Colores"},link:{tooltip:"Crear enlace",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar leyenda",input_placeholder:"Editar leyenda"},file_replace:{tooltip:{image:"Reemplazar imagen",video:"Reemplazar vídeo",audio:"Reemplazar audio",file:"Reemplazar archivo"}},file_rename:{tooltip:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"},input_placeholder:{image:"Renombrar imagen",video:"Renombrar vídeo",audio:"Renombrar audio",file:"Renombrar archivo"}},file_download:{tooltip:{image:"Descargar imagen",video:"Descargar vídeo",audio:"Descargar audio",file:"Descargar archivo"}},file_delete:{tooltip:{image:"Eliminar imagen",video:"Eliminar vídeo",audio:"Eliminar audio",file:"Eliminar archivo"}},file_preview_toggle:{tooltip:"Alternar vista previa"},nest:{tooltip:"Anidar bloque",secondary_tooltip:"Tab"},unnest:{tooltip:"Desanidar bloque",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinear texto a la izquierda"},align_center:{tooltip:"Alinear texto al centro"},align_right:{tooltip:"Alinear texto a la derecha"},align_justify:{tooltip:"Justificar texto"},table_cell_merge:{tooltip:"Combinar celdas"},comment:{tooltip:"Añadir comentario"}},file_panel:{upload:{title:"Subir",file_placeholder:{image:"Subir imagen",video:"Subir vídeo",audio:"Subir audio",file:"Subir archivo"},upload_error:"Error: Fallo en la subida"},embed:{title:"Incrustar",embed_button:{image:"Incrustar imagen",video:"Incrustar vídeo",audio:"Incrustar audio",file:"Incrustar archivo"},url_placeholder:"Introduce la URL"}},link_toolbar:{delete:{tooltip:"Eliminar enlace"},edit:{text:"Editar enlace",tooltip:"Editar"},open:{tooltip:"Abrir en nueva pestaña"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},comments:{actions:{add_reaction:"Agregar reacción",resolve:"Resolver",edit_comment:"Editar comentario",delete_comment:"Eliminar comentario",more_actions:"Más acciones"},reactions:{reacted_by:"Reaccionado por"},sidebar:{marked_as_resolved:"Marcado como resuelto",more_replies:e=>`${e} respuestas más`}},generic:{ctrl_shortcut:"Ctrl"}},xn={slash_menu:{heading:{title:"Titre 1",subtext:"Utilisé pour un titre de premier niveau",aliases:["h","titre1","h1"],group:"Titres"},heading_2:{title:"Titre 2",subtext:"Titre de deuxième niveau Utilisé pour les sections clés",aliases:["h2","titre2","sous-titre"],group:"Titres"},heading_3:{title:"Titre 3",subtext:"Titre de troisième niveau utilisé pour les sous-sections et les titres de groupe",aliases:["h3","titre3","sous-titre"],group:"Titres"},numbered_list:{title:"Liste Numérotée",subtext:"Utilisé pour afficher une liste numérotée",aliases:["ol","li","liste","listenumérotée","liste numérotée"],group:"Blocs de base"},bullet_list:{title:"Liste à puces",subtext:"Utilisé pour afficher une liste à puce non numérotée",aliases:["ul","li","liste","listeàpuces","liste à puces","bullet points","bulletpoints"],group:"Blocs de base"},check_list:{title:"Liste de tâches",subtext:"Utilisé pour afficher une liste avec des cases à cocher",aliases:["ul","li","liste","liste de vérification","liste cochée","case à cocher","checklist","checkbox","check box","to do","todo"],group:"Blocs de base"},paragraph:{title:"Paragraphe",subtext:"Utilisé pour le corps de votre document",aliases:["p","paragraphe","texte"],group:"Blocs de base"},code_block:{title:"Bloc de code",subtext:"Bloc de code avec coloration syntaxique",aliases:["code","pre"],group:"Blocs de base"},page_break:{title:"Saut de page",subtext:"Séparateur de page",aliases:["page","break","separator","saut","séparateur"],group:"Blocs de base"},table:{title:"Tableau",subtext:"Utilisé pour les tableaux",aliases:["tableau","grille"],group:"Avancé"},image:{title:"Image",subtext:"Insérer une image",aliases:["image","uploadImage","télécharger image","téléverser image","uploader image","img","photo","média","url"],group:"Médias"},video:{title:"Vidéo",subtext:"Insérer une vidéo",aliases:["vidéo","télécharger vidéo","téléverser vidéo","mp4","film","média","url"],group:"Média"},audio:{title:"Audio",subtext:"Insérer un audio",aliases:["audio","télécharger audio","téléverser audio","mp3","son","média","url"],group:"Média"},file:{title:"Fichier",subtext:"Insérer un fichier",aliases:["fichier","téléverser fichier","intégrer fichier","insérer fichier","média","url"],group:"Média"},emoji:{title:"Emoji",subtext:"Utilisé pour insérer un emoji",aliases:["emoji","émoticône","émotion","visage","smiley"],group:"Autres"}},placeholders:{default:"Entrez du texte ou tapez '/' pour faire apparaître les options de mise en page",heading:"Titre",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste",new_comment:"Écrire un commentaire...",edit_comment:"Modifier le commentaire...",comment_reply:"Ajouter un commentaire..."},file_blocks:{image:{add_button_text:"Ajouter une image"},video:{add_button_text:"Ajouter une vidéo"},audio:{add_button_text:"Ajouter un audio"},file:{add_button_text:"Ajouter un fichier"}},side_menu:{add_block_label:"Ajouter un bloc",drag_handle_label:"Ouvrir le menu du bloc"},drag_handle:{delete_menuitem:"Supprimer",colors_menuitem:"Couleurs",header_row_menuitem:"En-tête de ligne",header_column_menuitem:"En-tête de colonne"},table_handle:{delete_column_menuitem:"Supprimer la colonne",delete_row_menuitem:"Supprimer la ligne",add_left_menuitem:"Ajouter une colonne à gauche",add_right_menuitem:"Ajouter une colonne à droite",add_above_menuitem:"Ajouter une ligne au-dessus",add_below_menuitem:"Ajouter une ligne en dessous",split_cell_menuitem:"Diviser la cellule",merge_cells_menuitem:"Fusionner les cellules",background_color_menuitem:"Couleur de fond"},suggestion_menu:{no_items_title:"Aucun élément trouvé",loading:"Chargement…"},color_picker:{text_title:"Texte",background_title:"Fond",colors:{default:"Défaut",gray:"Gris",brown:"Marron",red:"Rouge",orange:"Orange",yellow:"Jaune",green:"Vert",blue:"Bleu",purple:"Violet",pink:"Rose"}},formatting_toolbar:{bold:{tooltip:"Gras",secondary_tooltip:"Mod+B"},italic:{tooltip:"Italique",secondary_tooltip:"Mod+I"},underline:{tooltip:"Souligner",secondary_tooltip:"Mod+U"},strike:{tooltip:"Barré",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Couleurs"},link:{tooltip:"Créer un lien",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Modifier la légende",input_placeholder:"Modifier la légende"},file_replace:{tooltip:{image:"Remplacer l'image",video:"Remplacer la vidéo",audio:"Remplacer l'audio",file:"Remplacer le fichier"}},file_rename:{tooltip:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"},input_placeholder:{image:"Renommer l'image",video:"Renommer la vidéo",audio:"Renommer l'audio",file:"Renommer le fichier"}},file_download:{tooltip:{image:"Télécharger l'image",video:"Télécharger la vidéo",audio:"Télécharger l'audio",file:"Télécharger le fichier"}},file_delete:{tooltip:{image:"Supprimer l'image",video:"Supprimer la vidéo",audio:"Supprimer l'audio",file:"Supprimer le fichier"}},file_preview_toggle:{tooltip:"Basculer l'aperçu"},nest:{tooltip:"Augmenter le retrait du bloc",secondary_tooltip:"Tab"},unnest:{tooltip:"Diminuer le retait du bloc",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Aligner le texte à gauche"},align_center:{tooltip:"Aligner le texte au centre"},align_right:{tooltip:"Aligner le texte à droite"},align_justify:{tooltip:"Justifier le texte"},table_cell_merge:{tooltip:"Fusionner les cellules"},comment:{tooltip:"Ajouter un commentaire"}},file_panel:{upload:{title:"Télécharger",file_placeholder:{image:"Télécharger une image",video:"Télécharger une vidéo",audio:"Télécharger un fichier audio",file:"Télécharger un fichier"},upload_error:"Erreur : échec du téléchargement"},embed:{title:"Intégrer",embed_button:{image:"Intégrer une image",video:"Intégrer une vidéo",audio:"Intégrer un fichier audio",file:"Intégrer un fichier"},url_placeholder:"Entrez l'URL"}},link_toolbar:{delete:{tooltip:"Supprimer le lien"},edit:{text:"Modifier le lien",tooltip:"Modifier"},open:{tooltip:"Ouvrir dans un nouvel onglet"},form:{title_placeholder:"Modifier le titre",url_placeholder:"Modifier l'URL"}},comments:{actions:{add_reaction:"Ajouter une réaction",resolve:"Résoudre",edit_comment:"Modifier le commentaire",delete_comment:"Supprimer le commentaire",more_actions:"Plus d'actions"},reactions:{reacted_by:"Réagi par"},sidebar:{marked_as_resolved:"Marqué comme résolu",more_replies:e=>`${e} réponses de plus`}},generic:{ctrl_shortcut:"Ctrl"}},Sn={slash_menu:{heading:{title:"Naslov 1",subtext:"Glavni naslov",aliases:["h","naslov1","h1"],group:"Naslovi"},heading_2:{title:"Naslov 2",subtext:"Naslov poglavlja",aliases:["h2","naslov2","podnaslov"],group:"Naslovi"},heading_3:{title:"Naslov 3",subtext:"Naslov podpoglavlja",aliases:["h3","naslov3","podnaslov"],group:"Naslovi"},numbered_list:{title:"Numerirani popis",subtext:"Popis s numeriranim stavkama",aliases:["poredaniPopis","stavkaPopisa","popis","numeriraniPopis","numerirani popis"],group:"Osnovni blokovi"},bullet_list:{title:"Popis s oznakama",subtext:"Popis s grafičkim oznakama",aliases:["neporedaniPopis","stavkaPopisa","popis","popisSOznakama","popis s oznakama"],group:"Osnovni blokovi"},check_list:{title:"Check lista",subtext:"Popis s kućicama za označavanje",aliases:["neporedaniPopis","stavkaPopisa","popis","popisZaProvjeru","check lista","označeni popis","kućicaZaOznačavanje"],group:"Osnovni blokovi"},paragraph:{title:"Normalan tekst",subtext:"Tekst paragrafa",aliases:["p","paragraf"],group:"Osnovni blokovi"},table:{title:"Tablica",subtext:"Tablica s podesivim ćelijama",aliases:["tablica"],group:"Napredno"},code_block:{title:"Blok koda",subtext:"Blok koda sa sintaksnim isticanjem",aliases:["code","pre"],group:"Osnovni blokovi"},page_break:{title:"Prijelom stranice",subtext:"Razdjelnik stranice",aliases:["page","break","separator","prijelom","razdjelnik"],group:"Osnovni blokovi"},image:{title:"Slika",subtext:"Slika s podesivom veličinom i natpisom",aliases:["slika","učitavanjeSlike","učitaj","img","fotografija","medij","url"],group:"Mediji"},video:{title:"Video",subtext:"Video s podesivom veličinom i natpisom",aliases:["video","učitavanjeVidea","učitaj","mp4","film","medij","url"],group:"Mediji"},audio:{title:"Audio",subtext:"Audio s natpisom",aliases:["audio","učitavanjeAudija","učitaj","mp3","zvuk","medij","url"],group:"Mediji"},file:{title:"Datoteka",subtext:"Ugrađena datoteka",aliases:["datoteka","učitaj","ugradi","medij","url"],group:"Mediji"},emoji:{title:"Emoji",subtext:"Pretraži i umetni emoji",aliases:["emoji","emotikon","emocija","lice"],group:"Ostalo"}},placeholders:{default:"Unesi tekst ili upiši ‘/’ za naredbe",heading:"Naslov",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista",new_comment:"Napišite komentar...",edit_comment:"Uredi komentar...",comment_reply:"Dodaj komentar..."},file_blocks:{image:{add_button_text:"Dodaj sliku"},video:{add_button_text:"Dodaj video"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj datoteku"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Meni za dodavanje bloka"},drag_handle:{delete_menuitem:"Ukloni",colors_menuitem:"Boje",header_row_menuitem:"Zaglavni redak",header_column_menuitem:"Zaglavni stupac"},table_handle:{delete_column_menuitem:"Ukloni stupac",delete_row_menuitem:"Ukloni redak",add_left_menuitem:"Dodaj stupac lijevo",add_right_menuitem:"Dodaj stupac desno",add_above_menuitem:"Dodaj redak iznad",add_below_menuitem:"Dodaj redak ispod",split_cell_menuitem:"Podijeli ćeliju",merge_cells_menuitem:"Spoji ćelije",background_color_menuitem:"Boja pozadine"},suggestion_menu:{no_items_title:"Stavke nisu pronađene",loading:"Učitavanje…"},color_picker:{text_title:"Tekst",background_title:"Pozadina",colors:{default:"Zadano",gray:"Siva",brown:"Smeđa",red:"Crvena",orange:"Narančasta",yellow:"Žuta",green:"Zelena",blue:"Plava",purple:"Ljubičasta",pink:"Ružičasta"}},formatting_toolbar:{bold:{tooltip:"Podebljano",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kurziv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podcrtano",secondary_tooltip:"Mod+U"},strike:{tooltip:"Precrtano",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Boja"},link:{tooltip:"Kreiraj poveznicu",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Uredi natpis",input_placeholder:"Uredi natpis"},file_replace:{tooltip:{image:"Zamijeni sliku",video:"Zamijeni video",audio:"Zamijeni audio",file:"Zamijeni datoteku"}},file_rename:{tooltip:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"},input_placeholder:{image:"Preimenuj sliku",video:"Preimenuj video",audio:"Preimenuj audio",file:"Preimenuj datoteku"}},file_download:{tooltip:{image:"Preuzmi sliku",video:"Preuzmi video",audio:"Preuzmi audio",file:"Preuzmi datoteku"}},file_delete:{tooltip:{image:"Ukloni sliku",video:"Ukloni video",audio:"Ukloni audio",file:"Ukloni datoteku"}},file_preview_toggle:{tooltip:"Prikaži/sakrij pregled"},nest:{tooltip:"Ugnijezdi blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Razgnijezdi blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Poravnaj tekst lijevo"},align_center:{tooltip:"Poravnaj tekst po sredini"},align_right:{tooltip:"Poravnaj tekst desno"},align_justify:{tooltip:"Poravnaj tekst obostrano"},table_cell_merge:{tooltip:"Spoji ćelije"},comment:{tooltip:"Dodaj komentar"}},file_panel:{upload:{title:"Učitaj",file_placeholder:{image:"Učitaj sliku",video:"Učitaj video",audio:"Učitaj audio",file:"Učitaj datoteku"},upload_error:"Pogreška: Učitavanje nije uspjelo"},embed:{title:"Ugradi",embed_button:{image:"Ugradi sliku",video:"Ugradi video",audio:"Ugradi audio",file:"Ugradi datoteku"},url_placeholder:"Dodaj URL"}},link_toolbar:{delete:{tooltip:"Ukloni poveznicu"},edit:{text:"Uredi poveznicu",tooltip:"Uredi"},open:{tooltip:"Otvori u novoj kartici"},form:{title_placeholder:"Uredi naslov",url_placeholder:"Uredi URL"}},comments:{actions:{add_reaction:"Dodaj reakciju",resolve:"Riješi",edit_comment:"Uredi komentar",delete_comment:"Obriši komentar",more_actions:"Više radnji"},reactions:{reacted_by:"Reagirao/la"},sidebar:{marked_as_resolved:"Označeno kao riješeno",more_replies:e=>`${e} dodatnih odgovora`}},generic:{ctrl_shortcut:"Ctrl"}},En={slash_menu:{heading:{title:"Fyrirsögn 1",subtext:"Notað fyrir efstu fyrirsögn",aliases:["h","fyrirsogn1","h1"],group:"Fyrirsagnir"},heading_2:{title:"Fyrirsögn 2",subtext:"Notað fyrir lykilhluta",aliases:["h2","fyrirsogn2","undirfyrirsogn"],group:"Fyrirsagnir"},heading_3:{title:"Fyrirsögn 3",subtext:"Notað fyrir undirhluta og hópfyrirsagnir",aliases:["h3","fyrirsogn3","undirfyrirsogn"],group:"Fyrirsagnir"},numbered_list:{title:"Númeruð listi",subtext:"Notað til að birta númeraðan lista",aliases:["ol","li","listi","numeradurlisti"],group:"Grunnblokkar"},bullet_list:{title:"Punktalisti",subtext:"Notað til að birta óraðaðan lista",aliases:["ul","li","listi","punktalisti"],group:"Grunnblokkar"},check_list:{title:"Athugunarlisti",subtext:"Notað til að sýna lista með gátreitum",aliases:["ul","li","listi","athugunarlisti","merktur listi"],group:"Grunnblokkar"},paragraph:{title:"Málsgrein",subtext:"Notað fyrir meginmál skjalsins",aliases:["p","malsgrein"],group:"Grunnblokkar"},code_block:{title:"Kóðablokk",subtext:"Kóðablokkur með litskiptingu",aliases:["kóði","pre"],group:"Grunnblokkar"},page_break:{title:"Síðubrot",subtext:"Síðuskil",aliases:["page","break","separator","síðubrot","síðuskil"],group:"Grunnblokkir"},table:{title:"Tafla",subtext:"Notað fyrir töflur",aliases:["tafla"],group:"Ítarlegt"},image:{title:"Mynd",subtext:"Settu inn mynd",aliases:["mynd","myndaupphlaed","upphlaed","img","mynd","media","url"],group:"Miðlar"},video:{title:"Myndband",subtext:"Setja inn myndband",aliases:["myndband","videoUpphala","hlaða upp","mp4","kvikmynd","miðill","url"],group:"Miðill"},audio:{title:"Hljóð",subtext:"Setja inn hljóð",aliases:["hljóð","audioUpphala","hlaða upp","mp3","hljóð","miðill","url"],group:"Miðlar"},file:{title:"Skrá",subtext:"Setja inn skrá",aliases:["skrá","hlaða upp","fella inn","miðill","url"],group:"Miðlar"},emoji:{title:"Emoji",subtext:"Notað til að setja inn smámynd",aliases:["emoji","andlitsávísun","tilfinningar","andlit"],group:"Annað"}},placeholders:{default:"Sláðu inn texta eða skrifaðu '/' fyrir skipanir",heading:"Fyrirsögn",bulletListItem:"Listi",numberedListItem:"Listi",checkListItem:"Listi",new_comment:"Skrifaðu athugasemd...",edit_comment:"Breyta athugasemd...",comment_reply:"Bæta við athugasemd..."},file_blocks:{image:{add_button_text:"Bæta við mynd"},video:{add_button_text:"Bæta við myndbandi"},audio:{add_button_text:"Bæta við hljóði"},file:{add_button_text:"Bæta við skrá"}},side_menu:{add_block_label:"Bæta við blokki",drag_handle_label:"Opna blokkarvalmynd"},drag_handle:{delete_menuitem:"Eyða",colors_menuitem:"Litir",header_row_menuitem:"Höfuðröð",header_column_menuitem:"Höfuðdálkur"},table_handle:{delete_column_menuitem:"Eyða dálki",delete_row_menuitem:"Eyða röð",add_left_menuitem:"Bæta dálki við til vinstri",add_right_menuitem:"Bæta dálki við til hægri",add_above_menuitem:"Bæta röð við fyrir ofan",add_below_menuitem:"Bæta röð við fyrir neðan",split_cell_menuitem:"Splita dálk",merge_cells_menuitem:"Sameina dálka",background_color_menuitem:"Breyta bakgrunni"},suggestion_menu:{no_items_title:"Engir hlutir fundust",loading:"Hleður…"},color_picker:{text_title:"Texti",background_title:"Bakgrunnur",colors:{default:"Sjálfgefið",gray:"Grár",brown:"Brúnn",red:"Rauður",orange:"Appelsínugulur",yellow:"Gulur",green:"Grænn",blue:"Blár",purple:"Fjólublár",pink:"Bleikur"}},formatting_toolbar:{bold:{tooltip:"Feitletrað",secondary_tooltip:"Mod+B"},italic:{tooltip:"Skáletrað",secondary_tooltip:"Mod+I"},underline:{tooltip:"Undirstrikað",secondary_tooltip:"Mod+U"},strike:{tooltip:"Yfirstrikað",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kóði",secondary_tooltip:""},colors:{tooltip:"Litir"},link:{tooltip:"Búa til tengil",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Breyta myndatexta",input_placeholder:"Breyta myndatexta"},file_replace:{tooltip:{image:"Skipta um mynd",video:"Skipta um myndband",audio:"Skipta um hljóð",file:"Skipta um skrá"}},file_rename:{tooltip:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"},input_placeholder:{image:"Endurnefna mynd",video:"Endurnefna myndband",audio:"Endurnefna hljóð",file:"Endurnefna skrá"}},file_download:{tooltip:{image:"Sækja mynd",video:"Sækja myndband",audio:"Sækja hljóð",file:"Sækja skrá"}},file_delete:{tooltip:{image:"Eyða mynd",video:"Eyða myndbandi",audio:"Eyða hljóði",file:"Eyða skrá"}},file_preview_toggle:{tooltip:"Skipta um forskoðun"},nest:{tooltip:"Fella blokk saman",secondary_tooltip:"Tab"},unnest:{tooltip:"Afþýða blokk",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Vinstrijafna texta"},align_center:{tooltip:"Miðjustilla texta"},align_right:{tooltip:"Hægrijafna texta"},align_justify:{tooltip:"Jafna texta"},table_cell_merge:{tooltip:"Sameina dálka"},comment:{tooltip:"Bæta við athugasemd"}},file_panel:{upload:{title:"Hlaða upp",file_placeholder:{image:"Hlaða upp mynd",video:"Hlaða upp myndband",audio:"Hlaða upp hljóð",file:"Hlaða upp skrá"},upload_error:"Villa: Upphleðsla mistókst"},embed:{title:"Innsetja",embed_button:{image:"Innsetja mynd",video:"Innsetja myndband",audio:"Innsetja hljóð",file:"Innsetja skrá"},url_placeholder:"Sláðu inn URL"}},link_toolbar:{delete:{tooltip:"Fjarlægja tengil"},edit:{text:"Breyta tengli",tooltip:"Breyta"},open:{tooltip:"Opna í nýjum flipa"},form:{title_placeholder:"Breyta titli",url_placeholder:"Breyta URL"}},comments:{actions:{add_reaction:"Bæta við viðbrögðum",resolve:"Leysa",edit_comment:"Breyta athugasemd",delete_comment:"Eyða athugasemd",more_actions:"Fleiri aðgerðir"},reactions:{reacted_by:"Brást við af"},sidebar:{marked_as_resolved:"Merkt sem leyst",more_replies:e=>`${e} fleiri svör`}},generic:{ctrl_shortcut:"Ctrl"}},Bn={slash_menu:{heading:{title:"Intestazione 1",subtext:"Intestazione di primo livello",aliases:["h","intestazione1","h1"],group:"Intestazioni"},heading_2:{title:"Intestazione 2",subtext:"Intestazione di sezione chiave",aliases:["h2","intestazione2","sottotitolo"],group:"Intestazioni"},heading_3:{title:"Intestazione 3",subtext:"Intestazione di sottosezione e gruppo",aliases:["h3","intestazione3","sottotitolo"],group:"Intestazioni"},numbered_list:{title:"Elenco Numerato",subtext:"Elenco con elementi ordinati",aliases:["ol","li","elenco","elenconumerato","elenco numerato"],group:"Blocchi Base"},bullet_list:{title:"Elenco Puntato",subtext:"Elenco con elementi non ordinati",aliases:["ul","li","elenco","elencopuntato","elenco puntato"],group:"Blocchi Base"},check_list:{title:"Elenco di Controllo",subtext:"Elenco con caselle di controllo",aliases:["ul","li","elenco","elencocontrollo","elenco controllo","elenco verificato","casella di controllo"],group:"Blocchi Base"},paragraph:{title:"Paragrafo",subtext:"Il corpo del tuo documento",aliases:["p","paragrafo"],group:"Blocchi Base"},code_block:{title:"Blocco di Codice",subtext:"Blocco di codice con evidenziazione della sintassi",aliases:["code","pre"],group:"Blocchi Base"},page_break:{title:"Interruzione di Pagina",subtext:"Separatore di pagina",aliases:["pagina","interruzione","separatore"],group:"Blocchi base"},table:{title:"Tabella",subtext:"Tabella con celle modificabili",aliases:["tabella"],group:"Avanzato"},image:{title:"Immagine",subtext:"Immagine ridimensionabile con didascalia",aliases:["immagine","caricaImmagine","carica","img","foto","media","url"],group:"Media"},video:{title:"Video",subtext:"Video ridimensionabile con didascalia",aliases:["video","caricaVideo","carica","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Audio incorporato con didascalia",aliases:["audio","caricaAudio","carica","mp3","suono","media","url"],group:"Media"},file:{title:"File",subtext:"File incorporato",aliases:["file","carica","embed","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Cerca e inserisci un'emoji",aliases:["emoji","emote","emozione","faccia"],group:"Altri"}},placeholders:{default:"Inserisci testo o digita '/' per i comandi",heading:"Intestazione",bulletListItem:"Elenco",numberedListItem:"Elenco",checkListItem:"Elenco",new_comment:"Scrivi un commento...",edit_comment:"Modifica commento...",comment_reply:"Aggiungi commento..."},file_blocks:{image:{add_button_text:"Aggiungi immagine"},video:{add_button_text:"Aggiungi video"},audio:{add_button_text:"Aggiungi audio"},file:{add_button_text:"Aggiungi file"}},side_menu:{add_block_label:"Aggiungi blocco",drag_handle_label:"Apri menu blocco"},drag_handle:{delete_menuitem:"Elimina",colors_menuitem:"Colori",header_row_menuitem:"Riga intestazione",header_column_menuitem:"Colonna intestazione"},table_handle:{delete_column_menuitem:"Elimina colonna",delete_row_menuitem:"Elimina riga",add_left_menuitem:"Aggiungi colonna a sinistra",add_right_menuitem:"Aggiungi colonna a destra",add_above_menuitem:"Aggiungi riga sopra",add_below_menuitem:"Aggiungi riga sotto",split_cell_menuitem:"Dividi cella",merge_cells_menuitem:"Unisci celle",background_color_menuitem:"Colore di sfondo"},suggestion_menu:{no_items_title:"Nessun elemento trovato",loading:"Caricamento…"},color_picker:{text_title:"Testo",background_title:"Sfondo",colors:{default:"Predefinito",gray:"Grigio",brown:"Marrone",red:"Rosso",orange:"Arancione",yellow:"Giallo",green:"Verde",blue:"Blu",purple:"Viola",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Grassetto",secondary_tooltip:"Cmd+B"},italic:{tooltip:"Corsivo",secondary_tooltip:"Cmd+I"},underline:{tooltip:"Sottolineato",secondary_tooltip:"Cmd+U"},strike:{tooltip:"Barrato",secondary_tooltip:"Cmd+Shift+S"},code:{tooltip:"Codice",secondary_tooltip:""},colors:{tooltip:"Colori"},link:{tooltip:"Crea link",secondary_tooltip:"Cmd+K"},file_caption:{tooltip:"Modifica didascalia",input_placeholder:"Modifica didascalia"},file_replace:{tooltip:{image:"Sostituisci immagine",video:"Sostituisci video",audio:"Sostituisci audio",file:"Sostituisci file"}},file_rename:{tooltip:{image:"Rinomina immagine",video:"Rinomina video",audio:"Rinomina audio",file:"Rinomina file"},input_placeholder:{image:"Rinomina immagine",video:"Rinomina video",audio:"Rinomina audio",file:"Rinomina file"}},file_download:{tooltip:{image:"Scarica immagine",video:"Scarica video",audio:"Scarica audio",file:"Scarica file"}},file_delete:{tooltip:{image:"Elimina immagine",video:"Elimina video",audio:"Elimina audio",file:"Elimina file"}},file_preview_toggle:{tooltip:"Attiva/disattiva anteprima"},nest:{tooltip:"Annida blocco",secondary_tooltip:"Tab"},unnest:{tooltip:"Disannida blocco",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Allinea testo a sinistra"},align_center:{tooltip:"Allinea testo al centro"},align_right:{tooltip:"Allinea testo a destra"},align_justify:{tooltip:"Giustifica testo"},table_cell_merge:{tooltip:"Unisci celle"},comment:{tooltip:"Aggiungi commento"}},file_panel:{upload:{title:"Carica",file_placeholder:{image:"Carica immagine",video:"Carica video",audio:"Carica audio",file:"Carica file"},upload_error:"Errore: Caricamento fallito"},embed:{title:"Incorpora",embed_button:{image:"Incorpora immagine",video:"Incorpora video",audio:"Incorpora audio",file:"Incorpora file"},url_placeholder:"Inserisci URL"}},link_toolbar:{delete:{tooltip:"Rimuovi link"},edit:{text:"Modifica link",tooltip:"Modifica"},open:{tooltip:"Apri in una nuova scheda"},form:{title_placeholder:"Modifica titolo",url_placeholder:"Modifica URL"}},comments:{actions:{add_reaction:"Aggiungi reazione",resolve:"Risolvi",edit_comment:"Modifica commento",delete_comment:"Elimina commento",more_actions:"Altre azioni"},reactions:{reacted_by:"Reagito da"},sidebar:{marked_as_resolved:"Contrassegnato come risolto",more_replies:e=>`${e} altre risposte`}},generic:{ctrl_shortcut:"Ctrl"}},Tn={slash_menu:{heading:{title:"見出し1",subtext:"トップレベルの見出しに使用",aliases:["h","見出し1","h1","大見出し"],group:"見出し"},heading_2:{title:"見出し2",subtext:"重要なセクションに使用",aliases:["h2","見出し2","subheading","中見出し"],group:"見出し"},heading_3:{title:"見出し3",subtext:"セクションやグループの見出しに使用",aliases:["h3","見出し3","subheading","小見出し"],group:"見出し"},numbered_list:{title:"番号付リスト",subtext:"番号付リストを表示するために使用",aliases:["ol","li","numberedlist","numbered list","リスト","番号付リスト","番号 リスト"],group:"基本ブロック"},bullet_list:{title:"箇条書き",subtext:"箇条書きを表示するために使用",aliases:["ul","li","bulletlist","bullet list","リスト","箇条書きリスト"],group:"基本ブロック"},check_list:{title:"チェックリスト",subtext:"チェックボックス付きリストを表示するために使用されます",aliases:["ul","li","list","checklist","checked list","リスト","チェックリスト","チェックされたリスト"],group:"基本ブロック"},paragraph:{title:"標準テキスト",subtext:"本文に使用",aliases:["p","paragraph","標準テキスト"],group:"基本ブロック"},code_block:{title:"コードブロック",subtext:"シンタックスハイライト付きのコードブロック",aliases:["code","pre","コード","コードブロック"],group:"基本ブロック"},page_break:{title:"改ページ",subtext:"ページ区切り",aliases:["page","break","separator","改ページ","区切り"],group:"基本ブロック"},table:{title:"表",subtext:"表に使用",aliases:["table","表","テーブル"],group:"高度なブロック"},image:{title:"画像",subtext:"画像を挿入",aliases:["image","imageUpload","upload","img","picture","media","url","画像"],group:"メディア"},video:{title:"ビデオ",subtext:"ビデオを挿入",aliases:["video","videoUpload","upload","mp4","film","media","url","ビデオ"],group:"メディア"},audio:{title:"オーディオ",subtext:"オーディオを挿入",aliases:["audio","audioUpload","upload","mp3","sound","media","url","オーディオ"],group:"メディア"},file:{title:"ファイル",subtext:"ファイルを挿入",aliases:["file","upload","embed","media","url","ファイル"],group:"メディア"},emoji:{title:"絵文字",subtext:"絵文字を挿入するために使用します",aliases:["絵文字","顔文字","感情表現","顔"],group:"その他"}},placeholders:{default:"テキストを入力するか'/' を入力してコマンド選択",heading:"見出し",bulletListItem:"リストを追加",numberedListItem:"リストを追加",checkListItem:"リストを追加",new_comment:"コメントを書く...",edit_comment:"コメントを編集...",comment_reply:"コメントを追加..."},file_blocks:{image:{add_button_text:"画像を追加"},video:{add_button_text:"ビデオを追加"},audio:{add_button_text:"オーディオを追加"},file:{add_button_text:"ファイルを追加"}},side_menu:{add_block_label:"ブロックを追加",drag_handle_label:"ブロックメニュー"},drag_handle:{delete_menuitem:"削除",colors_menuitem:"色を変更",header_row_menuitem:"行の見出し",header_column_menuitem:"列の見出し"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_menuitem:"下に行を追加",split_cell_menuitem:"セルを分割",merge_cells_menuitem:"セルを結合",background_color_menuitem:"背景色を変更"},suggestion_menu:{no_items_title:"アイテムが見つかりません",loading:"読込中…"},color_picker:{text_title:"文字色",background_title:"背景色",colors:{default:"デフォルト",gray:"グレー",brown:"茶色",red:"赤",orange:"オレンジ",yellow:"黄色",green:"緑",blue:"青",purple:"紫",pink:"ピンク"}},formatting_toolbar:{bold:{tooltip:"太字",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下線",secondary_tooltip:"Mod+U"},strike:{tooltip:"打ち消し",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"コード",secondary_tooltip:""},colors:{tooltip:"色"},link:{tooltip:"リンク",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"キャプションを編集",input_placeholder:"キャプションを編集"},file_replace:{tooltip:{image:"画像を置換",video:"ビデオを置換",audio:"オーディオを置換",file:"ファイルを置換"}},file_rename:{tooltip:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"},input_placeholder:{image:"画像の名前を変更",video:"ビデオの名前を変更",audio:"オーディオの名前を変更",file:"ファイルの名前を変更"}},file_download:{tooltip:{image:"画像をダウンロード",video:"ビデオをダウンロード",audio:"オーディオをダウンロード",file:"ファイルをダウンロード"}},file_delete:{tooltip:{image:"画像を削除",video:"ビデオを削除",audio:"オーディオを削除",file:"ファイルを削除"}},file_preview_toggle:{tooltip:"プレビューの切り替え"},nest:{tooltip:"インデント増",secondary_tooltip:"Tab"},unnest:{tooltip:"インデント減",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左揃え"},align_center:{tooltip:"中央揃え"},align_right:{tooltip:"右揃え"},align_justify:{tooltip:"両端揃え"},table_cell_merge:{tooltip:"セルを結合"},comment:{tooltip:"コメントを追加"}},file_panel:{upload:{title:"アップロード",file_placeholder:{image:"画像をアップロード",video:"ビデオをアップロード",audio:"オーディオをアップロード",file:"ファイルをアップロード"},upload_error:"エラー: アップロードが失敗しました"},embed:{title:"埋め込み",embed_button:{image:"画像を埋め込む",video:"ビデオを埋め込む",audio:"オーディオを埋め込む",file:"ファイルを埋め込む"},url_placeholder:"URLを入力"}},link_toolbar:{delete:{tooltip:"リンクを解除"},edit:{text:"リンクを編集",tooltip:"編集"},open:{tooltip:"新しいタブでリンクを開く"},form:{title_placeholder:"タイトルを編集",url_placeholder:"URLを編集"}},comments:{actions:{add_reaction:"リアクションを追加",resolve:"解決",edit_comment:"コメントを編集",delete_comment:"コメントを削除",more_actions:"その他の操作"},reactions:{reacted_by:"リアクションした人"},sidebar:{marked_as_resolved:"解決済みとしてマーク",more_replies:e=>`${e} 件の追加返信`}},generic:{ctrl_shortcut:"Ctrl"}},Mn={slash_menu:{heading:{title:"제목1",subtext:"섹션 제목(대)",aliases:["h","제목1","h1","대제목"],group:"제목"},heading_2:{title:"제목2",subtext:"섹션 제목(중)",aliases:["h2","제목2","중제목"],group:"제목"},heading_3:{title:"제목3",subtext:"섹션 제목(소)",aliases:["h3","제목3","subheading"],group:"제목"},numbered_list:{title:"번호 매기기 목록",subtext:"번호가 매겨진 목록을 추가합니다.",aliases:["ol","li","목록","번호 매기기 목록","번호 목록"],group:"기본 블록"},bullet_list:{title:"글머리 기호 목록",subtext:"간단한 글머리 기호를 추가합니다.",aliases:["ul","li","목록","글머리 기호 목록","글머리 목록"],group:"기본 블록"},check_list:{title:"체크리스트",subtext:"체크박스가 있는 목록을 표시하는 데 사용",aliases:["ul","li","목록","체크리스트","체크 리스트","체크된 목록","체크박스"],group:"기본 블록"},paragraph:{title:"본문",subtext:"일반 텍스트",aliases:["p","paragraph","본문"],group:"기본 블록"},code_block:{title:"코드 블록",subtext:"구문 강조가 있는 코드 블록",aliases:["code","pre"],group:"기본 블록"},page_break:{title:"페이지 나누기",subtext:"페이지 구분자",aliases:["page","break","separator","페이지","구분자"],group:"기본 블록"},table:{title:"표",subtext:"간단한 표를 추가합니다.",aliases:["표"],group:"고급"},image:{title:"이미지",subtext:"이미지 파일을 업로드합니다.",aliases:["image","imageUpload","upload","img","picture","media","이미지","url"],group:"미디어"},video:{title:"비디오",subtext:"비디오 삽입",aliases:["video","videoUpload","upload","mp4","film","media","동영상","url"],group:"미디어"},audio:{title:"오디오",subtext:"오디오 삽입",aliases:["audio","audioUpload","upload","mp3","sound","media","오디오","url"],group:"미디어"},file:{title:"파일",subtext:"파일 삽입",aliases:["file","upload","embed","media","파일","url"],group:"미디어"},emoji:{title:"이모지",subtext:"이모지 삽입용으로 사용됩니다",aliases:["이모지","emoji","감정 표현","emotion expression","표정","face expression","얼굴","face"],group:"기타"}},placeholders:{default:"텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.",heading:"제목",bulletListItem:"목록",numberedListItem:"목록",checkListItem:"목록",new_comment:"댓글 작성...",edit_comment:"댓글 수정...",comment_reply:"댓글 추가..."},file_blocks:{image:{add_button_text:"이미지 추가"},video:{add_button_text:"비디오 추가"},audio:{add_button_text:"오디오 추가"},file:{add_button_text:"파일 추가"}},side_menu:{add_block_label:"블록 추가",drag_handle_label:"블록 메뉴 열기"},drag_handle:{delete_menuitem:"삭제",colors_menuitem:"색깔",header_row_menuitem:"행 제목",header_column_menuitem:"열 제목"},table_handle:{delete_column_menuitem:"열 1개 삭제",delete_row_menuitem:"행 삭제",add_left_menuitem:"왼쪽에 열 1개 추가",add_right_menuitem:"오른쪽에 열 1개 추가",add_above_menuitem:"위에 행 1개 추가",add_below_menuitem:"아래에 행 1개 추가",split_cell_menuitem:"셀 분할",merge_cells_menuitem:"셀 병합",background_color_menuitem:"배경색 변경"},suggestion_menu:{no_items_title:"항목을 찾을 수 없음",loading:"로딩 중…"},color_picker:{text_title:"텍스트",background_title:"배경",colors:{default:"기본",gray:"회색",brown:"갈색",red:"빨간색",orange:"주황색",yellow:"노란색",green:"녹색",blue:"파란색",purple:"보라색",pink:"분홍색"}},formatting_toolbar:{bold:{tooltip:"진하게",secondary_tooltip:"Mod+B"},italic:{tooltip:"기울임",secondary_tooltip:"Mod+I"},underline:{tooltip:"밑줄",secondary_tooltip:"Mod+U"},strike:{tooltip:"취소선",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"코드",secondary_tooltip:""},colors:{tooltip:"색깔"},link:{tooltip:"링크 만들기",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"이미지 캡션 수정",input_placeholder:"이미지 캡션 수정"},file_replace:{tooltip:{image:"이미지 교체",video:"비디오 교체",audio:"오디오 교체",file:"파일 교체"}},file_rename:{tooltip:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"},input_placeholder:{image:"이미지 이름 변경",video:"비디오 이름 변경",audio:"오디오 이름 변경",file:"파일 이름 변경"}},file_download:{tooltip:{image:"이미지 다운로드",video:"비디오 다운로드",audio:"오디오 다운로드",file:"파일 다운로드"}},file_delete:{tooltip:{image:"이미지 삭제",video:"비디오 삭제",audio:"오디오 삭제",file:"파일 삭제"}},file_preview_toggle:{tooltip:"미리보기 전환"},nest:{tooltip:"중첩 블록",secondary_tooltip:"Tab"},unnest:{tooltip:"비중첩 블록",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"텍스트 왼쪽 맞춤"},align_center:{tooltip:"텍스트 가운데 맞춤"},align_right:{tooltip:"텍스트 오른쪽 맞춤"},align_justify:{tooltip:"텍스트 양쪽 맞춤"},table_cell_merge:{tooltip:"셀 병합"},comment:{tooltip:"코멘트 추가"}},file_panel:{upload:{title:"업로드",file_placeholder:{image:"이미지 업로드",video:"비디오 업로드",audio:"오디오 업로드",file:"파일 업로드"},upload_error:"오류: 업로드 실패"},embed:{title:"임베드",embed_button:{image:"이미지 삽입",video:"비디오 삽입",audio:"오디오 삽입",file:"파일 삽입"},url_placeholder:"URL을 입력하세요."}},link_toolbar:{delete:{tooltip:"링크 삭제"},edit:{text:"링크 수정",tooltip:"수정"},open:{tooltip:"새 탭으로 열기"},form:{title_placeholder:"제목 수정",url_placeholder:"URL 수정"}},comments:{actions:{add_reaction:"반응 추가",resolve:"해결",edit_comment:"댓글 수정",delete_comment:"댓글 삭제",more_actions:"더 많은 작업"},reactions:{reacted_by:"반응한 사람"},sidebar:{marked_as_resolved:"해결됨으로 표시됨",more_replies:e=>`${e}개의 추가 답글`}},generic:{ctrl_shortcut:"Ctrl"}},In={slash_menu:{heading:{title:"Kop 1",subtext:"Gebruikt voor een hoofdkop",aliases:["h","kop1","h1"],group:"Koppen"},heading_2:{title:"Kop 2",subtext:"Gebruikt voor belangrijke secties",aliases:["h2","kop2","subkop"],group:"Koppen"},heading_3:{title:"Kop 3",subtext:"Gebruikt voor subsecties en groepskoppen",aliases:["h3","kop3","subkop"],group:"Koppen"},numbered_list:{title:"Genummerde Lijst",subtext:"Gebruikt om een genummerde lijst weer te geven",aliases:["ol","li","lijst","genummerdelijst","genummerde lijst"],group:"Basisblokken"},bullet_list:{title:"Puntenlijst",subtext:"Gebruikt om een ongeordende lijst weer te geven",aliases:["ul","li","lijst","puntenlijst","punten lijst"],group:"Basisblokken"},check_list:{title:"Controlelijst",subtext:"Gebruikt om een lijst met selectievakjes weer te geven",aliases:["ul","li","lijst","aangevinkte lijst","selectievakje"],group:"Basisblokken"},paragraph:{title:"Paragraaf",subtext:"Gebruikt voor de hoofdtekst van uw document",aliases:["p","paragraaf"],group:"Basisblokken"},code_block:{title:"Codeblok",subtext:"Codeblok met syntax highlighting",aliases:["code","pre"],group:"Basisblokken"},page_break:{title:"Pagina-einde",subtext:"Paginascheiding",aliases:["page","break","separator","pagina","scheiding"],group:"Basisblokken"},table:{title:"Tabel",subtext:"Gebruikt voor tabellen",aliases:["tabel"],group:"Geavanceerd"},image:{title:"Afbeelding",subtext:"Voeg een afbeelding in",aliases:["afbeelding","imageUpload","upload","img","foto","media","url"],group:"Media"},video:{title:"Video",subtext:"Voeg een video in",aliases:["video","videoUploaden","upload","mp4","film","media","url","drive","dropbox"],group:"Media"},audio:{title:"Audio",subtext:"Voeg audio in",aliases:["audio","audioUploaden","upload","mp3","geluid","media","url"],group:"Media"},file:{title:"Bestand",subtext:"Voeg een bestand in",aliases:["bestand","upload","insluiten","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Gebruikt voor het invoegen van een emoji",aliases:["emoji","emotie-uitdrukking","gezichtsuitdrukking","gezicht"],group:"Overig"}},placeholders:{default:"Voer tekst in of type '/' voor commando's",heading:"Kop",bulletListItem:"Lijst",numberedListItem:"Lijst",checkListItem:"Lijst",new_comment:"Schrijf een reactie...",edit_comment:"Reactie bewerken...",comment_reply:"Reactie toevoegen..."},file_blocks:{image:{add_button_text:"Afbeelding toevoegen"},video:{add_button_text:"Video toevoegen"},audio:{add_button_text:"Audio toevoegen"},file:{add_button_text:"Bestand toevoegen"}},side_menu:{add_block_label:"Nieuw blok",drag_handle_label:"Open blok menu"},drag_handle:{delete_menuitem:"Verwijder",colors_menuitem:"Kleuren",header_row_menuitem:"Kopregel",header_column_menuitem:"Kopkolom"},table_handle:{delete_column_menuitem:"Verwijder kolom",delete_row_menuitem:"Verwijder rij",add_left_menuitem:"Voeg kolom links toe",add_right_menuitem:"Voeg kolom rechts toe",add_above_menuitem:"Voeg rij boven toe",add_below_menuitem:"Voeg rij onder toe",split_cell_menuitem:"Splits cel",merge_cells_menuitem:"Voeg cellen samen",background_color_menuitem:"Achtergrondkleur wijzigen"},suggestion_menu:{no_items_title:"Geen items gevonden",loading:"Laden…"},color_picker:{text_title:"Tekst",background_title:"Achtergrond",colors:{default:"Standaard",gray:"Grijs",brown:"Bruin",red:"Rood",orange:"Oranje",yellow:"Geel",green:"Groen",blue:"Blauw",purple:"Paars",pink:"Roze"}},formatting_toolbar:{bold:{tooltip:"Vet",secondary_tooltip:"Mod+B"},italic:{tooltip:"Cursief",secondary_tooltip:"Mod+I"},underline:{tooltip:"Onderstrepen",secondary_tooltip:"Mod+U"},strike:{tooltip:"Doorstrepen",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Kleuren"},link:{tooltip:"Maak link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Bewerk onderschrift",input_placeholder:"Bewerk onderschrift"},file_replace:{tooltip:{image:"Afbeelding vervangen",video:"Video vervangen",audio:"Audio vervangen",file:"Bestand vervangen"}},file_rename:{tooltip:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"},input_placeholder:{image:"Afbeelding hernoemen",video:"Video hernoemen",audio:"Audio hernoemen",file:"Bestand hernoemen"}},file_download:{tooltip:{image:"Afbeelding downloaden",video:"Video downloaden",audio:"Audio downloaden",file:"Bestand downloaden"}},file_delete:{tooltip:{image:"Afbeelding verwijderen",video:"Video verwijderen",audio:"Audio verwijderen",file:"Bestand verwijderen"}},file_preview_toggle:{tooltip:"Voorbeeldschakelaar"},nest:{tooltip:"Nest blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Ontnest blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Tekst links uitlijnen"},align_center:{tooltip:"Tekst centreren"},align_right:{tooltip:"Tekst rechts uitlijnen"},align_justify:{tooltip:"Tekst uitvullen"},table_cell_merge:{tooltip:"Voeg cellen samen"},comment:{tooltip:"Commentaar toevoegen"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Afbeelding uploaden",video:"Video uploaden",audio:"Audio uploaden",file:"Bestand uploaden"},upload_error:"Fout: Upload mislukt"},embed:{title:"Insluiten",embed_button:{image:"Afbeelding insluiten",video:"Video insluiten",audio:"Audio insluiten",file:"Bestand insluiten"},url_placeholder:"Voer URL in"}},link_toolbar:{delete:{tooltip:"Verwijder link"},edit:{text:"Bewerk link",tooltip:"Bewerk"},open:{tooltip:"Open in nieuw tabblad"},form:{title_placeholder:"Bewerk titel",url_placeholder:"Bewerk URL"}},comments:{actions:{add_reaction:"Reactie toevoegen",resolve:"Oplossen",edit_comment:"Reactie bewerken",delete_comment:"Reactie verwijderen",more_actions:"Meer acties"},reactions:{reacted_by:"Gereageerd door"},sidebar:{marked_as_resolved:"Gemarkeerd als opgelost",more_replies:e=>`${e} extra reacties`}},generic:{ctrl_shortcut:"Ctrl"}},Ln={slash_menu:{heading:{title:"Overskrift 1",subtext:"Toppnivåoverskrift",aliases:["h","overskrift1","h1"],group:"Overskrifter"},heading_2:{title:"Overskrift 2",subtext:"Hovedseksjonsoverskrift",aliases:["h2","overskrift2","underoverskrift"],group:"Overskrifter"},heading_3:{title:"Overskrift 3",subtext:"Underseksjon og gruppeoverskrift",aliases:["h3","overskrift3","underoverskrift"],group:"Overskrifter"},numbered_list:{title:"Nummerert liste",subtext:"Liste med ordnede elementer",aliases:["ol","li","liste","nummerertliste","nummerert liste"],group:"Grunnleggende blokker"},bullet_list:{title:"Punktliste",subtext:"Liste med uordnede elementer",aliases:["ul","li","liste","punktliste","punkt liste"],group:"Grunnleggende blokker"},check_list:{title:"Sjekkliste",subtext:"Liste med avmerkingsbokser",aliases:["ul","li","liste","sjekkliste","sjekk liste","avmerket liste","avmerkingsboks"],group:"Grunnleggende blokker"},paragraph:{title:"Avsnitt",subtext:"Hoveddelen av dokumentet ditt",aliases:["p","avsnitt"],group:"Grunnleggende blokker"},code_block:{title:"Kodeblokk",subtext:"Kodeblokk med syntaksfremheving",aliases:["kode","pre"],group:"Grunnleggende blokker"},page_break:{title:"Sideskift",subtext:"Sideskilletegn",aliases:["side","skift","skilletegn"],group:"Grunnleggende blokker"},table:{title:"Tabell",subtext:"Tabell med redigerbare celler",aliases:["tabell"],group:"Avansert"},image:{title:"Bilde",subtext:"Justerbart bilde med bildetekst",aliases:["bilde","bildeopplasting","opplasting","img","bilde","media","url"],group:"Media"},video:{title:"Video",subtext:"Justerbar video med bildetekst",aliases:["video","videoopplasting","opplasting","mp4","film","media","url"],group:"Media"},audio:{title:"Lyd",subtext:"legg til lyd med bildetekst",aliases:["lyd","lydopplasting","opplasting","mp3","lyd","media","url"],group:"Media"},file:{title:"Fil",subtext:"Innebygd fil",aliases:["fil","opplasting","innebygd","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Søk etter og legg til en emoji",aliases:["emoji","emote","emosjon","ansikt"],group:"Andre"}},placeholders:{default:"Skriv tekst eller skriv '/' for å vise kommandoer",heading:"Overskrift",bulletListItem:"Liste",numberedListItem:"Liste",checkListItem:"Liste",new_comment:"Skriv en kommentar...",edit_comment:"Rediger kommentar...",comment_reply:"Legg til kommentar..."},file_blocks:{image:{add_button_text:"Legg til bilde"},video:{add_button_text:"Legg til video"},audio:{add_button_text:"Legg til lyd"},file:{add_button_text:"Legg til fil"}},side_menu:{add_block_label:"Legg til blokk",drag_handle_label:"Åpne blokkmeny"},drag_handle:{delete_menuitem:"Slett",colors_menuitem:"Farger",header_row_menuitem:"Rad overskrift",header_column_menuitem:"Kolonne overskrift"},table_handle:{delete_column_menuitem:"Slett kolonne",delete_row_menuitem:"Slett rad",add_left_menuitem:"Legg til kolonne til venstre",add_right_menuitem:"Legg til kolonne til høyre",add_above_menuitem:"Legg til rad over",add_below_menuitem:"Legg til rad under",split_cell_menuitem:"Del celle",merge_cells_menuitem:"Slå sammen celler",background_color_menuitem:"Bakgrunnsfarge"},suggestion_menu:{no_items_title:"Ingen elementer funnet",loading:"Laster…"},color_picker:{text_title:"Tekst",background_title:"Bakgrunn",colors:{default:"Standard",gray:"Grå",brown:"Brun",red:"Rød",orange:"Oransje",yellow:"Gul",green:"Grønn",blue:"Blå",purple:"Lilla",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Fet",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursiv",secondary_tooltip:"Mod+I"},underline:{tooltip:"Understrek",secondary_tooltip:"Mod+U"},strike:{tooltip:"Gjennomstrek",secondary_tooltip:"Mod+Shift+S"},code:{tooltip:"Kode",secondary_tooltip:""},colors:{tooltip:"Farger"},link:{tooltip:"Opprett lenke",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Rediger bildetekst",input_placeholder:"Rediger bildetekst"},file_replace:{tooltip:{image:"Bytt ut bilde",video:"Bytt ut video",audio:"Bytt ut lyd",file:"Bytt ut fil"}},file_rename:{tooltip:{image:"Endre navn på bilde",video:"Endre navn på video",audio:"Endre navn på lyd",file:"Endre navn på fil"},input_placeholder:{image:"Endre navn på bilde",video:"Endre navn på video",audio:"Endre navn på lyd",file:"Endre navn på fil"}},file_download:{tooltip:{image:"Last ned bilde",video:"Last ned video",audio:"Last ned lyd",file:"Last ned fil"}},file_delete:{tooltip:{image:"Slett bilde",video:"Slett video",audio:"Slett lyd",file:"Slett fil"}},file_preview_toggle:{tooltip:"Veksle forhåndsvisning"},nest:{tooltip:"Plasser blokk inni",secondary_tooltip:"Tab"},unnest:{tooltip:"Ta blokk ut",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Venstrejuster tekst"},align_center:{tooltip:"Midtstill tekst"},align_right:{tooltip:"Høyrejuster tekst"},align_justify:{tooltip:"Juster tekst"},comment:{tooltip:"Legg til kommentar"},table_cell_merge:{tooltip:"Slå sammen celler"}},file_panel:{upload:{title:"Last opp",file_placeholder:{image:"Last opp bilde",video:"Last opp video",audio:"Last opp lyd",file:"Last opp fil"},upload_error:"Feil: Opplasting mislyktes"},embed:{title:"Bygg inn",embed_button:{image:"Bygg inn bilde",video:"Bygg inn video",audio:"Bygg inn lyd",file:"Bygg inn fil"},url_placeholder:"Skriv inn URL"}},link_toolbar:{delete:{tooltip:"Fjern lenke"},edit:{text:"Rediger lenke",tooltip:"Rediger"},open:{tooltip:"Åpne i ny fane"},form:{title_placeholder:"Rediger tittel",url_placeholder:"Rediger URL"}},comments:{actions:{add_reaction:"Legg til reaksjon",resolve:"Løs",edit_comment:"Rediger kommentar",delete_comment:"Slett kommentar",more_actions:"Flere handlinger"},reactions:{reacted_by:"Reagert av"},sidebar:{marked_as_resolved:"Merket som løst",more_replies:e=>`${e} flere svar`}},generic:{ctrl_shortcut:"Ctrl"}},Pn={slash_menu:{heading:{title:"Nagłówek 1",subtext:"Używany dla nagłówka najwyższego poziomu",aliases:["h","naglowek1","h1"],group:"Nagłówki"},heading_2:{title:"Nagłówek 2",subtext:"Używany dla kluczowych sekcji",aliases:["h2","naglowek2","podnaglowek"],group:"Nagłówki"},heading_3:{title:"Nagłówek 3",subtext:"Używany dla podsekcji i grup nagłówków",aliases:["h3","naglowek3","podnaglowek"],group:"Nagłówki"},numbered_list:{title:"Lista numerowana",subtext:"Używana do wyświetlania listy numerowanej",aliases:["ol","li","lista","numerowana lista"],group:"Podstawowe bloki"},bullet_list:{title:"Lista punktowana",subtext:"Używana do wyświetlania listy bez numeracji",aliases:["ul","li","lista","punktowana lista"],group:"Podstawowe bloki"},check_list:{title:"Lista z polami wyboru",subtext:"Używana do wyświetlania listy z polami wyboru",aliases:["ul","li","lista","lista z polami wyboru","pole wyboru"],group:"Podstawowe bloki"},paragraph:{title:"Akapit",subtext:"Używany dla treści dokumentu",aliases:["p","akapit"],group:"Podstawowe bloki"},code_block:{title:"Blok kodu",subtext:"Blok kodu z podświetleniem składni",aliases:["kod","pre"],group:"Podstawowe bloki"},page_break:{title:"Podział strony",subtext:"Separator strony",aliases:["page","break","separator","podział","separator"],group:"Podstawowe bloki"},table:{title:"Tabela",subtext:"Używana do tworzenia tabel",aliases:["tabela"],group:"Zaawansowane"},image:{title:"Zdjęcie",subtext:"Wstaw zdjęcie",aliases:["obraz","wrzućZdjęcie","wrzuć","img","zdjęcie","media","url"],group:"Media"},video:{title:"Wideo",subtext:"Wstaw wideo",aliases:["wideo","wrzućWideo","wrzuć","mp4","film","media","url"],group:"Media"},audio:{title:"Audio",subtext:"Wstaw audio",aliases:["audio","wrzućAudio","wrzuć","mp3","dźwięk","media","url"],group:"Media"},file:{title:"Plik",subtext:"Wstaw plik",aliases:["plik","wrzuć","wstaw","media","url"],group:"Media"},emoji:{title:"Emoji",subtext:"Używane do wstawiania emoji",aliases:["emoji","emotka","wyrażenie emocji","twarz"],group:"Inne"}},placeholders:{default:"Wprowadź tekst lub wpisz '/' aby użyć poleceń",heading:"Nagłówek",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista",new_comment:"Napisz komentarz...",edit_comment:"Edytuj komentarz...",comment_reply:"Dodaj komentarz..."},file_blocks:{image:{add_button_text:"Dodaj zdjęcie"},video:{add_button_text:"Dodaj wideo"},audio:{add_button_text:"Dodaj audio"},file:{add_button_text:"Dodaj plik"}},side_menu:{add_block_label:"Dodaj blok",drag_handle_label:"Otwórz menu bloków"},drag_handle:{delete_menuitem:"Usuń",colors_menuitem:"Kolory",header_row_menuitem:"Nagłówek wiersza",header_column_menuitem:"Nagłówek kolumny"},table_handle:{delete_column_menuitem:"Usuń kolumnę",delete_row_menuitem:"Usuń wiersz",add_left_menuitem:"Dodaj kolumnę po lewej",add_right_menuitem:"Dodaj kolumnę po prawej",add_above_menuitem:"Dodaj wiersz powyżej",add_below_menuitem:"Dodaj wiersz poniżej",split_cell_menuitem:"Podziel komórkę",merge_cells_menuitem:"Połącz komórki",background_color_menuitem:"Zmień kolor tła"},suggestion_menu:{no_items_title:"Nie znaleziono elementów",loading:"Ładowanie…"},color_picker:{text_title:"Tekst",background_title:"Tło",colors:{default:"Domyślny",gray:"Szary",brown:"Brązowy",red:"Czerwony",orange:"Pomarańczowy",yellow:"Żółty",green:"Zielony",blue:"Niebieski",purple:"Fioletowy",pink:"Różowy"}},formatting_toolbar:{bold:{tooltip:"Pogrubienie",secondary_tooltip:"Mod+B"},italic:{tooltip:"Kursywa",secondary_tooltip:"Mod+I"},underline:{tooltip:"Podkreślenie",secondary_tooltip:"Mod+U"},strike:{tooltip:"Przekreślenie",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Kod",secondary_tooltip:""},colors:{tooltip:"Kolory"},link:{tooltip:"Utwórz link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Zmień podpis",input_placeholder:"Zmień podpis"},file_replace:{tooltip:{image:"Zmień obraz",video:"Zmień wideo",audio:"Zmień audio",file:"Zmień plik"}},file_rename:{tooltip:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"},input_placeholder:{image:"Zmień nazwę zdjęcia",video:"Zmień nazwę wideo",audio:"Zmień nazwę audio",file:"Zmień nazwę pliku"}},file_download:{tooltip:{image:"Pobierz zdjęcie",video:"Pobierz wideo",audio:"Pobierz audio",file:"Pobierz plik"}},file_delete:{tooltip:{image:"Usuń zdjęcie",video:"Usuń wideo",audio:"Usuń audio",file:"Usuń plik"}},file_preview_toggle:{tooltip:"Przełącz podgląd"},nest:{tooltip:"Zagnieźdź blok",secondary_tooltip:"Tab"},unnest:{tooltip:"Odgagnieźdź blok",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Wyrównaj tekst do lewej"},align_center:{tooltip:"Wyśrodkuj tekst"},align_right:{tooltip:"Wyrównaj tekst do prawej"},align_justify:{tooltip:"Wyjustuj tekst"},table_cell_merge:{tooltip:"Połącz komórki"},comment:{tooltip:"Dodaj komentarz"}},file_panel:{upload:{title:"Wrzuć",file_placeholder:{image:"Wrzuć zdjęcie",video:"Wrzuć wideo",audio:"Wrzuć audio",file:"Wrzuć plik"},upload_error:"Błąd: Przesyłanie nie powiodło się"},embed:{title:"Wstaw",embed_button:{image:"Wstaw zdjęice",video:"Wstaw wideo",audio:"Wstaw audio",file:"Wstaw plik"},url_placeholder:"Wprowadź URL"}},link_toolbar:{delete:{tooltip:"Usuń link"},edit:{text:"Edytuj link",tooltip:"Edytuj"},open:{tooltip:"Otwórz w nowej karcie"},form:{title_placeholder:"Edytuj tytuł",url_placeholder:"Edytuj URL"}},comments:{actions:{add_reaction:"Dodaj reakcję",resolve:"Rozwiąż",edit_comment:"Edytuj komentarz",delete_comment:"Usuń komentarz",more_actions:"Więcej akcji"},reactions:{reacted_by:"Zareagowali"},sidebar:{marked_as_resolved:"Oznaczone jako rozwiązane",more_replies:e=>`${e} więcej odpowiedzi`}},generic:{ctrl_shortcut:"Ctrl"}},An={slash_menu:{heading:{title:"Título",subtext:"Usado para um título de nível superior",aliases:["h","titulo1","h1"],group:"Títulos"},heading_2:{title:"Título 2",subtext:"Usado para seções principais",aliases:["h2","titulo2","subtitulo"],group:"Títulos"},heading_3:{title:"Título 3",subtext:"Usado para subseções e títulos de grupo",aliases:["h3","titulo3","subtitulo"],group:"Títulos"},numbered_list:{title:"Lista Numerada",subtext:"Usado para exibir uma lista numerada",aliases:["ol","li","lista","listanumerada","lista numerada"],group:"Blocos básicos"},bullet_list:{title:"Lista com Marcadores",subtext:"Usado para exibir uma lista não ordenada",aliases:["ul","li","lista","listamarcadores","lista com marcadores"],group:"Blocos básicos"},check_list:{title:"Lista de verificação",subtext:"Usado para exibir uma lista com caixas de seleção",aliases:["ul","li","lista","lista de verificação","lista marcada","caixa de seleção"],group:"Blocos básicos"},paragraph:{title:"Parágrafo",subtext:"Usado para o corpo do seu documento",aliases:["p","paragrafo"],group:"Blocos básicos"},code_block:{title:"Bloco de Código",subtext:"Usado para exibir código com destaque de sintaxe",aliases:["codigo","pre"],group:"Blocos básicos"},page_break:{title:"Quebra de página",subtext:"Separador de página",aliases:["page","break","separator","quebra","separador"],group:"Blocos básicos"},table:{title:"Tabela",subtext:"Usado para tabelas",aliases:["tabela"],group:"Avançado"},image:{title:"Imagem",subtext:"Inserir uma imagem",aliases:["imagem","uploadImagem","upload","img","foto","media","url"],group:"Mídia"},video:{title:"Vídeo",subtext:"Inserir um vídeo",aliases:["vídeo","uploadVídeo","upload","mp4","filme","mídia","url"],group:"Mídia"},audio:{title:"Áudio",subtext:"Inserir um áudio",aliases:["áudio","uploadÁudio","upload","mp3","som","mídia","url"],group:"Mídia"},file:{title:"Arquivo",subtext:"Inserir um arquivo",aliases:["arquivo","upload","incorporar","mídia","url"],group:"Mídia"},emoji:{title:"Emoji",subtext:"Usado para inserir um emoji",aliases:["emoji","emoticon","expressão emocional","rosto"],group:"Outros"}},placeholders:{default:"Digite texto ou use '/' para comandos",heading:"Título",bulletListItem:"Lista",numberedListItem:"Lista",checkListItem:"Lista",new_comment:"Escreva um comentário...",edit_comment:"Editar comentário...",comment_reply:"Adicionar comentário..."},file_blocks:{image:{add_button_text:"Adicionar imagem"},video:{add_button_text:"Adicionar vídeo"},audio:{add_button_text:"Adicionar áudio"},file:{add_button_text:"Adicionar arquivo"}},side_menu:{add_block_label:"Adicionar bloco",drag_handle_label:"Abrir menu do bloco"},drag_handle:{delete_menuitem:"Excluir",colors_menuitem:"Cores",header_row_menuitem:"Cabeçalho de linha",header_column_menuitem:"Cabeçalho de coluna"},table_handle:{delete_column_menuitem:"Excluir coluna",delete_row_menuitem:"Excluir linha",add_left_menuitem:"Adicionar coluna à esquerda",add_right_menuitem:"Adicionar coluna à direita",add_above_menuitem:"Adicionar linha acima",add_below_menuitem:"Adicionar linha abaixo",split_cell_menuitem:"Dividir célula",merge_cells_menuitem:"Juntar células",background_color_menuitem:"Alterar cor de fundo"},suggestion_menu:{no_items_title:"Nenhum item encontrado",loading:"Carregando…"},color_picker:{text_title:"Texto",background_title:"Fundo",colors:{default:"Padrão",gray:"Cinza",brown:"Marrom",red:"Vermelho",orange:"Laranja",yellow:"Amarelo",green:"Verde",blue:"Azul",purple:"Roxo",pink:"Rosa"}},formatting_toolbar:{bold:{tooltip:"Negrito",secondary_tooltip:"Mod+B"},italic:{tooltip:"Itálico",secondary_tooltip:"Mod+I"},underline:{tooltip:"Sublinhado",secondary_tooltip:"Mod+U"},strike:{tooltip:"Riscado",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Código",secondary_tooltip:""},colors:{tooltip:"Cores"},link:{tooltip:"Criar link",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Editar legenda",input_placeholder:"Editar legenda"},file_replace:{tooltip:{image:"Substituir imagem",video:"Substituir vídeo",audio:"Substituir áudio",file:"Substituir arquivo"}},file_rename:{tooltip:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"},input_placeholder:{image:"Renomear imagem",video:"Renomear vídeo",audio:"Renomear áudio",file:"Renomear arquivo"}},file_download:{tooltip:{image:"Baixar imagem",video:"Baixar vídeo",audio:"Baixar áudio",file:"Baixar arquivo"}},file_delete:{tooltip:{image:"Excluir imagem",video:"Excluir vídeo",audio:"Excluir áudio",file:"Excluir arquivo"}},file_preview_toggle:{tooltip:"Alternar visualização"},nest:{tooltip:"Aninhar bloco",secondary_tooltip:"Tab"},unnest:{tooltip:"Desaninhar bloco",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Alinhar à esquerda"},align_center:{tooltip:"Alinhar ao centro"},align_right:{tooltip:"Alinhar à direita"},align_justify:{tooltip:"Justificar texto"},table_cell_merge:{tooltip:"Juntar células"},comment:{tooltip:"Adicionar comentário"}},file_panel:{upload:{title:"Upload",file_placeholder:{image:"Upload de imagem",video:"Upload de vídeo",audio:"Upload de áudio",file:"Upload de arquivo"},upload_error:"Erro: Falha no upload"},embed:{title:"Incorporar",embed_button:{image:"Incorporar imagem",video:"Incorporar vídeo",audio:"Incorporar áudio",file:"Incorporar arquivo"},url_placeholder:"Insira a URL"}},link_toolbar:{delete:{tooltip:"Remover link"},edit:{text:"Editar link",tooltip:"Editar"},open:{tooltip:"Abrir em nova aba"},form:{title_placeholder:"Editar título",url_placeholder:"Editar URL"}},comments:{actions:{add_reaction:"Adicionar reação",resolve:"Resolver",edit_comment:"Editar comentário",delete_comment:"Excluir comentário",more_actions:"Mais ações"},reactions:{reacted_by:"Reagido por"},sidebar:{marked_as_resolved:"Marcado como resolvido",more_replies:e=>`${e} respostas a mais`}},generic:{ctrl_shortcut:"Ctrl"}},Nn={slash_menu:{heading:{title:"Заголовок 1 уровня",subtext:"Используется для заголовка верхнего уровня",aliases:["h","heading1","h1","заголовок1"],group:"Заголовки"},heading_2:{title:"Заголовок 2 уровня",subtext:"Используется для ключевых разделов",aliases:["h2","heading2","subheading","заголовок2","подзаголовок"],group:"Заголовки"},heading_3:{title:"Заголовок 3 уровня",subtext:"Используется для подразделов и групп",aliases:["h3","heading3","subheading","заголовок3","подзаголовок"],group:"Заголовки"},numbered_list:{title:"Нумерованный список",subtext:"Используется для отображения нумерованного списка",aliases:["ol","li","list","numberedlist","numbered list","список","нумерованный список"],group:"Базовые блоки"},bullet_list:{title:"Маркированный список",subtext:"Для отображения неупорядоченного списка.",aliases:["ul","li","list","bulletlist","bullet list","список","маркированный список"],group:"Базовые блоки"},check_list:{title:"Контрольный список",subtext:"Для отображения списка с флажками",aliases:["ul","li","list","checklist","check list","checked list","checkbox","список"],group:"Базовые блоки"},paragraph:{title:"Параграф",subtext:"Основной текст",aliases:["p","paragraph","параграф"],group:"Базовые блоки"},code_block:{title:"Блок кода",subtext:"Блок кода с подсветкой синтаксиса",aliases:["code","pre","блок кода"],group:"Базовые блоки"},page_break:{title:"Разрыв страницы",subtext:"Разделитель страницы",aliases:["page","break","separator","разрыв","разделитель"],group:"Основные блоки"},table:{title:"Таблица",subtext:"Используется для таблиц",aliases:["table","таблица"],group:"Продвинутый"},image:{title:"Картинка",subtext:"Вставить изображение",aliases:["image","imageUpload","upload","img","picture","media","url","загрузка","картинка","рисунок"],group:"Медиа"},video:{title:"Видео",subtext:"Вставить видео",aliases:["video","videoUpload","upload","mp4","film","media","url","загрузка","видео"],group:"Медиа"},audio:{title:"Аудио",subtext:"Вставить аудио",aliases:["audio","audioUpload","upload","mp3","sound","media","url","загрузка","аудио","звук","музыка"],group:"Медиа"},file:{title:"Файл",subtext:"Вставить файл",aliases:["file","upload","embed","media","url","загрузка","файл"],group:"Медиа"},emoji:{title:"Эмодзи",subtext:"Используется для вставки эмодзи",aliases:["эмодзи","смайлик","выражение эмоций","лицо"],group:"Прочее"}},placeholders:{default:"Ведите текст или введите «/» для команд",heading:"Заголовок",bulletListItem:"Список",numberedListItem:"Список",checkListItem:"Список",new_comment:"Напишите комментарий...",edit_comment:"Редактировать комментарий...",comment_reply:"Добавить комментарий..."},file_blocks:{image:{add_button_text:"Добавить изображение"},video:{add_button_text:"Добавить видео"},audio:{add_button_text:"Добавить аудио"},file:{add_button_text:"Добавить файл"}},side_menu:{add_block_label:"Добавить блок",drag_handle_label:"Открыть меню блока"},drag_handle:{delete_menuitem:"Удалить",colors_menuitem:"Цвета",header_row_menuitem:"Заголовок строки",header_column_menuitem:"Заголовок столбца"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_menuitem:"Добавить строку ниже",split_cell_menuitem:"Разделить ячейку",merge_cells_menuitem:"Объединить ячейки",background_color_menuitem:"Цвет фона"},suggestion_menu:{no_items_title:"ничего не найдено",loading:"Загрузка…"},color_picker:{text_title:"Текст",background_title:"Задний фон",colors:{default:"По умолчинию",gray:"Серый",brown:"Коричневый",red:"Красный",orange:"Оранжевый",yellow:"Жёлтый",green:"Зелёный",blue:"Голубой",purple:"Фиолетовый",pink:"Розовый"}},formatting_toolbar:{bold:{tooltip:"Жирный",secondary_tooltip:"Mod+B"},italic:{tooltip:"Курсив",secondary_tooltip:"Mod+I"},underline:{tooltip:"Подчёркнутый",secondary_tooltip:"Mod+U"},strike:{tooltip:"Зачёркнутый",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Код",secondary_tooltip:""},colors:{tooltip:"Цвета"},link:{tooltip:"Создать ссылку",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Изменить подпись",input_placeholder:"Изменить подпись"},file_replace:{tooltip:{image:"Заменить изображение",video:"Заменить видео",audio:"Заменить аудио",file:"Заменить файл"}},file_rename:{tooltip:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"},input_placeholder:{image:"Переименовать изображение",video:"Переименовать видео",audio:"Переименовать аудио",file:"Переименовать файл"}},file_download:{tooltip:{image:"Скачать картинку",video:"Скачать видео",audio:"Скачать аудио",file:"Скачать файл"}},file_delete:{tooltip:{image:"Удалить картинку",video:"Удалить видео",audio:"Удалить аудио",file:"Удалить файл"}},file_preview_toggle:{tooltip:"Переключить предварительный просмотр"},nest:{tooltip:"Сдвинуть вправо",secondary_tooltip:"Tab"},unnest:{tooltip:"Сдвинуть влево",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Текст по левому краю"},align_center:{tooltip:"Текст по середине"},align_right:{tooltip:"Текст по правому краю"},align_justify:{tooltip:"По середине текст"},table_cell_merge:{tooltip:"Объединить ячейки"},comment:{tooltip:"Добавить комментарий"}},file_panel:{upload:{title:"Загрузить",file_placeholder:{image:"Загрузить картинки",video:"Загрузить видео",audio:"Загрузить аудио",file:"Загрузить файл"},upload_error:"Ошибка: не удалось загрузить"},embed:{title:"Вставить",embed_button:{image:"Вставить картинку",video:"Вставить видео",audio:"Вставить аудио",file:"Вставить файл"},url_placeholder:"Введите URL"}},link_toolbar:{delete:{tooltip:"Удалить ссылку"},edit:{text:"Изменить ссылку",tooltip:"Редактировать"},open:{tooltip:"Открыть в новой вкладке"},form:{title_placeholder:"Изменить заголовок",url_placeholder:"Изменить URL"}},comments:{actions:{add_reaction:"Добавить реакцию",resolve:"Решить",edit_comment:"Редактировать комментарий",delete_comment:"Удалить комментарий",more_actions:"Другие действия"},reactions:{reacted_by:"Отреагировал(а)"},sidebar:{marked_as_resolved:"Отмечено как решенное",more_replies:e=>`${e} дополнительных ответов`}},generic:{ctrl_shortcut:"Ctrl"}},Dn={slash_menu:{heading:{title:"Заголовок 1",subtext:"Заголовок найвищого рівня",aliases:["h","heading1","h1","заголовок1"],group:"Заголовки"},heading_2:{title:"Заголовок 2",subtext:"Основний заголовок розділу",aliases:["h2","heading2","subheading","заголовок2"],group:"Заголовки"},heading_3:{title:"Заголовок 3",subtext:"Підзаголовок і груповий заголовок",aliases:["h3","heading3","subheading","заголовок3"],group:"Заголовки"},numbered_list:{title:"Нумерований список",subtext:"Список із впорядкованими елементами",aliases:["ol","li","list","numberedlist","numbered list","список","нумерований список"],group:"Базові блоки"},bullet_list:{title:"Маркований список",subtext:"Список із невпорядкованими елементами",aliases:["ul","li","list","bulletlist","bullet list","список","маркований список"],group:"Базові блоки"},check_list:{title:"Чек-лист",subtext:"Список із чекбоксами",aliases:["ul","li","list","checklist","check list","checked list","checkbox","чекбокс","чек-лист"],group:"Базові блоки"},paragraph:{title:"Параграф",subtext:"Основний текст документа",aliases:["p","paragraph","параграф"],group:"Базові блоки"},code_block:{title:"Блок коду",subtext:"Блок коду з підсвіткою синтаксису",aliases:["code","pre","блок коду"],group:"Базові блоки"},page_break:{title:"Розрив сторінки",subtext:"Роздільник сторінки",aliases:["page","break","separator","розрив сторінки","розділювач"],group:"Базові блоки"},table:{title:"Таблиця",subtext:"Таблиця з редагованими клітинками",aliases:["table","таблиця"],group:"Розширені"},image:{title:"Зображення",subtext:"Масштабоване зображення з підписом",aliases:["image","imageUpload","upload","img","picture","media","url","зображення","медіа"],group:"Медіа"},video:{title:"Відео",subtext:"Масштабоване відео з підписом",aliases:["video","videoUpload","upload","mp4","film","media","url","відео","медіа"],group:"Медіа"},audio:{title:"Аудіо",subtext:"Вбудоване аудіо з підписом",aliases:["audio","audioUpload","upload","mp3","sound","media","url","аудіо","медіа"],group:"Медіа"},file:{title:"Файл",subtext:"Вбудований файл",aliases:["file","upload","embed","media","url","файл","медіа"],group:"Медіа"},emoji:{title:"Емодзі",subtext:"Пошук і вставка емодзі",aliases:["emoji","emote","emotion","face","смайлик","емодзі"],group:"Інше"}},placeholders:{default:"Введіть текст або наберіть '/' для команд",heading:"Заголовок",bulletListItem:"Список",numberedListItem:"Список",checkListItem:"Список",new_comment:"Напишіть коментар...",edit_comment:"Редагувати коментар...",comment_reply:"Додати коментар..."},file_blocks:{image:{add_button_text:"Додати зображення"},video:{add_button_text:"Додати відео"},audio:{add_button_text:"Додати аудіо"},file:{add_button_text:"Додати файл"}},side_menu:{add_block_label:"Додати блок",drag_handle_label:"Відкрити меню блока"},drag_handle:{delete_menuitem:"Видалити",colors_menuitem:"Кольори",header_row_menuitem:"Заголовок рядка",header_column_menuitem:"Заголовок стовпця"},table_handle:{delete_column_menuitem:"Видалити стовпець",delete_row_menuitem:"Видалити рядок",add_left_menuitem:"Додати стовпець зліва",add_right_menuitem:"Додати стовпець справа",add_above_menuitem:"Додати рядок вище",add_below_menuitem:"Додати рядок нижче",split_cell_menuitem:"Розділити клітинку",merge_cells_menuitem:"Об'єднати клітинки",background_color_menuitem:"Змінити колір фону"},suggestion_menu:{no_items_title:"Нічого не знайдено",loading:"Завантаження…"},color_picker:{text_title:"Текст",background_title:"Фон",colors:{default:"За замовчуванням",gray:"Сірий",brown:"Коричневий",red:"Червоний",orange:"Помаранчевий",yellow:"Жовтий",green:"Зелений",blue:"Блакитний",purple:"Фіолетовий",pink:"Рожевий"}},formatting_toolbar:{bold:{tooltip:"Жирний",secondary_tooltip:"Mod+B"},italic:{tooltip:"Курсив",secondary_tooltip:"Mod+I"},underline:{tooltip:"Підкреслений",secondary_tooltip:"Mod+U"},strike:{tooltip:"Закреслений",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Код",secondary_tooltip:""},colors:{tooltip:"Кольори"},link:{tooltip:"Створити посилання",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Редагувати підпис",input_placeholder:"Редагувати підпис"},file_replace:{tooltip:{image:"Замінити зображення",video:"Замінити відео",audio:"Замінити аудіо",file:"Замінити файл"}},file_rename:{tooltip:{image:"Перейменувати зображення",video:"Перейменувати відео",audio:"Перейменувати аудіо",file:"Перейменувати файл"},input_placeholder:{image:"Перейменувати зображення",video:"Перейменувати відео",audio:"Перейменувати аудіо",file:"Перейменувати файл"}},file_download:{tooltip:{image:"Завантажити зображення",video:"Завантажити відео",audio:"Завантажити аудіо",file:"Завантажити файл"}},file_delete:{tooltip:{image:"Видалити зображення",video:"Видалити відео",audio:"Видалити аудіо",file:"Видалити файл"}},file_preview_toggle:{tooltip:"Перемкнути попередній перегляд"},nest:{tooltip:"Вкладений блок",secondary_tooltip:"Tab"},unnest:{tooltip:"Розгрупувати блок",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Вирівняти за лівим краєм"},align_center:{tooltip:"Вирівняти по центру"},align_right:{tooltip:"Вирівняти за правим краєм"},align_justify:{tooltip:"Вирівняти за шириною"},table_cell_merge:{tooltip:"Об'єднати клітинки"},comment:{tooltip:"Додати коментар"}},file_panel:{upload:{title:"Завантажити",file_placeholder:{image:"Завантажити зображення",video:"Завантажити відео",audio:"Завантажити аудіо",file:"Завантажити файл"},upload_error:"Помилка: не вдалося завантажити"},embed:{title:"Вставити",embed_button:{image:"Вставити зображення",video:"Вставити відео",audio:"Вставити аудіо",file:"Вставити файл"},url_placeholder:"Введіть URL"}},link_toolbar:{delete:{tooltip:"Видалити посилання"},edit:{text:"Редагувати посилання",tooltip:"Редагувати"},open:{tooltip:"Відкрити в новій вкладці"},form:{title_placeholder:"Редагувати заголовок",url_placeholder:"Редагувати URL"}},comments:{actions:{add_reaction:"Додати реакцію",resolve:"Вирішити",edit_comment:"Редагувати коментар",delete_comment:"Видалити коментар",more_actions:"Більше дій"},reactions:{reacted_by:"Відреагував(ла)"},sidebar:{marked_as_resolved:"Позначено як вирішене",more_replies:e=>`${e} додаткових відповідей`}},generic:{ctrl_shortcut:"Ctrl"}},jn={slash_menu:{heading:{title:"Tiêu đề H1",subtext:"Sử dụng cho tiêu đề cấp cao nhất",aliases:["h","tieude1","dd1"],group:"Tiêu đề"},heading_2:{title:"Tiêu đề H2",subtext:"Sử dụng cho các phần chính",aliases:["h2","tieude2","tieudephu"],group:"Tiêu đề"},heading_3:{title:"Tiêu đề H3",subtext:"Sử dụng cho phụ đề và tiêu đề nhóm",aliases:["h3","tieude3","tieudephu"],group:"Tiêu đề"},numbered_list:{title:"Danh sách đánh số",subtext:"Sử dụng để hiển thị danh sách có đánh số",aliases:["ol","li","ds","danhsachdso","danh sach danh so"],group:"Khối cơ bản"},bullet_list:{title:"Danh sách",subtext:"Sử dụng để hiển thị danh sách không đánh số",aliases:["ul","li","ds","danhsach","danh sach"],group:"Khối cơ bản"},check_list:{title:"Danh sách kiểm tra",subtext:"Dùng để hiển thị danh sách có hộp kiểm",aliases:["ul","li","danh sach","danh sach kiem tra","danh sach da kiem tra","hop kiem"],group:"Khối cơ bản"},paragraph:{title:"Đoạn văn",subtext:"Sử dụng cho nội dung chính của tài liệu",aliases:["p","doanvan"],group:"Khối cơ bản"},code_block:{title:"Mã",subtext:"Sử dụng để hiển thị mã với cú pháp",aliases:["code","pre"],group:"Khối cơ bản"},page_break:{title:"Ngắt trang",subtext:"Phân cách trang",aliases:["page","break","separator","ngắt","phân cách"],group:"Khối cơ bản"},table:{title:"Bảng",subtext:"Sử dụng để tạo bảng",aliases:["bang"],group:"Nâng cao"},image:{title:"Hình ảnh",subtext:"Chèn hình ảnh",aliases:["anh","tai-len-anh","tai-len","img","hinh","media","url"],group:"Phương tiện"},video:{title:"Video",subtext:"Chèn video",aliases:["video","tai-len-video","tai-len","mp4","phim","media","url"],group:"Phương tiện"},audio:{title:"Âm thanh",subtext:"Chèn âm thanh",aliases:["âm thanh","tai-len-am-thanh","tai-len","mp3","am thanh","media","url"],group:"Phương tiện"},file:{title:"Tệp",subtext:"Chèn tệp",aliases:["tep","tai-len","nhung","media","url"],group:"Phương tiện"},emoji:{title:"Biểu tượng cảm xúc",subtext:"Dùng để chèn biểu tượng cảm xúc",aliases:["biểu tượng cảm xúc","emoji","emoticon","cảm xúc expression","khuôn mặt","face"],group:"Khác"}},placeholders:{default:"Nhập văn bản hoặc gõ '/' để thêm định dạng",heading:"Tiêu đề",bulletListItem:"Danh sách",numberedListItem:"Danh sách",checkListItem:"Danh sách",new_comment:"Viết bình luận...",edit_comment:"Chỉnh sửa bình luận...",comment_reply:"Thêm bình luận..."},file_blocks:{image:{add_button_text:"Thêm ảnh"},video:{add_button_text:"Thêm video"},audio:{add_button_text:"Thêm âm thanh"},file:{add_button_text:"Thêm tệp"}},side_menu:{add_block_label:"Thêm khối",drag_handle_label:"Mở trình đơn khối"},drag_handle:{delete_menuitem:"Xóa",colors_menuitem:"Màu sắc",header_row_menuitem:"Tiêu đề hàng",header_column_menuitem:"Tiêu đề cột"},table_handle:{delete_column_menuitem:"Xóa cột",delete_row_menuitem:"Xóa hàng",add_left_menuitem:"Thêm cột bên trái",add_right_menuitem:"Thêm cột bên phải",add_above_menuitem:"Thêm hàng phía trên",add_below_menuitem:"Thêm hàng phía dưới",split_cell_menuitem:"Chia ô",merge_cells_menuitem:"Gộp ô",background_color_menuitem:"Màu nền"},suggestion_menu:{no_items_title:"Không tìm thấy mục nào",loading:"Đang tải..."},color_picker:{text_title:"Văn bản",background_title:"Nền",colors:{default:"Mặc định",gray:"Xám",brown:"Nâu",red:"Đỏ",orange:"Cam",yellow:"Vàng",green:"Xanh lá",blue:"Xanh dương",purple:"Tím",pink:"Hồng"}},formatting_toolbar:{bold:{tooltip:"In đậm",secondary_tooltip:"Mod+B"},italic:{tooltip:"In nghiêng",secondary_tooltip:"Mod+I"},underline:{tooltip:"Gạch dưới",secondary_tooltip:"Mod+U"},strike:{tooltip:"Gạch ngang",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"Code",secondary_tooltip:""},colors:{tooltip:"Màu sắc"},link:{tooltip:"Tạo liên kết",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"Chỉnh sửa chú thích",input_placeholder:"Chỉnh sửa chú thích"},file_replace:{tooltip:{image:"Thay thế hình ảnh",video:"Thay thế video",audio:"Thay thế âm thanh",file:"Thay thế tệp"}},file_rename:{tooltip:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"},input_placeholder:{image:"Đổi tên hình ảnh",video:"Đổi tên video",audio:"Đổi tên âm thanh",file:"Đổi tên tệp"}},file_download:{tooltip:{image:"Tải xuống hình ảnh",video:"Tải xuống video",audio:"Tải xuống âm thanh",file:"Tải xuống tệp"}},file_delete:{tooltip:{image:"Xóa hình ảnh",video:"Xóa video",audio:"Xóa âm thanh",file:"Xóa tệp"}},file_preview_toggle:{tooltip:"Chuyển đổi xem trước"},nest:{tooltip:"Lồng khối",secondary_tooltip:"Tab"},unnest:{tooltip:"Bỏ lồng khối",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"Căn trái văn bản"},align_center:{tooltip:"Căn giữa văn bản"},align_right:{tooltip:"Căn phải văn bản"},align_justify:{tooltip:"Căn đều văn bản"},table_cell_merge:{tooltip:"Gộp các ô"},comment:{tooltip:"Thêm bình luận"}},file_panel:{upload:{title:"Tải lên",file_placeholder:{image:"Tải lên hình ảnh",video:"Tải lên video",audio:"Tải lên âm thanh",file:"Tải lên tệp"},upload_error:"Lỗi: Tải lên thất bại"},embed:{title:"Nhúng",embed_button:{image:"Nhúng hình ảnh",video:"Nhúng video",audio:"Nhúng âm thanh",file:"Nhúng tệp"},url_placeholder:"Nhập URL"}},link_toolbar:{delete:{tooltip:"Xóa liên kết"},edit:{text:"Chỉnh sửa liên kết",tooltip:"Chỉnh sửa"},open:{tooltip:"Mở trong tab mới"},form:{title_placeholder:"Chỉnh sửa tiêu đề",url_placeholder:"Chỉnh sửa URL"}},comments:{actions:{add_reaction:"Thêm phản ứng",resolve:"Giải quyết",edit_comment:"Chỉnh sửa bình luận",delete_comment:"Xóa bình luận",more_actions:"Thêm hành động"},reactions:{reacted_by:"Phản ứng bởi"},sidebar:{marked_as_resolved:"Đã đánh dấu là đã giải quyết",more_replies:e=>`${e} câu trả lời nữa`}},generic:{ctrl_shortcut:"Ctrl"}},Rn={slash_menu:{heading:{title:"一级标题",subtext:"用于顶级标题",aliases:["h","heading1","h1","标题","一级标题"],group:"标题"},heading_2:{title:"二级标题",subtext:"用于关键部分",aliases:["h2","heading2","subheading","标题","二级标题","副标题"],group:"标题"},heading_3:{title:"三级标题",subtext:"用于小节和分组标题",aliases:["h3","heading3","subheading","标题","三级标题"],group:"标题"},numbered_list:{title:"有序列表",subtext:"用于显示有序列表",aliases:["ol","li","list","numberedlist","numbered list","列表","有序列表"],group:"基础"},bullet_list:{title:"无序列表",subtext:"用于显示无序列表",aliases:["ul","li","list","bulletlist","bullet list","列表","无序列表"],group:"基础"},check_list:{title:"检查清单",subtext:"用于显示带有复选框的列表",aliases:["ul","li","checklist","checked list","列表","检查清单","勾选列表","复选框"],group:"基础"},paragraph:{title:"段落",subtext:"用于文档正文",aliases:["p","paragraph","text","正文"],group:"基础"},code_block:{title:"代码块",subtext:"用于显示带有语法高亮的代码块",aliases:["code","pre","代码","预格式"],group:"基础"},page_break:{title:"分页符",subtext:"页面分隔符",aliases:["page","break","separator","分页","分隔符"],group:"基础"},table:{title:"表格",subtext:"使用表格",aliases:["table","表格"],group:"高级功能"},image:{title:"图片",subtext:"插入图片",aliases:["图片","上传图片","上传","image","img","相册","媒体","url"],group:"媒体"},video:{title:"视频",subtext:"插入视频",aliases:["视频","视频上传","上传","video","mp4","电影","媒体","url","驱动","dropbox"],group:"媒体"},audio:{title:"音频",subtext:"插入音频",aliases:["音频","音频上传","上传","audio","mp3","声音","媒体","url","驱动","dropbox"],group:"媒体"},file:{title:"文件",subtext:"插入文件",aliases:["文件","上传","file","嵌入","媒体","url"],group:"媒体"},emoji:{title:"表情符号",subtext:"用于插入表情符号",aliases:["表情符号","emoji","face","emote","表情","表情表达","表情"],group:"其他"}},placeholders:{default:"输入 '/' 以使用命令",heading:"标题",bulletListItem:"列表",numberedListItem:"列表",checkListItem:"列表",new_comment:"写评论...",edit_comment:"编辑评论...",comment_reply:"添加评论..."},file_blocks:{image:{add_button_text:"添加图片"},video:{add_button_text:"添加视频"},audio:{add_button_text:"添加音频"},file:{add_button_text:"添加文件"}},side_menu:{add_block_label:"添加块",drag_handle_label:"打开菜单"},drag_handle:{delete_menuitem:"删除",colors_menuitem:"颜色",header_row_menuitem:"行标题",header_column_menuitem:"列标题"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_menuitem:"下方添加行",split_cell_menuitem:"拆分单元格",merge_cells_menuitem:"合并单元格",background_color_menuitem:"背景色"},suggestion_menu:{no_items_title:"无匹配项",loading:"加载中…"},color_picker:{text_title:"文本",background_title:"背景色",colors:{default:"默认",gray:"灰色",brown:"棕色",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",pink:"粉色"}},formatting_toolbar:{bold:{tooltip:"加粗",secondary_tooltip:"Mod+B"},italic:{tooltip:"斜体",secondary_tooltip:"Mod+I"},underline:{tooltip:"下划线",secondary_tooltip:"Mod+U"},strike:{tooltip:"删除线",secondary_tooltip:"Mod+Shift+X"},code:{tooltip:"代码标记",secondary_tooltip:""},colors:{tooltip:"颜色"},link:{tooltip:"添加链接",secondary_tooltip:"Mod+K"},file_caption:{tooltip:"编辑标题",input_placeholder:"编辑标题"},file_replace:{tooltip:{image:"替换图片",video:"替换视频",audio:"替换音频",file:"替换文件"}},file_rename:{tooltip:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"},input_placeholder:{image:"重命名图片",video:"重命名视频",audio:"重命名音频",file:"重命名文件"}},file_download:{tooltip:{image:"下载图片",video:"下载视频",audio:"下载音频",file:"下载文件"}},file_delete:{tooltip:{image:"删除图片",video:"删除视频",audio:"删除音频",file:"删除文件"}},file_preview_toggle:{tooltip:"切换预览"},nest:{tooltip:"嵌套",secondary_tooltip:"Tab"},unnest:{tooltip:"取消嵌套",secondary_tooltip:"Shift+Tab"},align_left:{tooltip:"左对齐"},align_center:{tooltip:"居中"},align_right:{tooltip:"右对齐"},align_justify:{tooltip:"文本对齐"},table_cell_merge:{tooltip:"合并单元格"},comment:{tooltip:"添加评论"}},file_panel:{upload:{title:"上传",file_placeholder:{image:"上传图片",video:"上传视频",audio:"上传音频",file:"上传文件"},upload_error:"Error:上传失败"},embed:{title:"嵌入",embed_button:{image:"嵌入图片",video:"嵌入视频",audio:"嵌入音频",file:"嵌入文件"},url_placeholder:"输入图片地址"}},link_toolbar:{delete:{tooltip:"清除链接"},edit:{text:"编辑链接",tooltip:"编辑"},open:{tooltip:"新窗口打开"},form:{title_placeholder:"编辑标题",url_placeholder:"编辑链接地址"}},comments:{actions:{add_reaction:"添加反应",resolve:"解决",edit_comment:"编辑评论",delete_comment:"删除评论",more_actions:"更多操作"},reactions:{reacted_by:"已回应"},sidebar:{marked_as_resolved:"标记为已解决",more_replies:e=>`还有 ${e} 条回复`}},generic:{ctrl_shortcut:"Ctrl"}},Un=Object.freeze(Object.defineProperty({__proto__:null,ar:wn,de:vn,en:Ft,es:Cn,fr:xn,hr:Sn,is:En,it:Bn,ja:Tn,ko:Mn,nl:In,no:Ln,pl:Pn,pt:An,ru:Nn,uk:Dn,vi:jn,zh:Rn},Symbol.toStringTag,{value:"Module"}));class O extends Error{constructor(o){super(`Unreachable case: ${o}`)}}function Hn(e,o=!0){const{"data-test":t,...i}=e;if(Object.keys(i).length>0&&o)throw new Error("Object must be empty "+JSON.stringify(e))}function G(e,o){const t=e.resolve(o);if(t.nodeAfter&&t.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:t.pos,node:t.nodeAfter};let i=t.depth,n=t.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:t.before(i),node:n};i--,n=t.node(i)}const r=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&r.push(l)}),console.warn(`Position ${o} is not within a blockContainer node.`);const a=e.resolve(r.find(s=>s>=o)||r[r.length-1]);return{posBeforeNode:a.pos,node:a.nodeAfter}}function Ne(e,o){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const t=e,i=o,n=i+t.nodeSize,r={node:t,beforePos:i,afterPos:n};if(t.type.name==="blockContainer"){let a,s;if(t.forEach((l,d)=>{if(l.type.spec.group==="blockContent"){const c=l,u=i+d+1,m=u+l.nodeSize;a={node:c,beforePos:u,afterPos:m}}else if(l.type.name==="blockGroup"){const c=l,u=i+d+1,m=u+l.nodeSize;s={node:c,beforePos:u,afterPos:m}}}),!a)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${t}`);return{isBlockContainer:!0,bnBlock:r,blockContent:a,childContainer:s,blockNoteType:a.node.type.name}}else{if(!r.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${r.node}`);return{isBlockContainer:!1,bnBlock:r,childContainer:r,blockNoteType:r.node.type.name}}}function Y(e){return Ne(e.node,e.posBeforeNode)}function de(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return Ne(e.nodeAfter,e.pos)}function C(e){const o=G(e.doc,e.selection.anchor);return Y(o)}function On(e,o=JSON.stringify){const t={};return e.filter(i=>{const n=o(i);return Object.prototype.hasOwnProperty.call(t,n)?!1:t[n]=!0})}function Vn(e){const o=e.filter((i,n)=>e.indexOf(i)!==n);return On(o)}const ce=k.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return zt.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const o={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...o,id:e[this.options.attributeName]}:o}}}}]},addProseMirrorPlugins(){let e=null,o=!1;return[new y.Plugin({key:new y.PluginKey("uniqueID"),appendTransaction:(t,i,n)=>{const r=t.some(f=>f.docChanged)&&!i.doc.eq(n.doc),a=this.options.filterTransaction&&t.some(f=>{let g,b;return!(!((b=(g=this.options).filterTransaction)===null||b===void 0)&&b.call(g,f))});if(!r||a)return;const{tr:s}=n,{types:l,attributeName:d,generateID:c}=this.options,u=k.combineTransactionSteps(i.doc,t),{mapping:m}=u;if(k.getChangedRanges(u).forEach(({newRange:f})=>{const g=k.findChildrenInRange(n.doc,f,w=>l.includes(w.type.name)),b=g.map(({node:w})=>w.attrs[d]).filter(w=>w!==null),_=Vn(b);g.forEach(({node:w,pos:v})=>{let x;const B=(x=s.doc.nodeAt(v))===null||x===void 0?void 0:x.attrs[d];if(B===null){const I=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(I)===null){const St=JSON.parse(JSON.stringify(n.doc.toJSON()));if(St.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(St.content)===JSON.stringify(I.toJSON())){s.setNodeMarkup(v,void 0,{...w.attrs,[d]:"initialBlockId"});return}}s.setNodeMarkup(v,void 0,{...w.attrs,[d]:c()});return}const{deleted:z}=m.invert().mapResult(v);z&&_.includes(B)&&s.setNodeMarkup(v,void 0,{...w.attrs,[d]:c()})})}),!!s.steps.length)return s},view(t){const i=n=>{let r;e=!((r=t.dom.parentElement)===null||r===void 0)&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(t,i)=>{let n;return e!==t.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy"?o=!0:o=!1,e=null,!1},paste:()=>(o=!0,!1)},transformPasted:t=>{if(!o)return t;const{types:i,attributeName:n}=this.options,r=a=>{const s=[];return a.forEach(l=>{if(l.isText){s.push(l);return}if(!i.includes(l.type.name)){s.push(l.copy(r(l.content)));return}const d=l.type.create({...l.attrs,[n]:null},r(l.content),l.marks);s.push(d)}),S.Fragment.from(s)};return o=!1,new S.Slice(r(t.content),t.openStart,t.openEnd)}}})]}});function We(e){return e.type==="link"}function De(e){return typeof e!="string"&&e.type==="link"}function W(e){return typeof e!="string"&&e.type==="text"}function Te(e){var o,t,i,n,r;return je(e)?{...e}:se(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:((o=e.props)==null?void 0:o.backgroundColor)??"default",textColor:((t=e.props)==null?void 0:t.textColor)??"default",textAlignment:((i=e.props)==null?void 0:i.textAlignment)??"left",colspan:((n=e.props)==null?void 0:n.colspan)??1,rowspan:((r=e.props)==null?void 0:r.rowspan)??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function se(e){return e!=null&&typeof e!="string"&&!Array.isArray(e)&&e.type==="tableCell"}function je(e){return se(e)&&e.props!==void 0&&e.content!==void 0}function le(e){return je(e)?e.props.colspan??1:1}function Me(e){return je(e)?e.props.rowspan??1:1}const $t=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function K(e,o="Ctrl"){return $t()?e.replace("Mod","⌘"):e.replace("Mod",o)}function q(...e){return e.filter(o=>o).join(" ")}const zn=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function F(e,o,t,i){const n=document.createElement("div");n.className=q("bn-block-content",t.class),n.setAttribute("data-content-type",e);for(const[a,s]of Object.entries(t))a!=="class"&&n.setAttribute(a,s);const r=document.createElement(o);r.className=q("bn-inline-content",i.class);for(const[a,s]of Object.entries(i))a!=="class"&&r.setAttribute(a,s);return n.appendChild(r),{dom:n,contentDOM:r}}const qe=(e,o)=>{let t=ee(e,o.pmSchema,o.schema.styleSchema);t.type.name==="blockContainer"&&(t=t.firstChild);const i=o.pmSchema.nodes[t.type.name].spec.toDOM;if(i===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const n=i(t);if(typeof n!="object"||!("dom"in n))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return n},P={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},at=["backgroundColor","textColor"];function ge(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Fn(e){const o=e.split("/");return!o.length||o[o.length-1]===""?e:o[o.length-1]}function ue(e){const o={};return Object.entries(e).filter(([t,i])=>!at.includes(t)).forEach(([t,i])=>{o[t]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const r=n.getAttribute(ge(t));if(r===null)return null;if(i.default===void 0&&i.type==="boolean"||i.default!==void 0&&typeof i.default=="boolean")return r==="true"?!0:r==="false"?!1:null;if(i.default===void 0&&i.type==="number"||i.default!==void 0&&typeof i.default=="number"){const a=parseFloat(r);return!Number.isNaN(a)&&Number.isFinite(a)?a:null}return r},renderHTML:n=>n[t]!==i.default?{[ge(t)]:n[t]}:{}}}),o}function Kt(e,o,t,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),a=t.state.doc.resolve(n).node().attrs.id;if(!a)throw new Error("Block doesn't have id");const s=o.getBlock(a);if(s.type!==i)throw new Error("Block type does not match");return s}function fe(e,o,t,i,n=!1,r){const a=document.createElement("div");if(r!==void 0)for(const[s,l]of Object.entries(r))s!=="class"&&a.setAttribute(s,l);a.className=q("bn-block-content",(r==null?void 0:r.class)||""),a.setAttribute("data-content-type",o);for(const[s,l]of Object.entries(t)){const c=i[s].default;!at.includes(s)&&l!==c&&a.setAttribute(ge(s),l)}return n&&a.setAttribute("data-file-block",""),a.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=q("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:a}}function $(e){return k.Node.create(e)}function st(e,o){return{config:e,implementation:o}}function Z(e,o,t){return st({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:o},{node:e,requiredExtensions:t,toInternalHTML:qe,toExternalHTML:qe})}function lt(e){return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t.config]))}function Gt(e,o){e.stopEvent=t=>(t.type==="mousedown"&&setTimeout(()=>{o.view.dom.blur()},10),!0)}function Wt(e,o){const t=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return o&&t.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=o==null?void 0:o(i);return n===void 0?!1:n}}),t}function pe(e,o){const t=$({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,isolating:!0,addAttributes(){return ue(e.propSchema)},parseHTML(){return Wt(e,o.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return fe({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var d;const n=this.options.editor,r=Kt(i,n,this.editor,e.type),a=((d=this.options.domAttributes)==null?void 0:d.blockContent)||{},s=o.render(r,n),l=fe(s,r.type,r.props,e.propSchema,a);return e.isSelectable===!1&&Gt(l,this.editor),l}}});if(t.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return st(e,{node:t,toInternalHTML:(i,n)=>{var s;const r=((s=t.options.domAttributes)==null?void 0:s.blockContent)||{},a=o.render(i,n);return fe(a,i.type,i.props,e.propSchema,e.isFileBlock,r)},toExternalHTML:(i,n)=>{var s,l;const r=((s=t.options.domAttributes)==null?void 0:s.blockContent)||{};let a=(l=o.toExternalHTML)==null?void 0:l.call(o,i,n);return a===void 0&&(a=o.render(i,n)),fe(a,i.type,i.props,e.propSchema,r)}})}function dt(e,o,t){var r,a;const i={type:"tableContent",columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},n=[];e.content.forEach((s,l,d)=>{const c={cells:[]};d===0&&s.content.forEach(u=>{let m=u.attrs.colwidth;m==null&&(m=new Array(u.attrs.colspan??1).fill(void 0)),i.columnWidths.push(...m)}),c.cells=s.content.content.map((u,m)=>(n[d]||(n[d]=[]),n[d][m]=u.type.name==="tableHeader",{type:"tableCell",content:u.content.content.map(f=>ke(f,o,t)).reduce((f,g)=>{if(!f.length)return g;const b=f[f.length-1],_=g[0];return _&&W(b)&&W(_)&&JSON.stringify(b.styles)===JSON.stringify(_.styles)?(b.text+=`
|
|
2
|
-
`+
|
|
3
|
-
`;else if(
|
|
4
|
-
`;else throw new Error("unexpected");else
|
|
5
|
-
`,styles:{}};return}if(
|
|
6
|
-
`?o.nodes.hardBreak.createChecked():o.text(a,n)):[o.text(e.text,n)]}function Jn(e,o,t){const i=o.marks.link.create({href:e.href});return Qe(e.content,o,t).map(n=>{if(n.type.name==="text")return n.mark([...n.marks,i]);if(n.type.name==="hardBreak")return n;throw new Error("unexpected node type")})}function Qe(e,o,t,i){const n=[];if(typeof e=="string")return n.push(...Et({type:"text",text:e,styles:{}},o,t,i)),n;for(const r of e)n.push(...Et(r,o,t,i));return n}function U(e,o,t,i){const n=[];for(const r of e)typeof r=="string"?n.push(...Qe(r,o,t,i)):De(r)?n.push(...Jn(r,o,t)):W(r)?n.push(...Qe([r],o,t,i)):n.push(no(r,o,t));return n}function _e(e,o,t){const i=[],n=new Array(e.headerRows??0).fill(!0),r=new Array(e.headerCols??0).fill(!0),a=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){const l=e.rows[s],d=[],c=n[s];for(let m=0;m<l.cells.length;m++){const h=l.cells[m],f=r[m],g=void 0;let b=null;const _=te({row:s,col:m},{type:"table",content:e});let w=a[_.col]?[a[_.col]]:null;if(h)if(typeof h=="string")b=o.text(h);else if(se(h)){h.content&&(b=U(h.content,o,t));const x=le(h);x>1&&(w=new Array(x).fill(!1).map((B,z)=>a[_.col+z]??void 0))}else b=U(h,o,t);const v=o.nodes[f||c?"tableHeader":"tableCell"].createChecked({...se(h)?h.props:{},colwidth:w},o.nodes.tableParagraph.createChecked(g,b));d.push(v)}const u=o.nodes.tableRow.createChecked({},d);i.push(u)}return i}function no(e,o,t){let i,n=e.type;if(n===void 0&&(n="paragraph"),!o.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)i=o.nodes[n].createChecked(e.props);else if(typeof e.content=="string"){const r=U([e.content],o,t,n);i=o.nodes[n].createChecked(e.props,r)}else if(Array.isArray(e.content)){const r=U(e.content,o,t,n);i=o.nodes[n].createChecked(e.props,r)}else if(e.content.type==="tableContent"){const r=_e(e.content,o,t);i=o.nodes[n].createChecked(e.props,r)}else throw new O(e.content.type);return i}function ee(e,o,t){let i=e.id;i===void 0&&(i=ce.options.generateID());const n=[];if(e.children)for(const a of e.children)n.push(ee(a,o,t));if(!e.type||o.nodes[e.type].isInGroup("blockContent")){const a=no(e,o,t),s=n.length>0?o.nodes.blockGroup.createChecked({},n):void 0;return o.nodes.blockContainer.createChecked({id:i,...e.props},s?[a,s]:a)}else{if(o.nodes[e.type].isInGroup("bnBlock"))return o.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function R(e,o){let t,i;if(o.firstChild.descendants((n,r)=>t?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(t=n,i=r+1,!1)),!(t===void 0||i===void 0))return{node:t,posBeforeNode:i}}const A=(e,o,t)=>({state:i,dispatch:n})=>{const r=de(i.doc.resolve(o));if(n){const a=i.schema.nodes[r.blockNoteType],s=i.schema.nodes[t.type||r.blockNoteType],l=s.isInGroup("bnBlock")?s:i.schema.nodes.blockContainer;if(r.isBlockContainer&&s.isInGroup("blockContent"))Bt(t,i,e,r),Yn(t,i,e,a,s,r);else if(!r.isBlockContainer&&s.isInGroup("bnBlock"))Bt(t,i,e,r);else{const d=E(r.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(r.bnBlock.beforePos,r.bnBlock.afterPos,ee({children:d.children,...t},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(r.bnBlock.beforePos,l,{...r.bnBlock.node.attrs,...t.props})}return!0};function Yn(e,o,t,i,n,r){let a="keep";if(e.content)if(typeof e.content=="string")a=U([e.content],o.schema,t.schema.styleSchema,n.name);else if(Array.isArray(e.content))a=U(e.content,o.schema,t.schema.styleSchema,n.name);else if(e.content.type==="tableContent")a=_e(e.content,o.schema,t.schema.styleSchema);else throw new O(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(a=[]);a==="keep"?o.tr.setNodeMarkup(r.blockContent.beforePos,e.type===void 0?void 0:o.schema.nodes[e.type],{...r.blockContent.node.attrs,...e.props}):o.tr.replaceWith(r.blockContent.beforePos,r.blockContent.afterPos,n.createChecked({...r.blockContent.node.attrs,...e.props},a))}function Bt(e,o,t,i){if(e.children!==void 0&&e.children.length>0){const n=e.children.map(r=>ee(r,o.schema,t.schema.styleSchema));if(i.childContainer)o.tr.step(new Be.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new S.Slice(S.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");o.tr.insert(i.blockContent.afterPos,o.schema.nodes.blockGroup.createChecked({},n))}}}function ro(e,o,t){const i=e._tiptapEditor,n=typeof o=="string"?o:o.id,r=R(n,i.state.doc);if(!r)throw new Error(`Block with ID ${n} not found`);i.commands.command(({state:s,dispatch:l})=>(A(e,r.posBeforeNode,t)({state:s,dispatch:l}),!0));const a=i.state.doc.resolve(r.posBeforeNode+1).node();return E(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ao(e){const o=[...e.classList].filter(t=>!t.startsWith("bn-"))||[];o.length>0?e.className=o.join(" "):e.removeAttribute("class")}function so(e,o,t,i){let n;if(o)if(typeof o=="string")n=U([o],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(o))n=U(o,e.pmSchema,e.schema.styleSchema);else if(o.type==="tableContent")n=_e(o,e.pmSchema,e.schema.styleSchema);else throw new O(o.type);else throw new Error("blockContent is required");const r=t.serializeFragment(S.Fragment.from(n),i);return r.nodeType===1&&ao(r),r}function Qn(e,o,t,i,n,r,a){var g,b,_,w,v,x,B,z;const s=(a==null?void 0:a.document)??document,l=o.pmSchema.nodes.blockContainer;let d=t.props;if(!t.props){d={};for(const[M,I]of Object.entries(o.schema.blockSchema[t.type].propSchema))I.default!==void 0&&(d[M]=I.default)}const u=[...((b=(g=l.spec)==null?void 0:g.toDOM)==null?void 0:b.call(g,l.create({id:t.id,...d}))).dom.attributes],m=o.blockImplementations[t.type].implementation.toExternalHTML({...t,props:d},o),h=s.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const M=[...u,...m.dom.attributes].filter(I=>I.name.startsWith("data")&&I.name!=="data-content-type"&&I.name!=="data-file-block"&&I.name!=="data-node-view-wrapper"&&I.name!=="data-node-type"&&I.name!=="data-id"&&I.name!=="data-index"&&I.name!=="data-editable");for(const I of M)m.dom.firstChild.setAttribute(I.name,I.value);ao(m.dom.firstChild),h.append(...m.dom.childNodes)}else h.append(m.dom);if(m.contentDOM&&t.content){const M=so(o,t.content,i,a);m.contentDOM.appendChild(M)}let f;if(n.has(t.type)?f="OL":r.has(t.type)&&(f="UL"),f){if(((_=e.lastChild)==null?void 0:_.nodeName)!==f){const I=s.createElement(f);f==="OL"&&(d!=null&&d.start)&&(d==null?void 0:d.start)!==1&&I.setAttribute("start",d.start+""),e.append(I)}const M=s.createElement("li");M.append(h),e.lastChild.appendChild(M)}else e.append(h);if(t.children&&t.children.length>0){const M=s.createDocumentFragment();if(lo(M,o,t.children,i,n,r,a),((w=e.lastChild)==null?void 0:w.nodeName)==="UL"||((v=e.lastChild)==null?void 0:v.nodeName)==="OL")for(;((x=M.firstChild)==null?void 0:x.nodeName)==="UL"||((B=M.firstChild)==null?void 0:B.nodeName)==="OL";)e.lastChild.lastChild.appendChild(M.firstChild);o.pmSchema.nodes[t.type].isInGroup("blockContent")?e.append(M):(z=m.contentDOM)==null||z.append(M)}}const lo=(e,o,t,i,n,r,a)=>{for(const s of t)Qn(e,o,s,i,n,r,a)},er=(e,o,t,i,n,r)=>{const s=((r==null?void 0:r.document)??document).createDocumentFragment();return lo(s,e,o,t,i,n,r),s},ye=(e,o)=>{const t=S.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const r=er(o,i,t,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),a=document.createElement("div");return a.append(r),a.innerHTML},exportInlineContent:(i,n)=>{const r=so(o,i,t,n),a=document.createElement("div");return a.append(r.cloneNode(!0)),a.innerHTML}}};function tr(e,o,t,i,n){let r;if(o)if(typeof o=="string")r=U([o],e.pmSchema,e.schema.styleSchema,i);else if(Array.isArray(o))r=U(o,e.pmSchema,e.schema.styleSchema,i);else if(o.type==="tableContent")r=_e(o,e.pmSchema,e.schema.styleSchema);else throw new O(o.type);else throw new Error("blockContent is required");return t.serializeFragment(S.Fragment.from(r),n)}function or(e,o,t,i,n){var u,m,h,f,g;const r=e.pmSchema.nodes.blockContainer;let a=o.props;if(!o.props){a={};for(const[b,_]of Object.entries(e.schema.blockSchema[o.type].propSchema))_.default!==void 0&&(a[b]=_.default)}const l=e.blockImplementations[o.type].implementation.toInternalHTML({...o,props:a},e);if(o.type==="numberedListItem"&&l.dom.setAttribute("data-index",i.toString()),l.contentDOM&&o.content){const b=tr(e,o.content,t,o.type,n);l.contentDOM.appendChild(b)}if(e.pmSchema.nodes[o.type].isInGroup("bnBlock")){if(o.children&&o.children.length>0){const b=co(e,o.children,t,n);(u=l.contentDOM)==null||u.append(b)}return l.dom}const c=(h=(m=r.spec)==null?void 0:m.toDOM)==null?void 0:h.call(m,r.create({id:o.id,...a}));return(f=c.contentDOM)==null||f.appendChild(l.dom),o.children&&o.children.length>0&&((g=c.contentDOM)==null||g.appendChild(uo(e,o.children,t,n))),c.dom}function co(e,o,t,i){const r=((i==null?void 0:i.document)??document).createDocumentFragment();let a=0;for(const s of o){s.type==="numberedListItem"?a++:a=0;const l=or(e,s,t,a,i);r.appendChild(l)}return r}const uo=(e,o,t,i)=>{var s;const n=e.pmSchema.nodes.blockGroup,r=n.spec.toDOM(n.create({})),a=co(e,o,t,i);return(s=r.contentDOM)==null||s.appendChild(a),r.dom},po=(e,o)=>{const t=S.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>uo(o,i,t,n).outerHTML}},we=(e,o)=>{const t=e.querySelector(o);if(!t)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:t,caption:n}},mo=(e,o,t,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const r=document.createElement("div");r.className="bn-add-file-button-icon",i?r.appendChild(i):r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',n.appendChild(r);const a=document.createElement("p");a.className="bn-add-file-button-text",a.innerHTML=t||o.dictionary.file_blocks.file.add_button_text,n.appendChild(a);const s=d=>{d.preventDefault()},l=()=>{o.dispatch(o._tiptapEditor.state.tr.setMeta(o.filePanel.plugin,{block:e}))};return n.addEventListener("mousedown",s,!0),n.addEventListener("click",l,!0),{dom:n,destroy:()=>{n.removeEventListener("mousedown",s,!0),n.removeEventListener("click",l,!0)}}},ho='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',fo=e=>{const o=document.createElement("div");o.className="bn-file-name-with-icon";const t=document.createElement("div");t.className="bn-file-icon",t.innerHTML=ho,o.appendChild(t);const i=document.createElement("p");return i.className="bn-file-name",i.textContent=e.props.name,o.appendChild(i),{dom:o}},Re=(e,o,t,i,n)=>{const r=document.createElement("div");if(r.className="bn-file-block-content-wrapper",e.props.url===""){const s=mo(e,o,i,n);r.appendChild(s.dom);const l=o.onUploadStart(d=>{if(d===e.id){r.removeChild(s.dom);const c=document.createElement("div");c.className="bn-file-loading-preview",c.textContent="Loading...",r.appendChild(c)}});return{dom:r,destroy:()=>{l(),s.destroy()}}}const a={dom:r};if(e.props.showPreview===!1||!t){const s=fo(e);r.appendChild(s.dom),a.destroy=()=>{var l;(l=s.destroy)==null||l.call(s)}}else r.appendChild(t.dom);if(e.props.caption){const s=document.createElement("p");s.className="bn-file-caption",s.textContent=e.props.caption,r.appendChild(s)}return a},Ue=(e,o)=>{const t=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=o,t.appendChild(e),t.appendChild(i),{dom:t}},ve=(e,o)=>{const t=document.createElement("div"),i=document.createElement("p");return i.textContent=o,t.appendChild(e),t.appendChild(i),{dom:t}},Tt=e=>({url:e.src||void 0}),go='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>',bo={backgroundColor:P.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},ko={type:"audio",propSchema:bo,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},_o=(e,o)=>{const t=document.createElement("div");t.innerHTML=go;const i=document.createElement("audio");return i.className="bn-audio",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(n=>{i.src=n}):i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,Re(e,o,{dom:i},o.dictionary.file_blocks.audio.add_button_text,t.firstElementChild)},yo=e=>{if(e.tagName==="AUDIO")return Tt(e);if(e.tagName==="FIGURE"){const o=we(e,"audio");if(!o)return;const{targetElement:t,caption:i}=o;return{...Tt(t),caption:i}}},wo=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add audio",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("audio"),o.src=e.props.url):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Ue(o,e.props.caption):ve(o,e.props.caption):{dom:o}},vo=pe(ko,{render:_o,parse:yo,toExternalHTML:wo}),Co=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...Ke.bundledLanguagesInfo.filter(e=>["c","cpp","css","glsl","graphql","haml","html","java","javascript","json","jsonc","jsonl","jsx","julia","less","markdown","mdx","php","postcss","pug","python","r","regexp","sass","scss","shellscript","sql","svelte","typescript","vue","vue-html","wasm","wgsl","xml","yaml"].includes(e.id)).map(e=>({match:[e.id,...e.aliases||[]],id:e.id,name:e.name})),{id:"tsx",name:"TSX",match:["tsx","typescriptreact"]},{id:"haskell",name:"Haskell",match:["haskell","hs"]},{id:"csharp",name:"C#",match:["c#","csharp","cs"]},{id:"latex",name:"LaTeX",match:["latex"]},{id:"lua",name:"Lua",match:["lua"]},{id:"mermaid",name:"Mermaid",match:["mermaid","mmd"]},{id:"ruby",name:"Ruby",match:["ruby","rb"]},{id:"rust",name:"Rust",match:["rust","rs"]},{id:"scala",name:"Scala",match:["scala"]},{id:"swift",name:"Swift",match:["swift"]},{id:"kotlin",name:"Kotlin",match:["kotlin","kt","kts"]},{id:"objective-c",name:"Objective C",match:["objective-c","objc"]}],et=Symbol.for("blocknote.shikiParser"),Ee=Symbol.for("blocknote.shikiHighlighterPromise"),Le={language:{default:"javascript",values:[...Co.map(e=>e.id)]}},xo=$({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:Co}},addAttributes(){const e=this.options.supportedLanguages;return{language:{default:this.options.defaultLanguage,parseHTML:o=>{var r;let t=o,i=null;(t==null?void 0:t.tagName)==="DIV"&&(t==null?void 0:t.dataset.contentType)==="codeBlock"&&(t=t.children[0]),(t==null?void 0:t.tagName)==="PRE"&&(t=t==null?void 0:t.children[0]);const n=t==null?void 0:t.getAttribute("data-language");if(n)i=n.toLowerCase();else{const s=[...(t==null?void 0:t.className.split(" "))||[]].filter(l=>l.startsWith("language-")).map(l=>l.replace("language-",""));s.length>0&&(i=s[0].toLowerCase())}return i?((r=e.find(({match:a})=>a.includes(i)))==null?void 0:r.id)||this.options.defaultLanguage:null},renderHTML:o=>o.language&&o.language!=="text"?{class:`language-${o.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",contentElement:"code"},{tag:"pre",contentElement:"code",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,r;const o=document.createElement("pre"),{dom:t,contentDOM:i}=F(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{},...e});return t.removeChild(i),t.appendChild(o),o.appendChild(i),{dom:t,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:o,node:t,getPos:i,HTMLAttributes:n})=>{var u,m;const r=document.createElement("pre"),a=document.createElement("select"),s=document.createElement("div"),{dom:l,contentDOM:d}=F(this.name,"code",{...((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),c=h=>{const f=h.target.value;o.commands.command(({tr:g})=>(g.setNodeAttribute(i(),"language",f),!0))};return e.forEach(({id:h,name:f})=>{const g=document.createElement("option");g.value=h,g.text=f,a.appendChild(g)}),s.contentEditable="false",a.value=t.attrs.language||this.options.defaultLanguage,l.removeChild(d),l.appendChild(s),l.appendChild(r),r.appendChild(d),s.appendChild(a),a.addEventListener("change",c),{dom:l,contentDOM:d,update:h=>h.type===this.type,destroy:()=>{a.removeEventListener("change",c)}}}},addProseMirrorPlugins(){const e=this.options.supportedLanguages,o=globalThis;let t,i;const n=a=>{if(!t)return o[Ee]=o[Ee]||Ke.createHighlighter({themes:["github-dark"],langs:[]}),o[Ee].then(l=>{t=l});const s=a.language;return s&&s!=="text"&&!t.getLoadedLanguages().includes(s)&&e.find(({id:l})=>l===s)&&Ke.bundledLanguagesInfo.find(({id:l})=>l===s)?t.loadLanguage(s):(i||(i=o[et]||Xi.createParser(t),o[et]=i),i(a))};return[Zi.createHighlightPlugin({parser:n,languageExtractor:a=>a.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:o,range:t,match:i})=>{var s;const n=o.doc.resolve(t.from),r=i[1].trim(),a={language:((s=e.find(({match:l})=>l.includes(r)))==null?void 0:s.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;o.tr.delete(t.from,t.to).setBlockType(t.from,t.from,this.type,a).setSelection(y.TextSelection.create(o.tr.doc,t.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:o}=e.state,{$from:t}=o;if(e.isActive(this.name)&&!t.parent.textContent&&k.isTextSelection(o)){const i=t.pos-t.parentOffset-2;return e.chain().setNodeSelection(i).deleteSelection().run(),!0}return!1},Tab:({editor:e})=>this.options.indentLineWithTab&&e.isActive(this.name)?(e.commands.insertContent(" "),!0):!1,Enter:({editor:e})=>{const{$from:o}=e.state.selection;if(!e.isActive(this.name))return!1;const t=o.parentOffset===o.parent.nodeSize-2,i=o.parent.textContent.endsWith(`
|
|
1
|
+
"use strict";var zn=Object.create;var We=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var qn=Object.getOwnPropertyNames;var jn=Object.getPrototypeOf,Kn=Object.prototype.hasOwnProperty;var Gn=(e,o,t)=>o in e?We(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var Xn=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of qn(o))!Kn.call(e,r)&&r!==t&&We(e,r,{get:()=>o[r],enumerable:!(n=Wn(o,r))||n.enumerable});return e};var V=(e,o,t)=>(t=e!=null?zn(jn(e)):{},Xn(o||!e||!e.__esModule?We(t,"default",{value:e,enumerable:!0}):t,e));var p=(e,o,t)=>Gn(e,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("prosemirror-model"),Ie=require("prosemirror-transform"),k=require("@tiptap/core"),y=require("prosemirror-state"),Wt=require("uuid"),Jn=require("prosemirror-highlight"),Yn=require("prosemirror-highlight/shiki"),P=require("prosemirror-tables"),Zn=require("@tiptap/extension-bold"),Qn=require("@tiptap/extension-code"),er=require("@tiptap/extension-italic"),tr=require("@tiptap/extension-strike"),or=require("@tiptap/extension-underline"),nr=require("@tiptap/extension-table-cell"),rr=require("@tiptap/extension-table-header"),sr=require("@tiptap/extension-table-row"),ir=require("@tiptap/extension-gapcursor"),ar=require("@tiptap/extension-history"),lr=require("@tiptap/extension-link"),cr=require("@tiptap/extension-text"),dr=require("@tiptap/extension-collaboration"),ur=require("@tiptap/extension-collaboration-cursor"),x=require("prosemirror-view"),Ge=require("y-prosemirror"),pr=require("prosemirror-dropcursor"),hr=require("./en-D4taoCs4.cjs"),ne=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},fr=ne(Zn),mr=ne(Qn),gr=ne(er),br=ne(tr),kr=ne(or),wr=ne(dr),yr=ne(ur);class F extends Error{constructor(o){super(`Unreachable case: ${o}`)}}function Cr(e,o=!0){const{"data-test":t,...n}=e;if(Object.keys(n).length>0&&o)throw new Error("Object must be empty "+JSON.stringify(e))}function K(e,o){const t=e.resolve(o);if(t.nodeAfter&&t.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:t.pos,node:t.nodeAfter};let n=t.depth,r=t.node(n);for(;n>0;){if(r.type.isInGroup("bnBlock"))return{posBeforeNode:t.before(n),node:r};n--,r=t.node(n)}const s=[];e.descendants((a,l)=>{a.type.isInGroup("bnBlock")&&s.push(l)}),console.warn(`Position ${o} is not within a blockContainer node.`);const i=e.resolve(s.find(a=>a>=o)||s[s.length-1]);return{posBeforeNode:i.pos,node:i.nodeAfter}}function Oe(e,o){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const t=e,n=o,r=n+t.nodeSize,s={node:t,beforePos:n,afterPos:r};if(t.type.name==="blockContainer"){let i,a;if(t.forEach((l,c)=>{if(l.type.spec.group==="blockContent"){const d=l,u=n+c+1,h=u+l.nodeSize;i={node:d,beforePos:u,afterPos:h}}else if(l.type.name==="blockGroup"){const d=l,u=n+c+1,h=u+l.nodeSize;a={node:d,beforePos:u,afterPos:h}}}),!i)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${t}`);return{isBlockContainer:!0,bnBlock:s,blockContent:i,childContainer:a,blockNoteType:i.node.type.name}}else{if(!s.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${s.node}`);return{isBlockContainer:!1,bnBlock:s,childContainer:s,blockNoteType:s.node.type.name}}}function Q(e){return Oe(e.node,e.posBeforeNode)}function ue(e){if(!e.nodeAfter)throw new Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return Oe(e.nodeAfter,e.pos)}function v(e){const o=K(e.doc,e.selection.anchor);return Q(o)}function vr(e,o=JSON.stringify){const t={};return e.filter(n=>{const r=o(n);return Object.prototype.hasOwnProperty.call(t,r)?!1:t[r]=!0})}function Sr(e){const o=e.filter((n,r)=>e.indexOf(n)!==r);return vr(o)}const pe=k.Extension.create({name:"uniqueID",priority:1e4,addOptions(){return{attributeName:"id",types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<"u"&&window.__TEST_OPTIONS){const e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return Wt.v4()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{const o={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...o,id:e[this.options.attributeName]}:o}}}}]},addProseMirrorPlugins(){let e=null,o=!1;return[new y.Plugin({key:new y.PluginKey("uniqueID"),appendTransaction:(t,n,r)=>{const s=t.some(m=>m.docChanged)&&!n.doc.eq(r.doc),i=this.options.filterTransaction&&t.some(m=>{let g,b;return!(!((b=(g=this.options).filterTransaction)===null||b===void 0)&&b.call(g,m))});if(!s||i)return;const{tr:a}=r,{types:l,attributeName:c,generateID:d}=this.options,u=k.combineTransactionSteps(n.doc,t),{mapping:h}=u;if(k.getChangedRanges(u).forEach(({newRange:m})=>{const g=k.findChildrenInRange(r.doc,m,C=>l.includes(C.type.name)),b=g.map(({node:C})=>C.attrs[c]).filter(C=>C!==null),w=Sr(b);g.forEach(({node:C,pos:S})=>{let A;const W=(A=a.doc.nodeAt(S))===null||A===void 0?void 0:A.attrs[c];if(W===null){const E=n.doc.type.createAndFill().content;if(n.doc.content.findDiffStart(E)===null){const re=JSON.parse(JSON.stringify(r.doc.toJSON()));if(re.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(re.content)===JSON.stringify(E.toJSON())){a.setNodeMarkup(S,void 0,{...C.attrs,[c]:"initialBlockId"});return}}a.setNodeMarkup(S,void 0,{...C.attrs,[c]:d()});return}const{deleted:q}=h.invert().mapResult(S);q&&w.includes(W)&&a.setNodeMarkup(S,void 0,{...C.attrs,[c]:d()})})}),!!a.steps.length)return a},view(t){const n=r=>{let s;e=!((s=t.dom.parentElement)===null||s===void 0)&&s.contains(r.target)?t.dom.parentElement:null};return window.addEventListener("dragstart",n),{destroy(){window.removeEventListener("dragstart",n)}}},props:{handleDOMEvents:{drop:(t,n)=>{let r;return e!==t.dom.parentElement||((r=n.dataTransfer)===null||r===void 0?void 0:r.effectAllowed)==="copy"?o=!0:o=!1,e=null,!1},paste:()=>(o=!0,!1)},transformPasted:t=>{if(!o)return t;const{types:n,attributeName:r}=this.options,s=i=>{const a=[];return i.forEach(l=>{if(l.isText){a.push(l);return}if(!n.includes(l.type.name)){a.push(l.copy(s(l.content)));return}const c=l.type.create({...l.attrs,[r]:null},s(l.content),l.marks);a.push(c)}),B.Fragment.from(a)};return o=!1,new B.Slice(s(t.content),t.openStart,t.openEnd)}}})]}});function Xe(e){return e.type==="link"}function _e(e){return typeof e!="string"&&e.type==="link"}function G(e){return typeof e!="string"&&e.type==="text"}function Le(e){var o,t,n,r,s;return Re(e)?{...e}:ce(e)?{type:"tableCell",content:[].concat(e.content),props:{backgroundColor:((o=e.props)==null?void 0:o.backgroundColor)??"default",textColor:((t=e.props)==null?void 0:t.textColor)??"default",textAlignment:((n=e.props)==null?void 0:n.textAlignment)??"left",colspan:((r=e.props)==null?void 0:r.colspan)??1,rowspan:((s=e.props)==null?void 0:s.rowspan)??1}}:{type:"tableCell",content:[].concat(e),props:{backgroundColor:"default",textColor:"default",textAlignment:"left",colspan:1,rowspan:1}}}function ce(e){return e!=null&&typeof e!="string"&&!Array.isArray(e)&&e.type==="tableCell"}function Re(e){return ce(e)&&e.props!==void 0&&e.content!==void 0}function de(e){return Re(e)?e.props.colspan??1:1}function Ae(e){return Re(e)?e.props.rowspan??1:1}const qt=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function j(e,o="Ctrl"){return qt()?e.replace("Mod","⌘"):e.replace("Mod",o)}function X(...e){return e.filter(o=>o).join(" ")}const Er=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function $(e,o,t,n){const r=document.createElement("div");r.className=X("bn-block-content",t.class),r.setAttribute("data-content-type",e);for(const[i,a]of Object.entries(t))i!=="class"&&r.setAttribute(i,a);const s=document.createElement(o);s.className=X("bn-inline-content",n.class);for(const[i,a]of Object.entries(n))i!=="class"&&s.setAttribute(i,a);return r.appendChild(s),{dom:r,contentDOM:s}}const Je=(e,o)=>{let t=te(e,o.pmSchema,o.schema.styleSchema);t.type.name==="blockContainer"&&(t=t.firstChild);const n=o.pmSchema.nodes[t.type.name].spec.toDOM;if(n===void 0)throw new Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");const r=n(t);if(typeof r!="object"||!("dom"in r))throw new Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return r},M={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},at=["backgroundColor","textColor"];function ke(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Br(e){const o=e.split("/");return!o.length||o[o.length-1]===""?e:o[o.length-1]}function he(e){const o={};return Object.entries(e).filter(([t,n])=>!at.includes(t)).forEach(([t,n])=>{o[t]={default:n.default,keepOnSplit:!0,parseHTML:r=>{const s=r.getAttribute(ke(t));if(s===null)return null;if(n.default===void 0&&n.type==="boolean"||n.default!==void 0&&typeof n.default=="boolean")return s==="true"?!0:s==="false"?!1:null;if(n.default===void 0&&n.type==="number"||n.default!==void 0&&typeof n.default=="number"){const i=parseFloat(s);return!Number.isNaN(i)&&Number.isFinite(i)?i:null}return s},renderHTML:r=>r[t]!==n.default?{[ke(t)]:r[t]}:{}}}),o}function jt(e,o,t,n){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const r=e(),i=t.state.doc.resolve(r).node().attrs.id;if(!i)throw new Error("Block doesn't have id");const a=o.getBlock(i);if(a.type!==n)throw new Error("Block type does not match");return a}function be(e,o,t,n,r=!1,s){const i=document.createElement("div");if(s!==void 0)for(const[a,l]of Object.entries(s))a!=="class"&&i.setAttribute(a,l);i.className=X("bn-block-content",(s==null?void 0:s.class)||""),i.setAttribute("data-content-type",o);for(const[a,l]of Object.entries(t)){const d=n[a].default;!at.includes(a)&&l!==d&&i.setAttribute(ke(a),l)}return r&&i.setAttribute("data-file-block",""),i.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=X("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:i}}function z(e){return k.Node.create(e)}function lt(e,o){return{config:e,implementation:o}}function J(e,o,t){return lt({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:o},{node:e,requiredExtensions:t,toInternalHTML:Je,toExternalHTML:Je})}function ct(e){return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t.config]))}function Kt(e,o){e.stopEvent=t=>(t.type==="mousedown"&&setTimeout(()=>{o.view.dom.blur()},10),!0)}function Gt(e,o){const t=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return o&&t.push({tag:"*",getAttrs(n){if(typeof n=="string")return!1;const r=o==null?void 0:o(n);return r===void 0?!1:r}}),t}function fe(e,o){const t=z({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,isolating:!0,addAttributes(){return he(e.propSchema)},parseHTML(){return Gt(e,o.parse)},renderHTML({HTMLAttributes:n}){const r=document.createElement("div");return be({dom:r,contentDOM:e.content==="inline"?r:void 0},e.type,{},e.propSchema,e.isFileBlock,n)},addNodeView(){return({getPos:n})=>{var c;const r=this.options.editor,s=jt(n,r,this.editor,e.type),i=((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},a=o.render(s,r),l=be(a,s.type,s.props,e.propSchema,i);return e.isSelectable===!1&&Kt(l,this.editor),l}}});if(t.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return lt(e,{node:t,toInternalHTML:(n,r)=>{var a;const s=((a=t.options.domAttributes)==null?void 0:a.blockContent)||{},i=o.render(n,r);return be(i,n.type,n.props,e.propSchema,e.isFileBlock,s)},toExternalHTML:(n,r)=>{var a,l;const s=((a=t.options.domAttributes)==null?void 0:a.blockContent)||{};let i=(l=o.toExternalHTML)==null?void 0:l.call(o,n,r);return i===void 0&&(i=o.render(n,r)),be(i,n.type,n.props,e.propSchema,s)}})}function dt(e,o,t){var s,i;const n={type:"tableContent",columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},r=[];e.content.forEach((a,l,c)=>{const d={cells:[]};c===0&&a.content.forEach(u=>{let h=u.attrs.colwidth;h==null&&(h=new Array(u.attrs.colspan??1).fill(void 0)),n.columnWidths.push(...h)}),d.cells=a.content.content.map((u,h)=>(r[c]||(r[c]=[]),r[c][h]=u.type.name==="tableHeader",{type:"tableCell",content:u.content.content.map(m=>ye(m,o,t)).reduce((m,g)=>{if(!m.length)return g;const b=m[m.length-1],w=g[0];return w&&G(b)&&G(w)&&JSON.stringify(b.styles)===JSON.stringify(w.styles)?(b.text+=`
|
|
2
|
+
`+w.text,m.push(...g.slice(1)),m):(m.push(...g),m)},[]),props:{colspan:u.attrs.colspan,rowspan:u.attrs.rowspan,backgroundColor:u.attrs.backgroundColor,textColor:u.attrs.textColor,textAlignment:u.attrs.textAlignment}})),n.rows.push(d)});for(let a=0;a<r.length;a++)(s=r[a])!=null&&s.every(l=>l)&&(n.headerRows=(n.headerRows??0)+1);for(let a=0;a<((i=r[0])==null?void 0:i.length);a++)r!=null&&r.every(l=>l[a])&&(n.headerCols=(n.headerCols??0)+1);return n}function ye(e,o,t){const n=[];let r;return e.content.forEach(s=>{if(s.type.name==="hardBreak"){if(r)if(G(r))r.text+=`
|
|
3
|
+
`;else if(Xe(r))r.content[r.content.length-1].text+=`
|
|
4
|
+
`;else throw new Error("unexpected");else r={type:"text",text:`
|
|
5
|
+
`,styles:{}};return}if(s.type.name!=="link"&&s.type.name!=="text"){if(!o[s.type.name]){console.warn("unrecognized inline content type",s.type.name);return}r&&(n.push(r),r=void 0),n.push(Ne(s,o,t));return}const i={};let a;for(const l of s.marks)if(l.type.name==="link")a=l;else{const c=t[l.type.name];if(!c){if(l.type.spec.blocknoteIgnore)continue;throw new Error(`style ${l.type.name} not found in styleSchema`)}if(c.propSchema==="boolean")i[c.type]=!0;else if(c.propSchema==="string")i[c.type]=l.attrs.stringValue;else throw new F(c.propSchema)}r?G(r)?a?(n.push(r),r={type:"link",href:a.attrs.href,content:[{type:"text",text:s.textContent,styles:i}]}):JSON.stringify(r.styles)===JSON.stringify(i)?r.text+=s.textContent:(n.push(r),r={type:"text",text:s.textContent,styles:i}):Xe(r)&&(a?r.href===a.attrs.href?JSON.stringify(r.content[r.content.length-1].styles)===JSON.stringify(i)?r.content[r.content.length-1].text+=s.textContent:r.content.push({type:"text",text:s.textContent,styles:i}):(n.push(r),r={type:"link",href:a.attrs.href,content:[{type:"text",text:s.textContent,styles:i}]}):(n.push(r),r={type:"text",text:s.textContent,styles:i})):a?r={type:"link",href:a.attrs.href,content:[{type:"text",text:s.textContent,styles:i}]}:r={type:"text",text:s.textContent,styles:i}}),r&&n.push(r),n}function Ne(e,o,t){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const n={},r=o[e.type.name];for(const[a,l]of Object.entries(e.attrs)){if(!r)throw Error("ic node is of an unrecognized type: "+e.type.name);const c=r.propSchema;a in c&&(n[a]=l)}let s;return r.content==="styled"?s=ye(e,o,t):s=void 0,{type:e.type.name,props:n,content:s}}function T(e,o,t,n,r){var m;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const s=r==null?void 0:r.get(e);if(s)return s;const i=Oe(e,0);let a=i.bnBlock.node.attrs.id;a===null&&(a=pe.options.generateID());const l=o[i.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+i.blockNoteType);const c={};for(const[g,b]of Object.entries({...e.attrs,...i.isBlockContainer?i.blockContent.node.attrs:{}})){const w=l.propSchema;g in w&&!(w[g].default===void 0&&b===void 0)&&(c[g]=b)}const d=o[i.blockNoteType],u=[];(m=i.childContainer)==null||m.node.forEach(g=>{u.push(T(g,o,t,n,r))});let h;if(d.content==="inline"){if(!i.isBlockContainer)throw new Error("impossible");h=ye(i.blockContent.node,t,n)}else if(d.content==="table"){if(!i.isBlockContainer)throw new Error("impossible");h=dt(i.blockContent.node,t,n)}else if(d.content==="none")h=void 0;else throw new F(d.content);const f={id:a,type:d.type,props:c,content:h,children:u};return r==null||r.set(e,f),f}function Ye(e,o,t,n){return e.dom.setAttribute("data-inline-content-type",o),Object.entries(t).filter(([r,s])=>{const i=n[r];return s!==i.default}).map(([r,s])=>[ke(r),s]).forEach(([r,s])=>e.dom.setAttribute(r,s)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Xt(e){return{Backspace:({editor:o})=>{const t=o.state.selection.$from;return o.state.selection.empty&&t.node().type.name===e.type&&t.parentOffset===0}}}function Jt(e,o){return{config:e,implementation:o}}function Yt(e,o){return Jt({type:e.name,propSchema:o,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function ut(e){return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t.config]))}function Zt(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:o=>{const t=o;return t.matches("[data-editable]")?t:t.querySelector("[data-editable]")||t}}]}function Tr(e,o){const t=k.Node.create({name:e.type,inline:!0,group:"inline",selectable:e.content==="styled",atom:e.content==="none",content:e.content==="styled"?"inline*":"",addAttributes(){return he(e.propSchema)},addKeyboardShortcuts(){return Xt(e)},parseHTML(){return Zt(e)},renderHTML({node:n}){const r=this.options.editor,s=o.render(Ne(n,r.schema.inlineContentSchema,r.schema.styleSchema),()=>{},r);return Ye(s,e.type,n.attrs,e.propSchema)},addNodeView(){return({node:n,getPos:r})=>{const s=this.options.editor,i=o.render(Ne(n,s.schema.inlineContentSchema,s.schema.styleSchema),a=>{if(typeof r=="boolean")return;const l=R([a],s._tiptapEditor.schema,s.schema.styleSchema);s.dispatch(s.prosemirrorView.state.tr.replaceWith(r(),r()+n.nodeSize,l))},s);return Ye(i,e.type,n.attrs,e.propSchema)}}});return Yt(t,e.propSchema)}function Qt(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:o=>o.getAttribute("data-value"),renderHTML:o=>o.stringValue!==void 0?{"data-value":o.stringValue}:{}}}}function eo(e,o,t,n){return e.dom.setAttribute("data-style-type",o),n==="string"&&e.dom.setAttribute("data-value",t),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function pt(e,o){return{config:e,implementation:o}}function Z(e,o){return pt({type:e.name,propSchema:o},{mark:e})}function ht(e){return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t.config]))}function to(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:o=>{const t=o;return t.matches("[data-editable]")?t:t.querySelector("[data-editable]")||t}}]}function xr(e,o){const t=k.Mark.create({name:e.type,addAttributes(){return Qt(e.propSchema)},parseHTML(){return to(e)},renderHTML({mark:n}){let r;if(e.propSchema==="boolean")r=o.render();else if(e.propSchema==="string")r=o.render(n.attrs.stringValue);else throw new F(e.propSchema);return eo(r,e.type,n.attrs.stringValue,e.propSchema)}});return pt(e,{mark:t})}function ee(e){const{height:o,width:t}=ft(e),n=new Array(o).fill(!1).map(()=>new Array(t).fill(null)),r=(s,i)=>{for(let a=s;a<o;a++)for(let l=i;l<t;l++)if(!n[a][l])return{row:a,col:l};throw new Error("Unable to create occupancy grid for table, no more available cells")};for(let s=0;s<e.content.rows.length;s++)for(let i=0;i<e.content.rows[s].cells.length;i++){const a=Le(e.content.rows[s].cells[i]),l=Ae(a),c=de(a),{row:d,col:u}=r(s,i);for(let h=d;h<d+l;h++)for(let f=u;f<u+c;f++){if(n[h][f])throw new Error(`Unable to create occupancy grid for table, cell at ${h},${f} is already occupied`);n[h][f]={row:s,col:i,rowspan:l,colspan:c,cell:a}}}return n}function we(e){const o=new Set;return e.map(t=>({cells:t.map(n=>o.has(n.row+":"+n.col)?!1:(o.add(n.row+":"+n.col),n.cell)).filter(n=>n!==!1)}))}function oe(e,o,t=ee(o)){for(let n=0;n<t.length;n++)for(let r=0;r<t[n].length;r++){const s=t[n][r];if(s.row===e.row&&s.col===e.col)return{row:n,col:r,cell:s.cell}}throw new Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function ft(e){const o=e.content.rows.length;let t=0;return e.content.rows.forEach(n=>{let r=0;n.cells.forEach(s=>{r+=de(s)}),t=Math.max(t,r)}),{height:o,width:t}}function oo(e,o,t=ee(o)){var r;const n=(r=t[e.row])==null?void 0:r[e.col];if(n)return{row:n.row,col:n.col,cell:n.cell}}function Ze(e,o){var s;const t=ee(e);if(o<0||o>=t.length)return[];let n=0;for(let i=0;i<o;i++){const a=(s=t[n])==null?void 0:s[0];if(!a)return[];n+=a.rowspan}const r=new Array(t[0].length).fill(!1).map((i,a)=>oo({row:n,col:a},e,t)).filter(i=>i!==void 0);return r.filter((i,a)=>r.findIndex(l=>l.row===i.row&&l.col===i.col)===a)}function Qe(e,o){var s;const t=ee(e);if(o<0||o>=t[0].length)return[];let n=0;for(let i=0;i<o;i++){const a=(s=t[0])==null?void 0:s[n];if(!a)return[];n+=a.colspan}const r=new Array(t.length).fill(!1).map((i,a)=>oo({row:a,col:n},e,t)).filter(i=>i!==void 0);return r.filter((i,a)=>r.findIndex(l=>l.row===i.row&&l.col===i.col)===a)}function Mr(e,o,t,n=ee(e)){const{col:r}=oe({row:0,col:o},e,n),{col:s}=oe({row:0,col:t},e,n);return n.forEach(i=>{const[a]=i.splice(r,1);i.splice(s,0,a)}),we(n)}function Pr(e,o,t,n=ee(e)){const{row:r}=oe({row:o,col:0},e,n),{row:s}=oe({row:t,col:0},e,n),[i]=n.splice(r,1);return n.splice(s,0,i),we(n)}function et(e){return e?ce(e)?et(e.content):typeof e=="string"?e.length===0:Array.isArray(e)?e.every(o=>typeof o=="string"?o.length===0:G(o)?o.text.length===0:_e(o)?typeof o.content=="string"?o.content.length===0:o.content.every(t=>t.text.length===0):!1):!1:!0}function Ir(e,o,t=ee(e)){if(o==="columns"){let s=0;for(let i=t[0].length-1;i>=0&&t.every(l=>et(l[i].cell)&&l[i].colspan===1);i--)s++;for(let i=t.length-1;i>=0;i--){const a=Math.max(t[i].length-s,1);t[i]=t[i].slice(0,a)}return we(t)}let n=0;for(let s=t.length-1;s>=0&&t[s].every(a=>et(a.cell)&&a.rowspan===1);s--)n++;const r=Math.min(n,t.length-1);return t.splice(t.length-r,r),we(t)}function Lr(e,o,t,n=ee(e)){const{width:r,height:s}=ft(e);if(o==="columns")n.forEach((i,a)=>{if(t>=0)for(let l=0;l<t;l++)i.push({row:a,col:Math.max(...i.map(c=>c.col))+1,rowspan:1,colspan:1,cell:Le("")});else i.splice(r+t,-1*t)});else if(t>0)for(let i=0;i<t;i++){const a=new Array(r).fill(null).map((l,c)=>({row:s+i,col:c,rowspan:1,colspan:1,cell:Le("")}));n.push(a)}else t<0&&n.splice(s+t,-1*t);return we(n)}function no(e,o,t){const n=Ze(e,t);if(!n.some(l=>Ae(l.cell)>1))return!0;let s=t,i=t;return n.forEach(l=>{const c=Ae(l.cell);s=Math.max(s,l.row+c-1),i=Math.min(i,l.row)}),o<t?t===s:t===i}function ro(e,o,t){const n=Qe(e,t);if(!n.some(l=>de(l.cell)>1))return!0;let s=t,i=t;return n.forEach(l=>{const c=de(l.cell);s=Math.max(s,l.col+c-1),i=Math.min(i,l.col)}),o<t?t===s:t===i}function Ar(e,o,t){const n=oe(e,t),r=oe(o,t);return n.col===r.col}function xt(e,o,t,n){const r=[];for(const[i,a]of Object.entries(e.styles)){const l=t[i];if(!l)throw new Error(`style ${i} not found in styleSchema`);if(l.propSchema==="boolean")r.push(o.mark(i));else if(l.propSchema==="string")r.push(o.mark(i,{stringValue:a}));else throw new F(l.propSchema)}return!n||!o.nodes[n].spec.code?e.text.split(/(\n)/g).filter(i=>i.length>0).map(i=>i===`
|
|
6
|
+
`?o.nodes.hardBreak.createChecked():o.text(i,r)):[o.text(e.text,r)]}function Nr(e,o,t){const n=o.marks.link.create({href:e.href});return tt(e.content,o,t).map(r=>{if(r.type.name==="text")return r.mark([...r.marks,n]);if(r.type.name==="hardBreak")return r;throw new Error("unexpected node type")})}function tt(e,o,t,n){const r=[];if(typeof e=="string")return r.push(...xt({text:e,styles:{}},o,t,n)),r;for(const s of e)r.push(...xt(s,o,t,n));return r}function R(e,o,t,n){const r=[];for(const s of e)typeof s=="string"?r.push(...tt(s,o,t,n)):_e(s)?r.push(...Nr(s,o,t)):G(s)?r.push(...tt([s],o,t,n)):r.push(so(s,o,t));return r}function Ce(e,o,t){const n=[],r=new Array(e.headerRows??0).fill(!0),s=new Array(e.headerCols??0).fill(!0),i=e.columnWidths??[];for(let a=0;a<e.rows.length;a++){const l=e.rows[a],c=[],d=r[a];for(let h=0;h<l.cells.length;h++){const f=l.cells[h],m=s[h],g=void 0;let b=null;const w=oe({row:a,col:h},{content:e});let C=i[w.col]?[i[w.col]]:null;if(f)if(typeof f=="string")b=o.text(f);else if(ce(f)){f.content&&(b=R(f.content,o,t));const A=de(f);A>1&&(C=new Array(A).fill(!1).map((W,q)=>i[w.col+q]??void 0))}else b=R(f,o,t);const S=o.nodes[m||d?"tableHeader":"tableCell"].createChecked({...ce(f)?f.props:{},colwidth:C},o.nodes.tableParagraph.createChecked(g,b));c.push(S)}const u=o.nodes.tableRow.createChecked({},c);n.push(u)}return n}function so(e,o,t){let n,r=e.type;if(r===void 0&&(r="paragraph"),!o.nodes[r])throw new Error(`node type ${r} not found in schema`);if(!e.content)n=o.nodes[r].createChecked(e.props);else if(typeof e.content=="string"){const s=R([e.content],o,t,r);n=o.nodes[r].createChecked(e.props,s)}else if(Array.isArray(e.content)){const s=R(e.content,o,t,r);n=o.nodes[r].createChecked(e.props,s)}else if(e.content.type==="tableContent"){const s=Ce(e.content,o,t);n=o.nodes[r].createChecked(e.props,s)}else throw new F(e.content.type);return n}function te(e,o,t){let n=e.id;n===void 0&&(n=pe.options.generateID());const r=[];if(e.children)for(const i of e.children)r.push(te(i,o,t));if(!e.type||o.nodes[e.type].isInGroup("blockContent")){const i=so(e,o,t),a=r.length>0?o.nodes.blockGroup.createChecked({},r):void 0;return o.nodes.blockContainer.createChecked({id:n,...e.props},a?[i,a]:i)}else{if(o.nodes[e.type].isInGroup("bnBlock"))return o.nodes[e.type].createChecked({id:n,...e.props},r);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function _(e,o){let t,n;if(o.firstChild.descendants((r,s)=>t?!1:!r.type.isInGroup("bnBlock")||r.attrs.id!==e?!0:(t=r,n=s+1,!1)),!(t===void 0||n===void 0))return{node:t,posBeforeNode:n}}const L=(e,o,t)=>({state:n,dispatch:r})=>{const s=ue(n.doc.resolve(o));if(r){const i=n.schema.nodes[s.blockNoteType],a=n.schema.nodes[t.type||s.blockNoteType],l=a.isInGroup("bnBlock")?a:n.schema.nodes.blockContainer;if(s.isBlockContainer&&a.isInGroup("blockContent"))Mt(t,n,e,s),Hr(t,n,e,i,a,s);else if(!s.isBlockContainer&&a.isInGroup("bnBlock"))Mt(t,n,e,s);else{const c=T(s.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return n.tr.replaceWith(s.bnBlock.beforePos,s.bnBlock.afterPos,te({children:c.children,...t},n.schema,e.schema.styleSchema)),!0}n.tr.setNodeMarkup(s.bnBlock.beforePos,l,{...s.bnBlock.node.attrs,...t.props})}return!0};function Hr(e,o,t,n,r,s){let i="keep";if(e.content)if(typeof e.content=="string")i=R([e.content],o.schema,t.schema.styleSchema,r.name);else if(Array.isArray(e.content))i=R(e.content,o.schema,t.schema.styleSchema,r.name);else if(e.content.type==="tableContent")i=Ce(e.content,o.schema,t.schema.styleSchema);else throw new F(e.content.type);else n.spec.content===""||r.spec.content!==n.spec.content&&(i=[]);i==="keep"?o.tr.setNodeMarkup(s.blockContent.beforePos,e.type===void 0?void 0:o.schema.nodes[e.type],{...s.blockContent.node.attrs,...e.props}):o.tr.replaceWith(s.blockContent.beforePos,s.blockContent.afterPos,r.createChecked({...s.blockContent.node.attrs,...e.props},i))}function Mt(e,o,t,n){if(e.children!==void 0&&e.children.length>0){const r=e.children.map(s=>te(s,o.schema,t.schema.styleSchema));if(n.childContainer)o.tr.step(new Ie.ReplaceStep(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new B.Slice(B.Fragment.from(r),0,0)));else{if(!n.isBlockContainer)throw new Error("impossible");o.tr.insert(n.blockContent.afterPos,o.schema.nodes.blockGroup.createChecked({},r))}}}function io(e,o,t){const n=e._tiptapEditor,r=typeof o=="string"?o:o.id,s=_(r,n.state.doc);if(!s)throw new Error(`Block with ID ${r} not found`);n.commands.command(({state:a,dispatch:l})=>(L(e,s.posBeforeNode,t)({state:a,dispatch:l}),!0));const i=n.state.doc.resolve(s.posBeforeNode+1).node();return T(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ao(e){const o=Array.from(e.classList).filter(t=>!t.startsWith("bn-"))||[];o.length>0?e.className=o.join(" "):e.removeAttribute("class")}function lo(e,o,t,n){let r;if(o)if(typeof o=="string")r=R([o],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(o))r=R(o,e.pmSchema,e.schema.styleSchema);else if(o.type==="tableContent")r=Ce(o,e.pmSchema,e.schema.styleSchema);else throw new F(o.type);else throw new Error("blockContent is required");const s=t.serializeFragment(B.Fragment.from(r),n);return s.nodeType===1&&ao(s),s}function Dr(e,o,t,n,r,s,i){var g,b,w,C,S,A,W,q;const a=(i==null?void 0:i.document)??document,l=o.pmSchema.nodes.blockContainer;let c=t.props;if(!t.props){c={};for(const[I,E]of Object.entries(o.schema.blockSchema[t.type].propSchema))E.default!==void 0&&(c[I]=E.default)}const d=(b=(g=l.spec)==null?void 0:g.toDOM)==null?void 0:b.call(g,l.create({id:t.id,...c})),u=Array.from(d.dom.attributes),h=o.blockImplementations[t.type].implementation.toExternalHTML({...t,props:c},o),f=a.createDocumentFragment();if(h.dom.classList.contains("bn-block-content")){const I=[...u,...Array.from(h.dom.attributes)].filter(E=>E.name.startsWith("data")&&E.name!=="data-content-type"&&E.name!=="data-file-block"&&E.name!=="data-node-view-wrapper"&&E.name!=="data-node-type"&&E.name!=="data-id"&&E.name!=="data-index"&&E.name!=="data-editable");for(const E of I)h.dom.firstChild.setAttribute(E.name,E.value);ao(h.dom.firstChild),f.append(...Array.from(h.dom.childNodes))}else f.append(h.dom);if(h.contentDOM&&t.content){const I=lo(o,t.content,n,i);h.contentDOM.appendChild(I)}let m;if(r.has(t.type)?m="OL":s.has(t.type)&&(m="UL"),m){if(((w=e.lastChild)==null?void 0:w.nodeName)!==m){const E=a.createElement(m);m==="OL"&&(c!=null&&c.start)&&(c==null?void 0:c.start)!==1&&E.setAttribute("start",c.start+""),e.append(E)}const I=a.createElement("li");I.append(f),e.lastChild.appendChild(I)}else e.append(f);if(t.children&&t.children.length>0){const I=a.createDocumentFragment();if(co(I,o,t.children,n,r,s,i),((C=e.lastChild)==null?void 0:C.nodeName)==="UL"||((S=e.lastChild)==null?void 0:S.nodeName)==="OL")for(;((A=I.firstChild)==null?void 0:A.nodeName)==="UL"||((W=I.firstChild)==null?void 0:W.nodeName)==="OL";)e.lastChild.lastChild.appendChild(I.firstChild);o.pmSchema.nodes[t.type].isInGroup("blockContent")?e.append(I):(q=h.contentDOM)==null||q.append(I)}}const co=(e,o,t,n,r,s,i)=>{for(const a of t)Dr(e,o,a,n,r,s,i)},Or=(e,o,t,n,r,s)=>{const a=((s==null?void 0:s.document)??document).createDocumentFragment();return co(a,e,o,t,n,r,s),a},ve=(e,o)=>{const t=B.DOMSerializer.fromSchema(e);return{exportBlocks:(n,r)=>{const s=Or(o,n,t,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),r),i=document.createElement("div");return i.append(s),i.innerHTML},exportInlineContent:(n,r)=>{const s=lo(o,n,t,r),i=document.createElement("div");return i.append(s.cloneNode(!0)),i.innerHTML}}};function _r(e,o,t,n,r){let s;if(o)if(typeof o=="string")s=R([o],e.pmSchema,e.schema.styleSchema,n);else if(Array.isArray(o))s=R(o,e.pmSchema,e.schema.styleSchema,n);else if(o.type==="tableContent")s=Ce(o,e.pmSchema,e.schema.styleSchema);else throw new F(o.type);else throw new Error("blockContent is required");return t.serializeFragment(B.Fragment.from(s),r)}function Rr(e,o,t,n,r){var u,h,f,m,g;const s=e.pmSchema.nodes.blockContainer;let i=o.props;if(!o.props){i={};for(const[b,w]of Object.entries(e.schema.blockSchema[o.type].propSchema))w.default!==void 0&&(i[b]=w.default)}const l=e.blockImplementations[o.type].implementation.toInternalHTML({...o,props:i},e);if(o.type==="numberedListItem"&&l.dom.setAttribute("data-index",n.toString()),l.contentDOM&&o.content){const b=_r(e,o.content,t,o.type,r);l.contentDOM.appendChild(b)}if(e.pmSchema.nodes[o.type].isInGroup("bnBlock")){if(o.children&&o.children.length>0){const b=uo(e,o.children,t,r);(u=l.contentDOM)==null||u.append(b)}return l.dom}const d=(f=(h=s.spec)==null?void 0:h.toDOM)==null?void 0:f.call(h,s.create({id:o.id,...i}));return(m=d.contentDOM)==null||m.appendChild(l.dom),o.children&&o.children.length>0&&((g=d.contentDOM)==null||g.appendChild(po(e,o.children,t,r))),d.dom}function uo(e,o,t,n){const s=((n==null?void 0:n.document)??document).createDocumentFragment();let i=0;for(const a of o){a.type==="numberedListItem"?i++:i=0;const l=Rr(e,a,t,i,n);s.appendChild(l)}return s}const po=(e,o,t,n)=>{var a;const r=e.pmSchema.nodes.blockGroup,s=r.spec.toDOM(r.create({})),i=uo(e,o,t,n);return(a=s.contentDOM)==null||a.appendChild(i),s.dom},ho=(e,o)=>{const t=B.DOMSerializer.fromSchema(e);return{serializeBlocks:(n,r)=>po(o,n,t,r).outerHTML}},Se=(e,o)=>{const t=e.querySelector(o);if(!t)return;const n=e.querySelector("figcaption"),r=(n==null?void 0:n.textContent)??void 0;return{targetElement:t,caption:r}},fo=(e,o,t,n)=>{const r=document.createElement("div");r.className="bn-add-file-button";const s=document.createElement("div");s.className="bn-add-file-button-icon",n?s.appendChild(n):s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',r.appendChild(s);const i=document.createElement("p");i.className="bn-add-file-button-text",i.innerHTML=t||o.dictionary.file_blocks.file.add_button_text,r.appendChild(i);const a=c=>{c.preventDefault()},l=()=>{o.dispatch(o._tiptapEditor.state.tr.setMeta(o.filePanel.plugin,{block:e}))};return r.addEventListener("mousedown",a,!0),r.addEventListener("click",l,!0),{dom:r,destroy:()=>{r.removeEventListener("mousedown",a,!0),r.removeEventListener("click",l,!0)}}},mo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>',go=e=>{const o=document.createElement("div");o.className="bn-file-name-with-icon";const t=document.createElement("div");t.className="bn-file-icon",t.innerHTML=mo,o.appendChild(t);const n=document.createElement("p");return n.className="bn-file-name",n.textContent=e.props.name,o.appendChild(n),{dom:o}},Ve=(e,o,t,n,r)=>{const s=document.createElement("div");if(s.className="bn-file-block-content-wrapper",e.props.url===""){const a=fo(e,o,n,r);s.appendChild(a.dom);const l=o.onUploadStart(c=>{if(c===e.id){s.removeChild(a.dom);const d=document.createElement("div");d.className="bn-file-loading-preview",d.textContent="Loading...",s.appendChild(d)}});return{dom:s,destroy:()=>{l(),a.destroy()}}}const i={dom:s};if(e.props.showPreview===!1||!t){const a=go(e);s.appendChild(a.dom),i.destroy=()=>{var l;(l=a.destroy)==null||l.call(a)}}else s.appendChild(t.dom);if(e.props.caption){const a=document.createElement("p");a.className="bn-file-caption",a.textContent=e.props.caption,s.appendChild(a)}return i},Fe=(e,o)=>{const t=document.createElement("figure"),n=document.createElement("figcaption");return n.textContent=o,t.appendChild(e),t.appendChild(n),{dom:t}},Ee=(e,o)=>{const t=document.createElement("div"),n=document.createElement("p");return n.textContent=o,t.appendChild(e),t.appendChild(n),{dom:t}},Pt=e=>({url:e.src||void 0}),bo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>',ko={backgroundColor:M.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},wo={type:"audio",propSchema:ko,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},yo=(e,o)=>{const t=document.createElement("div");t.innerHTML=bo;const n=document.createElement("audio");return n.className="bn-audio",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(r=>{n.src=r}):n.src=e.props.url,n.controls=!0,n.contentEditable="false",n.draggable=!1,Ve(e,o,{dom:n},o.dictionary.file_blocks.audio.add_button_text,t.firstElementChild)},Co=e=>{if(e.tagName==="AUDIO")return Pt(e);if(e.tagName==="FIGURE"){const o=Se(e,"audio");if(!o)return;const{targetElement:t,caption:n}=o;return{...Pt(t),caption:n}}},vo=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add audio",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("audio"),o.src=e.props.url):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Fe(o,e.props.caption):Ee(o,e.props.caption):{dom:o}},So=fe(wo,{render:yo,parse:Co,toExternalHTML:vo}),ot=Symbol.for("blocknote.shikiParser"),Me=Symbol.for("blocknote.shikiHighlighterPromise"),Eo={language:{default:"text"}},Vr=z({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"text",indentLineWithTab:!0,supportedLanguages:{}}},addAttributes(){const e=this.options;return{language:{default:e.editor.settings.codeBlock.defaultLanguage,parseHTML:o=>{let t=o,n=null;(t==null?void 0:t.tagName)==="DIV"&&(t==null?void 0:t.dataset.contentType)==="codeBlock"&&(t=t.children[0]),(t==null?void 0:t.tagName)==="PRE"&&(t=t==null?void 0:t.children[0]);const r=t==null?void 0:t.getAttribute("data-language");if(r)n=r.toLowerCase();else{const i=[...(t==null?void 0:t.className.split(" "))||[]].filter(a=>a.startsWith("language-")).map(a=>a.replace("language-",""));i.length>0&&(n=i[0].toLowerCase())}return n?It(e.editor.settings.codeBlock,n):null},renderHTML:o=>o.language?{class:`language-${o.language}`,"data-language":o.language}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",contentElement:"code"},{tag:"pre",contentElement:"code",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var r,s;const o=document.createElement("pre"),{dom:t,contentDOM:n}=$(this.name,"code",((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},{...((s=this.options.domAttributes)==null?void 0:s.inlineContent)||{},...e});return t.removeChild(n),t.appendChild(o),o.appendChild(n),{dom:t,contentDOM:n}},addNodeView(){const e=this.options;return({editor:o,node:t,getPos:n,HTMLAttributes:r})=>{var u,h;const s=document.createElement("pre"),i=document.createElement("select"),a=document.createElement("div"),{dom:l,contentDOM:c}=$(this.name,"code",{...((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},...r},((h=this.options.domAttributes)==null?void 0:h.inlineContent)||{}),d=f=>{const m=f.target.value;o.commands.command(({tr:g})=>(g.setNodeAttribute(n(),"language",m),!0))};return Object.entries(e.editor.settings.codeBlock.supportedLanguages).forEach(([f,{name:m}])=>{const g=document.createElement("option");g.value=f,g.text=m,i.appendChild(g)}),a.contentEditable="false",i.value=t.attrs.language||e.editor.settings.codeBlock.defaultLanguage,l.removeChild(c),l.appendChild(a),l.appendChild(s),s.appendChild(c),a.appendChild(i),i.addEventListener("change",d),{dom:l,contentDOM:c,update:f=>f.type===this.type,destroy:()=>{i.removeEventListener("change",d)}}}},addProseMirrorPlugins(){const e=this.options,o=globalThis;let t,n,r=!1;const s=a=>{if(!e.editor.settings.codeBlock.createHighlighter)return process.env.NODE_ENV==="development"&&!r&&(console.log("For syntax highlighting of code blocks, you must provide a highlighter function"),r=!0),[];if(!t)return o[Me]=o[Me]||e.editor.settings.codeBlock.createHighlighter(),o[Me].then(c=>{t=c});const l=a.language;return l&&l!=="text"&&!t.getLoadedLanguages().includes(l)&&l in e.editor.settings.codeBlock.supportedLanguages?t.loadLanguage(l):(n||(n=o[ot]||Yn.createParser(t),o[ot]=n),n(a))};return[Jn.createHighlightPlugin({parser:s,languageExtractor:a=>a.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:o,range:t,match:n})=>{const r=o.doc.resolve(t.from),s=n[1].trim(),i={language:It(e.editor.settings.codeBlock,s)};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),this.type))return null;o.tr.delete(t.from,t.to).setBlockType(t.from,t.from,this.type,i).setSelection(y.TextSelection.create(o.tr.doc,t.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:o}=e.state,{$from:t}=o;if(e.isActive(this.name)&&!t.parent.textContent&&k.isTextSelection(o)){const n=t.pos-t.parentOffset-2;return e.chain().setNodeSelection(n).deleteSelection().run(),!0}return!1},Tab:({editor:e})=>this.options.indentLineWithTab&&e.isActive(this.name)?(e.commands.insertContent(" "),!0):!1,Enter:({editor:e})=>{const{$from:o}=e.state.selection;if(!e.isActive(this.name))return!1;const t=o.parentOffset===o.parent.nodeSize-2,n=o.parent.textContent.endsWith(`
|
|
7
7
|
|
|
8
|
-
`);return!t||!
|
|
9
|
-
`),!0):e.chain().command(({tr:n})=>(n.delete(o.pos-2,o.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:o}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(o.pos-o.parentOffset+o.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),So=Z(xo,Le);function ir(e){var o;return Z(xo.configure(e),{language:{default:e.defaultLanguage||Le.language.default,values:((o=e.supportedLanguages)==null?void 0:o.map(t=>t.id))||Le.language.values}})}const tt=e=>({url:e.src||void 0}),Eo={backgroundColor:P.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Bo={type:"file",propSchema:Eo,content:"none",isFileBlock:!0},To=(e,o)=>Re(e,o),Mo=e=>{if(e.tagName==="EMBED")return tt(e);if(e.tagName==="FIGURE"){const o=we(e,"embed");if(!o)return;const{targetElement:t,caption:i}=o;return{...tt(t),caption:i}}},Io=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add file",{dom:t}}const o=document.createElement("a");return o.href=e.props.url,o.textContent=e.props.name||e.props.url,e.props.caption?ve(o,e.props.caption):{dom:o}},Lo=pe(Bo,{render:To,parse:Mo,toExternalHTML:Io}),ht=(e,o,t,i,n,r)=>{const{dom:a,destroy:s}=Re(e,o,t,n,r),l=a;e.props.url&&e.props.showPreview&&(l.style.width=`${e.props.previewWidth}px`);const d=document.createElement("div");d.className="bn-resize-handle",d.style.left="4px";const c=document.createElement("div");c.className="bn-resize-handle",c.style.right="4px";let u,m=e.props.previewWidth;const h=v=>{if(!u){!o.isEditable&&i.contains(d)&&i.contains(c)&&(i.removeChild(d),i.removeChild(c));return}let x;e.props.textAlignment==="center"?u.handleUsed==="left"?x=u.initialWidth+(u.initialClientX-v.clientX)*2:x=u.initialWidth+(v.clientX-u.initialClientX)*2:u.handleUsed==="left"?x=u.initialWidth+u.initialClientX-v.clientX:x=u.initialWidth+v.clientX-u.initialClientX,m=Math.max(x,64),l.style.width=`${m}px`},f=v=>{(!v.target||!l.contains(v.target)||!o.isEditable)&&i.contains(d)&&i.contains(c)&&(i.removeChild(d),i.removeChild(c)),u&&(u=void 0,o.updateBlock(e,{props:{previewWidth:m}}))},g=()=>{o.isEditable&&(i.appendChild(d),i.appendChild(c))},b=v=>{v.relatedTarget===d||v.relatedTarget===c||u||o.isEditable&&i.contains(d)&&i.contains(c)&&(i.removeChild(d),i.removeChild(c))},_=v=>{v.preventDefault(),u={handleUsed:"left",initialWidth:l.clientWidth,initialClientX:v.clientX}},w=v=>{v.preventDefault(),u={handleUsed:"right",initialWidth:l.clientWidth,initialClientX:v.clientX}};return window.addEventListener("mousemove",h),window.addEventListener("mouseup",f),l.addEventListener("mouseenter",g),l.addEventListener("mouseleave",b),d.addEventListener("mousedown",_),c.addEventListener("mousedown",w),{dom:l,destroy:()=>{s==null||s(),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",f),l.removeEventListener("mouseenter",g),l.removeEventListener("mouseleave",b),d.removeEventListener("mousedown",_),c.removeEventListener("mousedown",w)}}},nr=async e=>{const o=new FormData;return o.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:o})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")},Mt=e=>{const o=e.src||void 0,t=e.width||void 0;return{url:o,previewWidth:t}},Po='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>',Ao={textAlignment:P.textAlignment,backgroundColor:P.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},No={type:"image",propSchema:Ao,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},Do=(e,o)=>{const t=document.createElement("div");t.innerHTML=Po;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("img");return n.className="bn-visual-media",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(r=>{n.src=r}):n.src=e.props.url,n.alt=e.props.name||e.props.caption||"BlockNote image",n.contentEditable="false",n.draggable=!1,i.appendChild(n),ht(e,o,{dom:i},i,o.dictionary.file_blocks.image.add_button_text,t.firstElementChild)},jo=e=>{if(e.tagName==="IMG")return Mt(e);if(e.tagName==="FIGURE"){const o=we(e,"img");if(!o)return;const{targetElement:t,caption:i}=o;return{...Mt(t),caption:i}}},Ro=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add image",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("img"),o.src=e.props.url,o.alt=e.props.name||e.props.caption||"BlockNote image",o.width=e.props.previewWidth):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Ue(o,e.props.caption):ve(o,e.props.caption):{dom:o}},Uo=pe(No,{render:Do,parse:jo,toExternalHTML:Ro}),Ho={type:"pageBreak",propSchema:{},content:"none",isFileBlock:!1,isSelectable:!1},Oo=()=>{const e=document.createElement("div");return e.className="bn-page-break",e.setAttribute("data-page-break",""),{dom:e}},Vo=e=>{if(e.tagName==="DIV"&&e.hasAttribute("data-page-break"))return{type:"pageBreak"}},zo=()=>{const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},Fo=pe(Ho,{render:Oo,parse:Vo,toExternalHTML:zo}),rr=k.Mark.create({name:"backgroundColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-background-color")?{stringValue:e.getAttribute("data-background-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),ar=J(rr,"string"),sr=k.Mark.create({name:"textColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-text-color"),renderHTML:e=>({"data-text-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-text-color")?{stringValue:e.getAttribute("data-text-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),lr=J(sr,"string"),$o={...P,level:{default:1,values:[1,2,3]}},dr=$({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return ue($o)},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:o,chain:t,range:i})=>{const n=C(o);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||t().command(A(this.options.editor,n.bnBlock.beforePos,{type:"heading",props:{level:e}})).deleteRange({from:i.from,to:i.to}).run()}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:1}}))},"Mod-Alt-2":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:2}}))},"Mod-Alt-3":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:3}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"h1",attrs:{level:1},node:"heading"},{tag:"h2",attrs:{level:2},node:"heading"},{tag:"h3",attrs:{level:3},node:"heading"}]},renderHTML({node:e,HTMLAttributes:o}){var t,i;return F(this.name,`h${e.attrs.level}`,{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...o},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),cr=Z(dr,$o),Ko=(e,o,t)=>({state:i,dispatch:n})=>{const r=G(i.doc,e),a=Y(r);if(!a.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const s=[{type:a.bnBlock.node.type,attrs:t?{...a.bnBlock.node.attrs,id:void 0}:{}},{type:o?a.blockContent.node.type:i.schema.nodes.paragraph,attrs:t?{...a.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,s),!0},ft=e=>{const o=e._tiptapEditor,t=C(o.state);if(!t.isBlockContainer)return!1;const{bnBlock:i,blockContent:n}=t,r=o.state.selection.anchor===o.state.selection.head;return!(n.node.type.name==="bulletListItem"||n.node.type.name==="numberedListItem"||n.node.type.name==="checkListItem")||!r?!1:o.commands.first(({state:a,chain:s,commands:l})=>[()=>l.command(()=>n.node.childCount===0?l.command(A(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>l.command(()=>n.node.childCount>0?(s().deleteSelection().command(Ko(a.selection.from,!0)).run(),!0):!1)])},ur={...P},pr=$({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:o,range:t})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||o().command(A(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>ft(this.options.editor),"Mod-Shift-8":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"bulletListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.tagName==="UL"||o.tagName==="DIV"&&o.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var o,t;return F(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),mr=Z(pr,ur),Go={...P,checked:{default:!1}},hr=$({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return ue(Go)},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:o,range:t})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||o().command(A(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:t.from,to:t.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:o,range:t})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||o().command(A(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>ft(this.options.editor),"Mod-Shift-9":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"checkListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"input",getAttrs:e=>typeof e=="string"?!1:e.type==="checkbox"?{checked:e.checked}:!1,node:"checkListItem"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;if(o===null)return!1;if(o.tagName==="UL"||o.tagName==="DIV"&&o.parentElement.tagName==="UL"){const t=e.querySelector("input[type=checkbox]")||null;return t===null?!1:{checked:t.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:o}){var r,a;const t=document.createElement("input");t.type="checkbox",t.checked=e.attrs.checked,e.attrs.checked&&t.setAttribute("checked","");const{dom:i,contentDOM:n}=F(this.name,"p",{...((r=this.options.domAttributes)==null?void 0:r.blockContent)||{},...o},((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{});return i.insertBefore(t,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:o,editor:t,HTMLAttributes:i})=>{var c,u;const n=document.createElement("div"),r=document.createElement("div");r.contentEditable="false";const a=document.createElement("input");a.type="checkbox",a.checked=e.attrs.checked,e.attrs.checked&&a.setAttribute("checked","");const s=()=>{if(!t.isEditable){a.checked=!a.checked;return}if(typeof o!="boolean"){const m=G(t.state.doc,o());if(m.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${m.node.type.name}`);this.editor.commands.command(A(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:a.checked}}))}};a.addEventListener("change",s);const{dom:l,contentDOM:d}=F(this.name,"p",{...((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},...i},((u=this.options.domAttributes)==null?void 0:u.inlineContent)||{});if(typeof o!="boolean"){const h="label-"+this.editor.state.doc.resolve(o()).node().attrs.id;a.setAttribute("aria-labelledby",h),d.id=h}return l.removeChild(d),l.appendChild(n),n.appendChild(r),n.appendChild(d),r.appendChild(a),{dom:l,contentDOM:d,destroy:()=>{a.removeEventListener("change",s)}}}}}),fr=Z(hr,Go),gr=new y.PluginKey("numbered-list-indexing"),br=()=>new y.Plugin({key:gr,appendTransaction:(e,o,t)=>{const i=t.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return t.doc.descendants((r,a)=>{var s;if(r.type.name==="blockContainer"&&r.firstChild.type.name==="numberedListItem"){let l=`${r.firstChild.attrs.start||1}`;const d=Y({posBeforeNode:a,node:r});if(!d.isBlockContainer)throw new Error("impossible");const c=i.doc.resolve(d.bnBlock.beforePos).nodeBefore;if(c){const f=Y({posBeforeNode:d.bnBlock.beforePos-c.nodeSize,node:c});if(f.blockNoteType==="numberedListItem"){if(!f.isBlockContainer)throw new Error("impossible");const b=f.blockContent.node.attrs.index;l=(parseInt(b)+1).toString()}}const u=d.blockContent.node,m=u.attrs.index,h=((s=c==null?void 0:c.firstChild)==null?void 0:s.type.name)!=="numberedListItem";if(m!==l||u.attrs.start&&!h){n=!0;const{start:f,...g}=u.attrs;i.setNodeMarkup(d.blockContent.beforePos,void 0,{...g,index:l,...typeof f=="number"&&h&&{start:f}})}}}),n?i:null}}),Wo={...P,start:{default:void 0,type:"number"}},kr=$({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{...ue(Wo),index:{default:null,parseHTML:e=>e.getAttribute("data-index"),renderHTML:e=>({"data-index":e.index})}}},addInputRules(){return[new k.InputRule({find:new RegExp("^(\\d+)\\.\\s$"),handler:({state:e,chain:o,range:t,match:i})=>{const n=C(e);if(!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||n.blockNoteType==="numberedListItem")return;const r=parseInt(i[1]);o().command(A(this.options.editor,n.bnBlock.beforePos,{type:"numberedListItem",props:r===1&&{}||{start:r}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>ft(this.options.editor),"Mod-Shift-7":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[br()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;if(o===null)return!1;if(o.tagName==="OL"||o.tagName==="DIV"&&o.parentElement.tagName==="OL"){const t=parseInt(o.getAttribute("start")||"1")||1;return e.previousSibling||t===1?{}:{start:t}}return!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var o,t;return F(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),_r=Z(kr,Wo),yr={...P},wr=$({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>{const e=C(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(A(this.options.editor,e.bnBlock.beforePos,{type:"paragraph",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"p",priority:200,getAttrs:e=>{var o;return typeof e=="string"||!((o=e.textContent)!=null&&o.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var o,t;return F(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),vr=Z(wr,yr),Cr=35,gt=120,xr=31,Sr=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[L.columnResizing({cellMinWidth:Cr,defaultCellMinWidth:gt,View:null}),L.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.setHardBreak(),!0):!1,Backspace:()=>{const e=this.editor.state.selection,o=e.empty,t=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return o&&t&&i},Tab:()=>this.editor.commands.command(({state:e,dispatch:o,view:t})=>L.goToNextCell(1)(e,o,t)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:o,view:t})=>L.goToNextCell(-1)(e,o,t))}},extendNodeSchema(e){const o={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",o))}}}),Er={textColor:P.textColor},Br=$({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var o,t;return F(this.name,"table",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:o})=>{var i;class t extends L.TableView{constructor(r,a,s){super(r,a),this.node=r,this.cellMinWidth=a,this.blockContentHTMLAttributes=s;const l=document.createElement("div");l.className=q("bn-block-content",s.class),l.setAttribute("data-content-type","table");for(const[m,h]of Object.entries(s))m!=="class"&&l.setAttribute(m,h);const d=this.dom,c=document.createElement("div");c.className="tableWrapper-inner",c.appendChild(d.firstChild),d.appendChild(c),l.appendChild(d);const u=document.createElement("div");u.className="table-widgets-container",u.style.position="relative",d.appendChild(u),this.dom=l}ignoreMutation(r){return!r.target.closest(".tableWrapper-inner")||super.ignoreMutation(r)}}return new t(e,gt,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...o})}}}),Tr=$({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{preserveWhitespace:"full",priority:210,context:"tableContent",tag:"p",getAttrs:e=>({})},{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent)return!1;const o=e.parentElement;return o===null?!1:o.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),Mr=Z(Br,Er,[Sr,Tr,nn.TableHeader.extend({content:"tableContent+"}),on.TableCell.extend({content:"tableContent+"}),rn.TableRow]),It=e=>{const o=e.src||void 0,t=e.width||void 0;return{url:o,previewWidth:t}},qo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>',Zo={textAlignment:P.textAlignment,backgroundColor:P.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Xo={type:"video",propSchema:Zo,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},Jo=(e,o)=>{const t=document.createElement("div");t.innerHTML=qo;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("video");return n.className="bn-visual-media",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(r=>{n.src=r}):n.src=e.props.url,n.controls=!0,n.contentEditable="false",n.draggable=!1,n.width=e.props.previewWidth,i.appendChild(n),ht(e,o,{dom:i},i,o.dictionary.file_blocks.video.add_button_text,t.firstElementChild)},Yo=e=>{if(e.tagName==="VIDEO")return It(e);if(e.tagName==="FIGURE"){const o=we(e,"video");if(!o)return;const{targetElement:t,caption:i}=o;return{...It(t),caption:i}}},Qo=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add video",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("video"),o.src=e.props.url,o.width=e.props.previewWidth):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Ue(o,e.props.caption):ve(o,e.props.caption):{dom:o}},ei=pe(Xo,{render:Jo,parse:Yo,toExternalHTML:Qo}),bt={paragraph:vr,heading:cr,codeBlock:So,bulletListItem:mr,numberedListItem:_r,checkListItem:fr,table:Mr,file:Lo,image:Uo,video:ei,audio:vo},ti=lt(bt),kt={bold:J(hn.default,"boolean"),italic:J(gn.default,"boolean"),underline:J(kn.default,"boolean"),strike:J(bn.default,"boolean"),code:J(fn.default,"boolean"),textColor:lr,backgroundColor:ar},Ir=pt(kt),_t={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},oi=ct(_t);function D(e,o){return e in o.schema.blockSchema&&o.schema.blockSchema[e]===ti[e]}function ii(e,o){return e in o.schema.inlineContentSchema&&o.schema.inlineContentSchema[e]===oi[e]}function ni(e,o,t){return o.type===e&&o.type in t.schema.blockSchema&&D(o.type,t)}function Lr(e,o){return e.type in o.schema.blockSchema&&o.schema.blockSchema[e.type].isFileBlock||!1}function Pr(e,o){return e.type in o.schema.blockSchema&&o.schema.blockSchema[e.type].isFileBlock&&"showPreview"in o.schema.blockSchema[e.type].propSchema||!1}function Ar(e,o){return o.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function ri(e,o,t){return o in t.schema.blockSchema&&e in t.schema.blockSchema[o].propSchema&&t.schema.blockSchema[o].propSchema[e]===P[e]}function Nr(e,o,t){return ri(e,o.type,t)}function ot(e){return e instanceof L.CellSelection}function Dr(e){let o=e.getTextCursorPosition().block,t=e.schema.blockSchema[o.type].content;for(;t==="none";){if(o=e.getTextCursorPosition().nextBlock,o===void 0)return;t=e.schema.blockSchema[o.type].content,e.setTextCursorPosition(o,"end")}}function N(e,o){const t=e.getTextCursorPosition().block;if(t.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(t.content)&&(t.content.length===1&&W(t.content[0])&&t.content[0].type==="text"&&t.content[0].text==="/"||t.content.length===0)?(i=e.updateBlock(t,o),e.setTextCursorPosition(i)):(i=e.insertBlocks([o],t,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Dr(e),i}function jr(e){const o=[];return D("heading",e)&&o.push({onItemClick:()=>{N(e,{type:"heading",props:{level:1}})},badge:K("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{N(e,{type:"heading",props:{level:2}})},badge:K("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{N(e,{type:"heading",props:{level:3}})},badge:K("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),D("numberedListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"numberedListItem"})},badge:K("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),D("bulletListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"bulletListItem"})},badge:K("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),D("checkListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"checkListItem"})},badge:K("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),D("paragraph",e)&&o.push({onItemClick:()=>{N(e,{type:"paragraph"})},badge:K("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),D("codeBlock",e)&&o.push({onItemClick:()=>{N(e,{type:"codeBlock"})},badge:K("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),D("table",e)&&o.push({onItemClick:()=>{N(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),D("image",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"image",...e.dictionary.slash_menu.image}),D("video",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"video",...e.dictionary.slash_menu.video}),D("audio",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"audio",...e.dictionary.slash_menu.audio}),D("file",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"file",...e.dictionary.slash_menu.file}),o.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),o}function Rr(e,o){return e.filter(({title:t,aliases:i})=>t.toLowerCase().includes(o.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(o.toLowerCase())).length!==0)}function ze(e){return e&&Object.fromEntries(Object.entries(e).filter(([,o])=>o!==void 0))}class me{constructor(o){p(this,"blockSpecs");p(this,"inlineContentSpecs");p(this,"styleSpecs");p(this,"blockSchema");p(this,"inlineContentSchema");p(this,"styleSchema");p(this,"BlockNoteEditor","only for types");p(this,"Block","only for types");p(this,"PartialBlock","only for types");this.blockSpecs=ze(o==null?void 0:o.blockSpecs)||bt,this.inlineContentSpecs=ze(o==null?void 0:o.inlineContentSpecs)||_t,this.styleSpecs=ze(o==null?void 0:o.styleSpecs)||kt,this.blockSchema=lt(this.blockSpecs),this.inlineContentSchema=ct(this.inlineContentSpecs),this.styleSchema=pt(this.styleSpecs)}static create(o){return new me(o)}}const yt=me.create({blockSpecs:{pageBreak:Fo}}),Ur=e=>me.create({blockSpecs:{...e.blockSpecs,...yt.blockSpecs},inlineContentSpecs:e.inlineContentSpecs,styleSpecs:e.styleSpecs});function ai(e){return"pageBreak"in e.schema.blockSchema&&e.schema.blockSchema.pageBreak===yt.blockSchema.pageBreak}function Hr(e){const o=[];return ai(e)&&o.push({...e.dictionary.slash_menu.page_break,onItemClick:()=>{N(e,{type:"pageBreak"})},key:"page_break"}),o}function Or(e,o,t,i="before"){const n=typeof t=="string"?t:t.id,r=[];for(const l of o)r.push(ee(l,e.pmSchema,e.schema.styleSchema));const a=R(n,e._tiptapEditor.state.doc);if(!a)throw new Error(`Block with ID ${n} not found`);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(a.posBeforeNode,r)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(a.posBeforeNode+a.node.nodeSize,r));const s=[];for(const l of r)s.push(E(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return s}function Vr(e){const o=e._tiptapEditor.state,t=o.selection,i=G(o.doc,t.anchor);if(t instanceof L.CellSelection)return{type:"cell",anchorBlockId:i.node.attrs.id,anchorCellOffset:t.$anchorCell.pos-i.posBeforeNode,headCellOffset:t.$headCell.pos-i.posBeforeNode};if(e._tiptapEditor.state.selection instanceof y.NodeSelection)return{type:"node",anchorBlockId:i.node.attrs.id};{const n=G(o.doc,t.head);return{type:"text",anchorBlockId:i.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:t.anchor-i.posBeforeNode,headOffset:t.head-n.posBeforeNode}}}function zr(e,o){var n,r;const t=(n=R(o.anchorBlockId,e._tiptapEditor.state.doc))==null?void 0:n.posBeforeNode;if(t===void 0)throw new Error(`Could not find block with ID ${o.anchorBlockId} to update selection`);let i;if(o.type==="cell")i=L.CellSelection.create(e._tiptapEditor.state.doc,t+o.anchorCellOffset,t+o.headCellOffset);else if(o.type==="node")i=y.NodeSelection.create(e._tiptapEditor.state.doc,t+1);else{const a=(r=R(o.headBlockId,e._tiptapEditor.state.doc))==null?void 0:r.posBeforeNode;if(a===void 0)throw new Error(`Could not find block with ID ${o.headBlockId} to update selection`);i=y.TextSelection.create(e._tiptapEditor.state.doc,t+o.anchorOffset,a+o.headOffset)}e.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function it(e){return e.map(o=>o.type==="columnList"?o.children.map(t=>it(t.children)).flat():{...o,children:it(o.children)}).flat()}function si(e,o,t){var r;const i=((r=e.getSelection())==null?void 0:r.blocks)||[e.getTextCursorPosition().block],n=Vr(e);e.removeBlocks(i),e.insertBlocks(it(i),o,t),zr(e,n)}function li(e){return!e||e.type!=="columnList"}function di(e,o,t){let i,n;if(o?o.children.length>0?(i=o.children[o.children.length-1],n="after"):(i=o,n="before"):t&&(i=t,n="before"),!i||!n)return;const r=e.getParentBlock(i);return li(r)?{referenceBlock:i,placement:n}:di(e,n==="after"?i:e.getPrevBlock(i),r)}function ci(e,o,t){let i,n;if(o?o.children.length>0?(i=o.children[0],n="before"):(i=o,n="after"):t&&(i=t,n="after"),!i||!n)return;const r=e.getParentBlock(i);return li(r)?{referenceBlock:i,placement:n}:ci(e,n==="before"?i:e.getNextBlock(i),r)}function Fr(e){const o=e.getSelection(),t=(o==null?void 0:o.blocks[0])||e.getTextCursorPosition().block,i=di(e,e.getPrevBlock(t),e.getParentBlock(t));i&&si(e,i.referenceBlock,i.placement)}function $r(e){const o=e.getSelection(),t=(o==null?void 0:o.blocks[(o==null?void 0:o.blocks.length)-1])||e.getTextCursorPosition().block,i=ci(e,e.getNextBlock(t),e.getParentBlock(t));i&&si(e,i.referenceBlock,i.placement)}function Kr(e,o){return function({state:t,dispatch:i}){const{$from:n,$to:r}=t.selection,a=n.blockRange(r,c=>c.childCount>0&&(c.type.name==="blockGroup"||c.type.name==="column"));if(!a)return!1;const s=a.startIndex;if(s===0)return!1;const d=a.parent.child(s-1);if(d.type!==e)return!1;if(i){const c=d.lastChild&&d.lastChild.type===o,u=S.Fragment.from(c?e.create():null),m=new S.Slice(S.Fragment.from(e.create(null,S.Fragment.from(o.create(null,u)))),c?3:1,0),h=a.start,f=a.end;i(t.tr.step(new Be.ReplaceAroundStep(h-(c?3:1),f,h,f,m,1,!0)).scrollIntoView())}return!0}}function ui(e){return e._tiptapEditor.commands.command(Kr(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function Gr(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function Wr(e){const{bnBlock:o}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(o.beforePos).nodeBefore!==null}function qr(e){const{bnBlock:o}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(o.beforePos).depth>1}function pi(e,o,t){const i=e._tiptapEditor;let n=i.state.tr;const r=[];for(const u of t)r.push(ee(u,e.pmSchema,e.schema.styleSchema));const a=new Set(o.map(u=>typeof u=="string"?u:u.id)),s=[],l=typeof o[0]=="string"?o[0]:o[0].id;let d=0;if(i.state.doc.descendants((u,m)=>{if(a.size===0)return!1;if(!u.type.isInGroup("bnBlock")||!a.has(u.attrs.id))return!0;if(s.push(E(u,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),a.delete(u.attrs.id),t.length>0&&u.attrs.id===l){const b=n.doc.nodeSize;n=n.insert(m,r);const _=n.doc.nodeSize;d+=b-_}const h=n.doc.nodeSize,f=n.doc.resolve(m-d);f.node().type.name==="blockGroup"&&f.node(f.depth-1).type.name!=="doc"&&f.node().childCount===1?n=n.delete(f.before(),f.after()):n=n.delete(m-d,m-d+u.nodeSize);const g=n.doc.nodeSize;return d+=h-g,!1}),a.size>0){const u=[...a].join(`
|
|
10
|
-
`);throw Error("Blocks with the following IDs could not be found in the editor: "+u)}e.dispatch(n);const c=[];for(const u of r)c.push(E(u,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:c,removedBlocks:s}}function Zr(e,o,t){return pi(e,o,t)}function Xr(e,o){return pi(e,o,[]).removedBlocks}function Jr(e,o){const t=typeof o=="string"?o:o.id,i=R(t,e._tiptapEditor.state.doc);if(i)return E(i.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Yr(e,o){const t=typeof o=="string"?o:o.id,i=R(t,e._tiptapEditor.state.doc);if(!i)return;const r=e._tiptapEditor.state.doc.resolve(i.posBeforeNode).nodeBefore;if(r)return E(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Qr(e,o){const t=typeof o=="string"?o:o.id,i=R(t,e._tiptapEditor.state.doc);if(!i)return;const r=e._tiptapEditor.state.doc.resolve(i.posBeforeNode+i.node.nodeSize).nodeAfter;if(r)return E(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ea(e,o){const t=typeof o=="string"?o:o.id,i=R(t,e._tiptapEditor.state.doc);if(!i)return;const n=e._tiptapEditor.state.doc.resolve(i.posBeforeNode),r=n.node(),a=n.node(-1),s=a.type.name!=="doc"?r.type.name==="blockGroup"?a:r:void 0;if(s)return E(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ta(e,o,t,i={updateSelection:!0}){const n=t._tiptapEditor.state.tr;let{from:r,to:a}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,d="";if(o.forEach(c=>{c.check(),s&&c.isText&&c.marks.length===0?d+=c.text:s=!1,l=l?c.isBlock:!1}),r===a&&l){const{parent:c}=n.doc.resolve(r);c.isTextblock&&!c.type.spec.code&&!c.childCount&&(r-=1,a+=1)}return s?n.insertText(d,r,a):n.replaceWith(r,a,o),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),t.dispatch(n),!0}function oa(e){const o=e._tiptapEditor.state;if(o.selection.empty||"node"in o.selection)return;const t=o.doc.resolve(G(o.doc,o.selection.from).posBeforeNode),i=o.doc.resolve(G(o.doc,o.selection.to).posBeforeNode),n=(d,c)=>{const u=t.posAtIndex(d,c),m=o.doc.resolve(u).nodeAfter;if(!m)throw new Error(`Error getting selection - node not found at position ${u}`);return E(m,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)},r=[],a=t.sharedDepth(i.pos),s=t.index(a),l=i.index(a);if(t.depth>a){r.push(E(t.nodeAfter,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));for(let d=t.depth;d>a;d--)if(t.node(d).type.isInGroup("childContainer")){const u=t.index(d)+1,m=t.node(d).childCount;for(let h=u;h<m;h++)r.push(n(h,d))}}else r.push(n(s,a));for(let d=s+1;d<=l;d++)r.push(n(d,a));if(r.length===0)throw new Error(`Error getting selection - selection doesn't span any blocks (${o.selection})`);return{blocks:r}}function ia(e,o,t){const i=typeof o=="string"?o:o.id,n=typeof t=="string"?t:t.id;if(i===n)throw new Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);const r=e._tiptapEditor.state.doc,a=R(i,r);if(!a)throw new Error(`Block with ID ${i} not found`);const s=R(n,r);if(!s)throw new Error(`Block with ID ${n} not found`);const l=Y(a),d=Y(s),c=e.schema.blockSchema[l.blockNoteType],u=e.schema.blockSchema[d.blockNoteType];if(!l.isBlockContainer||c.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!d.isBlockContainer||u.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${n})`);let m,h;if(c.content==="table"){const f=L.TableMap.get(l.blockContent.node);m=l.blockContent.beforePos+f.positionAt(0,0,l.blockContent.node)+1+2}else m=l.blockContent.beforePos+1;if(u.content==="table"){const f=L.TableMap.get(d.blockContent.node),g=d.blockContent.beforePos+f.positionAt(f.height-1,f.width-1,d.blockContent.node)+1,b=r.resolve(g).nodeAfter.nodeSize;h=g+b-2}else h=d.blockContent.afterPos-1;e._tiptapEditor.dispatch(e._tiptapEditor.state.tr.setSelection(y.TextSelection.create(e._tiptapEditor.state.doc,m,h)))}function na(e){const{bnBlock:o}=C(e._tiptapEditor.state),t=e._tiptapEditor.state.doc.resolve(o.beforePos),i=t.nodeBefore,n=e._tiptapEditor.state.doc.resolve(o.afterPos).nodeAfter;let r;return t.depth>1&&(r=t.node(),r.type.isInGroup("bnBlock")||(r=t.node(t.depth-1))),{block:E(o.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:E(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:E(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:r===void 0?void 0:E(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function mi(e,o,t="start"){const i=typeof o=="string"?o:o.id,n=R(i,e._tiptapEditor.state.doc);if(!n)throw new Error(`Block with ID ${i} not found`);const r=Y(n),a=e.schema.blockSchema[r.blockNoteType].content;if(r.isBlockContainer){const s=r.blockContent;if(a==="none"){e._tiptapEditor.commands.setNodeSelection(s.beforePos);return}if(a==="inline")t==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+1):e._tiptapEditor.commands.setTextSelection(s.afterPos-1);else if(a==="table")t==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+4):e._tiptapEditor.commands.setTextSelection(s.afterPos-4);else throw new O(a)}else{const s=t==="start"?r.childContainer.node.firstChild:r.childContainer.node.lastChild;mi(e,s.attrs.id,t)}}exports.esmDependencies=void 0;async function He(){if(exports.esmDependencies)return exports.esmDependencies;const e=await Promise.all([import("rehype-parse"),import("rehype-stringify"),import("unified"),import("hast-util-from-dom"),import("rehype-remark"),import("remark-gfm"),import("remark-stringify"),import("remark-parse"),import("remark-rehype"),import("rehype-format")]);return exports.esmDependencies={rehypeParse:e[0],rehypeStringify:e[1],unified:e[2],hastUtilFromDom:e[3],rehypeRemark:e[4],remarkGfm:e[5],remarkStringify:e[6],remarkParse:e[7],remarkRehype:e[8],rehypeFormat:e[9]},exports.esmDependencies}function ra(){const e=o=>{let t=o.children.length;for(let i=0;i<t;i++){const n=o.children[i];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){o.children.splice(i,1,...n.children);const r=n.children.length-1;t+=r,i+=r}else o.children.splice(i,1),t--,i--}};return e}function aa(){const e=exports.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const o=t=>{var i;if(t.children&&"length"in t.children&&t.children.length)for(let n=t.children.length-1;n>=0;n--){const r=t.children[n],a=n+1<t.children.length?t.children[n+1]:void 0;r.type==="element"&&r.tagName==="input"&&((i=r.properties)==null?void 0:i.type)==="checkbox"&&(a==null?void 0:a.type)==="element"&&a.tagName==="p"?(a.tagName="span",a.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):o(r)}};return o}function Oe(e){const o=exports.esmDependencies;if(!o)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return o.unified.unified().use(o.rehypeParse.default,{fragment:!0}).use(ra).use(aa).use(o.rehypeRemark.default).use(o.remarkGfm.default).use(o.remarkStringify.default,{handlers:{text:i=>i.value}}).processSync(e).value}async function hi(e,o,t,i){await He();const r=ye(o,t).exportBlocks(e,i);return Oe(r)}function sa(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function la(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function da(e){e.querySelectorAll("li > ul, li > ol").forEach(o=>{const t=sa(o),i=o.parentElement,n=Array.from(i.childNodes).slice(t+1);o.remove(),n.forEach(r=>{r.remove()}),i.insertAdjacentElement("afterend",o),n.reverse().forEach(r=>{if(la(r))return;const a=document.createElement("li");a.append(r),o.insertAdjacentElement("afterend",a)}),i.childNodes.length===0&&i.remove()})}function ca(e){e.querySelectorAll("li + ul, li + ol").forEach(o=>{var r,a;const t=o.previousElementSibling,i=document.createElement("div");t.insertAdjacentElement("afterend",i),i.append(t);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((r=i.nextElementSibling)==null?void 0:r.nodeName)==="UL"||((a=i.nextElementSibling)==null?void 0:a.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Lt=null;function ua(){return Lt||(Lt=document.implementation.createHTMLDocument("title"))}function fi(e){if(typeof e=="string"){const o=ua().createElement("div");o.innerHTML=e,e=o}return da(e),ca(e),e}async function wt(e,o,t,i,n){const r=fi(e),s=S.DOMParser.fromSchema(n).parse(r,{topNode:n.nodes.blockGroup.create()}),l=[];for(let d=0;d<s.childCount;d++)l.push(E(s.child(d),o,t,i));return l}function pa(e,o){const t=o.value?o.value:"",i={};o.lang&&(i["data-language"]=o.lang);let n={type:"element",tagName:"code",properties:i,children:[{type:"text",value:t}]};return o.meta&&(n.data={meta:o.meta}),e.patch(o,n),n=e.applyData(o,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(o,n),n}async function gi(e,o,t,i,n){const r=await He(),a=r.unified.unified().use(r.remarkParse.default).use(r.remarkGfm.default).use(r.remarkRehype.default,{handlers:{...r.remarkRehype.defaultHandlers,code:pa}}).use(r.rehypeStringify.default).processSync(e);return wt(a.value,o,t,i,n)}const vt=["vscode-editor-data","blocknote/html","text/html","text/plain","Files"];function ma(e,o){if(!e.startsWith(".")||!o.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===o}function ha(e,o){const t=e.split("/"),i=o.split("/");if(t.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${o} is not a valid MIME type.`);return t[1]==="*"||i[1]==="*"?t[0]===i[0]:(t[0]==="*"||i[0]==="*"||t[0]===i[0])&&t[1]===i[1]}function Pt(e,o,t){let i;return Array.isArray(o.content)&&o.content.length===0?i=e.updateBlock(o,t).id:i=e.insertBlocks([t],o,"after")[0].id,i}async function bi(e,o){var a;if(!o.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const t="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(t===null)return;let i=null;for(const s of vt)if(t.types.includes(s)){i=s;break}if(i!=="Files")return;const n=t.items;if(!n)return;e.preventDefault();const r=Object.values(o.schema.blockSchema).filter(s=>s.isFileBlock);for(let s=0;s<n.length;s++){let l="file";for(const c of r)for(const u of c.fileBlockAccept||[]){const m=u.startsWith("."),h=n[s].getAsFile();if(h&&(!m&&h.type&&ha(n[s].type,u)||m&&ma("."+h.name.split(".").pop(),u))){l=c.type;break}}const d=n[s].getAsFile();if(d){const c={type:l,props:{name:d.name}};let u;if(e.type==="paste"){const f=o.getTextCursorPosition().block;u=Pt(o,f,c)}else if(e.type==="drop"){const f={left:e.clientX,top:e.clientY},g=(a=o.prosemirrorView)==null?void 0:a.posAtCoords(f);if(!g)return;const b=G(o._tiptapEditor.state.doc,g.pos);u=Pt(o,o.getBlock(b.node.attrs.id),c)}else return;const m=await o.uploadFile(d,u),h=typeof m=="string"?{props:{url:m}}:{...m};o.updateBlock(u,h)}}}const fa=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{drop(o,t){if(!e.isEditable)return;let i=null;for(const n of vt)if(t.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(bi(t,e),!0):!1}}}})]}});async function ga(e,o){const{schema:t}=o.state;if(!e.clipboardData)return!1;const i=e.clipboardData.getData("text/plain");if(!i)return!1;if(!t.nodes.codeBlock)return o.pasteText(i),!0;const n=e.clipboardData.getData("vscode-editor-data"),r=n?JSON.parse(n):void 0,a=r==null?void 0:r.mode;return a?(o.pasteHTML(`<pre><code class="language-${a}">${i.replace(/\r\n?/g,`
|
|
11
|
-
`)}</code></pre>`),!0):!1}const ba=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{paste(o,t){if(t.preventDefault(),!e.isEditable)return;let i;for(const r of vt)if(t.clipboardData.types.includes(r)){i=r;break}if(!i)return!0;if(i==="vscode-editor-data")return ga(t,o),!0;if(i==="Files")return bi(t,e),!0;let n=t.clipboardData.getData(i);return i==="blocknote/html"?(o.pasteHTML(n),!0):i==="text/html"?(n=fi(n.trim()).innerHTML,o.pasteHTML(n),!0):(o.pasteText(n),!0)}}}})]}});function ki(e,o){const t=[];return e.descendants(i=>{var n,r;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((r=i.firstChild)==null||r.forEach(a=>{t.push(E(a,o.blockSchema,o.inlineContentSchema,o.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(t.push(E(i,o.blockSchema,o.inlineContentSchema,o.styleSchema)),!1):!0}),t}function ka(e,o,t){var s;let i=!1;const n=e.state.selection instanceof L.CellSelection;if(!n){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,d=[];for(let c=0;c<l.childCount;c++)d.push(l.child(c));i=d.find(c=>c.type.isInGroup("bnBlock")||c.type.name==="blockGroup"||c.type.spec.group==="blockContent")===void 0,i&&(o=l)}let r;const a=ye(e.state.schema,t);if(n){((s=o.firstChild)==null?void 0:s.type.name)==="table"&&(o=o.firstChild.content);const l=dt(o,t.schema.inlineContentSchema,t.schema.styleSchema);r=`<table>${a.exportInlineContent(l,{})}</table>`}else if(i){const l=ke(o,t.schema.inlineContentSchema,t.schema.styleSchema);r=a.exportInlineContent(l,{})}else{const l=ki(o,t.schema);r=a.exportBlocks(l,{})}return r}function _i(e,o){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&o.dispatch(o._tiptapEditor.state.tr.setSelection(new y.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const t=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=ka(e,i,o),r=Oe(n);return{clipboardHTML:t,externalHTML:n,markdown:r}}const At=()=>{const e=window.getSelection();if(!e||e.isCollapsed)return!0;let o=e.focusNode;for(;o;){if(o instanceof HTMLElement&&o.getAttribute("contenteditable")==="false")return!0;o=o.parentElement}return!1},Nt=(e,o,t)=>{t.preventDefault(),t.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:r}=_i(o,e);t.clipboardData.setData("blocknote/html",i),t.clipboardData.setData("text/html",n),t.clipboardData.setData("text/plain",r)},_a=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{copy(o,t){return At()||Nt(e,o,t),!0},cut(o,t){return At()||(Nt(e,o,t),o.editable&&o.dispatch(o.state.tr.deleteSelection())),!0},dragstart(o,t){if(!("node"in o.state.selection)||o.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new y.NodeSelection(o.state.doc.resolve(o.state.selection.from-1)))),t.preventDefault(),t.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:r}=_i(o,e);return t.dataTransfer.setData("blocknote/html",i),t.dataTransfer.setData("text/html",n),t.dataTransfer.setData("text/plain",r),!0}}}})]}}),ya=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer","tableCell","tableHeader"],attributes:{backgroundColor:{default:P.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):P.backgroundColor.default,renderHTML:e=>e.backgroundColor===P.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}}),wa=e=>{var i;const o=[];o.push(_n.default.configure({fragment:e.fragment}));const t=(i=e.provider)==null?void 0:i.awareness;if(t){const n=new Map;e.showCursorLabels!=="always"&&t.on("change",({updated:s})=>{for(const l of s){const d=n.get(l);d&&(d.element.setAttribute("data-active",""),d.hideTimeout&&clearTimeout(d.hideTimeout),n.set(l,{element:d.element,hideTimeout:setTimeout(()=>{d.element.removeAttribute("data-active")},2e3)}))}});const r=s=>{const l=document.createElement("span");l.classList.add("bn-collaboration-cursor__base");const d=document.createElement("span");d.setAttribute("contentedEditable","false"),d.classList.add("bn-collaboration-cursor__caret"),d.setAttribute("style",`background-color: ${s.color}`);const c=document.createElement("span");return c.classList.add("bn-collaboration-cursor__label"),c.setAttribute("style",`background-color: ${s.color}`),c.insertBefore(document.createTextNode(s.name),null),d.insertBefore(c,null),l.insertBefore(document.createTextNode(""),null),l.insertBefore(d,null),l.insertBefore(document.createTextNode(""),null),l},a=(s,l)=>{var c;let d=n.get(l);if(!d){const u=((c=e==null?void 0:e.renderCursor)==null?void 0:c.call(e,s))||r(s);(e==null?void 0:e.showCursorLabels)!=="always"&&(u.addEventListener("mouseenter",()=>{const m=n.get(l);m.element.setAttribute("data-active",""),m.hideTimeout&&(clearTimeout(m.hideTimeout),n.set(l,{element:m.element,hideTimeout:void 0}))}),u.addEventListener("mouseleave",()=>{const m=n.get(l);n.set(l,{element:m.element,hideTimeout:setTimeout(()=>{m.element.removeAttribute("data-active")},2e3)})})),d={element:u,hideTimeout:void 0},n.set(l,d)}return d.element};o.push(yn.default.configure({user:e.user,render:a,provider:e.provider}))}return o},yi=k.Mark.create({name:"comment",excludes:"",inclusive:!1,keepOnSplit:!0,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute("data-orphan"),renderHTML:e=>e.orphan?{"data-orphan":"true"}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute("data-bn-thread-id"),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:""}}},renderHTML({HTMLAttributes:e}){return["span",k.mergeAttributes(e,{class:"bn-thread-mark"})]},parseHTML(){return[{tag:"span.bn-thread-mark"}]},extendMarkSchema(e){return e.name==="comment"?{blocknoteIgnore:!0}:{}}});class X{constructor(){p(this,"callbacks",{})}on(o,t){return this.callbacks[o]||(this.callbacks[o]=[]),this.callbacks[o].push(t),()=>this.off(o,t)}emit(o,...t){const i=this.callbacks[o];i&&i.forEach(n=>n.apply(this,t))}off(o,t){const i=this.callbacks[o];i&&(t?this.callbacks[o]=i.filter(n=>n!==t):delete this.callbacks[o])}removeAllListeners(){this.callbacks={}}}class va extends X{constructor(t){super();p(this,"userCache",new Map);p(this,"loadingUsers",new Set);this.resolveUsers=t}async loadUsers(t){const i=t.filter(n=>!this.userCache.has(n)&&!this.loadingUsers.has(n));if(i.length!==0){for(const n of i)this.loadingUsers.add(n);try{const n=await this.resolveUsers(i);for(const r of n)this.userCache.set(r.id,r);this.emit("update",this.userCache)}finally{for(const n of i)this.loadingUsers.delete(n)}}}getUser(t){return this.userCache.get(t)}subscribe(t){return this.on("update",t)}}const Ce=new y.PluginKey("blocknote-comments"),Ca="SET_SELECTED_THREAD_ID";function xa(e,o){const t=new Map;return e.descendants((i,n)=>{i.marks.forEach(r=>{if(r.type.name===o){const a=r.attrs.threadId;if(!a)return;const s=n,l=s+i.nodeSize,d=t.get(a)??{from:1/0,to:0};t.set(a,{from:Math.min(s,d.from),to:Math.max(l,d.to)})}})}),t}class Sa extends X{constructor(t,i,n){super();p(this,"plugin");p(this,"userStore");p(this,"pendingComment",!1);p(this,"selectedThreadId");p(this,"threadPositions",new Map);p(this,"updateMarksFromThreads",t=>{const i=this.editor._tiptapEditor;i.state.doc.descendants((n,r)=>{n.marks.forEach(a=>{if(a.type.name===this.markType){const s=a.type,l=a.attrs.threadId,d=t.get(l),c=!!(!d||d.resolved||d.deletedAt);if(c!==a.attrs.orphan){const{tr:u}=i.state,m=Math.max(r,0),h=Math.min(r+n.nodeSize,i.state.doc.content.size-1);u.removeMark(m,h,s),u.addMark(m,h,s.create({...a.attrs,orphan:c})),i.dispatch(u),c&&this.selectedThreadId===l&&(this.selectedThreadId=void 0,this.emitStateUpdate())}}})})});if(this.editor=t,this.threadStore=i,this.markType=n,!t.resolveUsers)throw new Error("resolveUsers is required for comments");this.userStore=new va(t.resolveUsers),this.threadStore.subscribe(this.updateMarksFromThreads),t.onCreate(()=>{this.updateMarksFromThreads(this.threadStore.getThreads()),t.onSelectionChange(()=>{this.pendingComment&&(this.pendingComment=!1,this.emitStateUpdate())})});const r=this;this.plugin=new y.Plugin({key:Ce,state:{init(){return{decorations:T.DecorationSet.empty}},apply(a,s){const l=a.getMeta(Ce);if(!a.docChanged&&!l)return s;const d=a.docChanged?xa(a.doc,r.markType):r.threadPositions;(d.size>0||r.threadPositions.size>0)&&(r.threadPositions=d,r.emitStateUpdate());const c=[];if(r.selectedThreadId){const u=d.get(r.selectedThreadId);u&&c.push(T.Decoration.inline(u.from,u.to,{class:"bn-thread-mark-selected"}))}return{decorations:T.DecorationSet.create(a.doc,c)}}},props:{decorations(a){var s;return((s=Ce.getState(a))==null?void 0:s.decorations)??T.DecorationSet.empty},handleClick:(a,s,l)=>{if(l.button!==0)return;const d=a.state.doc.nodeAt(s);if(!d){r.selectThread(void 0);return}const c=d.marks.find(m=>m.type.name===n&&m.attrs.orphan!==!0),u=c==null?void 0:c.attrs.threadId;r.selectThread(u,!1)}}})}emitStateUpdate(){this.emit("update",{selectedThreadId:this.selectedThreadId,pendingComment:this.pendingComment,threadPositions:this.threadPositions})}onUpdate(t){return this.on("update",t)}selectThread(t,i=!0){var n,r;if(this.selectedThreadId!==t&&(this.selectedThreadId=t,this.emitStateUpdate(),this.editor.dispatch(this.editor.prosemirrorView.state.tr.setMeta(Ce,{name:Ca})),t&&i)){const a=this.threadPositions.get(t);if(!a)return;(r=(n=this.editor.prosemirrorView)==null?void 0:n.domAtPos(a.from).node)==null||r.scrollIntoView({behavior:"smooth",block:"center"})}}startPendingComment(){this.pendingComment=!0,this.emitStateUpdate()}stopPendingComment(){this.pendingComment=!1,this.emitStateUpdate()}async createThread(t){const i=await this.threadStore.createThread(t);if(this.threadStore.addThreadToDocument){const n=this.editor.prosemirrorView,r=n.state.selection,a=Ge.ySyncPluginKey.getState(n.state),s={prosemirror:{head:r.head,anchor:r.anchor},yjs:a?Ge.getRelativeSelection(a.binding,n.state):void 0};await this.threadStore.addThreadToDocument({threadId:i.id,selection:s})}else this.editor._tiptapEditor.commands.setMark(this.markType,{orphan:!1,threadId:i.id})}}class wi{constructor(o,t,i,n){p(this,"state");p(this,"emitUpdate");p(this,"mouseDownHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"dragstartHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;if((o=this.state)!=null&&o.show){const t=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!t)return;this.state.referencePos=t.getBoundingClientRect(),this.emitUpdate()}});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pluginKey=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");n(this.state)},i.dom.addEventListener("mousedown",this.mouseDownHandler),i.dom.addEventListener("dragstart",this.dragstartHandler),i.root.addEventListener("scroll",this.scrollHandler,!0)}update(o,t){var n,r;const i=this.pluginKey.getState(o.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const a=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!a)return;this.state={show:!0,referencePos:a.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!o.state.selection.eq(t.selection)||!o.state.doc.eq(t.doc)||!this.editor.isEditable)&&(r=this.state)!=null&&r.show&&(this.state.show=!1,this.emitUpdate())}destroy(){this.pmView.dom.removeEventListener("mousedown",this.mouseDownHandler),this.pmView.dom.removeEventListener("dragstart",this.dragstartHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const Fe=new y.PluginKey("FilePanelPlugin");class vi extends X{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>{var t;return(t=this.view)==null?void 0:t.closeMenu()});this.plugin=new y.Plugin({key:Fe,view:i=>(this.view=new wi(t,Fe,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var r;return n.key==="Escape"&&this.shown?((r=this.view)==null||r.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var r;return{block:(r=i.getMeta(Fe))==null?void 0:r.block}}}})}get shown(){var t,i;return((i=(t=this.view)==null?void 0:t.state)==null?void 0:i.show)||!1}onUpdate(t){return this.on("update",t)}}class Ci{constructor(o,t,i){p(this,"state");p(this,"emitUpdate");p(this,"preventHide",!1);p(this,"preventShow",!1);p(this,"shouldShow",({state:o,from:t,to:i})=>{const{doc:n,selection:r}=o,{empty:a}=r,s=!n.textBetween(t,i).length&&k.isTextSelection(o.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(a||s)});p(this,"blurHandler",o=>{var i;if(this.preventHide){this.preventHide=!1;return}const t=this.pmView.dom.parentElement;o&&o.relatedTarget&&(t===o.relatedTarget||t.contains(o.relatedTarget)||o.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"viewMousedownHandler",()=>{this.preventShow=!0});p(this,"mouseupHandler",()=>{this.preventShow&&(this.preventShow=!1,setTimeout(()=>this.update(this.pmView)))});p(this,"dragHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},t.dom.addEventListener("mousedown",this.viewMousedownHandler),t.root.addEventListener("mouseup",this.mouseupHandler),t.dom.addEventListener("dragstart",this.dragHandler),t.dom.addEventListener("dragover",this.dragHandler),t.dom.addEventListener("blur",this.blurHandler),t.root.addEventListener("scroll",this.scrollHandler,!0)}update(o,t){var m;const{state:i,composing:n}=o,{selection:r}=i,a=t&&t.selection.from===i.selection.from&&t.selection.to===i.selection.to;if(n||a)return;const{ranges:s}=r,l=Math.min(...s.map(h=>h.$from.pos)),d=Math.max(...s.map(h=>h.$to.pos)),c=this.shouldShow({view:o,state:i,from:l,to:d}),u=typeof Range.prototype.getClientRects>"u";if(!this.preventShow&&(c||this.preventHide)&&!u){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((m=this.state)!=null&&m.show&&!this.preventHide&&(!c||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("mouseup",this.mouseupHandler),this.pmView.dom.removeEventListener("dragstart",this.dragHandler),this.pmView.dom.removeEventListener("dragover",this.dragHandler),this.pmView.dom.removeEventListener("blur",this.blurHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:o}=this.pmView,{selection:t}=o,{ranges:i}=t,n=Math.min(...i.map(a=>a.$from.pos)),r=Math.max(...i.map(a=>a.$to.pos));if(k.isNodeSelection(t)){const a=this.pmView.nodeDOM(n);if(a)return a.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,r)}}const xi=new y.PluginKey("FormattingToolbarPlugin");class Si extends X{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:xi,view:i=>(this.view=new Ci(t,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var t,i;return((i=(t=this.view)==null?void 0:t.state)==null?void 0:i.show)||!1}onUpdate(t){return this.on("update",t)}}const Dt=(e,o)=>{const t=e.resolve(o);if(t.depth<=1)return;const i=t.posAtIndex(t.index(t.depth-1),t.depth-1);return de(e.resolve(i))},nt=(e,o)=>{const t=e.resolve(o),i=t.index();if(i===0)return;const n=t.posAtIndex(i-1);return de(e.resolve(n))},Ei=(e,o)=>{for(;o.childContainer;){const t=o.childContainer.node,i=e.resolve(o.childContainer.beforePos+1).posAtIndex(t.childCount-1);o=de(e.resolve(i))}return o},Ea=(e,o)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&o.isBlockContainer&&o.blockContent.node.type.spec.content==="inline*",Ba=(e,o,t,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),r=e.doc.resolve(i.childContainer.afterPos-1),a=n.blockRange(r);if(o){const s=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(a,s.depth)}}if(o){if(!t.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but previous block is not a block container`);o(e.tr.delete(t.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},jt=e=>({state:o,dispatch:t})=>{const i=o.doc.resolve(e),n=de(i),r=nt(o.doc,n.bnBlock.beforePos);if(!r)return!1;const a=Ei(o.doc,r);return Ea(a,n)?Ba(o,t,a,n):!1},Ta=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:r})=>{const a=C(r);if(!a.isBlockContainer)return!1;const s=r.selection.from===a.blockContent.beforePos+1,l=a.blockContent.node.type.name==="paragraph";return s&&!l?n.command(A(this.options.editor,a.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:r})=>{const a=C(r);if(!a.isBlockContainer)return!1;const{blockContent:s}=a;return r.selection.from===s.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:r})=>{const a=C(r);if(!a.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=a,d=r.selection.from===l.beforePos+1,c=r.selection.empty,u=s.beforePos;return d&&c?i().command(jt(u)).scrollIntoView().run():!1}),()=>n.command(({state:r,dispatch:a})=>{const s=C(r);if(!s.isBlockContainer||!(r.selection.from===s.blockContent.beforePos+1)||nt(r.doc,s.bnBlock.beforePos))return!1;const c=Dt(r.doc,s.bnBlock.beforePos);if((c==null?void 0:c.blockNoteType)!=="column")return!1;const u=c,m=Dt(r.doc,u.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const h=u.childContainer.node.childCount===1,f=h&&m.childContainer.node.childCount===2,g=m.childContainer.node.firstChild===u.bnBlock.node;if(a){const b=r.doc.slice(s.bnBlock.beforePos,s.bnBlock.afterPos,!1);if(f)if(g){r.tr.step(new Be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,u.bnBlock.afterPos+1,m.bnBlock.afterPos-2,b,b.size,!1));const _=r.tr.doc.resolve(u.bnBlock.beforePos);r.tr.setSelection(y.TextSelection.between(_,_))}else{r.tr.step(new Be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,u.bnBlock.beforePos-1,b,0,!1));const _=r.tr.doc.resolve(r.tr.mapping.map(u.bnBlock.beforePos-1));r.tr.setSelection(y.TextSelection.between(_,_))}else if(h)if(g){r.tr.delete(u.bnBlock.beforePos,u.bnBlock.afterPos),r.tr.insert(m.bnBlock.beforePos,b.content);const _=r.tr.doc.resolve(m.bnBlock.beforePos);r.tr.setSelection(y.TextSelection.between(_,_))}else r.tr.delete(u.bnBlock.beforePos-1,u.bnBlock.beforePos+1);else{r.tr.delete(s.bnBlock.beforePos,s.bnBlock.afterPos),g?r.tr.insert(m.bnBlock.beforePos-1,b.content):r.tr.insert(u.bnBlock.beforePos-1,b.content);const _=r.tr.doc.resolve(u.bnBlock.beforePos-1);r.tr.setSelection(y.TextSelection.between(_,_))}}return!0}),()=>n.command(({state:r})=>{const a=C(r);if(!a.isBlockContainer)throw new Error("todo");const s=r.selection.from===a.blockContent.beforePos+1,l=r.selection.empty,d=nt(r.doc,a.bnBlock.beforePos);if(d&&s&&l){const c=Ei(r.doc,d);if(!c.isBlockContainer)throw new Error("todo");if(c.blockContent.node.type.spec.content===""||c.blockContent.node.type.spec.content==="inline*"&&c.blockContent.node.childCount===0)return i().cut({from:a.bnBlock.beforePos,to:a.bnBlock.afterPos},c.bnBlock.afterPos).deleteRange({from:c.bnBlock.beforePos,to:c.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.command(({state:n})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:a,blockContent:s,childContainer:l}=r,{depth:d}=n.doc.resolve(a.beforePos),c=a.afterPos===n.doc.nodeSize-3,u=n.selection.from===s.afterPos-1,m=n.selection.empty;if(!c&&u&&m&&!(l!==void 0)){let f=d,g=a.afterPos+1,b=n.doc.resolve(g).depth;for(;b<f;)f=b,g+=2,b=n.doc.resolve(g).depth;return i.command(jt(g-1))}return!1})]),Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:a,blockContent:s}=r,{depth:l}=n.doc.resolve(a.beforePos),d=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,u=s.node.childCount===0,m=l>1;return d&&c&&u&&m?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:r})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=a,d=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,u=l.node.childCount===0;if(d&&c&&u){const m=s.afterPos,h=m+2;if(r){const f=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(m,f).scrollIntoView(),n.tr.setSelection(new y.TextSelection(n.doc.resolve(h)))}return!0}return!1}),()=>i.command(({state:n,chain:r})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{blockContent:s}=a,l=n.selection.$anchor.parentOffset===0;return s.node.childCount===0?!1:(r().deleteSelection().command(Ko(n.selection.from,l,l)).run(),!0)})]),Tab:()=>{var i,n,r;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown)?!1:ui(this.options.editor)},"Shift-Tab":()=>{var i,n,r;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(r=this.options.editor.filePanel)!=null&&r.shown)?!1:(this.editor.commands.liftListItem("blockContainer"),!0)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0)}}});class Ma{constructor(o,t,i){p(this,"state");p(this,"emitUpdate");p(this,"menuUpdateTimer");p(this,"startMenuUpdateTimer");p(this,"stopMenuUpdateTimer");p(this,"mouseHoveredLinkMark");p(this,"mouseHoveredLinkMarkRange");p(this,"keyboardHoveredLinkMark");p(this,"keyboardHoveredLinkMarkRange");p(this,"linkMark");p(this,"linkMarkRange");p(this,"mouseOverHandler",o=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),o.target instanceof HTMLAnchorElement&&o.target.nodeName==="A"){const t=o.target,i=this.pmView.posAtDOM(t,0)+1,n=this.pmView.state.doc.resolve(i),r=n.marks();for(const a of r)if(a.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=a,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,a.type,a.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});p(this,"clickHandler",o=>{var i;const t=this.pmView.dom.parentElement;this.linkMark&&o&&o.target&&!(t===o.target||t.contains(o.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;this.linkMark!==void 0&&(o=this.state)!=null&&o.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");i(this.state)},this.startMenuUpdateTimer=()=>{this.menuUpdateTimer=setTimeout(()=>{this.update(this.pmView,void 0,!0)},250)},this.stopMenuUpdateTimer=()=>(this.menuUpdateTimer&&(clearTimeout(this.menuUpdateTimer),this.menuUpdateTimer=void 0),!1),this.pmView.dom.addEventListener("mouseover",this.mouseOverHandler),this.pmView.root.addEventListener("click",this.clickHandler,!0),this.pmView.root.addEventListener("scroll",this.scrollHandler,!0)}editLink(o,t){var n;const i=this.pmView.state.tr.insertText(t,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+t.length,this.pmView.state.schema.mark("link",{href:o})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var o;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())}update(o,t,i=!1){var s;const{state:n}=o;if(t&&t.selection.from===n.selection.from&&t.selection.to===n.selection.to||!this.pmView.hasFocus())return;const a=this.linkMark;if(this.linkMark=void 0,this.linkMarkRange=void 0,this.keyboardHoveredLinkMark=void 0,this.keyboardHoveredLinkMarkRange=void 0,this.pmView.state.selection.empty){const l=this.pmView.state.selection.$from.marks();for(const d of l)if(d.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=d,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,d.type,d.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&i&&(this.linkMark=this.mouseHoveredLinkMark,this.linkMarkRange=this.mouseHoveredLinkMarkRange),this.keyboardHoveredLinkMark&&(this.linkMark=this.keyboardHoveredLinkMark,this.linkMarkRange=this.keyboardHoveredLinkMarkRange),this.linkMark&&this.editor.isEditable){this.state={show:!0,referencePos:k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),url:this.linkMark.attrs.href,text:this.pmView.state.doc.textBetween(this.linkMarkRange.from,this.linkMarkRange.to)},this.emitUpdate();return}if((s=this.state)!=null&&s.show&&a&&(!this.linkMark||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mouseover",this.mouseOverHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0),this.pmView.root.removeEventListener("click",this.clickHandler,!0)}}const Bi=new y.PluginKey("LinkToolbarPlugin");class Ti extends X{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"editLink",(t,i)=>{this.view.editLink(t,i)});p(this,"deleteLink",()=>{this.view.deleteLink()});p(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});p(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:Bi,view:i=>(this.view=new Ma(t,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(t){return this.on("update",t)}get shown(){var t,i;return((i=(t=this.view)==null?void 0:t.state)==null?void 0:i.show)||!1}}const Mi=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],Ii="https",Ia=new y.PluginKey("node-selection-keyboard");class La{constructor(){p(this,"plugin");this.plugin=new y.Plugin({key:Ia,props:{handleKeyDown:(o,t)=>{if("node"in o.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(t.key.length===1)return t.preventDefault(),!0;if(t.key==="Enter"&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){const i=o.state.tr;return o.dispatch(i.insert(o.state.tr.selection.$to.after(),o.state.schema.nodes.paragraph.createChecked()).setSelection(new y.TextSelection(i.doc.resolve(o.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const Pa=new y.PluginKey("blocknote-placeholder");class Aa{constructor(o,t){p(this,"plugin");this.plugin=new y.Plugin({key:Pa,view:i=>{var d,c;const n=`placeholder-selector-${zt.v4()}`;i.dom.classList.add(n);const r=document.createElement("style"),a=o._tiptapEditor.options.injectNonce;a&&r.setAttribute("nonce",a),((d=o.prosemirrorView)==null?void 0:d.root)instanceof ShadowRoot?o.prosemirrorView.root.append(r):(c=o.prosemirrorView)==null||c.root.head.appendChild(r);const s=r.sheet,l=(u="")=>`.${n} .bn-block-content${u} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;try{const{default:u,emptyDocument:m,...h}=t;for(const[b,_]of Object.entries(h)){const w=`[data-content-type="${b}"]`;s.insertRule(`${l(w)} { content: ${JSON.stringify(_)}; }`)}const f="[data-is-only-empty-block]",g="[data-is-empty-and-focused]";s.insertRule(`${l(f)} { content: ${JSON.stringify(m)}; }`),s.insertRule(`${l(g)} { content: ${JSON.stringify(u)}; }`)}catch(u){console.warn("Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",u)}return{destroy:()=>{var u,m;((u=o.prosemirrorView)==null?void 0:u.root)instanceof ShadowRoot?o.prosemirrorView.root.removeChild(r):(m=o.prosemirrorView)==null||m.root.head.removeChild(r)}}},props:{decorations:i=>{const{doc:n,selection:r}=i;if(!o.isEditable||!r.empty||r.$from.parent.type.spec.code)return;const a=[];i.doc.content.size===6&&a.push(T.Decoration.node(2,4,{"data-is-only-empty-block":"true"}));const s=r.$anchor,l=s.parent;if(l.content.size===0){const d=s.before();a.push(T.Decoration.node(d,d+l.nodeSize,{"data-is-empty-and-focused":"true"}))}return T.DecorationSet.create(n,a)}}})}}const Rt=new y.PluginKey("previous-blocks"),Na={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class Da{constructor(){p(this,"plugin");let o;this.plugin=new y.Plugin({key:Rt,view(t){return{update:async(i,n)=>{var r;((r=this.key)==null?void 0:r.getState(i.state).updatedBlocks.size)>0&&(o=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(Rt,{clearUpdate:!0}))},0))},destroy:()=>{o&&clearTimeout(o)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(t,i,n,r){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!t.docChanged||n.doc.eq(r.doc))return i;const a={},s=k.findChildren(n.doc,c=>c.attrs.id),l=new Map(s.map(c=>[c.node.attrs.id,c])),d=k.findChildren(r.doc,c=>c.attrs.id);for(const c of d){const u=l.get(c.node.attrs.id),m=u==null?void 0:u.node.firstChild,h=c.node.firstChild;if(u&&m&&h){const f={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:r.doc.resolve(c.pos).depth};let g={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(u.pos).depth};a[c.node.attrs.id]=g,t.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(g=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),f.type==="numberedListItem"&&(g.index=f.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=g,JSON.stringify(g)!==JSON.stringify(f)&&(g["depth-change"]=g.depth-f.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=a,i}},props:{decorations(t){const i=this.getState(t);if(i.updatedBlocks.size===0)return;const n=[];return t.doc.descendants((r,a)=>{if(!r.attrs.id||!i.updatedBlocks.has(r.attrs.id))return;const s=i.currentTransactionOldBlockAttrs[r.attrs.id],l={};for(const[c,u]of Object.entries(s))l["data-prev-"+Na[c]]=u||"none";const d=T.Decoration.node(a,a+r.nodeSize,{...l});n.push(d)}),T.DecorationSet.create(t.doc,n)}}})}}const Ut=new y.PluginKey("blocknote-show-selection");class ja{constructor(o){p(this,"plugin");p(this,"enabled",!1);this.editor=o,this.plugin=new y.Plugin({key:Ut,props:{decorations:t=>{const{doc:i,selection:n}=t;if(!this.enabled)return T.DecorationSet.empty;const r=T.Decoration.inline(n.from,n.to,{"data-show-selection":"true"});return T.DecorationSet.create(i,[r])}}})}setEnabled(o){var t,i;this.enabled!==o&&(this.enabled=o,(i=this.editor.prosemirrorView)==null||i.dispatch((t=this.editor.prosemirrorView)==null?void 0:t.state.tr.setMeta(Ut,{})))}getEnabled(){return this.enabled}}function Li(e,o){var t,i;for(;e&&e.parentElement&&e.parentElement!==o.dom&&((t=e.getAttribute)==null?void 0:t.call(e,"data-node-type"))!=="blockContainer";)e=e.parentElement;if(((i=e.getAttribute)==null?void 0:i.call(e,"data-node-type"))==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}class ne extends y.Selection{constructor(t,i){super(t,i);p(this,"nodes");const n=t.node();this.nodes=[],t.doc.nodesBetween(t.pos,i.pos,(r,a,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(r),!1})}static create(t,i,n=i){return new ne(t.resolve(i),t.resolve(n))}content(){return new S.Slice(S.Fragment.from(this.nodes),0,0)}eq(t){if(!(t instanceof ne)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let i=0;i<this.nodes.length;i++)if(!this.nodes[i].eq(t.nodes[i]))return!1;return!0}map(t,i){const n=i.mapResult(this.from),r=i.mapResult(this.to);return r.deleted?y.Selection.near(t.resolve(n.pos)):n.deleted?y.Selection.near(t.resolve(r.pos)):new ne(t.resolve(n.pos),t.resolve(r.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let V;function Ra(e,o){let t,i;const n=o.resolve(e.from).node().type.spec.group==="blockContent",r=o.resolve(e.to).node().type.spec.group==="blockContent",a=Math.min(e.$anchor.depth,e.$head.depth);if(n&&r){const s=e.$from.start(a-1),l=e.$to.end(a-1);t=o.resolve(s-1).pos,i=o.resolve(l+1).pos}else t=e.from,i=e.to;return{from:t,to:i}}function Ht(e,o,t=o){o===t&&(t+=e.state.doc.resolve(o+1).node().nodeSize);const i=e.domAtPos(o).node.cloneNode(!0),n=e.domAtPos(o).node,r=(u,m)=>Array.prototype.indexOf.call(u.children,m),a=r(n,e.domAtPos(o+1).node.parentElement),s=r(n,e.domAtPos(t-1).node.parentElement);for(let u=n.childElementCount-1;u>=0;u--)(u>s||u<a)&&i.removeChild(i.children[u]);Pi(e.root),V=i;const l=V.getElementsByTagName("iframe");for(let u=0;u<l.length;u++){const m=l[u],h=m.parentElement;h&&h.removeChild(m)}const c=e.dom.className.split(" ").filter(u=>u!=="ProseMirror"&&u!=="bn-root"&&u!=="bn-editor").join(" ");V.className=V.className+" bn-drag-preview "+c,e.root instanceof ShadowRoot?e.root.appendChild(V):e.root.body.appendChild(V)}function Pi(e){V!==void 0&&(e instanceof ShadowRoot?e.removeChild(V):e.body.removeChild(V),V=void 0)}function Ua(e,o,t){if(!e.dataTransfer)return;const i=t.prosemirrorView;if(!i)return;const n=R(o.id,i.state.doc);if(!n)throw new Error(`Block with ID ${o.id} not found`);const r=n.posBeforeNode;if(r!=null){const a=i.state.selection,s=i.state.doc,{from:l,to:d}=Ra(a,s),c=l<=r&&r<d,u=a.$anchor.node()!==a.$head.node()||a instanceof ne;c&&u?(i.dispatch(i.state.tr.setSelection(ne.create(s,l,d))),Ht(i,l,d)):(i.dispatch(i.state.tr.setSelection(y.NodeSelection.create(i.state.doc,r))),Ht(i,r));const m=i.state.selection.content(),h=t.pmSchema,f=i.serializeForClipboard(m).dom.innerHTML,g=ye(h,t),b=ki(m.content,t.schema),_=g.exportBlocks(b,{}),w=Oe(_);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",f),e.dataTransfer.setData("text/html",_),e.dataTransfer.setData("text/plain",w),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(V,0,0)}}const he=.1;function rt(e,o,t,i=!0){const n=e.root.elementsFromPoint(o.left+(t==="editor"?50:0),o.top);for(const r of n)if(e.dom.contains(r))return i&&r.closest("[data-node-type=columnList]")?rt(e,{left:o.left+50,top:o.top},t,!1):Li(r,e)}function Ha(e,o,t){if(!o.dom.firstChild)return;const i=o.dom.firstChild.getBoundingClientRect(),n={left:e.x,top:e.y},r=n.left<i.left,a=n.left>i.right;t==="viewport"&&(r&&(n.left=i.left+10),a&&(n.left=i.right-10));let s=rt(o,n,t);if(!a&&s){const l=s.node.getBoundingClientRect();n.left=l.right-10,s=rt(o,n,"viewport",!1)}return s}class Ai{constructor(o,t,i,n){p(this,"state");p(this,"emitUpdate");p(this,"mousePos");p(this,"hoveredBlock");p(this,"menuFrozen",!1);p(this,"isDragOrigin",!1);p(this,"updateState",o=>{this.state=o,this.emitUpdate(this.state)});p(this,"updateStateFromMousePos",()=>{var i,n,r,a;if(this.menuFrozen||!this.mousePos)return;const o=Ha(this.mousePos,this.pmView,this.sideMenuDetection);if(!o||!this.editor.isEditable){(i=this.state)!=null&&i.show&&(this.state.show=!1,this.updateState(this.state));return}if((n=this.state)!=null&&n.show&&((r=this.hoveredBlock)!=null&&r.hasAttribute("data-id"))&&((a=this.hoveredBlock)==null?void 0:a.getAttribute("data-id"))===o.id)return;this.hoveredBlock=o.node;const t=o.node.firstChild;if(t&&this.editor.isEditable){const s=t.getBoundingClientRect(),l=o.node.closest("[data-node-type=column]");this.updateState({show:!0,referencePos:new DOMRect(l?l.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,s.y,s.width,s.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))})}});p(this,"onDrop",o=>{var n,r;if(this.pmView.dragging===null)return;this.editor._tiptapEditor.commands.blur();const t=o.target instanceof Node&&((n=o.target instanceof HTMLElement?o.target:o.target.parentElement)==null?void 0:n.closest(".bn-editor"))||null;if(t&&(!this.isDragOrigin&&this.pmView.dom===t?this.pmView.dispatch(this.pmView.state.tr.setSelection(y.TextSelection.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.to))):this.isDragOrigin&&this.pmView.dom!==t&&setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0)),this.sideMenuDetection==="editor"||o.synthetic||!((r=o.dataTransfer)!=null&&r.types.includes("blocknote/html")))return;const i=this.pmView.posAtCoords({left:o.clientX,top:o.clientY});if(!i||i.inside===-1){const a=this.createSyntheticEvent(o);this.pmView.dom.dispatchEvent(a)}});p(this,"onDragEnd",()=>{this.pmView.dragging=null});p(this,"onDragStart",o=>{var a;const t=(a=o.dataTransfer)==null?void 0:a.getData("blocknote/html");if(!t)return;if(this.pmView.dragging)throw new Error("New drag was started while an existing drag is ongoing");const i=document.createElement("div");i.innerHTML=t;const r=S.DOMParser.fromSchema(this.pmView.state.schema).parse(i,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new S.Slice(r.content,0,0),move:!0}});p(this,"onDragOver",o=>{var i;if(this.sideMenuDetection==="editor"||o.synthetic||!((i=o.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const t=this.pmView.posAtCoords({left:o.clientX,top:o.clientY});if(!t||t.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(o);this.pmView.dom.dispatchEvent(n)}});p(this,"onKeyDown",o=>{var t;(t=this.state)!=null&&t.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});p(this,"onMouseMove",o=>{var r;if(this.menuFrozen)return;this.mousePos={x:o.clientX,y:o.clientY};const t=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>t.left&&this.mousePos.x<t.right&&this.mousePos.y>t.top&&this.mousePos.y<t.bottom,n=this.pmView.dom.parentElement;if(i&&o&&o.target&&!(n===o.target||n.contains(o.target))){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});p(this,"onScroll",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.referencePos=this.hoveredBlock.getBoundingClientRect(),this.emitUpdate(this.state))});this.editor=o,this.sideMenuDetection=t,this.pmView=i,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");n(this.state)},this.pmView.root.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragend",this.onDragEnd,!0),He(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),i.root.addEventListener("scroll",this.onScroll,!0)}createSyntheticEvent(o){const t=new Event(o.type,o),i=this.pmView.dom.firstChild.getBoundingClientRect();return t.clientX=o.clientX,t.clientY=o.clientY,o.clientX<i.left&&o.clientX>i.left-i.width*he?t.clientX=i.left+i.width*he/2:o.clientX>i.right&&o.clientX<i.right+i.width*he?t.clientX=i.right-i.width*he/2:(o.clientX<i.left||o.clientX>i.right)&&(t.clientX=i.left+he*i.width*2),t.clientY=Math.min(Math.max(o.clientY,i.top),i.top+i.height),t.dataTransfer=o.dataTransfer,t.preventDefault=()=>o.preventDefault(),t.synthetic=!0,t}update(o,t){var n;!t.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("dragend",this.onDragEnd,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0)}}const Ni=new y.PluginKey("SideMenuPlugin");class Di extends X{constructor(t,i){super();p(this,"view");p(this,"plugin");p(this,"blockDragStart",(t,i)=>{this.view&&(this.view.isDragOrigin=!0),Ua(t,i,this.editor)});p(this,"blockDragEnd",()=>{this.editor.prosemirrorView&&Pi(this.editor.prosemirrorView.root),this.view&&(this.view.isDragOrigin=!1)});p(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});p(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=t,this.plugin=new y.Plugin({key:Ni,view:n=>(this.view=new Ai(t,i,n,r=>{this.emit("update",r)}),this.view)})}onUpdate(t){return this.on("update",t)}}const Oa=k.findParentNode(e=>e.type.name==="blockContainer");class Va{constructor(o,t){p(this,"state");p(this,"emitUpdate");p(this,"rootEl");p(this,"pluginState");p(this,"handleScroll",()=>{var o,t;if((o=this.state)!=null&&o.show){const i=(t=this.rootEl)==null?void 0:t.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});p(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(re,null))});p(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});var i,n;this.editor=o,this.pluginState=void 0,this.emitUpdate=r=>{var a;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");t(r,{...this.state,ignoreQueryLength:(a=this.pluginState)==null?void 0:a.ignoreQueryLength})},this.rootEl=(i=this.editor.prosemirrorView)==null?void 0:i.root,(n=this.rootEl)==null||n.addEventListener("scroll",this.handleScroll,!0)}update(o,t){var d;const i=re.getState(t),n=re.getState(o.state),r=i===void 0&&n!==void 0,a=i!==void 0&&n===void 0;if(!r&&!(i!==void 0&&n!==void 0)&&!a)return;if(this.pluginState=a?i:n,a||!this.editor.isEditable){this.state.show=!1,this.emitUpdate(this.pluginState.triggerCharacter);return}const l=(d=this.rootEl)==null?void 0:d.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&l&&(this.state={show:!0,referencePos:l.getBoundingClientRect(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var o;(o=this.rootEl)==null||o.removeEventListener("scroll",this.handleScroll,!0)}}const re=new y.PluginKey("SuggestionMenuPlugin");class ji extends X{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"triggerCharacters",[]);p(this,"addTriggerCharacter",t=>{this.triggerCharacters.push(t)});p(this,"removeTriggerCharacter",t=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==t)});p(this,"closeMenu",()=>this.view.closeMenu());p(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new y.Plugin({key:re,view:()=>(this.view=new Va(t,(n,r)=>{this.emit(`update ${n}`,r)}),this.view),state:{init(){},apply(n,r,a,s){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return r;const l=n.getMeta(re);if(typeof l=="object"&&l!==null&&r===void 0)return{triggerCharacter:l.triggerCharacter,deleteTriggerCharacter:l.deleteTriggerCharacter!==!1,queryStartPos:s.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:l==null?void 0:l.ignoreQueryLength};if(r===void 0)return r;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||r.triggerCharacter!==void 0&&s.selection.from<r.queryStartPos)return;const d={...r};return d.query=s.doc.textBetween(r.queryStartPos,s.selection.from),d}},props:{handleTextInput(n,r,a,s){const l=this.getState(n.state);return i.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(re,{triggerCharacter:s})),!0):!1},decorations(n){const r=this.getState(n);if(r===void 0)return null;if(!r.deleteTriggerCharacter){const a=Oa(n.selection);if(a)return T.DecorationSet.create(n.doc,[T.Decoration.node(a.pos,a.pos+a.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}return T.DecorationSet.create(n.doc,[T.Decoration.inline(r.queryStartPos-r.triggerCharacter.length,r.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":r.decorationId})])}}})}onUpdate(t,i){return this.triggerCharacters.includes(t)||this.addTriggerCharacter(t),this.on(`update ${t}`,i)}get shown(){var t,i;return((i=(t=this.view)==null?void 0:t.state)==null?void 0:i.show)||!1}}function za(e,o){e.suggestionMenus.addTriggerCharacter(o)}let j;function Ot(e){j||(j=document.createElement("div"),j.innerHTML="_",j.style.opacity="0",j.style.height="1px",j.style.width="1px",e instanceof Document?e.body.appendChild(j):e.appendChild(j))}function Fa(e){j&&(e instanceof Document?e.body.removeChild(j):e.removeChild(j),j=void 0)}function xe(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function $a(e){let o=e;for(;o&&o.nodeName!=="TD"&&o.nodeName!=="TH"&&!o.classList.contains("tableWrapper");){if(o.classList.contains("ProseMirror"))return;const t=o.parentNode;if(!t||!(t instanceof Element))return;o=t}return o.nodeName==="TD"||o.nodeName==="TH"?{type:"cell",domNode:o,tbodyNode:o.closest("tbody")}:{type:"wrapper",domNode:o,tbodyNode:o.querySelector("tbody")}}function Ka(e,o){const t=o.querySelectorAll(e);for(let i=0;i<t.length;i++)t[i].style.visibility="hidden"}class Ri{constructor(o,t,i){p(this,"state");p(this,"emitUpdate");p(this,"tableId");p(this,"tablePos");p(this,"tableElement");p(this,"menuFrozen",!1);p(this,"mouseState","up");p(this,"prevWasEditable",null);p(this,"viewMousedownHandler",()=>{this.mouseState="down"});p(this,"mouseUpHandler",o=>{this.mouseState="up",this.mouseMoveHandler(o)});p(this,"mouseMoveHandler",o=>{var d,c,u,m,h,f,g;if(this.menuFrozen||this.mouseState==="selecting"||!(o.target instanceof Element)||!this.pmView.dom.contains(o.target))return;const t=$a(o.target);if((t==null?void 0:t.type)==="cell"&&this.mouseState==="down"&&!((d=this.state)!=null&&d.draggingState)){this.mouseState="selecting",(c=this.state)!=null&&c.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t||!this.editor.isEditable){(u=this.state)!=null&&u.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t.tbodyNode)return;const i=t.tbodyNode.getBoundingClientRect(),n=Li(t.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let r;const a=R(n.id,this.editor._tiptapEditor.state.doc);if(!a)throw new Error(`Block with ID ${n.id} not found`);const s=E(a.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(ni("table",s,this.editor)&&(this.tablePos=a.posBeforeNode+1,r=s),!r)return;this.tableId=n.id;const l=(m=t.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((t==null?void 0:t.type)==="wrapper"){const b=o.clientY>=i.bottom-1&&o.clientY<i.bottom+20,_=o.clientX>=i.right-1&&o.clientX<i.right+20,w=o.clientX>i.right||o.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:b,showAddOrRemoveColumnsButton:_,referencePosTable:i,block:r,widgetContainer:l,colIndex:w||(h=this.state)==null?void 0:h.colIndex,rowIndex:w||(f=this.state)==null?void 0:f.rowIndex,referencePosCell:w||(g=this.state)==null?void 0:g.referencePosCell}}else{const b=xe(t.domNode),_=xe(t.domNode.parentElement),w=t.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===_&&this.state.colIndex===b)return;this.state={show:!0,showAddOrRemoveColumnsButton:b===r.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:_===r.content.rows.length-1,referencePosTable:i,block:r,draggingState:void 0,referencePosCell:w,colIndex:b,rowIndex:_,widgetContainer:l}}return this.emitUpdate(),!1});p(this,"dragOverHandler",o=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;o.preventDefault(),o.dataTransfer.dropEffect="move",Ka(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const t={left:Math.min(Math.max(o.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(o.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(t.left,t.top).filter(h=>h.tagName==="TD"||h.tagName==="TH");if(i.length===0)return;const n=i[0];let r=!1;const a=xe(n.parentElement),s=xe(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation==="row"?a:s)!==l;(this.state.rowIndex!==a||this.state.colIndex!==s)&&(this.state.rowIndex=a,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),r=!0);const u=this.state.draggingState.draggedCellOrientation==="row"?t.top:t.left;this.state.draggingState.mousePos!==u&&(this.state.draggingState.mousePos=u,r=!0),r&&this.emitUpdate(),c&&this.editor.dispatch(this.pmView.state.tr.setMeta(ie,!0))});p(this,"dropHandler",o=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");o.preventDefault();const{draggingState:t,colIndex:i,rowIndex:n}=this.state,r=this.state.block.content.columnWidths;if(t.draggedCellOrientation==="row"){if(!oo(this.state.block,t.originalIndex,n))return!1;const a=Wn(this.state.block,t.originalIndex,n);this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,rows:a}})}else{if(!io(this.state.block,t.originalIndex,i))return!1;const a=Gn(this.state.block,t.originalIndex,i),[s]=r.splice(t.originalIndex,1);r.splice(i,0,s),this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,columnWidths:r,rows:a}})}return this.editor.setTextCursorPosition(this.state.block.id),!0});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},t.dom.addEventListener("mousemove",this.mouseMoveHandler),t.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),t.root.addEventListener("dragover",this.dragOverHandler),t.root.addEventListener("drop",this.dropHandler)}update(){var n;if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||!((n=this.tableElement)!=null&&n.isConnected)){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const{height:o,width:t}=mt(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=o&&(this.state.rowIndex=o-1),this.state.colIndex>=t&&(this.state.colIndex=t-1));const i=this.tableElement.querySelector("tbody");if(!i)throw new Error("Table block does not contain a 'tbody' HTML element. This should never happen.");if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){const a=i.children[this.state.rowIndex].children[this.state.colIndex];a?this.state.referencePosCell=a.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=i.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const ie=new y.PluginKey("TableHandlesPlugin");class Ui extends X{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"colDragStart",t=>{if(this.view.state===void 0||this.view.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"col",originalIndex:this.view.state.colIndex,mousePos:t.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Ot(this.editor.prosemirrorView.root),t.dataTransfer.setDragImage(j,0,0),t.dataTransfer.effectAllowed="move"});p(this,"rowDragStart",t=>{if(this.view.state===void 0||this.view.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:t.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Ot(this.editor.prosemirrorView.root),t.dataTransfer.setDragImage(j,0,0),t.dataTransfer.effectAllowed="copyMove"});p(this,"dragEnd",()=>{if(this.view.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState=void 0,this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ie,null)),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Fa(this.editor.prosemirrorView.root)});p(this,"freezeHandles",()=>{this.view.menuFrozen=!0});p(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});p(this,"getCellsAtRowHandle",(t,i)=>Xe(t,i));p(this,"getCellsAtColumnHandle",(t,i)=>Je(t,i));p(this,"setCellSelection",(t,i=t)=>{const n=this.view;if(!n)throw new Error("Table handles view not initialized");const r=this.editor.prosemirrorState,a=r.doc.resolve(n.tablePos+1),s=r.doc.resolve(a.posAtIndex(t.row)+1),l=r.doc.resolve(s.posAtIndex(t.col)),d=r.doc.resolve(a.posAtIndex(i.row)+1),c=r.doc.resolve(d.posAtIndex(i.col)),u=r.tr;return u.setSelection(new L.CellSelection(l,c)),r.apply(u)});p(this,"addRowOrColumn",(t,i)=>{const n=this.setCellSelection(i.orientation==="row"?{row:t,col:0}:{row:0,col:t});return i.orientation==="row"?i.side==="above"?L.addRowBefore(n,this.editor.dispatch):L.addRowAfter(n,this.editor.dispatch):i.side==="left"?L.addColumnBefore(n,this.editor.dispatch):L.addColumnAfter(n,this.editor.dispatch)});p(this,"removeRowOrColumn",(t,i)=>{const n=this.setCellSelection(i==="row"?{row:t,col:0}:{row:0,col:t});return i==="row"?L.deleteRow(n,this.editor.dispatch):L.deleteColumn(n,this.editor.dispatch)});p(this,"mergeCells",t=>{const i=t?this.setCellSelection(t.relativeStartCell,t.relativeEndCell):this.editor.prosemirrorState;return L.mergeCells(i,this.editor.dispatch)});p(this,"splitCell",t=>{const i=t?this.setCellSelection(t):this.editor.prosemirrorState;return L.splitCell(i,this.editor.dispatch)});p(this,"getCellSelection",()=>{const t=this.editor.prosemirrorState,i=t.selection;let n=i.$from,r=i.$to;if(ot(i)){const{ranges:f}=i;f.forEach(g=>{n=g.$from.min(n??g.$from),r=g.$to.max(r??g.$to)})}else if(n=t.doc.resolve(i.$from.pos-i.$from.parentOffset-1),r=t.doc.resolve(i.$to.pos-i.$to.parentOffset-1),n.pos===0||r.pos===0)return;const a=t.doc.resolve(n.pos-n.parentOffset-1),s=t.doc.resolve(r.pos-r.parentOffset-1),l=t.doc.resolve(a.pos-a.parentOffset-1),d=n.index(a.depth),c=a.index(l.depth),u=r.index(s.depth),m=s.index(l.depth),h=[];for(let f=c;f<=m;f++)for(let g=d;g<=u;g++)h.push({row:f,col:g});return{from:{row:c,col:d},to:{row:m,col:u},cells:h}});p(this,"getMergeDirection",t=>{const i=ot(this.editor.prosemirrorState.selection)?this.editor.prosemirrorState.selection:void 0;if(!i||!t||i.ranges.length<=1)return;const n=this.getCellSelection();if(n)return Xn(n.from,n.to,t)?"vertical":"horizontal"});p(this,"cropEmptyRowsOrColumns",(t,i)=>qn(t,i));p(this,"addRowsOrColumns",(t,i,n)=>Zn(t,i,n));this.editor=t,this.plugin=new y.Plugin({key:ie,view:i=>(this.view=new Ri(t,i,n=>{this.emit("update",n)}),this.view),props:{decorations:i=>{if(this.view===void 0||this.view.state===void 0||this.view.state.draggingState===void 0||this.view.tablePos===void 0)return;const n=this.view.state.draggingState.draggedCellOrientation==="row"?this.view.state.rowIndex:this.view.state.colIndex;if(n===void 0)return;const r=[],{block:a,draggingState:s}=this.view.state,{originalIndex:l,draggedCellOrientation:d}=s;if(n===l||!a||d==="row"&&!oo(a,l,n)||d==="col"&&!io(a,l,n))return T.DecorationSet.create(i.doc,r);const c=i.doc.resolve(this.view.tablePos+1);return this.view.state.draggingState.draggedCellOrientation==="row"?Xe(this.view.state.block,n).forEach(({row:m,col:h})=>{const f=i.doc.resolve(c.posAtIndex(m)+1),g=i.doc.resolve(f.posAtIndex(h)+1),b=g.node(),_=g.pos+(n>l?b.nodeSize-2:0);r.push(T.Decoration.widget(_,()=>{const w=document.createElement("div");return w.className="bn-table-drop-cursor",w.style.left="0",w.style.right="0",n>l?w.style.bottom="-2px":w.style.top="-3px",w.style.height="4px",w}))}):Je(this.view.state.block,n).forEach(({row:m,col:h})=>{const f=i.doc.resolve(c.posAtIndex(m)+1),g=i.doc.resolve(f.posAtIndex(h)+1),b=g.node(),_=g.pos+(n>l?b.nodeSize-2:0);r.push(T.Decoration.widget(_,()=>{const w=document.createElement("div");return w.className="bn-table-drop-cursor",w.style.top="0",w.style.bottom="0",n>l?w.style.right="-2px":w.style.left="-3px",w.style.width="4px",w}))}),T.DecorationSet.create(i.doc,r)}}})}onUpdate(t){return this.on("update",t)}}const Ga=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem","tableCell","tableHeader"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>e.textAlignment==="left"?{}:{"data-text-alignment":e.textAlignment}}}}]}}),Wa=k.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer","tableCell","tableHeader"],attributes:{textColor:{default:P.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):P.textColor.default,renderHTML:e=>e.textColor===P.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),qa=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new y.PluginKey(this.name);return[new y.Plugin({key:e,appendTransaction:(o,t,i)=>{const{doc:n,tr:r,schema:a}=i,s=e.getState(i),l=n.content.size-2,d=a.nodes.blockContainer,c=a.nodes.paragraph;if(s)return r.insert(l,d.create(void 0,c.create()))},state:{init:(o,t)=>{},apply:(o,t)=>{if(!o.docChanged)return t;let i=o.doc.lastChild;if(!i||i.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(i=i.lastChild,!i||i.type.name!=="blockContainer")return!0;const n=i.firstChild;if(!n)throw new Error("Expected blockContent");return i.nodeSize>4||n.type.spec.content!=="inline*"}}})]}}),Za={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Xa=k.Node.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const o={};for(const[t,i]of Object.entries(Za))e.getAttribute(i)&&(o[t]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?o:!1}}]},renderHTML({HTMLAttributes:e}){var n;const o=document.createElement("div");o.className="bn-block-outer",o.setAttribute("data-node-type","blockOuter");for(const[r,a]of Object.entries(e))r!=="class"&&o.setAttribute(r,a);const t={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=q("bn-block",t.class),i.setAttribute("data-node-type",this.name);for(const[r,a]of Object.entries(t))r!=="class"&&i.setAttribute(r,a);return o.appendChild(i),{dom:o,contentDOM:i}}}),Ja=k.Node.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var i;const o={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},t=document.createElement("div");t.className=q("bn-block-group",o.class),t.setAttribute("data-node-type","blockGroup");for(const[n,r]of Object.entries(o))n!=="class"&&t.setAttribute(n,r);return{dom:t,contentDOM:t}}}),Ya=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),Hi=e=>{const o={},t=Qa(e);for(const n of t)o[n.name]=n;o.formattingToolbar=new Si(e.editor),o.linkToolbar=new Ti(e.editor),o.sideMenu=new Di(e.editor,e.sideMenuDetection),o.suggestionMenus=new ji(e.editor),o.filePanel=new vi(e.editor),o.placeholder=new Aa(e.editor,e.placeholders),(e.animations??!0)&&(o.animations=new Da),e.tableHandles&&(o.tableHandles=new Ui(e.editor)),o.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},o.nodeSelectionKeyboard=new La,o.showSelection=new ja(e.editor),e.comments&&(o.comments=new Sa(e.editor,e.comments.threadStore,yi.name));const i=e.disableExtensions||[];for(const n of i)delete o[n];return o};let Vt=!1;const Qa=e=>{const o=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,an.Gapcursor,ce.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),sn.HardBreak.extend({priority:10}),cn.Text,dn.Link.extend({inclusive:!1}).configure({defaultProtocol:Ii,protocols:Vt?[]:Mi}),...Object.values(e.styleSpecs).map(t=>t.implementation.mark.configure({editor:e.editor})),Wa,ya,Ga,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Ya,Xa.configure({editor:e.editor,domAttributes:e.domAttributes}),Ta.configure({editor:e.editor,tabBehavior:e.tabBehavior}),Ja.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(t=>t.config!=="link"&&t.config!=="text").map(t=>t.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(t=>[...(t.implementation.requiredExtensions||[]).map(i=>i.configure({editor:e.editor,domAttributes:e.domAttributes})),t.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),_a(e.editor),ba(e.editor),fa(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[qa]:[],...e.comments?[yi]:[]];return Vt=!0,e.collaboration?o.push(...wa(e.collaboration)):o.push(ln.History),o};function es(e,o){const t=[];return e.forEach((i,n,r)=>{r!==o&&t.push(i)}),S.Fragment.from(t)}function ts(e,o){const t=[];for(let i=0;i<e.childCount;i++)if(e.child(i).type.name==="tableRow")if(t.length>0&&t[t.length-1].type.name==="table"){const n=t[t.length-1],r=n.copy(n.content.addToEnd(e.child(i)));t[t.length-1]=r}else{const n=o.nodes.table.createChecked(void 0,e.child(i));t.push(n)}else t.push(e.child(i));return e=S.Fragment.from(t),e}function os(e,o){let t=S.Fragment.from(e.content);if(t=ts(t,o.state.schema),!is(t,o))return new S.Slice(t,e.openStart,e.openEnd);for(let i=0;i<t.childCount;i++)if(t.child(i).type.spec.group==="blockContent"){const n=[t.child(i)];if(i+1<t.childCount&&t.child(i+1).type.name==="blockGroup"){const a=t.child(i+1).child(0).child(0);(a.type.name==="bulletListItem"||a.type.name==="numberedListItem"||a.type.name==="checkListItem")&&(n.push(t.child(i+1)),t=es(t,i+1))}const r=o.state.schema.nodes.blockContainer.createChecked(void 0,n);t=t.replaceChild(i,r)}return new S.Slice(t,e.openStart,e.openEnd)}function is(e,o){var r,a;const t=e.childCount===1,i=((r=e.firstChild)==null?void 0:r.type.spec.content)==="inline*",n=((a=e.firstChild)==null?void 0:a.type.spec.content)==="tableRow+";if(t){if(i)return!1;if(n){const s=C(o.state);if(s.isBlockContainer)return!(s.blockContent.node.type.spec.content==="tableRow+")}}return!0}const Ae=class Ae extends k.Editor{constructor(t,i){super({...t,content:void 0});p(this,"_state");p(this,"mount",(t,i,n)=>{i?(this.options.element=i,this.createViewAlternative(t,n)):this.destroy()});const n=this.schema;let r;const a=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(r)return r;const d=a.apply(n.nodes.doc,l),c=JSON.parse(JSON.stringify(d.toJSON()));return c.content[0].content[0].attrs.id="initialBlockId",r=S.Node.fromJSON(n,c),r};let s;try{const l=t==null?void 0:t.content.map(d=>ee(d,this.schema,i).toJSON());s=k.createDocument({type:"doc",content:[{type:"blockGroup",content:l}]},this.schema,this.options.parseOptions)}catch(l){throw console.error("Error creating document from blocks passed as `initialContent`. Caused by exception: ",l),new Error("Error creating document from blocks passed as `initialContent`:\n"+ +JSON.stringify(t.content))}this._state=y.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(t){this.view?this.view.dispatch(t):this._state=this.state.apply(t)}createViewAlternative(t,i){this.contentComponent=i;const n={};this.extensionManager.extensions.forEach(a=>{a.type==="mark"&&a.config.addMarkView&&(n[a.name]=a.config.addMarkView(t))}),this.view=new T.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state,markViews:n,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.commands.focus(this.options.autofocus||this.options.element.getAttribute("data-bn-autofocus")==="true",{scrollIntoView:!1}),this.emit("create",{editor:this}),this.isInitialized=!0}};p(Ae,"create",(t,i)=>{var r,a;const n=(r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout;typeof((a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Ae(t,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Pe=Ae;Pe.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const ns={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class Ct extends X{constructor(t){var d,c,u,m,h,f,g,b,_,w,v;super();p(this,"pmSchema");p(this,"extensions",{});p(this,"headless",!1);p(this,"_tiptapEditor");p(this,"elementRenderer",null);p(this,"blockCache",new WeakMap);p(this,"dictionary");p(this,"schema");p(this,"blockImplementations");p(this,"inlineContentImplementations");p(this,"styleImplementations");p(this,"formattingToolbar");p(this,"linkToolbar");p(this,"sideMenu");p(this,"suggestionMenus");p(this,"filePanel");p(this,"tableHandles");p(this,"comments");p(this,"showSelectionPlugin");p(this,"uploadFile");p(this,"onUploadStartCallbacks",[]);p(this,"onUploadEndCallbacks",[]);p(this,"resolveFileUrl");p(this,"resolveUsers");p(this,"settings");p(this,"dispatch",t=>{this._tiptapEditor.dispatch(t)});p(this,"mount",(t,i)=>{this._tiptapEditor.mount(this,t,i)});this.options=t;const i=t;if(i.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(i.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(i.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(i.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||Ft,this.settings={tables:{splitCells:((d=t==null?void 0:t.tables)==null?void 0:d.splitCells)??!1,cellBackgroundColor:((c=t==null?void 0:t.tables)==null?void 0:c.cellBackgroundColor)??!1,cellTextColor:((u=t==null?void 0:t.tables)==null?void 0:u.cellTextColor)??!1,headers:((m=t==null?void 0:t.tables)==null?void 0:m.headers)??!1}};const n={defaultStyles:!0,schema:t.schema||me.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(n.comments&&!n.resolveUsers)throw new Error("resolveUsers is required when using comments");if(this.resolveUsers=n.resolveUsers,this.schema=n.schema,this.blockImplementations=n.schema.blockSpecs,this.inlineContentImplementations=n.schema.inlineContentSpecs,this.styleImplementations=n.schema.styleSpecs,this.extensions=Hi({editor:this,domAttributes:n.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:n.collaboration,trailingBlock:n.trailingBlock,disableExtensions:n.disableExtensions,setIdAttribute:n.setIdAttribute,animations:n.animations??!0,tableHandles:D("table",this),dropCursor:this.options.dropCursor??mn.dropCursor,placeholders:n.placeholders,tabBehavior:n.tabBehavior,sideMenuDetection:n.sideMenuDetection||"viewport",comments:n.comments}),(((h=n._tiptapOptions)==null?void 0:h.extensions)||[]).forEach(x=>{this.extensions[x.name]=x}),Object.entries(n._extensions||{}).forEach(([x,B])=>{typeof B=="function"&&(B=B(this)),this.extensions[x]=B}),this.formattingToolbar=this.extensions.formattingToolbar,this.linkToolbar=this.extensions.linkToolbar,this.sideMenu=this.extensions.sideMenu,this.suggestionMenus=this.extensions.suggestionMenus,this.filePanel=this.extensions.filePanel,this.tableHandles=this.extensions.tableHandles,this.comments=this.extensions.comments,this.showSelectionPlugin=this.extensions.showSelection,n.uploadFile){const x=n.uploadFile;this.uploadFile=async(B,z)=>{this.onUploadStartCallbacks.forEach(M=>M.apply(this,[z]));try{return await x(B,z)}finally{this.onUploadEndCallbacks.forEach(M=>M.apply(this,[z]))}}}this.resolveFileUrl=n.resolveFileUrl,this.headless=n._headless;const r="collaboration"in this.extensions||"liveblocksExtension"in this.extensions;r&&n.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const a=n.initialContent||(r?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:ce.options.generateID()}]);if(!Array.isArray(a)||a.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+a);const s=[...Object.entries(this.extensions).map(([x,B])=>{if(B instanceof k.Extension||B instanceof k.Node||B instanceof k.Mark)return B;if(!B.plugin)throw new Error("Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property");return k.Extension.create({name:x,addProseMirrorPlugins:()=>[B.plugin]})})],l={...ns,...n._tiptapOptions,content:a,extensions:s,editorProps:{...(f=n._tiptapOptions)==null?void 0:f.editorProps,attributes:{tabIndex:"0",...(b=(g=n._tiptapOptions)==null?void 0:g.editorProps)==null?void 0:b.attributes,...(_=n.domAttributes)==null?void 0:_.editor,class:q("bn-editor",n.defaultStyles?"bn-default-styles":"",((v=(w=n.domAttributes)==null?void 0:w.editor)==null?void 0:v.class)||"")},transformPasted:os}};this.headless?this.pmSchema=k.getSchema(l.extensions):(this._tiptapEditor=Pe.create(l,this.schema.styleSchema),this.pmSchema=this._tiptapEditor.schema),this.emit("create")}static create(t={}){return new Ct(t)}get prosemirrorView(){return this._tiptapEditor.view}get prosemirrorState(){return this._tiptapEditor.state}get domElement(){var t;return(t=this.prosemirrorView)==null?void 0:t.dom}isFocused(){var t;return((t=this.prosemirrorView)==null?void 0:t.hasFocus())||!1}focus(){var t;(t=this.prosemirrorView)==null||t.focus()}onUploadStart(t){return this.onUploadStartCallbacks.push(t),()=>{const i=this.onUploadStartCallbacks.indexOf(t);i>-1&&this.onUploadStartCallbacks.splice(i,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const i=this.onUploadEndCallbacks.indexOf(t);i>-1&&this.onUploadEndCallbacks.splice(i,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this.prosemirrorState.doc.firstChild.descendants(i=>(t.push(E(i,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){return Jr(this,t)}getPrevBlock(t){return Yr(this,t)}getNextBlock(t){return Qr(this,t)}getParentBlock(t){return ea(this,t)}forEachBlock(t,i=!1){const n=this.document.slice();i&&n.reverse();function r(a){for(const s of a){if(t(s)===!1)return!1;const l=i?s.children.slice().reverse():s.children;if(!r(l))return!1}return!0}r(n)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return na(this)}setTextCursorPosition(t,i="start"){mi(this,t,i)}getSelection(){return oa(this)}setSelection(t,i){ia(this,t,i)}get isEditable(){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return!1}return this._tiptapEditor.isEditable===void 0?!0:this._tiptapEditor.isEditable}set isEditable(t){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return}this._tiptapEditor.options.editable!==t&&this._tiptapEditor.setEditable(t)}insertBlocks(t,i,n="before"){return Or(this,t,i,n)}updateBlock(t,i){return ro(this,t,i)}removeBlocks(t){return Xr(this,t)}replaceBlocks(t,i){return Zr(this,t,i)}insertInlineContent(t){const i=U(t,this.pmSchema,this.schema.styleSchema);ta({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},i,this)}getActiveStyles(){const t={},i=this._tiptapEditor.state.selection.$to.marks();for(const n of i){const r=this.schema.styleSchema[n.type.name];if(!r){n.type.name!=="link"&&!n.type.spec.blocknoteIgnore&&console.warn("mark not found in styleschema",n.type.name);continue}r.propSchema==="boolean"?t[r.type]=!0:t[r.type]=n.attrs.stringValue}return t}addStyles(t){for(const[i,n]of Object.entries(t)){const r=this.schema.styleSchema[i];if(!r)throw new Error(`style ${i} not found in styleSchema`);if(r.propSchema==="boolean")this._tiptapEditor.commands.setMark(i);else if(r.propSchema==="string")this._tiptapEditor.commands.setMark(i,{stringValue:n});else throw new O(r.propSchema)}}removeStyles(t){for(const i of Object.keys(t))this._tiptapEditor.commands.unsetMark(i)}toggleStyles(t){for(const[i,n]of Object.entries(t)){const r=this.schema.styleSchema[i];if(!r)throw new Error(`style ${i} not found in styleSchema`);if(r.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(i);else if(r.propSchema==="string")this._tiptapEditor.commands.toggleMark(i,{stringValue:n});else throw new O(r.propSchema)}}getSelectedText(){return this._tiptapEditor.state.doc.textBetween(this._tiptapEditor.state.selection.from,this._tiptapEditor.state.selection.to)}getSelectedLinkUrl(){return this._tiptapEditor.getAttributes("link").href}createLink(t,i){if(t==="")return;const{from:n,to:r}=this._tiptapEditor.state.selection;i||(i=this._tiptapEditor.state.doc.textBetween(n,r));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(i,n,r).addMark(n,n+i.length,a))}canNestBlock(){return Wr(this)}nestBlock(){ui(this)}canUnnestBlock(){return qr(this)}unnestBlock(){Gr(this)}moveBlocksUp(){Fr(this)}moveBlocksDown(){$r(this)}async blocksToHTMLLossy(t=this.document){return ye(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return po(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return wt(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return hi(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return gi(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}updateCollaborationUserInfo(t){if(!this.options.collaboration)throw new Error("Cannot update collaboration user info when collaboration is disabled.");this._tiptapEditor.commands.updateUser(t)}onChange(t){if(this.headless)return;const i=()=>{t(this)};return this._tiptapEditor.on("update",i),()=>{this._tiptapEditor.off("update",i)}}onSelectionChange(t,i){if(this.headless)return;const n=r=>{r.transaction.getMeta(Ge.ySyncPluginKey)&&!i||t(this)};return this._tiptapEditor.on("selectionUpdate",n),()=>{this._tiptapEditor.off("selectionUpdate",n)}}onCreate(t){return this.on("create",t),()=>{this.off("create",t)}}getSelectionBoundingBox(){var s;if(!this.prosemirrorView)return;const t=(s=this.prosemirrorView)==null?void 0:s.state,{selection:i}=t,{ranges:n}=i,r=Math.min(...n.map(l=>l.$from.pos)),a=Math.max(...n.map(l=>l.$to.pos));if(k.isNodeSelection(i)){const l=this.prosemirrorView.nodeDOM(r);if(l)return l.getBoundingClientRect()}return k.posToDOMRect(this.prosemirrorView,r,a)}get isEmpty(){const t=this.document;return t.length===0||t.length===1&&t[0].type==="paragraph"&&t[0].content.length===0}openSuggestionMenu(t,i){var a;const n=(a=this.prosemirrorView)==null?void 0:a.state.tr;if(!n)return;const r=i&&i.deleteTriggerCharacter?n.insertText(t):n;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(r.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(i==null?void 0:i.deleteTriggerCharacter)||!1,ignoreQueryLength:(i==null?void 0:i.ignoreQueryLength)||!1}))}getForceSelectionVisible(){return this.showSelectionPlugin.getEnabled()}setForceSelectionVisible(t){this.showSelectionPlugin.setEnabled(t)}}const rs={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},as={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}};class ss{constructor(o,t,i){this.mappings=t,this.options=i}async resolveFile(o){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(o)).blob();const t=await this.options.resolveFileUrl(o);return t instanceof Blob?t:(await fetch(t)).blob()}mapStyles(o){return Object.entries(o).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(o){return this.mappings.inlineContentMapping[o.type](o,this)}transformInlineContent(o){return o.map(t=>this.mapInlineContent(t))}async mapBlock(o,t,i){return this.mappings.blockMapping[o.type](o,this,t,i)}}function ls(e){return{createBlockMapping:o=>o,createInlineContentMapping:o=>o,createStyleMapping:o=>o}}let Se;async function ds(){return Se||(Se=(async()=>{const[e,o]=await Promise.all([import("emoji-mart"),import("@emoji-mart/data")]),t="default"in e?e.default:e,i="default"in o?o.default:o;return await t.init({data:i}),{emojiMart:t,emojiData:i}})(),Se)}async function cs(e,o){if(!ii("text",e))return[];const{emojiData:t,emojiMart:i}=await ds();return(o.trim()===""?Object.values(t.emojis):await i.SearchIndex.search(o)).map(r=>({id:r.skins[0].native,onItemClick:()=>e.insertInlineContent(r.skins[0].native+" ")}))}function us(e,...o){const t=[...e];for(const i of o)for(const n of i){const r=t.findLastIndex(a=>a.group===n.group);r===-1?t.push(n):t.splice(r+1,0,n)}return t}function $e(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function ae(e){var o,t,i,n,r;return typeof e=="string"?$e(e):Array.isArray(e)?e.flatMap(a=>typeof a=="string"?$e(a):De(a)?{...a,content:$e(a.content)}:W(a)?a:{props:{},...a,content:ae(a.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,headerRows:e.headerRows,headerCols:e.headerCols,rows:e.rows.map(a=>({...a,cells:a.cells.map(s=>ae(s))}))}:(e==null?void 0:e.type)==="tableCell"?{type:"tableCell",content:ae(e.content),props:{backgroundColor:((o=e.props)==null?void 0:o.backgroundColor)??"default",textColor:((t=e.props)==null?void 0:t.textColor)??"default",textAlignment:((i=e.props)==null?void 0:i.textAlignment)??"left",colspan:((n=e.props)==null?void 0:n.colspan)??1,rowspan:((r=e.props)==null?void 0:r.rowspan)??1}}:e}function ps(e,o){return o.map(t=>xt(e.blockSchema,t))}function xt(e,o){var n;const t=e[o.type].content,i={id:"",type:o.type,props:{},content:t==="inline"?[]:t==="table"?{type:"tableContent",columnWidths:void 0,headerRows:void 0,headerCols:void 0,rows:[]}:void 0,children:[],...o};if(Object.entries(e[o.type].propSchema).forEach(([r,a])=>{i.props[r]===void 0&&a.default!==void 0&&(i.props[r]=a.default)}),t==="inline"){const r=i.content;i.content=ae(r)}else if(t==="table"){const r=i.content;i.content={type:"tableContent",columnWidths:(r==null?void 0:r.columnWidths)||((n=r==null?void 0:r.rows[0])==null?void 0:n.cells.map(()=>{}))||[],headerRows:(r==null?void 0:r.headerRows)||void 0,headerCols:(r==null?void 0:r.headerCols)||void 0,rows:(r==null?void 0:r.rows.map(a=>({cells:a.cells.map(s=>ae(s))})))||[]}}return{...i,content:ae(i.content),children:i.children.map(r=>xt(e,r))}}function Oi(e){e.id||(e.id=ce.options.generateID()),e.children&&Vi(e.children)}function Vi(e){for(const o of e)Oi(o)}exports.AudioBlock=vo;exports.BlockNoteEditor=Ct;exports.BlockNoteSchema=me;exports.COLORS_DARK_MODE_DEFAULT=as;exports.COLORS_DEFAULT=rs;exports.CodeBlock=So;exports.DEFAULT_LINK_PROTOCOL=Ii;exports.EMPTY_CELL_HEIGHT=xr;exports.EMPTY_CELL_WIDTH=gt;exports.Exporter=ss;exports.FILE_AUDIO_ICON_SVG=go;exports.FILE_ICON_SVG=ho;exports.FILE_IMAGE_ICON_SVG=Po;exports.FILE_VIDEO_ICON_SVG=qo;exports.FileBlock=Lo;exports.FilePanelProsemirrorPlugin=vi;exports.FilePanelView=wi;exports.FormattingToolbarProsemirrorPlugin=Si;exports.FormattingToolbarView=Ci;exports.HTMLToBlocks=wt;exports.ImageBlock=Uo;exports.LinkToolbarProsemirrorPlugin=Ti;exports.PageBreak=Fo;exports.SideMenuProsemirrorPlugin=Di;exports.SideMenuView=Ai;exports.SuggestionMenuProseMirrorPlugin=ji;exports.TableHandlesProsemirrorPlugin=Ui;exports.TableHandlesView=Ri;exports.UniqueID=ce;exports.UnreachableCaseError=O;exports.VALID_LINK_PROTOCOLS=Mi;exports.VideoBlock=ei;exports.addIdsToBlock=Oi;exports.addIdsToBlocks=Vi;exports.addInlineContentAttributes=Ze;exports.addInlineContentKeyboardShortcuts=qt;exports.addStyleAttributes=Qt;exports.applyNonSelectableBlockFix=Gt;exports.assertEmpty=Hn;exports.audioBlockConfig=ko;exports.audioParse=yo;exports.audioPropSchema=bo;exports.audioRender=_o;exports.audioToExternalHTML=wo;exports.blockToNode=ee;exports.blocksToMarkdown=hi;exports.camelToDataKebab=ge;exports.checkBlockHasDefaultProp=Nr;exports.checkBlockIsDefaultType=ni;exports.checkBlockIsFileBlock=Lr;exports.checkBlockIsFileBlockWithPlaceholder=Ar;exports.checkBlockIsFileBlockWithPreview=Pr;exports.checkBlockTypeHasDefaultProp=ri;exports.checkDefaultBlockTypeInSchema=D;exports.checkDefaultInlineContentTypeInSchema=ii;exports.checkPageBreakBlocksInSchema=ai;exports.cleanHTMLToMarkdown=Oe;exports.combineByGroup=us;exports.contentNodeToInlineContent=ke;exports.contentNodeToTableContent=dt;exports.createAddFileButton=mo;exports.createBlockSpec=pe;exports.createBlockSpecFromStronglyTypedTiptapNode=Z;exports.createDefaultBlockDOMOutputSpec=F;exports.createExternalHTMLExporter=ye;exports.createFigureWithCaption=Ue;exports.createFileBlockWrapper=Re;exports.createFileNameWithIcon=fo;exports.createInlineContentSpec=$n;exports.createInlineContentSpecFromTipTapNode=Xt;exports.createInternalBlockSpec=st;exports.createInternalHTMLSerializer=po;exports.createInternalInlineContentSpec=Zt;exports.createInternalStyleSpec=ut;exports.createLinkWithCaption=ve;exports.createResizableFileBlockWrapper=ht;exports.createStronglyTypedTiptapNode=$;exports.createStyleSpec=Kn;exports.createStyleSpecFromTipTapMark=J;exports.createSuggestionMenu=za;exports.customizeCodeBlock=ir;exports.defaultBlockSchema=ti;exports.defaultBlockSpecs=bt;exports.defaultBlockToHTML=qe;exports.defaultCodeBlockPropSchema=Le;exports.defaultInlineContentSchema=oi;exports.defaultInlineContentSpecs=_t;exports.defaultProps=P;exports.defaultStyleSchema=Ir;exports.defaultStyleSpecs=kt;exports.fileBlockConfig=Bo;exports.fileParse=Mo;exports.filePropSchema=Eo;exports.fileRender=To;exports.fileToExternalHTML=Io;exports.filenameFromURL=Fn;exports.filterSuggestionItems=Rr;exports.formatKeyboardShortcut=K;exports.formattingToolbarPluginKey=xi;exports.getBlockFromPos=Kt;exports.getBlockInfo=Y;exports.getBlockInfoFromResolvedPos=de;exports.getBlockInfoFromSelection=C;exports.getBlockInfoWithManualOffset=Ne;exports.getBlockNoteExtensions=Hi;exports.getBlockSchemaFromSpecs=lt;exports.getColspan=le;exports.getDefaultEmojiPickerItems=cs;exports.getDefaultSlashMenuItems=jr;exports.getInlineContentParseRules=Jt;exports.getInlineContentSchemaFromSpecs=ct;exports.getNearestBlockPos=G;exports.getNodeById=R;exports.getPageBreakSlashMenuItems=Hr;exports.getParseRules=Wt;exports.getRowspan=Me;exports.getStyleParseRules=eo;exports.getStyleSchemaFromSpecs=pt;exports.imageBlockConfig=No;exports.imageParse=jo;exports.imagePropSchema=Ao;exports.imageRender=Do;exports.imageToExternalHTML=Ro;exports.inheritedProps=at;exports.initializeESMDependencies=He;exports.inlineContentToNodes=U;exports.insertOrUpdateBlock=N;exports.isAppleOS=$t;exports.isLinkInlineContent=We;exports.isPartialLinkInlineContent=De;exports.isPartialTableCell=se;exports.isSafari=zn;exports.isStyledTextInlineContent=W;exports.isTableCell=je;exports.isTableCellSelection=ot;exports.linkToolbarPluginKey=Bi;exports.locales=Un;exports.mapTableCell=Te;exports.mappingFactory=ls;exports.markdownToBlocks=gi;exports.mergeCSSClasses=q;exports.nodeToBlock=E;exports.nodeToCustomInlineContent=Ie;exports.pageBreakConfig=Ho;exports.pageBreakParse=Vo;exports.pageBreakRender=Oo;exports.pageBreakSchema=yt;exports.pageBreakToExternalHTML=zo;exports.parseEmbedElement=tt;exports.parseFigureElement=we;exports.partialBlockToBlockForTesting=xt;exports.partialBlocksToBlocksForTesting=ps;exports.propsToAttributes=ue;exports.shikiHighlighterPromiseSymbol=Ee;exports.shikiParserSymbol=et;exports.sideMenuPluginKey=Ni;exports.stylePropsToAttributes=Yt;exports.tableContentToNodes=_e;exports.tableHandlesPluginKey=ie;exports.updateBlock=ro;exports.updateBlockCommand=A;exports.uploadToTmpFilesDotOrg_DEV_ONLY=nr;exports.videoBlockConfig=Xo;exports.videoParse=Yo;exports.videoPropSchema=Zo;exports.videoRender=Jo;exports.videoToExternalHTML=Qo;exports.withPageBreak=Ur;exports.wrapInBlockStructure=fe;
|
|
8
|
+
`);return!t||!n?(e.commands.insertContent(`
|
|
9
|
+
`),!0):e.chain().command(({tr:r})=>(r.delete(o.pos-2,o.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:o}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(o.pos-o.parentOffset+o.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Bo=J(Vr,Eo);function It(e,o){var t;return((t=Object.entries(e.supportedLanguages).find(([n,{aliases:r}])=>(r==null?void 0:r.includes(o))||n===o))==null?void 0:t[0])||o}const nt=e=>({url:e.src||void 0}),To={backgroundColor:M.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},xo={type:"file",propSchema:To,content:"none",isFileBlock:!0},Mo=(e,o)=>Ve(e,o),Po=e=>{if(e.tagName==="EMBED")return nt(e);if(e.tagName==="FIGURE"){const o=Se(e,"embed");if(!o)return;const{targetElement:t,caption:n}=o;return{...nt(t),caption:n}}},Io=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add file",{dom:t}}const o=document.createElement("a");return o.href=e.props.url,o.textContent=e.props.name||e.props.url,e.props.caption?Ee(o,e.props.caption):{dom:o}},Lo=fe(xo,{render:Mo,parse:Po,toExternalHTML:Io}),mt=(e,o,t,n,r,s)=>{const{dom:i,destroy:a}=Ve(e,o,t,r,s),l=i;e.props.url&&e.props.showPreview&&(l.style.width=`${e.props.previewWidth}px`);const c=document.createElement("div");c.className="bn-resize-handle",c.style.left="4px";const d=document.createElement("div");d.className="bn-resize-handle",d.style.right="4px";let u,h=e.props.previewWidth;const f=S=>{if(!u){!o.isEditable&&n.contains(c)&&n.contains(d)&&(n.removeChild(c),n.removeChild(d));return}let A;e.props.textAlignment==="center"?u.handleUsed==="left"?A=u.initialWidth+(u.initialClientX-S.clientX)*2:A=u.initialWidth+(S.clientX-u.initialClientX)*2:u.handleUsed==="left"?A=u.initialWidth+u.initialClientX-S.clientX:A=u.initialWidth+S.clientX-u.initialClientX,h=Math.max(A,64),l.style.width=`${h}px`},m=S=>{(!S.target||!l.contains(S.target)||!o.isEditable)&&n.contains(c)&&n.contains(d)&&(n.removeChild(c),n.removeChild(d)),u&&(u=void 0,o.updateBlock(e,{props:{previewWidth:h}}))},g=()=>{o.isEditable&&(n.appendChild(c),n.appendChild(d))},b=S=>{S.relatedTarget===c||S.relatedTarget===d||u||o.isEditable&&n.contains(c)&&n.contains(d)&&(n.removeChild(c),n.removeChild(d))},w=S=>{S.preventDefault(),u={handleUsed:"left",initialWidth:l.clientWidth,initialClientX:S.clientX}},C=S=>{S.preventDefault(),u={handleUsed:"right",initialWidth:l.clientWidth,initialClientX:S.clientX}};return window.addEventListener("mousemove",f),window.addEventListener("mouseup",m),l.addEventListener("mouseenter",g),l.addEventListener("mouseleave",b),c.addEventListener("mousedown",w),d.addEventListener("mousedown",C),{dom:l,destroy:()=>{a==null||a(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",m),l.removeEventListener("mouseenter",g),l.removeEventListener("mouseleave",b),c.removeEventListener("mousedown",w),d.removeEventListener("mousedown",C)}}},Fr=async e=>{const o=new FormData;return o.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:o})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")},Lt=e=>{const o=e.src||void 0,t=e.width||void 0;return{url:o,previewWidth:t}},Ao='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>',No={textAlignment:M.textAlignment,backgroundColor:M.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Ho={type:"image",propSchema:No,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},Do=(e,o)=>{const t=document.createElement("div");t.innerHTML=Ao;const n=document.createElement("div");n.className="bn-visual-media-wrapper";const r=document.createElement("img");return r.className="bn-visual-media",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(s=>{r.src=s}):r.src=e.props.url,r.alt=e.props.name||e.props.caption||"BlockNote image",r.contentEditable="false",r.draggable=!1,n.appendChild(r),mt(e,o,{dom:n},n,o.dictionary.file_blocks.image.add_button_text,t.firstElementChild)},Oo=e=>{if(e.tagName==="IMG")return Lt(e);if(e.tagName==="FIGURE"){const o=Se(e,"img");if(!o)return;const{targetElement:t,caption:n}=o;return{...Lt(t),caption:n}}},_o=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add image",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("img"),o.src=e.props.url,o.alt=e.props.name||e.props.caption||"BlockNote image",o.width=e.props.previewWidth):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Fe(o,e.props.caption):Ee(o,e.props.caption):{dom:o}},Ro=fe(Ho,{render:Do,parse:Oo,toExternalHTML:_o}),Vo={type:"pageBreak",propSchema:{},content:"none",isFileBlock:!1,isSelectable:!1},Fo=()=>{const e=document.createElement("div");return e.className="bn-page-break",e.setAttribute("data-page-break",""),{dom:e}},Uo=e=>{if(e.tagName==="DIV"&&e.hasAttribute("data-page-break"))return{type:"pageBreak"}},$o=()=>{const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},zo=fe(Vo,{render:Fo,parse:Uo,toExternalHTML:$o}),Ur=k.Mark.create({name:"backgroundColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-background-color"),renderHTML:e=>({"data-background-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-background-color")?{stringValue:e.getAttribute("data-background-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),$r=Z(Ur,"string"),zr=k.Mark.create({name:"textColor",addAttributes(){return{stringValue:{default:void 0,parseHTML:e=>e.getAttribute("data-text-color"),renderHTML:e=>({"data-text-color":e.stringValue})}}},parseHTML(){return[{tag:"span",getAttrs:e=>typeof e=="string"?!1:e.hasAttribute("data-text-color")?{stringValue:e.getAttribute("data-text-color")}:!1}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}}),Wr=Z(zr,"string"),Wo={...M,level:{default:1,values:[1,2,3]}},qr=z({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return he(Wo)},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:o,chain:t,range:n})=>{const r=v(o);!r.isBlockContainer||r.blockContent.node.type.spec.content!=="inline*"||t().command(L(this.options.editor,r.bnBlock.beforePos,{type:"heading",props:{level:e}})).deleteRange({from:n.from,to:n.to}).run()}}))]},addKeyboardShortcuts(){return{"Mod-Alt-1":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:1}}))},"Mod-Alt-2":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:2}}))},"Mod-Alt-3":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"heading",props:{level:3}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"h1",attrs:{level:1},node:"heading"},{tag:"h2",attrs:{level:2},node:"heading"},{tag:"h3",attrs:{level:3},node:"heading"}]},renderHTML({node:e,HTMLAttributes:o}){var t,n;return $(this.name,`h${e.attrs.level}`,{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...o},((n=this.options.domAttributes)==null?void 0:n.inlineContent)||{})}}),jr=J(qr,Wo),qo=(e,o,t)=>({state:n,dispatch:r})=>{const s=K(n.doc,e),i=Q(s);if(!i.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const a=[{type:i.bnBlock.node.type,attrs:t?{...i.bnBlock.node.attrs,id:void 0}:{}},{type:o?i.blockContent.node.type:n.schema.nodes.paragraph,attrs:t?{...i.blockContent.node.attrs}:{}}];return r&&n.tr.split(e,2,a),!0},gt=e=>{const o=e._tiptapEditor,t=v(o.state);if(!t.isBlockContainer)return!1;const{bnBlock:n,blockContent:r}=t,s=o.state.selection.anchor===o.state.selection.head;return!(r.node.type.name==="bulletListItem"||r.node.type.name==="numberedListItem"||r.node.type.name==="checkListItem")||!s?!1:o.commands.first(({state:i,chain:a,commands:l})=>[()=>l.command(()=>r.node.childCount===0?l.command(L(e,n.beforePos,{type:"paragraph",props:{}})):!1),()=>l.command(()=>r.node.childCount>0?(a().deleteSelection().command(qo(i.selection.from,!0)).run(),!0):!1)])},Kr={...M},Gr=z({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:o,range:t})=>{const n=v(e);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(L(this.options.editor,n.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>gt(this.options.editor),"Mod-Shift-8":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"bulletListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.tagName==="UL"||o.tagName==="DIV"&&o.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var o,t;return $(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),Xr=J(Gr,Kr),jo={...M,checked:{default:!1}},Jr=z({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return he(jo)},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:o,range:t})=>{const n=v(e);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(L(this.options.editor,n.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:t.from,to:t.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:o,range:t})=>{const n=v(e);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(L(this.options.editor,n.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>gt(this.options.editor),"Mod-Shift-9":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"checkListItem",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"input",getAttrs:e=>typeof e=="string"?!1:e.type==="checkbox"?{checked:e.checked}:!1,node:"checkListItem"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;if(o===null)return!1;if(o.tagName==="UL"||o.tagName==="DIV"&&o.parentElement.tagName==="UL"){const t=e.querySelector("input[type=checkbox]")||null;return t===null?!1:{checked:t.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:o}){var s,i;const t=document.createElement("input");t.type="checkbox",t.checked=e.attrs.checked,e.attrs.checked&&t.setAttribute("checked","");const{dom:n,contentDOM:r}=$(this.name,"p",{...((s=this.options.domAttributes)==null?void 0:s.blockContent)||{},...o},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{});return n.insertBefore(t,r),{dom:n,contentDOM:r}},addNodeView(){return({node:e,getPos:o,editor:t,HTMLAttributes:n})=>{var d,u;const r=document.createElement("div"),s=document.createElement("div");s.contentEditable="false";const i=document.createElement("input");i.type="checkbox",i.checked=e.attrs.checked,e.attrs.checked&&i.setAttribute("checked","");const a=()=>{if(!t.isEditable){i.checked=!i.checked;return}if(typeof o!="boolean"){const h=K(t.state.doc,o());if(h.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${h.node.type.name}`);this.editor.commands.command(L(this.options.editor,h.posBeforeNode,{type:"checkListItem",props:{checked:i.checked}}))}};i.addEventListener("change",a);const{dom:l,contentDOM:c}=$(this.name,"p",{...((d=this.options.domAttributes)==null?void 0:d.blockContent)||{},...n},((u=this.options.domAttributes)==null?void 0:u.inlineContent)||{});if(typeof o!="boolean"){const f="label-"+this.editor.state.doc.resolve(o()).node().attrs.id;i.setAttribute("aria-labelledby",f),c.id=f}return l.removeChild(c),l.appendChild(r),r.appendChild(s),r.appendChild(c),s.appendChild(i),{dom:l,contentDOM:c,destroy:()=>{i.removeEventListener("change",a)}}}}}),Yr=J(Jr,jo),Zr=new y.PluginKey("numbered-list-indexing"),Qr=()=>new y.Plugin({key:Zr,appendTransaction:(e,o,t)=>{const n=t.tr;n.setMeta("numberedListIndexing",!0);let r=!1;return t.doc.descendants((s,i)=>{var a;if(s.type.name==="blockContainer"&&s.firstChild.type.name==="numberedListItem"){let l=`${s.firstChild.attrs.start||1}`;const c=Q({posBeforeNode:i,node:s});if(!c.isBlockContainer)throw new Error("impossible");const d=n.doc.resolve(c.bnBlock.beforePos).nodeBefore;if(d){const m=Q({posBeforeNode:c.bnBlock.beforePos-d.nodeSize,node:d});if(m.blockNoteType==="numberedListItem"){if(!m.isBlockContainer)throw new Error("impossible");const b=m.blockContent.node.attrs.index;l=(parseInt(b)+1).toString()}}const u=c.blockContent.node,h=u.attrs.index,f=((a=d==null?void 0:d.firstChild)==null?void 0:a.type.name)!=="numberedListItem";if(h!==l||u.attrs.start&&!f){r=!0;const{start:m,...g}=u.attrs;n.setNodeMarkup(c.blockContent.beforePos,void 0,{...g,index:l,...typeof m=="number"&&f&&{start:m}})}}}),r?n:null}}),Ko={...M,start:{default:void 0,type:"number"}},es=z({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{...he(Ko),index:{default:null,parseHTML:e=>e.getAttribute("data-index"),renderHTML:e=>({"data-index":e.index})}}},addInputRules(){return[new k.InputRule({find:new RegExp("^(\\d+)\\.\\s$"),handler:({state:e,chain:o,range:t,match:n})=>{const r=v(e);if(!r.isBlockContainer||r.blockContent.node.type.spec.content!=="inline*"||r.blockNoteType==="numberedListItem")return;const s=parseInt(n[1]);o().command(L(this.options.editor,r.bnBlock.beforePos,{type:"numberedListItem",props:s===1&&{}||{start:s}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{Enter:()=>gt(this.options.editor),"Mod-Shift-7":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[Qr()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;if(o===null)return!1;if(o.tagName==="OL"||o.tagName==="DIV"&&o.parentElement.tagName==="OL"){const t=parseInt(o.getAttribute("start")||"1")||1;return e.previousSibling||t===1?{}:{start:t}}return!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const o=e.parentElement;return o===null?!1:o.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var o,t;return $(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),ts=J(es,Ko),os={...M},ns=z({name:"paragraph",content:"inline*",group:"blockContent",addKeyboardShortcuts(){return{"Mod-Alt-0":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"paragraph",props:{}}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"p",priority:200,getAttrs:e=>{var o;return typeof e=="string"||!((o=e.textContent)!=null&&o.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var o,t;return $(this.name,"p",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),rs=J(ns,os),ss={...M},is=z({name:"quote",content:"inline*",group:"blockContent",addInputRules(){return[new k.InputRule({find:new RegExp("^>\\s$"),handler:({state:e,chain:o,range:t})=>{const n=v(e);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(L(this.options.editor,n.bnBlock.beforePos,{type:"quote",props:{}})).deleteRange({from:t.from,to:t.to})}})]},addKeyboardShortcuts(){return{"Mod-Alt-q":()=>{const e=v(this.editor.state);return!e.isBlockContainer||e.blockContent.node.type.spec.content!=="inline*"?!0:this.editor.commands.command(L(this.options.editor,e.bnBlock.beforePos,{type:"quote"}))}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"blockquote",node:"quote"}]},renderHTML({HTMLAttributes:e}){var o,t;return $(this.name,"blockquote",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})}}),as=J(is,ss),ls=35,bt=120,cs=31,ds=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[P.columnResizing({cellMinWidth:ls,defaultCellMinWidth:bt,View:null}),P.tableEditing()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name==="tableParagraph"?(this.editor.commands.insertContent({type:"hardBreak"}),!0):!1,Backspace:()=>{const e=this.editor.state.selection,o=e.empty,t=e.$head.parentOffset===0,n=e.$head.node().type.name==="tableParagraph";return o&&t&&n},Tab:()=>this.editor.commands.command(({state:e,dispatch:o,view:t})=>P.goToNextCell(1)(e,o,t)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:o,view:t})=>P.goToNextCell(-1)(e,o,t))}},extendNodeSchema(e){const o={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",o))}}}),us={textColor:M.textColor},ps=z({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var o,t;return $(this.name,"table",{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...e},((t=this.options.domAttributes)==null?void 0:t.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:o})=>{var n;class t extends P.TableView{constructor(s,i,a){super(s,i),this.node=s,this.cellMinWidth=i,this.blockContentHTMLAttributes=a;const l=document.createElement("div");l.className=X("bn-block-content",a.class),l.setAttribute("data-content-type","table");for(const[h,f]of Object.entries(a))h!=="class"&&l.setAttribute(h,f);const c=this.dom,d=document.createElement("div");d.className="tableWrapper-inner",d.appendChild(c.firstChild),c.appendChild(d),l.appendChild(c);const u=document.createElement("div");u.className="table-widgets-container",u.style.position="relative",c.appendChild(u),this.dom=l}ignoreMutation(s){return!s.target.closest(".tableWrapper-inner")||super.ignoreMutation(s)}}return new t(e,bt,{...((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},...o})}}}),hs=z({name:"tableParagraph",group:"tableContent",content:"inline*",parseHTML(){return[{preserveWhitespace:"full",priority:210,context:"tableContent",tag:"p",getAttrs:e=>({})},{tag:"p",getAttrs:e=>{if(typeof e=="string"||!e.textContent)return!1;const o=e.parentElement;return o===null?!1:o.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),fs=J(ps,us,[ds,hs,rr.TableHeader.extend({content:"tableContent+"}),nr.TableCell.extend({content:"tableContent+"}),sr.TableRow]),At=e=>{const o=e.src||void 0,t=e.width||void 0;return{url:o,previewWidth:t}},Go='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>',Xo={textAlignment:M.textAlignment,backgroundColor:M.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},Jo={type:"video",propSchema:Xo,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},Yo=(e,o)=>{const t=document.createElement("div");t.innerHTML=Go;const n=document.createElement("div");n.className="bn-visual-media-wrapper";const r=document.createElement("video");return r.className="bn-visual-media",o.resolveFileUrl?o.resolveFileUrl(e.props.url).then(s=>{r.src=s}):r.src=e.props.url,r.controls=!0,r.contentEditable="false",r.draggable=!1,r.width=e.props.previewWidth,n.appendChild(r),mt(e,o,{dom:n},n,o.dictionary.file_blocks.video.add_button_text,t.firstElementChild)},Zo=e=>{if(e.tagName==="VIDEO")return At(e);if(e.tagName==="FIGURE"){const o=Se(e,"video");if(!o)return;const{targetElement:t,caption:n}=o;return{...At(t),caption:n}}},Qo=e=>{if(!e.props.url){const t=document.createElement("p");return t.textContent="Add video",{dom:t}}let o;return e.props.showPreview?(o=document.createElement("video"),o.src=e.props.url,o.width=e.props.previewWidth):(o=document.createElement("a"),o.href=e.props.url,o.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?Fe(o,e.props.caption):Ee(o,e.props.caption):{dom:o}},en=fe(Jo,{render:Yo,parse:Zo,toExternalHTML:Qo}),kt={paragraph:rs,heading:jr,quote:as,codeBlock:Bo,bulletListItem:Xr,numberedListItem:ts,checkListItem:Yr,table:fs,file:Lo,image:Ro,video:en,audio:So},tn=ct(kt),wt={bold:Z(fr.default,"boolean"),italic:Z(gr.default,"boolean"),underline:Z(kr.default,"boolean"),strike:Z(br.default,"boolean"),code:Z(mr.default,"boolean"),textColor:Wr,backgroundColor:$r},ms=ht(wt),yt={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},on=ut(yt);function H(e,o){return e in o.schema.blockSchema&&o.schema.blockSchema[e]===tn[e]}function nn(e,o){return e in o.schema.inlineContentSchema&&o.schema.inlineContentSchema[e]===on[e]}function rn(e,o,t){return o.type===e&&o.type in t.schema.blockSchema&&H(o.type,t)}function gs(e,o){return e.type in o.schema.blockSchema&&o.schema.blockSchema[e.type].isFileBlock||!1}function bs(e,o){return e.type in o.schema.blockSchema&&o.schema.blockSchema[e.type].isFileBlock&&"showPreview"in o.schema.blockSchema[e.type].propSchema||!1}function ks(e,o){return o.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function sn(e,o,t){return o in t.schema.blockSchema&&e in t.schema.blockSchema[o].propSchema&&t.schema.blockSchema[o].propSchema[e]===M[e]}function ws(e,o,t){return sn(e,o.type,t)}function rt(e){return e instanceof P.CellSelection}function ys(e){let o=e.getTextCursorPosition().block,t=e.schema.blockSchema[o.type].content;for(;t==="none";){if(o=e.getTextCursorPosition().nextBlock,o===void 0)return;t=e.schema.blockSchema[o.type].content,e.setTextCursorPosition(o,"end")}}function N(e,o){const t=e.getTextCursorPosition().block;if(t.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let n;return Array.isArray(t.content)&&(t.content.length===1&&G(t.content[0])&&t.content[0].type==="text"&&t.content[0].text==="/"||t.content.length===0)?(n=e.updateBlock(t,o),e.setTextCursorPosition(n)):(n=e.insertBlocks([o],t,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),ys(e),n}function Cs(e){const o=[];return H("heading",e)&&o.push({onItemClick:()=>{N(e,{type:"heading",props:{level:1}})},badge:j("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{N(e,{type:"heading",props:{level:2}})},badge:j("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{N(e,{type:"heading",props:{level:3}})},badge:j("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),H("quote",e)&&o.push({onItemClick:()=>{N(e,{type:"quote"})},key:"quote",...e.dictionary.slash_menu.quote}),H("numberedListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"numberedListItem"})},badge:j("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),H("bulletListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"bulletListItem"})},badge:j("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),H("checkListItem",e)&&o.push({onItemClick:()=>{N(e,{type:"checkListItem"})},badge:j("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),H("paragraph",e)&&o.push({onItemClick:()=>{N(e,{type:"paragraph"})},badge:j("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),H("codeBlock",e)&&o.push({onItemClick:()=>{N(e,{type:"codeBlock"})},badge:j("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),H("table",e)&&o.push({onItemClick:()=>{N(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),H("image",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"image",...e.dictionary.slash_menu.image}),H("video",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"video",...e.dictionary.slash_menu.video}),H("audio",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"audio",...e.dictionary.slash_menu.audio}),H("file",e)&&o.push({onItemClick:()=>{const t=N(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:t}))},key:"file",...e.dictionary.slash_menu.file}),o.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),o}function vs(e,o){return e.filter(({title:t,aliases:n})=>t.toLowerCase().includes(o.toLowerCase())||n&&n.filter(r=>r.toLowerCase().includes(o.toLowerCase())).length!==0)}function qe(e){return e&&Object.fromEntries(Object.entries(e).filter(([,o])=>o!==void 0))}class me{constructor(o){p(this,"blockSpecs");p(this,"inlineContentSpecs");p(this,"styleSpecs");p(this,"blockSchema");p(this,"inlineContentSchema");p(this,"styleSchema");p(this,"BlockNoteEditor","only for types");p(this,"Block","only for types");p(this,"PartialBlock","only for types");this.blockSpecs=qe(o==null?void 0:o.blockSpecs)||kt,this.inlineContentSpecs=qe(o==null?void 0:o.inlineContentSpecs)||yt,this.styleSpecs=qe(o==null?void 0:o.styleSpecs)||wt,this.blockSchema=ct(this.blockSpecs),this.inlineContentSchema=ut(this.inlineContentSpecs),this.styleSchema=ht(this.styleSpecs)}static create(o){return new me(o)}}const Ct=me.create({blockSpecs:{pageBreak:zo}}),Ss=e=>me.create({blockSpecs:{...e.blockSpecs,...Ct.blockSpecs},inlineContentSpecs:e.inlineContentSpecs,styleSpecs:e.styleSpecs});function an(e){return"pageBreak"in e.schema.blockSchema&&e.schema.blockSchema.pageBreak===Ct.blockSchema.pageBreak}function Es(e){const o=[];return an(e)&&o.push({...e.dictionary.slash_menu.page_break,onItemClick:()=>{N(e,{type:"pageBreak"})},key:"page_break"}),o}function Bs(e,o,t,n="before"){const r=typeof t=="string"?t:t.id,s=[];for(const l of o)s.push(te(l,e.pmSchema,e.schema.styleSchema));const i=_(r,e._tiptapEditor.state.doc);if(!i)throw new Error(`Block with ID ${r} not found`);n==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(i.posBeforeNode,s)),n==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(i.posBeforeNode+i.node.nodeSize,s));const a=[];for(const l of s)a.push(T(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return a}function Ts(e){const o=e._tiptapEditor.state,t=o.selection,n=K(o.doc,t.anchor);if(t instanceof P.CellSelection)return{type:"cell",anchorBlockId:n.node.attrs.id,anchorCellOffset:t.$anchorCell.pos-n.posBeforeNode,headCellOffset:t.$headCell.pos-n.posBeforeNode};if(e._tiptapEditor.state.selection instanceof y.NodeSelection)return{type:"node",anchorBlockId:n.node.attrs.id};{const r=K(o.doc,t.head);return{type:"text",anchorBlockId:n.node.attrs.id,headBlockId:r.node.attrs.id,anchorOffset:t.anchor-n.posBeforeNode,headOffset:t.head-r.posBeforeNode}}}function xs(e,o){var r,s;const t=(r=_(o.anchorBlockId,e._tiptapEditor.state.doc))==null?void 0:r.posBeforeNode;if(t===void 0)throw new Error(`Could not find block with ID ${o.anchorBlockId} to update selection`);let n;if(o.type==="cell")n=P.CellSelection.create(e._tiptapEditor.state.doc,t+o.anchorCellOffset,t+o.headCellOffset);else if(o.type==="node")n=y.NodeSelection.create(e._tiptapEditor.state.doc,t+1);else{const i=(s=_(o.headBlockId,e._tiptapEditor.state.doc))==null?void 0:s.posBeforeNode;if(i===void 0)throw new Error(`Could not find block with ID ${o.headBlockId} to update selection`);n=y.TextSelection.create(e._tiptapEditor.state.doc,t+o.anchorOffset,i+o.headOffset)}e.dispatch(e._tiptapEditor.state.tr.setSelection(n))}function st(e){return e.map(o=>o.type==="columnList"?o.children.map(t=>st(t.children)).flat():{...o,children:st(o.children)}).flat()}function ln(e,o,t){var s;const n=((s=e.getSelection())==null?void 0:s.blocks)||[e.getTextCursorPosition().block],r=Ts(e);e.removeBlocks(n),e.insertBlocks(st(n),o,t),xs(e,r)}function cn(e){return!e||e.type!=="columnList"}function dn(e,o,t){let n,r;if(o?o.children.length>0?(n=o.children[o.children.length-1],r="after"):(n=o,r="before"):t&&(n=t,r="before"),!n||!r)return;const s=e.getParentBlock(n);return cn(s)?{referenceBlock:n,placement:r}:dn(e,r==="after"?n:e.getPrevBlock(n),s)}function un(e,o,t){let n,r;if(o?o.children.length>0?(n=o.children[0],r="before"):(n=o,r="after"):t&&(n=t,r="after"),!n||!r)return;const s=e.getParentBlock(n);return cn(s)?{referenceBlock:n,placement:r}:un(e,r==="before"?n:e.getNextBlock(n),s)}function Ms(e){const o=e.getSelection(),t=(o==null?void 0:o.blocks[0])||e.getTextCursorPosition().block,n=dn(e,e.getPrevBlock(t),e.getParentBlock(t));n&&ln(e,n.referenceBlock,n.placement)}function Ps(e){const o=e.getSelection(),t=(o==null?void 0:o.blocks[(o==null?void 0:o.blocks.length)-1])||e.getTextCursorPosition().block,n=un(e,e.getNextBlock(t),e.getParentBlock(t));n&&ln(e,n.referenceBlock,n.placement)}function Is(e,o){return function({state:t,dispatch:n}){const{$from:r,$to:s}=t.selection,i=r.blockRange(s,d=>d.childCount>0&&(d.type.name==="blockGroup"||d.type.name==="column"));if(!i)return!1;const a=i.startIndex;if(a===0)return!1;const c=i.parent.child(a-1);if(c.type!==e)return!1;if(n){const d=c.lastChild&&c.lastChild.type===o,u=B.Fragment.from(d?e.create():null),h=new B.Slice(B.Fragment.from(e.create(null,B.Fragment.from(o.create(null,u)))),d?3:1,0),f=i.start,m=i.end;n(t.tr.step(new Ie.ReplaceAroundStep(f-(d?3:1),m,f,m,h,1,!0)).scrollIntoView())}return!0}}function pn(e){return e._tiptapEditor.commands.command(Is(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function Ls(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function As(e){const{bnBlock:o}=v(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(o.beforePos).nodeBefore!==null}function Ns(e){const{bnBlock:o}=v(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(o.beforePos).depth>1}function hn(e,o,t){const n=e._tiptapEditor;let r=n.state.tr;const s=[];for(const u of t)s.push(te(u,e.pmSchema,e.schema.styleSchema));const i=new Set(o.map(u=>typeof u=="string"?u:u.id)),a=[],l=typeof o[0]=="string"?o[0]:o[0].id;let c=0;if(n.state.doc.descendants((u,h)=>{if(i.size===0)return!1;if(!u.type.isInGroup("bnBlock")||!i.has(u.attrs.id))return!0;if(a.push(T(u,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),i.delete(u.attrs.id),t.length>0&&u.attrs.id===l){const b=r.doc.nodeSize;r=r.insert(h,s);const w=r.doc.nodeSize;c+=b-w}const f=r.doc.nodeSize,m=r.doc.resolve(h-c);m.node().type.name==="blockGroup"&&m.node(m.depth-1).type.name!=="doc"&&m.node().childCount===1?r=r.delete(m.before(),m.after()):r=r.delete(h-c,h-c+u.nodeSize);const g=r.doc.nodeSize;return c+=f-g,!1}),i.size>0){const u=[...i].join(`
|
|
10
|
+
`);throw Error("Blocks with the following IDs could not be found in the editor: "+u)}e.dispatch(r);const d=[];for(const u of s)d.push(T(u,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:d,removedBlocks:a}}function Hs(e,o,t){return hn(e,o,t)}function Ds(e,o){return hn(e,o,[]).removedBlocks}function Os(e,o){const t=typeof o=="string"?o:o.id,n=_(t,e._tiptapEditor.state.doc);if(n)return T(n.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function _s(e,o){const t=typeof o=="string"?o:o.id,n=_(t,e._tiptapEditor.state.doc);if(!n)return;const s=e._tiptapEditor.state.doc.resolve(n.posBeforeNode).nodeBefore;if(s)return T(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Rs(e,o){const t=typeof o=="string"?o:o.id,n=_(t,e._tiptapEditor.state.doc);if(!n)return;const s=e._tiptapEditor.state.doc.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(s)return T(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Vs(e,o){const t=typeof o=="string"?o:o.id,n=_(t,e._tiptapEditor.state.doc);if(!n)return;const r=e._tiptapEditor.state.doc.resolve(n.posBeforeNode),s=r.node(),i=r.node(-1),a=i.type.name!=="doc"?s.type.name==="blockGroup"?i:s:void 0;if(a)return T(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function Fs(e,o,t,n={updateSelection:!0}){const r=t._tiptapEditor.state.tr;let{from:s,to:i}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},a=!0,l=!0,c="";if(o.forEach(d=>{d.check(),a&&d.isText&&d.marks.length===0?c+=d.text:a=!1,l=l?d.isBlock:!1}),s===i&&l){const{parent:d}=r.doc.resolve(s);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(s-=1,i+=1)}return a?r.insertText(c,s,i):r.replaceWith(s,i,o),n.updateSelection&&k.selectionToInsertionEnd(r,r.steps.length-1,-1),t.dispatch(r),!0}function Us(e){const o=e._tiptapEditor.state;if(o.selection.empty||"node"in o.selection)return;const t=o.doc.resolve(K(o.doc,o.selection.from).posBeforeNode),n=o.doc.resolve(K(o.doc,o.selection.to).posBeforeNode),r=(c,d)=>{const u=t.posAtIndex(c,d),h=o.doc.resolve(u).nodeAfter;if(!h)throw new Error(`Error getting selection - node not found at position ${u}`);return T(h,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)},s=[],i=t.sharedDepth(n.pos),a=t.index(i),l=n.index(i);if(t.depth>i){s.push(T(t.nodeAfter,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));for(let c=t.depth;c>i;c--)if(t.node(c).type.isInGroup("childContainer")){const u=t.index(c)+1,h=t.node(c).childCount;for(let f=u;f<h;f++)s.push(r(f,c))}}else s.push(r(a,i));for(let c=a+1;c<=l;c++)s.push(r(c,i));if(s.length===0)throw new Error(`Error getting selection - selection doesn't span any blocks (${o.selection})`);return{blocks:s}}function $s(e,o,t){const n=typeof o=="string"?o:o.id,r=typeof t=="string"?t:t.id;if(n===r)throw new Error(`Attempting to set selection with the same anchor and head blocks (id ${n})`);const s=e._tiptapEditor.state.doc,i=_(n,s);if(!i)throw new Error(`Block with ID ${n} not found`);const a=_(r,s);if(!a)throw new Error(`Block with ID ${r} not found`);const l=Q(i),c=Q(a),d=e.schema.blockSchema[l.blockNoteType],u=e.schema.blockSchema[c.blockNoteType];if(!l.isBlockContainer||d.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${n})`);if(!c.isBlockContainer||u.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${r})`);let h,f;if(d.content==="table"){const m=P.TableMap.get(l.blockContent.node);h=l.blockContent.beforePos+m.positionAt(0,0,l.blockContent.node)+1+2}else h=l.blockContent.beforePos+1;if(u.content==="table"){const m=P.TableMap.get(c.blockContent.node),g=c.blockContent.beforePos+m.positionAt(m.height-1,m.width-1,c.blockContent.node)+1,b=s.resolve(g).nodeAfter.nodeSize;f=g+b-2}else f=c.blockContent.afterPos-1;e._tiptapEditor.dispatch(e._tiptapEditor.state.tr.setSelection(y.TextSelection.create(e._tiptapEditor.state.doc,h,f)))}function zs(e){const{bnBlock:o}=v(e._tiptapEditor.state),t=e._tiptapEditor.state.doc.resolve(o.beforePos),n=t.nodeBefore,r=e._tiptapEditor.state.doc.resolve(o.afterPos).nodeAfter;let s;return t.depth>1&&(s=t.node(),s.type.isInGroup("bnBlock")||(s=t.node(t.depth-1))),{block:T(o.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:n===null?void 0:T(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:r===null?void 0:T(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:s===void 0?void 0:T(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function fn(e,o,t="start"){const n=typeof o=="string"?o:o.id,r=_(n,e._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n} not found`);const s=Q(r),i=e.schema.blockSchema[s.blockNoteType].content;if(s.isBlockContainer){const a=s.blockContent;if(i==="none"){e._tiptapEditor.commands.setNodeSelection(a.beforePos);return}if(i==="inline")t==="start"?e._tiptapEditor.commands.setTextSelection(a.beforePos+1):e._tiptapEditor.commands.setTextSelection(a.afterPos-1);else if(i==="table")t==="start"?e._tiptapEditor.commands.setTextSelection(a.beforePos+4):e._tiptapEditor.commands.setTextSelection(a.afterPos-4);else throw new F(i)}else{const a=t==="start"?s.childContainer.node.firstChild:s.childContainer.node.lastChild;fn(e,a.attrs.id,t)}}exports.esmDependencies=void 0;async function Ue(){if(exports.esmDependencies)return exports.esmDependencies;const e=await Promise.all([import("rehype-parse"),import("rehype-stringify"),import("unified"),import("hast-util-from-dom"),import("rehype-remark"),import("remark-gfm"),import("remark-stringify"),import("remark-parse"),import("remark-rehype"),import("rehype-format")]);return exports.esmDependencies={rehypeParse:e[0],rehypeStringify:e[1],unified:e[2],hastUtilFromDom:e[3],rehypeRemark:e[4],remarkGfm:e[5],remarkStringify:e[6],remarkParse:e[7],remarkRehype:e[8],rehypeFormat:e[9]},exports.esmDependencies}function Ws(){const e=o=>{let t=o.children.length;for(let n=0;n<t;n++){const r=o.children[n];if(r.type==="element"&&(e(r),r.tagName==="u"))if(r.children.length>0){o.children.splice(n,1,...r.children);const s=r.children.length-1;t+=s,n+=s}else o.children.splice(n,1),t--,n--}};return e}function qs(){const e=exports.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const o=t=>{var n;if(t.children&&"length"in t.children&&t.children.length)for(let r=t.children.length-1;r>=0;r--){const s=t.children[r],i=r+1<t.children.length?t.children[r+1]:void 0;s.type==="element"&&s.tagName==="input"&&((n=s.properties)==null?void 0:n.type)==="checkbox"&&(i==null?void 0:i.type)==="element"&&i.tagName==="p"?(i.tagName="span",i.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):o(s)}};return o}function $e(e){const o=exports.esmDependencies;if(!o)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return o.unified.unified().use(o.rehypeParse.default,{fragment:!0}).use(Ws).use(qs).use(o.rehypeRemark.default).use(o.remarkGfm.default).use(o.remarkStringify.default,{handlers:{text:n=>n.value}}).processSync(e).value}async function mn(e,o,t,n){await Ue();const s=ve(o,t).exportBlocks(e,n);return $e(s)}function js(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Ks(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function Gs(e){e.querySelectorAll("li > ul, li > ol").forEach(o=>{const t=js(o),n=o.parentElement,r=Array.from(n.childNodes).slice(t+1);o.remove(),r.forEach(s=>{s.remove()}),n.insertAdjacentElement("afterend",o),r.reverse().forEach(s=>{if(Ks(s))return;const i=document.createElement("li");i.append(s),o.insertAdjacentElement("afterend",i)}),n.childNodes.length===0&&n.remove()})}function Xs(e){e.querySelectorAll("li + ul, li + ol").forEach(o=>{var s,i;const t=o.previousElementSibling,n=document.createElement("div");t.insertAdjacentElement("afterend",n),n.append(t);const r=document.createElement("div");for(r.setAttribute("data-node-type","blockGroup"),n.append(r);((s=n.nextElementSibling)==null?void 0:s.nodeName)==="UL"||((i=n.nextElementSibling)==null?void 0:i.nodeName)==="OL";)r.append(n.nextElementSibling)})}let Nt=null;function Js(){return Nt||(Nt=document.implementation.createHTMLDocument("title"))}function gn(e){if(typeof e=="string"){const o=Js().createElement("div");o.innerHTML=e,e=o}return Gs(e),Xs(e),e}async function vt(e,o,t,n,r){const s=gn(e),a=B.DOMParser.fromSchema(r).parse(s,{topNode:r.nodes.blockGroup.create()}),l=[];for(let c=0;c<a.childCount;c++)l.push(T(a.child(c),o,t,n));return l}function Ys(e,o){const t=o.value?o.value:"",n={};o.lang&&(n["data-language"]=o.lang);let r={type:"element",tagName:"code",properties:n,children:[{type:"text",value:t}]};return o.meta&&(r.data={meta:o.meta}),e.patch(o,r),r=e.applyData(o,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(o,r),r}async function St(e){const o=await Ue();return o.unified.unified().use(o.remarkParse.default).use(o.remarkGfm.default).use(o.remarkRehype.default,{handlers:{...o.remarkRehype.defaultHandlers,code:Ys}}).use(o.rehypeStringify.default).processSync(e).value}async function bn(e,o,t,n,r){const s=await St(e);return vt(s,o,t,n,r)}const Et=["vscode-editor-data","blocknote/html","text/markdown","text/html","text/plain","Files"];function Zs(e,o){if(!e.startsWith(".")||!o.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===o}function Qs(e,o){const t=e.split("/"),n=o.split("/");if(t.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(n.length!==2)throw new Error(`The string ${o} is not a valid MIME type.`);return t[1]==="*"||n[1]==="*"?t[0]===n[0]:(t[0]==="*"||n[0]==="*"||t[0]===n[0])&&t[1]===n[1]}function Ht(e,o,t){let n;return Array.isArray(o.content)&&o.content.length===0?n=e.updateBlock(o,t).id:n=e.insertBlocks([t],o,"after")[0].id,n}async function kn(e,o){var i;if(!o.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const t="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(t===null)return;let n=null;for(const a of Et)if(t.types.includes(a)){n=a;break}if(n!=="Files")return;const r=t.items;if(!r)return;e.preventDefault();const s=Object.values(o.schema.blockSchema).filter(a=>a.isFileBlock);for(let a=0;a<r.length;a++){let l="file";for(const d of s)for(const u of d.fileBlockAccept||[]){const h=u.startsWith("."),f=r[a].getAsFile();if(f&&(!h&&f.type&&Qs(r[a].type,u)||h&&Zs("."+f.name.split(".").pop(),u))){l=d.type;break}}const c=r[a].getAsFile();if(c){const d={type:l,props:{name:c.name}};let u;if(e.type==="paste"){const m=o.getTextCursorPosition().block;u=Ht(o,m,d)}else if(e.type==="drop"){const m={left:e.clientX,top:e.clientY},g=(i=o.prosemirrorView)==null?void 0:i.posAtCoords(m);if(!g)return;const b=K(o._tiptapEditor.state.doc,g.pos);u=Ht(o,o.getBlock(b.node.attrs.id),d)}else return;const h=await o.uploadFile(c,u),f=typeof h=="string"?{props:{url:h}}:{...h};o.updateBlock(u,f)}}}const ei=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{drop(o,t){if(!e.isEditable)return;let n=null;for(const r of Et)if(t.dataTransfer.types.includes(r)){n=r;break}return n===null?!0:n==="Files"?(kn(t,e),!0):!1}}}})]}});async function ti(e,o){const{schema:t}=o.state;if(!e.clipboardData)return!1;const n=e.clipboardData.getData("text/plain");if(!n)return!1;if(!t.nodes.codeBlock)return o.pasteText(n),!0;const r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;return i?(o.pasteHTML(`<pre><code class="language-${i}">${n.replace(/\r\n?/g,`
|
|
11
|
+
`)}</code></pre>`),!0):!1}const oi=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,ni=new RegExp("(?:\\s|^)(_|__|\\*|\\*\\*|~~|==|\\+\\+)(?!\\s).{1,64}(?<!\\s)(?=\\1)"),ri=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,si=new RegExp("(?:\\s|^)`(?!\\s)[^`]{1,48}(?<!\\s)`([^\\w]|$)"),ii=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,ai=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,li=/\n{2} {0,3}-{2,48}\n{2}/,ci=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,di=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,ui=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,pi=/^\s*\|(.+\|)+\s*$/m,hi=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,fi=/^\s*\|(.+\|)+\s*$/m,mi=e=>oi.test(e)||ni.test(e)||ri.test(e)||si.test(e)||ii.test(e)||ai.test(e)||li.test(e)||ci.test(e)||di.test(e)||ui.test(e)||pi.test(e)||hi.test(e)||fi.test(e);function gi({event:e,editor:o,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n}){let r;for(const i of Et)if(e.clipboardData.types.includes(i)){r=i;break}if(!r)return!0;if(r==="vscode-editor-data")return ti(e,o.prosemirrorView),!0;if(r==="Files")return kn(e,o),!0;const s=e.clipboardData.getData(r);if(r==="blocknote/html")return o.pasteHTML(s,!0),!0;if(r==="text/markdown")return o.pasteMarkdown(s),!0;if(t){const i=e.clipboardData.getData("text/plain");if(mi(i))return o.pasteMarkdown(i),!0}return r==="text/html"?(o.pasteHTML(s),!0):n?(o.pasteMarkdown(s),!0):(o.pasteText(s),!0)}const bi=(e,o)=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{paste(t,n){if(n.preventDefault(),!!e.isEditable)return o({event:n,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:r=!0,plainTextAsMarkdown:s=!0}={})=>gi({event:n,editor:e,prioritizeMarkdownOverHTML:r,plainTextAsMarkdown:s})})}}}})]}});function wn(e,o){const t=[];return e.descendants(n=>{var r,s;return n.type.name==="blockContainer"&&((r=n.firstChild)==null?void 0:r.type.name)==="blockGroup"?!0:n.type.name==="columnList"&&n.childCount===1?((s=n.firstChild)==null||s.forEach(i=>{t.push(T(i,o.blockSchema,o.inlineContentSchema,o.styleSchema))}),!1):n.type.isInGroup("bnBlock")?(t.push(T(n,o.blockSchema,o.inlineContentSchema,o.styleSchema)),!1):!0}),t}function ki(e,o,t){var a;let n=!1;const r=e.state.selection instanceof P.CellSelection;if(!r){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,c=[];for(let d=0;d<l.childCount;d++)c.push(l.child(d));n=c.find(d=>d.type.isInGroup("bnBlock")||d.type.name==="blockGroup"||d.type.spec.group==="blockContent")===void 0,n&&(o=l)}let s;const i=ve(e.state.schema,t);if(r){((a=o.firstChild)==null?void 0:a.type.name)==="table"&&(o=o.firstChild.content);const l=dt(o,t.schema.inlineContentSchema,t.schema.styleSchema);s=`<table>${i.exportInlineContent(l,{})}</table>`}else if(n){const l=ye(o,t.schema.inlineContentSchema,t.schema.styleSchema);s=i.exportInlineContent(l,{})}else{const l=wn(o,t.schema);s=i.exportBlocks(l,{})}return s}function yn(e,o){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&o.dispatch(o._tiptapEditor.state.tr.setSelection(new y.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const t=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,n=e.state.selection.content().content,r=ki(e,n,o),s=$e(r);return{clipboardHTML:t,externalHTML:r,markdown:s}}const Dt=()=>{const e=window.getSelection();if(!e||e.isCollapsed)return!0;let o=e.focusNode;for(;o;){if(o instanceof HTMLElement&&o.getAttribute("contenteditable")==="false")return!0;o=o.parentElement}return!1},Ot=(e,o,t)=>{t.preventDefault(),t.clipboardData.clearData();const{clipboardHTML:n,externalHTML:r,markdown:s}=yn(o,e);t.clipboardData.setData("blocknote/html",n),t.clipboardData.setData("text/html",r),t.clipboardData.setData("text/plain",s)},wi=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new y.Plugin({props:{handleDOMEvents:{copy(o,t){return Dt()||Ot(e,o,t),!0},cut(o,t){return Dt()||(Ot(e,o,t),o.editable&&o.dispatch(o.state.tr.deleteSelection())),!0},dragstart(o,t){if(!("node"in o.state.selection)||o.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new y.NodeSelection(o.state.doc.resolve(o.state.selection.from-1)))),t.preventDefault(),t.dataTransfer.clearData();const{clipboardHTML:n,externalHTML:r,markdown:s}=yn(o,e);return t.dataTransfer.setData("blocknote/html",n),t.dataTransfer.setData("text/html",r),t.dataTransfer.setData("text/plain",s),!0}}}})]}}),yi=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer","tableCell","tableHeader"],attributes:{backgroundColor:{default:M.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):M.backgroundColor.default,renderHTML:e=>e.backgroundColor===M.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}}),Ci=e=>{var n;const o=[];o.push(wr.default.configure({fragment:e.fragment}));const t=(n=e.provider)==null?void 0:n.awareness;if(t){const r=new Map;e.showCursorLabels!=="always"&&t.on("change",({updated:a})=>{for(const l of a){const c=r.get(l);c&&(c.element.setAttribute("data-active",""),c.hideTimeout&&clearTimeout(c.hideTimeout),r.set(l,{element:c.element,hideTimeout:setTimeout(()=>{c.element.removeAttribute("data-active")},2e3)}))}});const s=a=>{const l=document.createElement("span");l.classList.add("bn-collaboration-cursor__base");const c=document.createElement("span");c.setAttribute("contentedEditable","false"),c.classList.add("bn-collaboration-cursor__caret"),c.setAttribute("style",`background-color: ${a.color}`);const d=document.createElement("span");return d.classList.add("bn-collaboration-cursor__label"),d.setAttribute("style",`background-color: ${a.color}`),d.insertBefore(document.createTextNode(a.name),null),c.insertBefore(d,null),l.insertBefore(document.createTextNode(""),null),l.insertBefore(c,null),l.insertBefore(document.createTextNode(""),null),l},i=(a,l)=>{var d;let c=r.get(l);if(!c){const u=((d=e==null?void 0:e.renderCursor)==null?void 0:d.call(e,a))||s(a);(e==null?void 0:e.showCursorLabels)!=="always"&&(u.addEventListener("mouseenter",()=>{const h=r.get(l);h.element.setAttribute("data-active",""),h.hideTimeout&&(clearTimeout(h.hideTimeout),r.set(l,{element:h.element,hideTimeout:void 0}))}),u.addEventListener("mouseleave",()=>{const h=r.get(l);r.set(l,{element:h.element,hideTimeout:setTimeout(()=>{h.element.removeAttribute("data-active")},2e3)})})),c={element:u,hideTimeout:void 0},r.set(l,c)}return c.element};o.push(yr.default.configure({user:e.user,render:i,provider:e.provider}))}return o},Cn=k.Mark.create({name:"comment",excludes:"",inclusive:!1,keepOnSplit:!0,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute("data-orphan"),renderHTML:e=>e.orphan?{"data-orphan":"true"}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute("data-bn-thread-id"),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:""}}},renderHTML({HTMLAttributes:e}){return["span",k.mergeAttributes(e,{class:"bn-thread-mark"})]},parseHTML(){return[{tag:"span.bn-thread-mark"}]},extendMarkSchema(e){return e.name==="comment"?{blocknoteIgnore:!0}:{}}});class Y{constructor(){p(this,"callbacks",{})}on(o,t){return this.callbacks[o]||(this.callbacks[o]=[]),this.callbacks[o].push(t),()=>this.off(o,t)}emit(o,...t){const n=this.callbacks[o];n&&n.forEach(r=>r.apply(this,t))}off(o,t){const n=this.callbacks[o];n&&(t?this.callbacks[o]=n.filter(r=>r!==t):delete this.callbacks[o])}removeAllListeners(){this.callbacks={}}}class vi extends Y{constructor(t){super();p(this,"userCache",new Map);p(this,"loadingUsers",new Set);this.resolveUsers=t}async loadUsers(t){const n=t.filter(r=>!this.userCache.has(r)&&!this.loadingUsers.has(r));if(n.length!==0){for(const r of n)this.loadingUsers.add(r);try{const r=await this.resolveUsers(n);for(const s of r)this.userCache.set(s.id,s);this.emit("update",this.userCache)}finally{for(const r of n)this.loadingUsers.delete(r)}}}getUser(t){return this.userCache.get(t)}subscribe(t){return this.on("update",t)}}const Be=new y.PluginKey("blocknote-comments"),Si="SET_SELECTED_THREAD_ID";function Ei(e,o){const t=new Map;return e.descendants((n,r)=>{n.marks.forEach(s=>{if(s.type.name===o){const i=s.attrs.threadId;if(!i)return;const a=r,l=a+n.nodeSize,c=t.get(i)??{from:1/0,to:0};t.set(i,{from:Math.min(a,c.from),to:Math.max(l,c.to)})}})}),t}class Bi extends Y{constructor(t,n,r){super();p(this,"plugin");p(this,"userStore");p(this,"pendingComment",!1);p(this,"selectedThreadId");p(this,"threadPositions",new Map);p(this,"updateMarksFromThreads",t=>{const n=this.editor._tiptapEditor;n.state.doc.descendants((r,s)=>{r.marks.forEach(i=>{if(i.type.name===this.markType){const a=i.type,l=i.attrs.threadId,c=t.get(l),d=!!(!c||c.resolved||c.deletedAt);if(d!==i.attrs.orphan){const{tr:u}=n.state,h=Math.max(s,0),f=Math.min(s+r.nodeSize,n.state.doc.content.size-1);u.removeMark(h,f,i),u.addMark(h,f,a.create({...i.attrs,orphan:d})),n.dispatch(u),d&&this.selectedThreadId===l&&(this.selectedThreadId=void 0,this.emitStateUpdate())}}})})});if(this.editor=t,this.threadStore=n,this.markType=r,!t.resolveUsers)throw new Error("resolveUsers is required for comments");this.userStore=new vi(t.resolveUsers),this.threadStore.subscribe(this.updateMarksFromThreads),t.onCreate(()=>{this.updateMarksFromThreads(this.threadStore.getThreads()),t.onSelectionChange(()=>{this.pendingComment&&(this.pendingComment=!1,this.emitStateUpdate())})});const s=this;this.plugin=new y.Plugin({key:Be,state:{init(){return{decorations:x.DecorationSet.empty}},apply(i,a){const l=i.getMeta(Be);if(!i.docChanged&&!l)return a;const c=i.docChanged?Ei(i.doc,s.markType):s.threadPositions;(c.size>0||s.threadPositions.size>0)&&(s.threadPositions=c,s.emitStateUpdate());const d=[];if(s.selectedThreadId){const u=c.get(s.selectedThreadId);u&&d.push(x.Decoration.inline(u.from,u.to,{class:"bn-thread-mark-selected"}))}return{decorations:x.DecorationSet.create(i.doc,d)}}},props:{decorations(i){var a;return((a=Be.getState(i))==null?void 0:a.decorations)??x.DecorationSet.empty},handleClick:(i,a,l)=>{if(l.button!==0)return;const c=i.state.doc.nodeAt(a);if(!c){s.selectThread(void 0);return}const d=c.marks.find(h=>h.type.name===r&&h.attrs.orphan!==!0),u=d==null?void 0:d.attrs.threadId;s.selectThread(u,!1)}}})}emitStateUpdate(){this.emit("update",{selectedThreadId:this.selectedThreadId,pendingComment:this.pendingComment,threadPositions:this.threadPositions})}onUpdate(t){return this.on("update",t)}selectThread(t,n=!0){var r,s;if(this.selectedThreadId!==t&&(this.selectedThreadId=t,this.emitStateUpdate(),this.editor.dispatch(this.editor.prosemirrorView.state.tr.setMeta(Be,{name:Si})),t&&n)){const i=this.threadPositions.get(t);if(!i)return;(s=(r=this.editor.prosemirrorView)==null?void 0:r.domAtPos(i.from).node)==null||s.scrollIntoView({behavior:"smooth",block:"center"})}}startPendingComment(){this.pendingComment=!0,this.emitStateUpdate()}stopPendingComment(){this.pendingComment=!1,this.emitStateUpdate()}async createThread(t){const n=await this.threadStore.createThread(t);if(this.threadStore.addThreadToDocument){const r=this.editor.prosemirrorView,s=r.state.selection,i=Ge.ySyncPluginKey.getState(r.state),a={prosemirror:{head:s.head,anchor:s.anchor},yjs:i?Ge.getRelativeSelection(i.binding,r.state):void 0};await this.threadStore.addThreadToDocument({threadId:n.id,selection:a})}else this.editor._tiptapEditor.commands.setMark(this.markType,{orphan:!1,threadId:n.id})}}class vn{constructor(o,t,n,r){p(this,"state");p(this,"emitUpdate");p(this,"mouseDownHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"dragstartHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;if((o=this.state)!=null&&o.show){const t=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!t)return;this.state.referencePos=t.getBoundingClientRect(),this.emitUpdate()}});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pluginKey=t,this.pmView=n,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized file panel");r(this.state)},n.dom.addEventListener("mousedown",this.mouseDownHandler),n.dom.addEventListener("dragstart",this.dragstartHandler),n.root.addEventListener("scroll",this.scrollHandler,!0)}update(o,t){var r,s;const n=this.pluginKey.getState(o.state);if(!((r=this.state)!=null&&r.show)&&n.block&&this.editor.isEditable){const i=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${n.block.id}"]`);if(!i)return;this.state={show:!0,referencePos:i.getBoundingClientRect(),block:n.block},this.emitUpdate();return}(!o.state.selection.eq(t.selection)||!o.state.doc.eq(t.doc)||!this.editor.isEditable)&&(s=this.state)!=null&&s.show&&(this.state.show=!1,this.emitUpdate())}destroy(){this.pmView.dom.removeEventListener("mousedown",this.mouseDownHandler),this.pmView.dom.removeEventListener("dragstart",this.dragstartHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}}const je=new y.PluginKey("FilePanelPlugin");class Sn extends Y{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>{var t;return(t=this.view)==null?void 0:t.closeMenu()});this.plugin=new y.Plugin({key:je,view:n=>(this.view=new vn(t,je,n,r=>{this.emit("update",r)}),this.view),props:{handleKeyDown:(n,r)=>{var s;return r.key==="Escape"&&this.shown?((s=this.view)==null||s.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:n=>{var s;return{block:(s=n.getMeta(je))==null?void 0:s.block}}}})}get shown(){var t,n;return((n=(t=this.view)==null?void 0:t.state)==null?void 0:n.show)||!1}onUpdate(t){return this.on("update",t)}}class En{constructor(o,t,n){p(this,"state");p(this,"emitUpdate");p(this,"preventHide",!1);p(this,"preventShow",!1);p(this,"shouldShow",({state:o,from:t,to:n})=>{const{doc:r,selection:s}=o,{empty:i}=s,a=!r.textBetween(t,n).length&&k.isTextSelection(o.selection);return s.$from.parent.type.spec.code||k.isNodeSelection(s)&&s.node.type.spec.code?!1:!(i||a)});p(this,"blurHandler",o=>{var n;if(this.preventHide){this.preventHide=!1;return}const t=this.pmView.dom.parentElement;o&&o.relatedTarget&&(t===o.relatedTarget||t.contains(o.relatedTarget)||o.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())});p(this,"viewMousedownHandler",()=>{this.preventShow=!0});p(this,"mouseupHandler",()=>{this.preventShow&&(this.preventShow=!1,setTimeout(()=>this.update(this.pmView)))});p(this,"dragHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");n(this.state)},t.dom.addEventListener("mousedown",this.viewMousedownHandler),t.root.addEventListener("mouseup",this.mouseupHandler),t.dom.addEventListener("dragstart",this.dragHandler),t.dom.addEventListener("dragover",this.dragHandler),t.dom.addEventListener("blur",this.blurHandler),t.root.addEventListener("scroll",this.scrollHandler,!0)}update(o,t){var h;const{state:n,composing:r}=o,{selection:s}=n,i=t&&t.selection.from===n.selection.from&&t.selection.to===n.selection.to;if(r||i)return;const{ranges:a}=s,l=Math.min(...a.map(f=>f.$from.pos)),c=Math.max(...a.map(f=>f.$to.pos)),d=this.shouldShow({view:o,state:n,from:l,to:c}),u=typeof Range.prototype.getClientRects>"u";if(!this.preventShow&&(d||this.preventHide)&&!u){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((h=this.state)!=null&&h.show&&!this.preventHide&&(!d||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("mouseup",this.mouseupHandler),this.pmView.dom.removeEventListener("dragstart",this.dragHandler),this.pmView.dom.removeEventListener("dragover",this.dragHandler),this.pmView.dom.removeEventListener("blur",this.blurHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0)}getSelectionBoundingBox(){const{state:o}=this.pmView,{selection:t}=o,{ranges:n}=t,r=Math.min(...n.map(i=>i.$from.pos)),s=Math.max(...n.map(i=>i.$to.pos));if(k.isNodeSelection(t)){const i=this.pmView.nodeDOM(r);if(i)return i.getBoundingClientRect()}return k.posToDOMRect(this.pmView,r,s)}}const Bn=new y.PluginKey("FormattingToolbarPlugin");class Tn extends Y{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:Bn,view:n=>(this.view=new En(t,n,r=>{this.emit("update",r)}),this.view),props:{handleKeyDown:(n,r)=>r.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}get shown(){var t,n;return((n=(t=this.view)==null?void 0:t.state)==null?void 0:n.show)||!1}onUpdate(t){return this.on("update",t)}}const Ti=k.Node.create({name:"hardBreak",inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",k.mergeAttributes(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
12
|
+
`}}),_t=(e,o)=>{const t=e.resolve(o);if(t.depth<=1)return;const n=t.posAtIndex(t.index(t.depth-1),t.depth-1);return ue(e.resolve(n))},Pe=(e,o)=>{const t=e.resolve(o),n=t.index();if(n===0)return;const r=t.posAtIndex(n-1);return ue(e.resolve(r))},xn=(e,o)=>{for(;o.childContainer;){const t=o.childContainer.node,n=e.resolve(o.childContainer.beforePos+1).posAtIndex(t.childCount-1);o=ue(e.resolve(n))}return o},xi=(e,o)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&o.isBlockContainer&&o.blockContent.node.type.spec.content==="inline*",Mi=(e,o,t,n)=>{if(!n.isBlockContainer)throw new Error(`Attempted to merge block at position ${n.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`);if(n.childContainer){const r=e.doc.resolve(n.childContainer.beforePos+1),s=e.doc.resolve(n.childContainer.afterPos-1),i=r.blockRange(s);if(o){const a=e.doc.resolve(n.bnBlock.beforePos);e.tr.lift(i,a.depth)}}if(o){if(!t.isBlockContainer)throw new Error(`Attempted to merge block at position ${n.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but previous block is not a block container`);o(e.tr.delete(t.blockContent.afterPos-1,n.blockContent.beforePos+1))}return!0},Rt=e=>({state:o,dispatch:t})=>{const n=o.doc.resolve(e),r=ue(n),s=Pe(o.doc,r.bnBlock.beforePos);if(!s)return!1;const i=xn(o.doc,s);return xi(i,r)?Mi(o,t,i,r):!1},Pi=k.Extension.create({priority:50,addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({chain:n,commands:r})=>[()=>r.deleteSelection(),()=>r.undoInputRule(),()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)return!1;const a=s.selection.from===i.blockContent.beforePos+1,l=i.blockContent.node.type.name==="paragraph";return a&&!l?r.command(L(this.options.editor,i.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)return!1;const{blockContent:a}=i;return s.selection.from===a.beforePos+1?r.liftListItem("blockContainer"):!1}),()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)return!1;const{bnBlock:a,blockContent:l}=i,c=s.selection.from===l.beforePos+1,d=s.selection.empty,u=a.beforePos;return c&&d?n().command(Rt(u)).scrollIntoView().run():!1}),()=>r.command(({state:s,dispatch:i})=>{const a=v(s);if(!a.isBlockContainer||!(s.selection.from===a.blockContent.beforePos+1)||Pe(s.doc,a.bnBlock.beforePos))return!1;const d=_t(s.doc,a.bnBlock.beforePos);if((d==null?void 0:d.blockNoteType)!=="column")return!1;const u=d,h=_t(s.doc,u.bnBlock.beforePos);if((h==null?void 0:h.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const f=u.childContainer.node.childCount===1,m=f&&h.childContainer.node.childCount===2,g=h.childContainer.node.firstChild===u.bnBlock.node;if(i){const b=s.doc.slice(a.bnBlock.beforePos,a.bnBlock.afterPos,!1);if(m)if(g){s.tr.step(new Ie.ReplaceAroundStep(h.bnBlock.beforePos,h.bnBlock.afterPos,u.bnBlock.afterPos+1,h.bnBlock.afterPos-2,b,b.size,!1));const w=s.tr.doc.resolve(u.bnBlock.beforePos);s.tr.setSelection(y.TextSelection.between(w,w))}else{s.tr.step(new Ie.ReplaceAroundStep(h.bnBlock.beforePos,h.bnBlock.afterPos,h.bnBlock.beforePos+2,u.bnBlock.beforePos-1,b,0,!1));const w=s.tr.doc.resolve(s.tr.mapping.map(u.bnBlock.beforePos-1));s.tr.setSelection(y.TextSelection.between(w,w))}else if(f)if(g){s.tr.delete(u.bnBlock.beforePos,u.bnBlock.afterPos),s.tr.insert(h.bnBlock.beforePos,b.content);const w=s.tr.doc.resolve(h.bnBlock.beforePos);s.tr.setSelection(y.TextSelection.between(w,w))}else s.tr.delete(u.bnBlock.beforePos-1,u.bnBlock.beforePos+1);else{s.tr.delete(a.bnBlock.beforePos,a.bnBlock.afterPos),g?s.tr.insert(h.bnBlock.beforePos-1,b.content):s.tr.insert(u.bnBlock.beforePos-1,b.content);const w=s.tr.doc.resolve(u.bnBlock.beforePos-1);s.tr.setSelection(y.TextSelection.between(w,w))}}return!0}),()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)return!1;if(i.blockContent.node.childCount===0&&i.blockContent.node.type.spec.content==="inline*"){const l=Pe(s.doc,i.bnBlock.beforePos);if(!l||!l.isBlockContainer)return!1;let c=n();if(l.blockContent.node.type.spec.content==="tableRow+"){const m=i.bnBlock.beforePos-1-1-1-1-1;c=c.setTextSelection(m)}else if(l.blockContent.node.type.spec.content===""){const d=l.blockContent.afterPos-l.blockContent.node.nodeSize;c=c.setNodeSelection(d)}else{const d=l.blockContent.afterPos-l.blockContent.node.nodeSize;c=c.setTextSelection(d)}return c.deleteRange({from:i.bnBlock.beforePos,to:i.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)throw new Error("todo");const a=s.selection.from===i.blockContent.beforePos+1,l=s.selection.empty,c=Pe(s.doc,i.bnBlock.beforePos);if(c&&a&&l){const d=xn(s.doc,c);if(!d.isBlockContainer)throw new Error("todo");if(d.blockContent.node.type.spec.content===""||d.blockContent.node.type.spec.content==="inline*"&&d.blockContent.node.childCount===0)return n().cut({from:i.bnBlock.beforePos,to:i.bnBlock.afterPos},d.bnBlock.afterPos).deleteRange({from:d.bnBlock.beforePos,to:d.bnBlock.afterPos}).run()}return!1})]),o=()=>this.editor.commands.first(({commands:n})=>[()=>n.deleteSelection(),()=>n.command(({state:r})=>{const s=v(r);if(!s.isBlockContainer)return!1;const{bnBlock:i,blockContent:a,childContainer:l}=s,{depth:c}=r.doc.resolve(i.beforePos),d=i.afterPos===r.doc.nodeSize-3,u=r.selection.from===a.afterPos-1,h=r.selection.empty;if(!d&&u&&h&&!(l!==void 0)){let m=c,g=i.afterPos+1,b=r.doc.resolve(g).depth;for(;b<m;)m=b,g+=2,b=r.doc.resolve(g).depth;return n.command(Rt(g-1))}return!1})]),t=(n=!1)=>this.editor.commands.first(({commands:r})=>[()=>r.command(({state:s})=>{const i=v(s);if(!i.isBlockContainer)return!1;const{bnBlock:a,blockContent:l}=i,{depth:c}=s.doc.resolve(a.beforePos),d=s.selection.$anchor.parentOffset===0,u=s.selection.anchor===s.selection.head,h=l.node.childCount===0,f=c>1;return d&&u&&h&&f?r.liftListItem("blockContainer"):!1}),()=>r.command(({state:s})=>{const i=v(s),a=this.options.editor.schema.blockSchema[i.blockNoteType].hardBreakShortcut??"shift+enter";return a==="none"?!1:a==="shift+enter"&&n||a==="enter"?r.insertContent({type:"hardBreak"}):!1}),()=>r.command(({state:s,dispatch:i})=>{const a=v(s);if(!a.isBlockContainer)return!1;const{bnBlock:l,blockContent:c}=a,d=s.selection.$anchor.parentOffset===0,u=s.selection.anchor===s.selection.head,h=c.node.childCount===0;if(d&&u&&h){const f=l.afterPos,m=f+2;if(i){const g=s.schema.nodes.blockContainer.createAndFill();s.tr.insert(f,g).scrollIntoView(),s.tr.setSelection(new y.TextSelection(s.doc.resolve(m)))}return!0}return!1}),()=>r.command(({state:s,chain:i})=>{const a=v(s);if(!a.isBlockContainer)return!1;const{blockContent:l}=a,c=s.selection.$anchor.parentOffset===0;return l.node.childCount===0?!1:(i().deleteSelection().command(qo(s.selection.from,c,c)).run(),!0)})]);return{Backspace:e,Delete:o,Enter:()=>t(),"Shift-Enter":()=>t(!0),Tab:()=>{var n,r,s;return this.options.tabBehavior!=="prefer-indent"&&((n=this.options.editor.formattingToolbar)!=null&&n.shown||(r=this.options.editor.linkToolbar)!=null&&r.shown||(s=this.options.editor.filePanel)!=null&&s.shown)?!1:pn(this.options.editor)},"Shift-Tab":()=>{var n,r,s;return this.options.tabBehavior!=="prefer-indent"&&((n=this.options.editor.formattingToolbar)!=null&&n.shown||(r=this.options.editor.linkToolbar)!=null&&r.shown||(s=this.options.editor.filePanel)!=null&&s.shown)?!1:(this.editor.commands.liftListItem("blockContainer"),!0)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0)}}});class Ii{constructor(o,t,n){p(this,"state");p(this,"emitUpdate");p(this,"menuUpdateTimer");p(this,"startMenuUpdateTimer");p(this,"stopMenuUpdateTimer");p(this,"mouseHoveredLinkMark");p(this,"mouseHoveredLinkMarkRange");p(this,"keyboardHoveredLinkMark");p(this,"keyboardHoveredLinkMarkRange");p(this,"linkMark");p(this,"linkMarkRange");p(this,"mouseOverHandler",o=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),o.target instanceof HTMLAnchorElement&&o.target.nodeName==="A"){const t=o.target,n=this.pmView.posAtDOM(t,0)+1,r=this.pmView.state.doc.resolve(n),s=r.marks();for(const i of s)if(i.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=i,this.mouseHoveredLinkMarkRange=k.getMarkRange(r,i.type,i.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});p(this,"clickHandler",o=>{var n;const t=this.pmView.dom.parentElement;this.linkMark&&o&&o.target&&!(t===o.target||t.contains(o.target))&&(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())});p(this,"scrollHandler",()=>{var o;this.linkMark!==void 0&&(o=this.state)!=null&&o.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});p(this,"closeMenu",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized link toolbar");n(this.state)},this.startMenuUpdateTimer=()=>{this.menuUpdateTimer=setTimeout(()=>{this.update(this.pmView,void 0,!0)},250)},this.stopMenuUpdateTimer=()=>(this.menuUpdateTimer&&(clearTimeout(this.menuUpdateTimer),this.menuUpdateTimer=void 0),!1),this.pmView.dom.addEventListener("mouseover",this.mouseOverHandler),this.pmView.root.addEventListener("click",this.clickHandler,!0),this.pmView.root.addEventListener("scroll",this.scrollHandler,!0)}editLink(o,t){var r;const n=this.pmView.state.tr.insertText(t,this.linkMarkRange.from,this.linkMarkRange.to);n.addMark(this.linkMarkRange.from,this.linkMarkRange.from+t.length,this.pmView.state.schema.mark("link",{href:o})),this.editor.dispatch(n),this.pmView.focus(),(r=this.state)!=null&&r.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var o;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate())}update(o,t,n=!1){var a;const{state:r}=o;if(t&&t.selection.from===r.selection.from&&t.selection.to===r.selection.to||!this.pmView.hasFocus())return;const i=this.linkMark;if(this.linkMark=void 0,this.linkMarkRange=void 0,this.keyboardHoveredLinkMark=void 0,this.keyboardHoveredLinkMarkRange=void 0,this.pmView.state.selection.empty){const l=this.pmView.state.selection.$from.marks();for(const c of l)if(c.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=c,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,c.type,c.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&n&&(this.linkMark=this.mouseHoveredLinkMark,this.linkMarkRange=this.mouseHoveredLinkMarkRange),this.keyboardHoveredLinkMark&&(this.linkMark=this.keyboardHoveredLinkMark,this.linkMarkRange=this.keyboardHoveredLinkMarkRange),this.linkMark&&this.editor.isEditable){this.state={show:!0,referencePos:k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),url:this.linkMark.attrs.href,text:this.pmView.state.doc.textBetween(this.linkMarkRange.from,this.linkMarkRange.to)},this.emitUpdate();return}if((a=this.state)!=null&&a.show&&i&&(!this.linkMark||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mouseover",this.mouseOverHandler),this.pmView.root.removeEventListener("scroll",this.scrollHandler,!0),this.pmView.root.removeEventListener("click",this.clickHandler,!0)}}const Mn=new y.PluginKey("LinkToolbarPlugin");class Pn extends Y{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"editLink",(t,n)=>{this.view.editLink(t,n)});p(this,"deleteLink",()=>{this.view.deleteLink()});p(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});p(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});p(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new y.Plugin({key:Mn,view:n=>(this.view=new Ii(t,n,r=>{this.emit("update",r)}),this.view),props:{handleKeyDown:(n,r)=>r.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(t){return this.on("update",t)}get shown(){var t,n;return((n=(t=this.view)==null?void 0:t.state)==null?void 0:n.show)||!1}}const In=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],Ln="https",Li=new y.PluginKey("node-selection-keyboard");class Ai{constructor(){p(this,"plugin");this.plugin=new y.Plugin({key:Li,props:{handleKeyDown:(o,t)=>{if("node"in o.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(t.key.length===1)return t.preventDefault(),!0;if(t.key==="Enter"&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){const n=o.state.tr;return o.dispatch(n.insert(o.state.tr.selection.$to.after(),o.state.schema.nodes.paragraph.createChecked()).setSelection(new y.TextSelection(n.doc.resolve(o.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const Ni=new y.PluginKey("blocknote-placeholder");class Hi{constructor(o,t){p(this,"plugin");this.plugin=new y.Plugin({key:Ni,view:n=>{var c,d;const r=`placeholder-selector-${Wt.v4()}`;n.dom.classList.add(r);const s=document.createElement("style"),i=o._tiptapEditor.options.injectNonce;i&&s.setAttribute("nonce",i),((c=o.prosemirrorView)==null?void 0:c.root)instanceof ShadowRoot?o.prosemirrorView.root.append(s):(d=o.prosemirrorView)==null||d.root.head.appendChild(s);const a=s.sheet,l=(u="")=>`.${r} .bn-block-content${u} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;try{const{default:u,emptyDocument:h,...f}=t;for(const[b,w]of Object.entries(f)){const C=`[data-content-type="${b}"]`;a.insertRule(`${l(C)} { content: ${JSON.stringify(w)}; }`)}const m="[data-is-only-empty-block]",g="[data-is-empty-and-focused]";a.insertRule(`${l(m)} { content: ${JSON.stringify(h)}; }`),a.insertRule(`${l(g)} { content: ${JSON.stringify(u)}; }`)}catch(u){console.warn("Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)",u)}return{destroy:()=>{var u,h;((u=o.prosemirrorView)==null?void 0:u.root)instanceof ShadowRoot?o.prosemirrorView.root.removeChild(s):(h=o.prosemirrorView)==null||h.root.head.removeChild(s)}}},props:{decorations:n=>{const{doc:r,selection:s}=n;if(!o.isEditable||!s.empty||s.$from.parent.type.spec.code)return;const i=[];n.doc.content.size===6&&i.push(x.Decoration.node(2,4,{"data-is-only-empty-block":"true"}));const a=s.$anchor,l=a.parent;if(l.content.size===0){const c=a.before();i.push(x.Decoration.node(c,c+l.nodeSize,{"data-is-empty-and-focused":"true"}))}return x.DecorationSet.create(r,i)}}})}}const Vt=new y.PluginKey("previous-blocks"),Di={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class Oi{constructor(){p(this,"plugin");let o;this.plugin=new y.Plugin({key:Vt,view(t){return{update:async(n,r)=>{var s;((s=this.key)==null?void 0:s.getState(n.state).updatedBlocks.size)>0&&(o=setTimeout(()=>{n.dispatch(n.state.tr.setMeta(Vt,{clearUpdate:!0}))},0))},destroy:()=>{o&&clearTimeout(o)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(t,n,r,s){if(n.currentTransactionOldBlockAttrs={},n.updatedBlocks.clear(),!t.docChanged||r.doc.eq(s.doc))return n;const i={},a=k.findChildren(r.doc,d=>d.attrs.id),l=new Map(a.map(d=>[d.node.attrs.id,d])),c=k.findChildren(s.doc,d=>d.attrs.id);for(const d of c){const u=l.get(d.node.attrs.id),h=u==null?void 0:u.node.firstChild,f=d.node.firstChild;if(u&&h&&f){const m={index:f.attrs.index,level:f.attrs.level,type:f.type.name,depth:s.doc.resolve(d.pos).depth};let g={index:h.attrs.index,level:h.attrs.level,type:h.type.name,depth:r.doc.resolve(u.pos).depth};i[d.node.attrs.id]=g,t.getMeta("numberedListIndexing")&&(d.node.attrs.id in n.prevTransactionOldBlockAttrs&&(g=n.prevTransactionOldBlockAttrs[d.node.attrs.id]),m.type==="numberedListItem"&&(g.index=m.index)),n.currentTransactionOldBlockAttrs[d.node.attrs.id]=g,JSON.stringify(g)!==JSON.stringify(m)&&(g["depth-change"]=g.depth-m.depth,n.updatedBlocks.add(d.node.attrs.id))}}return n.prevTransactionOldBlockAttrs=i,n}},props:{decorations(t){const n=this.getState(t);if(n.updatedBlocks.size===0)return;const r=[];return t.doc.descendants((s,i)=>{if(!s.attrs.id||!n.updatedBlocks.has(s.attrs.id))return;const a=n.currentTransactionOldBlockAttrs[s.attrs.id],l={};for(const[d,u]of Object.entries(a))l["data-prev-"+Di[d]]=u||"none";const c=x.Decoration.node(i,i+s.nodeSize,{...l});r.push(c)}),x.DecorationSet.create(t.doc,r)}}})}}const Ft=new y.PluginKey("blocknote-show-selection");class _i{constructor(o){p(this,"plugin");p(this,"enabled",!1);this.editor=o,this.plugin=new y.Plugin({key:Ft,props:{decorations:t=>{const{doc:n,selection:r}=t;if(!this.enabled)return x.DecorationSet.empty;const s=x.Decoration.inline(r.from,r.to,{"data-show-selection":"true"});return x.DecorationSet.create(n,[s])}}})}setEnabled(o){var t,n;this.enabled!==o&&(this.enabled=o,(n=this.editor.prosemirrorView)==null||n.dispatch((t=this.editor.prosemirrorView)==null?void 0:t.state.tr.setMeta(Ft,{})))}getEnabled(){return this.enabled}}function An(e,o){var t,n;for(;e&&e.parentElement&&e.parentElement!==o.dom&&((t=e.getAttribute)==null?void 0:t.call(e,"data-node-type"))!=="blockContainer";)e=e.parentElement;if(((n=e.getAttribute)==null?void 0:n.call(e,"data-node-type"))==="blockContainer")return{node:e,id:e.getAttribute("data-id")}}class ie extends y.Selection{constructor(t,n){super(t,n);p(this,"nodes");const r=t.node();this.nodes=[],t.doc.nodesBetween(t.pos,n.pos,(s,i,a)=>{if(a!==null&&a.eq(r))return this.nodes.push(s),!1})}static create(t,n,r=n){return new ie(t.resolve(n),t.resolve(r))}content(){return new B.Slice(B.Fragment.from(this.nodes),0,0)}eq(t){if(!(t instanceof ie)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let n=0;n<this.nodes.length;n++)if(!this.nodes[n].eq(t.nodes[n]))return!1;return!0}map(t,n){const r=n.mapResult(this.from),s=n.mapResult(this.to);return s.deleted?y.Selection.near(t.resolve(r.pos)):r.deleted?y.Selection.near(t.resolve(s.pos)):new ie(t.resolve(r.pos),t.resolve(s.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let U;function Ri(e,o){let t,n;const r=o.resolve(e.from).node().type.spec.group==="blockContent",s=o.resolve(e.to).node().type.spec.group==="blockContent",i=Math.min(e.$anchor.depth,e.$head.depth);if(r&&s){const a=e.$from.start(i-1),l=e.$to.end(i-1);t=o.resolve(a-1).pos,n=o.resolve(l+1).pos}else t=e.from,n=e.to;return{from:t,to:n}}function Ut(e,o,t=o){o===t&&(t+=e.state.doc.resolve(o+1).node().nodeSize);const n=e.domAtPos(o).node.cloneNode(!0),r=e.domAtPos(o).node,s=(u,h)=>Array.prototype.indexOf.call(u.children,h),i=s(r,e.domAtPos(o+1).node.parentElement),a=s(r,e.domAtPos(t-1).node.parentElement);for(let u=r.childElementCount-1;u>=0;u--)(u>a||u<i)&&n.removeChild(n.children[u]);Nn(e.root),U=n;const l=U.getElementsByTagName("iframe");for(let u=0;u<l.length;u++){const h=l[u],f=h.parentElement;f&&f.removeChild(h)}const d=e.dom.className.split(" ").filter(u=>u!=="ProseMirror"&&u!=="bn-root"&&u!=="bn-editor").join(" ");U.className=U.className+" bn-drag-preview "+d,e.root instanceof ShadowRoot?e.root.appendChild(U):e.root.body.appendChild(U)}function Nn(e){U!==void 0&&(e instanceof ShadowRoot?e.removeChild(U):e.body.removeChild(U),U=void 0)}function Vi(e,o,t){if(!e.dataTransfer)return;const n=t.prosemirrorView;if(!n)return;const r=_(o.id,n.state.doc);if(!r)throw new Error(`Block with ID ${o.id} not found`);const s=r.posBeforeNode;if(s!=null){const i=n.state.selection,a=n.state.doc,{from:l,to:c}=Ri(i,a),d=l<=s&&s<c,u=i.$anchor.node()!==i.$head.node()||i instanceof ie;d&&u?(n.dispatch(n.state.tr.setSelection(ie.create(a,l,c))),Ut(n,l,c)):(n.dispatch(n.state.tr.setSelection(y.NodeSelection.create(n.state.doc,s))),Ut(n,s));const h=n.state.selection.content(),f=t.pmSchema,m=n.serializeForClipboard(h).dom.innerHTML,g=ve(f,t),b=wn(h.content,t.schema),w=g.exportBlocks(b,{}),C=$e(w);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",m),e.dataTransfer.setData("text/html",w),e.dataTransfer.setData("text/plain",C),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(U,0,0)}}const ge=.1;function it(e,o,t,n=!0){const r=e.root.elementsFromPoint(o.left+(t==="editor"?50:0),o.top);for(const s of r)if(e.dom.contains(s))return n&&s.closest("[data-node-type=columnList]")?it(e,{left:o.left+50,top:o.top},t,!1):An(s,e)}function Fi(e,o,t){if(!o.dom.firstChild)return;const n=o.dom.firstChild.getBoundingClientRect(),r={left:e.x,top:e.y},s=r.left<n.left,i=r.left>n.right;t==="viewport"&&(s&&(r.left=n.left+10),i&&(r.left=n.right-10));let a=it(o,r,t);if(!i&&a){const l=a.node.getBoundingClientRect();r.left=l.right-10,a=it(o,r,"viewport",!1)}return a}class Hn{constructor(o,t,n,r){p(this,"state");p(this,"emitUpdate");p(this,"mousePos");p(this,"hoveredBlock");p(this,"menuFrozen",!1);p(this,"isDragOrigin",!1);p(this,"updateState",o=>{this.state=o,this.emitUpdate(this.state)});p(this,"updateStateFromMousePos",()=>{var n,r,s,i;if(this.menuFrozen||!this.mousePos)return;const o=Fi(this.mousePos,this.pmView,this.sideMenuDetection);if(!o||!this.editor.isEditable){(n=this.state)!=null&&n.show&&(this.state.show=!1,this.updateState(this.state));return}if((r=this.state)!=null&&r.show&&((s=this.hoveredBlock)!=null&&s.hasAttribute("data-id"))&&((i=this.hoveredBlock)==null?void 0:i.getAttribute("data-id"))===o.id)return;this.hoveredBlock=o.node;const t=o.node.firstChild;if(t&&this.editor.isEditable){const a=t.getBoundingClientRect(),l=o.node.closest("[data-node-type=column]");this.updateState({show:!0,referencePos:new DOMRect(l?l.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,a.y,a.width,a.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute("data-id"))})}});p(this,"onDrop",o=>{var r,s;if(this.pmView.dragging===null)return;this.editor._tiptapEditor.commands.blur();const t=o.target instanceof Node&&((r=o.target instanceof HTMLElement?o.target:o.target.parentElement)==null?void 0:r.closest(".bn-editor"))||null;if(t&&(!this.isDragOrigin&&this.pmView.dom===t?this.pmView.dispatch(this.pmView.state.tr.setSelection(y.TextSelection.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.to))):this.isDragOrigin&&this.pmView.dom!==t&&setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0)),this.sideMenuDetection==="editor"||o.synthetic||!((s=o.dataTransfer)!=null&&s.types.includes("blocknote/html")))return;const n=this.pmView.posAtCoords({left:o.clientX,top:o.clientY});if(!n||n.inside===-1){const i=this.createSyntheticEvent(o);this.pmView.dom.dispatchEvent(i)}});p(this,"onDragEnd",()=>{this.pmView.dragging=null});p(this,"onDragStart",o=>{var i;const t=(i=o.dataTransfer)==null?void 0:i.getData("blocknote/html");if(!t)return;if(this.pmView.dragging)throw new Error("New drag was started while an existing drag is ongoing");const n=document.createElement("div");n.innerHTML=t;const s=B.DOMParser.fromSchema(this.pmView.state.schema).parse(n,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new B.Slice(s.content,0,0),move:!0}});p(this,"onDragOver",o=>{var n;if(this.sideMenuDetection==="editor"||o.synthetic||!((n=o.dataTransfer)!=null&&n.types.includes("blocknote/html")))return;const t=this.pmView.posAtCoords({left:o.clientX,top:o.clientY});if(!t||t.inside===-1&&this.pmView.dom.firstChild){const r=this.createSyntheticEvent(o);this.pmView.dom.dispatchEvent(r)}});p(this,"onKeyDown",o=>{var t;(t=this.state)!=null&&t.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});p(this,"onMouseMove",o=>{var s;if(this.menuFrozen)return;this.mousePos={x:o.clientX,y:o.clientY};const t=this.pmView.dom.getBoundingClientRect(),n=this.mousePos.x>t.left&&this.mousePos.x<t.right&&this.mousePos.y>t.top&&this.mousePos.y<t.bottom,r=this.pmView.dom.parentElement;if(n&&o&&o.target&&!(r===o.target||r.contains(o.target))){(s=this.state)!=null&&s.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});p(this,"onScroll",()=>{var o;(o=this.state)!=null&&o.show&&(this.state.referencePos=this.hoveredBlock.getBoundingClientRect(),this.emitUpdate(this.state))});this.editor=o,this.sideMenuDetection=t,this.pmView=n,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized side menu");r(this.state)},this.pmView.root.addEventListener("dragstart",this.onDragStart),this.pmView.root.addEventListener("dragover",this.onDragOver),this.pmView.root.addEventListener("drop",this.onDrop,!0),this.pmView.root.addEventListener("dragend",this.onDragEnd,!0),Ue(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),n.root.addEventListener("scroll",this.onScroll,!0)}createSyntheticEvent(o){const t=new Event(o.type,o),n=this.pmView.dom.firstChild.getBoundingClientRect();return t.clientX=o.clientX,t.clientY=o.clientY,o.clientX<n.left&&o.clientX>n.left-n.width*ge?t.clientX=n.left+n.width*ge/2:o.clientX>n.right&&o.clientX<n.right+n.width*ge?t.clientX=n.right-n.width*ge/2:(o.clientX<n.left||o.clientX>n.right)&&(t.clientX=n.left+ge*n.width*2),t.clientY=Math.min(Math.max(o.clientY,n.top),n.top+n.height),t.dataTransfer=o.dataTransfer,t.preventDefault=()=>o.preventDefault(),t.synthetic=!0,t}update(o,t){var r;!t.doc.eq(this.pmView.state.doc)&&((r=this.state)!=null&&r.show)&&this.updateStateFromMousePos()}destroy(){var o;(o=this.state)!=null&&o.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.removeEventListener("dragstart",this.onDragStart),this.pmView.root.removeEventListener("dragover",this.onDragOver),this.pmView.root.removeEventListener("drop",this.onDrop,!0),this.pmView.root.removeEventListener("dragend",this.onDragEnd,!0),this.pmView.root.removeEventListener("keydown",this.onKeyDown,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0)}}const Dn=new y.PluginKey("SideMenuPlugin");class On extends Y{constructor(t,n){super();p(this,"view");p(this,"plugin");p(this,"blockDragStart",(t,n)=>{this.view&&(this.view.isDragOrigin=!0),Vi(t,n,this.editor)});p(this,"blockDragEnd",()=>{this.editor.prosemirrorView&&Nn(this.editor.prosemirrorView.root),this.view&&(this.view.isDragOrigin=!1)});p(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});p(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=t,this.plugin=new y.Plugin({key:Dn,view:r=>(this.view=new Hn(t,n,r,s=>{this.emit("update",s)}),this.view)})}onUpdate(t){return this.on("update",t)}}const Ui=k.findParentNode(e=>e.type.name==="blockContainer");class $i{constructor(o,t){p(this,"state");p(this,"emitUpdate");p(this,"rootEl");p(this,"pluginState");p(this,"handleScroll",()=>{var o,t;if((o=this.state)!=null&&o.show){const n=(t=this.rootEl)==null?void 0:t.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!n)return;this.state.referencePos=n.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});p(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ae,null))});p(this,"clearQuery",()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor._tiptapEditor.state.selection.from}).run()});var n,r;this.editor=o,this.pluginState=void 0,this.emitUpdate=s=>{var i;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");t(s,{...this.state,ignoreQueryLength:(i=this.pluginState)==null?void 0:i.ignoreQueryLength})},this.rootEl=(n=this.editor.prosemirrorView)==null?void 0:n.root,(r=this.rootEl)==null||r.addEventListener("scroll",this.handleScroll,!0)}update(o,t){var c;const n=ae.getState(t),r=ae.getState(o.state),s=n===void 0&&r!==void 0,i=n!==void 0&&r===void 0;if(!s&&!(n!==void 0&&r!==void 0)&&!i)return;if(this.pluginState=i?n:r,i||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}const l=(c=this.rootEl)==null?void 0:c.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&l&&(this.state={show:!0,referencePos:l.getBoundingClientRect(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var o;(o=this.rootEl)==null||o.removeEventListener("scroll",this.handleScroll,!0)}}const ae=new y.PluginKey("SuggestionMenuPlugin");class _n extends Y{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"triggerCharacters",[]);p(this,"addTriggerCharacter",t=>{this.triggerCharacters.push(t)});p(this,"removeTriggerCharacter",t=>{this.triggerCharacters=this.triggerCharacters.filter(n=>n!==t)});p(this,"closeMenu",()=>this.view.closeMenu());p(this,"clearQuery",()=>this.view.clearQuery());const n=this.triggerCharacters;this.plugin=new y.Plugin({key:ae,view:()=>(this.view=new $i(t,(r,s)=>{this.emit(`update ${r}`,s)}),this.view),state:{init(){},apply(r,s,i,a){if(r.getMeta("orderedListIndexing")!==void 0||r.selection.$from.parent.type.spec.code)return s;const l=r.getMeta(ae);if(typeof l=="object"&&l!==null&&s===void 0)return{triggerCharacter:l.triggerCharacter,deleteTriggerCharacter:l.deleteTriggerCharacter!==!1,queryStartPos:a.selection.from,query:"",decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:l==null?void 0:l.ignoreQueryLength};if(s===void 0)return s;if(a.selection.from!==a.selection.to||l===null||r.getMeta("focus")||r.getMeta("blur")||r.getMeta("pointer")||s.triggerCharacter!==void 0&&a.selection.from<s.queryStartPos)return;const c={...s};return c.query=a.doc.textBetween(s.queryStartPos,a.selection.from),c}},props:{handleTextInput(r,s,i,a){const l=this.getState(r.state);return n.includes(a)&&l===void 0?(r.dispatch(r.state.tr.insertText(a).scrollIntoView().setMeta(ae,{triggerCharacter:a})),!0):!1},decorations(r){const s=this.getState(r);if(s===void 0)return null;if(!s.deleteTriggerCharacter){const i=Ui(r.selection);if(i)return x.DecorationSet.create(r.doc,[x.Decoration.node(i.pos,i.pos+i.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":s.decorationId})])}return x.DecorationSet.create(r.doc,[x.Decoration.inline(s.queryStartPos-s.triggerCharacter.length,s.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":s.decorationId})])}}})}onUpdate(t,n){return this.triggerCharacters.includes(t)||this.addTriggerCharacter(t),this.on(`update ${t}`,n)}get shown(){var t,n;return((n=(t=this.view)==null?void 0:t.state)==null?void 0:n.show)||!1}}function zi(e,o){e.suggestionMenus.addTriggerCharacter(o)}let O;function $t(e){O||(O=document.createElement("div"),O.innerHTML="_",O.style.opacity="0",O.style.height="1px",O.style.width="1px",e instanceof Document?e.body.appendChild(O):e.appendChild(O))}function Wi(e){O&&(e instanceof Document?e.body.removeChild(O):e.removeChild(O),O=void 0)}function Te(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function qi(e){let o=e;for(;o&&o.nodeName!=="TD"&&o.nodeName!=="TH"&&!o.classList.contains("tableWrapper");){if(o.classList.contains("ProseMirror"))return;const t=o.parentNode;if(!t||!(t instanceof Element))return;o=t}return o.nodeName==="TD"||o.nodeName==="TH"?{type:"cell",domNode:o,tbodyNode:o.closest("tbody")}:{type:"wrapper",domNode:o,tbodyNode:o.querySelector("tbody")}}function ji(e,o){const t=o.querySelectorAll(e);for(let n=0;n<t.length;n++)t[n].style.visibility="hidden"}class Rn{constructor(o,t,n){p(this,"state");p(this,"emitUpdate");p(this,"tableId");p(this,"tablePos");p(this,"tableElement");p(this,"menuFrozen",!1);p(this,"mouseState","up");p(this,"prevWasEditable",null);p(this,"viewMousedownHandler",()=>{this.mouseState="down"});p(this,"mouseUpHandler",o=>{this.mouseState="up",this.mouseMoveHandler(o)});p(this,"mouseMoveHandler",o=>{var c,d,u,h,f,m,g;if(this.menuFrozen||this.mouseState==="selecting"||!(o.target instanceof Element)||!this.pmView.dom.contains(o.target))return;const t=qi(o.target);if((t==null?void 0:t.type)==="cell"&&this.mouseState==="down"&&!((c=this.state)!=null&&c.draggingState)){this.mouseState="selecting",(d=this.state)!=null&&d.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t||!this.editor.isEditable){(u=this.state)!=null&&u.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!t.tbodyNode)return;const n=t.tbodyNode.getBoundingClientRect(),r=An(t.domNode,this.pmView);if(!r)return;this.tableElement=r.node;let s;const i=_(r.id,this.editor._tiptapEditor.state.doc);if(!i)throw new Error(`Block with ID ${r.id} not found`);const a=T(i.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(rn("table",a,this.editor)&&(this.tablePos=i.posBeforeNode+1,s=a),!s)return;this.tableId=r.id;const l=(h=t.domNode.closest(".tableWrapper"))==null?void 0:h.querySelector(".table-widgets-container");if((t==null?void 0:t.type)==="wrapper"){const b=o.clientY>=n.bottom-1&&o.clientY<n.bottom+20,w=o.clientX>=n.right-1&&o.clientX<n.right+20,C=o.clientX>n.right||o.clientY>n.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:b,showAddOrRemoveColumnsButton:w,referencePosTable:n,block:s,widgetContainer:l,colIndex:C||(f=this.state)==null?void 0:f.colIndex,rowIndex:C||(m=this.state)==null?void 0:m.rowIndex,referencePosCell:C||(g=this.state)==null?void 0:g.referencePosCell}}else{const b=Te(t.domNode),w=Te(t.domNode.parentElement),C=t.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===w&&this.state.colIndex===b)return;this.state={show:!0,showAddOrRemoveColumnsButton:b===s.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:w===s.content.rows.length-1,referencePosTable:n,block:s,draggingState:void 0,referencePosCell:C,colIndex:b,rowIndex:w,widgetContainer:l}}return this.emitUpdate(),!1});p(this,"dragOverHandler",o=>{var h;if(((h=this.state)==null?void 0:h.draggingState)===void 0)return;o.preventDefault(),o.dataTransfer.dropEffect="move",ji(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const t={left:Math.min(Math.max(o.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(o.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(f=>f.tagName==="TD"||f.tagName==="TH");if(n.length===0)return;const r=n[0];let s=!1;const i=Te(r.parentElement),a=Te(r),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,d=(this.state.draggingState.draggedCellOrientation==="row"?i:a)!==l;(this.state.rowIndex!==i||this.state.colIndex!==a)&&(this.state.rowIndex=i,this.state.colIndex=a,this.state.referencePosCell=r.getBoundingClientRect(),s=!0);const u=this.state.draggingState.draggedCellOrientation==="row"?t.top:t.left;this.state.draggingState.mousePos!==u&&(this.state.draggingState.mousePos=u,s=!0),s&&this.emitUpdate(),d&&this.editor.dispatch(this.pmView.state.tr.setMeta(se,!0))});p(this,"dropHandler",o=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw new Error("Attempted to drop table row or column, but no table block was hovered prior.");o.preventDefault();const{draggingState:t,colIndex:n,rowIndex:r}=this.state,s=this.state.block.content.columnWidths;if(t.draggedCellOrientation==="row"){if(!no(this.state.block,t.originalIndex,r))return!1;const i=Pr(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,rows:i}})}else{if(!ro(this.state.block,t.originalIndex,n))return!1;const i=Mr(this.state.block,t.originalIndex,n),[a]=s.splice(t.originalIndex,1);s.splice(n,0,a),this.editor.updateBlock(this.state.block,{type:"table",content:{...this.state.block.content,columnWidths:s,rows:i}})}return this.editor.setTextCursorPosition(this.state.block.id),!0});this.editor=o,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");n(this.state)},t.dom.addEventListener("mousemove",this.mouseMoveHandler),t.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),t.root.addEventListener("dragover",this.dragOverHandler),t.root.addEventListener("drop",this.dropHandler)}update(){var r;if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||!((r=this.tableElement)!=null&&r.isConnected)){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const{height:o,width:t}=ft(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=o&&(this.state.rowIndex=o-1),this.state.colIndex>=t&&(this.state.colIndex=t-1));const n=this.tableElement.querySelector("tbody");if(!n)throw new Error("Table block does not contain a 'tbody' HTML element. This should never happen.");if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){const i=n.children[this.state.rowIndex].children[this.state.colIndex];i?this.state.referencePosCell=i.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=n.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener("mousemove",this.mouseMoveHandler),window.removeEventListener("mouseup",this.mouseUpHandler),this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.root.removeEventListener("dragover",this.dragOverHandler),this.pmView.root.removeEventListener("drop",this.dropHandler)}}const se=new y.PluginKey("TableHandlesPlugin");class Vn extends Y{constructor(t){super();p(this,"view");p(this,"plugin");p(this,"colDragStart",t=>{if(this.view.state===void 0||this.view.state.colIndex===void 0)throw new Error("Attempted to drag table column, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"col",originalIndex:this.view.state.colIndex,mousePos:t.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(se,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.colIndex,newIndex:this.view.state.colIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");$t(this.editor.prosemirrorView.root),t.dataTransfer.setDragImage(O,0,0),t.dataTransfer.effectAllowed="move"});p(this,"rowDragStart",t=>{if(this.view.state===void 0||this.view.state.rowIndex===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState={draggedCellOrientation:"row",originalIndex:this.view.state.rowIndex,mousePos:t.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(se,{draggedCellOrientation:this.view.state.draggingState.draggedCellOrientation,originalIndex:this.view.state.rowIndex,newIndex:this.view.state.rowIndex,tablePos:this.view.tablePos})),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");$t(this.editor.prosemirrorView.root),t.dataTransfer.setDragImage(O,0,0),t.dataTransfer.effectAllowed="copyMove"});p(this,"dragEnd",()=>{if(this.view.state===void 0)throw new Error("Attempted to drag table row, but no table block was hovered prior.");if(this.view.state.draggingState=void 0,this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(se,null)),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Wi(this.editor.prosemirrorView.root)});p(this,"freezeHandles",()=>{this.view.menuFrozen=!0});p(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});p(this,"getCellsAtRowHandle",(t,n)=>Ze(t,n));p(this,"getCellsAtColumnHandle",(t,n)=>Qe(t,n));p(this,"setCellSelection",(t,n=t)=>{const r=this.view;if(!r)throw new Error("Table handles view not initialized");const s=this.editor.prosemirrorState,i=s.doc.resolve(r.tablePos+1),a=s.doc.resolve(i.posAtIndex(t.row)+1),l=s.doc.resolve(a.posAtIndex(t.col)),c=s.doc.resolve(i.posAtIndex(n.row)+1),d=s.doc.resolve(c.posAtIndex(n.col)),u=s.tr;return u.setSelection(new P.CellSelection(l,d)),s.apply(u)});p(this,"addRowOrColumn",(t,n)=>{const r=this.setCellSelection(n.orientation==="row"?{row:t,col:0}:{row:0,col:t});return n.orientation==="row"?n.side==="above"?P.addRowBefore(r,this.editor.dispatch):P.addRowAfter(r,this.editor.dispatch):n.side==="left"?P.addColumnBefore(r,this.editor.dispatch):P.addColumnAfter(r,this.editor.dispatch)});p(this,"removeRowOrColumn",(t,n)=>{const r=this.setCellSelection(n==="row"?{row:t,col:0}:{row:0,col:t});return n==="row"?P.deleteRow(r,this.editor.dispatch):P.deleteColumn(r,this.editor.dispatch)});p(this,"mergeCells",t=>{const n=t?this.setCellSelection(t.relativeStartCell,t.relativeEndCell):this.editor.prosemirrorState;return P.mergeCells(n,this.editor.dispatch)});p(this,"splitCell",t=>{const n=t?this.setCellSelection(t):this.editor.prosemirrorState;return P.splitCell(n,this.editor.dispatch)});p(this,"getCellSelection",()=>{const t=this.editor.prosemirrorState,n=t.selection;let r=n.$from,s=n.$to;if(rt(n)){const{ranges:m}=n;m.forEach(g=>{r=g.$from.min(r??g.$from),s=g.$to.max(s??g.$to)})}else if(r=t.doc.resolve(n.$from.pos-n.$from.parentOffset-1),s=t.doc.resolve(n.$to.pos-n.$to.parentOffset-1),r.pos===0||s.pos===0)return;const i=t.doc.resolve(r.pos-r.parentOffset-1),a=t.doc.resolve(s.pos-s.parentOffset-1),l=t.doc.resolve(i.pos-i.parentOffset-1),c=r.index(i.depth),d=i.index(l.depth),u=s.index(a.depth),h=a.index(l.depth),f=[];for(let m=d;m<=h;m++)for(let g=c;g<=u;g++)f.push({row:m,col:g});return{from:{row:d,col:c},to:{row:h,col:u},cells:f}});p(this,"getMergeDirection",t=>{const n=rt(this.editor.prosemirrorState.selection)?this.editor.prosemirrorState.selection:void 0;if(!n||!t||n.ranges.length<=1)return;const r=this.getCellSelection();if(r)return Ar(r.from,r.to,t)?"vertical":"horizontal"});p(this,"cropEmptyRowsOrColumns",(t,n)=>Ir(t,n));p(this,"addRowsOrColumns",(t,n,r)=>Lr(t,n,r));this.editor=t,this.plugin=new y.Plugin({key:se,view:n=>(this.view=new Rn(t,n,r=>{this.emit("update",r)}),this.view),props:{decorations:n=>{if(this.view===void 0||this.view.state===void 0||this.view.state.draggingState===void 0||this.view.tablePos===void 0)return;const r=this.view.state.draggingState.draggedCellOrientation==="row"?this.view.state.rowIndex:this.view.state.colIndex;if(r===void 0)return;const s=[],{block:i,draggingState:a}=this.view.state,{originalIndex:l,draggedCellOrientation:c}=a;if(r===l||!i||c==="row"&&!no(i,l,r)||c==="col"&&!ro(i,l,r))return x.DecorationSet.create(n.doc,s);const d=n.doc.resolve(this.view.tablePos+1);return this.view.state.draggingState.draggedCellOrientation==="row"?Ze(this.view.state.block,r).forEach(({row:h,col:f})=>{const m=n.doc.resolve(d.posAtIndex(h)+1),g=n.doc.resolve(m.posAtIndex(f)+1),b=g.node(),w=g.pos+(r>l?b.nodeSize-2:0);s.push(x.Decoration.widget(w,()=>{const C=document.createElement("div");return C.className="bn-table-drop-cursor",C.style.left="0",C.style.right="0",r>l?C.style.bottom="-2px":C.style.top="-3px",C.style.height="4px",C}))}):Qe(this.view.state.block,r).forEach(({row:h,col:f})=>{const m=n.doc.resolve(d.posAtIndex(h)+1),g=n.doc.resolve(m.posAtIndex(f)+1),b=g.node(),w=g.pos+(r>l?b.nodeSize-2:0);s.push(x.Decoration.widget(w,()=>{const C=document.createElement("div");return C.className="bn-table-drop-cursor",C.style.top="0",C.style.bottom="0",r>l?C.style.right="-2px":C.style.left="-3px",C.style.width="4px",C}))}),x.DecorationSet.create(n.doc,s)}}})}onUpdate(t){return this.on("update",t)}}const Ki=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem","tableCell","tableHeader"],attributes:{textAlignment:{default:"left",parseHTML:e=>e.getAttribute("data-text-alignment"),renderHTML:e=>e.textAlignment==="left"?{}:{"data-text-alignment":e.textAlignment}}}}]}}),Gi=k.Extension.create({name:"blockTextColor",addGlobalAttributes(){return[{types:["blockContainer","tableCell","tableHeader"],attributes:{textColor:{default:M.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):M.textColor.default,renderHTML:e=>e.textColor===M.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),Xi=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new y.PluginKey(this.name);return[new y.Plugin({key:e,appendTransaction:(o,t,n)=>{const{doc:r,tr:s,schema:i}=n,a=e.getState(n),l=r.content.size-2,c=i.nodes.blockContainer,d=i.nodes.paragraph;if(a)return s.insert(l,c.create(void 0,d.create()))},state:{init:(o,t)=>{},apply:(o,t)=>{if(!o.docChanged)return t;let n=o.doc.lastChild;if(!n||n.type.name!=="blockGroup")throw new Error("Expected blockGroup");if(n=n.lastChild,!n||n.type.name!=="blockContainer")return!0;const r=n.firstChild;if(!r)throw new Error("Expected blockContent");return n.nodeSize>4||r.type.spec.content!=="inline*"}}})]}}),Ji={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Yi=k.Node.create({name:"blockContainer",group:"blockGroupChild bnBlock",content:"blockContent blockGroup?",priority:50,defining:!0,parseHTML(){return[{tag:"div",getAttrs:e=>{if(typeof e=="string")return!1;const o={};for(const[t,n]of Object.entries(Ji))e.getAttribute(n)&&(o[t]=e.getAttribute(n));return e.getAttribute("data-node-type")==="blockContainer"?o:!1}}]},renderHTML({HTMLAttributes:e}){var r;const o=document.createElement("div");o.className="bn-block-outer",o.setAttribute("data-node-type","blockOuter");for(const[s,i]of Object.entries(e))s!=="class"&&o.setAttribute(s,i);const t={...((r=this.options.domAttributes)==null?void 0:r.block)||{},...e},n=document.createElement("div");n.className=X("bn-block",t.class),n.setAttribute("data-node-type",this.name);for(const[s,i]of Object.entries(t))s!=="class"&&n.setAttribute(s,i);return o.appendChild(n),{dom:o,contentDOM:n}}}),Zi=k.Node.create({name:"blockGroup",group:"childContainer",content:"blockGroupChild+",parseHTML(){return[{tag:"div",getAttrs:e=>typeof e=="string"?!1:e.getAttribute("data-node-type")==="blockGroup"?null:!1}]},renderHTML({HTMLAttributes:e}){var n;const o={...((n=this.options.domAttributes)==null?void 0:n.blockGroup)||{},...e},t=document.createElement("div");t.className=X("bn-block-group",o.class),t.setAttribute("data-node-type","blockGroup");for(const[r,s]of Object.entries(o))r!=="class"&&t.setAttribute(r,s);return{dom:t,contentDOM:t}}}),Qi=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),Fn=e=>{const o={},t=ea(e);for(const r of t)o[r.name]=r;o.formattingToolbar=new Tn(e.editor),o.linkToolbar=new Pn(e.editor),o.sideMenu=new On(e.editor,e.sideMenuDetection),o.suggestionMenus=new _n(e.editor),o.filePanel=new Sn(e.editor),o.placeholder=new Hi(e.editor,e.placeholders),(e.animations??!0)&&(o.animations=new Oi),e.tableHandles&&(o.tableHandles=new Vn(e.editor)),o.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},o.nodeSelectionKeyboard=new Ai,o.showSelection=new _i(e.editor),e.comments&&(o.comments=new Bi(e.editor,e.comments.threadStore,Cn.name));const n=e.disableExtensions||[];for(const r of n)delete o[r];return o};let zt=!1;const ea=e=>{const o=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,ir.Gapcursor,pe.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),Ti,cr.Text,lr.Link.extend({inclusive:!1}).configure({defaultProtocol:Ln,protocols:zt?[]:In}),...Object.values(e.styleSpecs).map(t=>t.implementation.mark.configure({editor:e.editor})),Gi,yi,Ki,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Qi,Yi.configure({editor:e.editor,domAttributes:e.domAttributes}),Pi.configure({editor:e.editor,tabBehavior:e.tabBehavior}),Zi.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(t=>t.config!=="link"&&t.config!=="text").map(t=>t.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(t=>[...(t.implementation.requiredExtensions||[]).map(n=>n.configure({editor:e.editor,domAttributes:e.domAttributes})),t.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),wi(e.editor),bi(e.editor,e.pasteHandler||(t=>t.defaultPasteHandler())),ei(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[Xi]:[],...e.comments?[Cn]:[]];return zt=!0,e.collaboration?o.push(...Ci(e.collaboration)):o.push(ar.History),o};function ta(e,o){const t=[];return e.forEach((n,r,s)=>{s!==o&&t.push(n)}),B.Fragment.from(t)}function oa(e,o){const t=[];for(let n=0;n<e.childCount;n++)if(e.child(n).type.name==="tableRow")if(t.length>0&&t[t.length-1].type.name==="table"){const r=t[t.length-1],s=r.copy(r.content.addToEnd(e.child(n)));t[t.length-1]=s}else{const r=o.nodes.table.createChecked(void 0,e.child(n));t.push(r)}else t.push(e.child(n));return e=B.Fragment.from(t),e}function na(e,o){let t=B.Fragment.from(e.content);if(t=oa(t,o.state.schema),!ra(t,o))return new B.Slice(t,e.openStart,e.openEnd);for(let n=0;n<t.childCount;n++)if(t.child(n).type.spec.group==="blockContent"){const r=[t.child(n)];if(n+1<t.childCount&&t.child(n+1).type.name==="blockGroup"){const i=t.child(n+1).child(0).child(0);(i.type.name==="bulletListItem"||i.type.name==="numberedListItem"||i.type.name==="checkListItem")&&(r.push(t.child(n+1)),t=ta(t,n+1))}const s=o.state.schema.nodes.blockContainer.createChecked(void 0,r);t=t.replaceChild(n,s)}return new B.Slice(t,e.openStart,e.openEnd)}function ra(e,o){var s,i;const t=e.childCount===1,n=((s=e.firstChild)==null?void 0:s.type.spec.content)==="inline*",r=((i=e.firstChild)==null?void 0:i.type.spec.content)==="tableRow+";if(t){if(n)return!1;if(r){const a=v(o.state);if(a.isBlockContainer)return!(a.blockContent.node.type.spec.content==="tableRow+")}}return!0}const De=class De extends k.Editor{constructor(t,n){super({...t,content:void 0});p(this,"_state");p(this,"mount",(t,n,r)=>{n?(this.options.element=n,this.createViewAlternative(t,r)):this.destroy()});const r=this.schema;let s;const i=r.nodes.doc.createAndFill;r.nodes.doc.createAndFill=(...l)=>{if(s)return s;const c=i.apply(r.nodes.doc,l),d=JSON.parse(JSON.stringify(c.toJSON()));return d.content[0].content[0].attrs.id="initialBlockId",s=B.Node.fromJSON(r,d),s};let a;try{const l=t==null?void 0:t.content.map(c=>te(c,this.schema,n).toJSON());a=k.createDocument({type:"doc",content:[{type:"blockGroup",content:l}]},this.schema,this.options.parseOptions)}catch(l){throw console.error("Error creating document from blocks passed as `initialContent`. Caused by exception: ",l),new Error("Error creating document from blocks passed as `initialContent`:\n"+ +JSON.stringify(t.content))}this._state=y.EditorState.create({doc:a,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(t){this.view?this.view.dispatch(t):this._state=this.state.apply(t)}createViewAlternative(t,n){this.contentComponent=n;const r={};this.extensionManager.extensions.forEach(i=>{i.type==="mark"&&i.config.addMarkView&&(r[i.name]=i.config.addMarkView(t))}),this.view=new x.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state,markViews:r,nodeViews:this.extensionManager.nodeViews});const s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.commands.focus(this.options.autofocus||this.options.element.getAttribute("data-bn-autofocus")==="true",{scrollIntoView:!1}),this.emit("create",{editor:this}),this.isInitialized=!0}};p(De,"create",(t,n)=>{var s,i;const r=(s=globalThis==null?void 0:globalThis.window)==null?void 0:s.setTimeout;typeof((i=globalThis==null?void 0:globalThis.window)==null?void 0:i.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new De(t,n)}finally{r&&(globalThis.window.setTimeout=r)}});let He=De;He.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const sa={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class Bt extends Y{constructor(t){var c,d,u,h,f,m,g,b,w,C,S,A,W,q,I;super();p(this,"pmSchema");p(this,"extensions",{});p(this,"headless",!1);p(this,"_tiptapEditor");p(this,"elementRenderer",null);p(this,"blockCache",new WeakMap);p(this,"dictionary");p(this,"schema");p(this,"blockImplementations");p(this,"inlineContentImplementations");p(this,"styleImplementations");p(this,"formattingToolbar");p(this,"linkToolbar");p(this,"sideMenu");p(this,"suggestionMenus");p(this,"filePanel");p(this,"tableHandles");p(this,"comments");p(this,"showSelectionPlugin");p(this,"uploadFile");p(this,"onUploadStartCallbacks",[]);p(this,"onUploadEndCallbacks",[]);p(this,"resolveFileUrl");p(this,"resolveUsers");p(this,"settings");p(this,"dispatch",t=>{this._tiptapEditor.dispatch(t)});p(this,"mount",(t,n)=>{this._tiptapEditor.mount(this,t,n)});this.options=t;const n=t;if(n.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(n.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(n.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(n.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||hr.en,this.settings={tables:{splitCells:((c=t==null?void 0:t.tables)==null?void 0:c.splitCells)??!1,cellBackgroundColor:((d=t==null?void 0:t.tables)==null?void 0:d.cellBackgroundColor)??!1,cellTextColor:((u=t==null?void 0:t.tables)==null?void 0:u.cellTextColor)??!1,headers:((h=t==null?void 0:t.tables)==null?void 0:h.headers)??!1},codeBlock:{indentLineWithTab:((f=t==null?void 0:t.codeBlock)==null?void 0:f.indentLineWithTab)??!0,defaultLanguage:((m=t==null?void 0:t.codeBlock)==null?void 0:m.defaultLanguage)??"text",supportedLanguages:((g=t==null?void 0:t.codeBlock)==null?void 0:g.supportedLanguages)??{},createHighlighter:((b=t==null?void 0:t.codeBlock)==null?void 0:b.createHighlighter)??void 0}};const r={defaultStyles:!0,schema:t.schema||me.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(r.comments&&!r.resolveUsers)throw new Error("resolveUsers is required when using comments");if(this.resolveUsers=r.resolveUsers,this.schema=r.schema,this.blockImplementations=r.schema.blockSpecs,this.inlineContentImplementations=r.schema.inlineContentSpecs,this.styleImplementations=r.schema.styleSpecs,this.extensions=Fn({editor:this,domAttributes:r.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:r.collaboration,trailingBlock:r.trailingBlock,disableExtensions:r.disableExtensions,setIdAttribute:r.setIdAttribute,animations:r.animations??!0,tableHandles:H("table",this),dropCursor:this.options.dropCursor??pr.dropCursor,placeholders:r.placeholders,tabBehavior:r.tabBehavior,sideMenuDetection:r.sideMenuDetection||"viewport",comments:r.comments,pasteHandler:r.pasteHandler}),(((w=r._tiptapOptions)==null?void 0:w.extensions)||[]).forEach(E=>{this.extensions[E.name]=E}),Object.entries(r._extensions||{}).forEach(([E,D])=>{typeof D=="function"&&(D=D(this)),this.extensions[E]=D}),this.formattingToolbar=this.extensions.formattingToolbar,this.linkToolbar=this.extensions.linkToolbar,this.sideMenu=this.extensions.sideMenu,this.suggestionMenus=this.extensions.suggestionMenus,this.filePanel=this.extensions.filePanel,this.tableHandles=this.extensions.tableHandles,this.comments=this.extensions.comments,this.showSelectionPlugin=this.extensions.showSelection,r.uploadFile){const E=r.uploadFile;this.uploadFile=async(D,re)=>{this.onUploadStartCallbacks.forEach(ze=>ze.apply(this,[re]));try{return await E(D,re)}finally{this.onUploadEndCallbacks.forEach(ze=>ze.apply(this,[re]))}}}this.resolveFileUrl=r.resolveFileUrl,this.headless=r._headless;const s="collaboration"in this.extensions||"liveblocksExtension"in this.extensions;s&&r.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const i=r.initialContent||(s?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:pe.options.generateID()}]);if(!Array.isArray(i)||i.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+i);const a=[...Object.entries(this.extensions).map(([E,D])=>{if(D instanceof k.Extension||D instanceof k.Node||D instanceof k.Mark)return D;if(!D.plugin)throw new Error("Extension should either be a TipTap extension or a ProseMirror plugin in a plugin property");return k.Extension.create({name:E,addProseMirrorPlugins:()=>[D.plugin]})})],l={...sa,...r._tiptapOptions,content:i,extensions:a,editorProps:{...(C=r._tiptapOptions)==null?void 0:C.editorProps,attributes:{tabIndex:"0",...(A=(S=r._tiptapOptions)==null?void 0:S.editorProps)==null?void 0:A.attributes,...(W=r.domAttributes)==null?void 0:W.editor,class:X("bn-editor",r.defaultStyles?"bn-default-styles":"",((I=(q=r.domAttributes)==null?void 0:q.editor)==null?void 0:I.class)||"")},transformPasted:na}};this.headless?this.pmSchema=k.getSchema(l.extensions):(this._tiptapEditor=He.create(l,this.schema.styleSchema),this.pmSchema=this._tiptapEditor.schema),this.emit("create")}static create(t={}){return new Bt(t)}get prosemirrorView(){return this._tiptapEditor.view}get prosemirrorState(){return this._tiptapEditor.state}get domElement(){var t;return(t=this.prosemirrorView)==null?void 0:t.dom}isFocused(){var t;return((t=this.prosemirrorView)==null?void 0:t.hasFocus())||!1}focus(){var t;(t=this.prosemirrorView)==null||t.focus()}onUploadStart(t){return this.onUploadStartCallbacks.push(t),()=>{const n=this.onUploadStartCallbacks.indexOf(t);n>-1&&this.onUploadStartCallbacks.splice(n,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const n=this.onUploadEndCallbacks.indexOf(t);n>-1&&this.onUploadEndCallbacks.splice(n,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this.prosemirrorState.doc.firstChild.descendants(n=>(t.push(T(n,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){return Os(this,t)}getPrevBlock(t){return _s(this,t)}getNextBlock(t){return Rs(this,t)}getParentBlock(t){return Vs(this,t)}forEachBlock(t,n=!1){const r=this.document.slice();n&&r.reverse();function s(i){for(const a of i){if(t(a)===!1)return!1;const l=n?a.children.slice().reverse():a.children;if(!s(l))return!1}return!0}s(r)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return zs(this)}setTextCursorPosition(t,n="start"){fn(this,t,n)}getSelection(){return Us(this)}setSelection(t,n){$s(this,t,n)}get isEditable(){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return!1}return this._tiptapEditor.isEditable===void 0?!0:this._tiptapEditor.isEditable}set isEditable(t){if(!this._tiptapEditor){if(!this.headless)throw new Error("no editor, but also not headless?");return}this._tiptapEditor.options.editable!==t&&this._tiptapEditor.setEditable(t)}insertBlocks(t,n,r="before"){return Bs(this,t,n,r)}updateBlock(t,n){return io(this,t,n)}removeBlocks(t){return Ds(this,t)}replaceBlocks(t,n){return Hs(this,t,n)}insertInlineContent(t){const n=R(t,this.pmSchema,this.schema.styleSchema);Fs({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},n,this)}getActiveStyles(){const t={},n=this._tiptapEditor.state.selection.$to.marks();for(const r of n){const s=this.schema.styleSchema[r.type.name];if(!s){r.type.name!=="link"&&!r.type.spec.blocknoteIgnore&&console.warn("mark not found in styleschema",r.type.name);continue}s.propSchema==="boolean"?t[s.type]=!0:t[s.type]=r.attrs.stringValue}return t}addStyles(t){for(const[n,r]of Object.entries(t)){const s=this.schema.styleSchema[n];if(!s)throw new Error(`style ${n} not found in styleSchema`);if(s.propSchema==="boolean")this._tiptapEditor.commands.setMark(n);else if(s.propSchema==="string")this._tiptapEditor.commands.setMark(n,{stringValue:r});else throw new F(s.propSchema)}}removeStyles(t){for(const n of Object.keys(t))this._tiptapEditor.commands.unsetMark(n)}toggleStyles(t){for(const[n,r]of Object.entries(t)){const s=this.schema.styleSchema[n];if(!s)throw new Error(`style ${n} not found in styleSchema`);if(s.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(n);else if(s.propSchema==="string")this._tiptapEditor.commands.toggleMark(n,{stringValue:r});else throw new F(s.propSchema)}}getSelectedText(){return this._tiptapEditor.state.doc.textBetween(this._tiptapEditor.state.selection.from,this._tiptapEditor.state.selection.to)}getSelectedLinkUrl(){return this._tiptapEditor.getAttributes("link").href}createLink(t,n){if(t==="")return;const{from:r,to:s}=this._tiptapEditor.state.selection,i=this.pmSchema.mark("link",{href:t});this.dispatch(n?this._tiptapEditor.state.tr.insertText(n,r,s).addMark(r,r+n.length,i):this._tiptapEditor.state.tr.setSelection(y.TextSelection.create(this._tiptapEditor.state.tr.doc,s)).addMark(r,s,i))}canNestBlock(){return As(this)}nestBlock(){pn(this)}canUnnestBlock(){return Ns(this)}unnestBlock(){Ls(this)}moveBlocksUp(){Ms(this)}moveBlocksDown(){Ps(this)}async blocksToHTMLLossy(t=this.document){return ve(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return ho(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return vt(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return mn(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return bn(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}updateCollaborationUserInfo(t){if(!this.options.collaboration)throw new Error("Cannot update collaboration user info when collaboration is disabled.");this._tiptapEditor.commands.updateUser(t)}onChange(t){if(this.headless)return;const n=()=>{t(this)};return this._tiptapEditor.on("update",n),()=>{this._tiptapEditor.off("update",n)}}onSelectionChange(t,n){if(this.headless)return;const r=s=>{s.transaction.getMeta(Ge.ySyncPluginKey)&&!n||t(this)};return this._tiptapEditor.on("selectionUpdate",r),()=>{this._tiptapEditor.off("selectionUpdate",r)}}onCreate(t){return this.on("create",t),()=>{this.off("create",t)}}getSelectionBoundingBox(){var a;if(!this.prosemirrorView)return;const t=(a=this.prosemirrorView)==null?void 0:a.state,{selection:n}=t,{ranges:r}=n,s=Math.min(...r.map(l=>l.$from.pos)),i=Math.max(...r.map(l=>l.$to.pos));if(k.isNodeSelection(n)){const l=this.prosemirrorView.nodeDOM(s);if(l)return l.getBoundingClientRect()}return k.posToDOMRect(this.prosemirrorView,s,i)}get isEmpty(){const t=this.document;return t.length===0||t.length===1&&t[0].type==="paragraph"&&t[0].content.length===0}openSuggestionMenu(t,n){var i;const r=(i=this.prosemirrorView)==null?void 0:i.state.tr;if(!r)return;const s=n&&n.deleteTriggerCharacter?r.insertText(t):r;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(s.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(n==null?void 0:n.deleteTriggerCharacter)||!1,ignoreQueryLength:(n==null?void 0:n.ignoreQueryLength)||!1}))}getForceSelectionVisible(){return this.showSelectionPlugin.getEnabled()}setForceSelectionVisible(t){this.showSelectionPlugin.setEnabled(t)}convertHtmlToBlockNoteHtml(t){return gn(t.trim()).innerHTML}pasteHTML(t,n=!1){var s;let r=t;n||(r=this.convertHtmlToBlockNoteHtml(t)),r&&((s=this.prosemirrorView)==null||s.pasteHTML(r))}pasteText(t){var n;return(n=this.prosemirrorView)==null?void 0:n.pasteText(t)}async pasteMarkdown(t){return this.pasteHTML(await St(t))}}const ia={gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}},aa={gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}};class la{constructor(o,t,n){this.mappings=t,this.options=n}async resolveFile(o){var n;if(!((n=this.options)!=null&&n.resolveFileUrl))return(await fetch(o)).blob();const t=await this.options.resolveFileUrl(o);return t instanceof Blob?t:(await fetch(t)).blob()}mapStyles(o){return Object.entries(o).map(([n,r])=>this.mappings.styleMapping[n](r,this))}mapInlineContent(o){return this.mappings.inlineContentMapping[o.type](o,this)}transformInlineContent(o){return o.map(t=>this.mapInlineContent(t))}async mapBlock(o,t,n){return this.mappings.blockMapping[o.type](o,this,t,n)}}function ca(e){return{createBlockMapping:o=>o,createInlineContentMapping:o=>o,createStyleMapping:o=>o}}let xe;async function da(){return xe||(xe=(async()=>{const[e,o]=await Promise.all([import("emoji-mart"),import("@emoji-mart/data")]),t="default"in e?e.default:e,n="default"in o?o.default:o;return await t.init({data:n}),{emojiMart:t,emojiData:n}})(),xe)}async function ua(e,o){if(!nn("text",e))return[];const{emojiData:t,emojiMart:n}=await da();return(o.trim()===""?Object.values(t.emojis):await n.SearchIndex.search(o)).map(s=>({id:s.skins[0].native,onItemClick:()=>e.insertInlineContent(s.skins[0].native+" ")}))}function pa(e,...o){const t=[...e];for(const n of o)for(const r of n){const s=t.findLastIndex(i=>i.group===r.group);s===-1?t.push(r):t.splice(s+1,0,r)}return t}function Ke(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function le(e){var o,t,n,r,s;return typeof e=="string"?Ke(e):Array.isArray(e)?e.flatMap(i=>typeof i=="string"?Ke(i):_e(i)?{...i,content:Ke(i.content)}:G(i)?i:{props:{},...i,content:le(i.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,headerRows:e.headerRows,headerCols:e.headerCols,rows:e.rows.map(i=>({...i,cells:i.cells.map(a=>le(a))}))}:(e==null?void 0:e.type)==="tableCell"?{type:"tableCell",content:le(e.content),props:{backgroundColor:((o=e.props)==null?void 0:o.backgroundColor)??"default",textColor:((t=e.props)==null?void 0:t.textColor)??"default",textAlignment:((n=e.props)==null?void 0:n.textAlignment)??"left",colspan:((r=e.props)==null?void 0:r.colspan)??1,rowspan:((s=e.props)==null?void 0:s.rowspan)??1}}:e}function ha(e,o){return o.map(t=>Tt(e.blockSchema,t))}function Tt(e,o){var r;const t=e[o.type].content,n={id:"",type:o.type,props:{},content:t==="inline"?[]:t==="table"?{type:"tableContent",columnWidths:void 0,headerRows:void 0,headerCols:void 0,rows:[]}:void 0,children:[],...o};if(Object.entries(e[o.type].propSchema).forEach(([s,i])=>{n.props[s]===void 0&&i.default!==void 0&&(n.props[s]=i.default)}),t==="inline"){const s=n.content;n.content=le(s)}else if(t==="table"){const s=n.content;n.content={type:"tableContent",columnWidths:(s==null?void 0:s.columnWidths)||((r=s==null?void 0:s.rows[0])==null?void 0:r.cells.map(()=>{}))||[],headerRows:(s==null?void 0:s.headerRows)||void 0,headerCols:(s==null?void 0:s.headerCols)||void 0,rows:(s==null?void 0:s.rows.map(i=>({cells:i.cells.map(a=>le(a))})))||[]}}return{...n,content:le(n.content),children:n.children.map(s=>Tt(e,s))}}function Un(e){e.id||(e.id=pe.options.generateID()),e.children&&$n(e.children)}function $n(e){for(const o of e)Un(o)}exports.AudioBlock=So;exports.BlockNoteEditor=Bt;exports.BlockNoteSchema=me;exports.COLORS_DARK_MODE_DEFAULT=aa;exports.COLORS_DEFAULT=ia;exports.CodeBlock=Bo;exports.DEFAULT_LINK_PROTOCOL=Ln;exports.EMPTY_CELL_HEIGHT=cs;exports.EMPTY_CELL_WIDTH=bt;exports.Exporter=la;exports.FILE_AUDIO_ICON_SVG=bo;exports.FILE_ICON_SVG=mo;exports.FILE_IMAGE_ICON_SVG=Ao;exports.FILE_VIDEO_ICON_SVG=Go;exports.FileBlock=Lo;exports.FilePanelProsemirrorPlugin=Sn;exports.FilePanelView=vn;exports.FormattingToolbarProsemirrorPlugin=Tn;exports.FormattingToolbarView=En;exports.HTMLToBlocks=vt;exports.ImageBlock=Ro;exports.LinkToolbarProsemirrorPlugin=Pn;exports.PageBreak=zo;exports.SideMenuProsemirrorPlugin=On;exports.SideMenuView=Hn;exports.SuggestionMenuProseMirrorPlugin=_n;exports.TableHandlesProsemirrorPlugin=Vn;exports.TableHandlesView=Rn;exports.UniqueID=pe;exports.UnreachableCaseError=F;exports.VALID_LINK_PROTOCOLS=In;exports.VideoBlock=en;exports.addIdsToBlock=Un;exports.addIdsToBlocks=$n;exports.addInlineContentAttributes=Ye;exports.addInlineContentKeyboardShortcuts=Xt;exports.addStyleAttributes=eo;exports.applyNonSelectableBlockFix=Kt;exports.assertEmpty=Cr;exports.audioBlockConfig=wo;exports.audioParse=Co;exports.audioPropSchema=ko;exports.audioRender=yo;exports.audioToExternalHTML=vo;exports.blockToNode=te;exports.blocksToMarkdown=mn;exports.camelToDataKebab=ke;exports.checkBlockHasDefaultProp=ws;exports.checkBlockIsDefaultType=rn;exports.checkBlockIsFileBlock=gs;exports.checkBlockIsFileBlockWithPlaceholder=ks;exports.checkBlockIsFileBlockWithPreview=bs;exports.checkBlockTypeHasDefaultProp=sn;exports.checkDefaultBlockTypeInSchema=H;exports.checkDefaultInlineContentTypeInSchema=nn;exports.checkPageBreakBlocksInSchema=an;exports.cleanHTMLToMarkdown=$e;exports.combineByGroup=pa;exports.contentNodeToInlineContent=ye;exports.contentNodeToTableContent=dt;exports.createAddFileButton=fo;exports.createBlockSpec=fe;exports.createBlockSpecFromStronglyTypedTiptapNode=J;exports.createDefaultBlockDOMOutputSpec=$;exports.createExternalHTMLExporter=ve;exports.createFigureWithCaption=Fe;exports.createFileBlockWrapper=Ve;exports.createFileNameWithIcon=go;exports.createInlineContentSpec=Tr;exports.createInlineContentSpecFromTipTapNode=Yt;exports.createInternalBlockSpec=lt;exports.createInternalHTMLSerializer=ho;exports.createInternalInlineContentSpec=Jt;exports.createInternalStyleSpec=pt;exports.createLinkWithCaption=Ee;exports.createResizableFileBlockWrapper=mt;exports.createStronglyTypedTiptapNode=z;exports.createStyleSpec=xr;exports.createStyleSpecFromTipTapMark=Z;exports.createSuggestionMenu=zi;exports.defaultBlockSchema=tn;exports.defaultBlockSpecs=kt;exports.defaultBlockToHTML=Je;exports.defaultCodeBlockPropSchema=Eo;exports.defaultInlineContentSchema=on;exports.defaultInlineContentSpecs=yt;exports.defaultProps=M;exports.defaultStyleSchema=ms;exports.defaultStyleSpecs=wt;exports.fileBlockConfig=xo;exports.fileParse=Po;exports.filePropSchema=To;exports.fileRender=Mo;exports.fileToExternalHTML=Io;exports.filenameFromURL=Br;exports.filterSuggestionItems=vs;exports.formatKeyboardShortcut=j;exports.formattingToolbarPluginKey=Bn;exports.getBlockFromPos=jt;exports.getBlockInfo=Q;exports.getBlockInfoFromResolvedPos=ue;exports.getBlockInfoFromSelection=v;exports.getBlockInfoWithManualOffset=Oe;exports.getBlockNoteExtensions=Fn;exports.getBlockSchemaFromSpecs=ct;exports.getColspan=de;exports.getDefaultEmojiPickerItems=ua;exports.getDefaultSlashMenuItems=Cs;exports.getInlineContentParseRules=Zt;exports.getInlineContentSchemaFromSpecs=ut;exports.getNearestBlockPos=K;exports.getNodeById=_;exports.getPageBreakSlashMenuItems=Es;exports.getParseRules=Gt;exports.getRowspan=Ae;exports.getStyleParseRules=to;exports.getStyleSchemaFromSpecs=ht;exports.imageBlockConfig=Ho;exports.imageParse=Oo;exports.imagePropSchema=No;exports.imageRender=Do;exports.imageToExternalHTML=_o;exports.inheritedProps=at;exports.initializeESMDependencies=Ue;exports.inlineContentToNodes=R;exports.insertOrUpdateBlock=N;exports.isAppleOS=qt;exports.isLinkInlineContent=Xe;exports.isPartialLinkInlineContent=_e;exports.isPartialTableCell=ce;exports.isSafari=Er;exports.isStyledTextInlineContent=G;exports.isTableCell=Re;exports.isTableCellSelection=rt;exports.linkToolbarPluginKey=Mn;exports.mapTableCell=Le;exports.mappingFactory=ca;exports.markdownToBlocks=bn;exports.markdownToHTML=St;exports.mergeCSSClasses=X;exports.nodeToBlock=T;exports.nodeToCustomInlineContent=Ne;exports.pageBreakConfig=Vo;exports.pageBreakParse=Uo;exports.pageBreakRender=Fo;exports.pageBreakSchema=Ct;exports.pageBreakToExternalHTML=$o;exports.parseEmbedElement=nt;exports.parseFigureElement=Se;exports.partialBlockToBlockForTesting=Tt;exports.partialBlocksToBlocksForTesting=ha;exports.propsToAttributes=he;exports.shikiHighlighterPromiseSymbol=Me;exports.shikiParserSymbol=ot;exports.sideMenuPluginKey=Dn;exports.stylePropsToAttributes=Qt;exports.tableContentToNodes=Ce;exports.tableHandlesPluginKey=se;exports.updateBlock=io;exports.updateBlockCommand=L;exports.uploadToTmpFilesDotOrg_DEV_ONLY=Fr;exports.videoBlockConfig=Jo;exports.videoParse=Zo;exports.videoPropSchema=Xo;exports.videoRender=Yo;exports.videoToExternalHTML=Qo;exports.withPageBreak=Ss;exports.wrapInBlockStructure=be;
|
|
12
13
|
//# sourceMappingURL=blocknote.cjs.map
|