@blocknote/core 0.23.1 → 0.23.3
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.js +2819 -2500
- package/dist/blocknote.js.map +1 -1
- package/dist/blocknote.umd.cjs +6 -6
- package/dist/blocknote.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +2 -2
- package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +4 -2
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/external.html +1 -0
- package/src/api/exporters/html/__snapshots__/codeBlock/contains-newlines/internal.html +3 -0
- package/src/api/exporters/html/util/serializeBlocksInternalHTML.ts +6 -2
- package/src/api/exporters/markdown/__snapshots__/codeBlock/contains-newlines/markdown.md +4 -0
- package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +27 -0
- package/src/api/nodeConversions/blockToNode.ts +35 -9
- package/src/api/testUtil/cases/defaultSchema.ts +9 -0
- package/src/editor/BlockNoteExtensions.ts +4 -128
- package/src/editor/editor.css +19 -11
- package/src/extensions/Collaboration/createCollaborationExtensions.ts +151 -0
- package/src/extensions/SideMenu/SideMenuPlugin.ts +76 -28
- package/src/i18n/locales/fr.ts +2 -2
- package/src/i18n/locales/index.ts +2 -1
- package/src/i18n/locales/uk.ts +289 -0
- package/types/src/api/exporters/html/util/serializeBlocksInternalHTML.d.ts +1 -1
- package/types/src/api/nodeConversions/blockToNode.d.ts +1 -1
- package/types/src/editor/BlockNoteExtensions.d.ts +1 -1
- package/types/src/extensions/Collaboration/createCollaborationExtensions.d.ts +17 -0
- package/types/src/extensions/SideMenu/SideMenuPlugin.d.ts +0 -5
- package/types/src/i18n/locales/index.d.ts +2 -1
- package/types/src/i18n/locales/uk.d.ts +2 -0
package/dist/blocknote.umd.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(d,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("prosemirror-model"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("prosemirror-highlight"),require("prosemirror-highlight/shiki"),require("shiki"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("prosemirror-transform"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("prosemirror-tables"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("prosemirror-view"),require("prosemirror-dropcursor")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","@tiptap/core","prosemirror-state","uuid","prosemirror-highlight","prosemirror-highlight/shiki","shiki","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","prosemirror-transform","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","prosemirror-tables","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","prosemirror-view","prosemirror-dropcursor"],w):(d=typeof globalThis<"u"?globalThis:d||self,w(d.blocknote={},d.prosemirrorModel,d.core,d.prosemirrorState,d.uuid,d.prosemirrorHighlight,d.shiki$1,d.shiki,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.prosemirrorTransform,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.prosemirrorTables,d.Collaboration,d.CollaborationCursor,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.pmView,d.prosemirrorDropcursor))})(this,function(d,w,k,_,_i,yi,vi,Le,wi,Ci,xi,Si,Bi,be,Ei,Ti,Mi,U,Ii,Li,Pi,Ai,Ni,Di,ji,P,Hi){"use strict";var pr=Object.defineProperty;var hr=(d,w,k)=>w in d?pr(d,w,{enumerable:!0,configurable:!0,writable:!0,value:k}):d[w]=k;var h=(d,w,k)=>hr(d,typeof w!="symbol"?w+"":w,k);const Z=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function Oi(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Ui=Z(wi),Ri=Z(Ci),zi=Z(xi),Vi=Z(Si),Fi=Z(Bi),Gi=Z(Ii),$i=Z(Li),ct=Oi(P),Ki={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:"قائمة"},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:"ألوان"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_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:"ضبط النص"}},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:"تحرير الرابط"}},generic:{ctrl_shortcut:"Ctrl"}},Wi={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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Strg"}},ut={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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},qi=Object.freeze(Object.defineProperty({__proto__:null,ar:Ki,de:Wi,en:ut,es:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},fr:{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"},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"},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"},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:"Emboîter le bloc",secondary_tooltip:"Tab"},unnest:{tooltip:"Démboîter le 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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},hr:{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"},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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},is:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},it:{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"},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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},ja:{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:"リストを追加"},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:"色を変更"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_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:"両端揃え"}},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を編集"}},generic:{ctrl_shortcut:"Ctrl"}},ko:{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:"목록"},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:"색깔"},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개 추가"},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:"텍스트 양쪽 맞춤"}},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 수정"}},generic:{ctrl_shortcut:"Ctrl"}},nl:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},pl:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},pt:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},ru:{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:"Список"},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:"Цвета"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_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:"По середине текст"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},vi:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},zh:{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:"列表"},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:"颜色"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_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:"文本对齐"}},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:"编辑链接地址"}},generic:{ctrl_shortcut:"Ctrl"}}},Symbol.toStringTag,{value:"Module"}));class j extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function Xi(e,t=!0){const{"data-test":o,...i}=e;if(Object.keys(i).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Zi(e,t=JSON.stringify){const o={};return e.filter(i=>{const n=t(i);return Object.prototype.hasOwnProperty.call(o,n)?!1:o[n]=!0})}function Ji(e){const t=e.filter((i,n)=>e.indexOf(i)!==n);return Zi(t)}const J=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 _i.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 t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(o,i,n)=>{const a=o.some(f=>f.docChanged)&&!i.doc.eq(n.doc),r=this.options.filterTransaction&&o.some(f=>{let b,y;return!(!((y=(b=this.options).filterTransaction)===null||y===void 0)&&y.call(b,f))});if(!a||r)return;const{tr:s}=n,{types:l,attributeName:u,generateID:c}=this.options,p=k.combineTransactionSteps(i.doc,o),{mapping:m}=p;if(k.getChangedRanges(p).forEach(({newRange:f})=>{const b=k.findChildrenInRange(n.doc,f,M=>l.includes(M.type.name)),y=b.map(({node:M})=>M.attrs[u]).filter(M=>M!==null),v=Ji(y);b.forEach(({node:M,pos:x})=>{let O;const se=(O=s.doc.nodeAt(x))===null||O===void 0?void 0:O.attrs[u];if(se===null){const E=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(E)===null){const ki=JSON.parse(JSON.stringify(n.doc.toJSON()));if(ki.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(ki.content)===JSON.stringify(E.toJSON())){s.setNodeMarkup(x,void 0,{...M.attrs,[u]:"initialBlockId"});return}}s.setNodeMarkup(x,void 0,{...M.attrs,[u]:c()});return}const{deleted:Ie}=m.invert().mapResult(x);Ie&&v.includes(se)&&s.setNodeMarkup(x,void 0,{...M.attrs,[u]:c()})})}),!!s.steps.length)return s},view(o){const i=n=>{let a;e=!((a=o.dom.parentElement)===null||a===void 0)&&a.contains(n.target)?o.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(o,i)=>{let n;return(e!==o.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:o=>{if(!t)return o;const{types:i,attributeName:n}=this.options,a=r=>{const s=[];return r.forEach(l=>{if(l.isText){s.push(l);return}if(!i.includes(l.type.name)){s.push(l.copy(a(l.content)));return}const u=l.type.create({...l.attrs,[n]:null},a(l.content),l.marks);s.push(u)}),w.Fragment.from(s)};return t=!1,new w.Slice(a(o.content),o.openStart,o.openEnd)}}})]}});function Pe(e){return e.type==="link"}function Ae(e){return typeof e!="string"&&e.type==="link"}function Y(e){return typeof e!="string"&&e.type==="text"}function pt(e,t,o){const i=[];for(const[n,a]of Object.entries(e.styles)){const r=o[n];if(!r)throw new Error(`style ${n} not found in styleSchema`);if(r.propSchema==="boolean")i.push(t.mark(n));else if(r.propSchema==="string")i.push(t.mark(n,{stringValue:a}));else throw new j(r.propSchema)}return e.text.split(/(\n)/g).filter(n=>n.length>0).map(n=>n===`
|
|
2
|
-
`?t.nodes.hardBreak.createChecked():t.text(n,i))}function Yi(e,t,o){const i=t.marks.link.create({href:e.href});return Ne(e.content,t,o).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 Ne(e,t,o){const i=[];if(typeof e=="string")return i.push(...pt({type:"text",text:e,styles:{}},t,o)),i;for(const n of e)i.push(...pt(n,t,o));return i}function H(e,t,o){const i=[];for(const n of e)typeof n=="string"?i.push(...Ne(n,t,o)):Ae(n)?i.push(...Yi(n,t,o)):Y(n)?i.push(...Ne([n],t,o)):i.push(ht(n,t,o));return i}function le(e,t,o){var n;const i=[];for(const a of e.rows){const r=[];for(let l=0;l<a.cells.length;l++){const u=a.cells[l];let c;if(!u)c=t.nodes.tableParagraph.createChecked({});else if(typeof u=="string")c=t.nodes.tableParagraph.createChecked({},t.text(u));else{const m=H(u,t,o);c=t.nodes.tableParagraph.createChecked({},m)}const p=t.nodes.tableCell.createChecked({colwidth:(n=e.columnWidths)!=null&&n[l]?[e.columnWidths[l]]:null},c);r.push(p)}const s=t.nodes.tableRow.createChecked({},r);i.push(s)}return i}function ht(e,t,o){let i,n=e.type;if(n===void 0&&(n="paragraph"),!t.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)i=t.nodes[n].createChecked(e.props);else if(typeof e.content=="string"){const a=H([e.content],t,o);i=t.nodes[n].createChecked(e.props,a)}else if(Array.isArray(e.content)){const a=H(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else if(e.content.type==="tableContent"){const a=le(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else throw new j(e.content.type);return i}function q(e,t,o){let i=e.id;i===void 0&&(i=J.options.generateID());const n=[];if(e.children)for(const r of e.children)n.push(q(r,t,o));const a=t.nodes[e.type];if(a.isInGroup("blockContent")){const r=ht(e,t,o),s=n.length>0?t.nodes.blockGroup.createChecked({},n):void 0;return t.nodes.blockContainer.createChecked({id:i,...e.props},s?[r,s]:r)}else{if(a.isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function mt(e){const t=[...e.classList].filter(o=>!o.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function ft(e,t,o,i){let n;if(t)if(typeof t=="string")n=H([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=H(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=le(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");const a=o.serializeFragment(w.Fragment.from(n),i);return a.nodeType===1&&mt(a),a}function Qi(e,t,o,i,n,a,r){var b,y,v,M,x,O,se,Ie;const s=(r==null?void 0:r.document)??document,l=t.pmSchema.nodes.blockContainer;let u=o.props;if(!o.props){u={};for(const[I,E]of Object.entries(t.schema.blockSchema[o.type].propSchema))E.default!==void 0&&(u[I]=E.default)}const p=[...((y=(b=l.spec)==null?void 0:b.toDOM)==null?void 0:y.call(b,l.create({id:o.id,...u}))).dom.attributes],m=t.blockImplementations[o.type].implementation.toExternalHTML({...o,props:u},t),g=s.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const I=[...p,...m.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)m.dom.firstChild.setAttribute(E.name,E.value);mt(m.dom.firstChild),g.append(...m.dom.childNodes)}else g.append(m.dom);if(m.contentDOM&&o.content){const I=ft(t,o.content,i,r);m.contentDOM.appendChild(I)}let f;if(n.has(o.type)?f="OL":a.has(o.type)&&(f="UL"),f){if(((v=e.lastChild)==null?void 0:v.nodeName)!==f){const E=s.createElement(f);f==="OL"&&(u!=null&&u.start)&&(u==null?void 0:u.start)!==1&&E.setAttribute("start",u.start+""),e.append(E)}const I=s.createElement("li");I.append(g),e.lastChild.appendChild(I)}else e.append(g);if(o.children&&o.children.length>0){const I=s.createDocumentFragment();if(gt(I,t,o.children,i,n,a,r),((M=e.lastChild)==null?void 0:M.nodeName)==="UL"||((x=e.lastChild)==null?void 0:x.nodeName)==="OL")for(;((O=I.firstChild)==null?void 0:O.nodeName)==="UL"||((se=I.firstChild)==null?void 0:se.nodeName)==="OL";)e.lastChild.lastChild.appendChild(I.firstChild);t.pmSchema.nodes[o.type].isInGroup("blockContent")?e.append(I):(Ie=m.contentDOM)==null||Ie.append(I)}}const gt=(e,t,o,i,n,a,r)=>{for(const s of o)Qi(e,t,s,i,n,a,r)},en=(e,t,o,i,n,a)=>{const s=((a==null?void 0:a.document)??document).createDocumentFragment();return gt(s,e,t,o,i,n,a),s},de=(e,t)=>{const o=w.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const a=en(t,i,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),r=document.createElement("div");return r.append(a),r.innerHTML},exportInlineContent:(i,n)=>{const a=ft(t,i,o,n),r=document.createElement("div");return r.append(a.cloneNode(!0)),r.innerHTML}}};function tn(e,t,o,i){let n;if(t)if(typeof t=="string")n=H([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=H(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=le(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");return o.serializeFragment(w.Fragment.from(n),i)}function on(e,t,o,i,n){var p,m,g,f,b;const a=e.pmSchema.nodes.blockContainer;let r=t.props;if(!t.props){r={};for(const[y,v]of Object.entries(e.schema.blockSchema[t.type].propSchema))v.default!==void 0&&(r[y]=v.default)}const l=e.blockImplementations[t.type].implementation.toInternalHTML({...t,props:r},e);if(t.type==="numberedListItem"&&l.dom.setAttribute("data-index",i.toString()),l.contentDOM&&t.content){const y=tn(e,t.content,o,n);l.contentDOM.appendChild(y)}if(e.pmSchema.nodes[t.type].isInGroup("bnBlock")){if(t.children&&t.children.length>0){const y=bt(e,t.children,o,n);(p=l.contentDOM)==null||p.append(y)}return l.dom}const c=(g=(m=a.spec)==null?void 0:m.toDOM)==null?void 0:g.call(m,a.create({id:t.id,...r}));return(f=c.contentDOM)==null||f.appendChild(l.dom),t.children&&t.children.length>0&&((b=c.contentDOM)==null||b.appendChild(kt(e,t.children,o,n))),c.dom}function bt(e,t,o,i){const a=((i==null?void 0:i.document)??document).createDocumentFragment();let r=0;for(const s of t){s.type==="numberedListItem"?r++:r=0;const l=on(e,s,o,r,i);a.appendChild(l)}return a}const kt=(e,t,o,i)=>{var s;const n=e.pmSchema.nodes.blockGroup,a=n.spec.toDOM(n.create({})),r=bt(e,t,o,i);return(s=a.contentDOM)==null||s.appendChild(r),a.dom},_t=(e,t)=>{const o=w.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>kt(t,i,o,n).outerHTML}};function V(e,t){const o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let i=o.depth,n=o.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(i),node:n};i--,n=o.node(i)}const a=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&a.push(l)}),console.warn(`Position ${t} is not within a blockContainer node.`);const r=e.resolve(a.find(s=>s>=t)||a[a.length-1]);return{posBeforeNode:r.pos,node:r.nodeAfter}}function ke(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const o=e,i=t,n=i+o.nodeSize,a={node:o,beforePos:i,afterPos:n};if(o.type.name==="blockContainer"){let r,s;if(o.forEach((l,u)=>{if(l.type.spec.group==="blockContent"){const c=l,p=i+u+1,m=p+l.nodeSize;r={node:c,beforePos:p,afterPos:m}}else if(l.type.name==="blockGroup"){const c=l,p=i+u+1,m=p+l.nodeSize;s={node:c,beforePos:p,afterPos:m}}}),!r)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:a,blockContent:r,childContainer:s,blockNoteType:r.node.type.name}}else{if(!a.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${a.node}`);return{isBlockContainer:!1,bnBlock:a,childContainer:a,blockNoteType:a.node.type.name}}}function F(e){return ke(e.node,e.posBeforeNode)}function Q(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 ke(e.nodeAfter,e.pos)}function C(e){const t=V(e.doc,e.selection.anchor);return F(t)}function A(e,t){let o,i;if(t.firstChild.descendants((n,a)=>o?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(o=n,i=a+1,!1)),!(o===void 0||i===void 0))return{node:o,posBeforeNode:i}}const yt=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function G(e,t="Ctrl"){return yt()?e.replace("Mod","⌘"):e.replace("Mod",t)}function $(...e){return e.filter(t=>t).join(" ")}const nn=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function R(e,t,o,i){const n=document.createElement("div");n.className=$("bn-block-content",o.class),n.setAttribute("data-content-type",e);for(const[r,s]of Object.entries(o))r!=="class"&&n.setAttribute(r,s);const a=document.createElement(t);a.className=$("bn-inline-content",i.class);for(const[r,s]of Object.entries(i))r!=="class"&&a.setAttribute(r,s);return n.appendChild(a),{dom:n,contentDOM:a}}const De=(e,t)=>{let o=q(e,t.pmSchema,t.schema.styleSchema);o.type.name==="blockContainer"&&(o=o.firstChild);const i=t.pmSchema.nodes[o.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(o);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},B={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},je=["backgroundColor","textColor"];function ce(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function an(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function ee(e){const t={};return Object.entries(e).filter(([o,i])=>!je.includes(o)).forEach(([o,i])=>{t[o]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const a=n.getAttribute(ce(o));if(a===null)return null;if(i.default===void 0&&i.type==="boolean"||i.default!==void 0&&typeof i.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(i.default===void 0&&i.type==="number"||i.default!==void 0&&typeof i.default=="number"){const r=parseFloat(a);return!Number.isNaN(r)&&Number.isFinite(r)?r:null}return a},renderHTML:n=>n[o]!==i.default?{[ce(o)]:n[o]}:{}}}),t}function vt(e,t,o,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),r=o.state.doc.resolve(n).node().attrs.id;if(!r)throw new Error("Block doesn't have id");const s=t.getBlock(r);if(s.type!==i)throw new Error("Block type does not match");return s}function ue(e,t,o,i,n=!1,a){const r=document.createElement("div");if(a!==void 0)for(const[s,l]of Object.entries(a))s!=="class"&&r.setAttribute(s,l);r.className=$("bn-block-content",(a==null?void 0:a.class)||""),r.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(o)){const c=i[s].default;!je.includes(s)&&l!==c&&r.setAttribute(ce(s),l)}return n&&r.setAttribute("data-file-block",""),r.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=$("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:r}}function K(e){return k.Node.create(e)}function He(e,t){return{config:e,implementation:t}}function W(e,t,o){return He({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:o,toInternalHTML:De,toExternalHTML:De})}function Oe(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function wt(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Ct(e,t){const o=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&o.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=t==null?void 0:t(i);return n===void 0?!1:n}}),o}function te(e,t){const o=K({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,isolating:!0,addAttributes(){return ee(e.propSchema)},parseHTML(){return Ct(e,t.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return ue({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var u;const n=this.options.editor,a=vt(i,n,this.editor,e.type),r=((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},s=t.render(a,n),l=ue(s,a.type,a.props,e.propSchema,r);return e.isSelectable===!1&&wt(l,this.editor),l}}});if(o.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return He(e,{node:o,toInternalHTML:(i,n)=>{var s;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{},r=t.render(i,n);return ue(r,i.type,i.props,e.propSchema,e.isFileBlock,a)},toExternalHTML:(i,n)=>{var s,l;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{};let r=(l=t.toExternalHTML)==null?void 0:l.call(t,i,n);return r===void 0&&(r=t.render(i,n)),ue(r,i.type,i.props,e.propSchema,a)}})}function Ue(e,t,o){const i={type:"tableContent",columnWidths:[],rows:[]};return e.content.forEach((n,a,r)=>{const s={cells:[]};r===0&&n.content.forEach(l=>{var u;i.columnWidths.push(((u=l.attrs.colwidth)==null?void 0:u[0])||void 0)}),n.content.forEach(l=>{s.cells.push(pe(l.firstChild,t,o))}),i.rows.push(s)}),i}function pe(e,t,o){const i=[];let n;return e.content.forEach(a=>{if(a.type.name==="hardBreak"){if(n)if(Y(n))n.text+=`
|
|
1
|
+
(function(d,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("prosemirror-model"),require("@tiptap/core"),require("prosemirror-state"),require("uuid"),require("prosemirror-highlight"),require("prosemirror-highlight/shiki"),require("shiki"),require("@tiptap/extension-bold"),require("@tiptap/extension-code"),require("@tiptap/extension-italic"),require("@tiptap/extension-strike"),require("@tiptap/extension-underline"),require("prosemirror-transform"),require("@tiptap/extension-table-cell"),require("@tiptap/extension-table-header"),require("@tiptap/extension-table-row"),require("prosemirror-tables"),require("@tiptap/extension-gapcursor"),require("@tiptap/extension-hard-break"),require("@tiptap/extension-history"),require("@tiptap/extension-link"),require("@tiptap/extension-text"),require("prosemirror-view"),require("@tiptap/extension-collaboration"),require("@tiptap/extension-collaboration-cursor"),require("prosemirror-dropcursor")):typeof define=="function"&&define.amd?define(["exports","prosemirror-model","@tiptap/core","prosemirror-state","uuid","prosemirror-highlight","prosemirror-highlight/shiki","shiki","@tiptap/extension-bold","@tiptap/extension-code","@tiptap/extension-italic","@tiptap/extension-strike","@tiptap/extension-underline","prosemirror-transform","@tiptap/extension-table-cell","@tiptap/extension-table-header","@tiptap/extension-table-row","prosemirror-tables","@tiptap/extension-gapcursor","@tiptap/extension-hard-break","@tiptap/extension-history","@tiptap/extension-link","@tiptap/extension-text","prosemirror-view","@tiptap/extension-collaboration","@tiptap/extension-collaboration-cursor","prosemirror-dropcursor"],w):(d=typeof globalThis<"u"?globalThis:d||self,w(d.blocknote={},d.prosemirrorModel,d.core,d.prosemirrorState,d.uuid,d.prosemirrorHighlight,d.shiki$1,d.shiki,d.Bold,d.Code,d.Italic,d.Strike,d.Underline,d.prosemirrorTransform,d.extensionTableCell,d.extensionTableHeader,d.extensionTableRow,d.prosemirrorTables,d.extensionGapcursor,d.extensionHardBreak,d.extensionHistory,d.extensionLink,d.extensionText,d.pmView,d.Collaboration,d.CollaborationCursor,d.prosemirrorDropcursor))})(this,function(d,w,k,_,_i,yi,vi,Le,wi,Ci,xi,Si,Bi,be,Ei,Ti,Ii,U,Mi,Li,Pi,Ai,Ni,P,Di,ji,Hi){"use strict";var hr=Object.defineProperty;var mr=(d,w,k)=>w in d?hr(d,w,{enumerable:!0,configurable:!0,writable:!0,value:k}):d[w]=k;var h=(d,w,k)=>mr(d,typeof w!="symbol"?w+"":w,k);const Z=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function Oi(e){if(e&&typeof e=="object"&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const Ui=Z(wi),Ri=Z(Ci),Vi=Z(xi),zi=Z(Si),Fi=Z(Bi),ct=Oi(P),Gi=Z(Di),$i=Z(ji),Ki={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:"قائمة"},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:"ألوان"},table_handle:{delete_column_menuitem:"حذف عمود",delete_row_menuitem:"حذف صف",add_left_menuitem:"إضافة عمود إلى اليسار",add_right_menuitem:"إضافة عمود إلى اليمين",add_above_menuitem:"إضافة صف أعلى",add_below_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:"ضبط النص"}},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:"تحرير الرابط"}},generic:{ctrl_shortcut:"Ctrl"}},Wi={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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Strg"}},ut={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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},qi=Object.freeze(Object.defineProperty({__proto__:null,ar:Ki,de:Wi,en:ut,es:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},fr:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},hr:{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"},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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},is:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},it:{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"},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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},ja:{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:"リストを追加"},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:"色を変更"},table_handle:{delete_column_menuitem:"列を削除",delete_row_menuitem:"行を削除",add_left_menuitem:"左に列を追加",add_right_menuitem:"右に列を追加",add_above_menuitem:"上に行を追加",add_below_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:"両端揃え"}},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を編集"}},generic:{ctrl_shortcut:"Ctrl"}},ko:{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:"목록"},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:"색깔"},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개 추가"},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:"텍스트 양쪽 맞춤"}},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 수정"}},generic:{ctrl_shortcut:"Ctrl"}},nl:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},pl:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},pt:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},ru:{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:"Список"},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:"Цвета"},table_handle:{delete_column_menuitem:"Удалить столбец",delete_row_menuitem:"Удалить строку",add_left_menuitem:"Добавить столбец слева",add_right_menuitem:"Добавить столбец справа",add_above_menuitem:"Добавить строку выше",add_below_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:"По середине текст"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},uk:{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:"Список"},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:"Кольори"},table_handle:{delete_column_menuitem:"Видалити стовпець",delete_row_menuitem:"Видалити рядок",add_left_menuitem:"Додати стовпець зліва",add_right_menuitem:"Додати стовпець справа",add_above_menuitem:"Додати рядок вище",add_below_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:"Вирівняти за шириною"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},vi:{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"},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"},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"},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"}},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"}},generic:{ctrl_shortcut:"Ctrl"}},zh:{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:"列表"},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:"颜色"},table_handle:{delete_column_menuitem:"删除列",delete_row_menuitem:"删除行",add_left_menuitem:"左侧添加列",add_right_menuitem:"右侧添加列",add_above_menuitem:"上方添加行",add_below_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:"文本对齐"}},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:"编辑链接地址"}},generic:{ctrl_shortcut:"Ctrl"}}},Symbol.toStringTag,{value:"Module"}));class j extends Error{constructor(t){super(`Unreachable case: ${t}`)}}function Xi(e,t=!0){const{"data-test":o,...i}=e;if(Object.keys(i).length>0&&t)throw new Error("Object must be empty "+JSON.stringify(e))}function Zi(e,t=JSON.stringify){const o={};return e.filter(i=>{const n=t(i);return Object.prototype.hasOwnProperty.call(o,n)?!1:o[n]=!0})}function Ji(e){const t=e.filter((i,n)=>e.indexOf(i)!==n);return Zi(t)}const J=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 _i.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 t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new _.Plugin({key:new _.PluginKey("uniqueID"),appendTransaction:(o,i,n)=>{const a=o.some(g=>g.docChanged)&&!i.doc.eq(n.doc),r=this.options.filterTransaction&&o.some(g=>{let b,y;return!(!((y=(b=this.options).filterTransaction)===null||y===void 0)&&y.call(b,g))});if(!a||r)return;const{tr:s}=n,{types:l,attributeName:c,generateID:u}=this.options,p=k.combineTransactionSteps(i.doc,o),{mapping:m}=p;if(k.getChangedRanges(p).forEach(({newRange:g})=>{const b=k.findChildrenInRange(n.doc,g,I=>l.includes(I.type.name)),y=b.map(({node:I})=>I.attrs[c]).filter(I=>I!==null),v=Ji(y);b.forEach(({node:I,pos:x})=>{let O;const se=(O=s.doc.nodeAt(x))===null||O===void 0?void 0:O.attrs[c];if(se===null){const E=i.doc.type.createAndFill().content;if(i.doc.content.findDiffStart(E)===null){const ki=JSON.parse(JSON.stringify(n.doc.toJSON()));if(ki.content[0].content[0].attrs.id="initialBlockId",JSON.stringify(ki.content)===JSON.stringify(E.toJSON())){s.setNodeMarkup(x,void 0,{...I.attrs,[c]:"initialBlockId"});return}}s.setNodeMarkup(x,void 0,{...I.attrs,[c]:u()});return}const{deleted:Me}=m.invert().mapResult(x);Me&&v.includes(se)&&s.setNodeMarkup(x,void 0,{...I.attrs,[c]:u()})})}),!!s.steps.length)return s},view(o){const i=n=>{let a;e=!((a=o.dom.parentElement)===null||a===void 0)&&a.contains(n.target)?o.dom.parentElement:null};return window.addEventListener("dragstart",i),{destroy(){window.removeEventListener("dragstart",i)}}},props:{handleDOMEvents:{drop:(o,i)=>{let n;return(e!==o.dom.parentElement||((n=i.dataTransfer)===null||n===void 0?void 0:n.effectAllowed)==="copy")&&(e=null,t=!0),!1},paste:()=>(t=!0,!1)},transformPasted:o=>{if(!t)return o;const{types:i,attributeName:n}=this.options,a=r=>{const s=[];return r.forEach(l=>{if(l.isText){s.push(l);return}if(!i.includes(l.type.name)){s.push(l.copy(a(l.content)));return}const c=l.type.create({...l.attrs,[n]:null},a(l.content),l.marks);s.push(c)}),w.Fragment.from(s)};return t=!1,new w.Slice(a(o.content),o.openStart,o.openEnd)}}})]}});function Pe(e){return e.type==="link"}function Ae(e){return typeof e!="string"&&e.type==="link"}function Y(e){return typeof e!="string"&&e.type==="text"}function pt(e,t,o,i){const n=[];for(const[r,s]of Object.entries(e.styles)){const l=o[r];if(!l)throw new Error(`style ${r} not found in styleSchema`);if(l.propSchema==="boolean")n.push(t.mark(r));else if(l.propSchema==="string")n.push(t.mark(r,{stringValue:s}));else throw new j(l.propSchema)}return!i||!t.nodes[i].spec.code?e.text.split(/(\n)/g).filter(r=>r.length>0).map(r=>r===`
|
|
2
|
+
`?t.nodes.hardBreak.createChecked():t.text(r,n)):[t.text(e.text,n)]}function Yi(e,t,o){const i=t.marks.link.create({href:e.href});return Ne(e.content,t,o).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 Ne(e,t,o,i){const n=[];if(typeof e=="string")return n.push(...pt({type:"text",text:e,styles:{}},t,o,i)),n;for(const a of e)n.push(...pt(a,t,o,i));return n}function H(e,t,o,i){const n=[];for(const a of e)typeof a=="string"?n.push(...Ne(a,t,o,i)):Ae(a)?n.push(...Yi(a,t,o)):Y(a)?n.push(...Ne([a],t,o,i)):n.push(ht(a,t,o));return n}function le(e,t,o){var n;const i=[];for(const a of e.rows){const r=[];for(let l=0;l<a.cells.length;l++){const c=a.cells[l];let u;if(!c)u=t.nodes.tableParagraph.createChecked({});else if(typeof c=="string")u=t.nodes.tableParagraph.createChecked({},t.text(c));else{const m=H(c,t,o);u=t.nodes.tableParagraph.createChecked({},m)}const p=t.nodes.tableCell.createChecked({colwidth:(n=e.columnWidths)!=null&&n[l]?[e.columnWidths[l]]:null},u);r.push(p)}const s=t.nodes.tableRow.createChecked({},r);i.push(s)}return i}function ht(e,t,o){let i,n=e.type;if(n===void 0&&(n="paragraph"),!t.nodes[n])throw new Error(`node type ${n} not found in schema`);if(!e.content)i=t.nodes[n].createChecked(e.props);else if(typeof e.content=="string"){const a=H([e.content],t,o,n);i=t.nodes[n].createChecked(e.props,a)}else if(Array.isArray(e.content)){const a=H(e.content,t,o,n);i=t.nodes[n].createChecked(e.props,a)}else if(e.content.type==="tableContent"){const a=le(e.content,t,o);i=t.nodes[n].createChecked(e.props,a)}else throw new j(e.content.type);return i}function q(e,t,o){let i=e.id;i===void 0&&(i=J.options.generateID());const n=[];if(e.children)for(const r of e.children)n.push(q(r,t,o));const a=t.nodes[e.type];if(a.isInGroup("blockContent")){const r=ht(e,t,o),s=n.length>0?t.nodes.blockGroup.createChecked({},n):void 0;return t.nodes.blockContainer.createChecked({id:i,...e.props},s?[r,s]:r)}else{if(a.isInGroup("bnBlock"))return t.nodes[e.type].createChecked({id:i,...e.props},n);throw new Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}function mt(e){const t=[...e.classList].filter(o=>!o.startsWith("bn-"))||[];t.length>0?e.className=t.join(" "):e.removeAttribute("class")}function ft(e,t,o,i){let n;if(t)if(typeof t=="string")n=H([t],e.pmSchema,e.schema.styleSchema);else if(Array.isArray(t))n=H(t,e.pmSchema,e.schema.styleSchema);else if(t.type==="tableContent")n=le(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");const a=o.serializeFragment(w.Fragment.from(n),i);return a.nodeType===1&&mt(a),a}function Qi(e,t,o,i,n,a,r){var b,y,v,I,x,O,se,Me;const s=(r==null?void 0:r.document)??document,l=t.pmSchema.nodes.blockContainer;let c=o.props;if(!o.props){c={};for(const[M,E]of Object.entries(t.schema.blockSchema[o.type].propSchema))E.default!==void 0&&(c[M]=E.default)}const p=[...((y=(b=l.spec)==null?void 0:b.toDOM)==null?void 0:y.call(b,l.create({id:o.id,...c}))).dom.attributes],m=t.blockImplementations[o.type].implementation.toExternalHTML({...o,props:c},t),f=s.createDocumentFragment();if(m.dom.classList.contains("bn-block-content")){const M=[...p,...m.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 M)m.dom.firstChild.setAttribute(E.name,E.value);mt(m.dom.firstChild),f.append(...m.dom.childNodes)}else f.append(m.dom);if(m.contentDOM&&o.content){const M=ft(t,o.content,i,r);m.contentDOM.appendChild(M)}let g;if(n.has(o.type)?g="OL":a.has(o.type)&&(g="UL"),g){if(((v=e.lastChild)==null?void 0:v.nodeName)!==g){const E=s.createElement(g);g==="OL"&&(c!=null&&c.start)&&(c==null?void 0:c.start)!==1&&E.setAttribute("start",c.start+""),e.append(E)}const M=s.createElement("li");M.append(f),e.lastChild.appendChild(M)}else e.append(f);if(o.children&&o.children.length>0){const M=s.createDocumentFragment();if(gt(M,t,o.children,i,n,a,r),((I=e.lastChild)==null?void 0:I.nodeName)==="UL"||((x=e.lastChild)==null?void 0:x.nodeName)==="OL")for(;((O=M.firstChild)==null?void 0:O.nodeName)==="UL"||((se=M.firstChild)==null?void 0:se.nodeName)==="OL";)e.lastChild.lastChild.appendChild(M.firstChild);t.pmSchema.nodes[o.type].isInGroup("blockContent")?e.append(M):(Me=m.contentDOM)==null||Me.append(M)}}const gt=(e,t,o,i,n,a,r)=>{for(const s of o)Qi(e,t,s,i,n,a,r)},en=(e,t,o,i,n,a)=>{const s=((a==null?void 0:a.document)??document).createDocumentFragment();return gt(s,e,t,o,i,n,a),s},de=(e,t)=>{const o=w.DOMSerializer.fromSchema(e);return{exportBlocks:(i,n)=>{const a=en(t,i,o,new Set(["numberedListItem"]),new Set(["bulletListItem","checkListItem"]),n),r=document.createElement("div");return r.append(a),r.innerHTML},exportInlineContent:(i,n)=>{const a=ft(t,i,o,n),r=document.createElement("div");return r.append(a.cloneNode(!0)),r.innerHTML}}};function tn(e,t,o,i,n){let a;if(t)if(typeof t=="string")a=H([t],e.pmSchema,e.schema.styleSchema,i);else if(Array.isArray(t))a=H(t,e.pmSchema,e.schema.styleSchema,i);else if(t.type==="tableContent")a=le(t,e.pmSchema,e.schema.styleSchema);else throw new j(t.type);else throw new Error("blockContent is required");return o.serializeFragment(w.Fragment.from(a),n)}function on(e,t,o,i,n){var p,m,f,g,b;const a=e.pmSchema.nodes.blockContainer;let r=t.props;if(!t.props){r={};for(const[y,v]of Object.entries(e.schema.blockSchema[t.type].propSchema))v.default!==void 0&&(r[y]=v.default)}const l=e.blockImplementations[t.type].implementation.toInternalHTML({...t,props:r},e);if(t.type==="numberedListItem"&&l.dom.setAttribute("data-index",i.toString()),l.contentDOM&&t.content){const y=tn(e,t.content,o,t.type,n);l.contentDOM.appendChild(y)}if(e.pmSchema.nodes[t.type].isInGroup("bnBlock")){if(t.children&&t.children.length>0){const y=bt(e,t.children,o,n);(p=l.contentDOM)==null||p.append(y)}return l.dom}const u=(f=(m=a.spec)==null?void 0:m.toDOM)==null?void 0:f.call(m,a.create({id:t.id,...r}));return(g=u.contentDOM)==null||g.appendChild(l.dom),t.children&&t.children.length>0&&((b=u.contentDOM)==null||b.appendChild(kt(e,t.children,o,n))),u.dom}function bt(e,t,o,i){const a=((i==null?void 0:i.document)??document).createDocumentFragment();let r=0;for(const s of t){s.type==="numberedListItem"?r++:r=0;const l=on(e,s,o,r,i);a.appendChild(l)}return a}const kt=(e,t,o,i)=>{var s;const n=e.pmSchema.nodes.blockGroup,a=n.spec.toDOM(n.create({})),r=bt(e,t,o,i);return(s=a.contentDOM)==null||s.appendChild(r),a.dom},_t=(e,t)=>{const o=w.DOMSerializer.fromSchema(e);return{serializeBlocks:(i,n)=>kt(t,i,o,n).outerHTML}};function z(e,t){const o=e.resolve(t);if(o.nodeAfter&&o.nodeAfter.type.isInGroup("bnBlock"))return{posBeforeNode:o.pos,node:o.nodeAfter};let i=o.depth,n=o.node(i);for(;i>0;){if(n.type.isInGroup("bnBlock"))return{posBeforeNode:o.before(i),node:n};i--,n=o.node(i)}const a=[];e.descendants((s,l)=>{s.type.isInGroup("bnBlock")&&a.push(l)}),console.warn(`Position ${t} is not within a blockContainer node.`);const r=e.resolve(a.find(s=>s>=t)||a[a.length-1]);return{posBeforeNode:r.pos,node:r.nodeAfter}}function ke(e,t){if(!e.type.isInGroup("bnBlock"))throw new Error(`Attempted to get bnBlock node at position but found node of different type ${e.type}`);const o=e,i=t,n=i+o.nodeSize,a={node:o,beforePos:i,afterPos:n};if(o.type.name==="blockContainer"){let r,s;if(o.forEach((l,c)=>{if(l.type.spec.group==="blockContent"){const u=l,p=i+c+1,m=p+l.nodeSize;r={node:u,beforePos:p,afterPos:m}}else if(l.type.name==="blockGroup"){const u=l,p=i+c+1,m=p+l.nodeSize;s={node:u,beforePos:p,afterPos:m}}}),!r)throw new Error(`blockContainer node does not contain a blockContent node in its children: ${o}`);return{isBlockContainer:!0,bnBlock:a,blockContent:r,childContainer:s,blockNoteType:r.node.type.name}}else{if(!a.node.type.isInGroup("childContainer"))throw new Error(`bnBlock node is not in the childContainer group: ${a.node}`);return{isBlockContainer:!1,bnBlock:a,childContainer:a,blockNoteType:a.node.type.name}}}function F(e){return ke(e.node,e.posBeforeNode)}function Q(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 ke(e.nodeAfter,e.pos)}function C(e){const t=z(e.doc,e.selection.anchor);return F(t)}function A(e,t){let o,i;if(t.firstChild.descendants((n,a)=>o?!1:!n.type.isInGroup("bnBlock")||n.attrs.id!==e?!0:(o=n,i=a+1,!1)),!(o===void 0||i===void 0))return{node:o,posBeforeNode:i}}const yt=()=>typeof navigator<"u"&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function G(e,t="Ctrl"){return yt()?e.replace("Mod","⌘"):e.replace("Mod",t)}function $(...e){return e.filter(t=>t).join(" ")}const nn=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function R(e,t,o,i){const n=document.createElement("div");n.className=$("bn-block-content",o.class),n.setAttribute("data-content-type",e);for(const[r,s]of Object.entries(o))r!=="class"&&n.setAttribute(r,s);const a=document.createElement(t);a.className=$("bn-inline-content",i.class);for(const[r,s]of Object.entries(i))r!=="class"&&a.setAttribute(r,s);return n.appendChild(a),{dom:n,contentDOM:a}}const De=(e,t)=>{let o=q(e,t.pmSchema,t.schema.styleSchema);o.type.name==="blockContainer"&&(o=o.firstChild);const i=t.pmSchema.nodes[o.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(o);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},B={backgroundColor:{default:"default"},textColor:{default:"default"},textAlignment:{default:"left",values:["left","center","right","justify"]}},je=["backgroundColor","textColor"];function ce(e){return"data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function an(e){const t=e.split("/");return!t.length||t[t.length-1]===""?e:t[t.length-1]}function ee(e){const t={};return Object.entries(e).filter(([o,i])=>!je.includes(o)).forEach(([o,i])=>{t[o]={default:i.default,keepOnSplit:!0,parseHTML:n=>{const a=n.getAttribute(ce(o));if(a===null)return null;if(i.default===void 0&&i.type==="boolean"||i.default!==void 0&&typeof i.default=="boolean")return a==="true"?!0:a==="false"?!1:null;if(i.default===void 0&&i.type==="number"||i.default!==void 0&&typeof i.default=="number"){const r=parseFloat(a);return!Number.isNaN(r)&&Number.isFinite(r)?r:null}return a},renderHTML:n=>n[o]!==i.default?{[ce(o)]:n[o]}:{}}}),t}function vt(e,t,o,i){if(typeof e=="boolean")throw new Error("Cannot find node position as getPos is a boolean, not a function.");const n=e(),r=o.state.doc.resolve(n).node().attrs.id;if(!r)throw new Error("Block doesn't have id");const s=t.getBlock(r);if(s.type!==i)throw new Error("Block type does not match");return s}function ue(e,t,o,i,n=!1,a){const r=document.createElement("div");if(a!==void 0)for(const[s,l]of Object.entries(a))s!=="class"&&r.setAttribute(s,l);r.className=$("bn-block-content",(a==null?void 0:a.class)||""),r.setAttribute("data-content-type",t);for(const[s,l]of Object.entries(o)){const u=i[s].default;!je.includes(s)&&l!==u&&r.setAttribute(ce(s),l)}return n&&r.setAttribute("data-file-block",""),r.appendChild(e.dom),e.contentDOM!==void 0&&(e.contentDOM.className=$("bn-inline-content",e.contentDOM.className),e.contentDOM.setAttribute("data-editable","")),{...e,dom:r}}function K(e){return k.Node.create(e)}function He(e,t){return{config:e,implementation:t}}function W(e,t,o){return He({type:e.name,content:e.config.content==="inline*"?"inline":e.config.content==="tableRow+"?"table":"none",propSchema:t},{node:e,requiredExtensions:o,toInternalHTML:De,toExternalHTML:De})}function Oe(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function wt(e,t){e.stopEvent=o=>(o.type==="mousedown"&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Ct(e,t){const o=[{tag:"[data-content-type="+e.type+"]",contentElement:"[data-editable]"}];return t&&o.push({tag:"*",getAttrs(i){if(typeof i=="string")return!1;const n=t==null?void 0:t(i);return n===void 0?!1:n}}),o}function te(e,t){const o=K({name:e.type,content:e.content==="inline"?"inline*":"",group:"blockContent",selectable:e.isSelectable??!0,isolating:!0,addAttributes(){return ee(e.propSchema)},parseHTML(){return Ct(e,t.parse)},renderHTML({HTMLAttributes:i}){const n=document.createElement("div");return ue({dom:n,contentDOM:e.content==="inline"?n:void 0},e.type,{},e.propSchema,e.isFileBlock,i)},addNodeView(){return({getPos:i})=>{var c;const n=this.options.editor,a=vt(i,n,this.editor,e.type),r=((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},s=t.render(a,n),l=ue(s,a.type,a.props,e.propSchema,r);return e.isSelectable===!1&&wt(l,this.editor),l}}});if(o.name!==e.type)throw new Error("Node name does not match block type. This is a bug in BlockNote.");return He(e,{node:o,toInternalHTML:(i,n)=>{var s;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{},r=t.render(i,n);return ue(r,i.type,i.props,e.propSchema,e.isFileBlock,a)},toExternalHTML:(i,n)=>{var s,l;const a=((s=o.options.domAttributes)==null?void 0:s.blockContent)||{};let r=(l=t.toExternalHTML)==null?void 0:l.call(t,i,n);return r===void 0&&(r=t.render(i,n)),ue(r,i.type,i.props,e.propSchema,a)}})}function Ue(e,t,o){const i={type:"tableContent",columnWidths:[],rows:[]};return e.content.forEach((n,a,r)=>{const s={cells:[]};r===0&&n.content.forEach(l=>{var c;i.columnWidths.push(((c=l.attrs.colwidth)==null?void 0:c[0])||void 0)}),n.content.forEach(l=>{s.cells.push(pe(l.firstChild,t,o))}),i.rows.push(s)}),i}function pe(e,t,o){const i=[];let n;return e.content.forEach(a=>{if(a.type.name==="hardBreak"){if(n)if(Y(n))n.text+=`
|
|
3
3
|
`;else if(Pe(n))n.content[n.content.length-1].text+=`
|
|
4
4
|
`;else throw new Error("unexpected");else n={type:"text",text:`
|
|
5
|
-
`,styles:{}};return}if(a.type.name!=="link"&&a.type.name!=="text"&&t[a.type.name]){n&&(i.push(n),n=void 0),i.push(_e(a,t,o));return}const r={};let s;for(const l of a.marks)if(l.type.name==="link")s=l;else{const u=o[l.type.name];if(!u)throw new Error(`style ${l.type.name} not found in styleSchema`);if(u.propSchema==="boolean")r[u.type]=!0;else if(u.propSchema==="string")r[u.type]=l.attrs.stringValue;else throw new j(u.propSchema)}n?Y(n)?s?(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):JSON.stringify(n.styles)===JSON.stringify(r)?n.text+=a.textContent:(i.push(n),n={type:"text",text:a.textContent,styles:r}):Pe(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(r)?n.content[n.content.length-1].text+=a.textContent:n.content.push({type:"text",text:a.textContent,styles:r}):(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):(i.push(n),n={type:"text",text:a.textContent,styles:r})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}:n={type:"text",text:a.textContent,styles:r}}),n&&i.push(n),i}function _e(e,t,o){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const i={},n=t[e.type.name];for(const[s,l]of Object.entries(e.attrs)){if(!n)throw Error("ic node is of an unrecognized type: "+e.type.name);const u=n.propSchema;s in u&&(i[s]=l)}let a;return n.content==="styled"?a=pe(e,t,o):a=void 0,{type:e.type.name,props:i,content:a}}function S(e,t,o,i,n){var f;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const a=n==null?void 0:n.get(e);if(a)return a;const r=ke(e,0);let s=r.bnBlock.node.attrs.id;s===null&&(s=J.options.generateID());const l=t[r.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+r.blockNoteType);const u={};for(const[b,y]of Object.entries({...e.attrs,...r.isBlockContainer?r.blockContent.node.attrs:{}})){const v=l.propSchema;b in v&&!(v[b].default===void 0&&y===void 0)&&(u[b]=y)}const c=t[r.blockNoteType],p=[];(f=r.childContainer)==null||f.node.forEach(b=>{p.push(S(b,t,o,i,n))});let m;if(c.content==="inline"){if(!r.isBlockContainer)throw new Error("impossible");m=pe(r.blockContent.node,o,i)}else if(c.content==="table"){if(!r.isBlockContainer)throw new Error("impossible");m=Ue(r.blockContent.node,o,i)}else if(c.content==="none")m=void 0;else throw new j(c.content);const g={id:s,type:c.type,props:u,content:m,children:p};return n==null||n.set(e,g),g}function Re(e,t,o,i){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(o).filter(([n,a])=>{const r=i[n];return a!==r.default}).map(([n,a])=>[ce(n),a]).forEach(([n,a])=>e.dom.setAttribute(n,a)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function xt(e){return{Backspace:({editor:t})=>{const o=t.state.selection.$from;return t.state.selection.empty&&o.node().type.name===e.type&&o.parentOffset===0}}}function St(e,t){return{config:e,implementation:t}}function Bt(e,t){return St({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function ze(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Et(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function rn(e,t){const o=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 ee(e.propSchema)},addKeyboardShortcuts(){return xt(e)},parseHTML(){return Et(e)},renderHTML({node:i}){const n=this.options.editor,a=t.render(_e(i,n.schema.inlineContentSchema,n.schema.styleSchema),()=>{},n);return Re(a,e.type,i.attrs,e.propSchema)},addNodeView(){return({node:i,getPos:n})=>{const a=this.options.editor,r=t.render(_e(i,a.schema.inlineContentSchema,a.schema.styleSchema),s=>{if(typeof n=="boolean")return;const l=H([s],a._tiptapEditor.schema,a.schema.styleSchema);a.dispatch(a.prosemirrorView.state.tr.replaceWith(n(),n()+i.nodeSize,l))},a);return Re(r,e.type,i.attrs,e.propSchema)}}});return Bt(o,e.propSchema)}function Tt(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function Mt(e,t,o,i){return e.dom.setAttribute("data-style-type",t),i==="string"&&e.dom.setAttribute("data-value",o),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function Ve(e,t){return{config:e,implementation:t}}function X(e,t){return Ve({type:e.name,propSchema:t},{mark:e})}function Fe(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function It(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function sn(e,t){const o=k.Mark.create({name:e.type,addAttributes(){return Tt(e.propSchema)},parseHTML(){return It(e)},renderHTML({mark:i}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(i.attrs.stringValue);else throw new j(e.propSchema);return Mt(n,e.type,i.attrs.stringValue,e.propSchema)}});return Ve(e,{mark:o})}const he=(e,t)=>{const o=e.querySelector(t);if(!o)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:o,caption:n}},Lt=(e,t,o,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const a=document.createElement("div");a.className="bn-add-file-button-icon",i?a.appendChild(i):a.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(a);const r=document.createElement("p");r.className="bn-add-file-button-text",r.innerHTML=o||t.dictionary.file_blocks.file.add_button_text,n.appendChild(r);const s=u=>{u.preventDefault()},l=()=>{t.dispatch(t._tiptapEditor.state.tr.setMeta(t.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)}}},Pt='<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>',At=e=>{const t=document.createElement("div");t.className="bn-file-name-with-icon";const o=document.createElement("div");o.className="bn-file-icon",o.innerHTML=Pt,t.appendChild(o);const i=document.createElement("p");return i.className="bn-file-name",i.textContent=e.props.name,t.appendChild(i),{dom:t}},ye=(e,t,o,i,n)=>{const a=document.createElement("div");if(a.className="bn-file-block-content-wrapper",e.props.url===""){const s=Lt(e,t,i,n);a.appendChild(s.dom);const l=t.onUploadStart(u=>{if(u===e.id){a.removeChild(s.dom);const c=document.createElement("div");c.className="bn-file-loading-preview",c.textContent="Loading...",a.appendChild(c)}});return{dom:a,destroy:()=>{l(),s.destroy()}}}const r={dom:a};if(e.props.showPreview===!1||!o){const s=At(e);a.appendChild(s.dom),r.destroy=()=>{var l;(l=s.destroy)==null||l.call(s)}}else a.appendChild(o.dom);if(e.props.caption){const s=document.createElement("p");s.className="bn-file-caption",s.textContent=e.props.caption,a.appendChild(s)}return r},ve=(e,t)=>{const o=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},me=(e,t)=>{const o=document.createElement("div"),i=document.createElement("p");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},Nt=e=>({url:e.src||void 0}),Dt='<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>',jt={backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},Ht={type:"audio",propSchema:jt,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},Ot=(e,t)=>{const o=document.createElement("div");o.innerHTML=Dt;const i=document.createElement("audio");return i.className="bn-audio",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(n=>{i.src=n}):i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,ye(e,t,{dom:i},t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild)},Ut=e=>{if(e.tagName==="AUDIO")return Nt(e);if(e.tagName==="FIGURE"){const t=he(e,"audio");if(!t)return;const{targetElement:o,caption:i}=t;return{...Nt(o),caption:i}}},Rt=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add audio",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("audio"),t.src=e.props.url):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},zt=te(Ht,{render:Ot,parse:Ut,toExternalHTML:Rt}),Vt=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...Le.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"]}],Ge=Symbol.for("blocknote.shikiParser"),we=Symbol.for("blocknote.shikiHighlighterPromise"),Ce={language:{default:"javascript",values:[...Vt.map(e=>e.id)]}},Ft=K({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:Vt}},addAttributes(){const e=this.options.supportedLanguages;return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var a;let o=t,i=null;(o==null?void 0:o.tagName)==="DIV"&&(o==null?void 0:o.dataset.contentType)==="codeBlock"&&(o=o.children[0]),(o==null?void 0:o.tagName)==="PRE"&&(o=o==null?void 0:o.children[0]);const n=o==null?void 0:o.getAttribute("data-language");if(n)i=n.toLowerCase();else{const s=[...(o==null?void 0:o.className.split(" "))||[]].filter(l=>l.startsWith("language-")).map(l=>l.replace("language-",""));s.length>0&&(i=s[0].toLowerCase())}return i?((a=e.find(({match:r})=>r.includes(i)))==null?void 0:a.id)||this.options.defaultLanguage:null},renderHTML:t=>t.language&&t.language!=="text"?{class:`language-${t.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",contentElement:"code"},{tag:"pre",contentElement:"code",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,a;const t=document.createElement("pre"),{dom:o,contentDOM:i}=R(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{},...e});return o.removeChild(i),o.appendChild(t),t.appendChild(i),{dom:o,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:t,node:o,getPos:i,HTMLAttributes:n})=>{var p,m;const a=document.createElement("pre"),r=document.createElement("select"),s=document.createElement("div"),{dom:l,contentDOM:u}=R(this.name,"code",{...((p=this.options.domAttributes)==null?void 0:p.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),c=g=>{const f=g.target.value;t.commands.command(({tr:b})=>(b.setNodeAttribute(i(),"language",f),!0))};return e.forEach(({id:g,name:f})=>{const b=document.createElement("option");b.value=g,b.text=f,r.appendChild(b)}),s.contentEditable="false",r.value=o.attrs.language||this.options.defaultLanguage,l.removeChild(u),l.appendChild(s),l.appendChild(a),a.appendChild(u),s.appendChild(r),r.addEventListener("change",c),{dom:l,contentDOM:u,update:g=>g.type===this.type,destroy:()=>{r.removeEventListener("change",c)}}}},addProseMirrorPlugins(){const e=this.options.supportedLanguages,t=globalThis;let o,i;const n=r=>{if(!o)return t[we]=t[we]||Le.createHighlighter({themes:["github-dark"],langs:[]}),t[we].then(l=>{o=l});const s=r.language;return s&&s!=="text"&&!o.getLoadedLanguages().includes(s)&&e.find(({id:l})=>l===s)&&Le.bundledLanguagesInfo.find(({id:l})=>l===s)?o.loadLanguage(s):(i||(i=t[Ge]||vi.createParser(o),t[Ge]=i),i(r))};return[yi.createHighlightPlugin({parser:n,languageExtractor:r=>r.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:t,range:o,match:i})=>{var s;const n=t.doc.resolve(o.from),a=i[1].trim(),r={language:((s=e.find(({match:l})=>l.includes(a)))==null?void 0:s.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;t.tr.delete(o.from,o.to).setBlockType(o.from,o.from,this.type,r).setSelection(_.TextSelection.create(t.tr.doc,o.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:t}=e.state,{$from:o}=t;if(e.isActive(this.name)&&!o.parent.textContent&&k.isTextSelection(t)){const i=o.pos-o.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:t}=e.state.selection;if(!e.isActive(this.name))return!1;const o=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith(`
|
|
5
|
+
`,styles:{}};return}if(a.type.name!=="link"&&a.type.name!=="text"&&t[a.type.name]){n&&(i.push(n),n=void 0),i.push(_e(a,t,o));return}const r={};let s;for(const l of a.marks)if(l.type.name==="link")s=l;else{const c=o[l.type.name];if(!c)throw new Error(`style ${l.type.name} not found in styleSchema`);if(c.propSchema==="boolean")r[c.type]=!0;else if(c.propSchema==="string")r[c.type]=l.attrs.stringValue;else throw new j(c.propSchema)}n?Y(n)?s?(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):JSON.stringify(n.styles)===JSON.stringify(r)?n.text+=a.textContent:(i.push(n),n={type:"text",text:a.textContent,styles:r}):Pe(n)&&(s?n.href===s.attrs.href?JSON.stringify(n.content[n.content.length-1].styles)===JSON.stringify(r)?n.content[n.content.length-1].text+=a.textContent:n.content.push({type:"text",text:a.textContent,styles:r}):(i.push(n),n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}):(i.push(n),n={type:"text",text:a.textContent,styles:r})):s?n={type:"link",href:s.attrs.href,content:[{type:"text",text:a.textContent,styles:r}]}:n={type:"text",text:a.textContent,styles:r}}),n&&i.push(n),i}function _e(e,t,o){if(e.type.name==="text"||e.type.name==="link")throw new Error("unexpected");const i={},n=t[e.type.name];for(const[s,l]of Object.entries(e.attrs)){if(!n)throw Error("ic node is of an unrecognized type: "+e.type.name);const c=n.propSchema;s in c&&(i[s]=l)}let a;return n.content==="styled"?a=pe(e,t,o):a=void 0,{type:e.type.name,props:i,content:a}}function S(e,t,o,i,n){var g;if(!e.type.isInGroup("bnBlock"))throw Error("Node must be in bnBlock group, but is of type"+e.type.name);const a=n==null?void 0:n.get(e);if(a)return a;const r=ke(e,0);let s=r.bnBlock.node.attrs.id;s===null&&(s=J.options.generateID());const l=t[r.blockNoteType];if(!l)throw Error("Block is of an unrecognized type: "+r.blockNoteType);const c={};for(const[b,y]of Object.entries({...e.attrs,...r.isBlockContainer?r.blockContent.node.attrs:{}})){const v=l.propSchema;b in v&&!(v[b].default===void 0&&y===void 0)&&(c[b]=y)}const u=t[r.blockNoteType],p=[];(g=r.childContainer)==null||g.node.forEach(b=>{p.push(S(b,t,o,i,n))});let m;if(u.content==="inline"){if(!r.isBlockContainer)throw new Error("impossible");m=pe(r.blockContent.node,o,i)}else if(u.content==="table"){if(!r.isBlockContainer)throw new Error("impossible");m=Ue(r.blockContent.node,o,i)}else if(u.content==="none")m=void 0;else throw new j(u.content);const f={id:s,type:u.type,props:c,content:m,children:p};return n==null||n.set(e,f),f}function Re(e,t,o,i){return e.dom.setAttribute("data-inline-content-type",t),Object.entries(o).filter(([n,a])=>{const r=i[n];return a!==r.default}).map(([n,a])=>[ce(n),a]).forEach(([n,a])=>e.dom.setAttribute(n,a)),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function xt(e){return{Backspace:({editor:t})=>{const o=t.state.selection.$from;return t.state.selection.empty&&o.node().type.name===e.type&&o.parentOffset===0}}}function St(e,t){return{config:e,implementation:t}}function Bt(e,t){return St({type:e.name,propSchema:t,content:e.config.content==="inline*"?"styled":"none"},{node:e})}function Ve(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Et(e){return[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function rn(e,t){const o=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 ee(e.propSchema)},addKeyboardShortcuts(){return xt(e)},parseHTML(){return Et(e)},renderHTML({node:i}){const n=this.options.editor,a=t.render(_e(i,n.schema.inlineContentSchema,n.schema.styleSchema),()=>{},n);return Re(a,e.type,i.attrs,e.propSchema)},addNodeView(){return({node:i,getPos:n})=>{const a=this.options.editor,r=t.render(_e(i,a.schema.inlineContentSchema,a.schema.styleSchema),s=>{if(typeof n=="boolean")return;const l=H([s],a._tiptapEditor.schema,a.schema.styleSchema);a.dispatch(a.prosemirrorView.state.tr.replaceWith(n(),n()+i.nodeSize,l))},a);return Re(r,e.type,i.attrs,e.propSchema)}}});return Bt(o,e.propSchema)}function Tt(e){return e==="boolean"?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:t=>t.getAttribute("data-value"),renderHTML:t=>t.stringValue!==void 0?{"data-value":t.stringValue}:{}}}}function It(e,t,o,i){return e.dom.setAttribute("data-style-type",t),i==="string"&&e.dom.setAttribute("data-value",o),e.contentDOM!==void 0&&e.contentDOM.setAttribute("data-editable",""),e}function ze(e,t){return{config:e,implementation:t}}function X(e,t){return ze({type:e.name,propSchema:t},{mark:e})}function Fe(e){return Object.fromEntries(Object.entries(e).map(([t,o])=>[t,o.config]))}function Mt(e){return[{tag:`[data-style-type="${e.type}"]`,contentElement:t=>{const o=t;return o.matches("[data-editable]")?o:o.querySelector("[data-editable]")||o}}]}function sn(e,t){const o=k.Mark.create({name:e.type,addAttributes(){return Tt(e.propSchema)},parseHTML(){return Mt(e)},renderHTML({mark:i}){let n;if(e.propSchema==="boolean")n=t.render();else if(e.propSchema==="string")n=t.render(i.attrs.stringValue);else throw new j(e.propSchema);return It(n,e.type,i.attrs.stringValue,e.propSchema)}});return ze(e,{mark:o})}const he=(e,t)=>{const o=e.querySelector(t);if(!o)return;const i=e.querySelector("figcaption"),n=(i==null?void 0:i.textContent)??void 0;return{targetElement:o,caption:n}},Lt=(e,t,o,i)=>{const n=document.createElement("div");n.className="bn-add-file-button";const a=document.createElement("div");a.className="bn-add-file-button-icon",i?a.appendChild(i):a.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(a);const r=document.createElement("p");r.className="bn-add-file-button-text",r.innerHTML=o||t.dictionary.file_blocks.file.add_button_text,n.appendChild(r);const s=c=>{c.preventDefault()},l=()=>{t.dispatch(t._tiptapEditor.state.tr.setMeta(t.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)}}},Pt='<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>',At=e=>{const t=document.createElement("div");t.className="bn-file-name-with-icon";const o=document.createElement("div");o.className="bn-file-icon",o.innerHTML=Pt,t.appendChild(o);const i=document.createElement("p");return i.className="bn-file-name",i.textContent=e.props.name,t.appendChild(i),{dom:t}},ye=(e,t,o,i,n)=>{const a=document.createElement("div");if(a.className="bn-file-block-content-wrapper",e.props.url===""){const s=Lt(e,t,i,n);a.appendChild(s.dom);const l=t.onUploadStart(c=>{if(c===e.id){a.removeChild(s.dom);const u=document.createElement("div");u.className="bn-file-loading-preview",u.textContent="Loading...",a.appendChild(u)}});return{dom:a,destroy:()=>{l(),s.destroy()}}}const r={dom:a};if(e.props.showPreview===!1||!o){const s=At(e);a.appendChild(s.dom),r.destroy=()=>{var l;(l=s.destroy)==null||l.call(s)}}else a.appendChild(o.dom);if(e.props.caption){const s=document.createElement("p");s.className="bn-file-caption",s.textContent=e.props.caption,a.appendChild(s)}return r},ve=(e,t)=>{const o=document.createElement("figure"),i=document.createElement("figcaption");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},me=(e,t)=>{const o=document.createElement("div"),i=document.createElement("p");return i.textContent=t,o.appendChild(e),o.appendChild(i),{dom:o}},Nt=e=>({url:e.src||void 0}),Dt='<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>',jt={backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0}},Ht={type:"audio",propSchema:jt,content:"none",isFileBlock:!0,fileBlockAccept:["audio/*"]},Ot=(e,t)=>{const o=document.createElement("div");o.innerHTML=Dt;const i=document.createElement("audio");return i.className="bn-audio",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(n=>{i.src=n}):i.src=e.props.url,i.controls=!0,i.contentEditable="false",i.draggable=!1,ye(e,t,{dom:i},t.dictionary.file_blocks.audio.add_button_text,o.firstElementChild)},Ut=e=>{if(e.tagName==="AUDIO")return Nt(e);if(e.tagName==="FIGURE"){const t=he(e,"audio");if(!t)return;const{targetElement:o,caption:i}=t;return{...Nt(o),caption:i}}},Rt=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add audio",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("audio"),t.src=e.props.url):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},Vt=te(Ht,{render:Ot,parse:Ut,toExternalHTML:Rt}),zt=[{id:"text",name:"Plain Text",match:["text","txt","plain"]},...Le.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"]}],Ge=Symbol.for("blocknote.shikiParser"),we=Symbol.for("blocknote.shikiHighlighterPromise"),Ce={language:{default:"javascript",values:[...zt.map(e=>e.id)]}},Ft=K({name:"codeBlock",content:"inline*",group:"blockContent",marks:"",code:!0,defining:!0,addOptions(){return{defaultLanguage:"javascript",indentLineWithTab:!0,supportedLanguages:zt}},addAttributes(){const e=this.options.supportedLanguages;return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var a;let o=t,i=null;(o==null?void 0:o.tagName)==="DIV"&&(o==null?void 0:o.dataset.contentType)==="codeBlock"&&(o=o.children[0]),(o==null?void 0:o.tagName)==="PRE"&&(o=o==null?void 0:o.children[0]);const n=o==null?void 0:o.getAttribute("data-language");if(n)i=n.toLowerCase();else{const s=[...(o==null?void 0:o.className.split(" "))||[]].filter(l=>l.startsWith("language-")).map(l=>l.replace("language-",""));s.length>0&&(i=s[0].toLowerCase())}return i?((a=e.find(({match:r})=>r.includes(i)))==null?void 0:a.id)||this.options.defaultLanguage:null},renderHTML:t=>t.language&&t.language!=="text"?{class:`language-${t.language}`}:{}}}},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]",contentElement:"code"},{tag:"pre",contentElement:"code",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:e}){var n,a;const t=document.createElement("pre"),{dom:o,contentDOM:i}=R(this.name,"code",((n=this.options.domAttributes)==null?void 0:n.blockContent)||{},{...((a=this.options.domAttributes)==null?void 0:a.inlineContent)||{},...e});return o.removeChild(i),o.appendChild(t),t.appendChild(i),{dom:o,contentDOM:i}},addNodeView(){const e=this.options.supportedLanguages;return({editor:t,node:o,getPos:i,HTMLAttributes:n})=>{var p,m;const a=document.createElement("pre"),r=document.createElement("select"),s=document.createElement("div"),{dom:l,contentDOM:c}=R(this.name,"code",{...((p=this.options.domAttributes)==null?void 0:p.blockContent)||{},...n},((m=this.options.domAttributes)==null?void 0:m.inlineContent)||{}),u=f=>{const g=f.target.value;t.commands.command(({tr:b})=>(b.setNodeAttribute(i(),"language",g),!0))};return e.forEach(({id:f,name:g})=>{const b=document.createElement("option");b.value=f,b.text=g,r.appendChild(b)}),s.contentEditable="false",r.value=o.attrs.language||this.options.defaultLanguage,l.removeChild(c),l.appendChild(s),l.appendChild(a),a.appendChild(c),s.appendChild(r),r.addEventListener("change",u),{dom:l,contentDOM:c,update:f=>f.type===this.type,destroy:()=>{r.removeEventListener("change",u)}}}},addProseMirrorPlugins(){const e=this.options.supportedLanguages,t=globalThis;let o,i;const n=r=>{if(!o)return t[we]=t[we]||Le.createHighlighter({themes:["github-dark"],langs:[]}),t[we].then(l=>{o=l});const s=r.language;return s&&s!=="text"&&!o.getLoadedLanguages().includes(s)&&e.find(({id:l})=>l===s)&&Le.bundledLanguagesInfo.find(({id:l})=>l===s)?o.loadLanguage(s):(i||(i=t[Ge]||vi.createParser(o),t[Ge]=i),i(r))};return[yi.createHighlightPlugin({parser:n,languageExtractor:r=>r.attrs.language,nodeTypes:[this.name]})]},addInputRules(){const e=this.options.supportedLanguages;return[new k.InputRule({find:/^```(.*?)\s$/,handler:({state:t,range:o,match:i})=>{var s;const n=t.doc.resolve(o.from),a=i[1].trim(),r={language:((s=e.find(({match:l})=>l.includes(a)))==null?void 0:s.id)||this.options.defaultLanguage};if(!n.node(-1).canReplaceWith(n.index(-1),n.indexAfter(-1),this.type))return null;t.tr.delete(o.from,o.to).setBlockType(o.from,o.from,this.type,r).setSelection(_.TextSelection.create(t.tr.doc,o.from))}})]},addKeyboardShortcuts(){return{Delete:({editor:e})=>{const{selection:t}=e.state,{$from:o}=t;if(e.isActive(this.name)&&!o.parent.textContent&&k.isTextSelection(t)){const i=o.pos-o.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:t}=e.state.selection;if(!e.isActive(this.name))return!1;const o=t.parentOffset===t.parent.nodeSize-2,i=t.parent.textContent.endsWith(`
|
|
6
6
|
|
|
7
7
|
`);return!o||!i?(e.commands.insertContent(`
|
|
8
|
-
`),!0):e.chain().command(({tr:n})=>(n.delete(t.pos-2,t.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:t}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(t.pos-t.parentOffset+t.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Gt=W(Ft,Ce);function ln(e){var t;return W(Ft.configure(e),{language:{default:e.defaultLanguage||Ce.language.default,values:((t=e.supportedLanguages)==null?void 0:t.map(o=>o.id))||Ce.language.values}})}const $t={type:"pageBreak",propSchema:{},content:"none",isFileBlock:!1,isSelectable:!1},Kt=()=>{const e=document.createElement("div");return e.className="bn-page-break",e.setAttribute("data-page-break",""),{dom:e}},Wt=e=>{if(e.tagName==="DIV"&&e.hasAttribute("data-page-break"))return{type:"pageBreak"}},qt=()=>{const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},Xt=te($t,{render:Kt,parse:Wt,toExternalHTML:qt}),dn=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]}}),cn=X(dn,"string"),un=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]}}),pn=X(un,"string"),$e=e=>({url:e.src||void 0}),Zt={backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Jt={type:"file",propSchema:Zt,content:"none",isFileBlock:!0},Yt=(e,t)=>ye(e,t),Qt=e=>{if(e.tagName==="EMBED")return $e(e);if(e.tagName==="FIGURE"){const t=he(e,"embed");if(!t)return;const{targetElement:o,caption:i}=t;return{...$e(o),caption:i}}},eo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add file",{dom:o}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?me(t,e.props.caption):{dom:t}},to=te(Jt,{render:Yt,parse:Qt,toExternalHTML:eo}),T=(e,t,o)=>({state:i,dispatch:n})=>{const a=Q(i.doc.resolve(t));if(n){const r=i.schema.nodes[a.blockNoteType],s=i.schema.nodes[o.type||a.blockNoteType],l=s.isInGroup("bnBlock")?s:i.schema.nodes.blockContainer;if(a.isBlockContainer&&s.isInGroup("blockContent"))oo(o,i,e,a),hn(o,i,e,r,s,a);else if(!a.isBlockContainer&&s.isInGroup("bnBlock"))oo(o,i,e,a);else{const u=S(a.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,q({children:u.children,...o},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(a.bnBlock.beforePos,l,{...a.bnBlock.node.attrs,...o.props})}return!0};function hn(e,t,o,i,n,a){let r="keep";if(e.content)if(typeof e.content=="string")r=H([e.content],t.schema,o.schema.styleSchema);else if(Array.isArray(e.content))r=H(e.content,t.schema,o.schema.styleSchema);else if(e.content.type==="tableContent")r=le(e.content,t.schema,o.schema.styleSchema);else throw new j(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(r=[]);r==="keep"?t.tr.setNodeMarkup(a.blockContent.beforePos,e.type===void 0?void 0:t.schema.nodes[e.type],{...a.blockContent.node.attrs,...e.props}):t.tr.replaceWith(a.blockContent.beforePos,a.blockContent.afterPos,n.createChecked({...a.blockContent.node.attrs,...e.props},r))}function oo(e,t,o,i){if(e.children!==void 0){const n=e.children.map(a=>q(a,t.schema,o.schema.styleSchema));if(i.childContainer)t.tr.step(new be.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new w.Slice(w.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");t.tr.insert(i.blockContent.afterPos,t.schema.nodes.blockGroup.createChecked({},n))}}}function io(e,t,o){const i=e._tiptapEditor,n=typeof t=="string"?t:t.id,a=A(n,i.state.doc);if(!a)throw new Error(`Block with ID ${n} not found`);i.commands.command(({state:s,dispatch:l})=>(T(e,a.posBeforeNode,o)({state:s,dispatch:l}),!0));const r=i.state.doc.resolve(a.posBeforeNode+1).node();return S(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}const no={...B,level:{default:1,values:[1,2,3]}},mn=K({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return ee(no)},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:o,range:i})=>{const n=C(t);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(T(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(T(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(T(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(T(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:t}){var o,i;return R(this.name,`h${e.attrs.level}`,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),fn=W(mn,no),Ke=(e,t,o,i,n,a)=>{const{dom:r,destroy:s}=ye(e,t,o,n,a),l=r;e.props.url&&e.props.showPreview&&(l.style.width=`${e.props.previewWidth}px`);const u=document.createElement("div");u.className="bn-resize-handle",u.style.left="4px";const c=document.createElement("div");c.className="bn-resize-handle",c.style.right="4px";let p,m=e.props.previewWidth;const g=x=>{if(!p){!t.isEditable&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c));return}let O;e.props.textAlignment==="center"?p.handleUsed==="left"?O=p.initialWidth+(p.initialClientX-x.clientX)*2:O=p.initialWidth+(x.clientX-p.initialClientX)*2:p.handleUsed==="left"?O=p.initialWidth+p.initialClientX-x.clientX:O=p.initialWidth+x.clientX-p.initialClientX,m=Math.max(O,64),l.style.width=`${m}px`},f=x=>{(!x.target||!l.contains(x.target)||!t.isEditable)&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c)),p&&(p=void 0,t.updateBlock(e,{props:{previewWidth:m}}))},b=()=>{t.isEditable&&(i.appendChild(u),i.appendChild(c))},y=x=>{x.relatedTarget===u||x.relatedTarget===c||p||t.isEditable&&i.contains(u)&&i.contains(c)&&(i.removeChild(u),i.removeChild(c))},v=x=>{x.preventDefault(),p={handleUsed:"left",initialWidth:l.clientWidth,initialClientX:x.clientX}},M=x=>{x.preventDefault(),p={handleUsed:"right",initialWidth:l.clientWidth,initialClientX:x.clientX}};return window.addEventListener("mousemove",g),window.addEventListener("mouseup",f),l.addEventListener("mouseenter",b),l.addEventListener("mouseleave",y),u.addEventListener("mousedown",v),c.addEventListener("mousedown",M),{dom:l,destroy:()=>{s==null||s(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",f),l.removeEventListener("mouseenter",b),l.removeEventListener("mouseleave",y),u.removeEventListener("mousedown",v),c.removeEventListener("mousedown",M)}}},ao=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},ro='<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>',so={textAlignment:B.textAlignment,backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},lo={type:"image",propSchema:so,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},co=(e,t)=>{const o=document.createElement("div");o.innerHTML=ro;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("img");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.alt=e.props.name||e.props.caption||"BlockNote image",n.contentEditable="false",n.draggable=!1,i.appendChild(n),Ke(e,t,{dom:i},i,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild)},uo=e=>{if(e.tagName==="IMG")return ao(e);if(e.tagName==="FIGURE"){const t=he(e,"img");if(!t)return;const{targetElement:o,caption:i}=t;return{...ao(o),caption:i}}},po=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add image",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("img"),t.src=e.props.url,t.alt=e.props.name||e.props.caption||"BlockNote image",t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},ho=te(lo,{render:co,parse:uo,toExternalHTML:po}),mo=(e,t,o)=>({state:i,dispatch:n})=>{const a=V(i.doc,e),r=F(a);if(!r.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const s=[{type:r.bnBlock.node.type,attrs:o?{...r.bnBlock.node.attrs,id:void 0}:{}},{type:t?r.blockContent.node.type:i.schema.nodes.paragraph,attrs:o?{...r.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,s),!0},We=e=>{const t=e._tiptapEditor,o=C(t.state);if(!o.isBlockContainer)return!1;const{bnBlock:i,blockContent:n}=o,a=t.state.selection.anchor===t.state.selection.head;return!(n.node.type.name==="bulletListItem"||n.node.type.name==="numberedListItem"||n.node.type.name==="checkListItem")||!a?!1:t.commands.first(({state:r,chain:s,commands:l})=>[()=>l.command(()=>n.node.childCount===0?l.command(T(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>l.command(()=>n.node.childCount>0?(s().deleteSelection().command(mo(r.selection.from,!0)).run(),!0):!1)])},gn={...B},bn=K({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(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 t=e.parentElement;return t===null?!1:t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),kn=W(bn,gn),fo={...B,checked:{default:!1}},_n=K({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return ee(fo)},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:o.from,to:o.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(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 t=e.parentElement;if(t===null)return!1;if(t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"){const o=e.querySelector("input[type=checkbox]")||null;return o===null?!1:{checked:o.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var a,r;const o=document.createElement("input");o.type="checkbox",o.checked=e.attrs.checked,e.attrs.checked&&o.setAttribute("checked","");const{dom:i,contentDOM:n}=R(this.name,"p",{...((a=this.options.domAttributes)==null?void 0:a.blockContent)||{},...t},((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{});return i.insertBefore(o,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:o,HTMLAttributes:i})=>{var c,p;const n=document.createElement("div"),a=document.createElement("div");a.contentEditable="false";const r=document.createElement("input");r.type="checkbox",r.checked=e.attrs.checked,e.attrs.checked&&r.setAttribute("checked","");const s=()=>{if(!o.isEditable){r.checked=!r.checked;return}if(typeof t!="boolean"){const m=V(o.state.doc,t());if(m.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${m.node.type.name}`);this.editor.commands.command(T(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:r.checked}}))}};r.addEventListener("change",s);const{dom:l,contentDOM:u}=R(this.name,"p",{...((c=this.options.domAttributes)==null?void 0:c.blockContent)||{},...i},((p=this.options.domAttributes)==null?void 0:p.inlineContent)||{});if(typeof t!="boolean"){const g="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;r.setAttribute("aria-labelledby",g),u.id=g}return l.removeChild(u),l.appendChild(n),n.appendChild(a),n.appendChild(u),a.appendChild(r),{dom:l,contentDOM:u,destroy:()=>{r.removeEventListener("change",s)}}}}}),yn=W(_n,fo),vn=new _.PluginKey("numbered-list-indexing"),wn=()=>new _.Plugin({key:vn,appendTransaction:(e,t,o)=>{const i=o.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return o.doc.descendants((a,r)=>{var s;if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){let l=`${a.firstChild.attrs.start||1}`;const u=F({posBeforeNode:r,node:a});if(!u.isBlockContainer)throw new Error("impossible");const c=i.doc.resolve(u.bnBlock.beforePos).nodeBefore;if(c){const f=F({posBeforeNode:u.bnBlock.beforePos-c.nodeSize,node:c});if(f.blockNoteType==="numberedListItem"){if(!f.isBlockContainer)throw new Error("impossible");const y=f.blockContent.node.attrs.index;l=(parseInt(y)+1).toString()}}const p=u.blockContent.node,m=p.attrs.index,g=((s=c==null?void 0:c.firstChild)==null?void 0:s.type.name)!=="numberedListItem";if(m!==l||p.attrs.start&&!g){n=!0;const{start:f,...b}=p.attrs;i.setNodeMarkup(u.blockContent.beforePos,void 0,{...b,index:l,...typeof f=="number"&&g&&{start:f}})}}}),n?i:null}}),go={...B,start:{default:void 0,type:"number"}},Cn=K({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{...ee(go),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:t,range:o,match:i})=>{const n=C(e);if(!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||n.blockNoteType==="numberedListItem")return;const a=parseInt(i[1]);t().command(T(this.options.editor,n.bnBlock.beforePos,{type:"numberedListItem",props:a===1&&{}||{start:a}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[wn()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;if(t===null)return!1;if(t.tagName==="OL"||t.tagName==="DIV"&&t.parentElement.tagName==="OL"){const o=parseInt(t.getAttribute("start")||"1")||1;return e.previousSibling||o===1?{}:{start:o}}return!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),xn=W(Cn,go),Sn={...B},Bn=K({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(T(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 t;return typeof e=="string"||!((t=e.textContent)!=null&&t.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),En=W(Bn,Sn),Tn=35,qe=120,Mn=31,In=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[U.columnResizing({cellMinWidth:Tn,defaultCellMinWidth:qe,View:null}),U.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,t=e.empty,o=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return t&&o&&i},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(1)(e,t,o)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(-1)(e,t,o))}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",t))}}}),Ln={textColor:B.textColor},Pn=K({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:t})=>{var i;class o extends U.TableView{constructor(a,r,s){super(a,r),this.node=a,this.cellMinWidth=r,this.blockContentHTMLAttributes=s;const l=document.createElement("div");l.className=$("bn-block-content",s.class),l.setAttribute("data-content-type","table");for(const[m,g]of Object.entries(s))m!=="class"&&l.setAttribute(m,g);const u=this.dom,c=document.createElement("div");c.className="tableWrapper-inner",c.appendChild(u.firstChild),u.appendChild(c),l.appendChild(u);const p=document.createElement("div");p.className="table-widgets-container",p.style.position="relative",u.appendChild(p),this.dom=l}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new o(e,qe,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t})}}}),An=k.Node.create({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 t=e.parentElement;return t===null?!1:t.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),Nn=W(Pn,Ln,[In,An,Ti.TableHeader.extend({content:"tableContent"}),Ei.TableCell.extend({content:"tableContent"}),Mi.TableRow]),bo=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},ko='<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>',_o={textAlignment:B.textAlignment,backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},yo={type:"video",propSchema:_o,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},vo=(e,t)=>{const o=document.createElement("div");o.innerHTML=ko;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("video");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.controls=!0,n.contentEditable="false",n.draggable=!1,n.width=e.props.previewWidth,i.appendChild(n),Ke(e,t,{dom:i},i,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild)},wo=e=>{if(e.tagName==="VIDEO")return bo(e);if(e.tagName==="FIGURE"){const t=he(e,"video");if(!t)return;const{targetElement:o,caption:i}=t;return{...bo(o),caption:i}}},Co=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("video"),t.src=e.props.url,t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},xo=te(yo,{render:vo,parse:wo,toExternalHTML:Co}),Xe={paragraph:En,heading:fn,codeBlock:Gt,bulletListItem:kn,numberedListItem:xn,checkListItem:yn,table:Nn,file:to,image:ho,video:xo,audio:zt},So=Oe(Xe),Ze={bold:X(Ui.default,"boolean"),italic:X(zi.default,"boolean"),underline:X(Fi.default,"boolean"),strike:X(Vi.default,"boolean"),code:X(Ri.default,"boolean"),textColor:pn,backgroundColor:cn},Dn=Fe(Ze),Je={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Bo=ze(Je);function N(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===So[e]}function Eo(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===Bo[e]}function To(e,t,o){return t.type===e&&t.type in o.schema.blockSchema&&N(t.type,o)}function jn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function Hn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock&&"showPreview"in t.schema.blockSchema[e.type].propSchema||!1}function On(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function Mo(e,t,o){return t in o.schema.blockSchema&&e in o.schema.blockSchema[t].propSchema&&o.schema.blockSchema[t].propSchema[e]===B[e]}function Un(e,t,o){return Mo(e,t.type,o)}function Rn(e){let t=e.getTextCursorPosition().block,o=e.schema.blockSchema[t.type].content;for(;o==="none";)t=e.getTextCursorPosition().nextBlock,o=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function L(e,t){const o=e.getTextCursorPosition().block;if(o.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(o.content)&&(o.content.length===1&&Y(o.content[0])&&o.content[0].type==="text"&&o.content[0].text==="/"||o.content.length===0)?(i=e.updateBlock(o,t),e.setTextCursorPosition(i)):(i=e.insertBlocks([t],o,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Rn(e),i}function zn(e){const t=[];return N("heading",e)&&t.push({onItemClick:()=>{L(e,{type:"heading",props:{level:1}})},badge:G("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{L(e,{type:"heading",props:{level:2}})},badge:G("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{L(e,{type:"heading",props:{level:3}})},badge:G("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),N("numberedListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"numberedListItem"})},badge:G("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),N("bulletListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"bulletListItem"})},badge:G("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),N("checkListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"checkListItem"})},badge:G("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),N("paragraph",e)&&t.push({onItemClick:()=>{L(e,{type:"paragraph"})},badge:G("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),N("codeBlock",e)&&t.push({onItemClick:()=>{L(e,{type:"codeBlock"})},badge:G("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),N("table",e)&&t.push({onItemClick:()=>{L(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),N("image",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"image",...e.dictionary.slash_menu.image}),N("video",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"video",...e.dictionary.slash_menu.video}),N("audio",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"audio",...e.dictionary.slash_menu.audio}),N("file",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"file",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function Vn(e,t){return e.filter(({title:o,aliases:i})=>o.toLowerCase().includes(t.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}function Ye(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class oe{constructor(t){h(this,"blockSpecs");h(this,"inlineContentSpecs");h(this,"styleSpecs");h(this,"blockSchema");h(this,"inlineContentSchema");h(this,"styleSchema");h(this,"BlockNoteEditor","only for types");h(this,"Block","only for types");h(this,"PartialBlock","only for types");this.blockSpecs=Ye(t==null?void 0:t.blockSpecs)||Xe,this.inlineContentSpecs=Ye(t==null?void 0:t.inlineContentSpecs)||Je,this.styleSpecs=Ye(t==null?void 0:t.styleSpecs)||Ze,this.blockSchema=Oe(this.blockSpecs),this.inlineContentSchema=ze(this.inlineContentSpecs),this.styleSchema=Fe(this.styleSpecs)}static create(t){return new oe(t)}}const Qe=oe.create({blockSpecs:{pageBreak:Xt}}),Fn=e=>oe.create({blockSpecs:{...e.blockSpecs,...Qe.blockSpecs},inlineContentSpecs:e.inlineContentSpecs,styleSpecs:e.styleSpecs});function Io(e){return"pageBreak"in e.schema.blockSchema&&e.schema.blockSchema.pageBreak===Qe.blockSchema.pageBreak}function Gn(e){const t=[];return Io(e)&&t.push({...e.dictionary.slash_menu.page_break,onItemClick:()=>{L(e,{type:"pageBreak"})},key:"page_break"}),t}const $n=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")};function Kn(e,t,o,i="before"){const n=typeof o=="string"?o:o.id,a=[];for(const l of t)a.push(q(l,e.pmSchema,e.schema.styleSchema));const r=A(n,e._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n} not found`);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode,a)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode+r.node.nodeSize,a));const s=[];for(const l of a)s.push(S(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return s}function Wn(e){const t=e._tiptapEditor.state,o=t.selection,i=V(t.doc,o.anchor);if(o instanceof U.CellSelection)return{type:"cell",anchorBlockId:i.node.attrs.id,anchorCellOffset:o.$anchorCell.pos-i.posBeforeNode,headCellOffset:o.$headCell.pos-i.posBeforeNode};if(e._tiptapEditor.state.selection instanceof _.NodeSelection)return{type:"node",anchorBlockId:i.node.attrs.id};{const n=V(t.doc,o.head);return{type:"text",anchorBlockId:i.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:o.anchor-i.posBeforeNode,headOffset:o.head-n.posBeforeNode}}}function qn(e,t){var n,a;const o=(n=A(t.anchorBlockId,e._tiptapEditor.state.doc))==null?void 0:n.posBeforeNode;if(o===void 0)throw new Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let i;if(t.type==="cell")i=U.CellSelection.create(e._tiptapEditor.state.doc,o+t.anchorCellOffset,o+t.headCellOffset);else if(t.type==="node")i=_.NodeSelection.create(e._tiptapEditor.state.doc,o+1);else{const r=(a=A(t.headBlockId,e._tiptapEditor.state.doc))==null?void 0:a.posBeforeNode;if(r===void 0)throw new Error(`Could not find block with ID ${t.headBlockId} to update selection`);i=_.TextSelection.create(e._tiptapEditor.state.doc,o+t.anchorOffset,r+t.headOffset)}e.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function et(e){return e.map(t=>t.type==="columnList"?t.children.map(o=>et(o.children)).flat():{...t,children:et(t.children)}).flat()}function Lo(e,t,o){var a;const i=((a=e.getSelection())==null?void 0:a.blocks)||[e.getTextCursorPosition().block],n=Wn(e);e.removeBlocks(i),e.insertBlocks(et(i),t,o),qn(e,n)}function Po(e){return!e||e.type!=="columnList"}function Ao(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[t.children.length-1],n="after"):(i=t,n="before"):o&&(i=o,n="before"),!i||!n)return;const a=e.getParentBlock(i);return Po(a)?{referenceBlock:i,placement:n}:Ao(e,n==="after"?i:e.getPrevBlock(i),a)}function No(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[0],n="before"):(i=t,n="after"):o&&(i=o,n="after"),!i||!n)return;const a=e.getParentBlock(i);return Po(a)?{referenceBlock:i,placement:n}:No(e,n==="before"?i:e.getNextBlock(i),a)}function Xn(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[0])||e.getTextCursorPosition().block,i=Ao(e,e.getPrevBlock(o),e.getParentBlock(o));i&&Lo(e,i.referenceBlock,i.placement)}function Zn(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[(t==null?void 0:t.blocks.length)-1])||e.getTextCursorPosition().block,i=No(e,e.getNextBlock(o),e.getParentBlock(o));i&&Lo(e,i.referenceBlock,i.placement)}function Jn(e,t){return function({state:o,dispatch:i}){const{$from:n,$to:a}=o.selection,r=n.blockRange(a,c=>c.childCount>0&&(c.type.name==="blockGroup"||c.type.name==="column"));if(!r)return!1;const s=r.startIndex;if(s===0)return!1;const u=r.parent.child(s-1);if(u.type!==e)return!1;if(i){const c=u.lastChild&&u.lastChild.type===t,p=w.Fragment.from(c?e.create():null),m=new w.Slice(w.Fragment.from(e.create(null,w.Fragment.from(t.create(null,p)))),c?3:1,0),g=r.start,f=r.end;i(o.tr.step(new be.ReplaceAroundStep(g-(c?3:1),f,g,f,m,1,!0)).scrollIntoView())}return!0}}function Do(e){return e._tiptapEditor.commands.command(Jn(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function Yn(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function Qn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore!==null}function ea(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).depth>1}function jo(e,t,o){const i=e._tiptapEditor;let n=i.state.tr;const a=[];for(const p of o)a.push(q(p,e.pmSchema,e.schema.styleSchema));const r=new Set(t.map(p=>typeof p=="string"?p:p.id)),s=[],l=typeof t[0]=="string"?t[0]:t[0].id;let u=0;if(i.state.doc.descendants((p,m)=>{if(r.size===0)return!1;if(!p.type.isInGroup("bnBlock")||!r.has(p.attrs.id))return!0;if(s.push(S(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),r.delete(p.attrs.id),o.length>0&&p.attrs.id===l){const y=n.doc.nodeSize;n=n.insert(m,a);const v=n.doc.nodeSize;u+=y-v}const g=n.doc.nodeSize,f=n.doc.resolve(m-u);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-u,m-u+p.nodeSize);const b=n.doc.nodeSize;return u+=g-b,!1}),r.size>0){const p=[...r].join(`
|
|
9
|
-
`);throw Error("Blocks with the following IDs could not be found in the editor: "+p)}e.dispatch(n);const c=[];for(const p of a)c.push(S(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:c,removedBlocks:s}}function ta(e,t,o){return jo(e,t,o)}function oa(e,t){return jo(e,t,[]).removedBlocks}function ia(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(i)return S(i.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function na(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode).nodeBefore;if(a)return S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function aa(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode+i.node.nodeSize).nodeAfter;if(a)return S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ra(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const n=e._tiptapEditor.state.doc.resolve(i.posBeforeNode),a=n.node(),r=n.node(-1),s=r.type.name!=="doc"?a.type.name==="blockGroup"?r:a:void 0;if(s)return S(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function sa(e,t,o,i={updateSelection:!0}){const n=o._tiptapEditor.state.tr;let{from:a,to:r}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,u="";if(t.forEach(c=>{c.check(),s&&c.isText&&c.marks.length===0?u+=c.text:s=!1,l=l?c.isBlock:!1}),a===r&&l){const{parent:c}=n.doc.resolve(a);c.isTextblock&&!c.type.spec.code&&!c.childCount&&(a-=1,r+=1)}return s?n.insertText(u,a,r):n.replaceWith(a,r,t),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),o.dispatch(n),!0}function la(e){const t=e._tiptapEditor.state;if(t.selection.empty||"node"in t.selection)return;const o=t.doc.resolve(V(t.doc,t.selection.from).posBeforeNode),i=t.doc.resolve(V(t.doc,t.selection.to).posBeforeNode),n=(u,c)=>{const p=o.posAtIndex(u,c),m=t.doc.resolve(p).nodeAfter;if(!m)throw new Error(`Error getting selection - node not found at position ${p}`);return S(m,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)},a=[],r=o.sharedDepth(i.pos),s=o.index(r),l=i.index(r);if(o.depth>r){a.push(S(o.nodeAfter,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));for(let u=o.depth;u>r;u--)if(o.node(u).type.isInGroup("childContainer")){const p=o.index(u)+1,m=o.node(u).childCount;for(let g=p;g<m;g++)a.push(n(g,u))}}else a.push(n(s,r));for(let u=s+1;u<=l;u++)a.push(n(u,r));if(a.length===0)throw new Error(`Error getting selection - selection doesn't span any blocks (${t.selection})`);return{blocks:a}}function da(e,t,o){const i=typeof t=="string"?t:t.id,n=typeof o=="string"?o:o.id;if(i===n)throw new Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);const a=e._tiptapEditor.state.doc,r=A(i,a);if(!r)throw new Error(`Block with ID ${i} not found`);const s=A(n,a);if(!s)throw new Error(`Block with ID ${n} not found`);const l=F(r),u=F(s),c=e.schema.blockSchema[l.blockNoteType],p=e.schema.blockSchema[u.blockNoteType];if(!l.isBlockContainer||c.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!u.isBlockContainer||p.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${n})`);let m,g;if(c.content==="table"){const f=U.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(p.content==="table"){const f=U.TableMap.get(u.blockContent.node),b=u.blockContent.beforePos+f.positionAt(f.height-1,f.width-1,u.blockContent.node)+1,y=a.resolve(b).nodeAfter.nodeSize;g=b+y-2}else g=u.blockContent.afterPos-1;e._tiptapEditor.dispatch(e._tiptapEditor.state.tr.setSelection(_.TextSelection.create(e._tiptapEditor.state.doc,m,g)))}function ca(e){const{bnBlock:t}=C(e._tiptapEditor.state),o=e._tiptapEditor.state.doc.resolve(t.beforePos),i=o.nodeBefore,n=e._tiptapEditor.state.doc.resolve(t.afterPos).nodeAfter;let a;return o.depth>1&&(a=o.node(),a.type.isInGroup("bnBlock")||(a=o.node(o.depth-1))),{block:S(t.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:S(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:S(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:a===void 0?void 0:S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function Ho(e,t,o="start"){const i=typeof t=="string"?t:t.id,n=A(i,e._tiptapEditor.state.doc);if(!n)throw new Error(`Block with ID ${i} not found`);const a=F(n),r=e.schema.blockSchema[a.blockNoteType].content;if(a.isBlockContainer){const s=a.blockContent;if(r==="none"){e._tiptapEditor.commands.setNodeSelection(s.beforePos);return}if(r==="inline")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+1):e._tiptapEditor.commands.setTextSelection(s.afterPos-1);else if(r==="table")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+4):e._tiptapEditor.commands.setTextSelection(s.afterPos-4);else throw new j(r)}else{const s=o==="start"?a.childContainer.node.firstChild:a.childContainer.node.lastChild;Ho(e,s.attrs.id,o)}}d.esmDependencies=void 0;async function xe(){if(d.esmDependencies)return d.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 d.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]},d.esmDependencies}function ua(){const e=t=>{let o=t.children.length;for(let i=0;i<o;i++){const n=t.children[i];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){t.children.splice(i,1,...n.children);const a=n.children.length-1;o+=a,i+=a}else t.children.splice(i,1),o--,i--}};return e}function pa(){const e=d.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const t=o=>{var i;if(o.children&&"length"in o.children&&o.children.length)for(let n=o.children.length-1;n>=0;n--){const a=o.children[n],r=n+1<o.children.length?o.children[n+1]:void 0;a.type==="element"&&a.tagName==="input"&&((i=a.properties)==null?void 0:i.type)==="checkbox"&&(r==null?void 0:r.type)==="element"&&r.tagName==="p"?(r.tagName="span",r.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):t(a)}};return t}function Se(e){const t=d.esmDependencies;if(!t)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return t.unified.unified().use(t.rehypeParse.default,{fragment:!0}).use(ua).use(pa).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default,{handlers:{text:i=>i.value}}).processSync(e).value}async function Oo(e,t,o,i){await xe();const a=de(t,o).exportBlocks(e,i);return Se(a)}function ha(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function ma(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function fa(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const o=ha(t),i=t.parentElement,n=Array.from(i.childNodes).slice(o+1);t.remove(),n.forEach(a=>{a.remove()}),i.insertAdjacentElement("afterend",t),n.reverse().forEach(a=>{if(ma(a))return;const r=document.createElement("li");r.append(a),t.insertAdjacentElement("afterend",r)}),i.childNodes.length===0&&i.remove()})}function ga(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var a,r;const o=t.previousElementSibling,i=document.createElement("div");o.insertAdjacentElement("afterend",i),i.append(o);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((a=i.nextElementSibling)==null?void 0:a.nodeName)==="UL"||((r=i.nextElementSibling)==null?void 0:r.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Uo=null;function ba(){return Uo||(Uo=document.implementation.createHTMLDocument("title"))}function Ro(e){if(typeof e=="string"){const t=ba().createElement("div");t.innerHTML=e,e=t}return fa(e),ga(e),e}async function tt(e,t,o,i,n){const a=Ro(e),s=w.DOMParser.fromSchema(n).parse(a,{topNode:n.nodes.blockGroup.create()}),l=[];for(let u=0;u<s.childCount;u++)l.push(S(s.child(u),t,o,i));return l}function ka(e,t){const o=t.value?t.value:"",i={};t.lang&&(i["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:i,children:[{type:"text",value:o}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}async function zo(e,t,o,i,n){const a=await xe(),r=a.unified.unified().use(a.remarkParse.default).use(a.remarkGfm.default).use(a.remarkRehype.default,{handlers:{...a.remarkRehype.defaultHandlers,code:ka}}).use(a.rehypeStringify.default).processSync(e);return tt(r.value,t,o,i,n)}const ot=["vscode-editor-data","blocknote/html","text/html","text/plain","Files"];function _a(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===t}function ya(e,t){const o=e.split("/"),i=t.split("/");if(o.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return o[1]==="*"||i[1]==="*"?o[0]===i[0]:(o[0]==="*"||i[0]==="*"||o[0]===i[0])&&o[1]===i[1]}async function Vo(e,t){var r;if(!t.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const o="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(o===null)return;let i=null;for(const s of ot)if(o.types.includes(s)){i=s;break}if(i!=="Files")return;const n=o.items;if(!n)return;e.preventDefault();const a=Object.values(t.schema.blockSchema).filter(s=>s.isFileBlock);for(let s=0;s<n.length;s++){let l="file";for(const c of a)for(const p of c.fileBlockAccept||[]){const m=p.startsWith("."),g=n[s].getAsFile();if(g&&(!m&&g.type&&ya(n[s].type,p)||m&&_a("."+g.name.split(".").pop(),p))){l=c.type;break}}const u=n[s].getAsFile();if(u){const c={type:l,props:{name:u.name}};let p;if(e.type==="paste")p=t.insertBlocks([c],t.getTextCursorPosition().block,"after")[0].id;else if(e.type==="drop"){const f={left:e.clientX,top:e.clientY},b=(r=t.prosemirrorView)==null?void 0:r.posAtCoords(f);if(!b)return;const y=V(t._tiptapEditor.state.doc,b.pos),v=F(y);p=t.insertBlocks([c],v.bnBlock.node.attrs.id,"after")[0].id}else return;const m=await t.uploadFile(u,p),g=typeof m=="string"?{props:{url:m}}:{...m};t.updateBlock(p,g)}}}const va=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,o){if(!e.isEditable)return;let i=null;for(const n of ot)if(o.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(Vo(o,e),!0):!1}}}})]}});async function wa(e,t){const{schema:o}=t.state;if(!e.clipboardData)return!1;const i=e.clipboardData.getData("text/plain");if(!i)return!1;if(!o.nodes.codeBlock)return t.pasteText(i),!0;const n=e.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=a==null?void 0:a.mode;return r?(t.pasteHTML(`<pre><code class="language-${r}">${i.replace(/\r\n?/g,`
|
|
10
|
-
`)}</code></pre>`),!0):!1}const Ca=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,o){if(o.preventDefault(),!e.isEditable)return;let i;for(const a of ot)if(o.clipboardData.types.includes(a)){i=a;break}if(!i)return!0;if(i==="vscode-editor-data")return wa(o,t),!0;if(i==="Files")return Vo(o,e),!0;let n=o.clipboardData.getData(i);return i==="blocknote/html"?(t.pasteHTML(n),!0):i==="text/html"?(n=Ro(n.trim()).innerHTML,t.pasteHTML(n),!0):(t.pasteText(n),!0)}}}})]}});function Fo(e,t){const o=[];return e.descendants(i=>{var n,a;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((a=i.firstChild)==null||a.forEach(r=>{o.push(S(r,t.blockSchema,t.inlineContentSchema,t.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(o.push(S(i,t.blockSchema,t.inlineContentSchema,t.styleSchema)),!1):!0}),o}function xa(e,t,o){var s;let i=!1;const n=e.state.selection instanceof U.CellSelection;if(!n){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,u=[];for(let c=0;c<l.childCount;c++)u.push(l.child(c));i=u.find(c=>c.type.isInGroup("bnBlock")||c.type.name==="blockGroup"||c.type.spec.group==="blockContent")===void 0,i&&(t=l)}let a;const r=de(e.state.schema,o);if(n){((s=t.firstChild)==null?void 0:s.type.name)==="table"&&(t=t.firstChild.content);const l=Ue(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=`<table>${r.exportInlineContent(l,{})}</table>`}else if(i){const l=pe(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(l,{})}else{const l=Fo(t,o.schema);a=r.exportBlocks(l,{})}return a}function Go(e,t){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&t.dispatch(t._tiptapEditor.state.tr.setSelection(new _.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const o=ct.__serializeForClipboard(e,e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=xa(e,i,t),a=Se(n);return{clipboardHTML:o,externalHTML:n,markdown:a}}const $o=(e,t,o)=>{o.preventDefault(),o.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Go(t,e);o.clipboardData.setData("blocknote/html",i),o.clipboardData.setData("text/html",n),o.clipboardData.setData("text/plain",a)},Sa=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,o){return $o(e,t,o),!0},cut(t,o){return $o(e,t,o),t.editable&&t.dispatch(t.state.tr.deleteSelection()),!0},dragstart(t,o){if(!("node"in t.state.selection)||t.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1)))),o.preventDefault(),o.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Go(t,e);return o.dataTransfer.setData("blocknote/html",i),o.dataTransfer.setData("text/html",n),o.dataTransfer.setData("text/plain",a),!0}}}})]}}),Ba=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:B.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):B.backgroundColor.default,renderHTML:e=>e.backgroundColor===B.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}});class ie{constructor(){h(this,"callbacks",{})}on(t,o){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(o),()=>this.off(t,o)}emit(t,...o){const i=this.callbacks[t];i&&i.forEach(n=>n.apply(this,o))}off(t,o){const i=this.callbacks[t];i&&(o?this.callbacks[t]=i.filter(n=>n!==o):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class Ko{constructor(t,o,i,n){h(this,"state");h(this,"emitUpdate");h(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate()}});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=o,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(t,o){var n,a;const i=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const r=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!r)return;this.state={show:!0,referencePos:r.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!t.state.selection.eq(o.selection)||!t.state.doc.eq(o.doc)||!this.editor.isEditable)&&(a=this.state)!=null&&a.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 it=new _.PluginKey("FilePanelPlugin");class Wo extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>{var o;return(o=this.view)==null?void 0:o.closeMenu()});this.plugin=new _.Plugin({key:it,view:i=>(this.view=new Ko(o,it,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var a;return n.key==="Escape"&&this.shown?((a=this.view)==null||a.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var a;return{block:(a=i.getMeta(it))==null?void 0:a.block}}}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class qo{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"preventHide",!1);h(this,"preventShow",!1);h(this,"shouldShow",({state:t,from:o,to:i,view:n})=>{const{doc:a,selection:r}=t,{empty:s}=r,l=!a.textBetween(o,i).length&&k.isTextSelection(t.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(!n.hasFocus()||s||l)});h(this,"blurHandler",t=>{var i;if(this.preventHide){this.preventHide=!1;return}const o=this.pmView.dom.parentElement;t&&t.relatedTarget&&(o===t.relatedTarget||o.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"viewMousedownHandler",()=>{this.preventShow=!0});h(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});h(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},o.dom.addEventListener("mousedown",this.viewMousedownHandler),o.dom.addEventListener("mouseup",this.viewMouseupHandler),o.dom.addEventListener("dragstart",this.dragHandler),o.dom.addEventListener("dragover",this.dragHandler),o.dom.addEventListener("blur",this.blurHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var p,m;const{state:i,composing:n}=t,{selection:a}=i,r=o&&o.selection.from===i.selection.from&&o.selection.to===i.selection.to;if(n||r)return;const{ranges:s}=a,l=Math.min(...s.map(g=>g.$from.pos)),u=Math.max(...s.map(g=>g.$to.pos)),c=(p=this.shouldShow)==null?void 0:p.call(this,{view:t,state:i,from:l,to:u});if(!this.preventShow&&(c||this.preventHide)){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.dom.removeEventListener("mouseup",this.viewMouseupHandler),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:t}=this.pmView,{selection:o}=t,{ranges:i}=o,n=Math.min(...i.map(r=>r.$from.pos)),a=Math.max(...i.map(r=>r.$to.pos));if(k.isNodeSelection(o)){const r=this.pmView.nodeDOM(n);if(r)return r.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,a)}}const Xo=new _.PluginKey("FormattingToolbarPlugin");class Zo extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Xo,view:i=>(this.view=new qo(o,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 o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}const Jo=(e,t)=>{const o=e.resolve(t);if(o.depth<=1)return;const i=o.posAtIndex(o.index(o.depth-1),o.depth-1);return Q(e.resolve(i))},nt=(e,t)=>{const o=e.resolve(t),i=o.index();if(i===0)return;const n=o.posAtIndex(i-1);return Q(e.resolve(n))},Yo=(e,t)=>{for(;t.childContainer;){const o=t.childContainer.node,i=e.resolve(t.childContainer.beforePos+1).posAtIndex(o.childCount-1);t=Q(e.resolve(i))}return t},Ea=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content==="inline*",Ta=(e,t,o,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),a=e.doc.resolve(i.childContainer.afterPos-1),r=n.blockRange(a);if(t){const s=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(r,s.depth)}}if(t){if(!o.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(o.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},Qo=e=>({state:t,dispatch:o})=>{const i=t.doc.resolve(e),n=Q(i),a=nt(t.doc,n.bnBlock.beforePos);if(!a)return!1;const r=Yo(t.doc,a);return Ea(r,n)?Ta(t,o,r,n):!1},Ma=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const s=a.selection.from===r.blockContent.beforePos+1,l=r.blockContent.node.type.name==="paragraph";return s&&!l?n.command(T(this.options.editor,r.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{blockContent:s}=r;return a.selection.from===s.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,u=a.selection.from===l.beforePos+1,c=a.selection.empty,p=s.beforePos;return u&&c?i().command(Qo(p)).scrollIntoView().run():!1}),()=>n.command(({state:a,dispatch:r})=>{const s=C(a);if(!s.isBlockContainer||!(a.selection.from===s.blockContent.beforePos+1)||nt(a.doc,s.bnBlock.beforePos))return!1;const c=Jo(a.doc,s.bnBlock.beforePos);if((c==null?void 0:c.blockNoteType)!=="column")return!1;const p=c,m=Jo(a.doc,p.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const g=p.childContainer.node.childCount===1,f=g&&m.childContainer.node.childCount===2,b=m.childContainer.node.firstChild===p.bnBlock.node;if(r){const y=a.doc.slice(s.bnBlock.beforePos,s.bnBlock.afterPos,!1);if(f)if(b){a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,p.bnBlock.afterPos+1,m.bnBlock.afterPos-2,y,y.size,!1));const v=a.tr.doc.resolve(p.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(v,v))}else{a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,p.bnBlock.beforePos-1,y,0,!1));const v=a.tr.doc.resolve(a.tr.mapping.map(p.bnBlock.beforePos-1));a.tr.setSelection(_.TextSelection.between(v,v))}else if(g)if(b){a.tr.delete(p.bnBlock.beforePos,p.bnBlock.afterPos),a.tr.insert(m.bnBlock.beforePos,y.content);const v=a.tr.doc.resolve(m.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(v,v))}else a.tr.delete(p.bnBlock.beforePos-1,p.bnBlock.beforePos+1);else{a.tr.delete(s.bnBlock.beforePos,s.bnBlock.afterPos),b?a.tr.insert(m.bnBlock.beforePos-1,y.content):a.tr.insert(p.bnBlock.beforePos-1,y.content);const v=a.tr.doc.resolve(p.bnBlock.beforePos-1);a.tr.setSelection(_.TextSelection.between(v,v))}}return!0}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)throw new Error("todo");const s=a.selection.from===r.blockContent.beforePos+1,l=a.selection.empty,u=nt(a.doc,r.bnBlock.beforePos);if(u&&s&&l){const c=Yo(a.doc,u);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:r.bnBlock.beforePos,to:r.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 a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s,childContainer:l}=a,{depth:u}=n.doc.resolve(r.beforePos),c=r.afterPos===n.doc.nodeSize-3,p=n.selection.from===s.afterPos-1,m=n.selection.empty;if(!c&&p&&m&&!(l!==void 0)){let f=u,b=r.afterPos+1,y=n.doc.resolve(b).depth;for(;y<f;)f=y,b+=2,y=n.doc.resolve(b).depth;return i.command(Qo(b-1))}return!1})]),Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s}=a,{depth:l}=n.doc.resolve(r.beforePos),u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=s.node.childCount===0,m=l>1;return u&&c&&p&&m?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,u=n.selection.$anchor.parentOffset===0,c=n.selection.anchor===n.selection.head,p=l.node.childCount===0;if(u&&c&&p){const m=s.afterPos,g=m+2;if(a){const f=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(m,f).scrollIntoView(),n.tr.setSelection(new _.TextSelection(n.doc.resolve(g)))}return!0}return!1}),()=>i.command(({state:n,chain:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{blockContent:s}=r,l=n.selection.$anchor.parentOffset===0;return s.node.childCount===0?!1:(a().deleteSelection().command(mo(n.selection.from,l,l)).run(),!0)})]),Tab:()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown)?!1:Do(this.options.editor)},"Shift-Tab":()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.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 Ia{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"menuUpdateTimer");h(this,"startMenuUpdateTimer");h(this,"stopMenuUpdateTimer");h(this,"mouseHoveredLinkMark");h(this,"mouseHoveredLinkMarkRange");h(this,"keyboardHoveredLinkMark");h(this,"keyboardHoveredLinkMarkRange");h(this,"linkMark");h(this,"linkMarkRange");h(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const o=t.target,i=this.pmView.posAtDOM(o,0)+1,n=this.pmView.state.doc.resolve(i),a=n.marks();for(const r of a)if(r.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=r,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,r.type,r.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});h(this,"clickHandler",t=>{var i;const o=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(o===t.target||o.contains(t.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,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)},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(t,o){var n;const i=this.pmView.state.tr.insertText(o,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+o.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var t;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())}update(t,o){var r;const{state:i}=t;if(o&&o.selection.from===i.selection.from&&o.selection.to===i.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 s=this.pmView.state.selection.$from.marks();for(const l of s)if(l.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=l,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,l.type,l.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&(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((r=this.state)!=null&&r.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 ei=new _.PluginKey("LinkToolbarPlugin");class ti extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"editLink",(o,i)=>{this.view.editLink(o,i)});h(this,"deleteLink",()=>{this.view.deleteLink()});h(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});h(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:ei,view:i=>(this.view=new Ia(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(o){return this.on("update",o)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}const oi=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],ii="https",La=new _.PluginKey("node-selection-keyboard");class Pa{constructor(){h(this,"plugin");this.plugin=new _.Plugin({key:La,props:{handleKeyDown:(t,o)=>{if("node"in t.state.selection){if(o.ctrlKey||o.metaKey)return!1;if(o.key.length===1)return o.preventDefault(),!0;if(o.key==="Enter"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey){const i=t.state.tr;return t.dispatch(i.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new _.TextSelection(i.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const Aa=new _.PluginKey("blocknote-placeholder");class Na{constructor(t,o){h(this,"plugin");this.plugin=new _.Plugin({key:Aa,view:()=>{var l,u;const i=document.createElement("style"),n=t._tiptapEditor.options.injectNonce;n&&i.setAttribute("nonce",n),((l=t.prosemirrorView)==null?void 0:l.root)instanceof ShadowRoot?t.prosemirrorView.root.append(i):(u=t.prosemirrorView)==null||u.root.head.appendChild(i);const a=i.sheet,r=(c="")=>`.bn-block-content${c} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,s=(c,p=!0)=>{const m=p?"[data-is-empty-and-focused]":"";if(c==="default")return r(m);const g=`[data-content-type="${c}"]`;return r(m+g)};for(const[c,p]of Object.entries(o)){const m=c==="default";try{a.insertRule(`${s(c,m)} { content: ${JSON.stringify(p)}; }`),m||a.insertRule(`${s(c,!0)} { content: ${JSON.stringify(p)}; }`)}catch(g){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)",g)}}return{destroy:()=>{var c,p;((c=t.prosemirrorView)==null?void 0:c.root)instanceof ShadowRoot?t.prosemirrorView.root.removeChild(i):(p=t.prosemirrorView)==null||p.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:n,selection:a}=i;if(!t.isEditable||!a.empty||a.$from.parent.type.spec.code)return;const r=a.$anchor,s=r.parent;if(s.content.size>0)return null;const l=r.before(),u=P.Decoration.node(l,l+s.nodeSize,{"data-is-empty-and-focused":"true"});return P.DecorationSet.create(n,[u])}}})}}const ni=new _.PluginKey("previous-blocks"),Da={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class ja{constructor(){h(this,"plugin");let t;this.plugin=new _.Plugin({key:ni,view(o){return{update:async(i,n)=>{var a;((a=this.key)==null?void 0:a.getState(i.state).updatedBlocks.size)>0&&(t=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(ni,{clearUpdate:!0}))},0))},destroy:()=>{t&&clearTimeout(t)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(o,i,n,a){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!o.docChanged||n.doc.eq(a.doc))return i;const r={},s=k.findChildren(n.doc,c=>c.attrs.id),l=new Map(s.map(c=>[c.node.attrs.id,c])),u=k.findChildren(a.doc,c=>c.attrs.id);for(const c of u){const p=l.get(c.node.attrs.id),m=p==null?void 0:p.node.firstChild,g=c.node.firstChild;if(p&&m&&g){const f={index:g.attrs.index,level:g.attrs.level,type:g.type.name,depth:a.doc.resolve(c.pos).depth};let b={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(p.pos).depth};r[c.node.attrs.id]=b,o.getMeta("numberedListIndexing")&&(c.node.attrs.id in i.prevTransactionOldBlockAttrs&&(b=i.prevTransactionOldBlockAttrs[c.node.attrs.id]),f.type==="numberedListItem"&&(b.index=f.index)),i.currentTransactionOldBlockAttrs[c.node.attrs.id]=b,JSON.stringify(b)!==JSON.stringify(f)&&(b["depth-change"]=b.depth-f.depth,i.updatedBlocks.add(c.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(o){const i=this.getState(o);if(i.updatedBlocks.size===0)return;const n=[];return o.doc.descendants((a,r)=>{if(!a.attrs.id||!i.updatedBlocks.has(a.attrs.id))return;const s=i.currentTransactionOldBlockAttrs[a.attrs.id],l={};for(const[c,p]of Object.entries(s))l["data-prev-"+Da[c]]=p||"none";const u=P.Decoration.node(r,r+a.nodeSize,{...l});n.push(u)}),P.DecorationSet.create(o.doc,n)}}})}}function ai(e,t){var o,i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&((o=e.getAttribute)==null?void 0:o.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 _.Selection{constructor(o,i){super(o,i);h(this,"nodes");const n=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,i.pos,(a,r,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(a),!1})}static create(o,i,n=i){return new ne(o.resolve(i),o.resolve(n))}content(){return new w.Slice(w.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof ne)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let i=0;i<this.nodes.length;i++)if(!this.nodes[i].eq(o.nodes[i]))return!1;return!0}map(o,i){const n=i.mapResult(this.from),a=i.mapResult(this.to);return a.deleted?_.Selection.near(o.resolve(n.pos)):n.deleted?_.Selection.near(o.resolve(a.pos)):new ne(o.resolve(n.pos),o.resolve(a.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let z;function Ha(e,t){let o,i;const n=t.resolve(e.from).node().type.spec.group==="blockContent",a=t.resolve(e.to).node().type.spec.group==="blockContent",r=Math.min(e.$anchor.depth,e.$head.depth);if(n&&a){const s=e.$from.start(r-1),l=e.$to.end(r-1);o=t.resolve(s-1).pos,i=t.resolve(l+1).pos}else o=e.from,i=e.to;return{from:o,to:i}}function ri(e,t,o=t){t===o&&(o+=e.state.doc.resolve(t+1).node().nodeSize);const i=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,a=(c,p)=>Array.prototype.indexOf.call(c.children,p),r=a(n,e.domAtPos(t+1).node.parentElement),s=a(n,e.domAtPos(o-1).node.parentElement);for(let c=n.childElementCount-1;c>=0;c--)(c>s||c<r)&&i.removeChild(i.children[c]);si(e.root),z=i;const u=e.dom.className.split(" ").filter(c=>c!=="ProseMirror"&&c!=="bn-root"&&c!=="bn-editor").join(" ");z.className=z.className+" bn-drag-preview "+u,e.root instanceof ShadowRoot?e.root.appendChild(z):e.root.body.appendChild(z)}function si(e){z!==void 0&&(e instanceof ShadowRoot?e.removeChild(z):e.body.removeChild(z),z=void 0)}function Oa(e,t,o){if(!e.dataTransfer)return;const i=o.prosemirrorView;if(!i)return;const n=A(t.id,i.state.doc);if(!n)throw new Error(`Block with ID ${t.id} not found`);const a=n.posBeforeNode;if(a!=null){const r=i.state.selection,s=i.state.doc,{from:l,to:u}=Ha(r,s),c=l<=a&&a<u,p=r.$anchor.node()!==r.$head.node()||r instanceof ne;c&&p?(i.dispatch(i.state.tr.setSelection(ne.create(s,l,u))),ri(i,l,u)):(i.dispatch(i.state.tr.setSelection(_.NodeSelection.create(i.state.doc,a))),ri(i,a));const m=i.state.selection.content(),g=o.pmSchema,f=ct.__serializeForClipboard(i,m).dom.innerHTML,b=de(g,o),y=Fo(m.content,o.schema),v=b.exportBlocks(y,{}),M=Se(v);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",f),e.dataTransfer.setData("text/html",v),e.dataTransfer.setData("text/plain",M),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(z,0,0)}}const fe=.1;function at(e,t,o,i=!0){const n=e.root.elementsFromPoint(t.left+(o==="editor"?50:0),t.top);for(const a of n)if(e.dom.contains(a))return i&&a.closest("[data-node-type=columnList]")?at(e,{left:t.left+50,top:t.top},o,!1):ai(a,e)}function Ua(e,t,o){if(!t.dom.firstChild)return;const i=t.dom.firstChild.getBoundingClientRect(),n={left:e.x,top:e.y},a=n.left<i.left,r=n.left>i.right;o==="viewport"&&(a&&(n.left=i.left+10),r&&(n.left=i.right-10));let s=at(t,n,o);if(!r&&s){const l=s.node.getBoundingClientRect();n.left=l.right-10,s=at(t,n,"viewport",!1)}return s}class li{constructor(t,o,i,n){h(this,"state");h(this,"emitUpdate");h(this,"mousePos");h(this,"hoveredBlock");h(this,"menuFrozen",!1);h(this,"isDragOrigin",!1);h(this,"updateState",t=>{this.state=t,this.emitUpdate(this.state)});h(this,"updateStateFromMousePos",()=>{var i,n,a,r;if(this.menuFrozen||!this.mousePos)return;const t=Ua(this.mousePos,this.pmView,this.sideMenuDetection);if(!t||!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&&((a=this.hoveredBlock)!=null&&a.hasAttribute("data-id"))&&((r=this.hoveredBlock)==null?void 0:r.getAttribute("data-id"))===t.id)return;this.hoveredBlock=t.node;const o=t.node.firstChild;if(o&&this.editor.isEditable){const s=o.getBoundingClientRect(),l=t.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"))})}});h(this,"onDrop",t=>{var i;if(this.editor._tiptapEditor.commands.blur(),this.isDragOrigin&&!this.pmView.dom.contains(t.target)&&this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),this.sideMenuDetection==="editor"||t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onDragStart",t=>{var o;if(!this.pmView.dragging){const i=(o=t.dataTransfer)==null?void 0:o.getData("blocknote/html");if(!i)return;const n=document.createElement("div");n.innerHTML=i;const r=w.DOMParser.fromSchema(this.pmView.state.schema).parse(n,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new w.Slice(r.content,0,0),move:!0}}});h(this,"onDragOver",t=>{var i;if(this.sideMenuDetection==="editor"||t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onKeyDown",t=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});h(this,"onMouseMove",t=>{var a;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const o=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>o.left&&this.mousePos.x<o.right&&this.mousePos.y>o.top&&this.mousePos.y<o.bottom,n=this.pmView.dom.parentElement;if(i&&t&&t.target&&!(n===t.target||n.contains(t.target))){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});h(this,"onScroll",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.hoveredBlock.getBoundingClientRect(),this.emitUpdate(this.state))});this.editor=t,this.sideMenuDetection=o,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),xe(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),i.root.addEventListener("scroll",this.onScroll,!0)}createSyntheticEvent(t){const o=new Event(t.type,t),i=this.pmView.dom.firstChild.getBoundingClientRect();return o.clientX=t.clientX,o.clientY=t.clientY,t.clientX<i.left&&t.clientX>i.left-i.width*fe?o.clientX=i.left+i.width*fe/2:t.clientX>i.right&&t.clientX<i.right+i.width*fe?o.clientX=i.right-i.width*fe/2:(t.clientX<i.left||t.clientX>i.right)&&(o.clientX=i.left+fe*i.width*2),o.clientY=Math.min(Math.max(t.clientY,i.top),i.top+i.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,o}update(t,o){var n;!o.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var t;(t=this.state)!=null&&t.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("keydown",this.onKeyDown,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0)}}const di=new _.PluginKey("SideMenuPlugin");class ci extends ie{constructor(o,i){super();h(this,"view");h(this,"plugin");h(this,"blockDragStart",(o,i)=>{this.view&&(this.view.isDragOrigin=!0),Oa(o,i,this.editor)});h(this,"blockDragEnd",()=>{this.editor.prosemirrorView&&si(this.editor.prosemirrorView.root),this.view&&(this.view.isDragOrigin=!1)});h(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});h(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=o,this.plugin=new _.Plugin({key:di,view:n=>(this.view=new li(o,i,n,a=>{this.emit("update",a)}),this.view)})}onUpdate(o){return this.on("update",o)}}const Ra=k.findParentNode(e=>e.type.name==="blockContainer");class za{constructor(t,o){h(this,"state");h(this,"emitUpdate");h(this,"rootEl");h(this,"pluginState");h(this,"handleScroll",()=>{var t,o;if((t=this.state)!=null&&t.show){const i=(o=this.rootEl)==null?void 0:o.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});h(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ae,null))});h(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=t,this.pluginState=void 0,this.emitUpdate=a=>{var r;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");o(a,{...this.state,ignoreQueryLength:(r=this.pluginState)==null?void 0:r.ignoreQueryLength})},this.rootEl=(i=this.editor.prosemirrorView)==null?void 0:i.root,(n=this.rootEl)==null||n.addEventListener("scroll",this.handleScroll,!0)}update(t,o){var u;const i=ae.getState(o),n=ae.getState(t.state),a=i===void 0&&n!==void 0,r=i!==void 0&&n===void 0;if(!a&&!(i!==void 0&&n!==void 0)&&!r)return;if(this.pluginState=r?i:n,r||!this.editor.isEditable){this.state.show=!1,this.emitUpdate(this.pluginState.triggerCharacter);return}const l=(u=this.rootEl)==null?void 0:u.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 t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const ae=new _.PluginKey("SuggestionMenuPlugin");class ui extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"triggerCharacters",[]);h(this,"addTriggerCharacter",o=>{this.triggerCharacters.push(o)});h(this,"removeTriggerCharacter",o=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==o)});h(this,"closeMenu",()=>this.view.closeMenu());h(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new _.Plugin({key:ae,view:()=>(this.view=new za(o,(n,a)=>{this.emit(`update ${n}`,a)}),this.view),state:{init(){},apply(n,a,r,s){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return a;const l=n.getMeta(ae);if(typeof l=="object"&&l!==null&&a===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(a===void 0)return a;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||a.triggerCharacter!==void 0&&s.selection.from<a.queryStartPos)return;const u={...a};return u.query=s.doc.textBetween(a.queryStartPos,s.selection.from),u}},props:{handleTextInput(n,a,r,s){const l=this.getState(n.state);return i.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(ae,{triggerCharacter:s})),!0):!1},decorations(n){const a=this.getState(n);if(a===void 0)return null;if(!a.deleteTriggerCharacter){const r=Ra(n.selection);if(r)return P.DecorationSet.create(n.doc,[P.Decoration.node(r.pos,r.pos+r.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}return P.DecorationSet.create(n.doc,[P.Decoration.inline(a.queryStartPos-a.triggerCharacter.length,a.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}}})}onUpdate(o,i){return this.triggerCharacters.includes(o)||this.addTriggerCharacter(o),this.on(`update ${o}`,i)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}function Va(e,t){e.suggestionMenus.addTriggerCharacter(t)}let D;function pi(e){D||(D=document.createElement("div"),D.innerHTML="_",D.style.opacity="0",D.style.height="1px",D.style.width="1px",e instanceof Document?e.body.appendChild(D):e.appendChild(D))}function Fa(e){D&&(e instanceof Document?e.body.removeChild(D):e.removeChild(D),D=void 0)}function Be(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Ga(e){let t=e;for(;t&&t.nodeName!=="TD"&&t.nodeName!=="TH"&&!t.classList.contains("tableWrapper");){if(t.classList.contains("ProseMirror"))return;const o=t.parentNode;if(!o||!(o instanceof Element))return;t=o}return t.nodeName==="TD"||t.nodeName==="TH"?{type:"cell",domNode:t,tbodyNode:t.closest("tbody")}:{type:"wrapper",domNode:t,tbodyNode:t.querySelector("tbody")}}function $a(e,t){const o=t.querySelectorAll(e);for(let i=0;i<o.length;i++)o[i].style.visibility="hidden"}class hi{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"tableId");h(this,"tablePos");h(this,"tableElement");h(this,"menuFrozen",!1);h(this,"mouseState","up");h(this,"prevWasEditable",null);h(this,"viewMousedownHandler",()=>{this.mouseState="down"});h(this,"mouseUpHandler",t=>{this.mouseState="up",this.mouseMoveHandler(t)});h(this,"mouseMoveHandler",t=>{var u,c,p,m;if(this.menuFrozen||this.mouseState==="selecting"||!(t.target instanceof Element)||!this.pmView.dom.contains(t.target))return;const o=Ga(t.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((u=this.state)!=null&&u.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(!o||!this.editor.isEditable){(p=this.state)!=null&&p.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const i=o.tbodyNode.getBoundingClientRect(),n=ai(o.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let a;const r=A(n.id,this.editor._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n.id} not found`);const s=S(r.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(To("table",s,this.editor)&&(this.tablePos=r.posBeforeNode+1,a=s),!a)return;this.tableId=n.id;const l=(m=o.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const g=t.clientY>=i.bottom-1&&t.clientY<i.bottom+20,f=t.clientX>=i.right-1&&t.clientX<i.right+20,b=t.clientX>i.right||t.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:g,showAddOrRemoveColumnsButton:f,referencePosTable:i,block:a,widgetContainer:l,colIndex:b?void 0:this.state.colIndex,rowIndex:b?void 0:this.state.rowIndex,referencePosCell:b?void 0:this.state.referencePosCell}}else{const g=Be(o.domNode),f=Be(o.domNode.parentElement),b=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===f&&this.state.colIndex===g)return;this.state={show:!0,showAddOrRemoveColumnsButton:g===a.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:f===a.content.rows.length-1,referencePosTable:i,block:a,draggingState:void 0,referencePosCell:b,colIndex:g,rowIndex:f,widgetContainer:l}}return this.emitUpdate(),!1});h(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",$a(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(t.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(t.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(o.left,o.top).filter(g=>g.tagName==="TD"||g.tagName==="TH");if(i.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=i[0];let a=!1;const r=Be(n.parentElement),s=Be(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation==="row"?r:s)!==l;(this.state.rowIndex!==r||this.state.colIndex!==s)&&(this.state.rowIndex=r,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),a=!0);const p=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==p&&(this.state.draggingState.mousePos=p,a=!0),a&&this.emitUpdate(),c&&this.editor.dispatch(this.pmView.state.tr.setMeta(re,!0))});h(this,"dropHandler",t=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return;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.");t.preventDefault();const{draggingState:o,colIndex:i,rowIndex:n}=this.state,a=this.state.block.content.rows;if(o.draggedCellOrientation==="row"){const r=a[o.originalIndex];a.splice(o.originalIndex,1),a.splice(n,0,r)}else{const r=a.map(s=>s.cells[o.originalIndex]);a.forEach((s,l)=>{s.cells.splice(o.originalIndex,1),s.cells.splice(i,0,r[l])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:a}}),this.editor.setTextCursorPosition(this.state.block.id)});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const t=this.state.block.content.rows.length,o=this.state.block.content.rows[0].cells.length;this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=o&&(this.state.colIndex=o-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];this.state.referencePosCell=a.getBoundingClientRect()}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 re=new _.PluginKey("TableHandlesPlugin");class mi extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"colDragStart",o=>{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:o.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(re,{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.");pi(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(D,0,0),o.dataTransfer.effectAllowed="move"});h(this,"rowDragStart",o=>{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:o.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(re,{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.");pi(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(D,0,0),o.dataTransfer.effectAllowed="copyMove"});h(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(re,null)),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Fa(this.editor.prosemirrorView.root)});h(this,"freezeHandles",()=>{this.view.menuFrozen=!0});h(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=o,this.plugin=new _.Plugin({key:re,view:i=>(this.view=new hi(o,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 a=[];if(n===this.view.state.draggingState.originalIndex)return P.DecorationSet.create(i.doc,a);const r=i.doc.resolve(this.view.tablePos+1),s=r.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=i.doc.resolve(r.posAtIndex(n)+1),u=l.node();for(let c=0;c<u.childCount;c++){const p=i.doc.resolve(l.posAtIndex(c)+1),m=p.node(),g=p.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);a.push(P.Decoration.widget(g,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.left="0",f.style.right="0",n>this.view.state.draggingState.originalIndex?f.style.bottom="-2px":f.style.top="-3px",f.style.height="4px",f}))}}else for(let l=0;l<s.childCount;l++){const u=i.doc.resolve(r.posAtIndex(l)+1),c=i.doc.resolve(u.posAtIndex(n)+1),p=c.node(),m=c.pos+(n>this.view.state.draggingState.originalIndex?p.nodeSize-2:0);a.push(P.Decoration.widget(m,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.top="0",g.style.bottom="0",n>this.view.state.draggingState.originalIndex?g.style.right="-2px":g.style.left="-3px",g.style.width="4px",g}))}return P.DecorationSet.create(i.doc,a)}}})}onUpdate(o){return this.on("update",o)}}const Ka=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem"],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"],attributes:{textColor:{default:B.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):B.textColor.default,renderHTML:e=>e.textColor===B.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),qa=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,o,i)=>{const{doc:n,tr:a,schema:r}=i,s=e.getState(i),l=n.content.size-2,u=r.nodes.blockContainer,c=r.nodes.paragraph;if(s)return a.insert(l,u.create(void 0,c.create()))},state:{init:(t,o)=>{},apply:(t,o)=>{if(!t.docChanged)return o;let i=t.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*"}}})]}}),Xa={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Za=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 t={};for(const[o,i]of Object.entries(Xa))e.getAttribute(i)&&(t[o]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?t:!1}}]},renderHTML({HTMLAttributes:e}){var n;const t=document.createElement("div");t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter");for(const[a,r]of Object.entries(e))a!=="class"&&t.setAttribute(a,r);const o={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=$("bn-block",o.class),i.setAttribute("data-node-type",this.name);for(const[a,r]of Object.entries(o))a!=="class"&&i.setAttribute(a,r);return t.appendChild(i),{dom:t,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 t={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},o=document.createElement("div");o.className=$("bn-block-group",t.class),o.setAttribute("data-node-type","blockGroup");for(const[n,a]of Object.entries(t))n!=="class"&&o.setAttribute(n,a);return{dom:o,contentDOM:o}}}),Ya=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),fi=e=>{const t={},o=Qa(e);for(const n of o)t[n.name]=n;t.formattingToolbar=new Zo(e.editor),t.linkToolbar=new ti(e.editor),t.sideMenu=new ci(e.editor,e.sideMenuDetection),t.suggestionMenus=new ui(e.editor),t.filePanel=new Wo(e.editor),t.placeholder=new Na(e.editor,e.placeholders),(e.animations??!0)&&(t.animations=new ja),e.tableHandles&&(t.tableHandles=new mi(e.editor)),t.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},t.nodeSelectionKeyboard=new Pa;const i=e.disableExtensions||[];for(const n of i)delete t[n];return t},Qa=e=>{var o;const t=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,Pi.Gapcursor,J.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),Ai.HardBreak.extend({priority:10}),ji.Text,Di.Link.extend({inclusive:!1}).configure({defaultProtocol:ii,protocols:oi}),...Object.values(e.styleSpecs).map(i=>i.implementation.mark),Wa,Ba,Ka,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Ya,Za.configure({editor:e.editor,domAttributes:e.domAttributes}),Ma.configure({editor:e.editor,tabBehavior:e.tabBehavior}),Ja.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(i=>i.config!=="link"&&i.config!=="text").map(i=>i.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(i=>[...(i.implementation.requiredExtensions||[]).map(n=>n.configure({editor:e.editor,domAttributes:e.domAttributes})),i.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),Sa(e.editor),Ca(e.editor),va(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[qa]:[]];if(e.collaboration){t.push(Gi.default.configure({fragment:e.collaboration.fragment}));const i=(o=e.collaboration)==null?void 0:o.provider.awareness;if(i){const n=new Map;e.collaboration.showCursorLabels!=="always"&&i.on("change",({updated:s})=>{for(const l of s){const u=n.get(l);u&&(u.element.setAttribute("data-active",""),u.hideTimeout&&clearTimeout(u.hideTimeout),n.set(l,{element:u.element,hideTimeout:setTimeout(()=>{u.element.removeAttribute("data-active")},2e3)}))}});const a=(s,l,u)=>{var m,g;const c=document.createElement("span");c.classList.add("collaboration-cursor__caret"),c.setAttribute("style",`border-color: ${u}`),((m=e.collaboration)==null?void 0:m.showCursorLabels)==="always"&&c.setAttribute("data-active","");const p=document.createElement("span");return p.classList.add("collaboration-cursor__label"),p.setAttribute("style",`background-color: ${u}`),p.insertBefore(document.createTextNode(l),null),c.insertBefore(document.createTextNode(""),null),c.insertBefore(p,null),c.insertBefore(document.createTextNode(""),null),n.set(s,{element:c,hideTimeout:void 0}),((g=e.collaboration)==null?void 0:g.showCursorLabels)!=="always"&&(c.addEventListener("mouseenter",()=>{const f=n.get(s);f.element.setAttribute("data-active",""),f.hideTimeout&&(clearTimeout(f.hideTimeout),n.set(s,{element:f.element,hideTimeout:void 0}))}),c.addEventListener("mouseleave",()=>{const f=n.get(s);n.set(s,{element:f.element,hideTimeout:setTimeout(()=>{f.element.removeAttribute("data-active")},2e3)})})),n.get(s)},r=s=>{const l=[...i.getStates().entries()].find(c=>c[1].user===s);if(!l)throw new Error("Could not find client state for user");const u=l[0];return(n.get(u)||a(u,s.name,s.color)).element};t.push($i.default.configure({user:e.collaboration.user,render:e.collaboration.renderCursor||r,provider:e.collaboration.provider}))}}else t.push(Ni.History);return t};function er(e,t){const o=[];return e.forEach((i,n,a)=>{a!==t&&o.push(i)}),w.Fragment.from(o)}function tr(e,t){const o=[];for(let i=0;i<e.childCount;i++)if(e.child(i).type.name==="tableRow")if(o.length>0&&o[o.length-1].type.name==="table"){const n=o[o.length-1],a=n.copy(n.content.addToEnd(e.child(i)));o[o.length-1]=a}else{const n=t.nodes.table.createChecked(void 0,e.child(i));o.push(n)}else o.push(e.child(i));return e=w.Fragment.from(o),e}function or(e,t){let o=w.Fragment.from(e.content);if(o=tr(o,t.state.schema),!ir(o,t))return new w.Slice(o,e.openStart,e.openEnd);for(let i=0;i<o.childCount;i++)if(o.child(i).type.spec.group==="blockContent"){const n=[o.child(i)];if(i+1<o.childCount&&o.child(i+1).type.name==="blockGroup"){const r=o.child(i+1).child(0).child(0);(r.type.name==="bulletListItem"||r.type.name==="numberedListItem"||r.type.name==="checkListItem")&&(n.push(o.child(i+1)),o=er(o,i+1))}const a=t.state.schema.nodes.blockContainer.createChecked(void 0,n);o=o.replaceChild(i,a)}return new w.Slice(o,e.openStart,e.openEnd)}function ir(e,t){var a,r;const o=e.childCount===1,i=((a=e.firstChild)==null?void 0:a.type.spec.content)==="inline*",n=((r=e.firstChild)==null?void 0:r.type.spec.content)==="tableRow+";if(o){if(i)return!1;if(n){const s=C(t.state);if(s.isBlockContainer)return!(s.blockContent.node.type.spec.content==="tableRow+")}}return!0}const Me=class Me extends k.Editor{constructor(o,i){super({...o,content:void 0});h(this,"_state");h(this,"_creating",!1);h(this,"mount",o=>{o?(this.options.element=o,this.createViewAlternative()):(this.destroy(),this._creating=!1)});const n=this.schema;let a;const r=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(a)return a;const u=r.apply(n.nodes.doc,l),c=JSON.parse(JSON.stringify(u.toJSON()));return c.content[0].content[0].attrs.id="initialBlockId",a=w.Node.fromJSON(n,c),a};let s;try{const l=o==null?void 0:o.content.map(u=>q(u,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(o.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(o){this.view?this.view.dispatch(o):this._state=this.state.apply(o)}createViewAlternative(){this._creating=!0,queueMicrotask(()=>{if(!this._creating)return;this.view=new P.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0,this._creating=!1})}};h(Me,"create",(o,i)=>{var a,r;const n=(a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout;typeof((r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Me(o,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Ee=Me;Ee.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const nr={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class rt{constructor(t){h(this,"_pmSchema");h(this,"extensions",{});h(this,"headless",!1);h(this,"_tiptapEditor");h(this,"elementRenderer",null);h(this,"blockCache",new WeakMap);h(this,"dictionary");h(this,"schema");h(this,"blockImplementations");h(this,"inlineContentImplementations");h(this,"styleImplementations");h(this,"formattingToolbar");h(this,"linkToolbar");h(this,"sideMenu");h(this,"suggestionMenus");h(this,"filePanel");h(this,"tableHandles");h(this,"uploadFile");h(this,"onUploadStartCallbacks",[]);h(this,"onUploadEndCallbacks",[]);h(this,"resolveFileUrl");h(this,"mount",t=>{this._tiptapEditor.mount(t)});var s,l,u,c,p,m,g;this.options=t;const o=t;if(o.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(o.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(o.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(o.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||ut;const i={defaultStyles:!0,schema:t.schema||oe.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(this.schema=i.schema,this.blockImplementations=i.schema.blockSpecs,this.inlineContentImplementations=i.schema.inlineContentSpecs,this.styleImplementations=i.schema.styleSpecs,this.extensions=fi({editor:this,domAttributes:i.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:i.collaboration,trailingBlock:i.trailingBlock,disableExtensions:i.disableExtensions,setIdAttribute:i.setIdAttribute,animations:i.animations??!0,tableHandles:N("table",this),dropCursor:this.options.dropCursor??Hi.dropCursor,placeholders:i.placeholders,tabBehavior:i.tabBehavior,sideMenuDetection:i.sideMenuDetection||"viewport"}),(((s=i._tiptapOptions)==null?void 0:s.extensions)||[]).forEach(f=>{this.extensions[f.name]=f}),Object.entries(i._extensions||{}).forEach(([f,b])=>{typeof b=="function"&&(b=b(this)),this.extensions[f]=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,i.uploadFile){const f=i.uploadFile;this.uploadFile=async(b,y)=>{this.onUploadStartCallbacks.forEach(v=>v.apply(this,[y]));try{return await f(b,y)}finally{this.onUploadEndCallbacks.forEach(v=>v.apply(this,[y]))}}}this.resolveFileUrl=i.resolveFileUrl,this.headless=i._headless,i.collaboration&&i.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const n=i.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:J.options.generateID()}]);if(!Array.isArray(n)||n.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+n);const a=[...Object.entries(this.extensions).map(([f,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:f,addProseMirrorPlugins:()=>[b.plugin]})})],r={...nr,...i._tiptapOptions,content:n,extensions:a,editorProps:{...(l=i._tiptapOptions)==null?void 0:l.editorProps,attributes:{tabIndex:"0",...(c=(u=i._tiptapOptions)==null?void 0:u.editorProps)==null?void 0:c.attributes,...(p=i.domAttributes)==null?void 0:p.editor,class:$("bn-editor",i.defaultStyles?"bn-default-styles":"",((g=(m=i.domAttributes)==null?void 0:m.editor)==null?void 0:g.class)||"")},transformPasted:or}};this.headless?this._pmSchema=k.getSchema(r.extensions):(this._tiptapEditor=Ee.create(r,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new rt(t)}dispatch(t){this._tiptapEditor.dispatch(t)}get prosemirrorView(){return this._tiptapEditor.view}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 o=this.onUploadStartCallbacks.indexOf(t);o>-1&&this.onUploadStartCallbacks.splice(o,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const o=this.onUploadEndCallbacks.indexOf(t);o>-1&&this.onUploadEndCallbacks.splice(o,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(o=>(t.push(S(o,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){return ia(this,t)}getPrevBlock(t){return na(this,t)}getNextBlock(t){return aa(this,t)}getParentBlock(t){return ra(this,t)}forEachBlock(t,o=!1){const i=this.document.slice();o&&i.reverse();function n(a){for(const r of a){if(t(r)===!1)return!1;const s=o?r.children.slice().reverse():r.children;if(!n(s))return!1}return!0}n(i)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return ca(this)}setTextCursorPosition(t,o="start"){Ho(this,t,o)}getSelection(){return la(this)}setSelection(t,o){da(this,t,o)}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,o,i="before"){return Kn(this,t,o,i)}updateBlock(t,o){return io(this,t,o)}removeBlocks(t){return oa(this,t)}replaceBlocks(t,o){return ta(this,t,o)}insertInlineContent(t){const o=H(t,this.pmSchema,this.schema.styleSchema);sa({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},o,this)}getActiveStyles(){const t={},o=this._tiptapEditor.state.selection.$to.marks();for(const i of o){const n=this.schema.styleSchema[i.type.name];if(!n){i.type.name!=="link"&&console.warn("mark not found in styleschema",i.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=i.attrs.stringValue}return t}addStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(o,{stringValue:i});else throw new j(n.propSchema)}}removeStyles(t){for(const o of Object.keys(t))this._tiptapEditor.commands.unsetMark(o)}toggleStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(o,{stringValue:i});else throw new j(n.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,o){if(t==="")return;const{from:i,to:n}=this._tiptapEditor.state.selection;o||(o=this._tiptapEditor.state.doc.textBetween(i,n));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(o,i,n).addMark(i,i+o.length,a))}canNestBlock(){return Qn(this)}nestBlock(){Do(this)}canUnnestBlock(){return ea(this)}unnestBlock(){Yn(this)}moveBlocksUp(){Xn(this)}moveBlocksDown(){Zn(this)}async blocksToHTMLLossy(t=this.document){return de(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return _t(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return tt(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return Oo(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return zo(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 o=()=>{t(this)};return this._tiptapEditor.on("update",o),()=>{this._tiptapEditor.off("update",o)}}onSelectionChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",o),()=>{this._tiptapEditor.off("selectionUpdate",o)}}openSuggestionMenu(t,o){var a;const i=(a=this.prosemirrorView)==null?void 0:a.state.tr;if(!i)return;const n=o&&o.deleteTriggerCharacter?i.insertText(t):i;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(n.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(o==null?void 0:o.deleteTriggerCharacter)||!1,ignoreQueryLength:(o==null?void 0:o.ignoreQueryLength)||!1}))}}const ar={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"}},rr={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 sr{constructor(t,o,i){this.mappings=o,this.options=i}async resolveFile(t){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(t)).blob();const o=await this.options.resolveFileUrl(t);return o instanceof Blob?o:(await fetch(o)).blob()}mapStyles(t){return Object.entries(t).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(t){return this.mappings.inlineContentMapping[t.type](t,this)}transformInlineContent(t){return t.map(o=>this.mapInlineContent(o))}async mapBlock(t,o,i){return this.mappings.blockMapping[t.type](t,this,o,i)}}function lr(e){return{createBlockMapping:t=>t,createInlineContentMapping:t=>t,createStyleMapping:t=>t}}let Te,st;async function dr(e,t){if(!Eo("text",e))return[];if(!Te){Te=import("@emoji-mart/data"),st=await import("emoji-mart");const n=(await Te).default;await st.init({data:n})}const o=(await Te).default;return(t.trim()===""?Object.values(o.emojis):await st.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function cr(e,...t){const o=[...e];for(const i of t)for(const n of i){const a=o.findLastIndex(r=>r.group===n.group);a===-1?o.push(n):o.splice(a+1,0,n)}return o}function lt(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function ge(e){return typeof e=="string"?lt(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?lt(t):Ae(t)?{...t,content:lt(t.content)}:Y(t)?t:{props:{},...t,content:ge(t.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,rows:e.rows.map(t=>({...t,cells:t.cells.map(o=>ge(o))}))}:e}function ur(e,t){return t.map(o=>dt(e.blockSchema,o))}function dt(e,t){var n;const o=e[t.type].content,i={id:"",type:t.type,props:{},content:o==="inline"?[]:o==="table"?{type:"tableContent",columnWidths:[],rows:[]}:void 0,children:[],...t};if(Object.entries(e[t.type].propSchema).forEach(([a,r])=>{i.props[a]===void 0&&r.default!==void 0&&(i.props[a]=r.default)}),o==="inline"){const a=i.content;i.content=ge(a)}else if(o==="table"){const a=i.content;i.content={type:"tableContent",columnWidths:(a==null?void 0:a.columnWidths)||((n=a==null?void 0:a.rows[0])==null?void 0:n.cells.map(()=>{}))||[],rows:(a==null?void 0:a.rows.map(r=>({cells:r.cells.map(s=>ge(s))})))||[]}}return{...i,content:ge(i.content),children:i.children.map(a=>dt(e,a))}}function gi(e){e.id||(e.id=J.options.generateID()),e.children&&bi(e.children)}function bi(e){for(const t of e)gi(t)}d.AudioBlock=zt,d.BlockNoteEditor=rt,d.BlockNoteSchema=oe,d.COLORS_DARK_MODE_DEFAULT=rr,d.COLORS_DEFAULT=ar,d.CodeBlock=Gt,d.DEFAULT_LINK_PROTOCOL=ii,d.EMPTY_CELL_HEIGHT=Mn,d.EMPTY_CELL_WIDTH=qe,d.Exporter=sr,d.FILE_AUDIO_ICON_SVG=Dt,d.FILE_ICON_SVG=Pt,d.FILE_IMAGE_ICON_SVG=ro,d.FILE_VIDEO_ICON_SVG=ko,d.FileBlock=to,d.FilePanelProsemirrorPlugin=Wo,d.FilePanelView=Ko,d.FormattingToolbarProsemirrorPlugin=Zo,d.FormattingToolbarView=qo,d.HTMLToBlocks=tt,d.ImageBlock=ho,d.LinkToolbarProsemirrorPlugin=ti,d.PageBreak=Xt,d.SideMenuProsemirrorPlugin=ci,d.SideMenuView=li,d.SuggestionMenuProseMirrorPlugin=ui,d.TableHandlesProsemirrorPlugin=mi,d.TableHandlesView=hi,d.UniqueID=J,d.UnreachableCaseError=j,d.VALID_LINK_PROTOCOLS=oi,d.VideoBlock=xo,d.addIdsToBlock=gi,d.addIdsToBlocks=bi,d.addInlineContentAttributes=Re,d.addInlineContentKeyboardShortcuts=xt,d.addStyleAttributes=Mt,d.applyNonSelectableBlockFix=wt,d.assertEmpty=Xi,d.audioBlockConfig=Ht,d.audioParse=Ut,d.audioPropSchema=jt,d.audioRender=Ot,d.audioToExternalHTML=Rt,d.blockToNode=q,d.blocksToMarkdown=Oo,d.camelToDataKebab=ce,d.checkBlockHasDefaultProp=Un,d.checkBlockIsDefaultType=To,d.checkBlockIsFileBlock=jn,d.checkBlockIsFileBlockWithPlaceholder=On,d.checkBlockIsFileBlockWithPreview=Hn,d.checkBlockTypeHasDefaultProp=Mo,d.checkDefaultBlockTypeInSchema=N,d.checkDefaultInlineContentTypeInSchema=Eo,d.checkPageBreakBlocksInSchema=Io,d.cleanHTMLToMarkdown=Se,d.combineByGroup=cr,d.contentNodeToInlineContent=pe,d.contentNodeToTableContent=Ue,d.createAddFileButton=Lt,d.createBlockSpec=te,d.createBlockSpecFromStronglyTypedTiptapNode=W,d.createDefaultBlockDOMOutputSpec=R,d.createExternalHTMLExporter=de,d.createFigureWithCaption=ve,d.createFileBlockWrapper=ye,d.createFileNameWithIcon=At,d.createInlineContentSpec=rn,d.createInlineContentSpecFromTipTapNode=Bt,d.createInternalBlockSpec=He,d.createInternalHTMLSerializer=_t,d.createInternalInlineContentSpec=St,d.createInternalStyleSpec=Ve,d.createLinkWithCaption=me,d.createResizableFileBlockWrapper=Ke,d.createStronglyTypedTiptapNode=K,d.createStyleSpec=sn,d.createStyleSpecFromTipTapMark=X,d.createSuggestionMenu=Va,d.customizeCodeBlock=ln,d.defaultBlockSchema=So,d.defaultBlockSpecs=Xe,d.defaultBlockToHTML=De,d.defaultCodeBlockPropSchema=Ce,d.defaultInlineContentSchema=Bo,d.defaultInlineContentSpecs=Je,d.defaultProps=B,d.defaultStyleSchema=Dn,d.defaultStyleSpecs=Ze,d.fileBlockConfig=Jt,d.fileParse=Qt,d.filePropSchema=Zt,d.fileRender=Yt,d.fileToExternalHTML=eo,d.filenameFromURL=an,d.filterSuggestionItems=Vn,d.formatKeyboardShortcut=G,d.formattingToolbarPluginKey=Xo,d.getBlockFromPos=vt,d.getBlockInfo=F,d.getBlockInfoFromResolvedPos=Q,d.getBlockInfoFromSelection=C,d.getBlockInfoWithManualOffset=ke,d.getBlockNoteExtensions=fi,d.getBlockSchemaFromSpecs=Oe,d.getDefaultEmojiPickerItems=dr,d.getDefaultSlashMenuItems=zn,d.getInlineContentParseRules=Et,d.getInlineContentSchemaFromSpecs=ze,d.getNearestBlockPos=V,d.getNodeById=A,d.getPageBreakSlashMenuItems=Gn,d.getParseRules=Ct,d.getStyleParseRules=It,d.getStyleSchemaFromSpecs=Fe,d.imageBlockConfig=lo,d.imageParse=uo,d.imagePropSchema=so,d.imageRender=co,d.imageToExternalHTML=po,d.inheritedProps=je,d.initializeESMDependencies=xe,d.inlineContentToNodes=H,d.insertOrUpdateBlock=L,d.isAppleOS=yt,d.isLinkInlineContent=Pe,d.isPartialLinkInlineContent=Ae,d.isSafari=nn,d.isStyledTextInlineContent=Y,d.linkToolbarPluginKey=ei,d.locales=qi,d.mappingFactory=lr,d.markdownToBlocks=zo,d.mergeCSSClasses=$,d.nodeToBlock=S,d.nodeToCustomInlineContent=_e,d.pageBreakConfig=$t,d.pageBreakParse=Wt,d.pageBreakRender=Kt,d.pageBreakSchema=Qe,d.pageBreakToExternalHTML=qt,d.parseEmbedElement=$e,d.parseFigureElement=he,d.partialBlockToBlockForTesting=dt,d.partialBlocksToBlocksForTesting=ur,d.propsToAttributes=ee,d.shikiHighlighterPromiseSymbol=we,d.shikiParserSymbol=Ge,d.sideMenuPluginKey=di,d.stylePropsToAttributes=Tt,d.tableContentToNodes=le,d.tableHandlesPluginKey=re,d.updateBlock=io,d.updateBlockCommand=T,d.uploadToTmpFilesDotOrg_DEV_ONLY=$n,d.videoBlockConfig=yo,d.videoParse=wo,d.videoPropSchema=_o,d.videoRender=vo,d.videoToExternalHTML=Co,d.withPageBreak=Fn,d.wrapInBlockStructure=ue,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
8
|
+
`),!0):e.chain().command(({tr:n})=>(n.delete(t.pos-2,t.pos),!0)).exitCode().run()},"Shift-Enter":({editor:e})=>{const{$from:t}=e.state.selection;return e.isActive(this.name)?(e.chain().insertContentAt(t.pos-t.parentOffset+t.parent.nodeSize,{type:"paragraph"}).run(),!0):!1}}}}),Gt=W(Ft,Ce);function ln(e){var t;return W(Ft.configure(e),{language:{default:e.defaultLanguage||Ce.language.default,values:((t=e.supportedLanguages)==null?void 0:t.map(o=>o.id))||Ce.language.values}})}const $t={type:"pageBreak",propSchema:{},content:"none",isFileBlock:!1,isSelectable:!1},Kt=()=>{const e=document.createElement("div");return e.className="bn-page-break",e.setAttribute("data-page-break",""),{dom:e}},Wt=e=>{if(e.tagName==="DIV"&&e.hasAttribute("data-page-break"))return{type:"pageBreak"}},qt=()=>{const e=document.createElement("div");return e.setAttribute("data-page-break",""),{dom:e}},Xt=te($t,{render:Kt,parse:Wt,toExternalHTML:qt}),dn=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]}}),cn=X(dn,"string"),un=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]}}),pn=X(un,"string"),$e=e=>({url:e.src||void 0}),Zt={backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""}},Jt={type:"file",propSchema:Zt,content:"none",isFileBlock:!0},Yt=(e,t)=>ye(e,t),Qt=e=>{if(e.tagName==="EMBED")return $e(e);if(e.tagName==="FIGURE"){const t=he(e,"embed");if(!t)return;const{targetElement:o,caption:i}=t;return{...$e(o),caption:i}}},eo=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add file",{dom:o}}const t=document.createElement("a");return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?me(t,e.props.caption):{dom:t}},to=te(Jt,{render:Yt,parse:Qt,toExternalHTML:eo}),T=(e,t,o)=>({state:i,dispatch:n})=>{const a=Q(i.doc.resolve(t));if(n){const r=i.schema.nodes[a.blockNoteType],s=i.schema.nodes[o.type||a.blockNoteType],l=s.isInGroup("bnBlock")?s:i.schema.nodes.blockContainer;if(a.isBlockContainer&&s.isInGroup("blockContent"))oo(o,i,e,a),hn(o,i,e,r,s,a);else if(!a.isBlockContainer&&s.isInGroup("bnBlock"))oo(o,i,e,a);else{const c=S(a.bnBlock.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache);return i.tr.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,q({children:c.children,...o},i.schema,e.schema.styleSchema)),!0}i.tr.setNodeMarkup(a.bnBlock.beforePos,l,{...a.bnBlock.node.attrs,...o.props})}return!0};function hn(e,t,o,i,n,a){let r="keep";if(e.content)if(typeof e.content=="string")r=H([e.content],t.schema,o.schema.styleSchema,n.name);else if(Array.isArray(e.content))r=H(e.content,t.schema,o.schema.styleSchema,n.name);else if(e.content.type==="tableContent")r=le(e.content,t.schema,o.schema.styleSchema);else throw new j(e.content.type);else i.spec.content===""||n.spec.content!==i.spec.content&&(r=[]);r==="keep"?t.tr.setNodeMarkup(a.blockContent.beforePos,e.type===void 0?void 0:t.schema.nodes[e.type],{...a.blockContent.node.attrs,...e.props}):t.tr.replaceWith(a.blockContent.beforePos,a.blockContent.afterPos,n.createChecked({...a.blockContent.node.attrs,...e.props},r))}function oo(e,t,o,i){if(e.children!==void 0){const n=e.children.map(a=>q(a,t.schema,o.schema.styleSchema));if(i.childContainer)t.tr.step(new be.ReplaceStep(i.childContainer.beforePos+1,i.childContainer.afterPos-1,new w.Slice(w.Fragment.from(n),0,0)));else{if(!i.isBlockContainer)throw new Error("impossible");t.tr.insert(i.blockContent.afterPos,t.schema.nodes.blockGroup.createChecked({},n))}}}function io(e,t,o){const i=e._tiptapEditor,n=typeof t=="string"?t:t.id,a=A(n,i.state.doc);if(!a)throw new Error(`Block with ID ${n} not found`);i.commands.command(({state:s,dispatch:l})=>(T(e,a.posBeforeNode,o)({state:s,dispatch:l}),!0));const r=i.state.doc.resolve(a.posBeforeNode+1).node();return S(r,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}const no={...B,level:{default:1,values:[1,2,3]}},mn=K({name:"heading",content:"inline*",group:"blockContent",addAttributes(){return ee(no)},addInputRules(){return[...[1,2,3].map(e=>new k.InputRule({find:new RegExp(`^(#{${e}})\\s$`),handler:({state:t,chain:o,range:i})=>{const n=C(t);!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||o().command(T(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(T(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(T(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(T(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:t}){var o,i;return R(this.name,`h${e.attrs.level}`,{...((o=this.options.domAttributes)==null?void 0:o.blockContent)||{},...t},((i=this.options.domAttributes)==null?void 0:i.inlineContent)||{})}}),fn=W(mn,no),Ke=(e,t,o,i,n,a)=>{const{dom:r,destroy:s}=ye(e,t,o,n,a),l=r;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 u=document.createElement("div");u.className="bn-resize-handle",u.style.right="4px";let p,m=e.props.previewWidth;const f=x=>{if(!p){!t.isEditable&&i.contains(c)&&i.contains(u)&&(i.removeChild(c),i.removeChild(u));return}let O;e.props.textAlignment==="center"?p.handleUsed==="left"?O=p.initialWidth+(p.initialClientX-x.clientX)*2:O=p.initialWidth+(x.clientX-p.initialClientX)*2:p.handleUsed==="left"?O=p.initialWidth+p.initialClientX-x.clientX:O=p.initialWidth+x.clientX-p.initialClientX,m=Math.max(O,64),l.style.width=`${m}px`},g=x=>{(!x.target||!l.contains(x.target)||!t.isEditable)&&i.contains(c)&&i.contains(u)&&(i.removeChild(c),i.removeChild(u)),p&&(p=void 0,t.updateBlock(e,{props:{previewWidth:m}}))},b=()=>{t.isEditable&&(i.appendChild(c),i.appendChild(u))},y=x=>{x.relatedTarget===c||x.relatedTarget===u||p||t.isEditable&&i.contains(c)&&i.contains(u)&&(i.removeChild(c),i.removeChild(u))},v=x=>{x.preventDefault(),p={handleUsed:"left",initialWidth:l.clientWidth,initialClientX:x.clientX}},I=x=>{x.preventDefault(),p={handleUsed:"right",initialWidth:l.clientWidth,initialClientX:x.clientX}};return window.addEventListener("mousemove",f),window.addEventListener("mouseup",g),l.addEventListener("mouseenter",b),l.addEventListener("mouseleave",y),c.addEventListener("mousedown",v),u.addEventListener("mousedown",I),{dom:l,destroy:()=>{s==null||s(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",g),l.removeEventListener("mouseenter",b),l.removeEventListener("mouseleave",y),c.removeEventListener("mousedown",v),u.removeEventListener("mousedown",I)}}},ao=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},ro='<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>',so={textAlignment:B.textAlignment,backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},lo={type:"image",propSchema:so,content:"none",isFileBlock:!0,fileBlockAccept:["image/*"]},co=(e,t)=>{const o=document.createElement("div");o.innerHTML=ro;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("img");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.alt=e.props.name||e.props.caption||"BlockNote image",n.contentEditable="false",n.draggable=!1,i.appendChild(n),Ke(e,t,{dom:i},i,t.dictionary.file_blocks.image.add_button_text,o.firstElementChild)},uo=e=>{if(e.tagName==="IMG")return ao(e);if(e.tagName==="FIGURE"){const t=he(e,"img");if(!t)return;const{targetElement:o,caption:i}=t;return{...ao(o),caption:i}}},po=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add image",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("img"),t.src=e.props.url,t.alt=e.props.name||e.props.caption||"BlockNote image",t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},ho=te(lo,{render:co,parse:uo,toExternalHTML:po}),mo=(e,t,o)=>({state:i,dispatch:n})=>{const a=z(i.doc,e),r=F(a);if(!r.isBlockContainer)throw new Error(`BlockContainer expected when calling splitBlock, position ${e}`);const s=[{type:r.bnBlock.node.type,attrs:o?{...r.bnBlock.node.attrs,id:void 0}:{}},{type:t?r.blockContent.node.type:i.schema.nodes.paragraph,attrs:o?{...r.blockContent.node.attrs}:{}}];return n&&i.tr.split(e,2,s),!0},We=e=>{const t=e._tiptapEditor,o=C(t.state);if(!o.isBlockContainer)return!1;const{bnBlock:i,blockContent:n}=o,a=t.state.selection.anchor===t.state.selection.head;return!(n.node.type.name==="bulletListItem"||n.node.type.name==="numberedListItem"||n.node.type.name==="checkListItem")||!a?!1:t.commands.first(({state:r,chain:s,commands:l})=>[()=>l.command(()=>n.node.childCount===0?l.command(T(e,i.beforePos,{type:"paragraph",props:{}})):!1),()=>l.command(()=>n.node.childCount>0?(s().deleteSelection().command(mo(r.selection.from,!0)).run(),!0):!1)])},gn={...B},bn=K({name:"bulletListItem",content:"inline*",group:"blockContent",priority:90,addInputRules(){return[new k.InputRule({find:new RegExp("^[-+*]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"bulletListItem",props:{}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(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 t=e.parentElement;return t===null?!1:t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"?{}:!1},node:"bulletListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="bulletListItem"?{}:!1},priority:300,node:"bulletListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),kn=W(bn,gn),fo={...B,checked:{default:!1}},_n=K({name:"checkListItem",content:"inline*",group:"blockContent",addAttributes(){return ee(fo)},addInputRules(){return[new k.InputRule({find:new RegExp("\\[\\s*\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!1}})).deleteRange({from:o.from,to:o.to})}}),new k.InputRule({find:new RegExp("\\[[Xx]\\]\\s$"),handler:({state:e,chain:t,range:o})=>{const i=C(e);!i.isBlockContainer||i.blockContent.node.type.spec.content!=="inline*"||t().command(T(this.options.editor,i.bnBlock.beforePos,{type:"checkListItem",props:{checked:!0}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(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 t=e.parentElement;if(t===null)return!1;if(t.tagName==="UL"||t.tagName==="DIV"&&t.parentElement.tagName==="UL"){const o=e.querySelector("input[type=checkbox]")||null;return o===null?!1:{checked:o.checked}}return!1},node:"checkListItem"}]},renderHTML({node:e,HTMLAttributes:t}){var a,r;const o=document.createElement("input");o.type="checkbox",o.checked=e.attrs.checked,e.attrs.checked&&o.setAttribute("checked","");const{dom:i,contentDOM:n}=R(this.name,"p",{...((a=this.options.domAttributes)==null?void 0:a.blockContent)||{},...t},((r=this.options.domAttributes)==null?void 0:r.inlineContent)||{});return i.insertBefore(o,n),{dom:i,contentDOM:n}},addNodeView(){return({node:e,getPos:t,editor:o,HTMLAttributes:i})=>{var u,p;const n=document.createElement("div"),a=document.createElement("div");a.contentEditable="false";const r=document.createElement("input");r.type="checkbox",r.checked=e.attrs.checked,e.attrs.checked&&r.setAttribute("checked","");const s=()=>{if(!o.isEditable){r.checked=!r.checked;return}if(typeof t!="boolean"){const m=z(o.state.doc,t());if(m.node.type.name!=="blockContainer")throw new Error(`Expected blockContainer node, got ${m.node.type.name}`);this.editor.commands.command(T(this.options.editor,m.posBeforeNode,{type:"checkListItem",props:{checked:r.checked}}))}};r.addEventListener("change",s);const{dom:l,contentDOM:c}=R(this.name,"p",{...((u=this.options.domAttributes)==null?void 0:u.blockContent)||{},...i},((p=this.options.domAttributes)==null?void 0:p.inlineContent)||{});if(typeof t!="boolean"){const f="label-"+this.editor.state.doc.resolve(t()).node().attrs.id;r.setAttribute("aria-labelledby",f),c.id=f}return l.removeChild(c),l.appendChild(n),n.appendChild(a),n.appendChild(c),a.appendChild(r),{dom:l,contentDOM:c,destroy:()=>{r.removeEventListener("change",s)}}}}}),yn=W(_n,fo),vn=new _.PluginKey("numbered-list-indexing"),wn=()=>new _.Plugin({key:vn,appendTransaction:(e,t,o)=>{const i=o.tr;i.setMeta("numberedListIndexing",!0);let n=!1;return o.doc.descendants((a,r)=>{var s;if(a.type.name==="blockContainer"&&a.firstChild.type.name==="numberedListItem"){let l=`${a.firstChild.attrs.start||1}`;const c=F({posBeforeNode:r,node:a});if(!c.isBlockContainer)throw new Error("impossible");const u=i.doc.resolve(c.bnBlock.beforePos).nodeBefore;if(u){const g=F({posBeforeNode:c.bnBlock.beforePos-u.nodeSize,node:u});if(g.blockNoteType==="numberedListItem"){if(!g.isBlockContainer)throw new Error("impossible");const y=g.blockContent.node.attrs.index;l=(parseInt(y)+1).toString()}}const p=c.blockContent.node,m=p.attrs.index,f=((s=u==null?void 0:u.firstChild)==null?void 0:s.type.name)!=="numberedListItem";if(m!==l||p.attrs.start&&!f){n=!0;const{start:g,...b}=p.attrs;i.setNodeMarkup(c.blockContent.beforePos,void 0,{...b,index:l,...typeof g=="number"&&f&&{start:g}})}}}),n?i:null}}),go={...B,start:{default:void 0,type:"number"}},Cn=K({name:"numberedListItem",content:"inline*",group:"blockContent",priority:90,addAttributes(){return{...ee(go),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:t,range:o,match:i})=>{const n=C(e);if(!n.isBlockContainer||n.blockContent.node.type.spec.content!=="inline*"||n.blockNoteType==="numberedListItem")return;const a=parseInt(i[1]);t().command(T(this.options.editor,n.bnBlock.beforePos,{type:"numberedListItem",props:a===1&&{}||{start:a}})).deleteRange({from:o.from,to:o.to})}})]},addKeyboardShortcuts(){return{Enter:()=>We(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(T(this.options.editor,e.bnBlock.beforePos,{type:"numberedListItem",props:{}}))}}},addProseMirrorPlugins(){return[wn()]},parseHTML(){return[{tag:"div[data-content-type="+this.name+"]"},{tag:"li",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;if(t===null)return!1;if(t.tagName==="OL"||t.tagName==="DIV"&&t.parentElement.tagName==="OL"){const o=parseInt(t.getAttribute("start")||"1")||1;return e.previousSibling||o===1?{}:{start:o}}return!1},node:"numberedListItem"},{tag:"p",getAttrs:e=>{if(typeof e=="string")return!1;const t=e.parentElement;return t===null?!1:t.getAttribute("data-content-type")==="numberedListItem"?{}:!1},priority:300,node:"numberedListItem"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),xn=W(Cn,go),Sn={...B},Bn=K({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(T(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 t;return typeof e=="string"||!((t=e.textContent)!=null&&t.trim())?!1:{}},node:"paragraph"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"p",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})}}),En=W(Bn,Sn),Tn=35,qe=120,In=31,Mn=k.Extension.create({name:"BlockNoteTableExtension",addProseMirrorPlugins:()=>[U.columnResizing({cellMinWidth:Tn,defaultCellMinWidth:qe,View:null}),U.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,t=e.empty,o=e.$head.parentOffset===0,i=e.$head.node().type.name==="tableParagraph";return t&&o&&i},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(1)(e,t,o)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:o})=>U.goToNextCell(-1)(e,t,o))}},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:k.callOrReturn(k.getExtensionField(e,"tableRole",t))}}}),Ln={textColor:B.textColor},Pn=K({name:"table",content:"tableRow+",group:"blockContent",tableRole:"table",isolating:!0,parseHTML(){return[{tag:"table"}]},renderHTML({HTMLAttributes:e}){var t,o;return R(this.name,"table",{...((t=this.options.domAttributes)==null?void 0:t.blockContent)||{},...e},((o=this.options.domAttributes)==null?void 0:o.inlineContent)||{})},addNodeView(){return({node:e,HTMLAttributes:t})=>{var i;class o extends U.TableView{constructor(a,r,s){super(a,r),this.node=a,this.cellMinWidth=r,this.blockContentHTMLAttributes=s;const l=document.createElement("div");l.className=$("bn-block-content",s.class),l.setAttribute("data-content-type","table");for(const[m,f]of Object.entries(s))m!=="class"&&l.setAttribute(m,f);const c=this.dom,u=document.createElement("div");u.className="tableWrapper-inner",u.appendChild(c.firstChild),c.appendChild(u),l.appendChild(c);const p=document.createElement("div");p.className="table-widgets-container",p.style.position="relative",c.appendChild(p),this.dom=l}ignoreMutation(a){return!a.target.closest(".tableWrapper-inner")||super.ignoreMutation(a)}}return new o(e,qe,{...((i=this.options.domAttributes)==null?void 0:i.blockContent)||{},...t})}}}),An=k.Node.create({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 t=e.parentElement;return t===null?!1:t.tagName==="TD"?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["p",e,0]}}),Nn=W(Pn,Ln,[Mn,An,Ti.TableHeader.extend({content:"tableContent"}),Ei.TableCell.extend({content:"tableContent"}),Ii.TableRow]),bo=e=>{const t=e.src||void 0,o=e.width||void 0;return{url:t,previewWidth:o}},ko='<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>',_o={textAlignment:B.textAlignment,backgroundColor:B.backgroundColor,name:{default:""},url:{default:""},caption:{default:""},showPreview:{default:!0},previewWidth:{default:512}},yo={type:"video",propSchema:_o,content:"none",isFileBlock:!0,fileBlockAccept:["video/*"]},vo=(e,t)=>{const o=document.createElement("div");o.innerHTML=ko;const i=document.createElement("div");i.className="bn-visual-media-wrapper";const n=document.createElement("video");return n.className="bn-visual-media",t.resolveFileUrl?t.resolveFileUrl(e.props.url).then(a=>{n.src=a}):n.src=e.props.url,n.controls=!0,n.contentEditable="false",n.draggable=!1,n.width=e.props.previewWidth,i.appendChild(n),Ke(e,t,{dom:i},i,t.dictionary.file_blocks.video.add_button_text,o.firstElementChild)},wo=e=>{if(e.tagName==="VIDEO")return bo(e);if(e.tagName==="FIGURE"){const t=he(e,"video");if(!t)return;const{targetElement:o,caption:i}=t;return{...bo(o),caption:i}}},Co=e=>{if(!e.props.url){const o=document.createElement("p");return o.textContent="Add video",{dom:o}}let t;return e.props.showPreview?(t=document.createElement("video"),t.src=e.props.url,t.width=e.props.previewWidth):(t=document.createElement("a"),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?ve(t,e.props.caption):me(t,e.props.caption):{dom:t}},xo=te(yo,{render:vo,parse:wo,toExternalHTML:Co}),Xe={paragraph:En,heading:fn,codeBlock:Gt,bulletListItem:kn,numberedListItem:xn,checkListItem:yn,table:Nn,file:to,image:ho,video:xo,audio:Vt},So=Oe(Xe),Ze={bold:X(Ui.default,"boolean"),italic:X(Vi.default,"boolean"),underline:X(Fi.default,"boolean"),strike:X(zi.default,"boolean"),code:X(Ri.default,"boolean"),textColor:pn,backgroundColor:cn},Dn=Fe(Ze),Je={text:{config:"text",implementation:{}},link:{config:"link",implementation:{}}},Bo=Ve(Je);function N(e,t){return e in t.schema.blockSchema&&t.schema.blockSchema[e]===So[e]}function Eo(e,t){return e in t.schema.inlineContentSchema&&t.schema.inlineContentSchema[e]===Bo[e]}function To(e,t,o){return t.type===e&&t.type in o.schema.blockSchema&&N(t.type,o)}function jn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock||!1}function Hn(e,t){return e.type in t.schema.blockSchema&&t.schema.blockSchema[e.type].isFileBlock&&"showPreview"in t.schema.blockSchema[e.type].propSchema||!1}function On(e,t){return t.schema.blockSchema[e.type].isFileBlock&&!e.props.url}function Io(e,t,o){return t in o.schema.blockSchema&&e in o.schema.blockSchema[t].propSchema&&o.schema.blockSchema[t].propSchema[e]===B[e]}function Un(e,t,o){return Io(e,t.type,o)}function Rn(e){let t=e.getTextCursorPosition().block,o=e.schema.blockSchema[t.type].content;for(;o==="none";)t=e.getTextCursorPosition().nextBlock,o=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,"end")}function L(e,t){const o=e.getTextCursorPosition().block;if(o.content===void 0)throw new Error("Slash Menu open in a block that doesn't contain content.");let i;return Array.isArray(o.content)&&(o.content.length===1&&Y(o.content[0])&&o.content[0].type==="text"&&o.content[0].text==="/"||o.content.length===0)?(i=e.updateBlock(o,t),e.setTextCursorPosition(i)):(i=e.insertBlocks([t],o,"after")[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),Rn(e),i}function Vn(e){const t=[];return N("heading",e)&&t.push({onItemClick:()=>{L(e,{type:"heading",props:{level:1}})},badge:G("Mod-Alt-1"),key:"heading",...e.dictionary.slash_menu.heading},{onItemClick:()=>{L(e,{type:"heading",props:{level:2}})},badge:G("Mod-Alt-2"),key:"heading_2",...e.dictionary.slash_menu.heading_2},{onItemClick:()=>{L(e,{type:"heading",props:{level:3}})},badge:G("Mod-Alt-3"),key:"heading_3",...e.dictionary.slash_menu.heading_3}),N("numberedListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"numberedListItem"})},badge:G("Mod-Shift-7"),key:"numbered_list",...e.dictionary.slash_menu.numbered_list}),N("bulletListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"bulletListItem"})},badge:G("Mod-Shift-8"),key:"bullet_list",...e.dictionary.slash_menu.bullet_list}),N("checkListItem",e)&&t.push({onItemClick:()=>{L(e,{type:"checkListItem"})},badge:G("Mod-Shift-9"),key:"check_list",...e.dictionary.slash_menu.check_list}),N("paragraph",e)&&t.push({onItemClick:()=>{L(e,{type:"paragraph"})},badge:G("Mod-Alt-0"),key:"paragraph",...e.dictionary.slash_menu.paragraph}),N("codeBlock",e)&&t.push({onItemClick:()=>{L(e,{type:"codeBlock"})},badge:G("Mod-Alt-c"),key:"code_block",...e.dictionary.slash_menu.code_block}),N("table",e)&&t.push({onItemClick:()=>{L(e,{type:"table",content:{type:"tableContent",rows:[{cells:["","",""]},{cells:["","",""]}]}})},badge:void 0,key:"table",...e.dictionary.slash_menu.table}),N("image",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"image"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"image",...e.dictionary.slash_menu.image}),N("video",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"video"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"video",...e.dictionary.slash_menu.video}),N("audio",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"audio"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"audio",...e.dictionary.slash_menu.audio}),N("file",e)&&t.push({onItemClick:()=>{const o=L(e,{type:"file"});e.dispatch(e._tiptapEditor.state.tr.setMeta(e.filePanel.plugin,{block:o}))},key:"file",...e.dictionary.slash_menu.file}),t.push({onItemClick:()=>{e.openSuggestionMenu(":",{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:"emoji",...e.dictionary.slash_menu.emoji}),t}function zn(e,t){return e.filter(({title:o,aliases:i})=>o.toLowerCase().includes(t.toLowerCase())||i&&i.filter(n=>n.toLowerCase().includes(t.toLowerCase())).length!==0)}function Ye(e){return e&&Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}class oe{constructor(t){h(this,"blockSpecs");h(this,"inlineContentSpecs");h(this,"styleSpecs");h(this,"blockSchema");h(this,"inlineContentSchema");h(this,"styleSchema");h(this,"BlockNoteEditor","only for types");h(this,"Block","only for types");h(this,"PartialBlock","only for types");this.blockSpecs=Ye(t==null?void 0:t.blockSpecs)||Xe,this.inlineContentSpecs=Ye(t==null?void 0:t.inlineContentSpecs)||Je,this.styleSpecs=Ye(t==null?void 0:t.styleSpecs)||Ze,this.blockSchema=Oe(this.blockSpecs),this.inlineContentSchema=Ve(this.inlineContentSpecs),this.styleSchema=Fe(this.styleSpecs)}static create(t){return new oe(t)}}const Qe=oe.create({blockSpecs:{pageBreak:Xt}}),Fn=e=>oe.create({blockSpecs:{...e.blockSpecs,...Qe.blockSpecs},inlineContentSpecs:e.inlineContentSpecs,styleSpecs:e.styleSpecs});function Mo(e){return"pageBreak"in e.schema.blockSchema&&e.schema.blockSchema.pageBreak===Qe.blockSchema.pageBreak}function Gn(e){const t=[];return Mo(e)&&t.push({...e.dictionary.slash_menu.page_break,onItemClick:()=>{L(e,{type:"pageBreak"})},key:"page_break"}),t}const $n=async e=>{const t=new FormData;return t.append("file",e),(await(await fetch("https://tmpfiles.org/api/v1/upload",{method:"POST",body:t})).json()).data.url.replace("tmpfiles.org/","tmpfiles.org/dl/")};function Kn(e,t,o,i="before"){const n=typeof o=="string"?o:o.id,a=[];for(const l of t)a.push(q(l,e.pmSchema,e.schema.styleSchema));const r=A(n,e._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n} not found`);i==="before"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode,a)),i==="after"&&e.dispatch(e._tiptapEditor.state.tr.insert(r.posBeforeNode+r.node.nodeSize,a));const s=[];for(const l of a)s.push(S(l,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return s}function Wn(e){const t=e._tiptapEditor.state,o=t.selection,i=z(t.doc,o.anchor);if(o instanceof U.CellSelection)return{type:"cell",anchorBlockId:i.node.attrs.id,anchorCellOffset:o.$anchorCell.pos-i.posBeforeNode,headCellOffset:o.$headCell.pos-i.posBeforeNode};if(e._tiptapEditor.state.selection instanceof _.NodeSelection)return{type:"node",anchorBlockId:i.node.attrs.id};{const n=z(t.doc,o.head);return{type:"text",anchorBlockId:i.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:o.anchor-i.posBeforeNode,headOffset:o.head-n.posBeforeNode}}}function qn(e,t){var n,a;const o=(n=A(t.anchorBlockId,e._tiptapEditor.state.doc))==null?void 0:n.posBeforeNode;if(o===void 0)throw new Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let i;if(t.type==="cell")i=U.CellSelection.create(e._tiptapEditor.state.doc,o+t.anchorCellOffset,o+t.headCellOffset);else if(t.type==="node")i=_.NodeSelection.create(e._tiptapEditor.state.doc,o+1);else{const r=(a=A(t.headBlockId,e._tiptapEditor.state.doc))==null?void 0:a.posBeforeNode;if(r===void 0)throw new Error(`Could not find block with ID ${t.headBlockId} to update selection`);i=_.TextSelection.create(e._tiptapEditor.state.doc,o+t.anchorOffset,r+t.headOffset)}e.dispatch(e._tiptapEditor.state.tr.setSelection(i))}function et(e){return e.map(t=>t.type==="columnList"?t.children.map(o=>et(o.children)).flat():{...t,children:et(t.children)}).flat()}function Lo(e,t,o){var a;const i=((a=e.getSelection())==null?void 0:a.blocks)||[e.getTextCursorPosition().block],n=Wn(e);e.removeBlocks(i),e.insertBlocks(et(i),t,o),qn(e,n)}function Po(e){return!e||e.type!=="columnList"}function Ao(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[t.children.length-1],n="after"):(i=t,n="before"):o&&(i=o,n="before"),!i||!n)return;const a=e.getParentBlock(i);return Po(a)?{referenceBlock:i,placement:n}:Ao(e,n==="after"?i:e.getPrevBlock(i),a)}function No(e,t,o){let i,n;if(t?t.children.length>0?(i=t.children[0],n="before"):(i=t,n="after"):o&&(i=o,n="after"),!i||!n)return;const a=e.getParentBlock(i);return Po(a)?{referenceBlock:i,placement:n}:No(e,n==="before"?i:e.getNextBlock(i),a)}function Xn(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[0])||e.getTextCursorPosition().block,i=Ao(e,e.getPrevBlock(o),e.getParentBlock(o));i&&Lo(e,i.referenceBlock,i.placement)}function Zn(e){const t=e.getSelection(),o=(t==null?void 0:t.blocks[(t==null?void 0:t.blocks.length)-1])||e.getTextCursorPosition().block,i=No(e,e.getNextBlock(o),e.getParentBlock(o));i&&Lo(e,i.referenceBlock,i.placement)}function Jn(e,t){return function({state:o,dispatch:i}){const{$from:n,$to:a}=o.selection,r=n.blockRange(a,u=>u.childCount>0&&(u.type.name==="blockGroup"||u.type.name==="column"));if(!r)return!1;const s=r.startIndex;if(s===0)return!1;const c=r.parent.child(s-1);if(c.type!==e)return!1;if(i){const u=c.lastChild&&c.lastChild.type===t,p=w.Fragment.from(u?e.create():null),m=new w.Slice(w.Fragment.from(e.create(null,w.Fragment.from(t.create(null,p)))),u?3:1,0),f=r.start,g=r.end;i(o.tr.step(new be.ReplaceAroundStep(f-(u?3:1),g,f,g,m,1,!0)).scrollIntoView())}return!0}}function Do(e){return e._tiptapEditor.commands.command(Jn(e._tiptapEditor.schema.nodes.blockContainer,e._tiptapEditor.schema.nodes.blockGroup))}function Yn(e){e._tiptapEditor.commands.liftListItem("blockContainer")}function Qn(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).nodeBefore!==null}function ea(e){const{bnBlock:t}=C(e._tiptapEditor.state);return e._tiptapEditor.state.doc.resolve(t.beforePos).depth>1}function jo(e,t,o){const i=e._tiptapEditor;let n=i.state.tr;const a=[];for(const p of o)a.push(q(p,e.pmSchema,e.schema.styleSchema));const r=new Set(t.map(p=>typeof p=="string"?p:p.id)),s=[],l=typeof t[0]=="string"?t[0]:t[0].id;let c=0;if(i.state.doc.descendants((p,m)=>{if(r.size===0)return!1;if(!p.type.isInGroup("bnBlock")||!r.has(p.attrs.id))return!0;if(s.push(S(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)),r.delete(p.attrs.id),o.length>0&&p.attrs.id===l){const y=n.doc.nodeSize;n=n.insert(m,a);const v=n.doc.nodeSize;c+=y-v}const f=n.doc.nodeSize,g=n.doc.resolve(m-c);g.node().type.name==="blockGroup"&&g.node(g.depth-1).type.name!=="doc"&&g.node().childCount===1?n=n.delete(g.before(),g.after()):n=n.delete(m-c,m-c+p.nodeSize);const b=n.doc.nodeSize;return c+=f-b,!1}),r.size>0){const p=[...r].join(`
|
|
9
|
+
`);throw Error("Blocks with the following IDs could not be found in the editor: "+p)}e.dispatch(n);const u=[];for(const p of a)u.push(S(p,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));return{insertedBlocks:u,removedBlocks:s}}function ta(e,t,o){return jo(e,t,o)}function oa(e,t){return jo(e,t,[]).removedBlocks}function ia(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(i)return S(i.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function na(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode).nodeBefore;if(a)return S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function aa(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const a=e._tiptapEditor.state.doc.resolve(i.posBeforeNode+i.node.nodeSize).nodeAfter;if(a)return S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function ra(e,t){const o=typeof t=="string"?t:t.id,i=A(o,e._tiptapEditor.state.doc);if(!i)return;const n=e._tiptapEditor.state.doc.resolve(i.posBeforeNode),a=n.node(),r=n.node(-1),s=r.type.name!=="doc"?a.type.name==="blockGroup"?r:a:void 0;if(s)return S(s,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}function sa(e,t,o,i={updateSelection:!0}){const n=o._tiptapEditor.state.tr;let{from:a,to:r}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},s=!0,l=!0,c="";if(t.forEach(u=>{u.check(),s&&u.isText&&u.marks.length===0?c+=u.text:s=!1,l=l?u.isBlock:!1}),a===r&&l){const{parent:u}=n.doc.resolve(a);u.isTextblock&&!u.type.spec.code&&!u.childCount&&(a-=1,r+=1)}return s?n.insertText(c,a,r):n.replaceWith(a,r,t),i.updateSelection&&k.selectionToInsertionEnd(n,n.steps.length-1,-1),o.dispatch(n),!0}function la(e){const t=e._tiptapEditor.state;if(t.selection.empty||"node"in t.selection)return;const o=t.doc.resolve(z(t.doc,t.selection.from).posBeforeNode),i=t.doc.resolve(z(t.doc,t.selection.to).posBeforeNode),n=(c,u)=>{const p=o.posAtIndex(c,u),m=t.doc.resolve(p).nodeAfter;if(!m)throw new Error(`Error getting selection - node not found at position ${p}`);return S(m,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)},a=[],r=o.sharedDepth(i.pos),s=o.index(r),l=i.index(r);if(o.depth>r){a.push(S(o.nodeAfter,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache));for(let c=o.depth;c>r;c--)if(o.node(c).type.isInGroup("childContainer")){const p=o.index(c)+1,m=o.node(c).childCount;for(let f=p;f<m;f++)a.push(n(f,c))}}else a.push(n(s,r));for(let c=s+1;c<=l;c++)a.push(n(c,r));if(a.length===0)throw new Error(`Error getting selection - selection doesn't span any blocks (${t.selection})`);return{blocks:a}}function da(e,t,o){const i=typeof t=="string"?t:t.id,n=typeof o=="string"?o:o.id;if(i===n)throw new Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);const a=e._tiptapEditor.state.doc,r=A(i,a);if(!r)throw new Error(`Block with ID ${i} not found`);const s=A(n,a);if(!s)throw new Error(`Block with ID ${n} not found`);const l=F(r),c=F(s),u=e.schema.blockSchema[l.blockNoteType],p=e.schema.blockSchema[c.blockNoteType];if(!l.isBlockContainer||u.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!c.isBlockContainer||p.content==="none")throw new Error(`Attempting to set selection anchor in block without content (id ${n})`);let m,f;if(u.content==="table"){const g=U.TableMap.get(l.blockContent.node);m=l.blockContent.beforePos+g.positionAt(0,0,l.blockContent.node)+1+2}else m=l.blockContent.beforePos+1;if(p.content==="table"){const g=U.TableMap.get(c.blockContent.node),b=c.blockContent.beforePos+g.positionAt(g.height-1,g.width-1,c.blockContent.node)+1,y=a.resolve(b).nodeAfter.nodeSize;f=b+y-2}else f=c.blockContent.afterPos-1;e._tiptapEditor.dispatch(e._tiptapEditor.state.tr.setSelection(_.TextSelection.create(e._tiptapEditor.state.doc,m,f)))}function ca(e){const{bnBlock:t}=C(e._tiptapEditor.state),o=e._tiptapEditor.state.doc.resolve(t.beforePos),i=o.nodeBefore,n=e._tiptapEditor.state.doc.resolve(t.afterPos).nodeAfter;let a;return o.depth>1&&(a=o.node(),a.type.isInGroup("bnBlock")||(a=o.node(o.depth-1))),{block:S(t.node,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),prevBlock:i===null?void 0:S(i,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),nextBlock:n===null?void 0:S(n,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache),parentBlock:a===void 0?void 0:S(a,e.schema.blockSchema,e.schema.inlineContentSchema,e.schema.styleSchema,e.blockCache)}}function Ho(e,t,o="start"){const i=typeof t=="string"?t:t.id,n=A(i,e._tiptapEditor.state.doc);if(!n)throw new Error(`Block with ID ${i} not found`);const a=F(n),r=e.schema.blockSchema[a.blockNoteType].content;if(a.isBlockContainer){const s=a.blockContent;if(r==="none"){e._tiptapEditor.commands.setNodeSelection(s.beforePos);return}if(r==="inline")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+1):e._tiptapEditor.commands.setTextSelection(s.afterPos-1);else if(r==="table")o==="start"?e._tiptapEditor.commands.setTextSelection(s.beforePos+4):e._tiptapEditor.commands.setTextSelection(s.afterPos-4);else throw new j(r)}else{const s=o==="start"?a.childContainer.node.firstChild:a.childContainer.node.lastChild;Ho(e,s.attrs.id,o)}}d.esmDependencies=void 0;async function xe(){if(d.esmDependencies)return d.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 d.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]},d.esmDependencies}function ua(){const e=t=>{let o=t.children.length;for(let i=0;i<o;i++){const n=t.children[i];if(n.type==="element"&&(e(n),n.tagName==="u"))if(n.children.length>0){t.children.splice(i,1,...n.children);const a=n.children.length-1;o+=a,i+=a}else t.children.splice(i,1),o--,i--}};return e}function pa(){const e=d.esmDependencies;if(!e)throw new Error("addSpacesToCheckboxes requires ESM dependencies to be initialized");const t=o=>{var i;if(o.children&&"length"in o.children&&o.children.length)for(let n=o.children.length-1;n>=0;n--){const a=o.children[n],r=n+1<o.children.length?o.children[n+1]:void 0;a.type==="element"&&a.tagName==="input"&&((i=a.properties)==null?void 0:i.type)==="checkbox"&&(r==null?void 0:r.type)==="element"&&r.tagName==="p"?(r.tagName="span",r.children.splice(0,0,e.hastUtilFromDom.fromDom(document.createTextNode(" ")))):t(a)}};return t}function Se(e){const t=d.esmDependencies;if(!t)throw new Error("cleanHTMLToMarkdown requires ESM dependencies to be initialized");return t.unified.unified().use(t.rehypeParse.default,{fragment:!0}).use(ua).use(pa).use(t.rehypeRemark.default).use(t.remarkGfm.default).use(t.remarkStringify.default,{handlers:{text:i=>i.value}}).processSync(e).value}async function Oo(e,t,o,i){await xe();const a=de(t,o).exportBlocks(e,i);return Se(a)}function ha(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function ma(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||"")}function fa(e){e.querySelectorAll("li > ul, li > ol").forEach(t=>{const o=ha(t),i=t.parentElement,n=Array.from(i.childNodes).slice(o+1);t.remove(),n.forEach(a=>{a.remove()}),i.insertAdjacentElement("afterend",t),n.reverse().forEach(a=>{if(ma(a))return;const r=document.createElement("li");r.append(a),t.insertAdjacentElement("afterend",r)}),i.childNodes.length===0&&i.remove()})}function ga(e){e.querySelectorAll("li + ul, li + ol").forEach(t=>{var a,r;const o=t.previousElementSibling,i=document.createElement("div");o.insertAdjacentElement("afterend",i),i.append(o);const n=document.createElement("div");for(n.setAttribute("data-node-type","blockGroup"),i.append(n);((a=i.nextElementSibling)==null?void 0:a.nodeName)==="UL"||((r=i.nextElementSibling)==null?void 0:r.nodeName)==="OL";)n.append(i.nextElementSibling)})}let Uo=null;function ba(){return Uo||(Uo=document.implementation.createHTMLDocument("title"))}function Ro(e){if(typeof e=="string"){const t=ba().createElement("div");t.innerHTML=e,e=t}return fa(e),ga(e),e}async function tt(e,t,o,i,n){const a=Ro(e),s=w.DOMParser.fromSchema(n).parse(a,{topNode:n.nodes.blockGroup.create()}),l=[];for(let c=0;c<s.childCount;c++)l.push(S(s.child(c),t,o,i));return l}function ka(e,t){const o=t.value?t.value:"",i={};t.lang&&(i["data-language"]=t.lang);let n={type:"element",tagName:"code",properties:i,children:[{type:"text",value:o}]};return t.meta&&(n.data={meta:t.meta}),e.patch(t,n),n=e.applyData(t,n),n={type:"element",tagName:"pre",properties:{},children:[n]},e.patch(t,n),n}async function Vo(e,t,o,i,n){const a=await xe(),r=a.unified.unified().use(a.remarkParse.default).use(a.remarkGfm.default).use(a.remarkRehype.default,{handlers:{...a.remarkRehype.defaultHandlers,code:ka}}).use(a.rehypeStringify.default).processSync(e);return tt(r.value,t,o,i,n)}const ot=["vscode-editor-data","blocknote/html","text/html","text/plain","Files"];function _a(e,t){if(!e.startsWith(".")||!t.startsWith("."))throw new Error("The strings provided are not valid file extensions.");return e===t}function ya(e,t){const o=e.split("/"),i=t.split("/");if(o.length!==2)throw new Error(`The string ${e} is not a valid MIME type.`);if(i.length!==2)throw new Error(`The string ${t} is not a valid MIME type.`);return o[1]==="*"||i[1]==="*"?o[0]===i[0]:(o[0]==="*"||i[0]==="*"||o[0]===i[0])&&o[1]===i[1]}async function zo(e,t){var r;if(!t.uploadFile){console.warn("Attempted ot insert file, but uploadFile is not set in the BlockNote editor options");return}const o="dataTransfer"in e?e.dataTransfer:e.clipboardData;if(o===null)return;let i=null;for(const s of ot)if(o.types.includes(s)){i=s;break}if(i!=="Files")return;const n=o.items;if(!n)return;e.preventDefault();const a=Object.values(t.schema.blockSchema).filter(s=>s.isFileBlock);for(let s=0;s<n.length;s++){let l="file";for(const u of a)for(const p of u.fileBlockAccept||[]){const m=p.startsWith("."),f=n[s].getAsFile();if(f&&(!m&&f.type&&ya(n[s].type,p)||m&&_a("."+f.name.split(".").pop(),p))){l=u.type;break}}const c=n[s].getAsFile();if(c){const u={type:l,props:{name:c.name}};let p;if(e.type==="paste")p=t.insertBlocks([u],t.getTextCursorPosition().block,"after")[0].id;else if(e.type==="drop"){const g={left:e.clientX,top:e.clientY},b=(r=t.prosemirrorView)==null?void 0:r.posAtCoords(g);if(!b)return;const y=z(t._tiptapEditor.state.doc,b.pos),v=F(y);p=t.insertBlocks([u],v.bnBlock.node.attrs.id,"after")[0].id}else return;const m=await t.uploadFile(c,p),f=typeof m=="string"?{props:{url:m}}:{...m};t.updateBlock(p,f)}}}const va=e=>k.Extension.create({name:"dropFile",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{drop(t,o){if(!e.isEditable)return;let i=null;for(const n of ot)if(o.dataTransfer.types.includes(n)){i=n;break}return i===null?!0:i==="Files"?(zo(o,e),!0):!1}}}})]}});async function wa(e,t){const{schema:o}=t.state;if(!e.clipboardData)return!1;const i=e.clipboardData.getData("text/plain");if(!i)return!1;if(!o.nodes.codeBlock)return t.pasteText(i),!0;const n=e.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=a==null?void 0:a.mode;return r?(t.pasteHTML(`<pre><code class="language-${r}">${i.replace(/\r\n?/g,`
|
|
10
|
+
`)}</code></pre>`),!0):!1}const Ca=e=>k.Extension.create({name:"pasteFromClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{paste(t,o){if(o.preventDefault(),!e.isEditable)return;let i;for(const a of ot)if(o.clipboardData.types.includes(a)){i=a;break}if(!i)return!0;if(i==="vscode-editor-data")return wa(o,t),!0;if(i==="Files")return zo(o,e),!0;let n=o.clipboardData.getData(i);return i==="blocknote/html"?(t.pasteHTML(n),!0):i==="text/html"?(n=Ro(n.trim()).innerHTML,t.pasteHTML(n),!0):(t.pasteText(n),!0)}}}})]}});function Fo(e,t){const o=[];return e.descendants(i=>{var n,a;return i.type.name==="blockContainer"&&((n=i.firstChild)==null?void 0:n.type.name)==="blockGroup"?!0:i.type.name==="columnList"&&i.childCount===1?((a=i.firstChild)==null||a.forEach(r=>{o.push(S(r,t.blockSchema,t.inlineContentSchema,t.styleSchema))}),!1):i.type.isInGroup("bnBlock")?(o.push(S(i,t.blockSchema,t.inlineContentSchema,t.styleSchema)),!1):!0}),o}function xa(e,t,o){var s;let i=!1;const n=e.state.selection instanceof U.CellSelection;if(!n){const l=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,c=[];for(let u=0;u<l.childCount;u++)c.push(l.child(u));i=c.find(u=>u.type.isInGroup("bnBlock")||u.type.name==="blockGroup"||u.type.spec.group==="blockContent")===void 0,i&&(t=l)}let a;const r=de(e.state.schema,o);if(n){((s=t.firstChild)==null?void 0:s.type.name)==="table"&&(t=t.firstChild.content);const l=Ue(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=`<table>${r.exportInlineContent(l,{})}</table>`}else if(i){const l=pe(t,o.schema.inlineContentSchema,o.schema.styleSchema);a=r.exportInlineContent(l,{})}else{const l=Fo(t,o.schema);a=r.exportBlocks(l,{})}return a}function Go(e,t){"node"in e.state.selection&&e.state.selection.node.type.spec.group==="blockContent"&&t.dispatch(t._tiptapEditor.state.tr.setSelection(new _.NodeSelection(e.state.doc.resolve(e.state.selection.from-1))));const o=ct.__serializeForClipboard(e,e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,n=xa(e,i,t),a=Se(n);return{clipboardHTML:o,externalHTML:n,markdown:a}}const $o=(e,t,o)=>{o.preventDefault(),o.clipboardData.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Go(t,e);o.clipboardData.setData("blocknote/html",i),o.clipboardData.setData("text/html",n),o.clipboardData.setData("text/plain",a)},Sa=e=>k.Extension.create({name:"copyToClipboard",addProseMirrorPlugins(){return[new _.Plugin({props:{handleDOMEvents:{copy(t,o){return $o(e,t,o),!0},cut(t,o){return $o(e,t,o),t.editable&&t.dispatch(t.state.tr.deleteSelection()),!0},dragstart(t,o){if(!("node"in t.state.selection)||t.state.selection.node.type.spec.group!=="blockContent")return;e.dispatch(e._tiptapEditor.state.tr.setSelection(new _.NodeSelection(t.state.doc.resolve(t.state.selection.from-1)))),o.preventDefault(),o.dataTransfer.clearData();const{clipboardHTML:i,externalHTML:n,markdown:a}=Go(t,e);return o.dataTransfer.setData("blocknote/html",i),o.dataTransfer.setData("text/html",n),o.dataTransfer.setData("text/plain",a),!0}}}})]}}),Ba=k.Extension.create({name:"blockBackgroundColor",addGlobalAttributes(){return[{types:["blockContainer"],attributes:{backgroundColor:{default:B.backgroundColor.default,parseHTML:e=>e.hasAttribute("data-background-color")?e.getAttribute("data-background-color"):B.backgroundColor.default,renderHTML:e=>e.backgroundColor===B.backgroundColor.default?{}:{"data-background-color":e.backgroundColor}}}}]}});class ie{constructor(){h(this,"callbacks",{})}on(t,o){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(o),()=>this.off(t,o)}emit(t,...o){const i=this.callbacks[t];i&&i.forEach(n=>n.apply(this,o))}off(t,o){const i=this.callbacks[t];i&&(o?this.callbacks[t]=i.filter(n=>n!==o):delete this.callbacks[t])}removeAllListeners(){this.callbacks={}}}class Ko{constructor(t,o,i,n){h(this,"state");h(this,"emitUpdate");h(this,"mouseDownHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"dragstartHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;if((t=this.state)!=null&&t.show){const o=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${this.state.block.id}"]`);if(!o)return;this.state.referencePos=o.getBoundingClientRect(),this.emitUpdate()}});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pluginKey=o,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(t,o){var n,a;const i=this.pluginKey.getState(t.state);if(!((n=this.state)!=null&&n.show)&&i.block&&this.editor.isEditable){const r=this.pmView.root.querySelector(`[data-node-type="blockContainer"][data-id="${i.block.id}"]`);if(!r)return;this.state={show:!0,referencePos:r.getBoundingClientRect(),block:i.block},this.emitUpdate();return}(!t.state.selection.eq(o.selection)||!t.state.doc.eq(o.doc)||!this.editor.isEditable)&&(a=this.state)!=null&&a.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 it=new _.PluginKey("FilePanelPlugin");class Wo extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>{var o;return(o=this.view)==null?void 0:o.closeMenu()});this.plugin=new _.Plugin({key:it,view:i=>(this.view=new Ko(o,it,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>{var a;return n.key==="Escape"&&this.shown?((a=this.view)==null||a.closeMenu(),!0):!1}},state:{init:()=>({block:void 0}),apply:i=>{var a;return{block:(a=i.getMeta(it))==null?void 0:a.block}}}})}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}class qo{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"preventHide",!1);h(this,"preventShow",!1);h(this,"shouldShow",({state:t,from:o,to:i,view:n})=>{const{doc:a,selection:r}=t,{empty:s}=r,l=!a.textBetween(o,i).length&&k.isTextSelection(t.selection);return r.$from.parent.type.spec.code||k.isNodeSelection(r)&&r.node.type.spec.code?!1:!(!n.hasFocus()||s||l)});h(this,"blurHandler",t=>{var i;if(this.preventHide){this.preventHide=!1;return}const o=this.pmView.dom.parentElement;t&&t.relatedTarget&&(o===t.relatedTarget||o.contains(t.relatedTarget)||t.relatedTarget.matches(".bn-ui-container, .bn-ui-container *"))||(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"viewMousedownHandler",()=>{this.preventShow=!0});h(this,"viewMouseupHandler",()=>{this.preventShow=!1,setTimeout(()=>this.update(this.pmView))});h(this,"dragHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.getSelectionBoundingBox(),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized formatting toolbar");i(this.state)},o.dom.addEventListener("mousedown",this.viewMousedownHandler),o.dom.addEventListener("mouseup",this.viewMouseupHandler),o.dom.addEventListener("dragstart",this.dragHandler),o.dom.addEventListener("dragover",this.dragHandler),o.dom.addEventListener("blur",this.blurHandler),o.root.addEventListener("scroll",this.scrollHandler,!0)}update(t,o){var p,m;const{state:i,composing:n}=t,{selection:a}=i,r=o&&o.selection.from===i.selection.from&&o.selection.to===i.selection.to;if(n||r)return;const{ranges:s}=a,l=Math.min(...s.map(f=>f.$from.pos)),c=Math.max(...s.map(f=>f.$to.pos)),u=(p=this.shouldShow)==null?void 0:p.call(this,{view:t,state:i,from:l,to:c});if(!this.preventShow&&(u||this.preventHide)){this.state={show:!0,referencePos:this.getSelectionBoundingBox()},this.emitUpdate();return}if((m=this.state)!=null&&m.show&&!this.preventHide&&(!u||this.preventShow||!this.editor.isEditable)){this.state.show=!1,this.emitUpdate();return}}destroy(){this.pmView.dom.removeEventListener("mousedown",this.viewMousedownHandler),this.pmView.dom.removeEventListener("mouseup",this.viewMouseupHandler),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:t}=this.pmView,{selection:o}=t,{ranges:i}=o,n=Math.min(...i.map(r=>r.$from.pos)),a=Math.max(...i.map(r=>r.$to.pos));if(k.isNodeSelection(o)){const r=this.pmView.nodeDOM(n);if(r)return r.getBoundingClientRect()}return k.posToDOMRect(this.pmView,n,a)}}const Xo=new _.PluginKey("FormattingToolbarPlugin");class Zo extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:Xo,view:i=>(this.view=new qo(o,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 o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}onUpdate(o){return this.on("update",o)}}const Jo=(e,t)=>{const o=e.resolve(t);if(o.depth<=1)return;const i=o.posAtIndex(o.index(o.depth-1),o.depth-1);return Q(e.resolve(i))},nt=(e,t)=>{const o=e.resolve(t),i=o.index();if(i===0)return;const n=o.posAtIndex(i-1);return Q(e.resolve(n))},Yo=(e,t)=>{for(;t.childContainer;){const o=t.childContainer.node,i=e.resolve(t.childContainer.beforePos+1).posAtIndex(o.childCount-1);t=Q(e.resolve(i))}return t},Ea=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content==="inline*"&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content==="inline*",Ta=(e,t,o,i)=>{if(!i.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but next block is not a block container`);if(i.childContainer){const n=e.doc.resolve(i.childContainer.beforePos+1),a=e.doc.resolve(i.childContainer.afterPos-1),r=n.blockRange(a);if(t){const s=e.doc.resolve(i.bnBlock.beforePos);e.tr.lift(r,s.depth)}}if(t){if(!o.isBlockContainer)throw new Error(`Attempted to merge block at position ${i.bnBlock.beforePos} into previous block at position ${o.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(o.blockContent.afterPos-1,i.blockContent.beforePos+1))}return!0},Qo=e=>({state:t,dispatch:o})=>{const i=t.doc.resolve(e),n=Q(i),a=nt(t.doc,n.bnBlock.beforePos);if(!a)return!1;const r=Yo(t.doc,a);return Ea(r,n)?Ta(t,o,r,n):!1},Ia=k.Extension.create({priority:50,addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({chain:i,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const s=a.selection.from===r.blockContent.beforePos+1,l=r.blockContent.node.type.name==="paragraph";return s&&!l?n.command(T(this.options.editor,r.bnBlock.beforePos,{type:"paragraph",props:{}})):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{blockContent:s}=r;return a.selection.from===s.beforePos+1?n.liftListItem("blockContainer"):!1}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,c=a.selection.from===l.beforePos+1,u=a.selection.empty,p=s.beforePos;return c&&u?i().command(Qo(p)).scrollIntoView().run():!1}),()=>n.command(({state:a,dispatch:r})=>{const s=C(a);if(!s.isBlockContainer||!(a.selection.from===s.blockContent.beforePos+1)||nt(a.doc,s.bnBlock.beforePos))return!1;const u=Jo(a.doc,s.bnBlock.beforePos);if((u==null?void 0:u.blockNoteType)!=="column")return!1;const p=u,m=Jo(a.doc,p.bnBlock.beforePos);if((m==null?void 0:m.blockNoteType)!=="columnList")throw new Error("parent of column is not a column list");const f=p.childContainer.node.childCount===1,g=f&&m.childContainer.node.childCount===2,b=m.childContainer.node.firstChild===p.bnBlock.node;if(r){const y=a.doc.slice(s.bnBlock.beforePos,s.bnBlock.afterPos,!1);if(g)if(b){a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,p.bnBlock.afterPos+1,m.bnBlock.afterPos-2,y,y.size,!1));const v=a.tr.doc.resolve(p.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(v,v))}else{a.tr.step(new be.ReplaceAroundStep(m.bnBlock.beforePos,m.bnBlock.afterPos,m.bnBlock.beforePos+2,p.bnBlock.beforePos-1,y,0,!1));const v=a.tr.doc.resolve(a.tr.mapping.map(p.bnBlock.beforePos-1));a.tr.setSelection(_.TextSelection.between(v,v))}else if(f)if(b){a.tr.delete(p.bnBlock.beforePos,p.bnBlock.afterPos),a.tr.insert(m.bnBlock.beforePos,y.content);const v=a.tr.doc.resolve(m.bnBlock.beforePos);a.tr.setSelection(_.TextSelection.between(v,v))}else a.tr.delete(p.bnBlock.beforePos-1,p.bnBlock.beforePos+1);else{a.tr.delete(s.bnBlock.beforePos,s.bnBlock.afterPos),b?a.tr.insert(m.bnBlock.beforePos-1,y.content):a.tr.insert(p.bnBlock.beforePos-1,y.content);const v=a.tr.doc.resolve(p.bnBlock.beforePos-1);a.tr.setSelection(_.TextSelection.between(v,v))}}return!0}),()=>n.command(({state:a})=>{const r=C(a);if(!r.isBlockContainer)throw new Error("todo");const s=a.selection.from===r.blockContent.beforePos+1,l=a.selection.empty,c=nt(a.doc,r.bnBlock.beforePos);if(c&&s&&l){const u=Yo(a.doc,c);if(!u.isBlockContainer)throw new Error("todo");if(u.blockContent.node.type.spec.content===""||u.blockContent.node.type.spec.content==="inline*"&&u.blockContent.node.childCount===0)return i().cut({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos},u.bnBlock.afterPos).deleteRange({from:u.bnBlock.beforePos,to:u.bnBlock.afterPos}).run()}return!1})]),Delete:()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s,childContainer:l}=a,{depth:c}=n.doc.resolve(r.beforePos),u=r.afterPos===n.doc.nodeSize-3,p=n.selection.from===s.afterPos-1,m=n.selection.empty;if(!u&&p&&m&&!(l!==void 0)){let g=c,b=r.afterPos+1,y=n.doc.resolve(b).depth;for(;y<g;)g=y,b+=2,y=n.doc.resolve(b).depth;return i.command(Qo(b-1))}return!1})]),Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.command(({state:n})=>{const a=C(n);if(!a.isBlockContainer)return!1;const{bnBlock:r,blockContent:s}=a,{depth:l}=n.doc.resolve(r.beforePos),c=n.selection.$anchor.parentOffset===0,u=n.selection.anchor===n.selection.head,p=s.node.childCount===0,m=l>1;return c&&u&&p&&m?i.liftListItem("blockContainer"):!1}),()=>i.command(({state:n,dispatch:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{bnBlock:s,blockContent:l}=r,c=n.selection.$anchor.parentOffset===0,u=n.selection.anchor===n.selection.head,p=l.node.childCount===0;if(c&&u&&p){const m=s.afterPos,f=m+2;if(a){const g=n.schema.nodes.blockContainer.createAndFill();n.tr.insert(m,g).scrollIntoView(),n.tr.setSelection(new _.TextSelection(n.doc.resolve(f)))}return!0}return!1}),()=>i.command(({state:n,chain:a})=>{const r=C(n);if(!r.isBlockContainer)return!1;const{blockContent:s}=r,l=n.selection.$anchor.parentOffset===0;return s.node.childCount===0?!1:(a().deleteSelection().command(mo(n.selection.from,l,l)).run(),!0)})]),Tab:()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.shown)?!1:Do(this.options.editor)},"Shift-Tab":()=>{var i,n,a;return this.options.tabBehavior!=="prefer-indent"&&((i=this.options.editor.formattingToolbar)!=null&&i.shown||(n=this.options.editor.linkToolbar)!=null&&n.shown||(a=this.options.editor.filePanel)!=null&&a.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(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"menuUpdateTimer");h(this,"startMenuUpdateTimer");h(this,"stopMenuUpdateTimer");h(this,"mouseHoveredLinkMark");h(this,"mouseHoveredLinkMarkRange");h(this,"keyboardHoveredLinkMark");h(this,"keyboardHoveredLinkMarkRange");h(this,"linkMark");h(this,"linkMarkRange");h(this,"mouseOverHandler",t=>{if(this.mouseHoveredLinkMark=void 0,this.mouseHoveredLinkMarkRange=void 0,this.stopMenuUpdateTimer(),t.target instanceof HTMLAnchorElement&&t.target.nodeName==="A"){const o=t.target,i=this.pmView.posAtDOM(o,0)+1,n=this.pmView.state.doc.resolve(i),a=n.marks();for(const r of a)if(r.type.name===this.pmView.state.schema.mark("link").type.name){this.mouseHoveredLinkMark=r,this.mouseHoveredLinkMarkRange=k.getMarkRange(n,r.type,r.attrs)||void 0;break}}return this.startMenuUpdateTimer(),!1});h(this,"clickHandler",t=>{var i;const o=this.pmView.dom.parentElement;this.linkMark&&t&&t.target&&!(o===t.target||o.contains(t.target))&&(i=this.state)!=null&&i.show&&(this.state.show=!1,this.emitUpdate())});h(this,"scrollHandler",()=>{var t;this.linkMark!==void 0&&(t=this.state)!=null&&t.show&&(this.state.referencePos=k.posToDOMRect(this.pmView,this.linkMarkRange.from,this.linkMarkRange.to),this.emitUpdate())});h(this,"closeMenu",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())});this.editor=t,this.pmView=o,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)},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(t,o){var n;const i=this.pmView.state.tr.insertText(o,this.linkMarkRange.from,this.linkMarkRange.to);i.addMark(this.linkMarkRange.from,this.linkMarkRange.from+o.length,this.pmView.state.schema.mark("link",{href:t})),this.editor.dispatch(i),this.pmView.focus(),(n=this.state)!=null&&n.show&&(this.state.show=!1,this.emitUpdate())}deleteLink(){var t;this.editor.dispatch(this.pmView.state.tr.removeMark(this.linkMarkRange.from,this.linkMarkRange.to,this.linkMark.type).setMeta("preventAutolink",!0)),this.pmView.focus(),(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate())}update(t,o){var r;const{state:i}=t;if(o&&o.selection.from===i.selection.from&&o.selection.to===i.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 s=this.pmView.state.selection.$from.marks();for(const l of s)if(l.type.name===this.pmView.state.schema.mark("link").type.name){this.keyboardHoveredLinkMark=l,this.keyboardHoveredLinkMarkRange=k.getMarkRange(this.pmView.state.selection.$from,l.type,l.attrs)||void 0;break}}if(this.mouseHoveredLinkMark&&(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((r=this.state)!=null&&r.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 ei=new _.PluginKey("LinkToolbarPlugin");class ti extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"editLink",(o,i)=>{this.view.editLink(o,i)});h(this,"deleteLink",()=>{this.view.deleteLink()});h(this,"startHideTimer",()=>{this.view.startMenuUpdateTimer()});h(this,"stopHideTimer",()=>{this.view.stopMenuUpdateTimer()});h(this,"closeMenu",()=>this.view.closeMenu());this.plugin=new _.Plugin({key:ei,view:i=>(this.view=new Ma(o,i,n=>{this.emit("update",n)}),this.view),props:{handleKeyDown:(i,n)=>n.key==="Escape"&&this.shown?(this.view.closeMenu(),!0):!1}})}onUpdate(o){return this.on("update",o)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}const oi=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"],ii="https",La=new _.PluginKey("node-selection-keyboard");class Pa{constructor(){h(this,"plugin");this.plugin=new _.Plugin({key:La,props:{handleKeyDown:(t,o)=>{if("node"in t.state.selection){if(o.ctrlKey||o.metaKey)return!1;if(o.key.length===1)return o.preventDefault(),!0;if(o.key==="Enter"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey){const i=t.state.tr;return t.dispatch(i.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new _.TextSelection(i.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})}}const Aa=new _.PluginKey("blocknote-placeholder");class Na{constructor(t,o){h(this,"plugin");this.plugin=new _.Plugin({key:Aa,view:()=>{var l,c;const i=document.createElement("style"),n=t._tiptapEditor.options.injectNonce;n&&i.setAttribute("nonce",n),((l=t.prosemirrorView)==null?void 0:l.root)instanceof ShadowRoot?t.prosemirrorView.root.append(i):(c=t.prosemirrorView)==null||c.root.head.appendChild(i);const a=i.sheet,r=(u="")=>`.bn-block-content${u} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`,s=(u,p=!0)=>{const m=p?"[data-is-empty-and-focused]":"";if(u==="default")return r(m);const f=`[data-content-type="${u}"]`;return r(m+f)};for(const[u,p]of Object.entries(o)){const m=u==="default";try{a.insertRule(`${s(u,m)} { content: ${JSON.stringify(p)}; }`),m||a.insertRule(`${s(u,!0)} { content: ${JSON.stringify(p)}; }`)}catch(f){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)",f)}}return{destroy:()=>{var u,p;((u=t.prosemirrorView)==null?void 0:u.root)instanceof ShadowRoot?t.prosemirrorView.root.removeChild(i):(p=t.prosemirrorView)==null||p.root.head.removeChild(i)}}},props:{decorations:i=>{const{doc:n,selection:a}=i;if(!t.isEditable||!a.empty||a.$from.parent.type.spec.code)return;const r=a.$anchor,s=r.parent;if(s.content.size>0)return null;const l=r.before(),c=P.Decoration.node(l,l+s.nodeSize,{"data-is-empty-and-focused":"true"});return P.DecorationSet.create(n,[c])}}})}}const ni=new _.PluginKey("previous-blocks"),Da={index:"index",level:"level",type:"type",depth:"depth","depth-change":"depth-change"};class ja{constructor(){h(this,"plugin");let t;this.plugin=new _.Plugin({key:ni,view(o){return{update:async(i,n)=>{var a;((a=this.key)==null?void 0:a.getState(i.state).updatedBlocks.size)>0&&(t=setTimeout(()=>{i.dispatch(i.state.tr.setMeta(ni,{clearUpdate:!0}))},0))},destroy:()=>{t&&clearTimeout(t)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(o,i,n,a){if(i.currentTransactionOldBlockAttrs={},i.updatedBlocks.clear(),!o.docChanged||n.doc.eq(a.doc))return i;const r={},s=k.findChildren(n.doc,u=>u.attrs.id),l=new Map(s.map(u=>[u.node.attrs.id,u])),c=k.findChildren(a.doc,u=>u.attrs.id);for(const u of c){const p=l.get(u.node.attrs.id),m=p==null?void 0:p.node.firstChild,f=u.node.firstChild;if(p&&m&&f){const g={index:f.attrs.index,level:f.attrs.level,type:f.type.name,depth:a.doc.resolve(u.pos).depth};let b={index:m.attrs.index,level:m.attrs.level,type:m.type.name,depth:n.doc.resolve(p.pos).depth};r[u.node.attrs.id]=b,o.getMeta("numberedListIndexing")&&(u.node.attrs.id in i.prevTransactionOldBlockAttrs&&(b=i.prevTransactionOldBlockAttrs[u.node.attrs.id]),g.type==="numberedListItem"&&(b.index=g.index)),i.currentTransactionOldBlockAttrs[u.node.attrs.id]=b,JSON.stringify(b)!==JSON.stringify(g)&&(b["depth-change"]=b.depth-g.depth,i.updatedBlocks.add(u.node.attrs.id))}}return i.prevTransactionOldBlockAttrs=r,i}},props:{decorations(o){const i=this.getState(o);if(i.updatedBlocks.size===0)return;const n=[];return o.doc.descendants((a,r)=>{if(!a.attrs.id||!i.updatedBlocks.has(a.attrs.id))return;const s=i.currentTransactionOldBlockAttrs[a.attrs.id],l={};for(const[u,p]of Object.entries(s))l["data-prev-"+Da[u]]=p||"none";const c=P.Decoration.node(r,r+a.nodeSize,{...l});n.push(c)}),P.DecorationSet.create(o.doc,n)}}})}}function ai(e,t){var o,i;for(;e&&e.parentElement&&e.parentElement!==t.dom&&((o=e.getAttribute)==null?void 0:o.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 _.Selection{constructor(o,i){super(o,i);h(this,"nodes");const n=o.node();this.nodes=[],o.doc.nodesBetween(o.pos,i.pos,(a,r,s)=>{if(s!==null&&s.eq(n))return this.nodes.push(a),!1})}static create(o,i,n=i){return new ne(o.resolve(i),o.resolve(n))}content(){return new w.Slice(w.Fragment.from(this.nodes),0,0)}eq(o){if(!(o instanceof ne)||this.nodes.length!==o.nodes.length||this.from!==o.from||this.to!==o.to)return!1;for(let i=0;i<this.nodes.length;i++)if(!this.nodes[i].eq(o.nodes[i]))return!1;return!0}map(o,i){const n=i.mapResult(this.from),a=i.mapResult(this.to);return a.deleted?_.Selection.near(o.resolve(n.pos)):n.deleted?_.Selection.near(o.resolve(a.pos)):new ne(o.resolve(n.pos),o.resolve(a.pos))}toJSON(){return{type:"node",anchor:this.anchor,head:this.head}}}let V;function Ha(e,t){let o,i;const n=t.resolve(e.from).node().type.spec.group==="blockContent",a=t.resolve(e.to).node().type.spec.group==="blockContent",r=Math.min(e.$anchor.depth,e.$head.depth);if(n&&a){const s=e.$from.start(r-1),l=e.$to.end(r-1);o=t.resolve(s-1).pos,i=t.resolve(l+1).pos}else o=e.from,i=e.to;return{from:o,to:i}}function ri(e,t,o=t){t===o&&(o+=e.state.doc.resolve(t+1).node().nodeSize);const i=e.domAtPos(t).node.cloneNode(!0),n=e.domAtPos(t).node,a=(u,p)=>Array.prototype.indexOf.call(u.children,p),r=a(n,e.domAtPos(t+1).node.parentElement),s=a(n,e.domAtPos(o-1).node.parentElement);for(let u=n.childElementCount-1;u>=0;u--)(u>s||u<r)&&i.removeChild(i.children[u]);si(e.root),V=i;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 si(e){V!==void 0&&(e instanceof ShadowRoot?e.removeChild(V):e.body.removeChild(V),V=void 0)}function Oa(e,t,o){if(!e.dataTransfer)return;const i=o.prosemirrorView;if(!i)return;const n=A(t.id,i.state.doc);if(!n)throw new Error(`Block with ID ${t.id} not found`);const a=n.posBeforeNode;if(a!=null){const r=i.state.selection,s=i.state.doc,{from:l,to:c}=Ha(r,s),u=l<=a&&a<c,p=r.$anchor.node()!==r.$head.node()||r instanceof ne;u&&p?(i.dispatch(i.state.tr.setSelection(ne.create(s,l,c))),ri(i,l,c)):(i.dispatch(i.state.tr.setSelection(_.NodeSelection.create(i.state.doc,a))),ri(i,a));const m=i.state.selection.content(),f=o.pmSchema,g=ct.__serializeForClipboard(i,m).dom.innerHTML,b=de(f,o),y=Fo(m.content,o.schema),v=b.exportBlocks(y,{}),I=Se(v);e.dataTransfer.clearData(),e.dataTransfer.setData("blocknote/html",g),e.dataTransfer.setData("text/html",v),e.dataTransfer.setData("text/plain",I),e.dataTransfer.effectAllowed="move",e.dataTransfer.setDragImage(V,0,0)}}const fe=.1;function at(e,t,o,i=!0){const n=e.root.elementsFromPoint(t.left+(o==="editor"?50:0),t.top);for(const a of n)if(e.dom.contains(a))return i&&a.closest("[data-node-type=columnList]")?at(e,{left:t.left+50,top:t.top},o,!1):ai(a,e)}function Ua(e,t,o){if(!t.dom.firstChild)return;const i=t.dom.firstChild.getBoundingClientRect(),n={left:e.x,top:e.y},a=n.left<i.left,r=n.left>i.right;o==="viewport"&&(a&&(n.left=i.left+10),r&&(n.left=i.right-10));let s=at(t,n,o);if(!r&&s){const l=s.node.getBoundingClientRect();n.left=l.right-10,s=at(t,n,"viewport",!1)}return s}class li{constructor(t,o,i,n){h(this,"state");h(this,"emitUpdate");h(this,"mousePos");h(this,"hoveredBlock");h(this,"menuFrozen",!1);h(this,"isDragOrigin",!1);h(this,"updateState",t=>{this.state=t,this.emitUpdate(this.state)});h(this,"updateStateFromMousePos",()=>{var i,n,a,r;if(this.menuFrozen||!this.mousePos)return;const t=Ua(this.mousePos,this.pmView,this.sideMenuDetection);if(!t||!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&&((a=this.hoveredBlock)!=null&&a.hasAttribute("data-id"))&&((r=this.hoveredBlock)==null?void 0:r.getAttribute("data-id"))===t.id)return;this.hoveredBlock=t.node;const o=t.node.firstChild;if(o&&this.editor.isEditable){const s=o.getBoundingClientRect(),l=t.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"))})}});h(this,"onDrop",t=>{var i;if(this.pmView.dragging===null||(this.editor._tiptapEditor.commands.blur(),!this.isDragOrigin&&this.pmView.dom.contains(t.target)?this.pmView.dispatch(this.pmView.state.tr.setSelection(_.TextSelection.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.to))):this.isDragOrigin&&!this.pmView.dom.contains(t.target)&&setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0),setTimeout(()=>this.pmView.dragging=null,0),this.sideMenuDetection==="editor"||t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html"))))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onDragStart",t=>{var r;const o=(r=t.dataTransfer)==null?void 0:r.getData("blocknote/html");if(!o)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=o;const a=w.DOMParser.fromSchema(this.pmView.state.schema).parse(i,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new w.Slice(a.content,0,0),move:!0}});h(this,"onDragOver",t=>{var i;if(this.sideMenuDetection==="editor"||t.synthetic||!((i=t.dataTransfer)!=null&&i.types.includes("blocknote/html")))return;const o=this.pmView.posAtCoords({left:t.clientX,top:t.clientY});if(!o||o.inside===-1&&this.pmView.dom.firstChild){const n=this.createSyntheticEvent(t);this.pmView.dom.dispatchEvent(n)}});h(this,"onKeyDown",t=>{var o;(o=this.state)!=null&&o.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))});h(this,"onMouseMove",t=>{var a;if(this.menuFrozen)return;this.mousePos={x:t.clientX,y:t.clientY};const o=this.pmView.dom.getBoundingClientRect(),i=this.mousePos.x>o.left&&this.mousePos.x<o.right&&this.mousePos.y>o.top&&this.mousePos.y<o.bottom,n=this.pmView.dom.parentElement;if(i&&t&&t.target&&!(n===t.target||n.contains(t.target))){(a=this.state)!=null&&a.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()});h(this,"onScroll",()=>{var t;(t=this.state)!=null&&t.show&&(this.state.referencePos=this.hoveredBlock.getBoundingClientRect(),this.emitUpdate(this.state))});this.editor=t,this.sideMenuDetection=o,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),xe(),this.pmView.root.addEventListener("mousemove",this.onMouseMove,!0),this.pmView.root.addEventListener("keydown",this.onKeyDown,!0),i.root.addEventListener("scroll",this.onScroll,!0)}createSyntheticEvent(t){const o=new Event(t.type,t),i=this.pmView.dom.firstChild.getBoundingClientRect();return o.clientX=t.clientX,o.clientY=t.clientY,t.clientX<i.left&&t.clientX>i.left-i.width*fe?o.clientX=i.left+i.width*fe/2:t.clientX>i.right&&t.clientX<i.right+i.width*fe?o.clientX=i.right-i.width*fe/2:(t.clientX<i.left||t.clientX>i.right)&&(o.clientX=i.left+fe*i.width*2),o.clientY=Math.min(Math.max(t.clientY,i.top),i.top+i.height),o.dataTransfer=t.dataTransfer,o.preventDefault=()=>t.preventDefault(),o.synthetic=!0,o}update(t,o){var n;!o.doc.eq(this.pmView.state.doc)&&((n=this.state)!=null&&n.show)&&this.updateStateFromMousePos()}destroy(){var t;(t=this.state)!=null&&t.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("keydown",this.onKeyDown,!0),this.pmView.root.removeEventListener("scroll",this.onScroll,!0)}}const di=new _.PluginKey("SideMenuPlugin");class ci extends ie{constructor(o,i){super();h(this,"view");h(this,"plugin");h(this,"blockDragStart",(o,i)=>{this.view&&(this.view.isDragOrigin=!0),Oa(o,i,this.editor)});h(this,"blockDragEnd",()=>{this.editor.prosemirrorView&&si(this.editor.prosemirrorView.root),this.view&&(this.view.isDragOrigin=!1)});h(this,"freezeMenu",()=>{this.view.menuFrozen=!0,this.view.state.show=!0,this.view.emitUpdate(this.view.state)});h(this,"unfreezeMenu",()=>{this.view.menuFrozen=!1,this.view.state.show=!1,this.view.emitUpdate(this.view.state)});this.editor=o,this.plugin=new _.Plugin({key:di,view:n=>(this.view=new li(o,i,n,a=>{this.emit("update",a)}),this.view)})}onUpdate(o){return this.on("update",o)}}const Ra=k.findParentNode(e=>e.type.name==="blockContainer");class Va{constructor(t,o){h(this,"state");h(this,"emitUpdate");h(this,"rootEl");h(this,"pluginState");h(this,"handleScroll",()=>{var t,o;if((t=this.state)!=null&&t.show){const i=(o=this.rootEl)==null?void 0:o.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!i)return;this.state.referencePos=i.getBoundingClientRect(),this.emitUpdate(this.pluginState.triggerCharacter)}});h(this,"closeMenu",()=>{this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(ae,null))});h(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=t,this.pluginState=void 0,this.emitUpdate=a=>{var r;if(!this.state)throw new Error("Attempting to update uninitialized suggestions menu");o(a,{...this.state,ignoreQueryLength:(r=this.pluginState)==null?void 0:r.ignoreQueryLength})},this.rootEl=(i=this.editor.prosemirrorView)==null?void 0:i.root,(n=this.rootEl)==null||n.addEventListener("scroll",this.handleScroll,!0)}update(t,o){var c;const i=ae.getState(o),n=ae.getState(t.state),a=i===void 0&&n!==void 0,r=i!==void 0&&n===void 0;if(!a&&!(i!==void 0&&n!==void 0)&&!r)return;if(this.pluginState=r?i:n,r||!this.editor.isEditable){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 t;(t=this.rootEl)==null||t.removeEventListener("scroll",this.handleScroll,!0)}}const ae=new _.PluginKey("SuggestionMenuPlugin");class ui extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"triggerCharacters",[]);h(this,"addTriggerCharacter",o=>{this.triggerCharacters.push(o)});h(this,"removeTriggerCharacter",o=>{this.triggerCharacters=this.triggerCharacters.filter(i=>i!==o)});h(this,"closeMenu",()=>this.view.closeMenu());h(this,"clearQuery",()=>this.view.clearQuery());const i=this.triggerCharacters;this.plugin=new _.Plugin({key:ae,view:()=>(this.view=new Va(o,(n,a)=>{this.emit(`update ${n}`,a)}),this.view),state:{init(){},apply(n,a,r,s){if(n.getMeta("orderedListIndexing")!==void 0||n.selection.$from.parent.type.spec.code)return a;const l=n.getMeta(ae);if(typeof l=="object"&&l!==null&&a===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(a===void 0)return a;if(s.selection.from!==s.selection.to||l===null||n.getMeta("focus")||n.getMeta("blur")||n.getMeta("pointer")||a.triggerCharacter!==void 0&&s.selection.from<a.queryStartPos)return;const c={...a};return c.query=s.doc.textBetween(a.queryStartPos,s.selection.from),c}},props:{handleTextInput(n,a,r,s){const l=this.getState(n.state);return i.includes(s)&&l===void 0?(n.dispatch(n.state.tr.insertText(s).scrollIntoView().setMeta(ae,{triggerCharacter:s})),!0):!1},decorations(n){const a=this.getState(n);if(a===void 0)return null;if(!a.deleteTriggerCharacter){const r=Ra(n.selection);if(r)return P.DecorationSet.create(n.doc,[P.Decoration.node(r.pos,r.pos+r.node.nodeSize,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}return P.DecorationSet.create(n.doc,[P.Decoration.inline(a.queryStartPos-a.triggerCharacter.length,a.queryStartPos,{nodeName:"span",class:"bn-suggestion-decorator","data-decoration-id":a.decorationId})])}}})}onUpdate(o,i){return this.triggerCharacters.includes(o)||this.addTriggerCharacter(o),this.on(`update ${o}`,i)}get shown(){var o,i;return((i=(o=this.view)==null?void 0:o.state)==null?void 0:i.show)||!1}}function za(e,t){e.suggestionMenus.addTriggerCharacter(t)}let D;function pi(e){D||(D=document.createElement("div"),D.innerHTML="_",D.style.opacity="0",D.style.height="1px",D.style.width="1px",e instanceof Document?e.body.appendChild(D):e.appendChild(D))}function Fa(e){D&&(e instanceof Document?e.body.removeChild(D):e.removeChild(D),D=void 0)}function Be(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Ga(e){let t=e;for(;t&&t.nodeName!=="TD"&&t.nodeName!=="TH"&&!t.classList.contains("tableWrapper");){if(t.classList.contains("ProseMirror"))return;const o=t.parentNode;if(!o||!(o instanceof Element))return;t=o}return t.nodeName==="TD"||t.nodeName==="TH"?{type:"cell",domNode:t,tbodyNode:t.closest("tbody")}:{type:"wrapper",domNode:t,tbodyNode:t.querySelector("tbody")}}function $a(e,t){const o=t.querySelectorAll(e);for(let i=0;i<o.length;i++)o[i].style.visibility="hidden"}class hi{constructor(t,o,i){h(this,"state");h(this,"emitUpdate");h(this,"tableId");h(this,"tablePos");h(this,"tableElement");h(this,"menuFrozen",!1);h(this,"mouseState","up");h(this,"prevWasEditable",null);h(this,"viewMousedownHandler",()=>{this.mouseState="down"});h(this,"mouseUpHandler",t=>{this.mouseState="up",this.mouseMoveHandler(t)});h(this,"mouseMoveHandler",t=>{var c,u,p,m;if(this.menuFrozen||this.mouseState==="selecting"||!(t.target instanceof Element)||!this.pmView.dom.contains(t.target))return;const o=Ga(t.target);if((o==null?void 0:o.type)==="cell"&&this.mouseState==="down"&&!((c=this.state)!=null&&c.draggingState)){this.mouseState="selecting",(u=this.state)!=null&&u.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o||!this.editor.isEditable){(p=this.state)!=null&&p.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!o.tbodyNode)return;const i=o.tbodyNode.getBoundingClientRect(),n=ai(o.domNode,this.pmView);if(!n)return;this.tableElement=n.node;let a;const r=A(n.id,this.editor._tiptapEditor.state.doc);if(!r)throw new Error(`Block with ID ${n.id} not found`);const s=S(r.node,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema,this.editor.blockCache);if(To("table",s,this.editor)&&(this.tablePos=r.posBeforeNode+1,a=s),!a)return;this.tableId=n.id;const l=(m=o.domNode.closest(".tableWrapper"))==null?void 0:m.querySelector(".table-widgets-container");if((o==null?void 0:o.type)==="wrapper"){const f=t.clientY>=i.bottom-1&&t.clientY<i.bottom+20,g=t.clientX>=i.right-1&&t.clientX<i.right+20,b=t.clientX>i.right||t.clientY>i.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:f,showAddOrRemoveColumnsButton:g,referencePosTable:i,block:a,widgetContainer:l,colIndex:b?void 0:this.state.colIndex,rowIndex:b?void 0:this.state.rowIndex,referencePosCell:b?void 0:this.state.referencePosCell}}else{const f=Be(o.domNode),g=Be(o.domNode.parentElement),b=o.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===n.id&&this.state.rowIndex===g&&this.state.colIndex===f)return;this.state={show:!0,showAddOrRemoveColumnsButton:f===a.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:g===a.content.rows.length-1,referencePosTable:i,block:a,draggingState:void 0,referencePosCell:b,colIndex:f,rowIndex:g,widgetContainer:l}}return this.emitUpdate(),!1});h(this,"dragOverHandler",t=>{var m;if(((m=this.state)==null?void 0:m.draggingState)===void 0)return;t.preventDefault(),t.dataTransfer.dropEffect="move",$a(".prosemirror-dropcursor-block, .prosemirror-dropcursor-inline",this.pmView.root);const o={left:Math.min(Math.max(t.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(t.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},i=this.pmView.root.elementsFromPoint(o.left,o.top).filter(f=>f.tagName==="TD"||f.tagName==="TH");if(i.length===0)throw new Error("Could not find table cell element that the mouse cursor is hovering over.");const n=i[0];let a=!1;const r=Be(n.parentElement),s=Be(n),l=this.state.draggingState.draggedCellOrientation==="row"?this.state.rowIndex:this.state.colIndex,u=(this.state.draggingState.draggedCellOrientation==="row"?r:s)!==l;(this.state.rowIndex!==r||this.state.colIndex!==s)&&(this.state.rowIndex=r,this.state.colIndex=s,this.state.referencePosCell=n.getBoundingClientRect(),a=!0);const p=this.state.draggingState.draggedCellOrientation==="row"?o.top:o.left;this.state.draggingState.mousePos!==p&&(this.state.draggingState.mousePos=p,a=!0),a&&this.emitUpdate(),u&&this.editor.dispatch(this.pmView.state.tr.setMeta(re,!0))});h(this,"dropHandler",t=>{if(this.mouseState="up",this.state===void 0||this.state.draggingState===void 0)return;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.");t.preventDefault();const{draggingState:o,colIndex:i,rowIndex:n}=this.state,a=this.state.block.content.rows;if(o.draggedCellOrientation==="row"){const r=a[o.originalIndex];a.splice(o.originalIndex,1),a.splice(n,0,r)}else{const r=a.map(s=>s.cells[o.originalIndex]);a.forEach((s,l)=>{s.cells.splice(o.originalIndex,1),s.cells.splice(i,0,r[l])})}this.editor.updateBlock(this.state.block,{type:"table",content:{type:"tableContent",rows:a}}),this.editor.setTextCursorPosition(this.state.block.id)});this.editor=t,this.pmView=o,this.emitUpdate=()=>{if(!this.state)throw new Error("Attempting to update uninitialized image toolbar");i(this.state)},o.dom.addEventListener("mousemove",this.mouseMoveHandler),o.dom.addEventListener("mousedown",this.viewMousedownHandler),window.addEventListener("mouseup",this.mouseUpHandler),o.root.addEventListener("dragover",this.dragOverHandler),o.root.addEventListener("drop",this.dropHandler)}update(){if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}const t=this.state.block.content.rows.length,o=this.state.block.content.rows[0].cells.length;this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=o&&(this.state.colIndex=o-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];this.state.referencePosCell=a.getBoundingClientRect()}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 re=new _.PluginKey("TableHandlesPlugin");class mi extends ie{constructor(o){super();h(this,"view");h(this,"plugin");h(this,"colDragStart",o=>{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:o.clientX},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(re,{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.");pi(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(D,0,0),o.dataTransfer.effectAllowed="move"});h(this,"rowDragStart",o=>{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:o.clientY},this.view.emitUpdate(),this.editor.dispatch(this.editor._tiptapEditor.state.tr.setMeta(re,{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.");pi(this.editor.prosemirrorView.root),o.dataTransfer.setDragImage(D,0,0),o.dataTransfer.effectAllowed="copyMove"});h(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(re,null)),!this.editor.prosemirrorView)throw new Error("Editor view not initialized.");Fa(this.editor.prosemirrorView.root)});h(this,"freezeHandles",()=>{this.view.menuFrozen=!0});h(this,"unfreezeHandles",()=>{this.view.menuFrozen=!1});this.editor=o,this.plugin=new _.Plugin({key:re,view:i=>(this.view=new hi(o,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 a=[];if(n===this.view.state.draggingState.originalIndex)return P.DecorationSet.create(i.doc,a);const r=i.doc.resolve(this.view.tablePos+1),s=r.node();if(this.view.state.draggingState.draggedCellOrientation==="row"){const l=i.doc.resolve(r.posAtIndex(n)+1),c=l.node();for(let u=0;u<c.childCount;u++){const p=i.doc.resolve(l.posAtIndex(u)+1),m=p.node(),f=p.pos+(n>this.view.state.draggingState.originalIndex?m.nodeSize-2:0);a.push(P.Decoration.widget(f,()=>{const g=document.createElement("div");return g.className="bn-table-drop-cursor",g.style.left="0",g.style.right="0",n>this.view.state.draggingState.originalIndex?g.style.bottom="-2px":g.style.top="-3px",g.style.height="4px",g}))}}else for(let l=0;l<s.childCount;l++){const c=i.doc.resolve(r.posAtIndex(l)+1),u=i.doc.resolve(c.posAtIndex(n)+1),p=u.node(),m=u.pos+(n>this.view.state.draggingState.originalIndex?p.nodeSize-2:0);a.push(P.Decoration.widget(m,()=>{const f=document.createElement("div");return f.className="bn-table-drop-cursor",f.style.top="0",f.style.bottom="0",n>this.view.state.draggingState.originalIndex?f.style.right="-2px":f.style.left="-3px",f.style.width="4px",f}))}return P.DecorationSet.create(i.doc,a)}}})}onUpdate(o){return this.on("update",o)}}const Ka=k.Extension.create({name:"textAlignment",addGlobalAttributes(){return[{types:["paragraph","heading","bulletListItem","numberedListItem","checkListItem"],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"],attributes:{textColor:{default:B.textColor.default,parseHTML:e=>e.hasAttribute("data-text-color")?e.getAttribute("data-text-color"):B.textColor.default,renderHTML:e=>e.textColor===B.textColor.default?{}:{"data-text-color":e.textColor}}}}]}}),qa=k.Extension.create({name:"trailingNode",addProseMirrorPlugins(){const e=new _.PluginKey(this.name);return[new _.Plugin({key:e,appendTransaction:(t,o,i)=>{const{doc:n,tr:a,schema:r}=i,s=e.getState(i),l=n.content.size-2,c=r.nodes.blockContainer,u=r.nodes.paragraph;if(s)return a.insert(l,c.create(void 0,u.create()))},state:{init:(t,o)=>{},apply:(t,o)=>{if(!t.docChanged)return o;let i=t.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*"}}})]}}),Xa={blockColor:"data-block-color",blockStyle:"data-block-style",id:"data-id",depth:"data-depth",depthChange:"data-depth-change"},Za=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 t={};for(const[o,i]of Object.entries(Xa))e.getAttribute(i)&&(t[o]=e.getAttribute(i));return e.getAttribute("data-node-type")==="blockContainer"?t:!1}}]},renderHTML({HTMLAttributes:e}){var n;const t=document.createElement("div");t.className="bn-block-outer",t.setAttribute("data-node-type","blockOuter");for(const[a,r]of Object.entries(e))a!=="class"&&t.setAttribute(a,r);const o={...((n=this.options.domAttributes)==null?void 0:n.block)||{},...e},i=document.createElement("div");i.className=$("bn-block",o.class),i.setAttribute("data-node-type",this.name);for(const[a,r]of Object.entries(o))a!=="class"&&i.setAttribute(a,r);return t.appendChild(i),{dom:t,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 t={...((i=this.options.domAttributes)==null?void 0:i.blockGroup)||{},...e},o=document.createElement("div");o.className=$("bn-block-group",t.class),o.setAttribute("data-node-type","blockGroup");for(const[n,a]of Object.entries(t))n!=="class"&&o.setAttribute(n,a);return{dom:o,contentDOM:o}}}),Ya=k.Node.create({name:"doc",topNode:!0,content:"blockGroup"}),Qa=e=>{var i;const t=[];t.push(Gi.default.configure({fragment:e.fragment}));const o=(i=e.provider)==null?void 0:i.awareness;if(o){const n=new Map;e.showCursorLabels!=="always"&&o.on("change",({updated:s})=>{for(const l of s){const c=n.get(l);c&&(c.element.setAttribute("data-active",""),c.hideTimeout&&clearTimeout(c.hideTimeout),n.set(l,{element:c.element,hideTimeout:setTimeout(()=>{c.element.removeAttribute("data-active")},2e3)}))}});const a=s=>{const l=document.createElement("span");l.classList.add("collaboration-cursor__caret"),l.setAttribute("style",`outline-color: ${s.color}`),(e==null?void 0:e.showCursorLabels)==="always"&&l.setAttribute("data-active","");const c=document.createElement("span");return c.classList.add("collaboration-cursor__label"),c.setAttribute("style",`background-color: ${s.color}`),c.insertBefore(document.createTextNode(s.name),null),l.insertBefore(document.createTextNode(""),null),l.insertBefore(c,null),l.insertBefore(document.createTextNode(""),null),l},r=s=>{var p;const l=[...o.getStates().entries()].find(m=>m[1].user===s);if(!l)throw new Error("Could not find client state for user");const c=l[0];let u=n.get(c);if(!u){const m=((p=e==null?void 0:e.renderCursor)==null?void 0:p.call(e,s))||a(s);(e==null?void 0:e.showCursorLabels)!=="always"&&(m.addEventListener("mouseenter",()=>{const f=n.get(c);f.element.setAttribute("data-active",""),f.hideTimeout&&(clearTimeout(f.hideTimeout),n.set(c,{element:f.element,hideTimeout:void 0}))}),m.addEventListener("mouseleave",()=>{const f=n.get(c);n.set(c,{element:f.element,hideTimeout:setTimeout(()=>{f.element.removeAttribute("data-active")},2e3)})})),u={element:m,hideTimeout:void 0},n.set(c,u)}return u.element};t.push($i.default.configure({user:e.user,render:r,provider:e.provider}))}return t},fi=e=>{const t={},o=er(e);for(const n of o)t[n.name]=n;t.formattingToolbar=new Zo(e.editor),t.linkToolbar=new ti(e.editor),t.sideMenu=new ci(e.editor,e.sideMenuDetection),t.suggestionMenus=new ui(e.editor),t.filePanel=new Wo(e.editor),t.placeholder=new Na(e.editor,e.placeholders),(e.animations??!0)&&(t.animations=new ja),e.tableHandles&&(t.tableHandles=new mi(e.editor)),t.dropCursor={plugin:e.dropCursor({width:5,color:"#ddeeff",editor:e.editor})},t.nodeSelectionKeyboard=new Pa;const i=e.disableExtensions||[];for(const n of i)delete t[n];return t},er=e=>{const t=[k.extensions.ClipboardTextSerializer,k.extensions.Commands,k.extensions.Editable,k.extensions.FocusEvents,k.extensions.Tabindex,Mi.Gapcursor,J.configure({types:["blockContainer","columnList","column"],setIdAttribute:e.setIdAttribute}),Li.HardBreak.extend({priority:10}),Ni.Text,Ai.Link.extend({inclusive:!1}).configure({defaultProtocol:ii,protocols:oi}),...Object.values(e.styleSpecs).map(o=>o.implementation.mark),Wa,Ba,Ka,k.Extension.create({name:"OverrideEscape",addKeyboardShortcuts(){return{Escape:()=>e.editor.suggestionMenus.shown?!1:this.editor.commands.blur()}}}),Ya,Za.configure({editor:e.editor,domAttributes:e.domAttributes}),Ia.configure({editor:e.editor,tabBehavior:e.tabBehavior}),Ja.configure({domAttributes:e.domAttributes}),...Object.values(e.inlineContentSpecs).filter(o=>o.config!=="link"&&o.config!=="text").map(o=>o.implementation.node.configure({editor:e.editor})),...Object.values(e.blockSpecs).flatMap(o=>[...(o.implementation.requiredExtensions||[]).map(i=>i.configure({editor:e.editor,domAttributes:e.domAttributes})),o.implementation.node.configure({editor:e.editor,domAttributes:e.domAttributes})]),Sa(e.editor),Ca(e.editor),va(e.editor),...e.trailingBlock===void 0||e.trailingBlock?[qa]:[]];return e.collaboration?t.push(...Qa(e.collaboration)):t.push(Pi.History),t};function tr(e,t){const o=[];return e.forEach((i,n,a)=>{a!==t&&o.push(i)}),w.Fragment.from(o)}function or(e,t){const o=[];for(let i=0;i<e.childCount;i++)if(e.child(i).type.name==="tableRow")if(o.length>0&&o[o.length-1].type.name==="table"){const n=o[o.length-1],a=n.copy(n.content.addToEnd(e.child(i)));o[o.length-1]=a}else{const n=t.nodes.table.createChecked(void 0,e.child(i));o.push(n)}else o.push(e.child(i));return e=w.Fragment.from(o),e}function ir(e,t){let o=w.Fragment.from(e.content);if(o=or(o,t.state.schema),!nr(o,t))return new w.Slice(o,e.openStart,e.openEnd);for(let i=0;i<o.childCount;i++)if(o.child(i).type.spec.group==="blockContent"){const n=[o.child(i)];if(i+1<o.childCount&&o.child(i+1).type.name==="blockGroup"){const r=o.child(i+1).child(0).child(0);(r.type.name==="bulletListItem"||r.type.name==="numberedListItem"||r.type.name==="checkListItem")&&(n.push(o.child(i+1)),o=tr(o,i+1))}const a=t.state.schema.nodes.blockContainer.createChecked(void 0,n);o=o.replaceChild(i,a)}return new w.Slice(o,e.openStart,e.openEnd)}function nr(e,t){var a,r;const o=e.childCount===1,i=((a=e.firstChild)==null?void 0:a.type.spec.content)==="inline*",n=((r=e.firstChild)==null?void 0:r.type.spec.content)==="tableRow+";if(o){if(i)return!1;if(n){const s=C(t.state);if(s.isBlockContainer)return!(s.blockContent.node.type.spec.content==="tableRow+")}}return!0}const Ie=class Ie extends k.Editor{constructor(o,i){super({...o,content:void 0});h(this,"_state");h(this,"_creating",!1);h(this,"mount",o=>{o?(this.options.element=o,this.createViewAlternative()):(this.destroy(),this._creating=!1)});const n=this.schema;let a;const r=n.nodes.doc.createAndFill;n.nodes.doc.createAndFill=(...l)=>{if(a)return a;const c=r.apply(n.nodes.doc,l),u=JSON.parse(JSON.stringify(c.toJSON()));return u.content[0].content[0].attrs.id="initialBlockId",a=w.Node.fromJSON(n,u),a};let s;try{const l=o==null?void 0:o.content.map(c=>q(c,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(o.content))}this._state=_.EditorState.create({doc:s,schema:this.schema})}get state(){return this.view&&(this._state=this.view.state),this._state}dispatch(o){this.view?this.view.dispatch(o):this._state=this.state.apply(o)}createViewAlternative(){this._creating=!0,queueMicrotask(()=>{if(!this._creating)return;this.view=new P.EditorView({mount:this.options.element},{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:this.state});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0,this._creating=!1})}};h(Ie,"create",(o,i)=>{var a,r;const n=(a=globalThis==null?void 0:globalThis.window)==null?void 0:a.setTimeout;typeof((r=globalThis==null?void 0:globalThis.window)==null?void 0:r.setTimeout)<"u"&&(globalThis.window.setTimeout=()=>0);try{return new Ie(o,i)}finally{n&&(globalThis.window.setTimeout=n)}});let Ee=Ie;Ee.prototype.createView=function(){this.options.onPaste=this.options.onDrop=void 0};const ar={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1};class rt{constructor(t){h(this,"_pmSchema");h(this,"extensions",{});h(this,"headless",!1);h(this,"_tiptapEditor");h(this,"elementRenderer",null);h(this,"blockCache",new WeakMap);h(this,"dictionary");h(this,"schema");h(this,"blockImplementations");h(this,"inlineContentImplementations");h(this,"styleImplementations");h(this,"formattingToolbar");h(this,"linkToolbar");h(this,"sideMenu");h(this,"suggestionMenus");h(this,"filePanel");h(this,"tableHandles");h(this,"uploadFile");h(this,"onUploadStartCallbacks",[]);h(this,"onUploadEndCallbacks",[]);h(this,"resolveFileUrl");h(this,"mount",t=>{this._tiptapEditor.mount(t)});var s,l,c,u,p,m,f;this.options=t;const o=t;if(o.onEditorContentChange)throw new Error("onEditorContentChange initialization option is deprecated, use <BlockNoteView onChange={...} />, the useEditorChange(...) hook, or editor.onChange(...)");if(o.onTextCursorPositionChange)throw new Error("onTextCursorPositionChange initialization option is deprecated, use <BlockNoteView onSelectionChange={...} />, the useEditorSelectionChange(...) hook, or editor.onSelectionChange(...)");if(o.onEditorReady)throw new Error("onEditorReady is deprecated. Editor is immediately ready for use after creation.");if(o.editable)throw new Error("editable initialization option is deprecated, use <BlockNoteView editable={true/false} />, or alternatively editor.isEditable = true/false");this.dictionary=t.dictionary||ut;const i={defaultStyles:!0,schema:t.schema||oe.create(),_headless:!1,...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(this.schema=i.schema,this.blockImplementations=i.schema.blockSpecs,this.inlineContentImplementations=i.schema.inlineContentSpecs,this.styleImplementations=i.schema.styleSpecs,this.extensions=fi({editor:this,domAttributes:i.domAttributes||{},blockSpecs:this.schema.blockSpecs,styleSpecs:this.schema.styleSpecs,inlineContentSpecs:this.schema.inlineContentSpecs,collaboration:i.collaboration,trailingBlock:i.trailingBlock,disableExtensions:i.disableExtensions,setIdAttribute:i.setIdAttribute,animations:i.animations??!0,tableHandles:N("table",this),dropCursor:this.options.dropCursor??Hi.dropCursor,placeholders:i.placeholders,tabBehavior:i.tabBehavior,sideMenuDetection:i.sideMenuDetection||"viewport"}),(((s=i._tiptapOptions)==null?void 0:s.extensions)||[]).forEach(g=>{this.extensions[g.name]=g}),Object.entries(i._extensions||{}).forEach(([g,b])=>{typeof b=="function"&&(b=b(this)),this.extensions[g]=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,i.uploadFile){const g=i.uploadFile;this.uploadFile=async(b,y)=>{this.onUploadStartCallbacks.forEach(v=>v.apply(this,[y]));try{return await g(b,y)}finally{this.onUploadEndCallbacks.forEach(v=>v.apply(this,[y]))}}}this.resolveFileUrl=i.resolveFileUrl,this.headless=i._headless,i.collaboration&&i.initialContent&&console.warn("When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider");const n=i.initialContent||(t.collaboration?[{type:"paragraph",id:"initialBlockId"}]:[{type:"paragraph",id:J.options.generateID()}]);if(!Array.isArray(n)||n.length===0)throw new Error("initialContent must be a non-empty array of blocks, received: "+n);const a=[...Object.entries(this.extensions).map(([g,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:g,addProseMirrorPlugins:()=>[b.plugin]})})],r={...ar,...i._tiptapOptions,content:n,extensions:a,editorProps:{...(l=i._tiptapOptions)==null?void 0:l.editorProps,attributes:{tabIndex:"0",...(u=(c=i._tiptapOptions)==null?void 0:c.editorProps)==null?void 0:u.attributes,...(p=i.domAttributes)==null?void 0:p.editor,class:$("bn-editor",i.defaultStyles?"bn-default-styles":"",((f=(m=i.domAttributes)==null?void 0:m.editor)==null?void 0:f.class)||"")},transformPasted:ir}};this.headless?this._pmSchema=k.getSchema(r.extensions):(this._tiptapEditor=Ee.create(r,this.schema.styleSchema),this._pmSchema=this._tiptapEditor.schema)}get pmSchema(){return this._pmSchema}static create(t={}){return new rt(t)}dispatch(t){this._tiptapEditor.dispatch(t)}get prosemirrorView(){return this._tiptapEditor.view}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 o=this.onUploadStartCallbacks.indexOf(t);o>-1&&this.onUploadStartCallbacks.splice(o,1)}}onUploadEnd(t){return this.onUploadEndCallbacks.push(t),()=>{const o=this.onUploadEndCallbacks.indexOf(t);o>-1&&this.onUploadEndCallbacks.splice(o,1)}}get topLevelBlocks(){return this.document}get document(){const t=[];return this._tiptapEditor.state.doc.firstChild.descendants(o=>(t.push(S(o,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.blockCache)),!1)),t}getBlock(t){return ia(this,t)}getPrevBlock(t){return na(this,t)}getNextBlock(t){return aa(this,t)}getParentBlock(t){return ra(this,t)}forEachBlock(t,o=!1){const i=this.document.slice();o&&i.reverse();function n(a){for(const r of a){if(t(r)===!1)return!1;const s=o?r.children.slice().reverse():r.children;if(!n(s))return!1}return!0}n(i)}onEditorContentChange(t){this._tiptapEditor.on("update",t)}onEditorSelectionChange(t){this._tiptapEditor.on("selectionUpdate",t)}getTextCursorPosition(){return ca(this)}setTextCursorPosition(t,o="start"){Ho(this,t,o)}getSelection(){return la(this)}setSelection(t,o){da(this,t,o)}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,o,i="before"){return Kn(this,t,o,i)}updateBlock(t,o){return io(this,t,o)}removeBlocks(t){return oa(this,t)}replaceBlocks(t,o){return ta(this,t,o)}insertInlineContent(t){const o=H(t,this.pmSchema,this.schema.styleSchema);sa({from:this._tiptapEditor.state.selection.from,to:this._tiptapEditor.state.selection.to},o,this)}getActiveStyles(){const t={},o=this._tiptapEditor.state.selection.$to.marks();for(const i of o){const n=this.schema.styleSchema[i.type.name];if(!n){i.type.name!=="link"&&console.warn("mark not found in styleschema",i.type.name);continue}n.propSchema==="boolean"?t[n.type]=!0:t[n.type]=i.attrs.stringValue}return t}addStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.setMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.setMark(o,{stringValue:i});else throw new j(n.propSchema)}}removeStyles(t){for(const o of Object.keys(t))this._tiptapEditor.commands.unsetMark(o)}toggleStyles(t){for(const[o,i]of Object.entries(t)){const n=this.schema.styleSchema[o];if(!n)throw new Error(`style ${o} not found in styleSchema`);if(n.propSchema==="boolean")this._tiptapEditor.commands.toggleMark(o);else if(n.propSchema==="string")this._tiptapEditor.commands.toggleMark(o,{stringValue:i});else throw new j(n.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,o){if(t==="")return;const{from:i,to:n}=this._tiptapEditor.state.selection;o||(o=this._tiptapEditor.state.doc.textBetween(i,n));const a=this.pmSchema.mark("link",{href:t});this.dispatch(this._tiptapEditor.state.tr.insertText(o,i,n).addMark(i,i+o.length,a))}canNestBlock(){return Qn(this)}nestBlock(){Do(this)}canUnnestBlock(){return ea(this)}unnestBlock(){Yn(this)}moveBlocksUp(){Xn(this)}moveBlocksDown(){Zn(this)}async blocksToHTMLLossy(t=this.document){return de(this.pmSchema,this).exportBlocks(t,{})}async blocksToFullHTML(t){return _t(this.pmSchema,this).serializeBlocks(t,{})}async tryParseHTMLToBlocks(t){return tt(t,this.schema.blockSchema,this.schema.inlineContentSchema,this.schema.styleSchema,this.pmSchema)}async blocksToMarkdownLossy(t=this.document){return Oo(t,this.pmSchema,this,{})}async tryParseMarkdownToBlocks(t){return Vo(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 o=()=>{t(this)};return this._tiptapEditor.on("update",o),()=>{this._tiptapEditor.off("update",o)}}onSelectionChange(t){if(this.headless)return;const o=()=>{t(this)};return this._tiptapEditor.on("selectionUpdate",o),()=>{this._tiptapEditor.off("selectionUpdate",o)}}openSuggestionMenu(t,o){var a;const i=(a=this.prosemirrorView)==null?void 0:a.state.tr;if(!i)return;const n=o&&o.deleteTriggerCharacter?i.insertText(t):i;this.prosemirrorView.focus(),this.prosemirrorView.dispatch(n.scrollIntoView().setMeta(this.suggestionMenus.plugin,{triggerCharacter:t,deleteTriggerCharacter:(o==null?void 0:o.deleteTriggerCharacter)||!1,ignoreQueryLength:(o==null?void 0:o.ignoreQueryLength)||!1}))}}const rr={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"}},sr={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 lr{constructor(t,o,i){this.mappings=o,this.options=i}async resolveFile(t){var i;if(!((i=this.options)!=null&&i.resolveFileUrl))return(await fetch(t)).blob();const o=await this.options.resolveFileUrl(t);return o instanceof Blob?o:(await fetch(o)).blob()}mapStyles(t){return Object.entries(t).map(([i,n])=>this.mappings.styleMapping[i](n,this))}mapInlineContent(t){return this.mappings.inlineContentMapping[t.type](t,this)}transformInlineContent(t){return t.map(o=>this.mapInlineContent(o))}async mapBlock(t,o,i){return this.mappings.blockMapping[t.type](t,this,o,i)}}function dr(e){return{createBlockMapping:t=>t,createInlineContentMapping:t=>t,createStyleMapping:t=>t}}let Te,st;async function cr(e,t){if(!Eo("text",e))return[];if(!Te){Te=import("@emoji-mart/data"),st=await import("emoji-mart");const n=(await Te).default;await st.init({data:n})}const o=(await Te).default;return(t.trim()===""?Object.values(o.emojis):await st.SearchIndex.search(t)).map(n=>({id:n.skins[0].native,onItemClick:()=>e.insertInlineContent(n.skins[0].native+" ")}))}function ur(e,...t){const o=[...e];for(const i of t)for(const n of i){const a=o.findLastIndex(r=>r.group===n.group);a===-1?o.push(n):o.splice(a+1,0,n)}return o}function lt(e=""){return typeof e=="string"?[{type:"text",text:e,styles:{}}]:e}function ge(e){return typeof e=="string"?lt(e):Array.isArray(e)?e.flatMap(t=>typeof t=="string"?lt(t):Ae(t)?{...t,content:lt(t.content)}:Y(t)?t:{props:{},...t,content:ge(t.content)}):(e==null?void 0:e.type)==="tableContent"?{type:"tableContent",columnWidths:e.columnWidths,rows:e.rows.map(t=>({...t,cells:t.cells.map(o=>ge(o))}))}:e}function pr(e,t){return t.map(o=>dt(e.blockSchema,o))}function dt(e,t){var n;const o=e[t.type].content,i={id:"",type:t.type,props:{},content:o==="inline"?[]:o==="table"?{type:"tableContent",columnWidths:[],rows:[]}:void 0,children:[],...t};if(Object.entries(e[t.type].propSchema).forEach(([a,r])=>{i.props[a]===void 0&&r.default!==void 0&&(i.props[a]=r.default)}),o==="inline"){const a=i.content;i.content=ge(a)}else if(o==="table"){const a=i.content;i.content={type:"tableContent",columnWidths:(a==null?void 0:a.columnWidths)||((n=a==null?void 0:a.rows[0])==null?void 0:n.cells.map(()=>{}))||[],rows:(a==null?void 0:a.rows.map(r=>({cells:r.cells.map(s=>ge(s))})))||[]}}return{...i,content:ge(i.content),children:i.children.map(a=>dt(e,a))}}function gi(e){e.id||(e.id=J.options.generateID()),e.children&&bi(e.children)}function bi(e){for(const t of e)gi(t)}d.AudioBlock=Vt,d.BlockNoteEditor=rt,d.BlockNoteSchema=oe,d.COLORS_DARK_MODE_DEFAULT=sr,d.COLORS_DEFAULT=rr,d.CodeBlock=Gt,d.DEFAULT_LINK_PROTOCOL=ii,d.EMPTY_CELL_HEIGHT=In,d.EMPTY_CELL_WIDTH=qe,d.Exporter=lr,d.FILE_AUDIO_ICON_SVG=Dt,d.FILE_ICON_SVG=Pt,d.FILE_IMAGE_ICON_SVG=ro,d.FILE_VIDEO_ICON_SVG=ko,d.FileBlock=to,d.FilePanelProsemirrorPlugin=Wo,d.FilePanelView=Ko,d.FormattingToolbarProsemirrorPlugin=Zo,d.FormattingToolbarView=qo,d.HTMLToBlocks=tt,d.ImageBlock=ho,d.LinkToolbarProsemirrorPlugin=ti,d.PageBreak=Xt,d.SideMenuProsemirrorPlugin=ci,d.SideMenuView=li,d.SuggestionMenuProseMirrorPlugin=ui,d.TableHandlesProsemirrorPlugin=mi,d.TableHandlesView=hi,d.UniqueID=J,d.UnreachableCaseError=j,d.VALID_LINK_PROTOCOLS=oi,d.VideoBlock=xo,d.addIdsToBlock=gi,d.addIdsToBlocks=bi,d.addInlineContentAttributes=Re,d.addInlineContentKeyboardShortcuts=xt,d.addStyleAttributes=It,d.applyNonSelectableBlockFix=wt,d.assertEmpty=Xi,d.audioBlockConfig=Ht,d.audioParse=Ut,d.audioPropSchema=jt,d.audioRender=Ot,d.audioToExternalHTML=Rt,d.blockToNode=q,d.blocksToMarkdown=Oo,d.camelToDataKebab=ce,d.checkBlockHasDefaultProp=Un,d.checkBlockIsDefaultType=To,d.checkBlockIsFileBlock=jn,d.checkBlockIsFileBlockWithPlaceholder=On,d.checkBlockIsFileBlockWithPreview=Hn,d.checkBlockTypeHasDefaultProp=Io,d.checkDefaultBlockTypeInSchema=N,d.checkDefaultInlineContentTypeInSchema=Eo,d.checkPageBreakBlocksInSchema=Mo,d.cleanHTMLToMarkdown=Se,d.combineByGroup=ur,d.contentNodeToInlineContent=pe,d.contentNodeToTableContent=Ue,d.createAddFileButton=Lt,d.createBlockSpec=te,d.createBlockSpecFromStronglyTypedTiptapNode=W,d.createDefaultBlockDOMOutputSpec=R,d.createExternalHTMLExporter=de,d.createFigureWithCaption=ve,d.createFileBlockWrapper=ye,d.createFileNameWithIcon=At,d.createInlineContentSpec=rn,d.createInlineContentSpecFromTipTapNode=Bt,d.createInternalBlockSpec=He,d.createInternalHTMLSerializer=_t,d.createInternalInlineContentSpec=St,d.createInternalStyleSpec=ze,d.createLinkWithCaption=me,d.createResizableFileBlockWrapper=Ke,d.createStronglyTypedTiptapNode=K,d.createStyleSpec=sn,d.createStyleSpecFromTipTapMark=X,d.createSuggestionMenu=za,d.customizeCodeBlock=ln,d.defaultBlockSchema=So,d.defaultBlockSpecs=Xe,d.defaultBlockToHTML=De,d.defaultCodeBlockPropSchema=Ce,d.defaultInlineContentSchema=Bo,d.defaultInlineContentSpecs=Je,d.defaultProps=B,d.defaultStyleSchema=Dn,d.defaultStyleSpecs=Ze,d.fileBlockConfig=Jt,d.fileParse=Qt,d.filePropSchema=Zt,d.fileRender=Yt,d.fileToExternalHTML=eo,d.filenameFromURL=an,d.filterSuggestionItems=zn,d.formatKeyboardShortcut=G,d.formattingToolbarPluginKey=Xo,d.getBlockFromPos=vt,d.getBlockInfo=F,d.getBlockInfoFromResolvedPos=Q,d.getBlockInfoFromSelection=C,d.getBlockInfoWithManualOffset=ke,d.getBlockNoteExtensions=fi,d.getBlockSchemaFromSpecs=Oe,d.getDefaultEmojiPickerItems=cr,d.getDefaultSlashMenuItems=Vn,d.getInlineContentParseRules=Et,d.getInlineContentSchemaFromSpecs=Ve,d.getNearestBlockPos=z,d.getNodeById=A,d.getPageBreakSlashMenuItems=Gn,d.getParseRules=Ct,d.getStyleParseRules=Mt,d.getStyleSchemaFromSpecs=Fe,d.imageBlockConfig=lo,d.imageParse=uo,d.imagePropSchema=so,d.imageRender=co,d.imageToExternalHTML=po,d.inheritedProps=je,d.initializeESMDependencies=xe,d.inlineContentToNodes=H,d.insertOrUpdateBlock=L,d.isAppleOS=yt,d.isLinkInlineContent=Pe,d.isPartialLinkInlineContent=Ae,d.isSafari=nn,d.isStyledTextInlineContent=Y,d.linkToolbarPluginKey=ei,d.locales=qi,d.mappingFactory=dr,d.markdownToBlocks=Vo,d.mergeCSSClasses=$,d.nodeToBlock=S,d.nodeToCustomInlineContent=_e,d.pageBreakConfig=$t,d.pageBreakParse=Wt,d.pageBreakRender=Kt,d.pageBreakSchema=Qe,d.pageBreakToExternalHTML=qt,d.parseEmbedElement=$e,d.parseFigureElement=he,d.partialBlockToBlockForTesting=dt,d.partialBlocksToBlocksForTesting=pr,d.propsToAttributes=ee,d.shikiHighlighterPromiseSymbol=we,d.shikiParserSymbol=Ge,d.sideMenuPluginKey=di,d.stylePropsToAttributes=Tt,d.tableContentToNodes=le,d.tableHandlesPluginKey=re,d.updateBlock=io,d.updateBlockCommand=T,d.uploadToTmpFilesDotOrg_DEV_ONLY=$n,d.videoBlockConfig=yo,d.videoParse=wo,d.videoPropSchema=_o,d.videoRender=vo,d.videoToExternalHTML=Co,d.withPageBreak=Fn,d.wrapInBlockStructure=ue,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
11
11
|
//# sourceMappingURL=blocknote.umd.cjs.map
|