@kedataindo/docflow-vue 0.0.79 → 0.0.81

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.
Files changed (3) hide show
  1. package/dist/index.cjs +104 -104
  2. package/dist/index.js +1966 -1948
  3. package/package.json +4 -4
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";var Yh=Object.defineProperty;var eb=(e,t,n)=>t in e?Yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kn=(e,t,n)=>eb(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("@kedataindo/docflow-core"),s=require("vue"),ar=require("@kedataindo/docflow-layout-engine");function of(e){const t=s.ref(null),n=s.shallowRef(null),i=s.ref(!1),r=s.computed(()=>{var c;return((c=n.value)==null?void 0:c.editor)??null}),a=s.computed(()=>{var c;return((c=n.value)==null?void 0:c.pluginActions)??{}}),o=()=>{if(!t.value||n.value)return;const c=s.unref(e.collaboration),u=s.unref(e.content),f=Ee.createEditor({target:t.value,content:u,plugins:e.plugins,editable:e.editable??!0,collaboration:c,onUpdate:e.onUpdate,getPageMap:e.getPageMap,paginationOptions:e.paginationOptions,onImageUpload:e.onImageUpload,citation:e.citation,aiStream:e.aiStream,aiDraft:e.aiDraft,debug:e.debug});n.value=f,s.nextTick(()=>{i.value=!0})},l=()=>{var c;(c=n.value)==null||c.destroy(),n.value=null,i.value=!1};return s.onMounted(()=>{o()}),s.onUnmounted(()=>{l()}),s.watch(()=>e.editable,c=>{r.value&&r.value.setEditable(c??!0)}),s.watch(()=>s.unref(e.collaboration),async(c,u)=>{c!==u&&(l(),await s.nextTick(),o())}),{editorRef:t,docsEditor:n,editor:r,pluginActions:a,isReady:i}}function tb(e){const t=s.computed(()=>{var r,a,o;return(o=(a=(r=e.value)==null?void 0:r.storage)==null?void 0:a.editorContext)==null?void 0:o.aiStream}),n=s.computed(()=>{var r,a,o;return(o=(a=(r=e.value)==null?void 0:r.storage)==null?void 0:a.editorContext)==null?void 0:o.aiDraft}),i=s.computed(()=>!!t.value);return{aiStream:t,aiDraft:n,isAIAvailable:i}}const iu="docs-editor-theme",cs=s.ref(!1);function Ro(){const e=n=>{if(cs.value=n,typeof document<"u"){const i=document.documentElement;n?i.classList.add("dark"):i.classList.remove("dark")}typeof localStorage<"u"&&localStorage.setItem(iu,n?"dark":"light")},t=()=>e(!cs.value);return s.onMounted(()=>{let n=!1;if(typeof localStorage<"u"){const i=localStorage.getItem(iu);i?n=i==="dark":typeof window<"u"&&(n=window.matchMedia("(prefers-color-scheme: dark)").matches)}e(n)}),{isDark:cs,toggle:t}}function nb(e,t){let n=1;return e.state.doc.nodesBetween(0,t-1,(i,r)=>{i.isBlock&&r>0&&n++},1),n}function ib(e,t){let n;return e.state.doc.nodesBetween(0,t,i=>{i.type.name==="heading"&&i.textContent.trim()&&(n=i.textContent.trim())}),n}function rb(e,t,n){try{const{view:i}=e,r=i.coordsAtPos(n),a=i.coordsAtPos(t);if(!r||!a)return 1;const o=parseFloat(getComputedStyle(i.dom).lineHeight)||parseFloat(getComputedStyle(i.dom).fontSize)*1.6||24;return o<=0?1:Math.max(1,Math.round((r.top-a.top)/o)+1)}catch{return 1}}function ab(e){const t=e.view.dom,n=t.querySelector("[data-rm-pagination]");if(!n)return{page:1,pageCount:1};const i=t.getBoundingClientRect();if(i.height===0||i.width===0)return{page:1,pageCount:1};const r=n.children.length||1;let a=1;try{const o=e.view.coordsAtPos(e.state.selection.head);if(!o)return{page:a,pageCount:r};const l=Array.from(n.querySelectorAll(".rm-page-break")),c=t.getBoundingClientRect(),u=o.top-c.top+t.scrollTop;let f=1,m=!1;for(const p of l){const h=p.querySelector(".breaker");if(h instanceof HTMLElement&&u<h.offsetTop){a=f,m=!0;break}f++}m||(a=f)}catch{a=1}return{page:a,pageCount:r}}function Ll(e){const t=e.state,{$from:n,head:i}=t.selection;let r=n.depth;for(;r>0&&!n.node(r).isBlock;)r--;const a=n.before(r),o=n.node(r),l=o.isBlock?o.type.name:void 0,{page:c,pageCount:u}=ab(e);return{page:c,pageCount:u,paragraphIndex:a>0?nb(e,a):1,line:rb(e,a,i),...l?{blockType:l}:{},section:ib(e,i)}}const sf={common:{save:"Save",cancel:"Cancel",create:"Create",delete:"Delete",rename:"Rename",duplicate:"Duplicate",move:"Move",moveToFolder:"Move to folder",moveDocument:"Move Document",noFolder:"(No Folder)",search:"Search",loading:"Loading...",error:"Error",dismiss:"Dismiss",emptyDocument:"(Empty Document)",confirmDelete:"Are you sure you want to delete this document?",undo:"Undo",restore:"Restore",deleteForever:"Delete forever",back:"Back",confirmPermanentDelete:"Permanently delete this document? This cannot be undone.",confirmPermanentDeleteBulk:"Permanently delete {count} documents? This cannot be undone.",selectAll:"Select all",clearSelection:"Clear selection"},header:{file:"File",new:"New",newDocument:"New document",helpMeCreate:"Help me create",fromTemplate:"From a template",open:"Open",makeACopy:"Make a copy",share:"Share",email:"Email",emailDraft:"Email draft",download:"Download",rename:"Rename",move:"Move",moveToFolder:"Move to folder",moveToTrash:"Move to trash",addToStarred:"Add to Starred",versionHistory:"Version history",language:"Language",pageSetup:"Page setup",print:"Print",details:"Details",security:"Security limitations",edit:"Edit",view:"View",insert:"Insert",format:"Format",tools:"Tools",extensions:"Extensions",help:"Help",backToDocuments:"Back to Documents",clickToRename:"Click to rename",starDocument:"Star document",unstarDocument:"Unstar document",sandbox:"Sandbox (toggle simulated collaborators)",theme:"Theme",account:"Account",markdown:"Markdown (.md)",html:"Web page (.html)",htmlZip:"Web page (.html, zipped)",text:"Plain text (.txt)",docx:"Microsoft Word (.docx)",pdf:"PDF Document (.pdf)",odt:"OpenDocument Format (.odt)",rtf:"Rich Text Format (.rtf)",undo:"Undo",redo:"Redo",selectAll:"Select all",cut:"Cut",copy:"Copy",paste:"Paste",pasteWithoutFormatting:"Paste without formatting",delete:"Delete",findAndReplace:"Find and replace",showSidebar:"Show outline",focusMode:"Full focus mode",showRuler:"Show ruler",meetingNotes:"Meeting notes",image:"Image",table:"Table",codeBlock:"Code block",link:"Link",header:"Header",footer:"Footer",footnote:"Footnote",tableOfContents:"Table of contents",bold:"Bold text",italic:"Italic text",underline:"Underline",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",alignIndent:"Align & indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Justify",bulletsNumbering:"Bullets & numbering",bulletList:"Bulleted list",numberedList:"Numbered list",taskList:"Task list",horizontalLine:"Horizontal line",pageNumbers:"Page numbers",pageNumberInHeader:"Insert in header",pageNumberInFooter:"Insert in footer",break:"Break",pageBreak:"Page break",pageBreakShortcut:"Ctrl+Enter",smartElements:"Smart elements",dateChip:"Date",peopleChip:"People",fileChip:"File",dropdownChip:"Dropdown",locationChip:"Location",pagelessFormat:"Pageless format",clearFormatting:"Clear formatting",spellCheck:"Spell check",wordCount:"Word count",preferences:"Preferences",manageExtensions:"Manage extensions…",keyboardShortcuts:"Keyboard shortcuts",reportIssue:"Report issue",about:"About DocsEditor"},toolbar:{undo:"Undo",redo:"Redo",print:"Print",spelling:"Spelling",zoom:"100%",paragraphStyle:"Paragraph style",normalText:"Normal text",fontFamily:"Font family",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",fontSize:"Font size",lists:"Lists",alignment:"Alignment",insert:"Insert",comments:"Comments",history:"History",ai:"AI",tableOfContents:"Table of contents",references:"References"},statusBar:{liveSyncActive:"Live Sync Active",connecting:"Connecting…",saving:"Saving changes…",offline:"Offline",lastSavedAt:"Last saved at",never:"Never",pageSize:"Page size",page:"Page",of:"of",pageless:"Pageless",words:"words",characters:"characters"},editor:{share:{title:"Share document",close:"Close",shareableLink:"Shareable link",copy:"Copy",copied:"Link copied to clipboard",couldNotCopy:"Could not copy link",collaborators:"Collaborators",addCollaborator:"Add collaborator by email",placeholder:"colleague@example.com",add:"Add",userNotFound:"User not found",failedToAdd:"Failed to add collaborator",visibility:"Visibility",private:"Private",privateDescription:"Only you and people you invite can access this document.",restricted:"Restricted",restrictedDescription:"Anyone with the link can view this document."},print:"Print",logOut:"Log out",rename:{title:"Rename document",label:"Document title",save:"Save",cancel:"Cancel"},pageSetup:{title:"Page setup",paperSize:"Paper size",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",top:"Top",bottom:"Bottom",left:"Left",right:"Right",apply:"Apply",cancel:"Cancel"},details:{title:"Document details",titleLabel:"Title",owner:"Owner",location:"Location",noFolder:"(No folder)",created:"Created",modified:"Last modified",statistics:"Statistics",words:"Words",characters:"Characters",pages:"Pages",loading:"Loading document details…"},email:{title:"Email this file",to:"To",toPlaceholder:"recipient@example.com",subject:"Subject",body:"Body",send:"Send",copyLink:"Copy link",shareableLink:"Shareable link",defaultSubject:"Document: {title}",defaultBody:"You can view this document at: {url}"},linkDialog:{insertTitle:"Insert link",editTitle:"Edit link",text:"Text to display",textPlaceholder:"Link text",url:"URL",urlPlaceholder:"https://example.com",insert:"Insert",update:"Update",remove:"Remove link",cancel:"Cancel",urlRequired:"URL is required",urlInvalid:"Please enter a valid URL"},findReplace:{title:"Find and replace",findPlaceholder:"Find in document",replacePlaceholder:"Replace with",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace all",noMatches:"No matches",matchCount:"{current} of {total}",close:"Close"},headerFooter:{header:"Header",footer:"Footer",headerPlaceholder:"e.g. Document Title",footerPlaceholder:"e.g. Page {page} of {total}",headerLeftPlaceholder:"e.g. Document Title",headerRightPlaceholder:"e.g. Page {page}",differentFirstPage:"Different first page",differentOddEven:"Different odd & even pages",options:"Options",formatHeader:"Header format",pageNumber:"Page numbers",removeHeader:"Remove header",removeFooter:"Remove footer",alignPlacement:"Content placement",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",placementSection:"Placement",placementHint:"Header/footer content is aligned within the text area (left/center/right).",headerFooterFormatTitle:"Header & footer",marginSection:"Margin",headerTopMargin:"Header (centimeters from top)",footerBottomMargin:"Footer (centimeters from bottom)",layoutSection:"Layout",pageNumberTitle:"Page numbers",positionSection:"Position",positionHeader:"Header",positionFooter:"Footer",showOnFirstPage:"Show on first page",numberingSection:"Numbering",startAt:"Start at",continueFromPrevious:"Continue from previous section",hideOnPages:"Hide page numbers on",hideOnPagesPlaceholder:"e.g. 1, 3-5",hideOnPagesHint:"Separate with commas; use a dash for ranges (e.g. 1, 3-5). Pages are still counted, only the number is hidden.",apply:"Apply",cancel:"Cancel",save:"Save"},showOutline:"Show document outline",loadingDocument:"Loading document"},slashMenu:{title:"Suggested",basicBlocks:"Basic Blocks",noMatch:"No matching commands"},documentTabs:{documentTabs:"Document Tabs",addTab:"Add tab",rename:"Rename",delete:"Delete",outline:"Outline",untitledHeading:"Untitled Heading {level}",placeholder:"Headings you add to the document will appear here."},theme:{lightMode:"Switch to light mode",darkMode:"Switch to dark mode"},sidebars:{ai:{title:"AI Writing Helper",description:"A server-side AI co-writer to draft, summarize, or edit your copy.",quickMacros:"Quick AI Macros",summarize:"Summarize",fixGrammar:"Fix Grammar",continue:"Continue",toSpanish:"To Spanish",generations:"AI Generations",aiDrafting:"AI drafting…",copy:"Copy",copied:"Copied",insert:"Insert",inserted:"Inserted",noDraft:"Ask anything about your document, or run a quick macro above.",promptPlaceholder:"Ask AI to draft outline, write content, rewrite tone…",promptAI:"Prompt AI",close:"Close",you:"You",assistant:"Assistant",notConfigured:"AI is not configured on this deployment.",selectTextFirst:"Select text in the document first",improveSelection:"Improve selection",draft:"Draft with citations",draftPlaceholder:"Ask the AI to draft text grounded on your reference library…",promptDraft:"Draft",citations:"Citations",emptyResponse:"The AI returned an empty response.",aiError:"AI request failed",contextLabel:"Attached context",pageShort:"p.",paragraphShort:"Para.",lineShort:"Line",selectionContext:"Selected text"},comments:{title:"Discussion Panel",placeholder:"Select text to add a comment…",addComment:"Add comment",resolve:"Resolve",reply:"Reply…",replyInThread:"Reply in thread",active:"Active",resolved:"Resolved",creatingAnchored:"Creating anchored comment:",quote:"Quote:",resolvedBy:"Resolved by {user}",noComments:"No {mode} comments yet.",commentOnSelection:"Comment on selection…",generalComment:"Add general comment to document…",anchoredComment:"Anchored comment",general:"General comment",post:"Post",orphaned:"Text deleted",delete:"Delete",confirmDelete:"Delete this comment thread? This cannot be undone."},history:{title:"History",empty:"No history yet.",version:"Version",restore:"Restore",closePreview:"Close Preview",restoreThis:"Restore This",viewingPreview:"Viewing Revision Preview",readOnlyPreview:"You are previewing version #{index}. Your editor is temporarily read-only.",modifiedBy:"Modified by:",saveNamedSnapshot:"Save Named Snapshot",snapshotPlaceholder:"e.g. Approved Final Draft…",noSnapshots:"No snapshots saved yet.",save:"Save",cancel:"Cancel",preview:"Preview"},toc:{title:"Contents",empty:"No headings yet.",untitledHeading:"Untitled Heading {level}",newSection:"New {tag} Section",startWriting:"Start writing here…",closeOutline:"Close outline",searchHeadings:"Search headings…",noHeadings:"No Headings Yet",noHeadingsDescription:"Use headers (H1, H2, or H3) to structure your document. An interactive outline will generate here automatically.",quickInsert:"Quick Insert",headingLevel:"Heading {level}",noMatchingHeaders:"No matching headers found",tryDifferentTerm:"Try searching with a different term.",outlineLayout:"Outline Layout",outlineSync:"Outline syncs automatically. Click any header to instantly jump, focus, and scroll the editor to that section."},references:{title:"References",subtitle:"Manage sources and insert citations.",close:"Close references",citationStyle:"Citation style",searchSources:"Search sources…",addSource:"Add source",editSource:"Edit source",noSources:"No sources yet",noSourcesDescription:"Add your first reference to start citing. Citations and the bibliography follow the active style automatically.",noMatchingSources:"No matching sources found",cite:"Cite",edit:"Edit",delete:"Delete",back:"Back to list",anonymous:"Anonymous",etAl:"et al.",confirmDelete:'Delete source "{title}"? Citations referencing it will stop rendering.',import:{title:"Import",fromDoi:"From DOI (CrossRef)",doiPlaceholder:"Paste a DOI or DOI link…",importDoi:"Import DOI",doiSuccess:"Source imported from CrossRef.",doiFailed:"DOI could not be resolved.",fromFile:"From BibTeX / RIS file",pickFile:"Choose .bib or .ris file",importing:"Importing…",batchSuccess:"{count} source(s) imported.",partial:"{ok} imported, {failed} failed.",failed:"Import failed."},types:{book:"Book","article-journal":"Journal article",chapter:"Book chapter",webpage:"Web page",report:"Report",thesis:"Thesis",document:"Document"},form:{type:"Source type",title:"Title",authors:"Authors",familyName:"Family name",givenName:"Given name",addAuthor:"Add author",year:"Year",journal:"Journal",bookTitle:"Book title",publisher:"Publisher",publisherPlace:"Place",volume:"Volume",issue:"Issue",pages:"Pages",save:"Save changes",create:"Add source",cancel:"Cancel"}}},dashboard:{allDocuments:"All Documents",starred:"Starred",folders:"Folders",createFolder:"Create New Folder",folderNamePlaceholder:"Folder name…",noFolders:"No folders created yet.",startNewDocument:"Start a New Document",blankDocument:"Blank Document",blankDescription:"Fresh slate",meetingNotes:"Meeting Notes",meetingNotesDescription:"Attendees & Action Items",projectProposal:"Project Proposal",projectProposalDescription:"Objectives & Deliverables",officialLetter:"Official Letter",officialLetterDescription:"Pre-formatted header",searchPlaceholder:"Search titles or full-text contents…",modified:"Modified",alphabetical:"Alphabetical",created:"Created",gridView:"Grid View",listView:"List View",activeFilters:"Active Filters:",folder:"Folder",starredOnly:"Starred Only",search:"Search",noDocuments:"No documents found",noDocumentsDescription:"No files match your current filters. Select a template or create a blank file to start drafting!",createBlankDocument:"Create Blank Document",loadingDocuments:"Loading documents...",folderCreated:"Folder created.",folderAlreadyExists:"A folder with that name already exists.",folderLoadError:"Could not load folders. Please try again.",folderCreateError:"Could not create the folder. Please try again.",documentTitle:"Document Title",lastModified:"Last Modified",actions:"Actions",trash:"Trash",trashEmpty:"Trash is empty",trashEmptyDescription:"Deleted documents will appear here.",trashedAt:"Trashed",movedToTrash:"Moved to trash:",selectedCount:"{count} selected",documentDeleteError:"Could not delete one or more documents. Please try again."},auth:{signInTitle:"Sign in to create and edit documents",signInWithGoogle:"Sign in with Google",signInWithEmail:"Sign in with Email",signInWithGitHub:"Sign in with GitHub",signInWith:"Sign in with {provider}",or:"or",email:"Email",password:"Password",name:"Name",signIn:"Sign In",signUp:"Sign Up",signOut:"Sign out",noAccount:"Don't have an account? Sign up",hasAccount:"Already have an account? Sign in",invalidCredentials:"Invalid email or password",accountCreated:"Account created! You are now signed in.",loadDocumentsError:"Failed to load documents. Is the server running?",retry:"Try again",rateLimited:"Server is rate limiting requests.",retryIn:"Retrying in {seconds}s…",networkError:"Could not reach the server. Check your connection.",noProviders:"No authentication providers configured. Check your server environment variables."},language:{label:"Language",en:"English",id:"Indonesian"}},lf={common:{save:"Simpan",cancel:"Batal",create:"Buat",delete:"Hapus",rename:"Ubah nama",duplicate:"Duplikat",move:"Pindah",moveToFolder:"Pindah ke folder",moveDocument:"Pindahkan Dokumen",noFolder:"(Tanpa Folder)",search:"Cari",loading:"Memuat…",error:"Kesalahan",dismiss:"Tutup",emptyDocument:"(Dokumen Kosong)",confirmDelete:"Apakah Anda yakin ingin menghapus dokumen ini?",undo:"Batalkan",restore:"Pulihkan",deleteForever:"Hapus permanen",back:"Kembali",confirmPermanentDelete:"Hapus dokumen ini secara permanen? Tindakan ini tidak dapat dibatalkan.",confirmPermanentDeleteBulk:"Hapus {count} dokumen secara permanen? Tindakan ini tidak dapat dibatalkan.",selectAll:"Pilih semua",clearSelection:"Hapus pilihan"},header:{file:"Berkas",new:"Baru",newDocument:"Dokumen baru",helpMeCreate:"Bantu saya membuat",fromTemplate:"Dari templat",open:"Buka",makeACopy:"Buat salinan",share:"Bagikan",email:"Email",emailDraft:"Draf Email",download:"Unduh",rename:"Ubah nama",move:"Pindah",moveToFolder:"Pindah ke folder",moveToTrash:"Pindah ke sampah",addToStarred:"Tambahkan ke Bintang",versionHistory:"Riwayat versi",language:"Bahasa",pageSetup:"Penataan halaman",print:"Cetak",details:"Detail",security:"Batasan keamanan",edit:"Sunting",view:"Tampilan",insert:"Sisipkan",format:"Format",tools:"Alat",extensions:"Ekstensi",help:"Bantuan",backToDocuments:"Kembali ke Dokumen",clickToRename:"Klik untuk mengganti nama",starDocument:"Bintangi dokumen",unstarDocument:"Hapus bintang",sandbox:"Sandbox (alihkan kolaborator simulasi)",theme:"Tema",account:"Akun",markdown:"Markdown (.md)",html:"Halaman web (.html)",htmlZip:"Halaman web (.html, ter-zip)",text:"Teks biasa (.txt)",docx:"Microsoft Word (.docx)",pdf:"Dokumen PDF (.pdf)",odt:"OpenDocument Format (.odt)",rtf:"Rich Text Format (.rtf)",undo:"Urungkan",redo:"Ulangi",selectAll:"Pilih semua",cut:"Potong",copy:"Salin",paste:"Tempel",pasteWithoutFormatting:"Tempel tanpa pemformatan",delete:"Hapus",findAndReplace:"Temukan dan ganti",showSidebar:"Tampilkan kerangka",focusMode:"Mode Fokus Penuh",showRuler:"Tampilkan penggaris",meetingNotes:"Catatan Rapat",image:"Gambar",table:"Tabel",codeBlock:"Kode Blok",link:"Tautan",header:"Header",footer:"Footer",footnote:"Catatan Kaki",tableOfContents:"Daftar isi",bold:"Teks Tebal",italic:"Teks Miring",underline:"Garis Bawah",heading1:"Judul 1",heading2:"Judul 2",heading3:"Judul 3",heading4:"Judul 4",heading5:"Judul 5",heading6:"Judul 6",alignIndent:"Perataan & indentasi",alignLeft:"Rata kiri",alignCenter:"Rata tengah",alignRight:"Rata kanan",alignJustify:"Rata kiri-kanan",bulletsNumbering:"Bullet & penomoran",bulletList:"Daftar ber-bullet",numberedList:"Daftar bernomor",taskList:"Daftar tugas",horizontalLine:"Garis horizontal",pageNumbers:"Nomor halaman",pageNumberInHeader:"Sisipkan di header",pageNumberInFooter:"Sisipkan di footer",break:"Pemisah",pageBreak:"Pemisah halaman",pageBreakShortcut:"Ctrl+Enter",smartElements:"Elemen pintar",dateChip:"Tanggal",peopleChip:"Orang",fileChip:"Berkas",dropdownChip:"Dropdown",locationChip:"Lokasi",pagelessFormat:"Format tanpa halaman",clearFormatting:"Hapus pemformatan",spellCheck:"Periksa ejaan",wordCount:"Hitungan kata",preferences:"Preferensi",manageExtensions:"Kelola ekstensi…",keyboardShortcuts:"Pintasan keyboard",reportIssue:"Laporkan masalah",about:"Tentang DocsEditor"},toolbar:{undo:"Urungkan",redo:"Ulangi",print:"Cetak",spelling:"Ejaan",zoom:"100%",paragraphStyle:"Gaya paragraf",normalText:"Teks normal",fontFamily:"Keluarga font",decreaseFontSize:"Kecilkan font",increaseFontSize:"Perbesar font",fontSize:"Ukuran font",lists:"Daftar",alignment:"Perataan",insert:"Sisipkan",comments:"Komentar",history:"Riwayat",ai:"AI",tableOfContents:"Daftar isi",references:"Referensi"},statusBar:{liveSyncActive:"Sinkron Langsung Aktif",connecting:"Menghubungkan…",saving:"Menyimpan perubahan…",offline:"Luring",lastSavedAt:"Terakhir disimpan",never:"Tidak pernah",pageSize:"Ukuran halaman",page:"Halaman",of:"dari",pageless:"Tanpa halaman",words:"kata",characters:"karakter"},editor:{share:{title:"Bagikan dokumen",close:"Tutup",shareableLink:"Tautan dapat dibagikan",copy:"Salin",copied:"Tautan disalin ke papan klip",couldNotCopy:"Tidak dapat menyalin tautan",collaborators:"Kolaborator",addCollaborator:"Tambahkan kolaborator lewat email",placeholder:"rekan@contoh.com",add:"Tambah",userNotFound:"Pengguna tidak ditemukan",failedToAdd:"Gagal menambahkan kolaborator",visibility:"Visibilitas",private:"Pribadi",privateDescription:"Hanya Anda dan orang yang Anda undang yang dapat mengakses dokumen ini.",restricted:"Terbatas",restrictedDescription:"Siapa pun dengan tautan dapat melihat dokumen ini."},print:"Cetak",logOut:"Keluar",rename:{title:"Ubah nama dokumen",label:"Judul dokumen",save:"Simpan",cancel:"Batal"},pageSetup:{title:"Penataan halaman",paperSize:"Ukuran kertas",orientation:"Orientasi",portrait:"Potret",landscape:"Lanskap",margins:"Margin",top:"Atas",bottom:"Bawah",left:"Kiri",right:"Kanan",apply:"Terapkan",cancel:"Batal"},details:{title:"Detail dokumen",titleLabel:"Judul",owner:"Pemilik",location:"Lokasi",noFolder:"(Tanpa folder)",created:"Dibuat",modified:"Terakhir diubah",statistics:"Statistik",words:"Kata",characters:"Karakter",pages:"Halaman",loading:"Memuat detail dokumen…"},email:{title:"Email file ini",to:"Kepada",toPlaceholder:"penerima@contoh.com",subject:"Subjek",body:"Isi",send:"Kirim",copyLink:"Salin tautan",shareableLink:"Tautan dapat dibagikan",defaultSubject:"Dokumen: {title}",defaultBody:"Anda dapat melihat dokumen ini di: {url}"},linkDialog:{insertTitle:"Sisipkan tautan",editTitle:"Edit tautan",text:"Teks yang ditampilkan",textPlaceholder:"Teks tautan",url:"URL",urlPlaceholder:"https://contoh.com",insert:"Sisipkan",update:"Perbarui",remove:"Hapus tautan",cancel:"Batal",urlRequired:"URL wajib diisi",urlInvalid:"Masukkan URL yang valid"},findReplace:{title:"Temukan dan ganti",findPlaceholder:"Temukan di dokumen",replacePlaceholder:"Ganti dengan",next:"Berikutnya",previous:"Sebelumnya",replace:"Ganti",replaceAll:"Ganti semua",noMatches:"Tidak ada hasil",matchCount:"{current} dari {total}",close:"Tutup"},headerFooter:{header:"Header",footer:"Footer",headerPlaceholder:"mis. Judul Dokumen",footerPlaceholder:"mis. Halaman {page} dari {total}",headerLeftPlaceholder:"mis. Judul Dokumen",headerRightPlaceholder:"mis. Halaman {page}",differentFirstPage:"Halaman pertama berbeda",differentOddEven:"Halaman ganjil & genap berbeda",options:"Opsi",formatHeader:"Format header",pageNumber:"Nomor halaman",removeHeader:"Hapus header",removeFooter:"Hapus footer",alignPlacement:"Peletakkan konten",alignLeft:"Rata kiri",alignCenter:"Rata tengah",alignRight:"Rata kanan",placementSection:"Peletakkan",placementHint:"Konten header/footer disejajarkan di dalam area teks (kiri/tengah/kanan).",headerFooterFormatTitle:"Header & footer",marginSection:"Margin",headerTopMargin:"Header (sentimeter dari atas)",footerBottomMargin:"Footer (sentimeter dari bawah)",layoutSection:"Tata letak",pageNumberTitle:"Nomor halaman",positionSection:"Posisi",positionHeader:"Header",positionFooter:"Footer",showOnFirstPage:"Tampilkan di halaman pertama",numberingSection:"Penomoran",startAt:"Dimulai dari",continueFromPrevious:"Lanjutkan dari bagian sebelumnya",hideOnPages:"Sembunyikan nomor di halaman",hideOnPagesPlaceholder:"mis. 1, 3-5",hideOnPagesHint:"Pisahkan dengan koma; gunakan tanda hubung untuk rentang (mis. 1, 3-5). Halaman tetap dihitung, hanya nomornya yang disembunyikan.",apply:"Terapkan",cancel:"Batal",save:"Simpan"},showOutline:"Tampilkan kerangka dokumen",loadingDocument:"Memuat dokumen"},slashMenu:{title:"Saran",basicBlocks:"Blok Dasar",noMatch:"Tidak ada perintah yang cocok"},documentTabs:{documentTabs:"Tab Dokumen",addTab:"Tambah tab",rename:"Ubah nama",delete:"Hapus",outline:"Kerangka",untitledHeading:"Judul Tanpa Nama {level}",placeholder:"Tajuk yang Anda tambahkan ke dokumen akan muncul di sini."},theme:{lightMode:"Beralih ke mode terang",darkMode:"Beralih ke mode gelap"},sidebars:{ai:{title:"AI Writing Helper",description:"Penulis AI sisi-server untuk menyusun, merangkum, atau menyunting tulisan Anda.",quickMacros:"Makro AI Cepat",summarize:"Rangkum",fixGrammar:"Perbaiki Tata Bahasa",continue:"Lanjutkan",toSpanish:"Ke Spanyol",generations:"Hasil AI",aiDrafting:"AI menyusun…",copy:"Salin",copied:"Tersalin",insert:"Sisipkan",inserted:"Tersisip",noDraft:"Tanya apa saja tentang dokumen Anda, atau jalankan makro cepat di atas.",promptPlaceholder:"Minta AI membuat kerangka, menulis konten, menulis ulang nada…",promptAI:"Perintah AI",close:"Tutup",you:"Anda",assistant:"Asisten",notConfigured:"AI belum dikonfigurasi pada deployment ini.",selectTextFirst:"Pilih teks di dokumen terlebih dahulu",improveSelection:"Perbaiki pilihan",draft:"Draf dengan sitasi",draftPlaceholder:"Minta AI menyusun teks berbasis pustaka referensi Anda…",promptDraft:"Susun",citations:"Sitasi",emptyResponse:"AI mengembalikan respons kosong.",aiError:"Permintaan AI gagal",contextLabel:"Konteks yang dilampirkan",pageShort:"Hal.",paragraphShort:"Alinea",lineShort:"Baris",selectionContext:"Teks terpilih"},comments:{title:"Panel Diskusi",placeholder:"Pilih teks untuk menambahkan komentar…",addComment:"Tambah komentar",resolve:"Selesai",reply:"Balas…",replyInThread:"Balas di thread",active:"Aktif",resolved:"Selesai",creatingAnchored:"Membuat komentar terpaut:",quote:"Kutipan:",resolvedBy:"Diselesaikan oleh {user}",noComments:"Belum ada komentar {mode}.",commentOnSelection:"Komentari pilihan…",generalComment:"Tambahkan komentar umum ke dokumen…",anchoredComment:"Komentar terpaut",general:"Komentar umum",post:"Kirim",orphaned:"Teks dihapus",delete:"Hapus",confirmDelete:"Hapus thread komentar ini? Tindakan ini tidak dapat dibatalkan."},history:{title:"Riwayat",empty:"Belum ada riwayat.",version:"Versi",restore:"Pulihkan",closePreview:"Tutup Pratinjau",restoreThis:"Pulihkan Ini",viewingPreview:"Melihat Pratinjau Revisi",readOnlyPreview:"Anda sedang melihat pratinjau versi #{index}. Editor Anda untuk sementara hanya-baca.",modifiedBy:"Diubah oleh:",saveNamedSnapshot:"Simpan Snapshot Bernama",snapshotPlaceholder:"mis. Final Draft Disetujui…",noSnapshots:"Belum ada snapshot yang disimpan.",save:"Simpan",cancel:"Batal",preview:"Pratinjau"},toc:{title:"Daftar Isi",empty:"Belum ada judul.",untitledHeading:"Judul Tanpa Nama {level}",newSection:"Bagian {tag} Baru",startWriting:"Mulai menulis di sini…",closeOutline:"Tutup kerangka",searchHeadings:"Cari judul…",noHeadings:"Belum Ada Judul",noHeadingsDescription:"Gunakan header (H1, H2, atau H3) untuk menyusun dokumen. Kerangka interaktif akan dibuat otomatis di sini.",quickInsert:"Sisipkan Cepat",headingLevel:"Judul {level}",noMatchingHeaders:"Tidak ada header yang cocok",tryDifferentTerm:"Coba cari dengan istilah lain.",outlineLayout:"Tata Letak Kerangka",outlineSync:"Kerangka tersinkronisasi otomatis. Klik header apa pun untuk langsung melompat, fokus, dan menggulir editor ke bagian tersebut."},references:{title:"Referensi",subtitle:"Kelola sumber dan sisipkan sitasi.",close:"Tutup referensi",citationStyle:"Gaya sitasi",searchSources:"Cari sumber…",addSource:"Tambah sumber",editSource:"Ubah sumber",noSources:"Belum ada sumber",noSourcesDescription:"Tambahkan referensi pertama Anda untuk mulai menyitasi. Sitasi dan daftar pustaka mengikuti gaya aktif secara otomatis.",noMatchingSources:"Tidak ada sumber yang cocok",cite:"Sitasi",edit:"Ubah",delete:"Hapus",back:"Kembali ke daftar",anonymous:"Anonim",etAl:"dkk.",confirmDelete:'Hapus sumber "{title}"? Sitasi yang merujuknya akan berhenti ditampilkan.',import:{title:"Impor",fromDoi:"Dari DOI (CrossRef)",doiPlaceholder:"Tempel DOI atau tautan DOI…",importDoi:"Impor DOI",doiSuccess:"Sumber berhasil diimpor dari CrossRef.",doiFailed:"DOI tidak dapat ditemukan.",fromFile:"Dari berkas BibTeX / RIS",pickFile:"Pilih berkas .bib atau .ris",importing:"Mengimpor…",batchSuccess:"{count} sumber berhasil diimpor.",partial:"{ok} berhasil, {failed} gagal.",failed:"Impor gagal."},types:{book:"Buku","article-journal":"Artikel jurnal",chapter:"Bab buku",webpage:"Halaman web",report:"Laporan",thesis:"Tesis",document:"Dokumen"},form:{type:"Jenis sumber",title:"Judul",authors:"Penulis",familyName:"Nama keluarga",givenName:"Nama depan",addAuthor:"Tambah penulis",year:"Tahun",journal:"Jurnal",bookTitle:"Judul buku",publisher:"Penerbit",publisherPlace:"Kota terbit",volume:"Volume",issue:"Edisi",pages:"Halaman",save:"Simpan perubahan",create:"Tambah sumber",cancel:"Batal"}}},dashboard:{allDocuments:"Semua Dokumen",starred:"Berbintang",folders:"Folder",createFolder:"Buat Folder Baru",folderNamePlaceholder:"Nama folder…",noFolders:"Belum ada folder.",startNewDocument:"Mulai Dokumen Baru",blankDocument:"Dokumen Kosong",blankDescription:"Kertas kosong",meetingNotes:"Catatan Rapat",meetingNotesDescription:"Peserta & Tindak Lanjut",projectProposal:"Proposal Proyek",projectProposalDescription:"Tujuan & Hasil",officialLetter:"Surat Resmi",officialLetterDescription:"Header yang sudah diformat",searchPlaceholder:"Cari judul atau isi dokumen…",modified:"Diubah",alphabetical:"Abjad",created:"Dibuat",gridView:"Tampilan Grid",listView:"Tampilan Daftar",activeFilters:"Filter Aktif:",folder:"Folder",starredOnly:"Hanya Berbintang",search:"Cari",noDocuments:"Tidak ada dokumen",noDocumentsDescription:"Tidak ada file yang cocok dengan filter. Pilih template atau buat dokumen kosong untuk mulai menulis!",createBlankDocument:"Buat Dokumen Kosong",loadingDocuments:"Memuat dokumen...",folderCreated:"Folder berhasil dibuat.",folderAlreadyExists:"Folder dengan nama tersebut sudah ada.",folderLoadError:"Folder tidak dapat dimuat. Silakan coba lagi.",folderCreateError:"Folder tidak dapat dibuat. Silakan coba lagi.",documentTitle:"Judul Dokumen",lastModified:"Terakhir Diubah",actions:"Aksi",trash:"Sampah",trashEmpty:"Sampah kosong",trashEmptyDescription:"Dokumen yang dihapus akan muncul di sini.",trashedAt:"Dihapus",movedToTrash:"Dipindahkan ke sampah:",selectedCount:"{count} dipilih",documentDeleteError:"Tidak dapat menghapus satu atau lebih dokumen. Silakan coba lagi."},auth:{signInTitle:"Masuk untuk membuat dan menyunting dokumen",signInWithGoogle:"Masuk dengan Google",signInWithEmail:"Masuk dengan Email",signInWithGitHub:"Masuk dengan GitHub",signInWith:"Masuk dengan {provider}",or:"atau",email:"Email",password:"Kata sandi",name:"Nama",signIn:"Masuk",signUp:"Daftar",signOut:"Keluar",noAccount:"Belum punya akun? Daftar",hasAccount:"Sudah punya akun? Masuk",invalidCredentials:"Email atau kata sandi salah",accountCreated:"Akun dibuat! Anda sekarang masuk.",loadDocumentsError:"Gagal memuat dokumen. Apakah server berjalan?",retry:"Coba lagi",rateLimited:"Server sedang membatasi permintaan.",retryIn:"Mencoba ulang dalam {seconds} detik…",networkError:"Tidak bisa menghubungi server. Periksa koneksi Anda.",noProviders:"Tidak ada penyedia autentikasi yang dikonfigurasi. Periksa variabel lingkungan server."},language:{label:"Bahasa",en:"English",id:"Indonesia"}},Pa={en:sf,id:lf},Bl="en",ob={en:sf.language.en,id:lf.language.id};function cf(e){return Pa[e]??Pa[Bl]}function Fa(e){return typeof e=="string"&&e in Pa}const uf=Symbol("docflow-locale"),df="docflow-locale";function sb(e){if(e&&Fa(e))return e;try{const t=localStorage.getItem(df);if(t&&Fa(t))return t}catch{}return Bl}function lb(e,t){const n=t.split(".");let i=e;for(const r of n){if(i===null||typeof i!="object")return;i=i[r]}return i}function ff(e){const t=s.ref(sb(e));return{locale:t,setLocale:r=>{if(Fa(r)){t.value=r;try{localStorage.setItem(df,r)}catch{}}},t:(r,a)=>{const o=cf(t.value),l=lb(o,r);if(typeof l!="string")return r;let c=l;if(a)for(const[u,f]of Object.entries(a))c=c.replace(new RegExp(`\\{${u}\\}`,"g"),String(f));return c}}}function ht(){const e=s.inject(uf,null);return e||ff()}function pf(e){const t=ff(e);return s.provide(uf,t),t}function mf(e){return ob[e]??e}function hf(){return["en","id"]}function cb(e){const t=s.ref({totalPages:1,visiblePages:[],config:{pageSize:{id:"a4",name:"A4",pageWidth:794,pageHeight:1123},margins:{top:20,bottom:20,left:50,right:50},pageGap:50,headerLeft:"",headerRight:"",footerLeft:"",footerRight:""}}),n=s.computed(()=>t.value.totalPages),i=s.computed(()=>t.value.visiblePages),r=s.ref(!1);let a=null,o=null;const l=()=>{var p;return((p=e.enabled)==null?void 0:p.value)??!0},c=async()=>{var g;if(!l())return;const p=e.editorRef.value,h=e.scrollRef.value;!((g=p==null?void 0:p.view)!=null&&g.dom)||!h||(a=new ar.VirtualPageOverlay(p.view.dom,e.config,h,e.bufferPages??2),a.observe(),t.value=await a.layout(),r.value=!0,o=new ResizeObserver(async()=>{a&&(t.value=await a.layout())}),o.observe(p.view.dom))},u=async p=>{a&&l()&&(t.value=await a.updateConfig(p))},f=()=>{a&&l()&&(t.value=a.getData())};let m=null;return s.onMounted(()=>{l()&&(m=setInterval(f,250))}),s.onUnmounted(()=>{m&&clearInterval(m),a==null||a.disconnect(),o==null||o.disconnect()}),s.watch([()=>{var p,h;return(h=(p=e.editorRef.value)==null?void 0:p.view)==null?void 0:h.dom},e.scrollRef,()=>{var p;return(p=e.enabled)==null?void 0:p.value}],()=>{l()&&!r.value?c():!l()&&r.value&&(m&&(clearInterval(m),m=null),a==null||a.disconnect(),o==null||o.disconnect(),a=null,o=null,r.value=!1)},{immediate:!0}),s.watch(()=>e.config,p=>{r.value&&l()&&u(p)},{deep:!0}),{data:t,totalPages:n,visiblePages:i,isReady:r,refreshData:f,updateConfig:u}}const ub={key:0,class:"virtual-page-overlay","aria-hidden":"true"},db=["innerHTML"],fb=["innerHTML"],pb=["innerHTML"],mb=["innerHTML"],hb=s.defineComponent({__name:"VirtualPageOverlay",props:{data:{},isReady:{type:Boolean}},setup(e){const t=e,n=s.computed(()=>t.data.visiblePages),i=s.computed(()=>t.data.config),r=s.computed(()=>i.value.pageSize),a=s.computed(()=>({height:`${i.value.pageGap}px`})),o=s.computed(()=>({paddingTop:`${i.value.margins.top}px`,paddingLeft:`${i.value.margins.left}px`,paddingRight:`${i.value.margins.right}px`,height:`${i.value.margins.top}px`})),l=s.computed(()=>({paddingBottom:`${i.value.margins.bottom}px`,paddingLeft:`${i.value.margins.left}px`,paddingRight:`${i.value.margins.right}px`}));function c(f){return{top:`${f.top}px`,height:`${r.value.pageHeight+i.value.pageGap}px`,width:`${r.value.pageWidth}px`}}function u(f,m){return f.replace(/\{page\}/g,String(m+1)).replace(/\{total\}/g,String(t.data.totalPages))}return(f,m)=>e.isReady?(s.openBlock(),s.createElementBlock("div",ub,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value,p=>(s.openBlock(),s.createElementBlock("div",{key:p.index,class:"vp-page",style:s.normalizeStyle(c(p))},[s.createElementVNode("div",{class:"vp-gap",style:s.normalizeStyle(a.value)},null,4),s.createElementVNode("div",{class:"vp-header",style:s.normalizeStyle(o.value)},[s.createElementVNode("span",{class:"vp-header-left",innerHTML:i.value.headerLeft},null,8,db),s.createElementVNode("span",{class:"vp-header-right",innerHTML:i.value.headerRight},null,8,fb)],4),s.createElementVNode("div",{class:"vp-footer",style:s.normalizeStyle(l.value)},[s.createElementVNode("span",{class:"vp-footer-left",innerHTML:u(i.value.footerLeft,p.index)},null,8,pb),s.createElementVNode("span",{class:"vp-footer-right",innerHTML:u(i.value.footerRight,p.index)},null,8,mb)],4)],4))),128))])):s.createCommentVNode("",!0)}}),Pl=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},bb=Pl(hb,[["__scopeId","data-v-a48fe1b6"]]),gb={class:"px-2 py-1.5 text-[10px] font-semibold uppercase text-slate-400"},vb=["onClick","onMouseenter"],xb={class:"text-slate-500 dark:text-slate-400"},bf=s.defineComponent({__name:"SlashMenu",props:{editor:{},commands:{}},setup(e){const{t}=ht(),n=e,i=s.ref(!1),r=s.ref(""),a=s.ref(0),o=s.ref({top:0,left:0}),l=s.ref([]);function c(){if(!n.editor)return;const{view:h}=n.editor,{selection:g}=h.state,b=h.coordsAtPos(g.head);o.value={top:b.bottom+4,left:b.left}}function u(h){var A,I,_,E;if(!n.editor)return;const{view:g}=n.editor,{selection:b}=g.state,y=b.head,v=g.state.doc.resolve(y),x=v.start(),w=v.parent.textContent.slice(0,v.parentOffset).lastIndexOf("/");if(w>=0){const z=x+w,P=g.state.tr.delete(z,y);g.dispatch(P)}const S=n.editor;if(typeof((A=S.commands)==null?void 0:A[h.command])=="function")S.commands[h.command]();else if(S.chain)try{(E=(_=(I=S.chain().focus())[h.command])==null?void 0:_.call(I))==null||E.run()}catch{}i.value=!1,r.value=""}function f(){i.value=!1,r.value=""}function m(){if(!n.editor)return;const{view:h}=n.editor,{selection:g}=h.state,b=g.head,y=h.state.doc.resolve(b),v=y.parent.textContent.slice(0,y.parentOffset),x=v.lastIndexOf("/");if(x>=0){const k=v.slice(0,x),w=v.slice(x+1);if((k===""||k.endsWith(" ")||k===`
2
- `)&&!w.includes(" ")){r.value=w,i.value=!0,a.value=0,c();return}}i.value=!1}s.watch(()=>n.editor,h=>{h&&(h.on("update",m),h.on("selectionUpdate",()=>{i.value&&c()}))}),s.watch([r,()=>n.commands],()=>{const h=r.value.toLowerCase();l.value=h?n.commands.filter(g=>g.name.toLowerCase().includes(h)):n.commands});function p(h){if(i.value){if(h.key==="ArrowDown"&&(h.preventDefault(),a.value=Math.min(a.value+1,l.value.length-1)),h.key==="ArrowUp"&&(h.preventDefault(),a.value=Math.max(a.value-1,0)),h.key==="Enter"){h.preventDefault();const g=l.value[a.value];g&&u(g)}h.key==="Escape"&&(h.preventDefault(),f())}}return s.onMounted(()=>{document.addEventListener("keydown",p)}),s.onUnmounted(()=>{document.removeEventListener("keydown",p)}),(h,g)=>(s.openBlock(),s.createBlock(s.Teleport,{to:"body"},[i.value&&l.value.length>0?(s.openBlock(),s.createElementBlock("div",{key:0,class:"docs-slash-menu fixed z-[999] w-56 max-h-64 overflow-y-auto rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-slate-700 dark:bg-slate-800",style:s.normalizeStyle({top:o.value.top+"px",left:o.value.left+"px"})},[s.createElementVNode("div",gb,s.toDisplayString(s.unref(t)("slashMenu.basicBlocks")),1),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(b,y)=>(s.openBlock(),s.createElementBlock("button",{key:b.command,class:s.normalizeClass(["flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",y===a.value?"bg-slate-100 dark:bg-slate-700":"hover:bg-slate-50 dark:hover:bg-slate-700/50"]),onClick:v=>u(b),onMouseenter:v=>a.value=y},[s.createElementVNode("span",xb,s.toDisplayString(b.name),1)],42,vb))),128))],4)):s.createCommentVNode("",!0)]))}});/**
1
+ "use strict";var eb=Object.defineProperty;var tb=(e,t,n)=>t in e?eb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kn=(e,t,n)=>tb(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ee=require("@kedataindo/docflow-core"),s=require("vue"),ar=require("@kedataindo/docflow-layout-engine");function of(e){const t=s.ref(null),n=s.shallowRef(null),i=s.ref(!1),r=s.computed(()=>{var c;return((c=n.value)==null?void 0:c.editor)??null}),a=s.computed(()=>{var c;return((c=n.value)==null?void 0:c.pluginActions)??{}}),o=()=>{if(!t.value||n.value)return;const c=s.unref(e.collaboration),u=s.unref(e.content),f=Ee.createEditor({target:t.value,content:u,plugins:e.plugins,editable:e.editable??!0,collaboration:c,onUpdate:e.onUpdate,getPageMap:e.getPageMap,paginationOptions:e.paginationOptions,onImageUpload:e.onImageUpload,citation:e.citation,aiStream:e.aiStream,aiDraft:e.aiDraft,debug:e.debug});n.value=f,s.nextTick(()=>{i.value=!0})},l=()=>{var c;(c=n.value)==null||c.destroy(),n.value=null,i.value=!1};return s.onMounted(()=>{o()}),s.onUnmounted(()=>{l()}),s.watch(()=>e.editable,c=>{r.value&&r.value.setEditable(c??!0)}),s.watch(()=>s.unref(e.collaboration),async(c,u)=>{c!==u&&(l(),await s.nextTick(),o())}),{editorRef:t,docsEditor:n,editor:r,pluginActions:a,isReady:i}}function nb(e){const t=s.computed(()=>{var r,a,o;return(o=(a=(r=e.value)==null?void 0:r.storage)==null?void 0:a.editorContext)==null?void 0:o.aiStream}),n=s.computed(()=>{var r,a,o;return(o=(a=(r=e.value)==null?void 0:r.storage)==null?void 0:a.editorContext)==null?void 0:o.aiDraft}),i=s.computed(()=>!!t.value);return{aiStream:t,aiDraft:n,isAIAvailable:i}}const iu="docs-editor-theme",cs=s.ref(!1);function Ro(){const e=n=>{if(cs.value=n,typeof document<"u"){const i=document.documentElement;n?i.classList.add("dark"):i.classList.remove("dark")}typeof localStorage<"u"&&localStorage.setItem(iu,n?"dark":"light")},t=()=>e(!cs.value);return s.onMounted(()=>{let n=!1;if(typeof localStorage<"u"){const i=localStorage.getItem(iu);i?n=i==="dark":typeof window<"u"&&(n=window.matchMedia("(prefers-color-scheme: dark)").matches)}e(n)}),{isDark:cs,toggle:t}}function ib(e,t){let n=1;return e.state.doc.nodesBetween(0,t-1,(i,r)=>{i.isBlock&&r>0&&n++},1),n}function rb(e,t){let n;return e.state.doc.nodesBetween(0,t,i=>{i.type.name==="heading"&&i.textContent.trim()&&(n=i.textContent.trim())}),n}function ab(e,t,n){try{const{view:i}=e,r=i.coordsAtPos(n),a=i.coordsAtPos(t);if(!r||!a)return 1;const o=parseFloat(getComputedStyle(i.dom).lineHeight)||parseFloat(getComputedStyle(i.dom).fontSize)*1.6||24;return o<=0?1:Math.max(1,Math.round((r.top-a.top)/o)+1)}catch{return 1}}function ob(e){const t=e.view.dom,n=t.querySelector("[data-rm-pagination]");if(!n)return{page:1,pageCount:1};const i=t.getBoundingClientRect();if(i.height===0||i.width===0)return{page:1,pageCount:1};const r=n.children.length||1;let a=1;try{const o=e.view.coordsAtPos(e.state.selection.head);if(!o)return{page:a,pageCount:r};const l=Array.from(n.querySelectorAll(".rm-page-break")),c=t.getBoundingClientRect(),u=o.top-c.top+t.scrollTop;let f=1,m=!1;for(const p of l){const h=p.querySelector(".breaker");if(h instanceof HTMLElement&&u<h.offsetTop){a=f,m=!0;break}f++}m||(a=f)}catch{a=1}return{page:a,pageCount:r}}function Ll(e){const t=e.state,{$from:n,head:i}=t.selection;let r=n.depth;for(;r>0&&!n.node(r).isBlock;)r--;const a=n.before(r),o=n.node(r),l=o.isBlock?o.type.name:void 0,{page:c,pageCount:u}=ob(e);return{page:c,pageCount:u,paragraphIndex:a>0?ib(e,a):1,line:ab(e,a,i),...l?{blockType:l}:{},section:rb(e,i)}}const sf={common:{save:"Save",cancel:"Cancel",create:"Create",delete:"Delete",rename:"Rename",duplicate:"Duplicate",move:"Move",moveToFolder:"Move to folder",moveDocument:"Move Document",noFolder:"(No Folder)",search:"Search",loading:"Loading...",error:"Error",dismiss:"Dismiss",emptyDocument:"(Empty Document)",confirmDelete:"Are you sure you want to delete this document?",undo:"Undo",restore:"Restore",deleteForever:"Delete forever",back:"Back",confirmPermanentDelete:"Permanently delete this document? This cannot be undone.",confirmPermanentDeleteBulk:"Permanently delete {count} documents? This cannot be undone.",selectAll:"Select all",clearSelection:"Clear selection"},header:{file:"File",new:"New",newDocument:"New document",helpMeCreate:"Help me create",fromTemplate:"From a template",open:"Open",makeACopy:"Make a copy",share:"Share",email:"Email",emailDraft:"Email draft",download:"Download",rename:"Rename",move:"Move",moveToFolder:"Move to folder",moveToTrash:"Move to trash",addToStarred:"Add to Starred",versionHistory:"Version history",language:"Language",pageSetup:"Page setup",print:"Print",details:"Details",security:"Security limitations",edit:"Edit",view:"View",insert:"Insert",format:"Format",tools:"Tools",extensions:"Extensions",help:"Help",backToDocuments:"Back to Documents",clickToRename:"Click to rename",starDocument:"Star document",unstarDocument:"Unstar document",sandbox:"Sandbox (toggle simulated collaborators)",theme:"Theme",account:"Account",markdown:"Markdown (.md)",html:"Web page (.html)",htmlZip:"Web page (.html, zipped)",text:"Plain text (.txt)",docx:"Microsoft Word (.docx)",pdf:"PDF Document (.pdf)",odt:"OpenDocument Format (.odt)",rtf:"Rich Text Format (.rtf)",undo:"Undo",redo:"Redo",selectAll:"Select all",cut:"Cut",copy:"Copy",paste:"Paste",pasteWithoutFormatting:"Paste without formatting",delete:"Delete",findAndReplace:"Find and replace",showSidebar:"Show outline",focusMode:"Full focus mode",showRuler:"Show ruler",meetingNotes:"Meeting notes",image:"Image",table:"Table",codeBlock:"Code block",link:"Link",header:"Header",footer:"Footer",footnote:"Footnote",tableOfContents:"Table of contents",bold:"Bold text",italic:"Italic text",underline:"Underline",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",alignIndent:"Align & indent",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignJustify:"Justify",bulletsNumbering:"Bullets & numbering",bulletList:"Bulleted list",numberedList:"Numbered list",taskList:"Task list",horizontalLine:"Horizontal line",pageNumbers:"Page numbers",pageNumberInHeader:"Insert in header",pageNumberInFooter:"Insert in footer",break:"Break",pageBreak:"Page break",pageBreakShortcut:"Ctrl+Enter",smartElements:"Smart elements",dateChip:"Date",peopleChip:"People",fileChip:"File",dropdownChip:"Dropdown",locationChip:"Location",pagelessFormat:"Pageless format",clearFormatting:"Clear formatting",spellCheck:"Spell check",wordCount:"Word count",preferences:"Preferences",manageExtensions:"Manage extensions…",keyboardShortcuts:"Keyboard shortcuts",reportIssue:"Report issue",about:"About DocsEditor"},toolbar:{undo:"Undo",redo:"Redo",print:"Print",spelling:"Spelling",zoom:"100%",paragraphStyle:"Paragraph style",normalText:"Normal text",fontFamily:"Font family",decreaseFontSize:"Decrease font size",increaseFontSize:"Increase font size",fontSize:"Font size",lists:"Lists",alignment:"Alignment",insert:"Insert",comments:"Comments",history:"History",ai:"AI",tableOfContents:"Table of contents",references:"References"},statusBar:{liveSyncActive:"Live Sync Active",connecting:"Connecting…",saving:"Saving changes…",offline:"Offline",lastSavedAt:"Last saved at",never:"Never",pageSize:"Page size",page:"Page",of:"of",pageless:"Pageless",words:"words",characters:"characters"},editor:{share:{title:"Share document",close:"Close",shareableLink:"Shareable link",copy:"Copy",copied:"Link copied to clipboard",couldNotCopy:"Could not copy link",collaborators:"Collaborators",addCollaborator:"Add collaborator by email",placeholder:"colleague@example.com",add:"Add",userNotFound:"User not found",failedToAdd:"Failed to add collaborator",visibility:"Visibility",private:"Private",privateDescription:"Only you and people you invite can access this document.",restricted:"Restricted",restrictedDescription:"Anyone with the link can view this document."},print:"Print",logOut:"Log out",rename:{title:"Rename document",label:"Document title",save:"Save",cancel:"Cancel"},pageSetup:{title:"Page setup",paperSize:"Paper size",orientation:"Orientation",portrait:"Portrait",landscape:"Landscape",margins:"Margins",top:"Top",bottom:"Bottom",left:"Left",right:"Right",apply:"Apply",cancel:"Cancel"},details:{title:"Document details",titleLabel:"Title",owner:"Owner",location:"Location",noFolder:"(No folder)",created:"Created",modified:"Last modified",statistics:"Statistics",words:"Words",characters:"Characters",pages:"Pages",loading:"Loading document details…"},email:{title:"Email this file",to:"To",toPlaceholder:"recipient@example.com",subject:"Subject",body:"Body",send:"Send",copyLink:"Copy link",shareableLink:"Shareable link",defaultSubject:"Document: {title}",defaultBody:"You can view this document at: {url}"},linkDialog:{insertTitle:"Insert link",editTitle:"Edit link",text:"Text to display",textPlaceholder:"Link text",url:"URL",urlPlaceholder:"https://example.com",insert:"Insert",update:"Update",remove:"Remove link",cancel:"Cancel",urlRequired:"URL is required",urlInvalid:"Please enter a valid URL"},findReplace:{title:"Find and replace",findPlaceholder:"Find in document",replacePlaceholder:"Replace with",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace all",noMatches:"No matches",matchCount:"{current} of {total}",close:"Close"},headerFooter:{header:"Header",footer:"Footer",headerPlaceholder:"e.g. Document Title",footerPlaceholder:"e.g. Page {page} of {total}",headerLeftPlaceholder:"e.g. Document Title",headerRightPlaceholder:"e.g. Page {page}",differentFirstPage:"Different first page",differentOddEven:"Different odd & even pages",options:"Options",formatHeader:"Header format",pageNumber:"Page numbers",removeHeader:"Remove header",removeFooter:"Remove footer",alignPlacement:"Content placement",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",placementSection:"Placement",placementHint:"Header/footer content is aligned within the text area (left/center/right).",headerFooterFormatTitle:"Header & footer",marginSection:"Margin",headerTopMargin:"Header (centimeters from top)",footerBottomMargin:"Footer (centimeters from bottom)",layoutSection:"Layout",pageNumberTitle:"Page numbers",positionSection:"Position",positionHeader:"Header",positionFooter:"Footer",showOnFirstPage:"Show on first page",numberingSection:"Numbering",startAt:"Start at",continueFromPrevious:"Continue from previous section",hideOnPages:"Hide page numbers on",hideOnPagesPlaceholder:"e.g. 1, 3-5",hideOnPagesHint:"Separate with commas; use a dash for ranges (e.g. 1, 3-5). Pages are still counted, only the number is hidden.",apply:"Apply",cancel:"Cancel",save:"Save"},showOutline:"Show document outline",loadingDocument:"Loading document"},slashMenu:{title:"Suggested",basicBlocks:"Basic Blocks",noMatch:"No matching commands"},documentTabs:{documentTabs:"Document Tabs",addTab:"Add tab",rename:"Rename",delete:"Delete",outline:"Outline",untitledHeading:"Untitled Heading {level}",placeholder:"Headings you add to the document will appear here."},theme:{lightMode:"Switch to light mode",darkMode:"Switch to dark mode"},sidebars:{ai:{title:"AI Writing Helper",description:"A server-side AI co-writer to draft, summarize, or edit your copy.",quickMacros:"Quick AI Macros",summarize:"Summarize",fixGrammar:"Fix Grammar",continue:"Continue",toSpanish:"To Spanish",generations:"AI Generations",aiDrafting:"AI drafting…",copy:"Copy",copied:"Copied",insert:"Insert",inserted:"Inserted",noDraft:"Ask anything about your document, or run a quick macro above.",promptPlaceholder:"Ask AI to draft outline, write content, rewrite tone…",promptAI:"Prompt AI",close:"Close",you:"You",assistant:"Assistant",notConfigured:"AI is not configured on this deployment.",selectTextFirst:"Select text in the document first",improveSelection:"Improve selection",draft:"Draft with citations",draftPlaceholder:"Ask the AI to draft text grounded on your reference library…",promptDraft:"Draft",citations:"Citations",emptyResponse:"The AI returned an empty response.",aiError:"AI request failed",contextLabel:"Attached context",pageShort:"p.",paragraphShort:"Para.",lineShort:"Line",selectionContext:"Selected text"},comments:{title:"Discussion Panel",placeholder:"Select text to add a comment…",addComment:"Add comment",resolve:"Resolve",reply:"Reply…",replyInThread:"Reply in thread",active:"Active",resolved:"Resolved",creatingAnchored:"Creating anchored comment:",quote:"Quote:",resolvedBy:"Resolved by {user}",noComments:"No {mode} comments yet.",commentOnSelection:"Comment on selection…",generalComment:"Add general comment to document…",anchoredComment:"Anchored comment",general:"General comment",post:"Post",orphaned:"Text deleted",delete:"Delete",confirmDelete:"Delete this comment thread? This cannot be undone."},history:{title:"History",empty:"No history yet.",version:"Version",restore:"Restore",closePreview:"Close Preview",restoreThis:"Restore This",viewingPreview:"Viewing Revision Preview",readOnlyPreview:"You are previewing version #{index}. Your editor is temporarily read-only.",modifiedBy:"Modified by:",saveNamedSnapshot:"Save Named Snapshot",snapshotPlaceholder:"e.g. Approved Final Draft…",noSnapshots:"No snapshots saved yet.",save:"Save",cancel:"Cancel",preview:"Preview"},toc:{title:"Contents",empty:"No headings yet.",untitledHeading:"Untitled Heading {level}",newSection:"New {tag} Section",startWriting:"Start writing here…",closeOutline:"Close outline",searchHeadings:"Search headings…",noHeadings:"No Headings Yet",noHeadingsDescription:"Use headers (H1, H2, or H3) to structure your document. An interactive outline will generate here automatically.",quickInsert:"Quick Insert",headingLevel:"Heading {level}",noMatchingHeaders:"No matching headers found",tryDifferentTerm:"Try searching with a different term.",outlineLayout:"Outline Layout",outlineSync:"Outline syncs automatically. Click any header to instantly jump, focus, and scroll the editor to that section."},references:{title:"References",subtitle:"Manage sources and insert citations.",close:"Close references",citationStyle:"Citation style",searchSources:"Search sources…",addSource:"Add source",editSource:"Edit source",noSources:"No sources yet",noSourcesDescription:"Add your first reference to start citing. Citations and the bibliography follow the active style automatically.",noMatchingSources:"No matching sources found",cite:"Cite",edit:"Edit",delete:"Delete",back:"Back to list",anonymous:"Anonymous",etAl:"et al.",confirmDelete:'Delete source "{title}"? Citations referencing it will stop rendering.',import:{title:"Import",fromDoi:"From DOI (CrossRef)",doiPlaceholder:"Paste a DOI or DOI link…",importDoi:"Import DOI",doiSuccess:"Source imported from CrossRef.",doiFailed:"DOI could not be resolved.",fromFile:"From BibTeX / RIS file",pickFile:"Choose .bib or .ris file",importing:"Importing…",batchSuccess:"{count} source(s) imported.",partial:"{ok} imported, {failed} failed.",failed:"Import failed."},types:{book:"Book","article-journal":"Journal article",chapter:"Book chapter",webpage:"Web page",report:"Report",thesis:"Thesis",document:"Document"},form:{type:"Source type",title:"Title",authors:"Authors",familyName:"Family name",givenName:"Given name",addAuthor:"Add author",year:"Year",journal:"Journal",bookTitle:"Book title",publisher:"Publisher",publisherPlace:"Place",volume:"Volume",issue:"Issue",pages:"Pages",save:"Save changes",create:"Add source",cancel:"Cancel"}}},dashboard:{allDocuments:"All Documents",starred:"Starred",folders:"Folders",createFolder:"Create New Folder",folderNamePlaceholder:"Folder name…",noFolders:"No folders created yet.",startNewDocument:"Start a New Document",blankDocument:"Blank Document",blankDescription:"Fresh slate",meetingNotes:"Meeting Notes",meetingNotesDescription:"Attendees & Action Items",projectProposal:"Project Proposal",projectProposalDescription:"Objectives & Deliverables",officialLetter:"Official Letter",officialLetterDescription:"Pre-formatted header",searchPlaceholder:"Search titles or full-text contents…",modified:"Modified",alphabetical:"Alphabetical",created:"Created",gridView:"Grid View",listView:"List View",activeFilters:"Active Filters:",folder:"Folder",starredOnly:"Starred Only",search:"Search",noDocuments:"No documents found",noDocumentsDescription:"No files match your current filters. Select a template or create a blank file to start drafting!",createBlankDocument:"Create Blank Document",loadingDocuments:"Loading documents...",folderCreated:"Folder created.",folderAlreadyExists:"A folder with that name already exists.",folderLoadError:"Could not load folders. Please try again.",folderCreateError:"Could not create the folder. Please try again.",documentTitle:"Document Title",lastModified:"Last Modified",actions:"Actions",trash:"Trash",trashEmpty:"Trash is empty",trashEmptyDescription:"Deleted documents will appear here.",trashedAt:"Trashed",movedToTrash:"Moved to trash:",selectedCount:"{count} selected",documentDeleteError:"Could not delete one or more documents. Please try again."},auth:{signInTitle:"Sign in to create and edit documents",signInWithGoogle:"Sign in with Google",signInWithEmail:"Sign in with Email",signInWithGitHub:"Sign in with GitHub",signInWith:"Sign in with {provider}",or:"or",email:"Email",password:"Password",name:"Name",signIn:"Sign In",signUp:"Sign Up",signOut:"Sign out",noAccount:"Don't have an account? Sign up",hasAccount:"Already have an account? Sign in",invalidCredentials:"Invalid email or password",accountCreated:"Account created! You are now signed in.",loadDocumentsError:"Failed to load documents. Is the server running?",retry:"Try again",rateLimited:"Server is rate limiting requests.",retryIn:"Retrying in {seconds}s…",networkError:"Could not reach the server. Check your connection.",noProviders:"No authentication providers configured. Check your server environment variables."},language:{label:"Language",en:"English",id:"Indonesian"}},lf={common:{save:"Simpan",cancel:"Batal",create:"Buat",delete:"Hapus",rename:"Ubah nama",duplicate:"Duplikat",move:"Pindah",moveToFolder:"Pindah ke folder",moveDocument:"Pindahkan Dokumen",noFolder:"(Tanpa Folder)",search:"Cari",loading:"Memuat…",error:"Kesalahan",dismiss:"Tutup",emptyDocument:"(Dokumen Kosong)",confirmDelete:"Apakah Anda yakin ingin menghapus dokumen ini?",undo:"Batalkan",restore:"Pulihkan",deleteForever:"Hapus permanen",back:"Kembali",confirmPermanentDelete:"Hapus dokumen ini secara permanen? Tindakan ini tidak dapat dibatalkan.",confirmPermanentDeleteBulk:"Hapus {count} dokumen secara permanen? Tindakan ini tidak dapat dibatalkan.",selectAll:"Pilih semua",clearSelection:"Hapus pilihan"},header:{file:"Berkas",new:"Baru",newDocument:"Dokumen baru",helpMeCreate:"Bantu saya membuat",fromTemplate:"Dari templat",open:"Buka",makeACopy:"Buat salinan",share:"Bagikan",email:"Email",emailDraft:"Draf Email",download:"Unduh",rename:"Ubah nama",move:"Pindah",moveToFolder:"Pindah ke folder",moveToTrash:"Pindah ke sampah",addToStarred:"Tambahkan ke Bintang",versionHistory:"Riwayat versi",language:"Bahasa",pageSetup:"Penataan halaman",print:"Cetak",details:"Detail",security:"Batasan keamanan",edit:"Sunting",view:"Tampilan",insert:"Sisipkan",format:"Format",tools:"Alat",extensions:"Ekstensi",help:"Bantuan",backToDocuments:"Kembali ke Dokumen",clickToRename:"Klik untuk mengganti nama",starDocument:"Bintangi dokumen",unstarDocument:"Hapus bintang",sandbox:"Sandbox (alihkan kolaborator simulasi)",theme:"Tema",account:"Akun",markdown:"Markdown (.md)",html:"Halaman web (.html)",htmlZip:"Halaman web (.html, ter-zip)",text:"Teks biasa (.txt)",docx:"Microsoft Word (.docx)",pdf:"Dokumen PDF (.pdf)",odt:"OpenDocument Format (.odt)",rtf:"Rich Text Format (.rtf)",undo:"Urungkan",redo:"Ulangi",selectAll:"Pilih semua",cut:"Potong",copy:"Salin",paste:"Tempel",pasteWithoutFormatting:"Tempel tanpa pemformatan",delete:"Hapus",findAndReplace:"Temukan dan ganti",showSidebar:"Tampilkan kerangka",focusMode:"Mode Fokus Penuh",showRuler:"Tampilkan penggaris",meetingNotes:"Catatan Rapat",image:"Gambar",table:"Tabel",codeBlock:"Kode Blok",link:"Tautan",header:"Header",footer:"Footer",footnote:"Catatan Kaki",tableOfContents:"Daftar isi",bold:"Teks Tebal",italic:"Teks Miring",underline:"Garis Bawah",heading1:"Judul 1",heading2:"Judul 2",heading3:"Judul 3",heading4:"Judul 4",heading5:"Judul 5",heading6:"Judul 6",alignIndent:"Perataan & indentasi",alignLeft:"Rata kiri",alignCenter:"Rata tengah",alignRight:"Rata kanan",alignJustify:"Rata kiri-kanan",bulletsNumbering:"Bullet & penomoran",bulletList:"Daftar ber-bullet",numberedList:"Daftar bernomor",taskList:"Daftar tugas",horizontalLine:"Garis horizontal",pageNumbers:"Nomor halaman",pageNumberInHeader:"Sisipkan di header",pageNumberInFooter:"Sisipkan di footer",break:"Pemisah",pageBreak:"Pemisah halaman",pageBreakShortcut:"Ctrl+Enter",smartElements:"Elemen pintar",dateChip:"Tanggal",peopleChip:"Orang",fileChip:"Berkas",dropdownChip:"Dropdown",locationChip:"Lokasi",pagelessFormat:"Format tanpa halaman",clearFormatting:"Hapus pemformatan",spellCheck:"Periksa ejaan",wordCount:"Hitungan kata",preferences:"Preferensi",manageExtensions:"Kelola ekstensi…",keyboardShortcuts:"Pintasan keyboard",reportIssue:"Laporkan masalah",about:"Tentang DocsEditor"},toolbar:{undo:"Urungkan",redo:"Ulangi",print:"Cetak",spelling:"Ejaan",zoom:"100%",paragraphStyle:"Gaya paragraf",normalText:"Teks normal",fontFamily:"Keluarga font",decreaseFontSize:"Kecilkan font",increaseFontSize:"Perbesar font",fontSize:"Ukuran font",lists:"Daftar",alignment:"Perataan",insert:"Sisipkan",comments:"Komentar",history:"Riwayat",ai:"AI",tableOfContents:"Daftar isi",references:"Referensi"},statusBar:{liveSyncActive:"Sinkron Langsung Aktif",connecting:"Menghubungkan…",saving:"Menyimpan perubahan…",offline:"Luring",lastSavedAt:"Terakhir disimpan",never:"Tidak pernah",pageSize:"Ukuran halaman",page:"Halaman",of:"dari",pageless:"Tanpa halaman",words:"kata",characters:"karakter"},editor:{share:{title:"Bagikan dokumen",close:"Tutup",shareableLink:"Tautan dapat dibagikan",copy:"Salin",copied:"Tautan disalin ke papan klip",couldNotCopy:"Tidak dapat menyalin tautan",collaborators:"Kolaborator",addCollaborator:"Tambahkan kolaborator lewat email",placeholder:"rekan@contoh.com",add:"Tambah",userNotFound:"Pengguna tidak ditemukan",failedToAdd:"Gagal menambahkan kolaborator",visibility:"Visibilitas",private:"Pribadi",privateDescription:"Hanya Anda dan orang yang Anda undang yang dapat mengakses dokumen ini.",restricted:"Terbatas",restrictedDescription:"Siapa pun dengan tautan dapat melihat dokumen ini."},print:"Cetak",logOut:"Keluar",rename:{title:"Ubah nama dokumen",label:"Judul dokumen",save:"Simpan",cancel:"Batal"},pageSetup:{title:"Penataan halaman",paperSize:"Ukuran kertas",orientation:"Orientasi",portrait:"Potret",landscape:"Lanskap",margins:"Margin",top:"Atas",bottom:"Bawah",left:"Kiri",right:"Kanan",apply:"Terapkan",cancel:"Batal"},details:{title:"Detail dokumen",titleLabel:"Judul",owner:"Pemilik",location:"Lokasi",noFolder:"(Tanpa folder)",created:"Dibuat",modified:"Terakhir diubah",statistics:"Statistik",words:"Kata",characters:"Karakter",pages:"Halaman",loading:"Memuat detail dokumen…"},email:{title:"Email file ini",to:"Kepada",toPlaceholder:"penerima@contoh.com",subject:"Subjek",body:"Isi",send:"Kirim",copyLink:"Salin tautan",shareableLink:"Tautan dapat dibagikan",defaultSubject:"Dokumen: {title}",defaultBody:"Anda dapat melihat dokumen ini di: {url}"},linkDialog:{insertTitle:"Sisipkan tautan",editTitle:"Edit tautan",text:"Teks yang ditampilkan",textPlaceholder:"Teks tautan",url:"URL",urlPlaceholder:"https://contoh.com",insert:"Sisipkan",update:"Perbarui",remove:"Hapus tautan",cancel:"Batal",urlRequired:"URL wajib diisi",urlInvalid:"Masukkan URL yang valid"},findReplace:{title:"Temukan dan ganti",findPlaceholder:"Temukan di dokumen",replacePlaceholder:"Ganti dengan",next:"Berikutnya",previous:"Sebelumnya",replace:"Ganti",replaceAll:"Ganti semua",noMatches:"Tidak ada hasil",matchCount:"{current} dari {total}",close:"Tutup"},headerFooter:{header:"Header",footer:"Footer",headerPlaceholder:"mis. Judul Dokumen",footerPlaceholder:"mis. Halaman {page} dari {total}",headerLeftPlaceholder:"mis. Judul Dokumen",headerRightPlaceholder:"mis. Halaman {page}",differentFirstPage:"Halaman pertama berbeda",differentOddEven:"Halaman ganjil & genap berbeda",options:"Opsi",formatHeader:"Format header",pageNumber:"Nomor halaman",removeHeader:"Hapus header",removeFooter:"Hapus footer",alignPlacement:"Peletakkan konten",alignLeft:"Rata kiri",alignCenter:"Rata tengah",alignRight:"Rata kanan",placementSection:"Peletakkan",placementHint:"Konten header/footer disejajarkan di dalam area teks (kiri/tengah/kanan).",headerFooterFormatTitle:"Header & footer",marginSection:"Margin",headerTopMargin:"Header (sentimeter dari atas)",footerBottomMargin:"Footer (sentimeter dari bawah)",layoutSection:"Tata letak",pageNumberTitle:"Nomor halaman",positionSection:"Posisi",positionHeader:"Header",positionFooter:"Footer",showOnFirstPage:"Tampilkan di halaman pertama",numberingSection:"Penomoran",startAt:"Dimulai dari",continueFromPrevious:"Lanjutkan dari bagian sebelumnya",hideOnPages:"Sembunyikan nomor di halaman",hideOnPagesPlaceholder:"mis. 1, 3-5",hideOnPagesHint:"Pisahkan dengan koma; gunakan tanda hubung untuk rentang (mis. 1, 3-5). Halaman tetap dihitung, hanya nomornya yang disembunyikan.",apply:"Terapkan",cancel:"Batal",save:"Simpan"},showOutline:"Tampilkan kerangka dokumen",loadingDocument:"Memuat dokumen"},slashMenu:{title:"Saran",basicBlocks:"Blok Dasar",noMatch:"Tidak ada perintah yang cocok"},documentTabs:{documentTabs:"Tab Dokumen",addTab:"Tambah tab",rename:"Ubah nama",delete:"Hapus",outline:"Kerangka",untitledHeading:"Judul Tanpa Nama {level}",placeholder:"Tajuk yang Anda tambahkan ke dokumen akan muncul di sini."},theme:{lightMode:"Beralih ke mode terang",darkMode:"Beralih ke mode gelap"},sidebars:{ai:{title:"AI Writing Helper",description:"Penulis AI sisi-server untuk menyusun, merangkum, atau menyunting tulisan Anda.",quickMacros:"Makro AI Cepat",summarize:"Rangkum",fixGrammar:"Perbaiki Tata Bahasa",continue:"Lanjutkan",toSpanish:"Ke Spanyol",generations:"Hasil AI",aiDrafting:"AI menyusun…",copy:"Salin",copied:"Tersalin",insert:"Sisipkan",inserted:"Tersisip",noDraft:"Tanya apa saja tentang dokumen Anda, atau jalankan makro cepat di atas.",promptPlaceholder:"Minta AI membuat kerangka, menulis konten, menulis ulang nada…",promptAI:"Perintah AI",close:"Tutup",you:"Anda",assistant:"Asisten",notConfigured:"AI belum dikonfigurasi pada deployment ini.",selectTextFirst:"Pilih teks di dokumen terlebih dahulu",improveSelection:"Perbaiki pilihan",draft:"Draf dengan sitasi",draftPlaceholder:"Minta AI menyusun teks berbasis pustaka referensi Anda…",promptDraft:"Susun",citations:"Sitasi",emptyResponse:"AI mengembalikan respons kosong.",aiError:"Permintaan AI gagal",contextLabel:"Konteks yang dilampirkan",pageShort:"Hal.",paragraphShort:"Alinea",lineShort:"Baris",selectionContext:"Teks terpilih"},comments:{title:"Panel Diskusi",placeholder:"Pilih teks untuk menambahkan komentar…",addComment:"Tambah komentar",resolve:"Selesai",reply:"Balas…",replyInThread:"Balas di thread",active:"Aktif",resolved:"Selesai",creatingAnchored:"Membuat komentar terpaut:",quote:"Kutipan:",resolvedBy:"Diselesaikan oleh {user}",noComments:"Belum ada komentar {mode}.",commentOnSelection:"Komentari pilihan…",generalComment:"Tambahkan komentar umum ke dokumen…",anchoredComment:"Komentar terpaut",general:"Komentar umum",post:"Kirim",orphaned:"Teks dihapus",delete:"Hapus",confirmDelete:"Hapus thread komentar ini? Tindakan ini tidak dapat dibatalkan."},history:{title:"Riwayat",empty:"Belum ada riwayat.",version:"Versi",restore:"Pulihkan",closePreview:"Tutup Pratinjau",restoreThis:"Pulihkan Ini",viewingPreview:"Melihat Pratinjau Revisi",readOnlyPreview:"Anda sedang melihat pratinjau versi #{index}. Editor Anda untuk sementara hanya-baca.",modifiedBy:"Diubah oleh:",saveNamedSnapshot:"Simpan Snapshot Bernama",snapshotPlaceholder:"mis. Final Draft Disetujui…",noSnapshots:"Belum ada snapshot yang disimpan.",save:"Simpan",cancel:"Batal",preview:"Pratinjau"},toc:{title:"Daftar Isi",empty:"Belum ada judul.",untitledHeading:"Judul Tanpa Nama {level}",newSection:"Bagian {tag} Baru",startWriting:"Mulai menulis di sini…",closeOutline:"Tutup kerangka",searchHeadings:"Cari judul…",noHeadings:"Belum Ada Judul",noHeadingsDescription:"Gunakan header (H1, H2, atau H3) untuk menyusun dokumen. Kerangka interaktif akan dibuat otomatis di sini.",quickInsert:"Sisipkan Cepat",headingLevel:"Judul {level}",noMatchingHeaders:"Tidak ada header yang cocok",tryDifferentTerm:"Coba cari dengan istilah lain.",outlineLayout:"Tata Letak Kerangka",outlineSync:"Kerangka tersinkronisasi otomatis. Klik header apa pun untuk langsung melompat, fokus, dan menggulir editor ke bagian tersebut."},references:{title:"Referensi",subtitle:"Kelola sumber dan sisipkan sitasi.",close:"Tutup referensi",citationStyle:"Gaya sitasi",searchSources:"Cari sumber…",addSource:"Tambah sumber",editSource:"Ubah sumber",noSources:"Belum ada sumber",noSourcesDescription:"Tambahkan referensi pertama Anda untuk mulai menyitasi. Sitasi dan daftar pustaka mengikuti gaya aktif secara otomatis.",noMatchingSources:"Tidak ada sumber yang cocok",cite:"Sitasi",edit:"Ubah",delete:"Hapus",back:"Kembali ke daftar",anonymous:"Anonim",etAl:"dkk.",confirmDelete:'Hapus sumber "{title}"? Sitasi yang merujuknya akan berhenti ditampilkan.',import:{title:"Impor",fromDoi:"Dari DOI (CrossRef)",doiPlaceholder:"Tempel DOI atau tautan DOI…",importDoi:"Impor DOI",doiSuccess:"Sumber berhasil diimpor dari CrossRef.",doiFailed:"DOI tidak dapat ditemukan.",fromFile:"Dari berkas BibTeX / RIS",pickFile:"Pilih berkas .bib atau .ris",importing:"Mengimpor…",batchSuccess:"{count} sumber berhasil diimpor.",partial:"{ok} berhasil, {failed} gagal.",failed:"Impor gagal."},types:{book:"Buku","article-journal":"Artikel jurnal",chapter:"Bab buku",webpage:"Halaman web",report:"Laporan",thesis:"Tesis",document:"Dokumen"},form:{type:"Jenis sumber",title:"Judul",authors:"Penulis",familyName:"Nama keluarga",givenName:"Nama depan",addAuthor:"Tambah penulis",year:"Tahun",journal:"Jurnal",bookTitle:"Judul buku",publisher:"Penerbit",publisherPlace:"Kota terbit",volume:"Volume",issue:"Edisi",pages:"Halaman",save:"Simpan perubahan",create:"Tambah sumber",cancel:"Batal"}}},dashboard:{allDocuments:"Semua Dokumen",starred:"Berbintang",folders:"Folder",createFolder:"Buat Folder Baru",folderNamePlaceholder:"Nama folder…",noFolders:"Belum ada folder.",startNewDocument:"Mulai Dokumen Baru",blankDocument:"Dokumen Kosong",blankDescription:"Kertas kosong",meetingNotes:"Catatan Rapat",meetingNotesDescription:"Peserta & Tindak Lanjut",projectProposal:"Proposal Proyek",projectProposalDescription:"Tujuan & Hasil",officialLetter:"Surat Resmi",officialLetterDescription:"Header yang sudah diformat",searchPlaceholder:"Cari judul atau isi dokumen…",modified:"Diubah",alphabetical:"Abjad",created:"Dibuat",gridView:"Tampilan Grid",listView:"Tampilan Daftar",activeFilters:"Filter Aktif:",folder:"Folder",starredOnly:"Hanya Berbintang",search:"Cari",noDocuments:"Tidak ada dokumen",noDocumentsDescription:"Tidak ada file yang cocok dengan filter. Pilih template atau buat dokumen kosong untuk mulai menulis!",createBlankDocument:"Buat Dokumen Kosong",loadingDocuments:"Memuat dokumen...",folderCreated:"Folder berhasil dibuat.",folderAlreadyExists:"Folder dengan nama tersebut sudah ada.",folderLoadError:"Folder tidak dapat dimuat. Silakan coba lagi.",folderCreateError:"Folder tidak dapat dibuat. Silakan coba lagi.",documentTitle:"Judul Dokumen",lastModified:"Terakhir Diubah",actions:"Aksi",trash:"Sampah",trashEmpty:"Sampah kosong",trashEmptyDescription:"Dokumen yang dihapus akan muncul di sini.",trashedAt:"Dihapus",movedToTrash:"Dipindahkan ke sampah:",selectedCount:"{count} dipilih",documentDeleteError:"Tidak dapat menghapus satu atau lebih dokumen. Silakan coba lagi."},auth:{signInTitle:"Masuk untuk membuat dan menyunting dokumen",signInWithGoogle:"Masuk dengan Google",signInWithEmail:"Masuk dengan Email",signInWithGitHub:"Masuk dengan GitHub",signInWith:"Masuk dengan {provider}",or:"atau",email:"Email",password:"Kata sandi",name:"Nama",signIn:"Masuk",signUp:"Daftar",signOut:"Keluar",noAccount:"Belum punya akun? Daftar",hasAccount:"Sudah punya akun? Masuk",invalidCredentials:"Email atau kata sandi salah",accountCreated:"Akun dibuat! Anda sekarang masuk.",loadDocumentsError:"Gagal memuat dokumen. Apakah server berjalan?",retry:"Coba lagi",rateLimited:"Server sedang membatasi permintaan.",retryIn:"Mencoba ulang dalam {seconds} detik…",networkError:"Tidak bisa menghubungi server. Periksa koneksi Anda.",noProviders:"Tidak ada penyedia autentikasi yang dikonfigurasi. Periksa variabel lingkungan server."},language:{label:"Bahasa",en:"English",id:"Indonesia"}},Pa={en:sf,id:lf},Bl="en",sb={en:sf.language.en,id:lf.language.id};function cf(e){return Pa[e]??Pa[Bl]}function Fa(e){return typeof e=="string"&&e in Pa}const uf=Symbol("docflow-locale"),df="docflow-locale";function lb(e){if(e&&Fa(e))return e;try{const t=localStorage.getItem(df);if(t&&Fa(t))return t}catch{}return Bl}function cb(e,t){const n=t.split(".");let i=e;for(const r of n){if(i===null||typeof i!="object")return;i=i[r]}return i}function ff(e){const t=s.ref(lb(e));return{locale:t,setLocale:r=>{if(Fa(r)){t.value=r;try{localStorage.setItem(df,r)}catch{}}},t:(r,a)=>{const o=cf(t.value),l=cb(o,r);if(typeof l!="string")return r;let c=l;if(a)for(const[u,f]of Object.entries(a))c=c.replace(new RegExp(`\\{${u}\\}`,"g"),String(f));return c}}}function ht(){const e=s.inject(uf,null);return e||ff()}function pf(e){const t=ff(e);return s.provide(uf,t),t}function mf(e){return sb[e]??e}function hf(){return["en","id"]}function ub(e){const t=s.ref({totalPages:1,visiblePages:[],config:{pageSize:{id:"a4",name:"A4",pageWidth:794,pageHeight:1123},margins:{top:20,bottom:20,left:50,right:50},pageGap:50,headerLeft:"",headerRight:"",footerLeft:"",footerRight:""}}),n=s.computed(()=>t.value.totalPages),i=s.computed(()=>t.value.visiblePages),r=s.ref(!1);let a=null,o=null;const l=()=>{var p;return((p=e.enabled)==null?void 0:p.value)??!0},c=async()=>{var g;if(!l())return;const p=e.editorRef.value,h=e.scrollRef.value;!((g=p==null?void 0:p.view)!=null&&g.dom)||!h||(a=new ar.VirtualPageOverlay(p.view.dom,e.config,h,e.bufferPages??2),a.observe(),t.value=await a.layout(),r.value=!0,o=new ResizeObserver(async()=>{a&&(t.value=await a.layout())}),o.observe(p.view.dom))},u=async p=>{a&&l()&&(t.value=await a.updateConfig(p))},f=()=>{a&&l()&&(t.value=a.getData())};let m=null;return s.onMounted(()=>{l()&&(m=setInterval(f,250))}),s.onUnmounted(()=>{m&&clearInterval(m),a==null||a.disconnect(),o==null||o.disconnect()}),s.watch([()=>{var p,h;return(h=(p=e.editorRef.value)==null?void 0:p.view)==null?void 0:h.dom},e.scrollRef,()=>{var p;return(p=e.enabled)==null?void 0:p.value}],()=>{l()&&!r.value?c():!l()&&r.value&&(m&&(clearInterval(m),m=null),a==null||a.disconnect(),o==null||o.disconnect(),a=null,o=null,r.value=!1)},{immediate:!0}),s.watch(()=>e.config,p=>{r.value&&l()&&u(p)},{deep:!0}),{data:t,totalPages:n,visiblePages:i,isReady:r,refreshData:f,updateConfig:u}}const db={key:0,class:"virtual-page-overlay","aria-hidden":"true"},fb=["innerHTML"],pb=["innerHTML"],mb=["innerHTML"],hb=["innerHTML"],bb=s.defineComponent({__name:"VirtualPageOverlay",props:{data:{},isReady:{type:Boolean}},setup(e){const t=e,n=s.computed(()=>t.data.visiblePages),i=s.computed(()=>t.data.config),r=s.computed(()=>i.value.pageSize),a=s.computed(()=>({height:`${i.value.pageGap}px`})),o=s.computed(()=>({paddingTop:`${i.value.margins.top}px`,paddingLeft:`${i.value.margins.left}px`,paddingRight:`${i.value.margins.right}px`,height:`${i.value.margins.top}px`})),l=s.computed(()=>({paddingBottom:`${i.value.margins.bottom}px`,paddingLeft:`${i.value.margins.left}px`,paddingRight:`${i.value.margins.right}px`}));function c(f){return{top:`${f.top}px`,height:`${r.value.pageHeight+i.value.pageGap}px`,width:`${r.value.pageWidth}px`}}function u(f,m){return f.replace(/\{page\}/g,String(m+1)).replace(/\{total\}/g,String(t.data.totalPages))}return(f,m)=>e.isReady?(s.openBlock(),s.createElementBlock("div",db,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.value,p=>(s.openBlock(),s.createElementBlock("div",{key:p.index,class:"vp-page",style:s.normalizeStyle(c(p))},[s.createElementVNode("div",{class:"vp-gap",style:s.normalizeStyle(a.value)},null,4),s.createElementVNode("div",{class:"vp-header",style:s.normalizeStyle(o.value)},[s.createElementVNode("span",{class:"vp-header-left",innerHTML:i.value.headerLeft},null,8,fb),s.createElementVNode("span",{class:"vp-header-right",innerHTML:i.value.headerRight},null,8,pb)],4),s.createElementVNode("div",{class:"vp-footer",style:s.normalizeStyle(l.value)},[s.createElementVNode("span",{class:"vp-footer-left",innerHTML:u(i.value.footerLeft,p.index)},null,8,mb),s.createElementVNode("span",{class:"vp-footer-right",innerHTML:u(i.value.footerRight,p.index)},null,8,hb)],4)],4))),128))])):s.createCommentVNode("",!0)}}),Pl=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},gb=Pl(bb,[["__scopeId","data-v-a48fe1b6"]]),vb={class:"px-2 py-1.5 text-[10px] font-semibold uppercase text-slate-400"},xb=["onClick","onMouseenter"],yb={class:"text-slate-500 dark:text-slate-400"},bf=s.defineComponent({__name:"SlashMenu",props:{editor:{},commands:{}},setup(e){const{t}=ht(),n=e,i=s.ref(!1),r=s.ref(""),a=s.ref(0),o=s.ref({top:0,left:0}),l=s.ref([]);function c(){if(!n.editor)return;const{view:h}=n.editor,{selection:g}=h.state,b=h.coordsAtPos(g.head);o.value={top:b.bottom+4,left:b.left}}function u(h){var A,I,_,E;if(!n.editor)return;const{view:g}=n.editor,{selection:b}=g.state,y=b.head,v=g.state.doc.resolve(y),x=v.start(),w=v.parent.textContent.slice(0,v.parentOffset).lastIndexOf("/");if(w>=0){const z=x+w,P=g.state.tr.delete(z,y);g.dispatch(P)}const S=n.editor;if(typeof((A=S.commands)==null?void 0:A[h.command])=="function")S.commands[h.command]();else if(S.chain)try{(E=(_=(I=S.chain().focus())[h.command])==null?void 0:_.call(I))==null||E.run()}catch{}i.value=!1,r.value=""}function f(){i.value=!1,r.value=""}function m(){if(!n.editor)return;const{view:h}=n.editor,{selection:g}=h.state,b=g.head,y=h.state.doc.resolve(b),v=y.parent.textContent.slice(0,y.parentOffset),x=v.lastIndexOf("/");if(x>=0){const k=v.slice(0,x),w=v.slice(x+1);if((k===""||k.endsWith(" ")||k===`
2
+ `)&&!w.includes(" ")){r.value=w,i.value=!0,a.value=0,c();return}}i.value=!1}s.watch(()=>n.editor,h=>{h&&(h.on("update",m),h.on("selectionUpdate",()=>{i.value&&c()}))}),s.watch([r,()=>n.commands],()=>{const h=r.value.toLowerCase();l.value=h?n.commands.filter(g=>g.name.toLowerCase().includes(h)):n.commands});function p(h){if(i.value){if(h.key==="ArrowDown"&&(h.preventDefault(),a.value=Math.min(a.value+1,l.value.length-1)),h.key==="ArrowUp"&&(h.preventDefault(),a.value=Math.max(a.value-1,0)),h.key==="Enter"){h.preventDefault();const g=l.value[a.value];g&&u(g)}h.key==="Escape"&&(h.preventDefault(),f())}}return s.onMounted(()=>{document.addEventListener("keydown",p)}),s.onUnmounted(()=>{document.removeEventListener("keydown",p)}),(h,g)=>(s.openBlock(),s.createBlock(s.Teleport,{to:"body"},[i.value&&l.value.length>0?(s.openBlock(),s.createElementBlock("div",{key:0,class:"docs-slash-menu fixed z-[999] w-56 max-h-64 overflow-y-auto rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-slate-700 dark:bg-slate-800",style:s.normalizeStyle({top:o.value.top+"px",left:o.value.left+"px"})},[s.createElementVNode("div",vb,s.toDisplayString(s.unref(t)("slashMenu.basicBlocks")),1),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,(b,y)=>(s.openBlock(),s.createElementBlock("button",{key:b.command,class:s.normalizeClass(["flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",y===a.value?"bg-slate-100 dark:bg-slate-700":"hover:bg-slate-50 dark:hover:bg-slate-700/50"]),onClick:v=>u(b),onMouseenter:v=>a.value=y},[s.createElementVNode("span",yb,s.toDisplayString(b.name),1)],42,xb))),128))],4)):s.createCommentVNode("",!0)]))}});/**
3
3
  * @license lucide-vue-next v1.0.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
- */const yb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
7
+ */const kb=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
8
8
  * @license lucide-vue-next v1.0.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the ISC license.
16
16
  * See the LICENSE file in the root directory of this source tree.
17
- */const kb=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
17
+ */const wb=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();/**
18
18
  * @license lucide-vue-next v1.0.0 - ISC
19
19
  *
20
20
  * This source code is licensed under the ISC license.
@@ -24,12 +24,12 @@
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */const wb=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
27
+ */const _b=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());/**
28
28
  * @license lucide-vue-next v1.0.0 - ISC
29
29
  *
30
30
  * This source code is licensed under the ISC license.
31
31
  * See the LICENSE file in the root directory of this source tree.
32
- */const _b=e=>{const t=wb(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
32
+ */const Sb=e=>{const t=_b(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
33
33
  * @license lucide-vue-next v1.0.0 - ISC
34
34
  *
35
35
  * This source code is licensed under the ISC license.
@@ -39,27 +39,27 @@
39
39
  *
40
40
  * This source code is licensed under the ISC license.
41
41
  * See the LICENSE file in the root directory of this source tree.
42
- */const Sb=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":a,size:o=er.width,color:l=er.stroke,...c},{slots:u})=>s.h("svg",{...er,...c,width:o,height:o,stroke:l,"stroke-width":ru(n)||ru(i)||n===!0||i===!0?Number(r||a||er["stroke-width"])*24/Number(o):r||a||er["stroke-width"],class:kb("lucide",c.class,...e?[`lucide-${au(_b(e))}-icon`,`lucide-${au(e)}`]:["lucide-icon"]),...!u.default&&!yb(c)&&{"aria-hidden":"true"}},[...t.map(f=>s.h(...f)),...u.default?[u.default()]:[]]);/**
42
+ */const Cb=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":i,strokeWidth:r,"stroke-width":a,size:o=er.width,color:l=er.stroke,...c},{slots:u})=>s.h("svg",{...er,...c,width:o,height:o,stroke:l,"stroke-width":ru(n)||ru(i)||n===!0||i===!0?Number(r||a||er["stroke-width"])*24/Number(o):r||a||er["stroke-width"],class:wb("lucide",c.class,...e?[`lucide-${au(Sb(e))}-icon`,`lucide-${au(e)}`]:["lucide-icon"]),...!u.default&&!kb(c)&&{"aria-hidden":"true"}},[...t.map(f=>s.h(...f)),...u.default?[u.default()]:[]]);/**
43
43
  * @license lucide-vue-next v1.0.0 - ISC
44
44
  *
45
45
  * This source code is licensed under the ISC license.
46
46
  * See the LICENSE file in the root directory of this source tree.
47
- */const Z=(e,t)=>(n,{slots:i,attrs:r})=>s.h(Sb,{...r,...n,iconNode:t,name:e},i);/**
47
+ */const Z=(e,t)=>(n,{slots:i,attrs:r})=>s.h(Cb,{...r,...n,iconNode:t,name:e},i);/**
48
48
  * @license lucide-vue-next v1.0.0 - ISC
49
49
  *
50
50
  * This source code is licensed under the ISC license.
51
51
  * See the LICENSE file in the root directory of this source tree.
52
- */const Cb=Z("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
52
+ */const Eb=Z("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
53
53
  * @license lucide-vue-next v1.0.0 - ISC
54
54
  *
55
55
  * This source code is licensed under the ISC license.
56
56
  * See the LICENSE file in the root directory of this source tree.
57
- */const Eb=Z("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
57
+ */const Ab=Z("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
58
58
  * @license lucide-vue-next v1.0.0 - ISC
59
59
  *
60
60
  * This source code is licensed under the ISC license.
61
61
  * See the LICENSE file in the root directory of this source tree.
62
- */const Ab=Z("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
62
+ */const Tb=Z("badge-check",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
63
63
  * @license lucide-vue-next v1.0.0 - ISC
64
64
  *
65
65
  * This source code is licensed under the ISC license.
@@ -74,7 +74,7 @@
74
74
  *
75
75
  * This source code is licensed under the ISC license.
76
76
  * See the LICENSE file in the root directory of this source tree.
77
- */const Tb=Z("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);/**
77
+ */const Nb=Z("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]);/**
78
78
  * @license lucide-vue-next v1.0.0 - ISC
79
79
  *
80
80
  * This source code is licensed under the ISC license.
@@ -94,32 +94,32 @@
94
94
  *
95
95
  * This source code is licensed under the ISC license.
96
96
  * See the LICENSE file in the root directory of this source tree.
97
- */const Nb=Z("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
97
+ */const Ob=Z("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
98
98
  * @license lucide-vue-next v1.0.0 - ISC
99
99
  *
100
100
  * This source code is licensed under the ISC license.
101
101
  * See the LICENSE file in the root directory of this source tree.
102
- */const Ob=Z("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
102
+ */const Mb=Z("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
103
103
  * @license lucide-vue-next v1.0.0 - ISC
104
104
  *
105
105
  * This source code is licensed under the ISC license.
106
106
  * See the LICENSE file in the root directory of this source tree.
107
- */const Mb=Z("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
107
+ */const Db=Z("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
108
108
  * @license lucide-vue-next v1.0.0 - ISC
109
109
  *
110
110
  * This source code is licensed under the ISC license.
111
111
  * See the LICENSE file in the root directory of this source tree.
112
- */const Db=Z("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
112
+ */const zb=Z("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
113
113
  * @license lucide-vue-next v1.0.0 - ISC
114
114
  *
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
- */const zb=Z("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
117
+ */const Ib=Z("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
118
118
  * @license lucide-vue-next v1.0.0 - ISC
119
119
  *
120
120
  * This source code is licensed under the ISC license.
121
121
  * See the LICENSE file in the root directory of this source tree.
122
- */const Ib=Z("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
122
+ */const Rb=Z("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
123
123
  * @license lucide-vue-next v1.0.0 - ISC
124
124
  *
125
125
  * This source code is licensed under the ISC license.
@@ -129,17 +129,17 @@
129
129
  *
130
130
  * This source code is licensed under the ISC license.
131
131
  * See the LICENSE file in the root directory of this source tree.
132
- */const Rb=Z("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);/**
132
+ */const Lb=Z("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);/**
133
133
  * @license lucide-vue-next v1.0.0 - ISC
134
134
  *
135
135
  * This source code is licensed under the ISC license.
136
136
  * See the LICENSE file in the root directory of this source tree.
137
- */const Lb=Z("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
137
+ */const Bb=Z("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
138
138
  * @license lucide-vue-next v1.0.0 - ISC
139
139
  *
140
140
  * This source code is licensed under the ISC license.
141
141
  * See the LICENSE file in the root directory of this source tree.
142
- */const Bb=Z("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);/**
142
+ */const Pb=Z("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);/**
143
143
  * @license lucide-vue-next v1.0.0 - ISC
144
144
  *
145
145
  * This source code is licensed under the ISC license.
@@ -149,7 +149,7 @@
149
149
  *
150
150
  * This source code is licensed under the ISC license.
151
151
  * See the LICENSE file in the root directory of this source tree.
152
- */const Pb=Z("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);/**
152
+ */const Fb=Z("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);/**
153
153
  * @license lucide-vue-next v1.0.0 - ISC
154
154
  *
155
155
  * This source code is licensed under the ISC license.
@@ -159,7 +159,7 @@
159
159
  *
160
160
  * This source code is licensed under the ISC license.
161
161
  * See the LICENSE file in the root directory of this source tree.
162
- */const Fb=Z("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
162
+ */const Vb=Z("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
163
163
  * @license lucide-vue-next v1.0.0 - ISC
164
164
  *
165
165
  * This source code is licensed under the ISC license.
@@ -174,22 +174,22 @@
174
174
  *
175
175
  * This source code is licensed under the ISC license.
176
176
  * See the LICENSE file in the root directory of this source tree.
177
- */const Vb=Z("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
177
+ */const Ub=Z("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
178
178
  * @license lucide-vue-next v1.0.0 - ISC
179
179
  *
180
180
  * This source code is licensed under the ISC license.
181
181
  * See the LICENSE file in the root directory of this source tree.
182
- */const Ub=Z("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]);/**
182
+ */const Hb=Z("folder-input",[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]]);/**
183
183
  * @license lucide-vue-next v1.0.0 - ISC
184
184
  *
185
185
  * This source code is licensed under the ISC license.
186
186
  * See the LICENSE file in the root directory of this source tree.
187
- */const Hb=Z("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
187
+ */const qb=Z("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
188
188
  * @license lucide-vue-next v1.0.0 - ISC
189
189
  *
190
190
  * This source code is licensed under the ISC license.
191
191
  * See the LICENSE file in the root directory of this source tree.
192
- */const qb=Z("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
192
+ */const jb=Z("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
193
193
  * @license lucide-vue-next v1.0.0 - ISC
194
194
  *
195
195
  * This source code is licensed under the ISC license.
@@ -219,17 +219,17 @@
219
219
  *
220
220
  * This source code is licensed under the ISC license.
221
221
  * See the LICENSE file in the root directory of this source tree.
222
- */const jb=Z("heading-4",[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]]);/**
222
+ */const $b=Z("heading-4",[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]]);/**
223
223
  * @license lucide-vue-next v1.0.0 - ISC
224
224
  *
225
225
  * This source code is licensed under the ISC license.
226
226
  * See the LICENSE file in the root directory of this source tree.
227
- */const $b=Z("heading-5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);/**
227
+ */const Wb=Z("heading-5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]);/**
228
228
  * @license lucide-vue-next v1.0.0 - ISC
229
229
  *
230
230
  * This source code is licensed under the ISC license.
231
231
  * See the LICENSE file in the root directory of this source tree.
232
- */const Wb=Z("heading-6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);/**
232
+ */const Gb=Z("heading-6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]);/**
233
233
  * @license lucide-vue-next v1.0.0 - ISC
234
234
  *
235
235
  * This source code is licensed under the ISC license.
@@ -249,17 +249,17 @@
249
249
  *
250
250
  * This source code is licensed under the ISC license.
251
251
  * See the LICENSE file in the root directory of this source tree.
252
- */const Gb=Z("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
252
+ */const Kb=Z("image-plus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
253
253
  * @license lucide-vue-next v1.0.0 - ISC
254
254
  *
255
255
  * This source code is licensed under the ISC license.
256
256
  * See the LICENSE file in the root directory of this source tree.
257
- */const Kb=Z("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
257
+ */const Xb=Z("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
258
258
  * @license lucide-vue-next v1.0.0 - ISC
259
259
  *
260
260
  * This source code is licensed under the ISC license.
261
261
  * See the LICENSE file in the root directory of this source tree.
262
- */const Xb=Z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
262
+ */const Jb=Z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
263
263
  * @license lucide-vue-next v1.0.0 - ISC
264
264
  *
265
265
  * This source code is licensed under the ISC license.
@@ -269,17 +269,17 @@
269
269
  *
270
270
  * This source code is licensed under the ISC license.
271
271
  * See the LICENSE file in the root directory of this source tree.
272
- */const Jb=Z("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
272
+ */const Zb=Z("keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);/**
273
273
  * @license lucide-vue-next v1.0.0 - ISC
274
274
  *
275
275
  * This source code is licensed under the ISC license.
276
276
  * See the LICENSE file in the root directory of this source tree.
277
- */const Zb=Z("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
277
+ */const Qb=Z("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
278
278
  * @license lucide-vue-next v1.0.0 - ISC
279
279
  *
280
280
  * This source code is licensed under the ISC license.
281
281
  * See the LICENSE file in the root directory of this source tree.
282
- */const Qb=Z("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
282
+ */const Yb=Z("layout-template",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
283
283
  * @license lucide-vue-next v1.0.0 - ISC
284
284
  *
285
285
  * This source code is licensed under the ISC license.
@@ -294,12 +294,12 @@
294
294
  *
295
295
  * This source code is licensed under the ISC license.
296
296
  * See the LICENSE file in the root directory of this source tree.
297
- */const Yb=Z("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);/**
297
+ */const e0=Z("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]);/**
298
298
  * @license lucide-vue-next v1.0.0 - ISC
299
299
  *
300
300
  * This source code is licensed under the ISC license.
301
301
  * See the LICENSE file in the root directory of this source tree.
302
- */const e0=Z("list-indent-increase",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]]);/**
302
+ */const t0=Z("list-indent-increase",[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]]);/**
303
303
  * @license lucide-vue-next v1.0.0 - ISC
304
304
  *
305
305
  * This source code is licensed under the ISC license.
@@ -309,7 +309,7 @@
309
309
  *
310
310
  * This source code is licensed under the ISC license.
311
311
  * See the LICENSE file in the root directory of this source tree.
312
- */const t0=Z("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
312
+ */const n0=Z("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
313
313
  * @license lucide-vue-next v1.0.0 - ISC
314
314
  *
315
315
  * This source code is licensed under the ISC license.
@@ -324,27 +324,27 @@
324
324
  *
325
325
  * This source code is licensed under the ISC license.
326
326
  * See the LICENSE file in the root directory of this source tree.
327
- */const n0=Z("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
327
+ */const i0=Z("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
328
328
  * @license lucide-vue-next v1.0.0 - ISC
329
329
  *
330
330
  * This source code is licensed under the ISC license.
331
331
  * See the LICENSE file in the root directory of this source tree.
332
- */const i0=Z("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
332
+ */const r0=Z("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
333
333
  * @license lucide-vue-next v1.0.0 - ISC
334
334
  *
335
335
  * This source code is licensed under the ISC license.
336
336
  * See the LICENSE file in the root directory of this source tree.
337
- */const r0=Z("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);/**
337
+ */const a0=Z("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);/**
338
338
  * @license lucide-vue-next v1.0.0 - ISC
339
339
  *
340
340
  * This source code is licensed under the ISC license.
341
341
  * See the LICENSE file in the root directory of this source tree.
342
- */const a0=Z("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);/**
342
+ */const o0=Z("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);/**
343
343
  * @license lucide-vue-next v1.0.0 - ISC
344
344
  *
345
345
  * This source code is licensed under the ISC license.
346
346
  * See the LICENSE file in the root directory of this source tree.
347
- */const o0=Z("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);/**
347
+ */const s0=Z("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);/**
348
348
  * @license lucide-vue-next v1.0.0 - ISC
349
349
  *
350
350
  * This source code is licensed under the ISC license.
@@ -354,7 +354,7 @@
354
354
  *
355
355
  * This source code is licensed under the ISC license.
356
356
  * See the LICENSE file in the root directory of this source tree.
357
- */const s0=Z("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
357
+ */const l0=Z("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
358
358
  * @license lucide-vue-next v1.0.0 - ISC
359
359
  *
360
360
  * This source code is licensed under the ISC license.
@@ -364,17 +364,17 @@
364
364
  *
365
365
  * This source code is licensed under the ISC license.
366
366
  * See the LICENSE file in the root directory of this source tree.
367
- */const l0=Z("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/**
367
+ */const c0=Z("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);/**
368
368
  * @license lucide-vue-next v1.0.0 - ISC
369
369
  *
370
370
  * This source code is licensed under the ISC license.
371
371
  * See the LICENSE file in the root directory of this source tree.
372
- */const c0=Z("navigation-2",[["polygon",{points:"12 2 19 21 12 17 5 21 12 2",key:"x8c0qg"}]]);/**
372
+ */const u0=Z("navigation-2",[["polygon",{points:"12 2 19 21 12 17 5 21 12 2",key:"x8c0qg"}]]);/**
373
373
  * @license lucide-vue-next v1.0.0 - ISC
374
374
  *
375
375
  * This source code is licensed under the ISC license.
376
376
  * See the LICENSE file in the root directory of this source tree.
377
- */const u0=Z("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
377
+ */const d0=Z("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);/**
378
378
  * @license lucide-vue-next v1.0.0 - ISC
379
379
  *
380
380
  * This source code is licensed under the ISC license.
@@ -389,12 +389,12 @@
389
389
  *
390
390
  * This source code is licensed under the ISC license.
391
391
  * See the LICENSE file in the root directory of this source tree.
392
- */const d0=Z("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
392
+ */const f0=Z("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
393
393
  * @license lucide-vue-next v1.0.0 - ISC
394
394
  *
395
395
  * This source code is licensed under the ISC license.
396
396
  * See the LICENSE file in the root directory of this source tree.
397
- */const f0=Z("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
397
+ */const p0=Z("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
398
398
  * @license lucide-vue-next v1.0.0 - ISC
399
399
  *
400
400
  * This source code is licensed under the ISC license.
@@ -414,7 +414,7 @@
414
414
  *
415
415
  * This source code is licensed under the ISC license.
416
416
  * See the LICENSE file in the root directory of this source tree.
417
- */const p0=Z("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
417
+ */const m0=Z("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
418
418
  * @license lucide-vue-next v1.0.0 - ISC
419
419
  *
420
420
  * This source code is licensed under the ISC license.
@@ -429,17 +429,17 @@
429
429
  *
430
430
  * This source code is licensed under the ISC license.
431
431
  * See the LICENSE file in the root directory of this source tree.
432
- */const m0=Z("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
432
+ */const h0=Z("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
433
433
  * @license lucide-vue-next v1.0.0 - ISC
434
434
  *
435
435
  * This source code is licensed under the ISC license.
436
436
  * See the LICENSE file in the root directory of this source tree.
437
- */const h0=Z("remove-formatting",[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]]);/**
437
+ */const b0=Z("remove-formatting",[["path",{d:"M4 7V4h16v3",key:"9msm58"}],["path",{d:"M5 20h6",key:"1h6pxn"}],["path",{d:"M13 4 8 20",key:"kqq6aj"}],["path",{d:"m15 15 5 5",key:"me55sn"}],["path",{d:"m20 15-5 5",key:"11p7ol"}]]);/**
438
438
  * @license lucide-vue-next v1.0.0 - ISC
439
439
  *
440
440
  * This source code is licensed under the ISC license.
441
441
  * See the LICENSE file in the root directory of this source tree.
442
- */const b0=Z("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);/**
442
+ */const g0=Z("reply",[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}],["path",{d:"m9 17-5-5 5-5",key:"nvlc11"}]]);/**
443
443
  * @license lucide-vue-next v1.0.0 - ISC
444
444
  *
445
445
  * This source code is licensed under the ISC license.
@@ -449,22 +449,22 @@
449
449
  *
450
450
  * This source code is licensed under the ISC license.
451
451
  * See the LICENSE file in the root directory of this source tree.
452
- */const g0=Z("ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
452
+ */const v0=Z("ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
453
453
  * @license lucide-vue-next v1.0.0 - ISC
454
454
  *
455
455
  * This source code is licensed under the ISC license.
456
456
  * See the LICENSE file in the root directory of this source tree.
457
- */const v0=Z("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
457
+ */const x0=Z("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
458
458
  * @license lucide-vue-next v1.0.0 - ISC
459
459
  *
460
460
  * This source code is licensed under the ISC license.
461
461
  * See the LICENSE file in the root directory of this source tree.
462
- */const x0=Z("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
462
+ */const y0=Z("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/**
463
463
  * @license lucide-vue-next v1.0.0 - ISC
464
464
  *
465
465
  * This source code is licensed under the ISC license.
466
466
  * See the LICENSE file in the root directory of this source tree.
467
- */const y0=Z("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
467
+ */const k0=Z("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
468
468
  * @license lucide-vue-next v1.0.0 - ISC
469
469
  *
470
470
  * This source code is licensed under the ISC license.
@@ -479,12 +479,12 @@
479
479
  *
480
480
  * This source code is licensed under the ISC license.
481
481
  * See the LICENSE file in the root directory of this source tree.
482
- */const k0=Z("separator-horizontal",[["path",{d:"m16 16-4 4-4-4",key:"3dv8je"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"m8 8 4-4 4 4",key:"2bscm2"}]]);/**
482
+ */const w0=Z("separator-horizontal",[["path",{d:"m16 16-4 4-4-4",key:"3dv8je"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"m8 8 4-4 4 4",key:"2bscm2"}]]);/**
483
483
  * @license lucide-vue-next v1.0.0 - ISC
484
484
  *
485
485
  * This source code is licensed under the ISC license.
486
486
  * See the LICENSE file in the root directory of this source tree.
487
- */const w0=Z("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
487
+ */const _0=Z("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
488
488
  * @license lucide-vue-next v1.0.0 - ISC
489
489
  *
490
490
  * This source code is licensed under the ISC license.
@@ -494,17 +494,17 @@
494
494
  *
495
495
  * This source code is licensed under the ISC license.
496
496
  * See the LICENSE file in the root directory of this source tree.
497
- */const _0=Z("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
497
+ */const S0=Z("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
498
498
  * @license lucide-vue-next v1.0.0 - ISC
499
499
  *
500
500
  * This source code is licensed under the ISC license.
501
501
  * See the LICENSE file in the root directory of this source tree.
502
- */const S0=Z("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
502
+ */const C0=Z("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
503
503
  * @license lucide-vue-next v1.0.0 - ISC
504
504
  *
505
505
  * This source code is licensed under the ISC license.
506
506
  * See the LICENSE file in the root directory of this source tree.
507
- */const C0=Z("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);/**
507
+ */const E0=Z("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);/**
508
508
  * @license lucide-vue-next v1.0.0 - ISC
509
509
  *
510
510
  * This source code is licensed under the ISC license.
@@ -519,7 +519,7 @@
519
519
  *
520
520
  * This source code is licensed under the ISC license.
521
521
  * See the LICENSE file in the root directory of this source tree.
522
- */const E0=Z("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
522
+ */const A0=Z("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
523
523
  * @license lucide-vue-next v1.0.0 - ISC
524
524
  *
525
525
  * This source code is licensed under the ISC license.
@@ -529,12 +529,12 @@
529
529
  *
530
530
  * This source code is licensed under the ISC license.
531
531
  * See the LICENSE file in the root directory of this source tree.
532
- */const A0=Z("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
532
+ */const T0=Z("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/**
533
533
  * @license lucide-vue-next v1.0.0 - ISC
534
534
  *
535
535
  * This source code is licensed under the ISC license.
536
536
  * See the LICENSE file in the root directory of this source tree.
537
- */const T0=Z("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
537
+ */const N0=Z("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
538
538
  * @license lucide-vue-next v1.0.0 - ISC
539
539
  *
540
540
  * This source code is licensed under the ISC license.
@@ -589,26 +589,26 @@
589
589
  *
590
590
  * This source code is licensed under the ISC license.
591
591
  * See the LICENSE file in the root directory of this source tree.
592
- */const N0=Z("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
592
+ */const O0=Z("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
593
593
  * @license lucide-vue-next v1.0.0 - ISC
594
594
  *
595
595
  * This source code is licensed under the ISC license.
596
596
  * See the LICENSE file in the root directory of this source tree.
597
- */const Wt=Z("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),O0=["title"],Qs=s.defineComponent({__name:"ThemeToggle",setup(e){const{isDark:t,toggle:n}=Ro(),{t:i}=ht();return(r,a)=>(s.openBlock(),s.createElementBlock("button",{type:"button",class:"p-2 rounded-lg border border-slate-200 bg-slate-50 text-slate-500 transition-colors hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200",title:s.unref(t)?s.unref(i)("theme.lightMode"):s.unref(i)("theme.darkMode"),onClick:a[0]||(a[0]=(...o)=>s.unref(n)&&s.unref(n)(...o))},[s.unref(t)?(s.openBlock(),s.createBlock(s.unref(T0),{key:0,class:"h-4 w-4"})):(s.openBlock(),s.createBlock(s.unref(l0),{key:1,class:"h-4 w-4"}))],8,O0))}}),M0="data:image/png;base64,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",D0="data:image/png;base64,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",z0={class:"sticky top-0 z-40 flex h-14 flex-col border-b border-slate-200 bg-white transition-colors duration-200 dark:border-slate-800 dark:bg-[#0b1120]"},I0={class:"flex h-full w-full items-center justify-between gap-4 px-3 md:px-4"},R0={class:"flex items-center gap-3"},L0=["title"],B0=["src"],P0={class:"flex min-w-0 flex-col gap-0.5"},F0={class:"flex items-center gap-1.5"},V0=["title"],U0=["title"],H0={class:"header-menu-container hidden items-center gap-0 md:flex"},q0=["onClick","onMouseenter"],j0={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[220px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top left"}},$0={key:0,class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},W0=["onMouseenter"],G0={type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5"},K0={class:"flex items-center gap-2.5"},X0={key:0,class:"absolute left-full top-0 z-50 ml-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200"},J0=["onClick"],Z0={class:"flex items-center gap-2.5"},Q0={key:0,class:"rounded bg-slate-100 px-1 py-0.5 text-[9px] font-mono text-slate-500 dark:bg-slate-700 dark:text-slate-400"},Y0={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},eg=["onClick"],tg={class:"flex items-center gap-2.5"},ng={key:0,class:"text-blue-600 dark:text-blue-400"},ig={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},rg={class:"flex flex-shrink-0 items-center gap-1.5"},ag={key:0,class:"hidden items-center gap-2 lg:flex"},og={class:"flex -space-x-1.5 overflow-hidden"},sg=["title"],lg={class:"drop-shadow-sm"},cg=["title"],ug={class:"hidden xl:block"},dg={class:"hidden sm:inline"},fg={class:"header-user-container relative flex-shrink-0"},pg=["title"],mg=["src","alt"],hg={key:1,class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 text-xs font-bold text-white"},bg={class:"hidden max-w-[140px] truncate text-sm font-medium text-slate-700 dark:text-slate-200 sm:inline"},gg={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},vg={class:"border-b border-slate-100 px-4 py-2 dark:border-slate-700/80"},xg={class:"truncate text-sm font-semibold text-slate-800 dark:text-slate-100"},yg={class:"header-more-container relative xl:hidden"},kg={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[210px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},wg={class:"flex items-center justify-between px-4 py-2"},Of=s.defineComponent({__name:"HeaderBar",props:{title:{default:"Untitled Document"},editable:{type:Boolean,default:!0},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},pageless:{type:Boolean,default:!1},outlineOpen:{type:Boolean,default:!1},showRuler:{type:Boolean,default:!0},focusMode:{type:Boolean,default:!1},currentUserId:{default:""},simulatorsActive:{type:Boolean,default:!1},userName:{default:""},userAvatar:{default:""}},emits:["back","update:title","toggle-star","toggle-simulators","export","share","menu-click"],setup(e,{emit:t}){const{setLocale:n,t:i}=ht(),{isDark:r}=Ro(),a=hf(),o=e,l=t,c=s.ref(!1),u=s.ref(o.title),f=s.ref(null),m=s.ref(null),p=s.ref(!1);s.watch(()=>o.title,R=>{u.value=R});const h=async()=>{var R,N;c.value=!0,await s.nextTick(),(R=f.value)==null||R.focus(),(N=f.value)==null||N.select()},g=()=>{const R=u.value.trim();R&&R!==o.title&&l("update:title",R),u.value=o.title,c.value=!1},b=s.computed(()=>r.value?M0:D0),y=R=>R.split(" ").map(N=>N[0]).join("").slice(0,2).toUpperCase(),v=R=>{l("export",R),m.value=null},x=s.computed(()=>y(o.userName)||"?"),k=s.ref(!1),w=typeof navigator<"u"&&/mac/i.test(navigator.platform);function S(R){return w?`⌘${R}`:`Ctrl+${R.replace("⇧","Shift+")}`}const A=s.computed(()=>({File:{label:i("header.file"),items:[{label:i("header.new"),icon:su,sub:[{label:i("header.newDocument"),action:"new-doc",icon:su},{label:i("header.helpMeCreate"),action:"new-help-me-create",icon:Un},{label:i("header.fromTemplate"),action:"new-from-template",icon:Qb}]},{label:i("header.open"),action:"open-doc",icon:Hb},{label:i("header.makeACopy"),action:"duplicate",icon:$s},{label:"divider",divider:!0},{label:i("header.share"),action:"share",icon:pu},{label:i("header.email"),action:"email",icon:Ws},{label:i("header.download"),icon:Pb,sub:[{label:i("header.docx"),action:"export:docx",badge:"DOCX",icon:dt},{label:i("header.pdf"),action:"export:pdf",badge:"PDF",icon:dt},{label:i("header.odt"),action:"export:odt",badge:"ODT",icon:dt},{label:i("header.txt"),action:"export:txt",badge:"TXT",icon:dt},{label:i("header.rtf"),action:"export:rtf",badge:"RTF",icon:dt},{label:i("header.htmlZip"),action:"export:html-zip",badge:"ZIP",icon:dt},{label:i("header.html"),action:"export:html",badge:"HTML",icon:dt},{label:i("header.markdown"),action:"export:markdown",badge:"MD",icon:dt}]},{label:"divider",divider:!0},{label:i("header.rename"),action:"rename",icon:jl},{label:i("header.move"),action:"move",icon:Ub},{label:i("header.addToStarred"),action:"add-to-starred",icon:mu},{label:i("header.moveToTrash"),action:"trash",icon:kr},{label:"divider",divider:!0},{label:i("header.versionHistory"),action:"version-history",icon:Ul},{label:"divider",divider:!0},{label:i("header.details"),action:"details",icon:Xb},{label:i("header.security"),action:"security",icon:S0},{label:"divider",divider:!0},{label:i("header.language"),icon:Zb,sub:a.map(R=>({label:mf(R),action:`set-locale:${R}`}))},{label:i("header.pageSetup"),action:"page-setup",icon:w0},{label:i("header.print"),action:"print",icon:Cf}]},Edit:{label:i("header.edit"),items:[{label:i("header.undo"),action:"undo",shortcut:S("Z"),icon:Nf},{label:i("header.redo"),action:"redo",shortcut:S("Y"),icon:Ef},{label:"divider",divider:!0},{label:i("header.cut"),action:"cut",shortcut:S("X"),icon:x0},{label:i("header.copy"),action:"copy",shortcut:S("C"),icon:$s},{label:i("header.paste"),action:"paste",shortcut:S("V"),icon:ou},{label:i("header.pasteWithoutFormatting"),action:"paste-without-formatting",shortcut:S("⇧V"),icon:ou},{label:"divider",divider:!0},{label:i("header.selectAll"),action:"select-all",shortcut:S("A"),icon:yr},{label:i("header.delete"),action:"delete",icon:kr},{label:"divider",divider:!0},{label:i("header.findAndReplace"),action:"find-replace",shortcut:S("⇧H"),icon:xr}]},View:{label:i("header.view"),items:[{label:i("header.showSidebar"),action:"toggle-left-sidebar",checked:o.outlineOpen,icon:d0},{label:"divider",divider:!0},{label:i("header.focusMode"),action:"toggle-focus-mode",checked:o.focusMode,icon:i0},{label:i("header.showRuler"),action:"toggle-ruler",checked:o.showRuler,icon:g0}]},Insert:{label:i("header.insert"),items:[{label:i("header.meetingNotes"),action:"meeting-notes",icon:u0},{label:i("header.emailDraft"),action:"email-draft",icon:Ws},{label:"divider",divider:!0},{label:i("header.image"),action:"insert-image",icon:Gb},{label:i("header.table"),action:"insert-table",icon:Tf},{label:i("header.codeBlock"),action:"insert-code",icon:Lb},{label:i("header.horizontalLine"),action:"horizontal-line",icon:Gs},{label:"divider",divider:!0},{label:i("header.link"),action:"insert-link",shortcut:S("K"),icon:ql},{label:"divider",divider:!0},{label:i("header.smartElements"),icon:Un,sub:[{label:i("header.dateChip"),action:"insert-date-chip",icon:Vl},{label:i("header.peopleChip"),action:"insert-people-chip",icon:us},{label:i("header.fileChip"),action:"insert-file-chip",icon:dt},{label:i("header.dropdownChip"),action:"insert-dropdown-chip",icon:en},{label:i("header.locationChip"),action:"insert-location-chip",icon:n0}]},{label:"divider",divider:!0},{label:i("header.break"),icon:k0,sub:[{label:i("header.pageBreak"),action:"insert-page-break",shortcut:i("header.pageBreakShortcut"),icon:Gs}]},{label:"divider",divider:!0},{label:i("header.header"),action:"insert-header",icon:lu},{label:i("header.footer"),action:"insert-footer",icon:du},{label:i("header.footnote"),action:"insert-footnote",icon:Vn},{label:i("header.tableOfContents"),action:"insert-toc",icon:Vn},{label:"divider",divider:!0},{label:i("header.pageNumbers"),icon:Ua,sub:[{label:i("header.pageNumberInHeader"),action:"page-numbers-header",icon:lu},{label:i("header.pageNumberInFooter"),action:"page-numbers-footer",icon:du}]}]},Format:{label:i("header.format"),items:[{label:i("header.bold"),action:"bold",icon:Fl},{label:i("header.italic"),action:"italic",icon:Hl},{label:i("header.underline"),action:"underline",icon:$l},{label:"divider",divider:!0},{label:i("header.heading1"),action:"heading1",icon:xf},{label:i("header.heading2"),action:"heading2",icon:yf},{label:i("header.heading3"),action:"heading3",icon:kf},{label:"divider",divider:!0},{label:i("header.alignIndent"),icon:e0,sub:[{label:i("header.alignLeft"),action:"align-left",icon:yr},{label:i("header.alignCenter"),action:"align-center",icon:Xs},{label:i("header.alignRight"),action:"align-right",icon:Js},{label:i("header.alignJustify"),action:"align-justify",icon:Zs}]},{label:i("header.bulletsNumbering"),icon:Vn,sub:[{label:i("header.bulletList"),action:"bullet-list",icon:Vn},{label:i("header.numberedList"),action:"numbered-list",icon:_f},{label:i("header.taskList"),action:"task-list",icon:Yb}]},{label:"divider",divider:!0},{label:i("header.pagelessFormat"),action:"toggle-pageless",checked:o.pageless,icon:y0},{label:"divider",divider:!0},{label:i("header.clearFormatting"),action:"clear-formatting",icon:h0}]},Tools:{label:i("header.tools"),items:[{label:i("header.spellCheck"),action:"spellcheck",icon:Af},{label:i("header.wordCount"),action:"word-count",icon:Ua},{label:"divider",divider:!0},{label:i("header.preferences"),action:"preferences",icon:C0}]},Extensions:{label:i("header.extensions"),items:[{label:i("header.manageExtensions"),action:"manage-extensions",icon:p0}]},Help:{label:i("header.help"),items:[{label:i("header.keyboardShortcuts"),action:"keyboard-shortcuts",icon:Jb},{label:"divider",divider:!0},{label:i("header.reportIssue"),action:"report-issue",icon:Tb},{label:i("header.about"),action:"about",icon:Ib}]}})),I=s.computed(()=>Object.keys(A.value)),_=s.ref(null),E=R=>{const N=m.value!==R;m.value=N?R:null,_.value=null,p.value=N},z=s.ref(!1),P=()=>{z.value=!z.value},U=s.ref(!1),V=R=>{n(R),U.value=!1},B=s.ref(!1),j=()=>{B.value=!B.value},$=R=>{if(R.startsWith("export:")){const N=R.replace("export:","");v(N)}else if(R==="share")l("share"),m.value=null;else if(R==="add-to-starred")l("toggle-star"),m.value=null;else if(R==="rename")h(),m.value=null;else if(R.startsWith("set-locale:")){const N=R.replace("set-locale:","");V(N)}else l("menu-click",R);_.value=null,p.value=!1},Y=R=>{const N=R.target;N.closest(".header-menu-container")||(m.value=null,_.value=null,p.value=!1),N.closest(".header-more-container")||(z.value=!1),N.closest(".header-user-container")||(B.value=!1)};function W(R){p.value&&m.value!==R&&(m.value=R,_.value=null)}function oe(R){m.value&&R.key==="Escape"&&(m.value=null,_.value=null,p.value=!1)}return s.onMounted(()=>{document.addEventListener("click",Y,!0),document.addEventListener("keydown",oe)}),s.onUnmounted(()=>{document.removeEventListener("click",Y,!0),document.removeEventListener("keydown",oe)}),(R,N)=>(s.openBlock(),s.createElementBlock("header",z0,[s.createElementVNode("div",I0,[s.createElementVNode("div",R0,[s.createElementVNode("button",{type:"button",class:"flex h-9 cursor-pointer items-center justify-center hover:opacity-90 transition-opacity",title:s.unref(i)("header.backToDocuments"),onClick:N[0]||(N[0]=L=>l("back"))},[s.createElementVNode("img",{src:b.value,alt:"Docflow",class:"h-9 w-auto"},null,8,B0)],8,L0),s.createElementVNode("div",P0,[s.createElementVNode("div",F0,[c.value?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,ref_key:"titleInputEl",ref:f,"onUpdate:modelValue":N[1]||(N[1]=L=>u.value=L),type:"text",class:"min-w-[150px] border-b-2 border-cyan-500 bg-transparent px-1 py-0 text-sm font-semibold text-slate-800 focus:outline-none dark:text-slate-100 md:min-w-[240px]",onBlur:g,onKeydown:s.withKeys(g,["enter"])},null,544)),[[s.vModelText,u.value]]):(s.openBlock(),s.createElementBlock("h1",{key:1,class:"max-w-[180px] cursor-text truncate rounded px-1 py-0 text-sm font-semibold text-slate-800 hover:bg-slate-50 dark:text-slate-100 dark:hover:bg-slate-800/60 md:max-w-[280px]",title:s.unref(i)("header.clickToRename"),onClick:N[2]||(N[2]=L=>void h())},s.toDisplayString(o.title),9,V0)),s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-400 transition-colors hover:text-amber-500",title:e.starred?s.unref(i)("header.unstarDocument"):s.unref(i)("header.starDocument"),onClick:N[3]||(N[3]=L=>l("toggle-star"))},[s.createVNode(s.unref(mu),{class:s.normalizeClass(["h-4 w-4",e.starred?"fill-amber-400 text-amber-500":""])},null,8,["class"])],8,U0)]),s.createElementVNode("nav",H0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,L=>(s.openBlock(),s.createElementBlock("div",{key:L,class:"relative"},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex items-center gap-0.5 rounded px-2 py-0.5 text-[13px] transition-colors",m.value===L?"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300":"text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800"]),onClick:s.withModifiers(D=>E(L),["stop"]),onMouseenter:D=>W(L)},s.toDisplayString(A.value[L].label),43,q0),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[m.value===L?(s.openBlock(),s.createElementBlock("div",j0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value[L].items,(D,K)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:K},[D.divider?(s.openBlock(),s.createElementBlock("div",$0)):D.sub?(s.openBlock(),s.createElementBlock("div",{key:1,class:"relative",onMouseenter:ne=>_.value=`${L}-${K}`,onMouseleave:N[4]||(N[4]=ne=>_.value=null)},[s.createElementVNode("button",G0,[s.createElementVNode("span",K0,[D.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(D.label),1)]),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 -rotate-90 text-slate-400"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-100 ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"transition-all duration-75 ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-2"},{default:s.withCtx(()=>[_.value===`${L}-${K}`?(s.openBlock(),s.createElementBlock("div",X0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.sub,ne=>(s.openBlock(),s.createElementBlock("button",{key:ne.action,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(ee=>$(ne.action),["stop"])},[s.createElementVNode("span",Z0,[ne.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(ne.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(ne.label),1)]),ne.badge?(s.openBlock(),s.createElementBlock("span",Q0,s.toDisplayString(ne.badge),1)):ne.shortcut?(s.openBlock(),s.createElementBlock("span",Y0,s.toDisplayString(ne.shortcut),1)):s.createCommentVNode("",!0)],8,J0))),128))])):s.createCommentVNode("",!0)]),_:2},1024)],40,W0)):(s.openBlock(),s.createElementBlock("button",{key:2,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(ne=>$(D.action),["stop"])},[s.createElementVNode("span",tg,[D.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(D.label),1)]),D.checked?(s.openBlock(),s.createElementBlock("span",ng,[s.createVNode(s.unref(Va),{class:"h-3.5 w-3.5"})])):D.shortcut?(s.openBlock(),s.createElementBlock("span",ig,s.toDisplayString(D.shortcut),1)):s.createCommentVNode("",!0)],8,eg))],64))),128))])):s.createCommentVNode("",!0)]),_:2},1024)]))),128))])])]),s.createElementVNode("div",rg,[e.collaborators.length>0?(s.openBlock(),s.createElementBlock("div",ag,[s.createElementVNode("div",og,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.collaborators,L=>(s.openBlock(),s.createElementBlock("div",{key:L.userId,class:"flex h-7 w-7 flex-shrink-0 cursor-help items-center justify-center rounded-full border-2 border-white text-[10px] font-bold text-white dark:border-slate-900",style:s.normalizeStyle({backgroundColor:L.color}),title:`${L.name} ${L.userId===e.currentUserId?"(You)":""} ${L.isTyping?"is typing...":""}`},[s.createElementVNode("span",lg,s.toDisplayString(y(L.name)),1)],12,sg))),128))])])):s.createCommentVNode("",!0),s.renderSlot(R.$slots,"actions"),e.editable?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:s.normalizeClass(["hidden h-8 w-8 items-center justify-center rounded-md transition-all xl:flex",e.simulatorsActive?"animate-pulse bg-emerald-600 text-white hover:bg-emerald-700":"text-indigo-600 hover:bg-slate-100 dark:text-indigo-300 dark:hover:bg-slate-800"]),title:s.unref(i)("header.sandbox"),onClick:N[5]||(N[5]=L=>l("toggle-simulators"))},[s.createVNode(s.unref(us),{class:"h-[18px] w-[18px]"})],10,cg)):s.createCommentVNode("",!0),s.createElementVNode("div",ug,[s.createVNode(Qs)]),s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-[13px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:N[6]||(N[6]=L=>l("share"))},[s.createVNode(s.unref(pu),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",dg,s.toDisplayString(s.unref(i)("header.share")),1)]),s.createElementVNode("div",fg,[s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-full py-0.5 pl-0.5 pr-1.5 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",title:e.userName,onClick:s.withModifiers(j,["stop"])},[e.userAvatar&&!k.value?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.userAvatar,alt:e.userName,referrerpolicy:"no-referrer",class:"h-7 w-7 flex-shrink-0 rounded-full object-cover",onError:N[7]||(N[7]=L=>k.value=!0)},null,40,mg)):(s.openBlock(),s.createElementBlock("span",hg,s.toDisplayString(x.value),1)),s.createElementVNode("span",bg,s.toDisplayString(e.userName||s.unref(i)("header.account")),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],8,pg),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[B.value?(s.openBlock(),s.createElementBlock("div",gg,[s.createElementVNode("div",vg,[s.createElementVNode("p",xg,s.toDisplayString(e.userName||s.unref(i)("header.account")),1)]),s.renderSlot(R.$slots,"user-menu",{close:()=>B.value=!1})])):s.createCommentVNode("",!0)]),_:3})]),s.createElementVNode("div",yg,[s.createElementVNode("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800",title:"More",onClick:s.withModifiers(P,["stop"])},[s.createVNode(s.unref(gf),{class:"h-[18px] w-[18px]"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[z.value?(s.openBlock(),s.createElementBlock("div",kg,[s.renderSlot(R.$slots,"overflow-actions",{close:()=>z.value=!1}),e.editable?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:N[8]||(N[8]=L=>{l("toggle-simulators"),z.value=!1})},[s.createVNode(s.unref(us),{class:"h-4 w-4 text-slate-400"}),s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.sandbox")),1)])):s.createCommentVNode("",!0),N[9]||(N[9]=s.createElementVNode("div",{class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},null,-1)),s.createElementVNode("div",wg,[s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.theme")),1),s.createVNode(Qs)])])):s.createCommentVNode("",!0)]),_:3})])])])]))}}),_g={class:"mb-3 grid grid-cols-10 gap-1.5"},Sg=["title","onClick"],Cg={class:"space-y-2"},Eg=["title","onClick"],Ag={class:"mt-3 border-t border-slate-100 pt-3 dark:border-slate-700"},Tg={class:"mb-2 text-[10px] font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400"},Ng={class:"flex items-center gap-2"},Og={class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 dark:border-slate-600"},hu=s.defineComponent({__name:"ColorPickerDropdown",props:{isOpen:{type:Boolean},activeColor:{},defaultColor:{},label:{}},emits:["select","reset","close"],setup(e,{emit:t}){const n=e,i=t,r=[["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#ffffff"],["#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],["#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],["#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd"],["#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"],["#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79"],["#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"],["#5b0f00","#660000","#783f04","#7f6000","#274e13","#0c343d","#1c4587","#073763","#20124d","#4a1130"]],a=s.ref("#000000"),o=s.ref(null);s.watch(()=>n.isOpen,m=>{m&&(a.value=n.activeColor||"#000000")});function l(m){i("select",m)}function c(){i("reset")}function u(){i("select",a.value)}function f(m){m.target===m.currentTarget&&i("close")}return(m,p)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"color-picker-dropdown absolute left-0 top-full z-50 mt-1.5 w-[272px] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-slate-700 dark:bg-[#0e1525]",onClick:f},[s.createElementVNode("div",_g,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r[0],h=>(s.openBlock(),s.createElementBlock("button",{key:h,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:h}),title:h,onClick:g=>l(h)},null,12,Sg))),128))]),s.createElementVNode("div",Cg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.slice(1),(h,g)=>(s.openBlock(),s.createElementBlock("div",{key:g,class:"grid grid-cols-10 gap-1.5"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h,b=>(s.openBlock(),s.createElementBlock("button",{key:b,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:b}),title:b,onClick:y=>l(b)},null,12,Eg))),128))]))),128))]),s.createElementVNode("div",Ag,[s.createElementVNode("div",Tg,s.toDisplayString(m.$props.label||"Custom"),1),s.createElementVNode("div",Ng,[s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-slate-50 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:hover:bg-slate-700",onClick:p[0]||(p[0]=h=>{var g;return(g=o.value)==null?void 0:g.click()})},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5 text-slate-600 dark:text-slate-300"})]),s.withDirectives(s.createElementVNode("input",{ref_key:"customInput",ref:o,"onUpdate:modelValue":p[1]||(p[1]=h=>a.value=h),type:"color",class:"sr-only",onChange:u},null,544),[[s.vModelText,a.value]]),s.createElementVNode("div",Og,[s.createElementVNode("div",{class:"h-4 w-4 rounded-full",style:s.normalizeStyle({backgroundColor:a.value})},null,4)]),s.createElementVNode("button",{type:"button",class:"ml-auto flex h-6 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:c},[s.createVNode(s.unref(jl),{class:"h-3 w-3"}),p[2]||(p[2]=s.createTextVNode(" Default ",-1))])])])])):s.createCommentVNode("",!0)}}),Mg={id:"editor-toolbar-row",class:"docs-editor-toolbar w-full border-b border-slate-200 bg-white py-1.5 text-slate-600 shadow-sm dark:border-slate-800 dark:bg-[#0b1120] dark:text-slate-300"},Dg={class:"flex min-h-9 w-full items-center gap-1 px-3 flex-nowrap"},zg=["title","aria-label","disabled"],Ig=["title","aria-label","disabled"],Rg=["title","aria-label"],Lg=["title","aria-label","disabled"],Bg=["title","aria-label"],Pg={class:"toolbar-dropdown relative flex-shrink-0"},Fg=["title","aria-label","disabled"],Vg={class:"truncate"},Ug={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},Hg=["disabled","onClick"],qg={class:"toolbar-dropdown relative flex-shrink-0"},jg=["title","aria-label","disabled"],$g={class:"truncate"},Wg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},Gg=["onClick"],Kg=["title","aria-label","disabled"],Xg=["value","title","aria-label","disabled","onKeydown"],Jg=["title","aria-label","disabled"],Zg=["title","aria-label","disabled","onClick"],Qg={key:1,class:"text-xs font-medium leading-none"},Yg={key:0,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},ev={key:1,class:"toolbar-dropdown relative flex-shrink-0"},tv=["title","aria-label","disabled"],nv={key:2,class:"toolbar-dropdown relative flex-shrink-0"},iv=["title","aria-label","disabled"],rv={key:3,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},av={key:4,class:"toolbar-dropdown relative flex-shrink-0"},ov=["title","aria-label","disabled"],sv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},lv=["disabled","onClick"],cv={key:5,class:"toolbar-dropdown relative flex-shrink-0"},uv=["title","aria-label","disabled"],dv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},fv=["disabled","onClick"],pv={key:6,class:"toolbar-dropdown relative flex-shrink-0"},mv=["title","aria-label","disabled"],hv={class:"hidden md:inline"},bv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[190px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},gv=["disabled","onClick"],vv=["title","aria-label"],xv=["title","aria-label"],yv=["title","aria-label"],kv=["title","aria-label"],wv=["title","aria-label"],_v="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Sv="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",St="docs-editor-toolbar__control inline-flex h-8 flex-shrink-0 items-center justify-center rounded-md p-1 text-slate-600 transition-all disabled:opacity-40 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",Cv="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Ev="text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",bu=11,Av=1,Tv=400,Mf=s.defineComponent({__name:"EditorToolbar",props:{actions:{},plugins:{},editor:{},activeSidebar:{}},emits:["toggle-sidebar","print","undo","redo","toggle-left-sidebar"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a={Bold:Fl,Italic:Hl,Underline:$l,Strikethrough:A0,Heading1:xf,Heading2:yf,Heading3:kf,Heading4:jb,Heading5:$b,Heading6:Wb,List:Vn,ListOrdered:_f,CheckSquare:E0,Quote:Ha,Link:wf,Code:Bb,Image:Kb,Table:Tf,AlignLeft:yr,AlignCenter:Xs,AlignRight:Js,AlignJustify:Zs,FileText:dt,Palette:uu,Highlighter:cu};function o(O){return O?a[O]??null:null}const l=s.computed(()=>{const O=[];for(const F of i.plugins??[])!F.toolbar||F.toolbar.length===0||O.push({pluginId:F.id,items:F.toolbar});return O}),c=s.ref(0);function u(){c.value++}s.watch(()=>i.editor,(O,F)=>{F&&F.off("transaction",u),O&&O.on("transaction",u)},{immediate:!0}),s.onUnmounted(()=>{i.editor&&i.editor.off("transaction",u)});function f(O){c.value;const F=i.editor;if(!F)return!1;switch(O.action){case"toggleBold":return F.isActive("bold");case"toggleItalic":return F.isActive("italic");case"toggleUnderline":return F.isActive("underline");case"toggleStrike":return F.isActive("strike");case"toggleHeading1":return F.isActive("heading",{level:1});case"toggleHeading2":return F.isActive("heading",{level:2});case"toggleHeading3":return F.isActive("heading",{level:3});case"toggleHeading4":return F.isActive("heading",{level:4});case"toggleHeading5":return F.isActive("heading",{level:5});case"toggleHeading6":return F.isActive("heading",{level:6});case"toggleBulletList":return F.isActive("bulletList");case"toggleOrderedList":return F.isActive("orderedList");case"toggleTaskList":return F.isActive("taskList");case"toggleBlockquote":return F.isActive("blockquote");case"toggleCodeBlock":return F.isActive("codeBlock");case"setLink":return F.isActive("link");case"alignLeft":return F.isActive({textAlign:"left"});case"alignCenter":return F.isActive({textAlign:"center"});case"alignRight":return F.isActive({textAlign:"right"});case"alignJustify":return F.isActive({textAlign:"justify"});default:return!1}}function m(O){if(!i.editor)return;const F=i.actions[O.action];if(typeof F=="function"){F(...O.args??[]),i.editor.commands.focus();return}const X=i.editor.commands[O.action];typeof X=="function"&&(X(...O.args??[]),i.editor.commands.focus())}const p=s.computed(()=>{var O;return c.value,(O=i.editor)==null?void 0:O.getAttributes("textStyle").color}),h=s.computed(()=>{var F,X;c.value;const O=(F=i.editor)==null?void 0:F.getAttributes("highlight");if(O!=null&&O.color)return O.color;if((X=i.editor)!=null&&X.isActive("highlight"))return"#ffff00"});function g(O,F){var ze,Xe,He;const X=i.actions[O];if(typeof X=="function")X(F);else{const un=(Xe=(ze=i.editor)==null?void 0:ze.commands)==null?void 0:Xe[O];typeof un=="function"&&un(F)}(He=i.editor)==null||He.commands.focus(),B.value=null}function b(O){var X,ze,Xe,He;const F=(X=i.editor)==null?void 0:X.chain().focus();if(!F){B.value=null;return}O==="setTextColor"?(ze=F.unsetColor)==null||ze.call(F).run():O==="setHighlight"&&((Xe=F.unsetHighlight)==null||Xe.call(F).run()),(He=i.editor)==null||He.commands.focus(),B.value=null}const y=["toggleHeading1","toggleHeading2","toggleHeading3","toggleHeading4","toggleHeading5","toggleHeading6"],v=["alignLeft","alignCenter","alignRight","alignJustify"],x=["toggleBulletList","toggleOrderedList","toggleTaskList"],k=["setLink","insertImage","insertTable","toggleBlockquote","toggleCodeBlock","insertFootnote","insertPageBreak","setPageBreak","togglePageBreak","addPageBreak"],w=["setTextColor","setHighlight"],S=s.computed(()=>l.value.flatMap(O=>O.items)),A=s.computed(()=>S.value.filter(O=>v.includes(O.action))),I=s.computed(()=>S.value.filter(O=>x.includes(O.action))),_=s.computed(()=>S.value.filter(O=>k.includes(O.action))),E=s.computed(()=>S.value.filter(O=>w.includes(O.action))),z=s.computed(()=>E.value.find(O=>O.action==="setTextColor")),P=s.computed(()=>E.value.find(O=>O.action==="setHighlight")),U=s.computed(()=>S.value.filter(O=>!y.includes(O.action)&&!v.includes(O.action)&&!x.includes(O.action)&&!k.includes(O.action)&&!w.includes(O.action))),V=s.computed(()=>{c.value;const O=i.editor;if(O){if(O.isActive({textAlign:"center"}))return Xs;if(O.isActive({textAlign:"right"}))return Js;if(O.isActive({textAlign:"justify"}))return Zs}return yr}),B=s.ref(null);function j(O){B.value=B.value===O?null:O}function $(O){m(O),B.value=null}function Y(O){O.target.closest(".toolbar-dropdown")||(B.value=null)}s.onMounted(()=>document.addEventListener("click",Y,!0)),s.onUnmounted(()=>document.removeEventListener("click",Y,!0));function W(O){return i.activeSidebar===O?Cv:Ev}const oe=s.computed(()=>{var O;return((O=i.plugins)==null?void 0:O.some(F=>F.id==="citation"))??!1}),R=s.computed(()=>{var O,F,X;return!!((X=(F=(O=i.editor)==null?void 0:O.storage)==null?void 0:F.editorContext)!=null&&X.aiStream)});function N(){i.editor&&(i.editor.commands.undo(),i.editor.commands.focus()),r("undo")}function L(){i.editor&&(i.editor.commands.redo(),i.editor.commands.focus()),r("redo")}function D(){r("print")}const K=s.computed(()=>[{value:"paragraph",label:n("toolbar.normalText")},{value:"heading-1",label:n("header.heading1")},{value:"heading-2",label:n("header.heading2")},{value:"heading-3",label:n("header.heading3")},{value:"heading-4",label:n("header.heading4")},{value:"heading-5",label:n("header.heading5")},{value:"heading-6",label:n("header.heading6")}]);function ne(O){const F=i.editor;if(F){if(O==="paragraph")F.commands.setParagraph();else{const X=parseInt(O.replace("heading-",""),10),ze=i.actions[`toggleHeading${X}`];typeof ze=="function"?ze():F.commands.toggleHeading({level:X})}F.commands.focus()}B.value=null}const ee=s.computed(()=>{c.value;const O=i.editor;if(!O)return"paragraph";for(let F=1;F<=6;F++)if(O.isActive("heading",{level:F}))return`heading-${F}`;return"paragraph"}),ie=s.computed(()=>{var O;return((O=K.value.find(F=>F.value===ee.value))==null?void 0:O.label)??n("toolbar.normalText")}),G=[{value:"arial",label:"Arial"},{value:"inter",label:"Inter"},{value:"serif",label:"Serif"},{value:"mono",label:"Monospace"}],H=s.ref("arial"),q=s.computed(()=>{var O;return((O=G.find(F=>F.value===H.value))==null?void 0:O.label)??"Arial"});function re(O){var F;H.value=O,B.value=null,(F=i.editor)==null||F.commands.focus()}const ce=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],fe=s.computed(()=>{var ze;c.value;const O=i.editor;if(!O)return bu;const F=O.getAttributes("textStyle");if(F!=null&&F.fontSize){const Xe=parseInt(F.fontSize,10);if(!isNaN(Xe))return Xe}const X=O.state.storedMarks;if(X){for(const Xe of X)if(Xe.type.name==="textStyle"&&Xe.attrs.fontSize){const He=parseInt(Xe.attrs.fontSize,10);if(!isNaN(He))return He}}if((ze=O.view)!=null&&ze.dom){const Xe=parseFloat(getComputedStyle(O.view.dom).fontSize);if(!isNaN(Xe)){const He=Math.round(Xe);return ce.reduce((Nn,Yn)=>Math.abs(Yn-He)<Math.abs(Nn-He)?Yn:Nn)}}return bu});function Oe(O){if(!i.editor)return;const F=fe.value,X=ce.indexOf(F);let ze;X>=0?ze=ce[Math.min(Math.max(X+O,0),ce.length-1)]:O<0?ze=[...ce].reverse().find(He=>He<F)??ce[0]:ze=ce.find(He=>He>F)??F,i.editor.commands.setFontSize(`${ze}px`),i.editor.commands.focus()}const pe=s.ref(null);function Se(O){pe.value=String(fe.value),O.target.select()}function ut(O){pe.value=O.target.value}function Jt(O){if(!i.editor)return;const F=Math.min(Math.max(O,Av),Tv);i.editor.commands.setFontSize(`${F}px`)}function Le(O){var X;const F=parseInt(O.target.value,10);!isNaN(F)&&F!==fe.value&&Jt(F),pe.value=null,(X=i.editor)==null||X.commands.focus()}function Ut(O){var X;pe.value=null;const F=O.target;F.value=String(fe.value),F.blur(),(X=i.editor)==null||X.commands.focus()}return(O,F)=>(s.openBlock(),s.createElementBlock("div",Mg,[s.createElementVNode("div",Dg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.undo"),"aria-label":s.unref(n)("toolbar.undo"),disabled:!e.editor,onMousedown:F[0]||(F[0]=s.withModifiers(()=>{},["prevent"])),onClick:N},[s.createVNode(s.unref(Nf),{class:"h-[18px] w-[18px]"})],42,zg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.redo"),"aria-label":s.unref(n)("toolbar.redo"),disabled:!e.editor,onMousedown:F[1]||(F[1]=s.withModifiers(()=>{},["prevent"])),onClick:L},[s.createVNode(s.unref(Ef),{class:"h-[18px] w-[18px]"})],42,Ig),F[39]||(F[39]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.print"),"aria-label":s.unref(n)("toolbar.print"),onMousedown:F[2]||(F[2]=s.withModifiers(()=>{},["prevent"])),onClick:D},[s.createVNode(s.unref(Cf),{class:"h-[18px] w-[18px]"})],42,Rg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.spelling"),"aria-label":s.unref(n)("toolbar.spelling"),disabled:!e.editor,onMousedown:F[3]||(F[3]=s.withModifiers(()=>{},["prevent"]))},[s.createVNode(s.unref(Af),{class:"h-[18px] w-[18px]"})],42,Lg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"px-2 text-xs"]),title:s.unref(n)("toolbar.zoom"),"aria-label":s.unref(n)("toolbar.zoom"),onMousedown:F[4]||(F[4]=s.withModifiers(()=>{},["prevent"]))},s.toDisplayString(s.unref(n)("toolbar.zoom")),43,Bg),F[40]||(F[40]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("div",Pg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-[116px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.paragraphStyle"),"aria-label":s.unref(n)("toolbar.paragraphStyle"),disabled:!e.editor,onMousedown:F[5]||(F[5]=s.withModifiers(()=>{},["prevent"])),onClick:F[6]||(F[6]=s.withModifiers(X=>j("heading"),["stop"]))},[s.createElementVNode("span",Vg,s.toDisplayString(ie.value),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,Fg),B.value==="heading"?(s.openBlock(),s.createElementBlock("div",Ug,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(K.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",ee.value===X.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[7]||(F[7]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>ne(X.value)},s.toDisplayString(X.label),43,Hg))),128))])):s.createCommentVNode("",!0)]),s.createElementVNode("div",qg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-[100px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.fontFamily"),"aria-label":s.unref(n)("toolbar.fontFamily"),disabled:!e.editor,onMousedown:F[8]||(F[8]=s.withModifiers(()=>{},["prevent"])),onClick:F[9]||(F[9]=s.withModifiers(X=>j("font"),["stop"]))},[s.createElementVNode("span",$g,s.toDisplayString(q.value),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,jg),B.value==="font"?(s.openBlock(),s.createElementBlock("div",Wg,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(G,X=>s.createElementVNode("button",{key:X.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",H.value===X.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),onMousedown:F[10]||(F[10]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>re(X.value)},s.toDisplayString(X.label),43,Gg)),64))])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-7 text-sm"]),title:s.unref(n)("toolbar.decreaseFontSize"),"aria-label":s.unref(n)("toolbar.decreaseFontSize"),disabled:!e.editor,onMousedown:F[11]||(F[11]=s.withModifiers(X=>Oe(-1),["prevent"]))},[s.createVNode(s.unref(Gs),{class:"h-3.5 w-3.5"})],42,Kg),s.createElementVNode("input",{type:"text",inputmode:"numeric",class:"h-8 w-8 flex-shrink-0 rounded border border-transparent bg-transparent text-center text-xs text-slate-700 outline-none transition hover:border-slate-300 focus:border-cyan-400 focus:bg-white disabled:opacity-40 dark:text-slate-200 dark:hover:border-slate-600 dark:focus:bg-slate-800",value:pe.value??String(fe.value),title:s.unref(n)("toolbar.fontSize"),"aria-label":s.unref(n)("toolbar.fontSize"),disabled:!e.editor,onFocus:Se,onInput:ut,onKeydown:[F[12]||(F[12]=s.withKeys(s.withModifiers(X=>X.target.blur(),["prevent"]),["enter"])),s.withKeys(s.withModifiers(Ut,["prevent"]),["esc"])],onBlur:Le},null,40,Xg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-7 text-sm"]),title:s.unref(n)("toolbar.increaseFontSize"),"aria-label":s.unref(n)("toolbar.increaseFontSize"),disabled:!e.editor,onMousedown:F[13]||(F[13]=s.withModifiers(X=>Oe(1),["prevent"]))},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5"})],42,Jg),F[41]||(F[41]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",title:X.label??X.id,"aria-label":X.label??X.id,class:s.normalizeClass(["docs-editor-toolbar__button inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md p-1 transition-all disabled:opacity-40",f(X)?_v:Sv]),disabled:!e.editor,onMousedown:F[14]||(F[14]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>m(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-[18px] w-[18px]"})):X.label?(s.openBlock(),s.createElementBlock("span",Qg,s.toDisplayString(X.label.charAt(0)),1)):s.createCommentVNode("",!0)],42,Zg))),128)),E.value.length?(s.openBlock(),s.createElementBlock("span",Yg)):s.createCommentVNode("",!0),z.value?(s.openBlock(),s.createElementBlock("div",ev,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:z.value.label??"Text color","aria-label":z.value.label??"Text color",disabled:!e.editor,onMousedown:F[15]||(F[15]=s.withModifiers(()=>{},["prevent"])),onClick:F[16]||(F[16]=s.withModifiers(X=>j("textColor"),["stop"]))},[s.createVNode(s.unref(uu),{class:"h-[18px] w-[18px]"})],42,tv),s.createVNode(hu,{"is-open":B.value==="textColor","active-color":p.value,label:"Custom",onSelect:F[17]||(F[17]=X=>g("setTextColor",X)),onReset:F[18]||(F[18]=X=>b("setTextColor")),onClose:F[19]||(F[19]=X=>B.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),P.value?(s.openBlock(),s.createElementBlock("div",nv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:P.value.label??"Highlight","aria-label":P.value.label??"Highlight",disabled:!e.editor,onMousedown:F[20]||(F[20]=s.withModifiers(()=>{},["prevent"])),onClick:F[21]||(F[21]=s.withModifiers(X=>j("highlight"),["stop"]))},[s.createVNode(s.unref(cu),{class:"h-[18px] w-[18px]"})],42,iv),s.createVNode(hu,{"is-open":B.value==="highlight","active-color":h.value,label:"Custom",onSelect:F[22]||(F[22]=X=>g("setHighlight",X)),onReset:F[23]||(F[23]=X=>b("setHighlight")),onClose:F[24]||(F[24]=X=>B.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),I.value.length||A.value.length||_.value.length?(s.openBlock(),s.createElementBlock("span",rv)):s.createCommentVNode("",!0),I.value.length?(s.openBlock(),s.createElementBlock("div",av,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.lists"),"aria-label":s.unref(n)("toolbar.lists"),disabled:!e.editor,onMousedown:F[25]||(F[25]=s.withModifiers(()=>{},["prevent"])),onClick:F[26]||(F[26]=s.withModifiers(X=>j("lists"),["stop"]))},[s.createVNode(s.unref(Vn),{class:"h-[18px] w-[18px]"}),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,ov),B.value==="lists"?(s.openBlock(),s.createElementBlock("div",sv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[27]||(F[27]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,lv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),A.value.length?(s.openBlock(),s.createElementBlock("div",cv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.alignment"),"aria-label":s.unref(n)("toolbar.alignment"),disabled:!e.editor,onMousedown:F[28]||(F[28]=s.withModifiers(()=>{},["prevent"])),onClick:F[29]||(F[29]=s.withModifiers(X=>j("align"),["stop"]))},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(V.value),{class:"h-[18px] w-[18px]"})),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,uv),B.value==="align"?(s.openBlock(),s.createElementBlock("div",dv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[30]||(F[30]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,fv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),_.value.length?(s.openBlock(),s.createElementBlock("div",pv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.insert"),"aria-label":s.unref(n)("toolbar.insert"),disabled:!e.editor,onMousedown:F[31]||(F[31]=s.withModifiers(()=>{},["prevent"])),onClick:F[32]||(F[32]=s.withModifiers(X=>j("insert"),["stop"]))},[s.createVNode(s.unref($n),{class:"h-4 w-4"}),s.createElementVNode("span",hv,s.toDisplayString(s.unref(n)("toolbar.insert")),1),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,mv),B.value==="insert"?(s.openBlock(),s.createElementBlock("div",bv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(_.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[33]||(F[33]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,gv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),F[42]||(F[42]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all relative",W("comments")]),title:s.unref(n)("toolbar.comments"),"aria-label":s.unref(n)("toolbar.comments"),onClick:F[34]||(F[34]=X=>r("toggle-sidebar","comments"))},[s.createVNode(s.unref(Sf),{class:"h-[18px] w-[18px]"})],10,vv),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("history")]),title:s.unref(n)("toolbar.history"),"aria-label":s.unref(n)("toolbar.history"),onClick:F[35]||(F[35]=X=>r("toggle-sidebar","history"))},[s.createVNode(s.unref(Ul),{class:"h-[18px] w-[18px]"})],10,xv),R.value?(s.openBlock(),s.createElementBlock("button",{key:7,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("ai")]),title:s.unref(n)("toolbar.ai"),"aria-label":s.unref(n)("toolbar.ai"),onClick:F[36]||(F[36]=X=>r("toggle-sidebar","ai"))},[s.createVNode(s.unref(Un),{class:"h-[18px] w-[18px]"})],10,yv)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("toc")]),title:s.unref(n)("toolbar.tableOfContents"),"aria-label":s.unref(n)("toolbar.tableOfContents"),onClick:F[37]||(F[37]=X=>r("toggle-sidebar","toc"))},[s.createVNode(s.unref(dt),{class:"h-[18px] w-[18px]"})],10,kv),oe.value?(s.openBlock(),s.createElementBlock("button",{key:8,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("references")]),title:s.unref(n)("toolbar.references"),"aria-label":s.unref(n)("toolbar.references"),onClick:F[38]||(F[38]=X=>r("toggle-sidebar","references"))},[s.createVNode(s.unref(js),{class:"h-[18px] w-[18px]"})],10,wv)):s.createCommentVNode("",!0)])]))}}),Nv={key:0,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-cyan-600 dark:text-cyan-400"},Ov=["title"],Mv=["disabled"],Dv=["onClick"],zv={key:0,class:"relative"},Iv={key:0,class:"absolute left-0 top-full z-10 mt-1 flex min-w-44 flex-col rounded-xl border border-slate-200 bg-white p-1 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]"},Rv=["onClick"],gu="bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold",Lv="text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white",Bv=s.defineComponent({__name:"BubbleMenu",props:{visible:{type:Boolean},actions:{},position:{},editor:{}},emits:["chat"],setup(e,{emit:t}){const n=e,i=t,r=s.ref(0),a=s.ref(!1);function o(){r.value++}s.watch(()=>n.editor,(v,x)=>{x&&x.off("transaction",o),v&&v.on("transaction",o)},{immediate:!0}),s.onUnmounted(()=>{n.editor&&n.editor.off("transaction",o)}),s.watch(r,()=>{a.value=!1});const l=s.computed(()=>{var v,x,k,w;return r.value,[{id:"bold",label:"Bold",action:"toggleBold",icon:Fl,active:(v=n.editor)==null?void 0:v.isActive("bold")},{id:"italic",label:"Italic",action:"toggleItalic",icon:Hl,active:(x=n.editor)==null?void 0:x.isActive("italic")},{id:"underline",label:"Underline",action:"toggleUnderline",icon:$l,active:(k=n.editor)==null?void 0:k.isActive("underline")},{id:"link",label:"Link",action:"setLink",icon:wf,active:(w=n.editor)==null?void 0:w.isActive("link")}]}),c=s.computed(()=>{var v,x,k;return r.value,!!((k=(x=(v=n.editor)==null?void 0:v.storage)==null?void 0:x.editorContext)!=null&&k.aiStream)}),u=s.computed(()=>{var v,x,k;return r.value,((k=(x=(v=n.editor)==null?void 0:v.storage)==null?void 0:x.ai)==null?void 0:k.preview)??null}),f=[{id:"rewrite",label:"Rewrite",action:"rewrite"},{id:"summarize",label:"Summarize",action:"summarize"},{id:"grammar",label:"Fix grammar",action:"grammar"},{id:"tone",label:"Make formal",action:"tone",prompt:"make it more formal"},{id:"translate",label:"Translate to English",action:"translate",prompt:"translate to English"},{id:"expand",label:"Expand",action:"expand"},{id:"shorten",label:"Shorten",action:"shorten"}];function m(){var v;return((v=n.editor)==null?void 0:v.commands)??null}function p(v){var x;a.value=!1,(x=m())==null||x.aiTransform({action:v.action,...v.prompt?{prompt:v.prompt}:{}})}function h(){var v;(v=m())==null||v.aiAccept()}function g(){var v;(v=m())==null||v.aiReject()}const b=s.computed(()=>n.position?{top:`${n.position.top}px`,left:`${n.position.left}px`}:{});function y(v){var k,w,S,A,I;if(v==="setLink"){if((k=n.editor)!=null&&k.isActive("link")){n.editor.chain().focus().unsetLink().run();return}const _=typeof window<"u"?window.prompt("Enter link URL:","https://"):null;if(_){const E=n.actions[v];typeof E=="function"?E({href:_,target:"_blank"}):(A=(S=(w=n.editor)==null?void 0:w.chain().focus()).setLink)==null||A.call(S,{href:_,target:"_blank"}).run()}return}const x=n.actions[v];if(typeof x=="function")x();else if(n.editor){const _=n.editor.chain().focus();(I=_[v])==null||I.call(_).run()}}return(v,x)=>e.visible?(s.openBlock(),s.createElementBlock("div",{key:0,"data-testid":"bubble-menu",class:"docs-editor-bubble-menu fixed z-50 flex gap-1 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]",style:s.normalizeStyle(b.value),onMousedown:x[2]||(x[2]=s.withModifiers(()=>{},["prevent"]))},[u.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[u.value.status==="streaming"?(s.openBlock(),s.createElementBlock("span",Nv,[s.createVNode(s.unref(t0),{class:"h-3.5 w-3.5 animate-spin"}),x[3]||(x[3]=s.createElementVNode("span",null,"AI writing…",-1))])):u.value.status==="error"?(s.openBlock(),s.createElementBlock("span",{key:1,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-red-600 dark:text-red-400",title:u.value.error},[s.createVNode(s.unref(Db),{class:"h-3.5 w-3.5"}),x[4]||(x[4]=s.createElementVNode("span",null,"AI error",-1))],8,Ov)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",disabled:u.value.status!=="done",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",u.value.status!=="done"?"cursor-not-allowed text-slate-300 dark:text-slate-600":"text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-500/10"]),title:"Accept (Enter)",onClick:h},[s.createVNode(s.unref(Va),{class:"h-3.5 w-3.5"}),x[5]||(x[5]=s.createElementVNode("span",null,"Accept",-1))],10,Mv),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all","text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10"]),title:"Reject (Esc)",onClick:g},[s.createVNode(s.unref(Wt),{class:"h-3.5 w-3.5"}),x[6]||(x[6]=s.createElementVNode("span",null,"Reject",-1))])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,k=>(s.openBlock(),s.createElementBlock("button",{key:k.id,type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",k.active?gu:Lv]),onClick:w=>y(k.action)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(k.icon),{class:"h-3.5 w-3.5"})),s.createElementVNode("span",null,s.toDisplayString(k.label),1)],10,Dv))),128)),c.value?(s.openBlock(),s.createElementBlock("div",zv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",a.value?gu:"text-cyan-600 hover:bg-cyan-50 dark:text-cyan-400 dark:hover:bg-cyan-500/10"]),onClick:x[0]||(x[0]=k=>a.value=!a.value)},[s.createVNode(s.unref(Un),{class:"h-3.5 w-3.5"}),x[7]||(x[7]=s.createElementVNode("span",null,"AI",-1))],2),a.value?(s.openBlock(),s.createElementBlock("div",Iv,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(f,k=>s.createElementVNode("button",{key:k.id,type:"button",class:"flex items-center gap-2 rounded-lg px-3 py-1.5 text-left text-xs font-semibold text-slate-600 transition-all hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/5 dark:hover:text-white",onClick:w=>p(k)},[s.createElementVNode("span",null,s.toDisplayString(k.label),1)],8,Rv)),64))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),c.value?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",title:"Chat (⌘L / Ctrl+L)",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all","text-violet-600 hover:bg-violet-50 dark:text-violet-400 dark:hover:bg-violet-500/10"]),"data-testid":"bubble-chat",onClick:x[1]||(x[1]=k=>{a.value=!1,i("chat")})},[s.createVNode(s.unref(o0),{class:"h-3.5 w-3.5"}),x[8]||(x[8]=s.createElementVNode("span",null,"Chat",-1))])):s.createCommentVNode("",!0)],64))],36)):s.createCommentVNode("",!0)}}),Df=Pl(Bv,[["__scopeId","data-v-d407c8e2"]]),Pv={id:"editor-footer-row",class:"flex h-9 flex-shrink-0 items-center justify-between border-t border-slate-200 bg-white px-4 font-sans text-[11px] text-slate-400 dark:border-slate-800 dark:bg-[#0b1120]"},Fv={class:"flex items-center gap-2"},Vv={class:"flex items-center gap-1 font-bold"},Uv={key:0,class:"relative mr-1 flex h-2 w-2"},Hv={key:1,class:"relative mr-1 flex h-2 w-2"},qv={key:2,class:"font-mono text-[10px] uppercase tracking-wide text-emerald-600 dark:text-cyan-400"},jv={key:3,class:"font-mono text-[10px] uppercase tracking-wide text-amber-600 dark:text-amber-500"},$v={class:"flex items-center gap-1.5 font-sans text-[11px] font-medium text-slate-500 dark:text-slate-400"},Wv={key:0,class:"animate-pulse font-semibold text-cyan-600 dark:text-cyan-400"},Gv={key:1,class:"font-semibold text-amber-600 dark:text-amber-500"},Kv={key:2,class:"flex items-center gap-1"},Xv={class:"rounded bg-slate-100 px-1.5 py-0.5 font-mono text-[10px] text-slate-700 dark:bg-white/5 dark:text-slate-300"},Jv={class:"flex items-center gap-3 font-semibold text-slate-400 dark:text-slate-500"},Zv=["value","title","aria-label"],Qv=["value"],Yv={key:0,class:"font-medium text-slate-500 dark:text-slate-400"},e1={key:1},t1={class:"font-mono text-slate-600 dark:text-slate-300"},n1={class:"font-mono text-slate-600 dark:text-slate-300"},i1={class:"font-mono text-slate-600 dark:text-slate-300"},r1={class:"font-mono text-slate-600 dark:text-slate-300"},zf=s.defineComponent({__name:"StatusBar",props:{connectionState:{default:"connected"},savingStatus:{default:"saved"},lastSaved:{default:void 0},wordCount:{default:0},charCount:{default:0},pageCount:{default:1},currentPage:{default:1},pageSize:{default:"a4"},pageSizes:{default:()=>[]},pageless:{type:Boolean,default:!1}},emits:["update:pageSize"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.computed(()=>i.lastSaved?new Date(i.lastSaved).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):n("statusBar.never")),o=s.computed(()=>{var l,c;return((c=(l=i.pageSizes)==null?void 0:l.find(u=>u.id===i.pageSize))==null?void 0:c.name)??i.pageSize.toUpperCase()});return(l,c)=>(s.openBlock(),s.createElementBlock("footer",Pv,[s.createElementVNode("div",Fv,[s.createElementVNode("span",Vv,[e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",Uv,[...c[1]||(c[1]=[s.createElementVNode("span",{class:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"},null,-1),s.createElementVNode("span",{class:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"},null,-1)])])):(s.openBlock(),s.createElementBlock("span",Hv,[...c[2]||(c[2]=[s.createElementVNode("span",{class:"h-2 w-2 animate-spin rounded-full border border-amber-500 border-t-transparent"},null,-1)])])),e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",qv,s.toDisplayString(s.unref(n)("statusBar.liveSyncActive")),1)):(s.openBlock(),s.createElementBlock("span",jv,s.toDisplayString(s.unref(n)("statusBar.connecting")),1))]),c[3]||(c[3]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"|",-1)),s.createElementVNode("span",$v,[s.createVNode(s.unref(m0),{class:s.normalizeClass(["h-3 w-3",e.savingStatus==="saving"?"animate-spin text-cyan-500":"text-emerald-500"])},null,8,["class"]),e.savingStatus==="saving"?(s.openBlock(),s.createElementBlock("span",Wv,s.toDisplayString(s.unref(n)("statusBar.saving")),1)):e.savingStatus==="offline"?(s.openBlock(),s.createElementBlock("span",Gv,s.toDisplayString(s.unref(n)("statusBar.offline")),1)):(s.openBlock(),s.createElementBlock("span",Kv,[s.createElementVNode("span",null,s.toDisplayString(s.unref(n)("statusBar.lastSavedAt")),1),s.createElementVNode("strong",Xv,s.toDisplayString(a.value),1)]))])]),s.createElementVNode("div",Jv,[s.createElementVNode("select",{value:e.pageSize,title:o.value,class:"h-6 cursor-pointer rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] font-medium text-slate-600 outline-none hover:border-slate-300 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300","aria-label":s.unref(n)("statusBar.pageSize"),onChange:c[0]||(c[0]=u=>r("update:pageSize",u.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.pageSizes,u=>(s.openBlock(),s.createElementBlock("option",{key:u.id,value:u.id},s.toDisplayString(u.name),9,Qv))),128))],40,Zv),c[4]||(c[4]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),e.pageless?(s.openBlock(),s.createElementBlock("span",Yv,s.toDisplayString(s.unref(n)("statusBar.pageless")),1)):(s.openBlock(),s.createElementBlock("span",e1,[s.createTextVNode(s.toDisplayString(s.unref(n)("statusBar.page"))+" ",1),s.createElementVNode("strong",t1,s.toDisplayString(e.currentPage),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.of"))+" ",1),s.createElementVNode("strong",n1,s.toDisplayString(e.pageCount),1)])),c[5]||(c[5]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",i1,s.toDisplayString(e.wordCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.words")),1)]),c[6]||(c[6]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",r1,s.toDisplayString(e.charCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.characters")),1)])])]))}}),a1={class:"docs-editor-ruler relative h-6 w-full flex-shrink-0 overflow-hidden border-b border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e]"},o1={class:"absolute inset-x-0 top-2.5 h-full"},s1={key:0,class:"absolute -top-2 left-0.5 text-[9px] text-slate-400"},l1=s.defineComponent({__name:"RulerBar",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var o,l;return{pageWidth:((o=t.layoutOptions)==null?void 0:o.pageWidth)??794,margins:((l=t.layoutOptions)==null?void 0:l.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const o=Math.floor(n.value.pageWidth/48);return Array.from({length:o+1},(l,c)=>c*48)}),r=s.computed(()=>`${n.value.margins.left}px`),a=s.computed(()=>`${n.value.pageWidth-n.value.margins.right}px`);return(o,l)=>(s.openBlock(),s.createElementBlock("div",a1,[s.createElementVNode("div",{class:"absolute inset-y-0 mx-auto h-full",style:s.normalizeStyle({width:`${n.value.pageWidth}px`,left:"50%",transform:"translateX(-50%)"})},[s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:r.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:a.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",o1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,c=>(s.openBlock(),s.createElementBlock("div",{key:c,class:s.normalizeClass(["absolute top-0 border-l border-slate-300 dark:border-slate-600",c%96===0?"h-3":"h-1.5"]),style:s.normalizeStyle({left:`${c}px`})},[c%96===0&&c>0?(s.openBlock(),s.createElementBlock("span",s1,s.toDisplayString(c/96),1)):s.createCommentVNode("",!0)],6))),128))])],4)]))}}),c1={class:"relative h-full w-full"},u1={key:0,class:"absolute -top-2 right-3 text-[9px] text-slate-400"},d1=s.defineComponent({__name:"VerticalRuler",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var r,a;return{pageHeight:((r=t.layoutOptions)==null?void 0:r.pageHeight)??1123,margins:((a=t.layoutOptions)==null?void 0:a.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const r=Math.floor(n.value.pageHeight/48);return Array.from({length:r+1},(a,o)=>o*48)});return(r,a)=>(s.openBlock(),s.createElementBlock("div",{class:"docs-editor-vertical-ruler sticky top-0 hidden w-6 flex-shrink-0 border-r border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e] lg:block",style:s.normalizeStyle({minHeight:`${n.value.pageHeight}px`})},[s.createElementVNode("div",c1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:s.normalizeClass(["absolute right-0 border-t border-slate-300 dark:border-slate-600",o%96===0?"w-3":"w-1.5"]),style:s.normalizeStyle({top:`${o}px`})},[o%96===0&&o>0?(s.openBlock(),s.createElementBlock("span",u1,s.toDisplayString(o/96),1)):s.createCommentVNode("",!0)],6))),128))])],4))}});function f1(e,t){try{const n=e.state.doc.nodeAt(t);if(!n||n.type.name!=="heading")return null;const i=e.view.nodeDOM(t);return i instanceof HTMLElement?i:(i==null?void 0:i.parentElement)instanceof HTMLElement?i.parentElement:null}catch{return null}}const p1={class:"toc-sidebar flex h-full w-80 flex-shrink-0 flex-col border-r border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},m1={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},h1={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},b1={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},g1=["title"],v1={key:0,class:"px-4 pb-2 pt-3"},x1={class:"relative flex items-center"},y1=["placeholder"],k1={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},w1={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},_1={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},S1={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},C1={class:"mt-1.5 max-w-[200px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},E1={class:"mt-5 w-full space-y-2 px-4 font-sans"},A1={class:"mb-1.5 block text-left text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},T1=["onClick"],N1={class:"flex items-center gap-1.5"},O1={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},M1={class:"text-xs font-semibold"},D1={class:"mt-1 text-[10px] text-slate-400"},z1={key:2,class:"space-y-1 font-sans"},I1={class:"mb-2.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},R1={class:"relative ml-1.5 space-y-1.5 border-l border-slate-100 pl-1.5 dark:border-white/5"},L1=["onClick"],B1={class:"flex min-w-0 flex-1 items-center gap-2"},P1={class:"border-t border-slate-200 bg-slate-50/50 p-3.5 text-[10px] leading-relaxed text-slate-400 dark:border-white/5 dark:bg-slate-900/30 dark:text-slate-500"},F1={class:"flex items-start gap-1.5"},V1=60,If=s.defineComponent({__name:"TOCSidebar",props:{editor:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref([]),o=s.ref(""),l=s.ref(null);let c=null;function u(){c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,f()},V1)}function f(){if(!n.editor)return;const v=[];n.editor.state.doc.descendants((x,k)=>{if(x.type.name==="heading"){if(x.attrs.tocExclude===!0||x.attrs["data-toc-exclude"]==="true"||x.attrs["data-toc-exclude"]===!0)return!0;const w=x.attrs.level;if(w===1||w===2||w===3){const S=x.textContent.trim();v.push({id:`heading-${k}`,text:S||r("sidebars.toc.untitledHeading").replace("{level}",String(w)),level:w,pos:k})}}return!0}),a.value=v}function m(){const v=n.editor;if(!v)return;const{from:x}=v.state.selection,k=v.state.doc.resolve(Math.max(0,x-1));for(let w=k.depth;w>0;w--){const S=k.node(w);if(S&&S.type.name==="heading"){l.value=`heading-${k.before(w+1)-1}`;return}}l.value=null}s.onMounted(()=>{var v,x;f(),m(),(v=n.editor)==null||v.on("update",u),(x=n.editor)==null||x.on("selectionUpdate",m)}),s.onUnmounted(()=>{var v,x;(v=n.editor)==null||v.off("update",u),(x=n.editor)==null||x.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null)}),s.watch(()=>n.editor,(v,x)=>{x==null||x.off("update",u),x==null||x.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null),f(),m(),v==null||v.on("update",u),v==null||v.on("selectionUpdate",m)});const p=s.computed(()=>a.value.filter(v=>v.text.toLowerCase().includes(o.value.toLowerCase())));function h(v){if(!n.editor)return;const x=n.editor;x.chain().focus().setTextSelection(v.pos).run(),l.value=v.id,setTimeout(()=>{var A;const k=document.querySelector(".docs-editor-scroll");if(!k)return;const w=f1(x,v.pos);if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}const S=k.querySelectorAll(".ProseMirror h1, .ProseMirror h2, .ProseMirror h3");for(const I of Array.from(S))if(((A=I.textContent)==null?void 0:A.trim())===v.text){I.scrollIntoView({behavior:"smooth",block:"center"});return}},50)}function g(v){if(!n.editor)return;const x=r(v===1?"header.heading1":v===2?"header.heading2":"header.heading3"),k=r("sidebars.toc.newSection"),w=r("sidebars.toc.startWriting");n.editor.chain().focus().insertContent(`<h${v}>${k.replace("{tag}",x)}</h${v}><p>${w}</p>`).run()}function b(v,x){const k="group w-full flex items-center justify-between rounded-lg p-1.5 text-left transition-all relative",w="bg-cyan-500/10 text-cyan-600 dark:text-cyan-400",S="text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-white/5";return v===1?[k,x?w:S,"pl-0 font-bold text-xs text-slate-800 dark:text-slate-200"]:v===2?[k,x?w:S,"pl-3.5 font-semibold text-[11px] text-slate-600 dark:text-slate-300"]:[k,x?w:S,"pl-6 text-[10px] text-slate-400 dark:text-slate-400"]}function y(v){return v===1?"bg-cyan-500":v===2?"bg-emerald-500":"bg-amber-500"}return(v,x)=>(s.openBlock(),s.createElementBlock("div",p1,[s.createElementVNode("div",m1,[s.createElementVNode("div",null,[s.createElementVNode("h3",h1,[s.createVNode(s.unref(Vn),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.title")),1)]),s.createElementVNode("p",b1,s.toDisplayString(s.unref(r)("sidebars.toc.empty")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.toc.closeOutline"),onClick:x[0]||(x[0]=k=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,g1)]),a.value.length>0?(s.openBlock(),s.createElementBlock("div",v1,[s.createElementVNode("div",x1,[s.createVNode(s.unref(xr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=k=>o.value=k),type:"text",placeholder:s.unref(r)("sidebars.toc.searchHeadings"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,y1),[[s.vModelText,o.value]]),o.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:x[2]||(x[2]=k=>o.value="")},[s.createVNode(s.unref(Wt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),s.createElementVNode("div",k1,[a.value.length===0?(s.openBlock(),s.createElementBlock("div",w1,[s.createElementVNode("div",_1,[s.createVNode(s.unref(Vn),{class:"h-6 w-6"})]),s.createElementVNode("h4",S1,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadings")),1),s.createElementVNode("p",C1,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadingsDescription")),1),s.createElementVNode("div",E1,[s.createElementVNode("span",A1,s.toDisplayString(s.unref(r)("sidebars.toc.quickInsert")),1),(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList([1,2,3],k=>s.createElementVNode("button",{key:k,type:"button",class:"flex w-full items-center justify-between rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-[11px] font-semibold text-slate-700 transition-all hover:bg-slate-100 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:w=>g(k)},[s.createElementVNode("span",N1,[s.createVNode(s.unref(Ua),{class:s.normalizeClass(["h-3 w-3",k===1?"text-cyan-500":k===2?"text-emerald-500":"text-amber-500"])},null,8,["class"]),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.headingLevel").replace("{level}",String(k))),1)]),s.createVNode(s.unref($n),{class:"h-3.5 w-3.5 text-slate-400"})],8,T1)),64))])])):p.value.length===0?(s.openBlock(),s.createElementBlock("div",O1,[s.createVNode(s.unref(xr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",M1,s.toDisplayString(s.unref(r)("sidebars.toc.noMatchingHeaders")),1),s.createElementVNode("p",D1,s.toDisplayString(s.unref(r)("sidebars.toc.tryDifferentTerm")),1)])):(s.openBlock(),s.createElementBlock("div",z1,[s.createElementVNode("span",I1,s.toDisplayString(s.unref(r)("sidebars.toc.outlineLayout")),1),s.createElementVNode("div",R1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(p.value,k=>(s.openBlock(),s.createElementBlock("button",{key:k.id,type:"button",class:s.normalizeClass(b(k.level,l.value===k.id)),onClick:w=>h(k)},[s.createElementVNode("div",B1,[s.createElementVNode("span",{class:s.normalizeClass(["h-1.5 w-1.5 shrink-0 rounded-full transition-all",[y(k.level),l.value===k.id?"scale-125 opacity-100":"opacity-40 group-hover:scale-110 group-hover:opacity-100"]])},null,2),s.createElementVNode("span",{class:s.normalizeClass(["flex-1 truncate leading-tight",l.value===k.id?"text-cyan-600 dark:text-cyan-400":""])},s.toDisplayString(k.text),3)]),s.createVNode(s.unref(Ob),{class:s.normalizeClass(["h-3 w-3 shrink-0 text-cyan-500 opacity-0 transition-opacity group-hover:opacity-100",l.value===k.id?"opacity-100 text-cyan-600 dark:text-cyan-400":""])},null,8,["class"])],10,L1))),128))])]))]),s.createElementVNode("div",P1,[s.createElementVNode("div",F1,[s.createVNode(s.unref(c0),{class:"mt-0.5 h-3.5 w-3.5 shrink-0 text-cyan-500"}),s.createElementVNode("p",null,s.toDisplayString(s.unref(r)("sidebars.toc.outlineSync")),1)])])]))}}),U1={class:"references-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},H1={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},q1={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},j1={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},$1=["title"],W1={class:"border-b border-slate-100 px-4 pb-3 pt-3 dark:border-white/5"},G1={class:"mb-1.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},K1=["value"],X1=["value"],J1={class:"flex items-center gap-2 px-4 pb-2 pt-3"},Z1={class:"relative flex flex-1 items-center"},Q1=["placeholder"],Y1=["title"],ex={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},tx={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},nx={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},ix={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},rx={class:"mt-1.5 max-w-[220px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},ax={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},ox={class:"text-xs font-semibold"},sx={key:2,class:"space-y-2 font-sans"},lx={class:"min-w-0 flex-1"},cx=["title"],ux={class:"mt-0.5 truncate text-[10px] text-slate-500 dark:text-slate-400"},dx={key:0},fx={key:1},px={key:2},mx={class:"mt-1.5 inline-block rounded bg-slate-200/70 px-1.5 py-0.5 text-[9px] font-mono uppercase tracking-wide text-slate-500 dark:bg-white/10 dark:text-slate-400"},hx={class:"mt-2.5 flex items-center gap-1.5"},bx=["onClick"],gx=["title","onClick"],vx=["title","onClick"],xx={key:0,class:"border-t border-slate-200 dark:border-white/5"},yx={key:0,class:"space-y-3 px-4 pb-4"},kx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},wx={class:"flex items-center gap-1.5"},_x=["placeholder"],Sx=["disabled","title"],Cx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Ex=["disabled"],Ax={key:0,class:"text-[10px] leading-relaxed text-slate-500 dark:text-slate-400"},Tx={class:"flex items-center gap-2 border-b border-slate-100 px-4 py-3 dark:border-white/5"},Nx=["title"],Ox={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},Mx={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},Dx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},zx=["value"],Ix={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Rx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Lx={class:"space-y-2"},Bx=["onUpdate:modelValue","placeholder"],Px=["onUpdate:modelValue","placeholder"],Fx=["onClick"],Vx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Ux={key:0},Hx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},qx={key:1,class:"grid grid-cols-2 gap-2"},jx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},$x={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Wx={key:2,class:"grid grid-cols-3 gap-2"},Gx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Kx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Xx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Jx={key:3},Zx={key:4},Qx={class:"flex items-center gap-2 pt-1.5"},Yx=["disabled"],ey=s.defineComponent({__name:"ReferencesSidebar",props:{sources:{},activeStyle:{},pickerMode:{type:Boolean,default:!1},availableStyles:{default:()=>[{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)"},{id:"chicago-author-date",name:"Chicago (author-date)"},{id:"apa",name:"APA"},{id:"modern-language-association",name:"MLA"}]},canImport:{type:Boolean,default:!1},importing:{type:Boolean,default:!1},importMessage:{default:""}},emits:["close","insert","create","update","remove","update:style","import-doi","import-bibliography"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=["book","article-journal","chapter","webpage","report","thesis","document"];function l(G){const H=G.author??[];if(H.length===0)return r("sidebars.references.anonymous");const q=H[0],re=q.family??q.literal??"";return H.length>1?`${re} ${r("sidebars.references.etAl")}`:re}function c(G){var q,re;const H=(re=(q=G.issued)==null?void 0:q["date-parts"])==null?void 0:re[0];return H!=null&&H[0]?String(H[0]):""}function u(G){const H=`sidebars.references.types.${G}`,q=r(H);return q===H?G:q}const f=s.computed(()=>{const G=a.value.trim().toLowerCase();return G?n.sources.filter(H=>[H.title,H["container-title"],H.publisher,H.DOI,H.URL,...(H.author??[]).map(re=>`${re.family??""} ${re.given??""} ${re.literal??""}`)].filter(Boolean).join(" ").toLowerCase().includes(G)):n.sources}),m=s.ref("list"),p=s.ref(null),h=s.ref("book"),g=s.ref(""),b=s.ref([{family:"",given:""}]),y=s.ref(""),v=s.ref(""),x=s.ref(""),k=s.ref(""),w=s.ref(""),S=s.ref(""),A=s.ref(""),I=s.ref(""),_=s.ref("");function E(){h.value="book",g.value="",b.value=[{family:"",given:""}],y.value="",v.value="",x.value="",k.value="",w.value="",S.value="",A.value="",I.value="",_.value=""}function z(){p.value=null,E(),m.value="form"}function P(G){p.value=G.id,h.value=G.type||"book",g.value=G.title??"",b.value=(G.author??[]).filter(q=>!q.literal).map(q=>({family:q.family??"",given:q.given??""}));const H=(G.author??[]).find(q=>q.literal);b.value.length===0&&(b.value=[{family:(H==null?void 0:H.literal)??"",given:""}]),y.value=c(G),v.value=G.publisher??"",x.value=G["publisher-place"]??"",k.value=G["container-title"]??"",w.value=G.volume??"",S.value=G.issue??"",A.value=G.page??"",I.value=G.DOI??"",_.value=G.URL??"",m.value="form"}function U(){b.value.push({family:"",given:""})}function V(G){b.value.splice(G,1),b.value.length===0&&b.value.push({family:"",given:""})}const B=s.computed(()=>["book","chapter","report","thesis","document"].includes(h.value)),j=s.computed(()=>["article-journal","chapter"].includes(h.value)),$=s.computed(()=>["article-journal","chapter"].includes(h.value)),Y=s.computed(()=>["webpage","report"].includes(h.value)),W=s.computed(()=>g.value.trim().length>0);function oe(){const G=b.value.filter(re=>re.family.trim()||re.given.trim()).map(re=>({family:re.family.trim(),given:re.given.trim()})),H=parseInt(y.value,10),q={id:p.value??crypto.randomUUID(),type:h.value,title:g.value.trim()};return G.length>0&&(q.author=G),Number.isFinite(H)&&(q.issued={"date-parts":[[H]]}),v.value.trim()&&(q.publisher=v.value.trim()),x.value.trim()&&(q["publisher-place"]=x.value.trim()),k.value.trim()&&(q["container-title"]=k.value.trim()),w.value.trim()&&(q.volume=w.value.trim()),S.value.trim()&&(q.issue=S.value.trim()),A.value.trim()&&(q.page=A.value.trim()),I.value.trim()&&(q.DOI=I.value.trim()),_.value.trim()&&(q.URL=_.value.trim()),q}function R(){if(!W.value)return;const G=oe();p.value?i("update",G):i("create",G),m.value="list"}function N(G){window.confirm(r("sidebars.references.confirmDelete").replace("{title}",G.title??G.id))&&i("remove",G.id)}const L=s.ref(!1),D=s.ref(""),K=s.ref(null);function ne(){const G=D.value.trim();!G||n.importing||(i("import-doi",G),D.value="")}function ee(){var G;n.importing||(G=K.value)==null||G.click()}async function ie(G){var fe;const H=G.target,q=(fe=H.files)==null?void 0:fe[0];if(H.value="",!q)return;const re=/\.ris$/i.test(q.name)?"ris":"bibtex",ce=await q.text();i("import-bibliography",{format:re,text:ce})}return(G,H)=>(s.openBlock(),s.createElementBlock("div",U1,[s.createElementVNode("div",H1,[s.createElementVNode("div",null,[s.createElementVNode("h3",q1,[s.createVNode(s.unref(js),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.title")),1)]),s.createElementVNode("p",j1,s.toDisplayString(s.unref(r)("sidebars.references.subtitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.close"),onClick:H[0]||(H[0]=q=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,$1)]),m.value==="list"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",W1,[s.createElementVNode("label",G1,s.toDisplayString(s.unref(r)("sidebars.references.citationStyle")),1),s.createElementVNode("select",{value:e.activeStyle,class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onChange:H[1]||(H[1]=q=>i("update:style",q.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.availableStyles,q=>(s.openBlock(),s.createElementBlock("option",{key:q.id,value:q.id},s.toDisplayString(q.name),9,X1))),128))],40,K1)]),s.createElementVNode("div",J1,[s.createElementVNode("div",Z1,[s.createVNode(s.unref(xr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[2]||(H[2]=q=>a.value=q),type:"text",placeholder:s.unref(r)("sidebars.references.searchSources"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,Q1),[[s.vModelText,a.value]]),a.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:H[3]||(H[3]=q=>a.value="")},[s.createVNode(s.unref(Wt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-xl bg-blue-600 text-white shadow transition-colors hover:bg-blue-700",title:s.unref(r)("sidebars.references.addSource"),onClick:z},[s.createVNode(s.unref($n),{class:"h-4 w-4"})],8,Y1)]),s.createElementVNode("div",ex,[e.sources.length===0?(s.openBlock(),s.createElementBlock("div",tx,[s.createElementVNode("div",nx,[s.createVNode(s.unref(js),{class:"h-6 w-6"})]),s.createElementVNode("h4",ix,s.toDisplayString(s.unref(r)("sidebars.references.noSources")),1),s.createElementVNode("p",rx,s.toDisplayString(s.unref(r)("sidebars.references.noSourcesDescription")),1),s.createElementVNode("button",{type:"button",class:"mt-5 flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-[11px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:z},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.addSource")),1)])])):f.value.length===0?(s.openBlock(),s.createElementBlock("div",ax,[s.createVNode(s.unref(xr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",ox,s.toDisplayString(s.unref(r)("sidebars.references.noMatchingSources")),1)])):(s.openBlock(),s.createElementBlock("div",sx,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.value,q=>(s.openBlock(),s.createElementBlock("div",{key:q.id,class:"group rounded-xl border border-slate-200/80 bg-slate-50/60 p-3 transition-all hover:border-slate-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"},[s.createElementVNode("div",lx,[s.createElementVNode("p",{class:"truncate text-xs font-semibold text-slate-800 dark:text-slate-200",title:q.title},s.toDisplayString(q.title),9,cx),s.createElementVNode("p",ux,[s.createTextVNode(s.toDisplayString(l(q)),1),c(q)?(s.openBlock(),s.createElementBlock("span",dx," ("+s.toDisplayString(c(q))+")",1)):s.createCommentVNode("",!0),q["container-title"]?(s.openBlock(),s.createElementBlock("span",fx," · "+s.toDisplayString(q["container-title"]),1)):q.publisher?(s.openBlock(),s.createElementBlock("span",px," · "+s.toDisplayString(q.publisher),1)):s.createCommentVNode("",!0)]),s.createElementVNode("span",mx,s.toDisplayString(u(q.type)),1)]),s.createElementVNode("div",hx,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex flex-1 items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-[10px] font-semibold transition-colors",e.pickerMode?"bg-blue-600 text-white hover:bg-blue-700":"bg-slate-200/80 text-slate-700 hover:bg-blue-600 hover:text-white dark:bg-white/10 dark:text-slate-300 dark:hover:bg-blue-600"]),onClick:re=>i("insert",q.id)},[s.createVNode(s.unref(Ha),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.cite")),1)],10,bx),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",title:s.unref(r)("sidebars.references.edit"),onClick:re=>P(q)},[s.createVNode(s.unref(jl),{class:"h-3.5 w-3.5"})],8,gx),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",title:s.unref(r)("sidebars.references.delete"),onClick:re=>N(q)},[s.createVNode(s.unref(kr),{class:"h-3.5 w-3.5"})],8,vx)])]))),128))]))]),e.canImport?(s.openBlock(),s.createElementBlock("div",xx,[s.createElementVNode("button",{type:"button",class:"flex w-full items-center justify-between px-4 py-2.5 text-[10px] font-bold uppercase tracking-widest text-slate-400 transition-colors hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",onClick:H[4]||(H[4]=q=>L.value=!L.value)},[s.createElementVNode("span",null,s.toDisplayString(s.unref(r)("sidebars.references.import.title")),1),s.createVNode(s.unref(en),{class:s.normalizeClass(["h-3.5 w-3.5 transition-transform",L.value?"rotate-180":""])},null,8,["class"])]),L.value?(s.openBlock(),s.createElementBlock("div",yx,[s.createElementVNode("div",null,[s.createElementVNode("label",kx,s.toDisplayString(s.unref(r)("sidebars.references.import.fromDoi")),1),s.createElementVNode("div",wx,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[5]||(H[5]=q=>D.value=q),type:"text",placeholder:s.unref(r)("sidebars.references.import.doiPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onKeydown:s.withKeys(ne,["enter"])},null,40,_x),[[s.vModelText,D.value]]),s.createElementVNode("button",{type:"button",disabled:e.importing||!D.value.trim(),class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg bg-blue-600 text-white transition-colors hover:bg-blue-700 disabled:opacity-40",title:s.unref(r)("sidebars.references.import.importDoi"),onClick:ne},[s.createVNode(s.unref(vf),{class:"h-3.5 w-3.5"})],8,Sx)])]),s.createElementVNode("div",null,[s.createElementVNode("label",Cx,s.toDisplayString(s.unref(r)("sidebars.references.import.fromFile")),1),s.createElementVNode("button",{type:"button",disabled:e.importing,class:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-slate-300 px-3 py-2 text-[11px] font-semibold text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-600 disabled:opacity-40 dark:border-white/15 dark:text-slate-400 dark:hover:border-blue-500 dark:hover:text-blue-400",onClick:ee},[s.createVNode(s.unref(Vb),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(e.importing?s.unref(r)("sidebars.references.import.importing"):s.unref(r)("sidebars.references.import.pickFile")),1)],8,Ex),s.createElementVNode("input",{ref_key:"bibFileInput",ref:K,type:"file",accept:".bib,.ris,application/x-bibtex,text/plain",class:"hidden",onChange:ie},null,544)]),e.importMessage?(s.openBlock(),s.createElementBlock("p",Ax,s.toDisplayString(e.importMessage),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",Tx,[s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.back"),onClick:H[6]||(H[6]=q=>m.value="list")},[s.createVNode(s.unref(Nb),{class:"h-4 w-4"})],8,Nx),s.createElementVNode("h4",Ox,s.toDisplayString(p.value?s.unref(r)("sidebars.references.editSource"):s.unref(r)("sidebars.references.addSource")),1)]),s.createElementVNode("div",Mx,[s.createElementVNode("form",{class:"space-y-3.5",onSubmit:s.withModifiers(R,["prevent"])},[s.createElementVNode("div",null,[s.createElementVNode("label",Dx,s.toDisplayString(s.unref(r)("sidebars.references.form.type")),1),s.withDirectives(s.createElementVNode("select",{"onUpdate:modelValue":H[7]||(H[7]=q=>h.value=q),class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(o,q=>s.createElementVNode("option",{key:q,value:q},s.toDisplayString(u(q)),9,zx)),64))],512),[[s.vModelSelect,h.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Ix,s.toDisplayString(s.unref(r)("sidebars.references.form.title"))+" *",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[8]||(H[8]=q=>g.value=q),type:"text",required:"",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,g.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Rx,s.toDisplayString(s.unref(r)("sidebars.references.form.authors")),1),s.createElementVNode("div",Lx,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(b.value,(q,re)=>(s.openBlock(),s.createElementBlock("div",{key:re,class:"flex items-center gap-1.5"},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":ce=>q.family=ce,type:"text",placeholder:s.unref(r)("sidebars.references.form.familyName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Bx),[[s.vModelText,q.family]]),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":ce=>q.given=ce,type:"text",placeholder:s.unref(r)("sidebars.references.form.givenName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Px),[[s.vModelText,q.given]]),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg text-slate-400 hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",onClick:ce=>V(re)},[s.createVNode(s.unref(Wt),{class:"h-3.5 w-3.5"})],8,Fx)]))),128))]),s.createElementVNode("button",{type:"button",class:"mt-1.5 flex items-center gap-1 text-[10px] font-semibold text-blue-600 hover:text-blue-700 dark:text-blue-400",onClick:U},[s.createVNode(s.unref($n),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.form.addAuthor")),1)])]),s.createElementVNode("div",null,[s.createElementVNode("label",Vx,s.toDisplayString(s.unref(r)("sidebars.references.form.year")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[9]||(H[9]=q=>y.value=q),type:"number",min:"0",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,y.value]])]),j.value?(s.openBlock(),s.createElementBlock("div",Ux,[s.createElementVNode("label",Hx,s.toDisplayString(h.value==="chapter"?s.unref(r)("sidebars.references.form.bookTitle"):s.unref(r)("sidebars.references.form.journal")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[10]||(H[10]=q=>k.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,k.value]])])):s.createCommentVNode("",!0),B.value?(s.openBlock(),s.createElementBlock("div",qx,[s.createElementVNode("div",null,[s.createElementVNode("label",jx,s.toDisplayString(s.unref(r)("sidebars.references.form.publisher")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[11]||(H[11]=q=>v.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,v.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",$x,s.toDisplayString(s.unref(r)("sidebars.references.form.publisherPlace")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[12]||(H[12]=q=>x.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,x.value]])])])):s.createCommentVNode("",!0),$.value?(s.openBlock(),s.createElementBlock("div",Wx,[s.createElementVNode("div",null,[s.createElementVNode("label",Gx,s.toDisplayString(s.unref(r)("sidebars.references.form.volume")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[13]||(H[13]=q=>w.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,w.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Kx,s.toDisplayString(s.unref(r)("sidebars.references.form.issue")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[14]||(H[14]=q=>S.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,S.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Xx,s.toDisplayString(s.unref(r)("sidebars.references.form.pages")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[15]||(H[15]=q=>A.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,A.value]])])])):s.createCommentVNode("",!0),h.value==="article-journal"?(s.openBlock(),s.createElementBlock("div",Jx,[H[19]||(H[19]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"DOI",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[16]||(H[16]=q=>I.value=q),type:"text",placeholder:"10.xxxx/xxxxx",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,I.value]])])):s.createCommentVNode("",!0),Y.value?(s.openBlock(),s.createElementBlock("div",Zx,[H[20]||(H[20]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"URL",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[17]||(H[17]=q=>_.value=q),type:"url",placeholder:"https://…",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,_.value]])])):s.createCommentVNode("",!0),s.createElementVNode("div",Qx,[s.createElementVNode("button",{type:"submit",disabled:!W.value,class:"flex-1 rounded-lg bg-blue-600 px-4 py-2 text-xs font-semibold text-white shadow transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-40"},s.toDisplayString(p.value?s.unref(r)("sidebars.references.form.save"):s.unref(r)("sidebars.references.form.create")),9,Yx),s.createElementVNode("button",{type:"button",class:"rounded-lg border border-slate-200 px-4 py-2 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 dark:border-white/10 dark:text-slate-300 dark:hover:bg-white/5",onClick:H[18]||(H[18]=q=>m.value="list")},s.toDisplayString(s.unref(r)("sidebars.references.form.cancel")),1)])],32)])],64))]))}});function ot(e){this.content=e}ot.prototype={constructor:ot,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),a=i.content.slice();return r==-1?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new ot(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ot(n)},addToStart:function(e,t){return new ot([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ot(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),a=i.find(e);return r.splice(a==-1?r.length:a,0,t,n),new ot(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ot.from(e),e.size?new ot(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ot.from(e),e.size?new ot(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ot.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};ot.from=function(e){if(e instanceof ot)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ot(t)};function Rf(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(i),a=t.child(i);if(r==a){n+=r.nodeSize;continue}if(!r.sameMarkup(a))return n;if(r.isText&&r.text!=a.text){let o=r.text,l=a.text,c=0;for(;o[c]==l[c];c++)n++;return c&&c<o.length&&c<l.length&&Pf(o.charCodeAt(c-1))&&Bf(o.charCodeAt(c))&&n--,n}if(r.content.size||a.content.size){let o=Rf(r.content,a.content,n+1);if(o!=null)return o}n+=r.nodeSize}}function Lf(e,t,n,i){for(let r=e.childCount,a=t.childCount;;){if(r==0||a==0)return r==a?null:{a:n,b:i};let o=e.child(--r),l=t.child(--a),c=o.nodeSize;if(o==l){n-=c,i-=c;continue}if(!o.sameMarkup(l))return{a:n,b:i};if(o.isText&&o.text!=l.text){let u=o.text,f=l.text,m=u.length,p=f.length;for(;m>0&&p>0&&u[m-1]==f[p-1];)m--,p--,n--,i--;return m&&p&&m<u.length&&Pf(u.charCodeAt(m-1))&&Bf(u.charCodeAt(m))&&(n++,i++),{a:n,b:i}}if(o.content.size||l.content.size){let u=Lf(o.content,l.content,n-1,i-1);if(u)return u}n-=c,i-=c}}function Bf(e){return e>=56320&&e<57344}function Pf(e){return e>=55296&&e<56320}class J{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;i<t.length;i++)this.size+=t[i].nodeSize}nodesBetween(t,n,i,r=0,a){for(let o=0,l=0;l<n;o++){let c=this.content[o],u=l+c.nodeSize;if(u>t&&i(c,r+l,a||null,o)!==!1&&c.content.size){let f=l+1;c.nodesBetween(Math.max(0,t-f),Math.min(c.content.size,n-f),i,r+f)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,r){let a="",o=!0;return this.nodesBetween(t,n,(l,c)=>{let u=l.isText?l.text.slice(Math.max(t,c)-c,n-c):l.isLeaf?r?typeof r=="function"?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(o?o=!1:a+=i),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,r=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),a=1);a<t.content.length;a++)r.push(t.content[a]);return new J(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let i=[],r=0;if(n>t)for(let a=0,o=0;o<n;a++){let l=this.content[a],c=o+l.nodeSize;c>t&&((o<t||c>n)&&(l.isText?l=l.cut(Math.max(0,t-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,t-o-1),Math.min(l.content.size,n-o-1))),i.push(l),r+=l.nodeSize),o=c}return new J(i,r)}cutByIndex(t,n){return t==n?J.empty:t==0&&n==this.content.length?this:new J(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let r=this.content.slice(),a=this.size+n.nodeSize-i.nodeSize;return r[t]=n,new J(r,a)}addToStart(t){return new J([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new J(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,i=0;n<this.content.length;n++){let r=this.content[n];t(r,i,n),i+=r.nodeSize}}findDiffStart(t,n=0){return Rf(this,t,n)}findDiffEnd(t,n=this.size,i=t.size){return Lf(this,t,n,i)}findIndex(t){if(t==0)return pa(0,t);if(t==this.size)return pa(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let r=this.child(n),a=i+r.nodeSize;if(a>=t)return a==t?pa(n+1,a):pa(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return J.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return J.empty;let n,i=0;for(let r=0;r<t.length;r++){let a=t[r];i+=a.nodeSize,r&&a.isText&&t[r-1].sameMarkup(a)?(n||(n=t.slice(0,r)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new J(n||t,i)}static from(t){if(!t)return J.empty;if(t instanceof J)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new J([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const ds={index:0,offset:0};function pa(e,t){return ds.index=e,ds.offset=t,ds}function qa(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!qa(e[i],t[i]))return!1}else{for(let i in e)if(!(i in t)||!qa(e[i],t[i]))return!1;for(let i in t)if(!(i in e))return!1}return!0}let Re=class Ys{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,i=!1;for(let r=0;r<t.length;r++){let a=t[r];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,r));else{if(a.type.excludes(this.type))return t;!i&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),i=!0),n&&n.push(a)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&qa(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let i=t.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(n[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ys.none;if(t instanceof Ys)return[t];let n=t.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};Re.none=[];class wr extends Error{}class ae{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=Vf(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new ae(i,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(Ff(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(J.fromJSON(t,n.content),i,r)}static maxOpen(t,n=!0){let i=0,r=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)i++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new ae(t,i,r)}}ae.empty=new ae(J.empty,0,0);function Ff(e,t,n){let{index:i,offset:r}=e.findIndex(t),a=e.maybeChild(i),{index:o,offset:l}=e.findIndex(n);if(r==t||a.isText){if(l!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(Ff(a.content,t-r-1,n-r-1)))}function Vf(e,t,n,i,r,a){let{index:o,offset:l}=e.findIndex(t),c=e.maybeChild(o);if(l==t||c.isText)return a&&i<=0&&r<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=Vf(c.content,t-l-1,n,o==0?i-1:0,o==e.childCount-1?r-1:0,c);return u&&e.replaceChild(o,c.copy(u))}function ty(e,t,n){if(n.openStart>e.depth)throw new wr("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wr("Inconsistent open depths");return Uf(e,t,n,0)}function Uf(e,t,n,i){let r=e.index(i),a=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){let o=Uf(e,t,n,i+1);return a.copy(a.content.replaceChild(r,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==i&&t.depth==i){let o=e.parent,l=o.content;return fi(o,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:o,end:l}=ny(n,e);return fi(a,qf(e,o,l,t,i))}else return fi(a,ja(e,t,i))}function Hf(e,t){if(!t.type.compatibleContent(e.type))throw new wr("Cannot join "+t.type.name+" onto "+e.type.name)}function el(e,t,n){let i=e.node(n);return Hf(i,t.node(n)),i}function di(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function cr(e,t,n,i){let r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(di(e.nodeAfter,i),a++));for(let l=a;l<o;l++)di(r.child(l),i);t&&t.depth==n&&t.textOffset&&di(t.nodeBefore,i)}function fi(e,t){if(!e.type.validContent(t))throw new wr("Invalid content for node "+e.type.name);return e.copy(t)}function qf(e,t,n,i,r){let a=e.depth>r&&el(e,t,r+1),o=i.depth>r&&el(n,i,r+1),l=[];return cr(null,e,r,l),a&&o&&t.index(r)==n.index(r)?(Hf(a,o),di(fi(a,qf(e,t,n,i,r+1)),l)):(a&&di(fi(a,ja(e,t,r+1)),l),cr(t,n,r,l),o&&di(fi(o,ja(n,i,r+1)),l)),cr(i,null,r,l),new J(l)}function ja(e,t,n){let i=[];if(cr(null,e,n,i),e.depth>n){let r=el(e,t,n+1);di(fi(r,ja(e,t,n+1)),i)}return cr(t,null,n,i),new J(i)}function ny(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)r=t.node(a).copy(J.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class _r{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=t.child(n);return i?t.child(n).cut(i):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)r+=i.child(a).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Re.none;if(this.textOffset)return t.child(n).marks;let i=t.maybeChild(n-1),r=t.maybeChild(n);if(!i){let l=i;i=r,r=l}let a=i.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!r||!a[o].isInSet(r.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=t.parent.maybeChild(t.index());for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);i>=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new $a(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],r=0,a=n;for(let o=t;;){let{index:l,offset:c}=o.content.findIndex(a),u=a-c;if(i.push(o,l,r+c),!u||(o=o.child(l),o.isText))break;a=u-1,r+=c+1}return new _r(n,i,a)}static resolveCached(t,n){let i=vu.get(t);if(i)for(let a=0;a<i.elts.length;a++){let o=i.elts[a];if(o.pos==n)return o}else vu.set(t,i=new iy);let r=i.elts[i.i]=_r.resolve(t,n);return i.i=(i.i+1)%ry,r}}class iy{constructor(){this.elts=[],this.i=0}}const ry=12,vu=new WeakMap;class $a{constructor(t,n,i){this.$from=t,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ay=Object.create(null);let pi=class tl{constructor(t,n,i,r=Re.none){this.type=t,this.attrs=n,this.marks=r,this.content=i||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,i,r=0){this.content.nodesBetween(t,n,i,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,i,r){return this.content.textBetween(t,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,i){return this.type==t&&qa(this.attrs,n||t.defaultAttrs||ay)&&Re.sameSet(this.marks,i||Re.none)}copy(t=null){return t==this.content?this:new tl(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new tl(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,i=!1){if(t==n)return ae.empty;let r=this.resolve(t),a=this.resolve(n),o=i?0:r.sharedDepth(n),l=r.start(o),u=r.node(o).content.cut(r.pos-l,a.pos-l);return new ae(u,r.depth-o,a.depth-o)}replace(t,n,i){return ty(this.resolve(t),this.resolve(n),i)}nodeAt(t){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(i),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:i}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(t);if(i<t)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(t){return _r.resolveCached(this,t)}resolveNoCache(t){return _r.resolve(this,t)}rangeHasMark(t,n,i){let r=!1;return n>t&&this.nodesBetween(t,n,a=>(i.isInSet(a.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),jf(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=J.empty,r=0,a=i.childCount){let o=this.contentMatchAt(t).matchFragment(i,r,a),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=r;c<a;c++)if(!this.type.allowsMarks(i.child(c).marks))return!1;return!0}canReplaceWith(t,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let a=this.contentMatchAt(t).matchType(i),o=a&&a.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Re.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),t=i.addToSet(t)}if(!Re.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let r=J.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,r,i);return a.type.checkAttrs(a.attrs),a}};pi.prototype.text=void 0;class Wa extends pi{constructor(t,n,i,r){if(super(t,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Wa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Wa(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function jf(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class bi{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new oy(t,n);if(i.next==null)return bi.empty;let r=$f(i);i.next&&i.err("Unexpected trailing text");let a=py(fy(r));return my(a,i),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,i=t.childCount){let r=this;for(let a=n;r&&a<i;a++)r=r.matchType(t.child(a).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let i=0;i<t.next.length;i++)if(this.next[n].type==t.next[i].type)return!0;return!1}fillBefore(t,n=!1,i=0){let r=[this];function a(o,l){let c=o.matchFragment(t,i);if(c&&(!n||c.validEnd))return J.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:m}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(m)==-1){r.push(m);let p=a(m,l.concat(f));if(p)return p}}return null}return a(this,[])}findWrapping(t){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==t)return this.wrapCache[i+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),a=r.match;if(a.matchType(t)){let o=[];for(let l=r;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:l,next:c}=a.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!r.type||c.validEnd)&&(i.push({match:l.contentMatch,type:l,via:r}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let r=0;r<i.next.length;r++)t.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),t.map((i,r)=>{let a=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)a+=(o?", ":"")+i.next[o].type.name+"->"+t.indexOf(i.next[o].next);return a}).join(`
598
- `)}}bi.empty=new bi(!0);class oy{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function $f(e){let t=[];do t.push(sy(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function sy(e){let t=[];do t.push(ly(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function ly(e){let t=dy(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=cy(e,t);else break;return t}function xu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function cy(e,t){let n=xu(e),i=n;return e.eat(",")&&(e.next!="}"?i=xu(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function uy(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let r=[];for(let a in n){let o=n[a];o.isInGroup(t)&&r.push(o)}return r.length==0&&e.err("No node type or group '"+t+"' found"),r}function dy(e){if(e.eat("(")){let t=$f(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=uy(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function fy(e){let t=[[]];return r(a(e,0),n()),t;function n(){return t.push([])-1}function i(o,l,c){let u={term:c,to:l};return t[o].push(u),u}function r(o,l){o.forEach(c=>c.to=l)}function a(o,l){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(a(u,l)),[]);if(o.type=="seq")for(let c=0;;c++){let u=a(o.exprs[c],l);if(c==o.exprs.length-1)return u;r(u,l=n())}else if(o.type=="star"){let c=n();return i(l,c),r(a(o.expr,c),c),[i(c)]}else if(o.type=="plus"){let c=n();return r(a(o.expr,l),c),r(a(o.expr,c),c),[i(c)]}else{if(o.type=="opt")return[i(l)].concat(a(o.expr,l));if(o.type=="range"){let c=l;for(let u=0;u<o.min;u++){let f=n();r(a(o.expr,c),f),c=f}if(o.max==-1)r(a(o.expr,c),c);else for(let u=o.min;u<o.max;u++){let f=n();i(c,f),r(a(o.expr,c),f),c=f}return[i(c)]}else{if(o.type=="name")return[i(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Wf(e,t){return t-e}function yu(e,t){let n=[];return i(t),n.sort(Wf);function i(r){let a=e[r];if(a.length==1&&!a[0].term)return i(a[0].to);n.push(r);for(let o=0;o<a.length;o++){let{term:l,to:c}=a[o];!l&&n.indexOf(c)==-1&&i(c)}}}function py(e){let t=Object.create(null);return n(yu(e,0));function n(i){let r=[];i.forEach(o=>{e[o].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let f=0;f<r.length;f++)r[f][0]==l&&(u=r[f][1]);yu(e,c).forEach(f=>{u||r.push([l,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let a=t[i.join(",")]=new bi(i.indexOf(e.length-1)>-1);for(let o=0;o<r.length;o++){let l=r[o][1].sort(Wf);a.next.push({type:r[o][0],next:t[l.join(",")]||n(l)})}return a}}function my(e,t){for(let n=0,i=[e];n<i.length;n++){let r=i[n],a=!r.validEnd,o=[];for(let l=0;l<r.next.length;l++){let{type:c,next:u}=r.next[l];o.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),i.indexOf(u)==-1&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Gf(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function Kf(e,t){let n=Object.create(null);for(let i in e){let r=t&&t[i];if(r===void 0){let a=e[i];if(a.hasDefault)r=a.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function Xf(e,t,n,i){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${i}`);for(let r in e)e[r].validate&&e[r].validate(t[r])}function Jf(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new by(e,i,t[i]);return n}let ku=class Zf{constructor(t,n,i){this.name=t,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=Jf(t,i.attrs),this.defaultAttrs=Gf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==bi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Kf(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new pi(this,this.computeAttrs(t),J.from(n),Re.setFrom(i))}createChecked(t=null,n,i){return n=J.from(n),this.checkContent(n),new pi(this,this.computeAttrs(t),n,Re.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let r=this.contentMatch.matchFragment(n),a=r&&r.fillBefore(J.empty,!0);return a?new pi(this,t,n.append(a),Re.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i<t.childCount;i++)if(!this.allowsMarks(t.child(i).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Xf(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let i=0;i<t.length;i++)this.allowsMarkType(t[i].type)?n&&n.push(t[i]):n||(n=t.slice(0,i));return n?n.length?n:Re.none:t}static compile(t,n){let i=Object.create(null);t.forEach((a,o)=>i[a]=new Zf(a,n,o));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function hy(e,t,n){let i=n.split("|");return r=>{let a=r===null?"null":typeof r;if(i.indexOf(a)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${a}`)}}class by{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?hy(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Lo{constructor(t,n,i,r){this.name=t,this.rank=n,this.schema=i,this.spec=r,this.attrs=Jf(t,r.attrs),this.excluded=null;let a=Gf(this.attrs);this.instance=a?new Re(this,a):null}create(t=null){return!t&&this.instance?this.instance:new Re(this,Kf(this.attrs,t))}static compile(t,n){let i=Object.create(null),r=0;return t.forEach((a,o)=>i[a]=new Lo(a,r++,n,o)),i}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Xf(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Qf{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=ot.from(t.nodes),n.marks=ot.from(t.marks||{}),this.nodes=ku.compile(this.spec.nodes,this),this.marks=Lo.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let a=this.nodes[r],o=a.spec.content||"",l=a.spec.marks;if(a.contentMatch=i[o]||(i[o]=bi.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=l=="_"?null:l?wu(this,l.split(" ")):l==""||!a.inlineContent?[]:null}for(let r in this.marks){let a=this.marks[r],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:wu(this,o.split(" "))}this.nodeFromJSON=r=>pi.fromJSON(this,r),this.markFromJSON=r=>Re.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ku){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,r)}text(t,n){let i=this.nodes.text;return new Wa(i,i.defaultAttrs,t,Re.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function wu(e,t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],a=e.marks[r],o=a;if(a)n.push(a);else for(let l in e.marks){let c=e.marks[l];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&n.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function gy(e){return e.tag!=null}function vy(e){return e.style!=null}let ur=class nl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(gy(r))this.tags.push(r);else if(vy(r)){let a=/[^=]*/.exec(r.style)[0];i.indexOf(a)<0&&i.push(a),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let a=t.nodes[r.node];return a.contentMatch.matchType(a)})}parse(t,n={}){let i=new Su(this,n,!1);return i.addAll(t,Re.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new Su(this,n,!0);return i.addAll(t,Re.none,n.from,n.to),ae.maxOpen(i.finish())}matchTag(t,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let a=this.tags[r];if(ky(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(t);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(t,n,i,r){for(let a=r?this.styles.indexOf(r)+1:0;a<this.styles.length;a++){let o=this.styles[a],l=o.style;if(!(l.indexOf(t)!=0||o.context&&!i.matchesContext(o.context)||l.length>t.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(o.getAttrs){let c=o.getAttrs(n);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(t){let n=[];function i(r){let a=r.priority==null?50:r.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<a)break}n.splice(o,0,r)}for(let r in t.marks){let a=t.marks[r].spec.parseDOM;a&&a.forEach(o=>{i(o=Cu(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in t.nodes){let a=t.nodes[r].spec.parseDOM;a&&a.forEach(o=>{i(o=Cu(o)),o.node||o.ignore||o.mark||(o.node=r)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new nl(t,nl.schemaRules(t)))}};const Yf={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xy={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ep={ol:!0,ul:!0},Sr=1,il=2,dr=4;function _u(e,t,n){return t!=null?(t?Sr:0)|(t==="full"?il:0):e&&e.whitespace=="pre"?Sr|il:n&~dr}class ma{constructor(t,n,i,r,a,o){this.type=t,this.attrs=n,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=Re.none,this.match=a||(o&dr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(t.type))?(this.match=i,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Sr)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let a=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-r[0].length))}}let n=J.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Yf.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Su{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,a,o=_u(null,n.preserveWhitespace,0)|(i?dr:0);r?a=new ma(r.type,r.attrs,Re.none,!0,n.topMatch||r.type.contentMatch,o):i?a=new ma(null,null,Re.none,!0,null,o):a=new ma(t.schema.topNodeType,null,Re.none,!0,null,o),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,r=this.top,a=r.options&il?"full":this.localPreserveWS||(r.options&Sr)>0,{schema:o}=this.parser;if(a==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(a)if(a==="full")i=i.replace(/\r\n?/g,`
599
- `);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[c]&&this.insertNode(o.text(l[c]),n,!/\S/.test(l[c]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=r.content[r.content.length-1],c=t.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),n,!/\S/.test(i)),this.findInText(t)}else this.findInside(t)}addElement(t,n,i){let r=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),l;ep.hasOwnProperty(o)&&this.parser.normalizeLists&&yy(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,i));e:if(c?c.ignore:xy.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let u,f=this.needsBlock;if(Yf.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let m=c&&c.skip?n:this.readStyles(t,n);m&&this.addAll(t,m),u&&this.sync(a),this.needsBlock=f}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,c,u,c.consuming===!1?l:void 0)}this.localPreserveWS=r}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
600
- `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let i=t.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let a=this.parser.matchedStyles[r],o=i.getPropertyValue(a);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(a,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,i,r){let a,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let c=this.enter(o,n.attrs||null,i,n.preserveWhitespace);c&&(a=!0,i=c)}else{let c=this.parser.schema.marks[n.mark];i=i.concat(c.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,i,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,i),this.findAround(t,c,!1)}a&&this.sync(l)&&this.open--}addAll(t,n,i,r){let a=i||0;for(let o=i?t.childNodes[i]:t.firstChild,l=r==null?null:t.childNodes[r];o!=l;o=o.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(o,n);this.findAtPoint(t,a)}findPlace(t,n,i){let r,a;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(t);if(u&&(!r||r.length>u.length+l)&&(r=u,a=c,!u.length))break;if(c.solid){if(i)break;l+=2}}if(!r)return null;this.sync(a);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n,i){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let r=this.findPlace(t,n,i);if(r){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let o=Re.none;for(let l of r.concat(t.marks))(a.type?a.type.allowsMarkType(l.type):Eu(l.type,t.type))&&(o=l.addToSet(o));return a.content.push(t.mark(o)),!0}return!1}enter(t,n,i,r){let a=this.findPlace(t.create(n),i,!1);return a&&(a=this.enterInner(t,n,i,!0,r)),a}enterInner(t,n,i,r=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let l=_u(t,a,o.options);o.options&dr&&o.content.length==0&&(l|=dr);let c=Re.none;return i=i.filter(u=>(o.type?o.type.allowsMarkType(u.type):Eu(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new ma(t,n,c,r,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Sr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)t+=i[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==t&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,i){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=(l,c)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;c>=a;c--)if(o(l-1,c))return!0;return!1}else{let f=c>0||c==0&&r?this.nodes[c].type:i&&c>=a?i.node(c-a).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function yy(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&ep.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function ky(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Cu(e){let t={};for(let n in e)t[n]=e[n];return t}function Eu(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let a=[],o=l=>{a.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:f}=l.edge(c);if(u==t||a.indexOf(f)<0&&o(f))return!0}};if(o(r.contentMatch))return!0}}class Hi{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},i){i||(i=ha(n).createDocumentFragment());let r=i,a=[];return t.forEach(o=>{if(a.length||o.marks.length){let l=0,c=0;for(;l<a.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(a[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<a.length;)r=a.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],f=this.serializeMark(u,o.isInline,n);f&&(a.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(o,n))}),i}serializeNodeInner(t,n){if(t.isText)return ha(n).createTextNode(t.text);let{dom:i,contentDOM:r}=Da(ha(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return i}serializeNode(t,n={}){let i=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let a=this.serializeMark(t.marks[r],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(i),i=a.dom)}return i}serializeMark(t,n,i={}){let r=this.marks[t.type.name];return r&&Da(ha(i),r(t,n),null,t.attrs)}static renderSpec(t,n,i=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:Da(t,n,i,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Hi(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Au(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return Au(t.marks)}}function Au(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function ha(e){return e.document||window.document}const Tu=new WeakMap;function wy(e){let t=Tu.get(e);return t===void 0&&Tu.set(e,t=_y(e)),t}function _y(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(e),t}function Da(e,t,n,i){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let r=t[0],a;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(a=wy(i))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));let l,c=n?e.createElementNS(n,r):e.createElement(r),u=t[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let m in u)if(u[m]!=null){let p=m.indexOf(" ");p>0?c.setAttributeNS(m.slice(0,p),m.slice(p+1),u[m]):m=="style"&&c.style?c.style.cssText=u[m]:c.setAttribute(m,u[m])}}for(let m=f;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof p=="string")c.appendChild(e.createTextNode(p));else{let{dom:h,contentDOM:g}=Da(e,p,n,i);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const tp=65535,np=Math.pow(2,16);function Sy(e,t){return e+t*np}function Nu(e){return e&tp}function Cy(e){return(e-(e&tp))/np}const ip=1,rp=2,za=4,ap=8;class rl{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&ap)>0}get deletedBefore(){return(this.delInfo&(ip|za))>0}get deletedAfter(){return(this.delInfo&(rp|za))>0}get deletedAcross(){return(this.delInfo&za)>0}}class Dt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Dt.empty)return Dt.empty}recover(t){let n=0,i=Nu(t);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+Cy(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,i){let r=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[l+a],f=this.ranges[l+o],m=c+u;if(t<=m){let p=u?t==c?-1:t==m?1:n:n,h=c+r+(p<0?0:f);if(i)return h;let g=t==(n<0?c:m)?null:Sy(l/3,t-c),b=t==c?rp:t==m?ip:za;return(n<0?t!=c:t!=m)&&(b|=ap),new rl(h,b,g)}r+=f-u}return i?t+r:new rl(t+r,0,null)}touches(t,n){let i=0,r=Nu(n),a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[l+a],f=c+u;if(t<=f&&l==r*3)return!0;i+=this.ranges[l+o]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,a=0;r<this.ranges.length;r+=3){let o=this.ranges[r],l=o-(this.inverted?a:0),c=o+(this.inverted?0:a),u=this.ranges[r+n],f=this.ranges[r+i];t(l,l+u,c,c+f),a+=f-u}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Dt.empty:new Dt(t<0?[0,-t,0]:[0,0,t])}}Dt.empty=new Dt([]);class Ga{constructor(t,n,i=0,r=t?t.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ga(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,i=this._maps.length;n<t._maps.length;n++){let r=t.getMirror(n);this.appendMap(t._maps[n],r!=null&&r<n?i+r:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,i=this._maps.length+t._maps.length;n>=0;n--){let r=t.getMirror(n);this.appendMap(t._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let t=new Ga;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;i<this.to;i++)t=this._maps[i].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,i){let r=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],l=o.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(a);if(c!=null&&c>a&&c<this.to){a=c,t=this._maps[c].recover(l.recover);continue}}r|=l.delInfo,t=l.pos}return i?t:new rl(t,r,null)}}const fs=Object.create(null);class bt{getMap(){return Dt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=fs[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in fs)throw new RangeError("Duplicate use of step JSON ID "+t);return fs[t]=n,n.prototype.jsonID=t,n}}class Qe{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Qe(t,null)}static fail(t){return new Qe(null,t)}static fromReplace(t,n,i,r){try{return Qe.ok(t.replace(n,i,r))}catch(a){if(a instanceof wr)return Qe.fail(a.message);throw a}}}function Gl(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let a=e.child(r);a.content.size&&(a=a.copy(Gl(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return J.fromArray(i)}class Hn extends bt{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=t.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new ae(Gl(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),r),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,a)}invert(){return new tn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Hn(n.pos,i.pos,this.mark)}merge(t){return t instanceof Hn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Hn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Hn(n.from,n.to,t.markFromJSON(n.mark))}}bt.jsonID("addMark",Hn);class tn extends bt{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new ae(Gl(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,i)}invert(){return new Hn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new tn(n.pos,i.pos,this.mark)}merge(t){return t instanceof tn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new tn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tn(n.from,n.to,t.markFromJSON(n.mark))}}bt.jsonID("removeMark",tn);class qn extends bt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new qn(this.pos,n.marks[r]);return new qn(this.pos,this.mark)}}return new gi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new qn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qn(n.pos,t.markFromJSON(n.mark))}}bt.jsonID("addNodeMark",qn);class gi extends bt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gi(n.pos,t.markFromJSON(n.mark))}}bt.jsonID("removeNodeMark",gi);class Ze extends bt{constructor(t,n,i,r=!1){super(),this.from=t,this.to=n,this.slice=i,this.structure=r}apply(t){return this.structure&&al(t,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ze(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),i=this.from==this.to&&Ze.MAP_BIAS<0?n:t.mapResult(this.from,1);return i.deletedAcross&&n.deletedAcross?null:new Ze(i.pos,Math.max(i.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Ze)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ze(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ze(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ze(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}Ze.MAP_BIAS=1;bt.jsonID("replace",Ze);class Ye extends bt{constructor(t,n,i,r,a,o,l=!1){super(),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=l}apply(t){if(this.structure&&(al(t,this.from,this.gapFrom)||al(t,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Qe.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?Qe.fromReplace(t,this.from,this.to,i):Qe.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ye(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?i.pos:t.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||a>i.pos?null:new Ye(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}bt.jsonID("replaceAround",Ye);function al(e,t,n){let i=e.resolve(t),r=n-t,a=i.depth;for(;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0){let o=i.node(a).maybeChild(i.indexAfter(a));for(;r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}}return!1}function Ey(e,t,n,i){let r=[],a=[],o,l;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let m=c.marks;if(!i.isInSet(m)&&f.type.allowsMarkType(i.type)){let p=Math.max(u,t),h=Math.min(u+c.nodeSize,n),g=i.addToSet(m);for(let b=0;b<m.length;b++)m[b].isInSet(g)||(o&&o.to==p&&o.mark.eq(m[b])?o.to=h:r.push(o=new tn(p,h,m[b])));l&&l.to==p?l.to=h:a.push(l=new Hn(p,h,i))}}),r.forEach(c=>e.step(c)),a.forEach(c=>e.step(c))}function Ay(e,t,n,i){let r=[],a=0;e.doc.nodesBetween(t,n,(o,l)=>{if(!o.isInline)return;a++;let c=null;if(i instanceof Lo){let u=o.marks,f;for(;f=i.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else i?i.isInSet(o.marks)&&(c=[i]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,n);for(let f=0;f<c.length;f++){let m=c[f],p;for(let h=0;h<r.length;h++){let g=r[h];g.step==a-1&&m.eq(r[h].style)&&(p=g)}p?(p.to=u,p.step=a):r.push({style:m,from:Math.max(l,t),to:u,step:a})}}}),r.forEach(o=>e.step(new tn(o.from,o.to,o.style)))}function Kl(e,t,n,i=n.contentMatch,r=!0){let a=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c<a.childCount;c++){let u=a.child(c),f=l+u.nodeSize,m=i.matchType(u.type);if(!m)o.push(new Ze(l,f,ae.empty));else{i=m;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new tn(l,f,u.marks[p]));if(r&&u.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,g;for(;p=h.exec(u.text);)g||(g=new ae(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Ze(l+p.index,l+p.index+p[0].length,g))}}l=f}if(!i.validEnd){let c=i.fillBefore(J.empty,!0);e.replace(l,l,new ae(c,0,0))}for(let c=o.length-1;c>=0;c--)e.step(o[c])}function Ty(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function qi(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,r=0,a=0;;--i){let o=e.$from.node(i),l=e.$from.index(i)+r,c=e.$to.indexAfter(i)-a;if(i<e.depth&&o.canReplace(l,c,n))return i;if(i==0||o.type.spec.isolating||!Ty(o,l,c))break;l&&(r=1),c<o.childCount&&(a=1)}return null}function Ny(e,t,n){let{$from:i,$to:r,depth:a}=t,o=i.before(a+1),l=r.after(a+1),c=o,u=l,f=J.empty,m=0;for(let g=a,b=!1;g>n;g--)b||i.index(g)>0?(b=!0,f=J.from(i.node(g).copy(f)),m++):c--;let p=J.empty,h=0;for(let g=a,b=!1;g>n;g--)b||r.after(g+1)<r.end(g)?(b=!0,p=J.from(r.node(g).copy(p)),h++):u++;e.step(new Ye(c,u,o,l,new ae(f.append(p),m,h),f.size-m,!0))}function Xl(e,t,n=null,i=e){let r=Oy(e,t),a=r&&My(i,t);return a?r.map(Ou).concat({type:t,attrs:n}).concat(a.map(Ou)):null}function Ou(e){return{type:e,attrs:null}}function Oy(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.contentMatchAt(i).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(i,r,o)?a:null}function My(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.child(i),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let c=(o.length?o[o.length-1]:t).contentMatch;for(let u=i;c&&u<r;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:o}function Dy(e,t,n){let i=J.empty;for(let o=n.length-1;o>=0;o--){if(i.size){let l=n[o].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=J.from(n[o].type.create(n[o].attrs,i))}let r=t.start,a=t.end;e.step(new Ye(r,a,r,a,new ae(i,0,0),n.length,!0))}function zy(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(o,l)=>{let c=typeof r=="function"?r(o):r;if(o.isTextblock&&!o.hasMarkup(i,c)&&Iy(e.doc,e.mapping.slice(a).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",g=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!g?u=!1:!h&&g&&(u=!0)}u===!1&&sp(e,o,l,a),Kl(e,e.mapping.slice(a).map(l,1),i,void 0,u===null);let f=e.mapping.slice(a),m=f.map(l,1),p=f.map(l+o.nodeSize,1);return e.step(new Ye(m,p,m+1,p-1,new ae(J.from(i.create(c,null,o.marks)),0,0),1,!0)),u===!0&&op(e,o,l,a),!1}})}function op(e,t,n,i){t.forEach((r,a)=>{if(r.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(r.text);){let c=e.mapping.slice(i).map(n+1+a+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function sp(e,t,n,i){t.forEach((r,a)=>{if(r.type==r.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(n+1+a);e.replaceWith(o,o+1,t.type.schema.text(`
601
- `))}})}function Iy(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function Ry(e,t,n,i,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let o=n.create(i,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ye(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(J.from(o),0,0),1,!0))}function Tn(e,t,n=1,i){let r=e.resolve(t),a=r.depth-n,o=i&&i[i.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!o.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=n-2;u>a;u--,f--){let m=r.node(u),p=r.index(u);if(m.type.spec.isolating)return!1;let h=m.content.cutByIndex(p,m.childCount),g=i&&i[f+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=i&&i[f]||m;if(!m.canReplace(p+1,m.childCount)||!b.type.validContent(h))return!1}let l=r.indexAfter(a),c=i&&i[0];return r.node(a).canReplaceWith(l,l,c?c.type:r.node(a+1).type)}function Ly(e,t,n=1,i){let r=e.doc.resolve(t),a=J.empty,o=J.empty;for(let l=r.depth,c=r.depth-n,u=n-1;l>c;l--,u--){a=J.from(r.node(l).copy(a));let f=i&&i[u];o=J.from(f?f.type.create(f.attrs,o):r.node(l).copy(o))}e.step(new Ze(t,t,new ae(a.append(o),n,n),!0))}function Xn(e,t){let n=e.resolve(t),i=n.index();return lp(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function By(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),o=a.type==i?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function lp(e,t){return!!(e&&t&&!e.isLeaf&&By(e,t))}function Bo(e,t,n=-1){let i=e.resolve(t);for(let r=i.depth;;r--){let a,o,l=i.index(r);if(r==i.depth?(a=i.nodeBefore,o=i.nodeAfter):n>0?(a=i.node(r+1),l++,o=i.node(r).maybeChild(l)):(a=i.node(r).maybeChild(l-1),o=i.node(r+1)),a&&!a.isTextblock&&lp(a,o)&&i.node(r).canReplace(l,l+1))return t;if(r==0)break;t=n<0?i.before(r):i.after(r)}}function Py(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(r&&o.inlineContent){let f=o.whitespace=="pre",m=!!o.contentMatch.matchType(r);f&&!m?i=!1:!f&&m&&(i=!0)}let l=e.steps.length;if(i===!1){let f=e.doc.resolve(t+n);sp(e,f.node(),f.before(),l)}o.inlineContent&&Kl(e,t+n-1,o,a.node().contentMatchAt(a.index()),i==null);let c=e.mapping.slice(l),u=c.map(t-n);if(e.step(new Ze(u,c.map(t+n,-1),ae.empty,!0)),i===!0){let f=e.doc.resolve(u);op(e,f.node(),f.before(),e.steps.length)}return e}function Fy(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let a=i.indexAfter(r);if(i.node(r).canReplaceWith(a,a,n))return i.after(r+1);if(a<i.node(r).childCount)return null}return null}function Vy(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let o=i.depth;o>=0;o--){let l=o==i.depth?0:i.pos<=(i.start(o+1)+i.end(o+1))/2?-1:1,c=i.index(o)+(l>0?1:0),u=i.node(o),f=!1;if(a==1)f=u.canReplace(c,c,r);else{let m=u.contentMatchAt(c).findWrapping(r.firstChild.type);f=m&&u.canReplaceWith(c,c,m[0])}if(f)return l==0?i.pos:l<0?i.before(o+1):i.after(o+1)}return null}function Po(e,t,n=t,i=ae.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),a=e.resolve(n);return cp(r,a,i)?new Ze(t,n,i):new Uy(r,a,i).fit()}function cp(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Uy{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=J.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=J.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;let a=this.placed,o=i.depth,l=r.depth;for(;o&&l&&a.childCount==1;)a=a.firstChild.content,o--,l--;let c=new ae(a,o,l);return t>-1?new Ye(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new Ze(i.pos,r.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<t;i++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=i){t=i;break}n=a.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let r,a=null;i?(a=ps(this.unplaced.content,i-1).firstChild,r=a.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],f,m=null;if(n==1&&(o?u.matchType(o.type)||(m=u.fillBefore(J.from(o),!1)):a&&c.compatibleContent(a.type)))return{sliceDepth:i,frontierDepth:l,parent:a,inject:m};if(n==2&&o&&(f=u.findWrapping(o.type)))return{sliceDepth:i,frontierDepth:l,parent:a,wrap:f};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=ps(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=ps(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(or(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new ae(or(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let b=0;b<a.length;b++)this.openFrontierNode(a[b]);let o=this.unplaced,l=i?i.content:o.content,c=o.openStart-t,u=0,f=[],{match:m,type:p}=this.frontier[n];if(r){for(let b=0;b<r.childCount;b++)f.push(r.child(b));m=m.matchFragment(r)}let h=l.size+t-(o.content.size-o.openEnd);for(;u<l.childCount;){let b=l.child(u),y=m.matchType(b.type);if(!y)break;u++,(u>1||c==0||b.content.size)&&(m=y,f.push(up(b.mark(p.allowedMarks(b.marks)),u==1?c:0,u==l.childCount?h:-1)))}let g=u==l.childCount;g||(h=-1),this.placed=sr(this.placed,n,J.from(f)),this.frontier[n].match=m,g&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,y=l;b<h;b++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=g?t==0?ae.empty:new ae(or(o.content,t-1,1),t-1,h<0?o.openEnd:t-1):new ae(or(o.content,t,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!ms(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=ms(t,n,r,i,a);if(o){for(let l=n-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],f=ms(t,l,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:o,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=sr(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let r=t.node(i),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(i));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=sr(this.placed,this.depth,J.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=sr(this.placed,this.frontier.length,n))}}function or(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(or(e.firstChild.content,t-1,n)))}function sr(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(sr(e.lastChild.content,t-1,n)))}function ps(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function up(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,up(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(J.empty,!0)))),e.copy(i)}function ms(e,t,n,i,r){let a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let l=i.fillBefore(a.content,!0,o);return l&&!Hy(n,a.content,o)?l:null}function Hy(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}function qy(e){return e.spec.defining||e.spec.definingForContent}function jy(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(cp(r,a,i))return e.step(new Ze(t,n,i));let o=fp(r,a);o[o.length-1]==0&&o.pop();let l=-(r.depth+1);o.unshift(l);for(let p=r.depth,h=r.pos-1;p>0;p--,h--){let g=r.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?l=p:r.before(p)==h&&o.splice(1,0,-p)}let c=o.indexOf(l),u=[],f=i.openStart;for(let p=i.content,h=0;;h++){let g=p.firstChild;if(u.push(g),h==i.openStart)break;p=g.content}for(let p=f-1;p>=0;p--){let h=u[p],g=qy(h.type);if(g&&!h.sameMarkup(r.node(Math.abs(l)-1)))f=p;else if(g||!h.type.isTextblock)break}for(let p=i.openStart;p>=0;p--){let h=(p+f+1)%(i.openStart+1),g=u[h];if(g)for(let b=0;b<o.length;b++){let y=o[(b+c)%o.length],v=!0;y<0&&(v=!1,y=-y);let x=r.node(y-1),k=r.index(y-1);if(x.canReplaceWith(k,k,g.type,g.marks))return e.replace(r.before(y),v?a.after(y):n,new ae(dp(i.content,0,i.openStart,h),h,i.openEnd))}}let m=e.steps.length;for(let p=o.length-1;p>=0&&(e.replace(t,n,i),!(e.steps.length>m));p--){let h=o[p];h<0||(t=r.before(h),n=a.after(h))}}function dp(e,t,n,i,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(dp(a.content,t+1,n,i,a)))}if(t>i){let a=r.contentMatchAt(0),o=a.fillBefore(e).append(e);e=o.append(a.matchFragment(o).fillBefore(J.empty,!0))}return e}function $y(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=Fy(e.doc,t,i.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(J.from(i),0,0))}function Wy(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let o=i.sharedDepth(n),l=!1;for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);for(let c=r.depth;c>o;c--)r.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);for(let c=r.depth;c>0&&n==r.start(c);c--)n=r.before(c);i=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=fp(i,r);for(let o=0;o<a.length;o++){let l=a[o],c=o==a.length-1;if(c&&l==0||i.node(l).type.contentMatch.validEnd)return e.delete(i.start(l),r.end(l));if(l>0&&(c||i.node(l-1).canReplace(i.index(l-1),r.indexAfter(l-1))))return e.delete(i.before(l),r.after(l))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}function fp(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let r=i;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Ii extends bt{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at attribute step's position");let i=Object.create(null);for(let a in n.attrs)i[a]=n.attrs[a];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(r),0,n.isLeaf?0:1))}getMap(){return Dt.empty}invert(t){return new Ii(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ii(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ii(n.pos,n.attr,n.value)}}bt.jsonID("attr",Ii);class Cr extends bt{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return Qe.ok(i)}getMap(){return Dt.empty}invert(t){return new Cr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cr(n.attr,n.value)}}bt.jsonID("docAttr",Cr);let Li=class extends Error{};Li=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Li.prototype=Object.create(Error.prototype);Li.prototype.constructor=Li;Li.prototype.name="TransformError";class pp{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ga}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Li(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,o,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=ae.empty){let r=Po(this.doc,t,n,i);return r&&this.step(r),this}replaceWith(t,n,i){return this.replace(t,n,new ae(J.from(i),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return jy(this,t,n,i),this}replaceRangeWith(t,n,i){return $y(this,t,n,i),this}deleteRange(t,n){return Wy(this,t,n),this}lift(t,n){return Ny(this,t,n),this}join(t,n=1){return Py(this,t,n),this}wrap(t,n){return Dy(this,t,n),this}setBlockType(t,n=t,i,r=null){return zy(this,t,n,i,r),this}setNodeMarkup(t,n,i=null,r){return Ry(this,t,n,i,r),this}setNodeAttribute(t,n,i){return this.step(new Ii(t,n,i)),this}setDocAttribute(t,n){return this.step(new Cr(t,n)),this}addNodeMark(t,n){return this.step(new qn(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Re)n.isInSet(i.marks)&&this.step(new gi(t,n));else{let r=i.marks,a,o=[];for(;a=n.isInSet(r);)o.push(new gi(t,a)),r=a.removeFromSet(r);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,n=1,i){return Ly(this,t,n,i),this}addMark(t,n,i){return Ey(this,t,n,i),this}removeMark(t,n,i){return Ay(this,t,n,i),this}clearIncompatible(t,n,i){return Kl(this,t,n,i),this}}const hs=Object.create(null);class ke{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new mp(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let i=n.content.lastChild,r=null;for(let l=0;l<n.openEnd;l++)r=i,i=i.lastChild;let a=t.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:u}=o[l],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(u.pos),l?ae.empty:n),l==0&&zu(t,a,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let i=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:o,$to:l}=r[a],c=t.mapping.slice(i),u=c.map(o.pos),f=c.map(l.pos);a?t.deleteRange(u,f):(t.replaceRangeWith(u,f,n),zu(t,i,n.isInline?-1:1))}}static findFrom(t,n,i=!1){let r=t.parent.inlineContent?new ge(t):Mi(t.node(0),t.parent,t.pos,t.index(),n,i);if(r)return r;for(let a=t.depth-1;a>=0;a--){let o=n<0?Mi(t.node(0),t.node(a),t.before(a+1),t.index(a),n,i):Mi(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,i);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new It(t.node(0))}static atStart(t){return Mi(t,t,0,0,1)||new It(t)}static atEnd(t){return Mi(t,t,t.content.size,t.childCount,-1)||new It(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=hs[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in hs)throw new RangeError("Duplicate use of selection JSON ID "+t);return hs[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ge.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class mp{constructor(t,n){this.$from=t,this.$to=n}}let Mu=!1;function Du(e){!Mu&&!e.parent.inlineContent&&(Mu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ge extends ke{constructor(t,n=t){Du(t),Du(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return ke.near(i);let r=t.resolve(n.map(this.anchor));return new ge(r.parent.inlineContent?r:i,i)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ge&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Fo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ge(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let r=t.resolve(n);return new this(r,i==n?r:t.resolve(i))}static between(t,n,i){let r=t.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let a=ke.findFrom(n,i,!0)||ke.findFrom(n,-i,!0);if(a)n=a.$head;else return ke.near(n,i)}return t.parent.inlineContent||(r==0?t=n:(t=(ke.findFrom(t,-i,!0)||ke.findFrom(t,i,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new ge(t,n)}}ke.jsonID("text",ge);class Fo{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Fo(t.map(this.anchor),t.map(this.head))}resolve(t){return ge.between(t.resolve(this.anchor),t.resolve(this.head))}}class be extends ke{constructor(t){let n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);super(t,i),this.node=n}map(t,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return i?ke.near(a):new be(a)}content(){return new ae(J.from(this.node),0,0)}eq(t){return t instanceof be&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Jl(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new be(t.resolve(n.anchor))}static create(t,n){return new be(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}be.prototype.visible=!1;ke.jsonID("node",be);class Jl{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:i}=t.mapResult(this.anchor);return n?new Fo(i,i):new Jl(i)}resolve(t){let n=t.resolve(this.anchor),i=n.nodeAfter;return i&&be.isSelectable(i)?new be(n):ke.near(n)}}class It extends ke{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let i=ke.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new It(t)}map(t){return new It(t)}eq(t){return t instanceof It}getBookmark(){return Gy}}ke.jsonID("all",It);const Gy={map(){return this},resolve(e){return new It(e)}};function Mi(e,t,n,i,r,a=!1){if(t.inlineContent)return ge.create(e,n);for(let o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){let l=t.child(o);if(l.isAtom){if(!a&&be.isSelectable(l))return be.create(e,n-(r<0?l.nodeSize:0))}else{let c=Mi(e,l,n+r,r<0?l.childCount:0,r,a);if(c)return c}n+=l.nodeSize*r}return null}function zu(e,t,n){let i=e.steps.length-1;if(i<t)return;let r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;let a=e.mapping.maps[i],o;a.forEach((l,c,u,f)=>{o==null&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}function Iu(e,t){return!t||!e?e:e.bind(t)}class ba{constructor(t,n,i){this.name=t,this.init=Iu(n.init,i),this.apply=Iu(n.apply,i)}}new ba("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ba("selection",{init(e,t){return e.selection||ke.atStart(t.doc)},apply(e){return e.selection}}),new ba("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new ba("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function hp(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):i=="handleDOMEvents"&&(r=hp(r,t,{})),n[i]=r}return n}class ct{constructor(t){this.spec=t,this.props={},t.props&&hp(t.props,this,this.props),this.key=t.key?t.key.key:bp("plugin")}getState(t){return t[this.key]}}const bs=Object.create(null);function bp(e){return e in bs?e+"$"+ ++bs[e]:(bs[e]=0,e+"$")}class rt{constructor(t="key"){this.key=bp(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const yi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},gp=function(e,t,n,i){return n&&(Ru(e,t,n,i,-1)||Ru(e,t,n,i,1))},Ky=/^(img|br|input|textarea|hr)$/i;function Ru(e,t,n,i,r){for(var a;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Ka(e))){let o=e.parentNode;if(!o||o.nodeType!=1||Zl(e)||Ky.test(e.nodeName)||e.contentEditable=="false")return!1;t=yi(e)+(r<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(r<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=o,t=r<0?Ka(e):0}else return!1}}function Ka(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Xy(e,t,n){for(let i=t==0,r=t==Ka(e);i||r;){if(e==n)return!0;let a=yi(e);if(e=e.parentNode,!e)return!1;i=i&&a==0,r=r&&a==Ka(e)}}function Zl(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const vp=function(e){return e.focusNode&&gp(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function xp(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const an=typeof navigator<"u"?navigator:null,Lu=typeof document<"u"?document:null,Jn=an&&an.userAgent||"",ol=/Edge\/(\d+)/.exec(Jn),yp=/MSIE \d/.exec(Jn),sl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jn),Lr=!!(yp||sl||ol),kp=yp?document.documentMode:sl?+sl[1]:ol?+ol[1]:0,Vo=!Lr&&/gecko\/(\d+)/i.test(Jn);Vo&&+(/Firefox\/(\d+)/.exec(Jn)||[0,0])[1];const ll=!Lr&&/Chrome\/(\d+)/.exec(Jn),Zn=!!ll,wp=ll?+ll[1]:0,ki=!Lr&&!!an&&/Apple Computer/.test(an.vendor),Ql=ki&&(/Mobile\/\w+/.test(Jn)||!!an&&an.maxTouchPoints>2),Vt=Ql||(an?/Mac/.test(an.platform):!1),_p=an?/Win/.test(an.platform):!1,Br=/Android \d/.test(Jn),Yl=!!Lu&&"webkitFontSmoothing"in Lu.documentElement.style,Jy=Yl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Zy(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=i.resolve(o),c,u;if(vp(n)){for(c=o;r&&!r.node;)r=r.parent;let m=r.node;if(r&&m.isAtom&&be.isSelectable(m)&&r.parent&&!(m.isInline&&Xy(n.focusNode,n.focusOffset,r.dom))){let p=r.posBefore;u=new be(o==p?l:i.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=o,p=o;for(let h=0;h<n.rangeCount;h++){let g=n.getRangeAt(h);m=Math.min(m,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(m<0)return null;[c,o]=p==e.state.selection.anchor?[p,m]:[m,p],l=i.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let f=i.resolve(c);if(!u){let m=t=="pointer"||e.state.selection.head<l.pos&&!a?1:-1;u=Cp(e,f,l,m)}return u}function Sp(e){return e.editable?e.hasFocus():tk(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ec(e,t=!1){let n=e.state.selection;if(ek(e,n),!Sp(e))return;let i=e.input.mouseDown;if(!t&&Zn&&i){let r=e.domSelectionRange(),a=e.domObserver.currentSelection;if(r.anchorNode&&a.anchorNode&&gp(r.anchorNode,r.anchorOffset,a.anchorNode,a.anchorOffset)&&i.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Yy(e);else{let{anchor:r,head:a}=n,o,l;Bu&&!(n instanceof ge)&&(n.$from.parent.inlineContent||(o=Pu(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=Pu(e,n.to))),e.docView.setSelection(r,a,e,t),Bu&&(o&&Fu(o),l&&Fu(l)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Qy(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const Bu=ki||Zn&&wp<63;function Pu(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,a=i?n.childNodes[i-1]:null;if(ki&&r&&r.contentEditable=="false")return gs(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return gs(r);if(a)return gs(a)}}function gs(e){return e.contentEditable="true",ki&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Fu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Qy(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Sp(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function Yy(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.collapse(n.parentNode,yi(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&Lr&&kp<=11&&(n.disabled=!0,n.disabled=!1)}function ek(e,t){if(t instanceof be){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vu(e)}function Vu(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Cp(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||ge.between(t,n,i)}function tk(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function cl(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&ke.findFrom(a,t)}function Ln(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Uu(e,t,n){let i=e.state.selection;if(i instanceof ge)if(n.indexOf("s")>-1){let{$head:r}=i,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return Ln(e,new ge(i.$anchor,o))}else if(i.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=cl(e.state,t);return r&&r instanceof be?Ln(e,r):!1}else if(!(Vt&&n.indexOf("m")>-1)){let r=i.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,o;if(!a||a.isText)return!1;let l=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?be.isSelectable(a)?Ln(e,new be(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Yl?Ln(e,new ge(e.state.doc.resolve(t<0?l:l+a.nodeSize))):!1:!1}}else return!1;else{if(i instanceof be&&i.node.isInline)return Ln(e,new ge(t>0?i.$to:i.$from));{let r=cl(e.state,t);return r?Ln(e,r):!1}}}function Xa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fr(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Ti(e,t){return t<0?nk(e):ik(e)}function nk(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,a,o=!1;for(Vo&&n.nodeType==1&&i<Xa(n)&&fr(n.childNodes[i],-1)&&(o=!0);;)if(i>0){if(n.nodeType!=1)break;{let l=n.childNodes[i-1];if(fr(l,-1))r=n,a=--i;else if(l.nodeType==3)n=l,i=n.nodeValue.length;else break}}else{if(Ep(n))break;{let l=n.previousSibling;for(;l&&fr(l,-1);)r=n.parentNode,a=yi(l),l=l.previousSibling;if(l)n=l,i=Xa(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}o?ul(e,n,i):r&&ul(e,r,a)}function ik(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r=Xa(n),a,o;for(;;)if(i<r){if(n.nodeType!=1)break;let l=n.childNodes[i];if(fr(l,1))a=n,o=++i;else break}else{if(Ep(n))break;{let l=n.nextSibling;for(;l&&fr(l,1);)a=l.parentNode,o=yi(l)+1,l=l.nextSibling;if(l)n=l,i=0,r=Xa(n);else{if(n=n.parentNode,n==e.dom)break;i=r=0}}}a&&ul(e,a,o)}function Ep(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function rk(e,t){for(;e&&t==e.childNodes.length&&!Zl(e);)t=yi(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function ak(e,t){for(;e&&!t&&!Zl(e);)t=yi(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function ul(e,t,n){if(t.nodeType!=3){let a,o;(o=rk(t,n))?(t=o,n=0):(a=ak(t,n))&&(t=a,n=a.nodeValue.length)}let i=e.domSelection();if(!i)return;if(vp(i)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&ec(e)},50)}function Hu(e,t){let n=e.state.doc.resolve(t);if(!(Zn||_p)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function qu(e,t,n){let i=e.state.selection;if(i instanceof ge&&!i.empty||n.indexOf("s")>-1||Vt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=cl(e.state,t);if(o&&o instanceof be)return Ln(e,o)}if(!r.parent.inlineContent){let o=t<0?r:a,l=i instanceof It?ke.near(o,t):ke.findFrom(o,t);return l?Ln(e,l):!1}return!1}function ju(e,t){if(!(e.state.selection instanceof ge))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let o=e.state.tr;return t<0?o.delete(n.pos-a.nodeSize,n.pos):o.delete(n.pos,n.pos+a.nodeSize),e.dispatch(o),!0}return!1}function $u(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ok(e){if(!ki||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let i=t.firstChild;$u(e,i,"true"),setTimeout(()=>$u(e,i,"false"),20)}return!1}function sk(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function lk(e,t){let n=t.keyCode,i=sk(t);if(n==8||Vt&&n==72&&i=="c")return ju(e,-1)||Ti(e,-1);if(n==46&&!t.shiftKey||Vt&&n==68&&i=="c")return ju(e,1)||Ti(e,1);if(n==13||n==27)return!0;if(n==37||Vt&&n==66&&i=="c"){let r=n==37?Hu(e,e.state.selection.from)=="ltr"?-1:1:-1;return Uu(e,r,i)||Ti(e,r)}else if(n==39||Vt&&n==70&&i=="c"){let r=n==39?Hu(e,e.state.selection.from)=="ltr"?1:-1:1;return Uu(e,r,i)||Ti(e,r)}else{if(n==38||Vt&&n==80&&i=="c")return qu(e,-1,i)||Ti(e,-1);if(n==40||Vt&&n==78&&i=="c")return ok(e)||qu(e,1,i)||Ti(e,1);if(i==(Vt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ap(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:i,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,a--;let h=i.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),i=h.content}let o=e.someProp("clipboardSerializer")||Hi.fromSchema(e.state.schema),l=zp(),c=l.createElement("div");c.appendChild(o.serializeFragment(i,{document:l}));let u=c.firstChild,f,m=0;for(;u&&u.nodeType==1&&(f=Dp[u.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let g=l.createElement(f[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),m++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${m?` -${m}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
597
+ */const Wt=Z("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),M0=["title"],Qs=s.defineComponent({__name:"ThemeToggle",setup(e){const{isDark:t,toggle:n}=Ro(),{t:i}=ht();return(r,a)=>(s.openBlock(),s.createElementBlock("button",{type:"button",class:"p-2 rounded-lg border border-slate-200 bg-slate-50 text-slate-500 transition-colors hover:border-slate-300 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-400 dark:hover:border-slate-600 dark:hover:text-slate-200",title:s.unref(t)?s.unref(i)("theme.lightMode"):s.unref(i)("theme.darkMode"),onClick:a[0]||(a[0]=(...o)=>s.unref(n)&&s.unref(n)(...o))},[s.unref(t)?(s.openBlock(),s.createBlock(s.unref(N0),{key:0,class:"h-4 w-4"})):(s.openBlock(),s.createBlock(s.unref(c0),{key:1,class:"h-4 w-4"}))],8,M0))}}),D0="data:image/png;base64,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",z0="data:image/png;base64,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",I0={class:"sticky top-0 z-40 flex h-14 flex-col border-b border-slate-200 bg-white transition-colors duration-200 dark:border-slate-800 dark:bg-[#0b1120]"},R0={class:"flex h-full w-full items-center justify-between gap-4 px-3 md:px-4"},L0={class:"flex items-center gap-3"},B0=["title"],P0=["src"],F0={class:"flex min-w-0 flex-col gap-0.5"},V0={class:"flex items-center gap-1.5"},U0=["title"],H0=["title"],q0={class:"header-menu-container hidden items-center gap-0 md:flex"},j0=["onClick","onMouseenter"],$0={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[220px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top left"}},W0={key:0,class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},G0=["onMouseenter"],K0={type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5"},X0={class:"flex items-center gap-2.5"},J0={key:0,class:"absolute left-full top-0 z-50 ml-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200"},Z0=["onClick"],Q0={class:"flex items-center gap-2.5"},Y0={key:0,class:"rounded bg-slate-100 px-1 py-0.5 text-[9px] font-mono text-slate-500 dark:bg-slate-700 dark:text-slate-400"},eg={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},tg=["onClick"],ng={class:"flex items-center gap-2.5"},ig={key:0,class:"text-blue-600 dark:text-blue-400"},rg={key:1,class:"text-[11px] text-slate-400 dark:text-slate-500"},ag={class:"flex flex-shrink-0 items-center gap-1.5"},og={key:0,class:"hidden items-center gap-2 lg:flex"},sg={class:"flex -space-x-1.5 overflow-hidden"},lg=["title"],cg={class:"drop-shadow-sm"},ug=["title"],dg={class:"hidden xl:block"},fg={class:"hidden sm:inline"},pg={class:"header-user-container relative flex-shrink-0"},mg=["title"],hg=["src","alt"],bg={key:1,class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 text-xs font-bold text-white"},gg={class:"hidden max-w-[140px] truncate text-sm font-medium text-slate-700 dark:text-slate-200 sm:inline"},vg={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[200px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},xg={class:"border-b border-slate-100 px-4 py-2 dark:border-slate-700/80"},yg={class:"truncate text-sm font-semibold text-slate-800 dark:text-slate-100"},kg={class:"header-more-container relative xl:hidden"},wg={key:0,class:"absolute right-0 top-full z-50 mt-1 min-w-[210px] rounded-lg border border-slate-200 bg-white py-1 text-sm text-slate-700 shadow-xl dark:border-slate-700 dark:bg-[#0e1525] dark:text-slate-200",style:{"transform-origin":"top right"}},_g={class:"flex items-center justify-between px-4 py-2"},Of=s.defineComponent({__name:"HeaderBar",props:{title:{default:"Untitled Document"},editable:{type:Boolean,default:!0},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},pageless:{type:Boolean,default:!1},outlineOpen:{type:Boolean,default:!1},showRuler:{type:Boolean,default:!0},focusMode:{type:Boolean,default:!1},currentUserId:{default:""},simulatorsActive:{type:Boolean,default:!1},userName:{default:""},userAvatar:{default:""}},emits:["back","update:title","toggle-star","toggle-simulators","export","share","menu-click"],setup(e,{emit:t}){const{setLocale:n,t:i}=ht(),{isDark:r}=Ro(),a=hf(),o=e,l=t,c=s.ref(!1),u=s.ref(o.title),f=s.ref(null),m=s.ref(null),p=s.ref(!1);s.watch(()=>o.title,R=>{u.value=R});const h=async()=>{var R,N;c.value=!0,await s.nextTick(),(R=f.value)==null||R.focus(),(N=f.value)==null||N.select()},g=()=>{const R=u.value.trim();R&&R!==o.title&&l("update:title",R),u.value=o.title,c.value=!1},b=s.computed(()=>r.value?D0:z0),y=R=>R.split(" ").map(N=>N[0]).join("").slice(0,2).toUpperCase(),v=R=>{l("export",R),m.value=null},x=s.computed(()=>y(o.userName)||"?"),k=s.ref(!1),w=typeof navigator<"u"&&/mac/i.test(navigator.platform);function S(R){return w?`⌘${R}`:`Ctrl+${R.replace("⇧","Shift+")}`}const A=s.computed(()=>({File:{label:i("header.file"),items:[{label:i("header.new"),icon:su,sub:[{label:i("header.newDocument"),action:"new-doc",icon:su},{label:i("header.helpMeCreate"),action:"new-help-me-create",icon:Un},{label:i("header.fromTemplate"),action:"new-from-template",icon:Yb}]},{label:i("header.open"),action:"open-doc",icon:qb},{label:i("header.makeACopy"),action:"duplicate",icon:$s},{label:"divider",divider:!0},{label:i("header.share"),action:"share",icon:pu},{label:i("header.email"),action:"email",icon:Ws},{label:i("header.download"),icon:Fb,sub:[{label:i("header.docx"),action:"export:docx",badge:"DOCX",icon:dt},{label:i("header.pdf"),action:"export:pdf",badge:"PDF",icon:dt},{label:i("header.odt"),action:"export:odt",badge:"ODT",icon:dt},{label:i("header.txt"),action:"export:txt",badge:"TXT",icon:dt},{label:i("header.rtf"),action:"export:rtf",badge:"RTF",icon:dt},{label:i("header.htmlZip"),action:"export:html-zip",badge:"ZIP",icon:dt},{label:i("header.html"),action:"export:html",badge:"HTML",icon:dt},{label:i("header.markdown"),action:"export:markdown",badge:"MD",icon:dt}]},{label:"divider",divider:!0},{label:i("header.rename"),action:"rename",icon:jl},{label:i("header.move"),action:"move",icon:Hb},{label:i("header.addToStarred"),action:"add-to-starred",icon:mu},{label:i("header.moveToTrash"),action:"trash",icon:kr},{label:"divider",divider:!0},{label:i("header.versionHistory"),action:"version-history",icon:Ul},{label:"divider",divider:!0},{label:i("header.details"),action:"details",icon:Jb},{label:i("header.security"),action:"security",icon:C0},{label:"divider",divider:!0},{label:i("header.language"),icon:Qb,sub:a.map(R=>({label:mf(R),action:`set-locale:${R}`}))},{label:i("header.pageSetup"),action:"page-setup",icon:_0},{label:i("header.print"),action:"print",icon:Cf}]},Edit:{label:i("header.edit"),items:[{label:i("header.undo"),action:"undo",shortcut:S("Z"),icon:Nf},{label:i("header.redo"),action:"redo",shortcut:S("Y"),icon:Ef},{label:"divider",divider:!0},{label:i("header.cut"),action:"cut",shortcut:S("X"),icon:y0},{label:i("header.copy"),action:"copy",shortcut:S("C"),icon:$s},{label:i("header.paste"),action:"paste",shortcut:S("V"),icon:ou},{label:i("header.pasteWithoutFormatting"),action:"paste-without-formatting",shortcut:S("⇧V"),icon:ou},{label:"divider",divider:!0},{label:i("header.selectAll"),action:"select-all",shortcut:S("A"),icon:yr},{label:i("header.delete"),action:"delete",icon:kr},{label:"divider",divider:!0},{label:i("header.findAndReplace"),action:"find-replace",shortcut:S("⇧H"),icon:xr}]},View:{label:i("header.view"),items:[{label:i("header.showSidebar"),action:"toggle-left-sidebar",checked:o.outlineOpen,icon:f0},{label:"divider",divider:!0},{label:i("header.focusMode"),action:"toggle-focus-mode",checked:o.focusMode,icon:r0},{label:i("header.showRuler"),action:"toggle-ruler",checked:o.showRuler,icon:v0}]},Insert:{label:i("header.insert"),items:[{label:i("header.meetingNotes"),action:"meeting-notes",icon:d0},{label:i("header.emailDraft"),action:"email-draft",icon:Ws},{label:"divider",divider:!0},{label:i("header.image"),action:"insert-image",icon:Kb},{label:i("header.table"),action:"insert-table",icon:Tf},{label:i("header.codeBlock"),action:"insert-code",icon:Bb},{label:i("header.horizontalLine"),action:"horizontal-line",icon:Gs},{label:"divider",divider:!0},{label:i("header.link"),action:"insert-link",shortcut:S("K"),icon:ql},{label:"divider",divider:!0},{label:i("header.smartElements"),icon:Un,sub:[{label:i("header.dateChip"),action:"insert-date-chip",icon:Vl},{label:i("header.peopleChip"),action:"insert-people-chip",icon:us},{label:i("header.fileChip"),action:"insert-file-chip",icon:dt},{label:i("header.dropdownChip"),action:"insert-dropdown-chip",icon:en},{label:i("header.locationChip"),action:"insert-location-chip",icon:i0}]},{label:"divider",divider:!0},{label:i("header.break"),icon:w0,sub:[{label:i("header.pageBreak"),action:"insert-page-break",shortcut:i("header.pageBreakShortcut"),icon:Gs}]},{label:"divider",divider:!0},{label:i("header.header"),action:"insert-header",icon:lu},{label:i("header.footer"),action:"insert-footer",icon:du},{label:i("header.footnote"),action:"insert-footnote",icon:Vn},{label:i("header.tableOfContents"),action:"insert-toc",icon:Vn},{label:"divider",divider:!0},{label:i("header.pageNumbers"),icon:Ua,sub:[{label:i("header.pageNumberInHeader"),action:"page-numbers-header",icon:lu},{label:i("header.pageNumberInFooter"),action:"page-numbers-footer",icon:du}]}]},Format:{label:i("header.format"),items:[{label:i("header.bold"),action:"bold",icon:Fl},{label:i("header.italic"),action:"italic",icon:Hl},{label:i("header.underline"),action:"underline",icon:$l},{label:"divider",divider:!0},{label:i("header.heading1"),action:"heading1",icon:xf},{label:i("header.heading2"),action:"heading2",icon:yf},{label:i("header.heading3"),action:"heading3",icon:kf},{label:"divider",divider:!0},{label:i("header.alignIndent"),icon:t0,sub:[{label:i("header.alignLeft"),action:"align-left",icon:yr},{label:i("header.alignCenter"),action:"align-center",icon:Xs},{label:i("header.alignRight"),action:"align-right",icon:Js},{label:i("header.alignJustify"),action:"align-justify",icon:Zs}]},{label:i("header.bulletsNumbering"),icon:Vn,sub:[{label:i("header.bulletList"),action:"bullet-list",icon:Vn},{label:i("header.numberedList"),action:"numbered-list",icon:_f},{label:i("header.taskList"),action:"task-list",icon:e0}]},{label:"divider",divider:!0},{label:i("header.pagelessFormat"),action:"toggle-pageless",checked:o.pageless,icon:k0},{label:"divider",divider:!0},{label:i("header.clearFormatting"),action:"clear-formatting",icon:b0}]},Tools:{label:i("header.tools"),items:[{label:i("header.spellCheck"),action:"spellcheck",icon:Af},{label:i("header.wordCount"),action:"word-count",icon:Ua},{label:"divider",divider:!0},{label:i("header.preferences"),action:"preferences",icon:E0}]},Extensions:{label:i("header.extensions"),items:[{label:i("header.manageExtensions"),action:"manage-extensions",icon:m0}]},Help:{label:i("header.help"),items:[{label:i("header.keyboardShortcuts"),action:"keyboard-shortcuts",icon:Zb},{label:"divider",divider:!0},{label:i("header.reportIssue"),action:"report-issue",icon:Nb},{label:i("header.about"),action:"about",icon:Rb}]}})),I=s.computed(()=>Object.keys(A.value)),_=s.ref(null),E=R=>{const N=m.value!==R;m.value=N?R:null,_.value=null,p.value=N},z=s.ref(!1),P=()=>{z.value=!z.value},U=s.ref(!1),V=R=>{n(R),U.value=!1},B=s.ref(!1),j=()=>{B.value=!B.value},$=R=>{if(R.startsWith("export:")){const N=R.replace("export:","");v(N)}else if(R==="share")l("share"),m.value=null;else if(R==="add-to-starred")l("toggle-star"),m.value=null;else if(R==="rename")h(),m.value=null;else if(R.startsWith("set-locale:")){const N=R.replace("set-locale:","");V(N)}else l("menu-click",R);_.value=null,p.value=!1},Y=R=>{const N=R.target;N.closest(".header-menu-container")||(m.value=null,_.value=null,p.value=!1),N.closest(".header-more-container")||(z.value=!1),N.closest(".header-user-container")||(B.value=!1)};function W(R){p.value&&m.value!==R&&(m.value=R,_.value=null)}function oe(R){m.value&&R.key==="Escape"&&(m.value=null,_.value=null,p.value=!1)}return s.onMounted(()=>{document.addEventListener("click",Y,!0),document.addEventListener("keydown",oe)}),s.onUnmounted(()=>{document.removeEventListener("click",Y,!0),document.removeEventListener("keydown",oe)}),(R,N)=>(s.openBlock(),s.createElementBlock("header",I0,[s.createElementVNode("div",R0,[s.createElementVNode("div",L0,[s.createElementVNode("button",{type:"button",class:"flex h-9 cursor-pointer items-center justify-center hover:opacity-90 transition-opacity",title:s.unref(i)("header.backToDocuments"),onClick:N[0]||(N[0]=L=>l("back"))},[s.createElementVNode("img",{src:b.value,alt:"Docflow",class:"h-9 w-auto"},null,8,P0)],8,B0),s.createElementVNode("div",F0,[s.createElementVNode("div",V0,[c.value?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,ref_key:"titleInputEl",ref:f,"onUpdate:modelValue":N[1]||(N[1]=L=>u.value=L),type:"text",class:"min-w-[150px] border-b-2 border-cyan-500 bg-transparent px-1 py-0 text-sm font-semibold text-slate-800 focus:outline-none dark:text-slate-100 md:min-w-[240px]",onBlur:g,onKeydown:s.withKeys(g,["enter"])},null,544)),[[s.vModelText,u.value]]):(s.openBlock(),s.createElementBlock("h1",{key:1,class:"max-w-[180px] cursor-text truncate rounded px-1 py-0 text-sm font-semibold text-slate-800 hover:bg-slate-50 dark:text-slate-100 dark:hover:bg-slate-800/60 md:max-w-[280px]",title:s.unref(i)("header.clickToRename"),onClick:N[2]||(N[2]=L=>void h())},s.toDisplayString(o.title),9,U0)),s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-400 transition-colors hover:text-amber-500",title:e.starred?s.unref(i)("header.unstarDocument"):s.unref(i)("header.starDocument"),onClick:N[3]||(N[3]=L=>l("toggle-star"))},[s.createVNode(s.unref(mu),{class:s.normalizeClass(["h-4 w-4",e.starred?"fill-amber-400 text-amber-500":""])},null,8,["class"])],8,H0)]),s.createElementVNode("nav",q0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,L=>(s.openBlock(),s.createElementBlock("div",{key:L,class:"relative"},[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex items-center gap-0.5 rounded px-2 py-0.5 text-[13px] transition-colors",m.value===L?"bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300":"text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800"]),onClick:s.withModifiers(D=>E(L),["stop"]),onMouseenter:D=>W(L)},s.toDisplayString(A.value[L].label),43,j0),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[m.value===L?(s.openBlock(),s.createElementBlock("div",$0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value[L].items,(D,K)=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:K},[D.divider?(s.openBlock(),s.createElementBlock("div",W0)):D.sub?(s.openBlock(),s.createElementBlock("div",{key:1,class:"relative",onMouseenter:ne=>_.value=`${L}-${K}`,onMouseleave:N[4]||(N[4]=ne=>_.value=null)},[s.createElementVNode("button",K0,[s.createElementVNode("span",X0,[D.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(D.label),1)]),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 -rotate-90 text-slate-400"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-100 ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"transition-all duration-75 ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 translate-x-2"},{default:s.withCtx(()=>[_.value===`${L}-${K}`?(s.openBlock(),s.createElementBlock("div",J0,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.sub,ne=>(s.openBlock(),s.createElementBlock("button",{key:ne.action,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(ee=>$(ne.action),["stop"])},[s.createElementVNode("span",Q0,[ne.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(ne.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(ne.label),1)]),ne.badge?(s.openBlock(),s.createElementBlock("span",Y0,s.toDisplayString(ne.badge),1)):ne.shortcut?(s.openBlock(),s.createElementBlock("span",eg,s.toDisplayString(ne.shortcut),1)):s.createCommentVNode("",!0)],8,Z0))),128))])):s.createCommentVNode("",!0)]),_:2},1024)],40,G0)):(s.openBlock(),s.createElementBlock("button",{key:2,type:"button",class:"flex w-full items-center justify-between gap-6 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:s.withModifiers(ne=>$(D.action),["stop"])},[s.createElementVNode("span",ng,[D.icon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{key:0,class:"h-4 w-4 shrink-0 text-slate-400 dark:text-slate-500"})):s.createCommentVNode("",!0),s.createTextVNode(" "+s.toDisplayString(D.label),1)]),D.checked?(s.openBlock(),s.createElementBlock("span",ig,[s.createVNode(s.unref(Va),{class:"h-3.5 w-3.5"})])):D.shortcut?(s.openBlock(),s.createElementBlock("span",rg,s.toDisplayString(D.shortcut),1)):s.createCommentVNode("",!0)],8,tg))],64))),128))])):s.createCommentVNode("",!0)]),_:2},1024)]))),128))])])]),s.createElementVNode("div",ag,[e.collaborators.length>0?(s.openBlock(),s.createElementBlock("div",og,[s.createElementVNode("div",sg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.collaborators,L=>(s.openBlock(),s.createElementBlock("div",{key:L.userId,class:"flex h-7 w-7 flex-shrink-0 cursor-help items-center justify-center rounded-full border-2 border-white text-[10px] font-bold text-white dark:border-slate-900",style:s.normalizeStyle({backgroundColor:L.color}),title:`${L.name} ${L.userId===e.currentUserId?"(You)":""} ${L.isTyping?"is typing...":""}`},[s.createElementVNode("span",cg,s.toDisplayString(y(L.name)),1)],12,lg))),128))])])):s.createCommentVNode("",!0),s.renderSlot(R.$slots,"actions"),e.editable?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:s.normalizeClass(["hidden h-8 w-8 items-center justify-center rounded-md transition-all xl:flex",e.simulatorsActive?"animate-pulse bg-emerald-600 text-white hover:bg-emerald-700":"text-indigo-600 hover:bg-slate-100 dark:text-indigo-300 dark:hover:bg-slate-800"]),title:s.unref(i)("header.sandbox"),onClick:N[5]||(N[5]=L=>l("toggle-simulators"))},[s.createVNode(s.unref(us),{class:"h-[18px] w-[18px]"})],10,ug)):s.createCommentVNode("",!0),s.createElementVNode("div",dg,[s.createVNode(Qs)]),s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-[13px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:N[6]||(N[6]=L=>l("share"))},[s.createVNode(s.unref(pu),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",fg,s.toDisplayString(s.unref(i)("header.share")),1)]),s.createElementVNode("div",pg,[s.createElementVNode("button",{type:"button",class:"flex h-8 items-center gap-1.5 rounded-full py-0.5 pl-0.5 pr-1.5 transition-colors hover:bg-slate-100 dark:hover:bg-slate-800",title:e.userName,onClick:s.withModifiers(j,["stop"])},[e.userAvatar&&!k.value?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.userAvatar,alt:e.userName,referrerpolicy:"no-referrer",class:"h-7 w-7 flex-shrink-0 rounded-full object-cover",onError:N[7]||(N[7]=L=>k.value=!0)},null,40,hg)):(s.openBlock(),s.createElementBlock("span",bg,s.toDisplayString(x.value),1)),s.createElementVNode("span",gg,s.toDisplayString(e.userName||s.unref(i)("header.account")),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],8,mg),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[B.value?(s.openBlock(),s.createElementBlock("div",vg,[s.createElementVNode("div",xg,[s.createElementVNode("p",yg,s.toDisplayString(e.userName||s.unref(i)("header.account")),1)]),s.renderSlot(R.$slots,"user-menu",{close:()=>B.value=!1})])):s.createCommentVNode("",!0)]),_:3})]),s.createElementVNode("div",kg,[s.createElementVNode("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800",title:"More",onClick:s.withModifiers(P,["stop"])},[s.createVNode(s.unref(gf),{class:"h-[18px] w-[18px]"})]),s.createVNode(s.Transition,{"enter-active-class":"transition-all duration-150 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-[-4px]","enter-to-class":"opacity-100 scale-100 translate-y-0","leave-active-class":"transition-all duration-100 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0","leave-to-class":"opacity-0 scale-95 translate-y-[-4px]"},{default:s.withCtx(()=>[z.value?(s.openBlock(),s.createElementBlock("div",wg,[s.renderSlot(R.$slots,"overflow-actions",{close:()=>z.value=!1}),e.editable?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-white/5",onClick:N[8]||(N[8]=L=>{l("toggle-simulators"),z.value=!1})},[s.createVNode(s.unref(us),{class:"h-4 w-4 text-slate-400"}),s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.sandbox")),1)])):s.createCommentVNode("",!0),N[9]||(N[9]=s.createElementVNode("div",{class:"my-1 border-t border-slate-100 dark:border-slate-700/80"},null,-1)),s.createElementVNode("div",_g,[s.createElementVNode("span",null,s.toDisplayString(s.unref(i)("header.theme")),1),s.createVNode(Qs)])])):s.createCommentVNode("",!0)]),_:3})])])])]))}}),Sg={class:"mb-3 grid grid-cols-10 gap-1.5"},Cg=["title","onClick"],Eg={class:"space-y-2"},Ag=["title","onClick"],Tg={class:"mt-3 border-t border-slate-100 pt-3 dark:border-slate-700"},Ng={class:"mb-2 text-[10px] font-semibold uppercase tracking-wide text-slate-500 dark:text-slate-400"},Og={class:"flex items-center gap-2"},Mg={class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 dark:border-slate-600"},hu=s.defineComponent({__name:"ColorPickerDropdown",props:{isOpen:{type:Boolean},activeColor:{},defaultColor:{},label:{}},emits:["select","reset","close"],setup(e,{emit:t}){const n=e,i=t,r=[["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#ffffff"],["#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff"],["#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"],["#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd"],["#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0"],["#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79"],["#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"],["#5b0f00","#660000","#783f04","#7f6000","#274e13","#0c343d","#1c4587","#073763","#20124d","#4a1130"]],a=s.ref("#000000"),o=s.ref(null);s.watch(()=>n.isOpen,m=>{m&&(a.value=n.activeColor||"#000000")});function l(m){i("select",m)}function c(){i("reset")}function u(){i("select",a.value)}function f(m){m.target===m.currentTarget&&i("close")}return(m,p)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"color-picker-dropdown absolute left-0 top-full z-50 mt-1.5 w-[272px] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-slate-700 dark:bg-[#0e1525]",onClick:f},[s.createElementVNode("div",Sg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r[0],h=>(s.openBlock(),s.createElementBlock("button",{key:h,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:h}),title:h,onClick:g=>l(h)},null,12,Cg))),128))]),s.createElementVNode("div",Eg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.slice(1),(h,g)=>(s.openBlock(),s.createElementBlock("div",{key:g,class:"grid grid-cols-10 gap-1.5"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h,b=>(s.openBlock(),s.createElementBlock("button",{key:b,type:"button",class:"h-5 w-5 rounded-full border border-slate-200 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-cyan-500 dark:border-slate-600",style:s.normalizeStyle({backgroundColor:b}),title:b,onClick:y=>l(b)},null,12,Ag))),128))]))),128))]),s.createElementVNode("div",Tg,[s.createElementVNode("div",Ng,s.toDisplayString(m.$props.label||"Custom"),1),s.createElementVNode("div",Og,[s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-slate-50 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-800 dark:hover:bg-slate-700",onClick:p[0]||(p[0]=h=>{var g;return(g=o.value)==null?void 0:g.click()})},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5 text-slate-600 dark:text-slate-300"})]),s.withDirectives(s.createElementVNode("input",{ref_key:"customInput",ref:o,"onUpdate:modelValue":p[1]||(p[1]=h=>a.value=h),type:"color",class:"sr-only",onChange:u},null,544),[[s.vModelText,a.value]]),s.createElementVNode("div",Mg,[s.createElementVNode("div",{class:"h-4 w-4 rounded-full",style:s.normalizeStyle({backgroundColor:a.value})},null,4)]),s.createElementVNode("button",{type:"button",class:"ml-auto flex h-6 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:c},[s.createVNode(s.unref(jl),{class:"h-3 w-3"}),p[2]||(p[2]=s.createTextVNode(" Default ",-1))])])])])):s.createCommentVNode("",!0)}}),Dg={id:"editor-toolbar-row",class:"docs-editor-toolbar w-full border-b border-slate-200 bg-white py-1.5 text-slate-600 shadow-sm dark:border-slate-800 dark:bg-[#0b1120] dark:text-slate-300"},zg={class:"flex min-h-9 w-full items-center gap-1 px-3 flex-nowrap"},Ig=["title","aria-label","disabled"],Rg=["title","aria-label","disabled"],Lg=["title","aria-label"],Bg=["title","aria-label","disabled"],Pg=["title","aria-label"],Fg={class:"toolbar-dropdown relative flex-shrink-0"},Vg=["title","aria-label","disabled"],Ug={class:"truncate"},Hg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},qg=["disabled","onClick"],jg={class:"toolbar-dropdown relative flex-shrink-0"},$g=["title","aria-label","disabled"],Wg={class:"truncate"},Gg={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},Kg=["onClick"],Xg=["title","aria-label","disabled"],Jg=["value","title","aria-label","disabled","onKeydown"],Zg=["title","aria-label","disabled"],Qg=["title","aria-label","disabled","onClick"],Yg={key:1,class:"text-xs font-medium leading-none"},ev={key:0,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},tv={key:1,class:"toolbar-dropdown relative flex-shrink-0"},nv=["title","aria-label","disabled"],iv={key:2,class:"toolbar-dropdown relative flex-shrink-0"},rv=["title","aria-label","disabled"],av={key:3,class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},ov={key:4,class:"toolbar-dropdown relative flex-shrink-0"},sv=["title","aria-label","disabled"],lv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[180px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},cv=["disabled","onClick"],uv={key:5,class:"toolbar-dropdown relative flex-shrink-0"},dv=["title","aria-label","disabled"],fv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[160px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},pv=["disabled","onClick"],mv={key:6,class:"toolbar-dropdown relative flex-shrink-0"},hv=["title","aria-label","disabled"],bv={class:"hidden md:inline"},gv={key:0,class:"absolute left-0 top-full z-50 mt-1 min-w-[190px] rounded-lg border border-slate-200 bg-white py-1 text-sm shadow-xl dark:border-slate-700 dark:bg-[#0e1525]"},vv=["disabled","onClick"],xv=["title","aria-label"],yv=["title","aria-label"],kv=["title","aria-label"],wv=["title","aria-label"],_v=["title","aria-label"],Sv="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Cv="text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",St="docs-editor-toolbar__control inline-flex h-8 flex-shrink-0 items-center justify-center rounded-md p-1 text-slate-600 transition-all disabled:opacity-40 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5",Ev="bg-slate-200 text-slate-900 dark:bg-slate-700 dark:text-slate-100",Av="text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 hover:bg-slate-100 dark:hover:bg-white/5",bu=11,Tv=1,Nv=400,Mf=s.defineComponent({__name:"EditorToolbar",props:{actions:{},plugins:{},editor:{},activeSidebar:{}},emits:["toggle-sidebar","print","undo","redo","toggle-left-sidebar"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a={Bold:Fl,Italic:Hl,Underline:$l,Strikethrough:T0,Heading1:xf,Heading2:yf,Heading3:kf,Heading4:$b,Heading5:Wb,Heading6:Gb,List:Vn,ListOrdered:_f,CheckSquare:A0,Quote:Ha,Link:wf,Code:Pb,Image:Xb,Table:Tf,AlignLeft:yr,AlignCenter:Xs,AlignRight:Js,AlignJustify:Zs,FileText:dt,Palette:uu,Highlighter:cu};function o(O){return O?a[O]??null:null}const l=s.computed(()=>{const O=[];for(const F of i.plugins??[])!F.toolbar||F.toolbar.length===0||O.push({pluginId:F.id,items:F.toolbar});return O}),c=s.ref(0);function u(){c.value++}s.watch(()=>i.editor,(O,F)=>{F&&F.off("transaction",u),O&&O.on("transaction",u)},{immediate:!0}),s.onUnmounted(()=>{i.editor&&i.editor.off("transaction",u)});function f(O){c.value;const F=i.editor;if(!F)return!1;switch(O.action){case"toggleBold":return F.isActive("bold");case"toggleItalic":return F.isActive("italic");case"toggleUnderline":return F.isActive("underline");case"toggleStrike":return F.isActive("strike");case"toggleHeading1":return F.isActive("heading",{level:1});case"toggleHeading2":return F.isActive("heading",{level:2});case"toggleHeading3":return F.isActive("heading",{level:3});case"toggleHeading4":return F.isActive("heading",{level:4});case"toggleHeading5":return F.isActive("heading",{level:5});case"toggleHeading6":return F.isActive("heading",{level:6});case"toggleBulletList":return F.isActive("bulletList");case"toggleOrderedList":return F.isActive("orderedList");case"toggleTaskList":return F.isActive("taskList");case"toggleBlockquote":return F.isActive("blockquote");case"toggleCodeBlock":return F.isActive("codeBlock");case"setLink":return F.isActive("link");case"alignLeft":return F.isActive({textAlign:"left"});case"alignCenter":return F.isActive({textAlign:"center"});case"alignRight":return F.isActive({textAlign:"right"});case"alignJustify":return F.isActive({textAlign:"justify"});default:return!1}}function m(O){if(!i.editor)return;const F=i.actions[O.action];if(typeof F=="function"){F(...O.args??[]),i.editor.commands.focus();return}const X=i.editor.commands[O.action];typeof X=="function"&&(X(...O.args??[]),i.editor.commands.focus())}const p=s.computed(()=>{var O;return c.value,(O=i.editor)==null?void 0:O.getAttributes("textStyle").color}),h=s.computed(()=>{var F,X;c.value;const O=(F=i.editor)==null?void 0:F.getAttributes("highlight");if(O!=null&&O.color)return O.color;if((X=i.editor)!=null&&X.isActive("highlight"))return"#ffff00"});function g(O,F){var ze,Xe,He;const X=i.actions[O];if(typeof X=="function")X(F);else{const un=(Xe=(ze=i.editor)==null?void 0:ze.commands)==null?void 0:Xe[O];typeof un=="function"&&un(F)}(He=i.editor)==null||He.commands.focus(),B.value=null}function b(O){var X,ze,Xe,He;const F=(X=i.editor)==null?void 0:X.chain().focus();if(!F){B.value=null;return}O==="setTextColor"?(ze=F.unsetColor)==null||ze.call(F).run():O==="setHighlight"&&((Xe=F.unsetHighlight)==null||Xe.call(F).run()),(He=i.editor)==null||He.commands.focus(),B.value=null}const y=["toggleHeading1","toggleHeading2","toggleHeading3","toggleHeading4","toggleHeading5","toggleHeading6"],v=["alignLeft","alignCenter","alignRight","alignJustify"],x=["toggleBulletList","toggleOrderedList","toggleTaskList"],k=["setLink","insertImage","insertTable","toggleBlockquote","toggleCodeBlock","insertFootnote","insertPageBreak","setPageBreak","togglePageBreak","addPageBreak"],w=["setTextColor","setHighlight"],S=s.computed(()=>l.value.flatMap(O=>O.items)),A=s.computed(()=>S.value.filter(O=>v.includes(O.action))),I=s.computed(()=>S.value.filter(O=>x.includes(O.action))),_=s.computed(()=>S.value.filter(O=>k.includes(O.action))),E=s.computed(()=>S.value.filter(O=>w.includes(O.action))),z=s.computed(()=>E.value.find(O=>O.action==="setTextColor")),P=s.computed(()=>E.value.find(O=>O.action==="setHighlight")),U=s.computed(()=>S.value.filter(O=>!y.includes(O.action)&&!v.includes(O.action)&&!x.includes(O.action)&&!k.includes(O.action)&&!w.includes(O.action))),V=s.computed(()=>{c.value;const O=i.editor;if(O){if(O.isActive({textAlign:"center"}))return Xs;if(O.isActive({textAlign:"right"}))return Js;if(O.isActive({textAlign:"justify"}))return Zs}return yr}),B=s.ref(null);function j(O){B.value=B.value===O?null:O}function $(O){m(O),B.value=null}function Y(O){O.target.closest(".toolbar-dropdown")||(B.value=null)}s.onMounted(()=>document.addEventListener("click",Y,!0)),s.onUnmounted(()=>document.removeEventListener("click",Y,!0));function W(O){return i.activeSidebar===O?Ev:Av}const oe=s.computed(()=>{var O;return((O=i.plugins)==null?void 0:O.some(F=>F.id==="citation"))??!1}),R=s.computed(()=>{var O,F,X;return!!((X=(F=(O=i.editor)==null?void 0:O.storage)==null?void 0:F.editorContext)!=null&&X.aiStream)});function N(){i.editor&&(i.editor.commands.undo(),i.editor.commands.focus()),r("undo")}function L(){i.editor&&(i.editor.commands.redo(),i.editor.commands.focus()),r("redo")}function D(){r("print")}const K=s.computed(()=>[{value:"paragraph",label:n("toolbar.normalText")},{value:"heading-1",label:n("header.heading1")},{value:"heading-2",label:n("header.heading2")},{value:"heading-3",label:n("header.heading3")},{value:"heading-4",label:n("header.heading4")},{value:"heading-5",label:n("header.heading5")},{value:"heading-6",label:n("header.heading6")}]);function ne(O){const F=i.editor;if(F){if(O==="paragraph")F.commands.setParagraph();else{const X=parseInt(O.replace("heading-",""),10),ze=i.actions[`toggleHeading${X}`];typeof ze=="function"?ze():F.commands.toggleHeading({level:X})}F.commands.focus()}B.value=null}const ee=s.computed(()=>{c.value;const O=i.editor;if(!O)return"paragraph";for(let F=1;F<=6;F++)if(O.isActive("heading",{level:F}))return`heading-${F}`;return"paragraph"}),ie=s.computed(()=>{var O;return((O=K.value.find(F=>F.value===ee.value))==null?void 0:O.label)??n("toolbar.normalText")}),G=[{value:"arial",label:"Arial"},{value:"inter",label:"Inter"},{value:"serif",label:"Serif"},{value:"mono",label:"Monospace"}],H=s.ref("arial"),q=s.computed(()=>{var O;return((O=G.find(F=>F.value===H.value))==null?void 0:O.label)??"Arial"});function re(O){var F;H.value=O,B.value=null,(F=i.editor)==null||F.commands.focus()}const ce=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72],fe=s.computed(()=>{var ze;c.value;const O=i.editor;if(!O)return bu;const F=O.getAttributes("textStyle");if(F!=null&&F.fontSize){const Xe=parseInt(F.fontSize,10);if(!isNaN(Xe))return Xe}const X=O.state.storedMarks;if(X){for(const Xe of X)if(Xe.type.name==="textStyle"&&Xe.attrs.fontSize){const He=parseInt(Xe.attrs.fontSize,10);if(!isNaN(He))return He}}if((ze=O.view)!=null&&ze.dom){const Xe=parseFloat(getComputedStyle(O.view.dom).fontSize);if(!isNaN(Xe)){const He=Math.round(Xe);return ce.reduce((Nn,Yn)=>Math.abs(Yn-He)<Math.abs(Nn-He)?Yn:Nn)}}return bu});function Oe(O){if(!i.editor)return;const F=fe.value,X=ce.indexOf(F);let ze;X>=0?ze=ce[Math.min(Math.max(X+O,0),ce.length-1)]:O<0?ze=[...ce].reverse().find(He=>He<F)??ce[0]:ze=ce.find(He=>He>F)??F,i.editor.commands.setFontSize(`${ze}px`),i.editor.commands.focus()}const pe=s.ref(null);function Se(O){pe.value=String(fe.value),O.target.select()}function ut(O){pe.value=O.target.value}function Jt(O){if(!i.editor)return;const F=Math.min(Math.max(O,Tv),Nv);i.editor.commands.setFontSize(`${F}px`)}function Le(O){var X;const F=parseInt(O.target.value,10);!isNaN(F)&&F!==fe.value&&Jt(F),pe.value=null,(X=i.editor)==null||X.commands.focus()}function Ut(O){var X;pe.value=null;const F=O.target;F.value=String(fe.value),F.blur(),(X=i.editor)==null||X.commands.focus()}return(O,F)=>(s.openBlock(),s.createElementBlock("div",Dg,[s.createElementVNode("div",zg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.undo"),"aria-label":s.unref(n)("toolbar.undo"),disabled:!e.editor,onMousedown:F[0]||(F[0]=s.withModifiers(()=>{},["prevent"])),onClick:N},[s.createVNode(s.unref(Nf),{class:"h-[18px] w-[18px]"})],42,Ig),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.redo"),"aria-label":s.unref(n)("toolbar.redo"),disabled:!e.editor,onMousedown:F[1]||(F[1]=s.withModifiers(()=>{},["prevent"])),onClick:L},[s.createVNode(s.unref(Ef),{class:"h-[18px] w-[18px]"})],42,Rg),F[39]||(F[39]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.print"),"aria-label":s.unref(n)("toolbar.print"),onMousedown:F[2]||(F[2]=s.withModifiers(()=>{},["prevent"])),onClick:D},[s.createVNode(s.unref(Cf),{class:"h-[18px] w-[18px]"})],42,Lg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:s.unref(n)("toolbar.spelling"),"aria-label":s.unref(n)("toolbar.spelling"),disabled:!e.editor,onMousedown:F[3]||(F[3]=s.withModifiers(()=>{},["prevent"]))},[s.createVNode(s.unref(Af),{class:"h-[18px] w-[18px]"})],42,Bg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"px-2 text-xs"]),title:s.unref(n)("toolbar.zoom"),"aria-label":s.unref(n)("toolbar.zoom"),onMousedown:F[4]||(F[4]=s.withModifiers(()=>{},["prevent"]))},s.toDisplayString(s.unref(n)("toolbar.zoom")),43,Pg),F[40]||(F[40]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("div",Fg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-[116px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.paragraphStyle"),"aria-label":s.unref(n)("toolbar.paragraphStyle"),disabled:!e.editor,onMousedown:F[5]||(F[5]=s.withModifiers(()=>{},["prevent"])),onClick:F[6]||(F[6]=s.withModifiers(X=>j("heading"),["stop"]))},[s.createElementVNode("span",Ug,s.toDisplayString(ie.value),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,Vg),B.value==="heading"?(s.openBlock(),s.createElementBlock("div",Hg,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(K.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",ee.value===X.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[7]||(F[7]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>ne(X.value)},s.toDisplayString(X.label),43,qg))),128))])):s.createCommentVNode("",!0)]),s.createElementVNode("div",jg,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-[100px] justify-between gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.fontFamily"),"aria-label":s.unref(n)("toolbar.fontFamily"),disabled:!e.editor,onMousedown:F[8]||(F[8]=s.withModifiers(()=>{},["prevent"])),onClick:F[9]||(F[9]=s.withModifiers(X=>j("font"),["stop"]))},[s.createElementVNode("span",Wg,s.toDisplayString(q.value),1),s.createVNode(s.unref(en),{class:"h-3.5 w-3.5 flex-shrink-0 text-slate-400"})],42,$g),B.value==="font"?(s.openBlock(),s.createElementBlock("div",Gg,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(G,X=>s.createElementVNode("button",{key:X.value,type:"button",class:s.normalizeClass(["flex w-full items-center px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",H.value===X.value?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),onMousedown:F[10]||(F[10]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>re(X.value)},s.toDisplayString(X.label),43,Kg)),64))])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-7 text-sm"]),title:s.unref(n)("toolbar.decreaseFontSize"),"aria-label":s.unref(n)("toolbar.decreaseFontSize"),disabled:!e.editor,onMousedown:F[11]||(F[11]=s.withModifiers(X=>Oe(-1),["prevent"]))},[s.createVNode(s.unref(Gs),{class:"h-3.5 w-3.5"})],42,Xg),s.createElementVNode("input",{type:"text",inputmode:"numeric",class:"h-8 w-8 flex-shrink-0 rounded border border-transparent bg-transparent text-center text-xs text-slate-700 outline-none transition hover:border-slate-300 focus:border-cyan-400 focus:bg-white disabled:opacity-40 dark:text-slate-200 dark:hover:border-slate-600 dark:focus:bg-slate-800",value:pe.value??String(fe.value),title:s.unref(n)("toolbar.fontSize"),"aria-label":s.unref(n)("toolbar.fontSize"),disabled:!e.editor,onFocus:Se,onInput:ut,onKeydown:[F[12]||(F[12]=s.withKeys(s.withModifiers(X=>X.target.blur(),["prevent"]),["enter"])),s.withKeys(s.withModifiers(Ut,["prevent"]),["esc"])],onBlur:Le},null,40,Jg),s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-7 text-sm"]),title:s.unref(n)("toolbar.increaseFontSize"),"aria-label":s.unref(n)("toolbar.increaseFontSize"),disabled:!e.editor,onMousedown:F[13]||(F[13]=s.withModifiers(X=>Oe(1),["prevent"]))},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5"})],42,Zg),F[41]||(F[41]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(U.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",title:X.label??X.id,"aria-label":X.label??X.id,class:s.normalizeClass(["docs-editor-toolbar__button inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md p-1 transition-all disabled:opacity-40",f(X)?Sv:Cv]),disabled:!e.editor,onMousedown:F[14]||(F[14]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>m(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-[18px] w-[18px]"})):X.label?(s.openBlock(),s.createElementBlock("span",Yg,s.toDisplayString(X.label.charAt(0)),1)):s.createCommentVNode("",!0)],42,Qg))),128)),E.value.length?(s.openBlock(),s.createElementBlock("span",ev)):s.createCommentVNode("",!0),z.value?(s.openBlock(),s.createElementBlock("div",tv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:z.value.label??"Text color","aria-label":z.value.label??"Text color",disabled:!e.editor,onMousedown:F[15]||(F[15]=s.withModifiers(()=>{},["prevent"])),onClick:F[16]||(F[16]=s.withModifiers(X=>j("textColor"),["stop"]))},[s.createVNode(s.unref(uu),{class:"h-[18px] w-[18px]"})],42,nv),s.createVNode(hu,{"is-open":B.value==="textColor","active-color":p.value,label:"Custom",onSelect:F[17]||(F[17]=X=>g("setTextColor",X)),onReset:F[18]||(F[18]=X=>b("setTextColor")),onClose:F[19]||(F[19]=X=>B.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),P.value?(s.openBlock(),s.createElementBlock("div",iv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"w-8"]),title:P.value.label??"Highlight","aria-label":P.value.label??"Highlight",disabled:!e.editor,onMousedown:F[20]||(F[20]=s.withModifiers(()=>{},["prevent"])),onClick:F[21]||(F[21]=s.withModifiers(X=>j("highlight"),["stop"]))},[s.createVNode(s.unref(cu),{class:"h-[18px] w-[18px]"})],42,rv),s.createVNode(hu,{"is-open":B.value==="highlight","active-color":h.value,label:"Custom",onSelect:F[22]||(F[22]=X=>g("setHighlight",X)),onReset:F[23]||(F[23]=X=>b("setHighlight")),onClose:F[24]||(F[24]=X=>B.value=null)},null,8,["is-open","active-color"])])):s.createCommentVNode("",!0),I.value.length||A.value.length||_.value.length?(s.openBlock(),s.createElementBlock("span",av)):s.createCommentVNode("",!0),I.value.length?(s.openBlock(),s.createElementBlock("div",ov,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.lists"),"aria-label":s.unref(n)("toolbar.lists"),disabled:!e.editor,onMousedown:F[25]||(F[25]=s.withModifiers(()=>{},["prevent"])),onClick:F[26]||(F[26]=s.withModifiers(X=>j("lists"),["stop"]))},[s.createVNode(s.unref(Vn),{class:"h-[18px] w-[18px]"}),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,sv),B.value==="lists"?(s.openBlock(),s.createElementBlock("div",lv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(I.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[27]||(F[27]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,cv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),A.value.length?(s.openBlock(),s.createElementBlock("div",uv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-0.5 px-1.5"]),title:s.unref(n)("toolbar.alignment"),"aria-label":s.unref(n)("toolbar.alignment"),disabled:!e.editor,onMousedown:F[28]||(F[28]=s.withModifiers(()=>{},["prevent"])),onClick:F[29]||(F[29]=s.withModifiers(X=>j("align"),["stop"]))},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(V.value),{class:"h-[18px] w-[18px]"})),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,dv),B.value==="align"?(s.openBlock(),s.createElementBlock("div",fv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(A.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[30]||(F[30]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,pv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),_.value.length?(s.openBlock(),s.createElementBlock("div",mv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([St,"gap-1 px-2 text-xs font-medium"]),title:s.unref(n)("toolbar.insert"),"aria-label":s.unref(n)("toolbar.insert"),disabled:!e.editor,onMousedown:F[31]||(F[31]=s.withModifiers(()=>{},["prevent"])),onClick:F[32]||(F[32]=s.withModifiers(X=>j("insert"),["stop"]))},[s.createVNode(s.unref($n),{class:"h-4 w-4"}),s.createElementVNode("span",bv,s.toDisplayString(s.unref(n)("toolbar.insert")),1),s.createVNode(s.unref(en),{class:"h-3 w-3 text-slate-400"})],42,hv),B.value==="insert"?(s.openBlock(),s.createElementBlock("div",gv,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(_.value,X=>(s.openBlock(),s.createElementBlock("button",{key:X.id,type:"button",class:s.normalizeClass(["flex w-full items-center gap-2.5 px-3 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",f(X)?"text-blue-600 dark:text-blue-300":"text-slate-700 dark:text-slate-200"]),disabled:!e.editor,onMousedown:F[33]||(F[33]=s.withModifiers(()=>{},["prevent"])),onClick:ze=>$(X)},[o(X.iconComponent)?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o(X.iconComponent)),{key:0,class:"h-4 w-4"})):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(X.label??X.id),1)],42,vv))),128))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),F[42]||(F[42]=s.createElementVNode("span",{class:"mx-1 h-5 w-px flex-shrink-0 bg-slate-200 dark:bg-white/10"},null,-1)),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all relative",W("comments")]),title:s.unref(n)("toolbar.comments"),"aria-label":s.unref(n)("toolbar.comments"),onClick:F[34]||(F[34]=X=>r("toggle-sidebar","comments"))},[s.createVNode(s.unref(Sf),{class:"h-[18px] w-[18px]"})],10,xv),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("history")]),title:s.unref(n)("toolbar.history"),"aria-label":s.unref(n)("toolbar.history"),onClick:F[35]||(F[35]=X=>r("toggle-sidebar","history"))},[s.createVNode(s.unref(Ul),{class:"h-[18px] w-[18px]"})],10,yv),R.value?(s.openBlock(),s.createElementBlock("button",{key:7,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("ai")]),title:s.unref(n)("toolbar.ai"),"aria-label":s.unref(n)("toolbar.ai"),onClick:F[36]||(F[36]=X=>r("toggle-sidebar","ai"))},[s.createVNode(s.unref(Un),{class:"h-[18px] w-[18px]"})],10,kv)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("toc")]),title:s.unref(n)("toolbar.tableOfContents"),"aria-label":s.unref(n)("toolbar.tableOfContents"),onClick:F[37]||(F[37]=X=>r("toggle-sidebar","toc"))},[s.createVNode(s.unref(dt),{class:"h-[18px] w-[18px]"})],10,wv),oe.value?(s.openBlock(),s.createElementBlock("button",{key:8,type:"button",class:s.normalizeClass(["docs-editor-toolbar__control flex h-8 w-8 items-center justify-center rounded-md transition-all",W("references")]),title:s.unref(n)("toolbar.references"),"aria-label":s.unref(n)("toolbar.references"),onClick:F[38]||(F[38]=X=>r("toggle-sidebar","references"))},[s.createVNode(s.unref(js),{class:"h-[18px] w-[18px]"})],10,_v)):s.createCommentVNode("",!0)])]))}}),Ov={key:0,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-cyan-600 dark:text-cyan-400"},Mv=["title"],Dv=["disabled"],zv=["onClick"],Iv={key:0,class:"relative"},Rv={key:0,class:"absolute left-0 top-full z-10 mt-1 flex min-w-44 flex-col rounded-xl border border-slate-200 bg-white p-1 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]"},Lv=["onClick"],gu="bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold",Bv="text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-white/5 hover:text-slate-900 dark:hover:text-white",Pv=s.defineComponent({__name:"BubbleMenu",props:{visible:{type:Boolean},actions:{},position:{},editor:{}},emits:["chat"],setup(e,{emit:t}){const n=e,i=t,r=s.ref(0),a=s.ref(!1);function o(){r.value++}s.watch(()=>n.editor,(v,x)=>{x&&x.off("transaction",o),v&&v.on("transaction",o)},{immediate:!0}),s.onUnmounted(()=>{n.editor&&n.editor.off("transaction",o)}),s.watch(r,()=>{a.value=!1});const l=s.computed(()=>{var v,x,k,w;return r.value,[{id:"bold",label:"Bold",action:"toggleBold",icon:Fl,active:(v=n.editor)==null?void 0:v.isActive("bold")},{id:"italic",label:"Italic",action:"toggleItalic",icon:Hl,active:(x=n.editor)==null?void 0:x.isActive("italic")},{id:"underline",label:"Underline",action:"toggleUnderline",icon:$l,active:(k=n.editor)==null?void 0:k.isActive("underline")},{id:"link",label:"Link",action:"setLink",icon:wf,active:(w=n.editor)==null?void 0:w.isActive("link")}]}),c=s.computed(()=>{var v,x,k;return r.value,!!((k=(x=(v=n.editor)==null?void 0:v.storage)==null?void 0:x.editorContext)!=null&&k.aiStream)}),u=s.computed(()=>{var v,x,k;return r.value,((k=(x=(v=n.editor)==null?void 0:v.storage)==null?void 0:x.ai)==null?void 0:k.preview)??null}),f=[{id:"rewrite",label:"Rewrite",action:"rewrite"},{id:"summarize",label:"Summarize",action:"summarize"},{id:"grammar",label:"Fix grammar",action:"grammar"},{id:"tone",label:"Make formal",action:"tone",prompt:"make it more formal"},{id:"translate",label:"Translate to English",action:"translate",prompt:"translate to English"},{id:"expand",label:"Expand",action:"expand"},{id:"shorten",label:"Shorten",action:"shorten"}];function m(){var v;return((v=n.editor)==null?void 0:v.commands)??null}function p(v){var x;a.value=!1,(x=m())==null||x.aiTransform({action:v.action,...v.prompt?{prompt:v.prompt}:{}})}function h(){var v;(v=m())==null||v.aiAccept()}function g(){var v;(v=m())==null||v.aiReject()}const b=s.computed(()=>n.position?{top:`${n.position.top}px`,left:`${n.position.left}px`}:{});function y(v){var k,w,S,A,I;if(v==="setLink"){if((k=n.editor)!=null&&k.isActive("link")){n.editor.chain().focus().unsetLink().run();return}const _=typeof window<"u"?window.prompt("Enter link URL:","https://"):null;if(_){const E=n.actions[v];typeof E=="function"?E({href:_,target:"_blank"}):(A=(S=(w=n.editor)==null?void 0:w.chain().focus()).setLink)==null||A.call(S,{href:_,target:"_blank"}).run()}return}const x=n.actions[v];if(typeof x=="function")x();else if(n.editor){const _=n.editor.chain().focus();(I=_[v])==null||I.call(_).run()}}return(v,x)=>e.visible?(s.openBlock(),s.createElementBlock("div",{key:0,"data-testid":"bubble-menu",class:"docs-editor-bubble-menu fixed z-50 flex gap-1 rounded-xl border border-slate-200 bg-white p-1.5 shadow-2xl dark:border-white/10 dark:bg-[#0c1329]",style:s.normalizeStyle(b.value),onMousedown:x[2]||(x[2]=s.withModifiers(()=>{},["prevent"]))},[u.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[u.value.status==="streaming"?(s.openBlock(),s.createElementBlock("span",Ov,[s.createVNode(s.unref(n0),{class:"h-3.5 w-3.5 animate-spin"}),x[3]||(x[3]=s.createElementVNode("span",null,"AI writing…",-1))])):u.value.status==="error"?(s.openBlock(),s.createElementBlock("span",{key:1,class:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-red-600 dark:text-red-400",title:u.value.error},[s.createVNode(s.unref(zb),{class:"h-3.5 w-3.5"}),x[4]||(x[4]=s.createElementVNode("span",null,"AI error",-1))],8,Mv)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",disabled:u.value.status!=="done",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",u.value.status!=="done"?"cursor-not-allowed text-slate-300 dark:text-slate-600":"text-emerald-600 hover:bg-emerald-50 dark:text-emerald-400 dark:hover:bg-emerald-500/10"]),title:"Accept (Enter)",onClick:h},[s.createVNode(s.unref(Va),{class:"h-3.5 w-3.5"}),x[5]||(x[5]=s.createElementVNode("span",null,"Accept",-1))],10,Dv),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all","text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-500/10"]),title:"Reject (Esc)",onClick:g},[s.createVNode(s.unref(Wt),{class:"h-3.5 w-3.5"}),x[6]||(x[6]=s.createElementVNode("span",null,"Reject",-1))])],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(l.value,k=>(s.openBlock(),s.createElementBlock("button",{key:k.id,type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",k.active?gu:Bv]),onClick:w=>y(k.action)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(k.icon),{class:"h-3.5 w-3.5"})),s.createElementVNode("span",null,s.toDisplayString(k.label),1)],10,zv))),128)),c.value?(s.openBlock(),s.createElementBlock("div",Iv,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all",a.value?gu:"text-cyan-600 hover:bg-cyan-50 dark:text-cyan-400 dark:hover:bg-cyan-500/10"]),onClick:x[0]||(x[0]=k=>a.value=!a.value)},[s.createVNode(s.unref(Un),{class:"h-3.5 w-3.5"}),x[7]||(x[7]=s.createElementVNode("span",null,"AI",-1))],2),a.value?(s.openBlock(),s.createElementBlock("div",Rv,[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(f,k=>s.createElementVNode("button",{key:k.id,type:"button",class:"flex items-center gap-2 rounded-lg px-3 py-1.5 text-left text-xs font-semibold text-slate-600 transition-all hover:bg-slate-100 hover:text-slate-900 dark:text-slate-300 dark:hover:bg-white/5 dark:hover:text-white",onClick:w=>p(k)},[s.createElementVNode("span",null,s.toDisplayString(k.label),1)],8,Lv)),64))])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0),c.value?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",title:"Chat (⌘L / Ctrl+L)",class:s.normalizeClass(["docs-editor-bubble-menu__button flex items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs font-semibold transition-all","text-violet-600 hover:bg-violet-50 dark:text-violet-400 dark:hover:bg-violet-500/10"]),"data-testid":"bubble-chat",onClick:x[1]||(x[1]=k=>{a.value=!1,i("chat")})},[s.createVNode(s.unref(s0),{class:"h-3.5 w-3.5"}),x[8]||(x[8]=s.createElementVNode("span",null,"Chat",-1))])):s.createCommentVNode("",!0)],64))],36)):s.createCommentVNode("",!0)}}),Df=Pl(Pv,[["__scopeId","data-v-d407c8e2"]]),Fv={id:"editor-footer-row",class:"flex h-9 flex-shrink-0 items-center justify-between border-t border-slate-200 bg-white px-4 font-sans text-[11px] text-slate-400 dark:border-slate-800 dark:bg-[#0b1120]"},Vv={class:"flex items-center gap-2"},Uv={class:"flex items-center gap-1 font-bold"},Hv={key:0,class:"relative mr-1 flex h-2 w-2"},qv={key:1,class:"relative mr-1 flex h-2 w-2"},jv={key:2,class:"font-mono text-[10px] uppercase tracking-wide text-emerald-600 dark:text-cyan-400"},$v={key:3,class:"font-mono text-[10px] uppercase tracking-wide text-amber-600 dark:text-amber-500"},Wv={class:"flex items-center gap-1.5 font-sans text-[11px] font-medium text-slate-500 dark:text-slate-400"},Gv={key:0,class:"animate-pulse font-semibold text-cyan-600 dark:text-cyan-400"},Kv={key:1,class:"font-semibold text-amber-600 dark:text-amber-500"},Xv={key:2,class:"flex items-center gap-1"},Jv={class:"rounded bg-slate-100 px-1.5 py-0.5 font-mono text-[10px] text-slate-700 dark:bg-white/5 dark:text-slate-300"},Zv={class:"flex items-center gap-3 font-semibold text-slate-400 dark:text-slate-500"},Qv=["value","title","aria-label"],Yv=["value"],e1={key:0,class:"font-medium text-slate-500 dark:text-slate-400"},t1={key:1},n1={class:"font-mono text-slate-600 dark:text-slate-300"},i1={class:"font-mono text-slate-600 dark:text-slate-300"},r1={class:"font-mono text-slate-600 dark:text-slate-300"},a1={class:"font-mono text-slate-600 dark:text-slate-300"},zf=s.defineComponent({__name:"StatusBar",props:{connectionState:{default:"connected"},savingStatus:{default:"saved"},lastSaved:{default:void 0},wordCount:{default:0},charCount:{default:0},pageCount:{default:1},currentPage:{default:1},pageSize:{default:"a4"},pageSizes:{default:()=>[]},pageless:{type:Boolean,default:!1}},emits:["update:pageSize"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.computed(()=>i.lastSaved?new Date(i.lastSaved).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):n("statusBar.never")),o=s.computed(()=>{var l,c;return((c=(l=i.pageSizes)==null?void 0:l.find(u=>u.id===i.pageSize))==null?void 0:c.name)??i.pageSize.toUpperCase()});return(l,c)=>(s.openBlock(),s.createElementBlock("footer",Fv,[s.createElementVNode("div",Vv,[s.createElementVNode("span",Uv,[e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",Hv,[...c[1]||(c[1]=[s.createElementVNode("span",{class:"absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75"},null,-1),s.createElementVNode("span",{class:"relative inline-flex h-2 w-2 rounded-full bg-emerald-500"},null,-1)])])):(s.openBlock(),s.createElementBlock("span",qv,[...c[2]||(c[2]=[s.createElementVNode("span",{class:"h-2 w-2 animate-spin rounded-full border border-amber-500 border-t-transparent"},null,-1)])])),e.connectionState==="connected"?(s.openBlock(),s.createElementBlock("span",jv,s.toDisplayString(s.unref(n)("statusBar.liveSyncActive")),1)):(s.openBlock(),s.createElementBlock("span",$v,s.toDisplayString(s.unref(n)("statusBar.connecting")),1))]),c[3]||(c[3]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"|",-1)),s.createElementVNode("span",Wv,[s.createVNode(s.unref(h0),{class:s.normalizeClass(["h-3 w-3",e.savingStatus==="saving"?"animate-spin text-cyan-500":"text-emerald-500"])},null,8,["class"]),e.savingStatus==="saving"?(s.openBlock(),s.createElementBlock("span",Gv,s.toDisplayString(s.unref(n)("statusBar.saving")),1)):e.savingStatus==="offline"?(s.openBlock(),s.createElementBlock("span",Kv,s.toDisplayString(s.unref(n)("statusBar.offline")),1)):(s.openBlock(),s.createElementBlock("span",Xv,[s.createElementVNode("span",null,s.toDisplayString(s.unref(n)("statusBar.lastSavedAt")),1),s.createElementVNode("strong",Jv,s.toDisplayString(a.value),1)]))])]),s.createElementVNode("div",Zv,[s.createElementVNode("select",{value:e.pageSize,title:o.value,class:"h-6 cursor-pointer rounded border border-slate-200 bg-white px-1.5 py-0.5 text-[11px] font-medium text-slate-600 outline-none hover:border-slate-300 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300","aria-label":s.unref(n)("statusBar.pageSize"),onChange:c[0]||(c[0]=u=>r("update:pageSize",u.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.pageSizes,u=>(s.openBlock(),s.createElementBlock("option",{key:u.id,value:u.id},s.toDisplayString(u.name),9,Yv))),128))],40,Qv),c[4]||(c[4]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),e.pageless?(s.openBlock(),s.createElementBlock("span",e1,s.toDisplayString(s.unref(n)("statusBar.pageless")),1)):(s.openBlock(),s.createElementBlock("span",t1,[s.createTextVNode(s.toDisplayString(s.unref(n)("statusBar.page"))+" ",1),s.createElementVNode("strong",n1,s.toDisplayString(e.currentPage),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.of"))+" ",1),s.createElementVNode("strong",i1,s.toDisplayString(e.pageCount),1)])),c[5]||(c[5]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",r1,s.toDisplayString(e.wordCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.words")),1)]),c[6]||(c[6]=s.createElementVNode("span",{class:"text-slate-200 dark:text-white/10"},"•",-1)),s.createElementVNode("span",null,[s.createElementVNode("strong",a1,s.toDisplayString(e.charCount),1),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("statusBar.characters")),1)])])]))}}),o1={class:"docs-editor-ruler relative h-6 w-full flex-shrink-0 overflow-hidden border-b border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e]"},s1={class:"absolute inset-x-0 top-2.5 h-full"},l1={key:0,class:"absolute -top-2 left-0.5 text-[9px] text-slate-400"},c1=s.defineComponent({__name:"RulerBar",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var o,l;return{pageWidth:((o=t.layoutOptions)==null?void 0:o.pageWidth)??794,margins:((l=t.layoutOptions)==null?void 0:l.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const o=Math.floor(n.value.pageWidth/48);return Array.from({length:o+1},(l,c)=>c*48)}),r=s.computed(()=>`${n.value.margins.left}px`),a=s.computed(()=>`${n.value.pageWidth-n.value.margins.right}px`);return(o,l)=>(s.openBlock(),s.createElementBlock("div",o1,[s.createElementVNode("div",{class:"absolute inset-y-0 mx-auto h-full",style:s.normalizeStyle({width:`${n.value.pageWidth}px`,left:"50%",transform:"translateX(-50%)"})},[s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:r.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",{class:"absolute top-0 z-10 h-0 w-0 border-l-[4px] border-r-[4px] border-t-[6px] border-l-transparent border-r-transparent border-t-blue-400",style:s.normalizeStyle({left:a.value,transform:"translateX(-4px)"})},null,4),s.createElementVNode("div",s1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,c=>(s.openBlock(),s.createElementBlock("div",{key:c,class:s.normalizeClass(["absolute top-0 border-l border-slate-300 dark:border-slate-600",c%96===0?"h-3":"h-1.5"]),style:s.normalizeStyle({left:`${c}px`})},[c%96===0&&c>0?(s.openBlock(),s.createElementBlock("span",l1,s.toDisplayString(c/96),1)):s.createCommentVNode("",!0)],6))),128))])],4)]))}}),u1={class:"relative h-full w-full"},d1={key:0,class:"absolute -top-2 right-3 text-[9px] text-slate-400"},f1=s.defineComponent({__name:"VerticalRuler",props:{layoutOptions:{}},setup(e){const t=e,n=s.computed(()=>{var r,a;return{pageHeight:((r=t.layoutOptions)==null?void 0:r.pageHeight)??1123,margins:((a=t.layoutOptions)==null?void 0:a.margins)??{top:96,bottom:96,left:96,right:96}}}),i=s.computed(()=>{const r=Math.floor(n.value.pageHeight/48);return Array.from({length:r+1},(a,o)=>o*48)});return(r,a)=>(s.openBlock(),s.createElementBlock("div",{class:"docs-editor-vertical-ruler sticky top-0 hidden w-6 flex-shrink-0 border-r border-slate-200 bg-slate-50 dark:border-slate-800 dark:bg-[#0a0f1e] lg:block",style:s.normalizeStyle({minHeight:`${n.value.pageHeight}px`})},[s.createElementVNode("div",u1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.value,o=>(s.openBlock(),s.createElementBlock("div",{key:o,class:s.normalizeClass(["absolute right-0 border-t border-slate-300 dark:border-slate-600",o%96===0?"w-3":"w-1.5"]),style:s.normalizeStyle({top:`${o}px`})},[o%96===0&&o>0?(s.openBlock(),s.createElementBlock("span",d1,s.toDisplayString(o/96),1)):s.createCommentVNode("",!0)],6))),128))])],4))}});function p1(e,t){try{const n=e.state.doc.nodeAt(t);if(!n||n.type.name!=="heading")return null;const i=e.view.nodeDOM(t);return i instanceof HTMLElement?i:(i==null?void 0:i.parentElement)instanceof HTMLElement?i.parentElement:null}catch{return null}}const m1={class:"toc-sidebar flex h-full w-80 flex-shrink-0 flex-col border-r border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},h1={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},b1={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},g1={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},v1=["title"],x1={key:0,class:"px-4 pb-2 pt-3"},y1={class:"relative flex items-center"},k1=["placeholder"],w1={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},_1={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},S1={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},C1={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},E1={class:"mt-1.5 max-w-[200px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},A1={class:"mt-5 w-full space-y-2 px-4 font-sans"},T1={class:"mb-1.5 block text-left text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},N1=["onClick"],O1={class:"flex items-center gap-1.5"},M1={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},D1={class:"text-xs font-semibold"},z1={class:"mt-1 text-[10px] text-slate-400"},I1={key:2,class:"space-y-1 font-sans"},R1={class:"mb-2.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},L1={class:"relative ml-1.5 space-y-1.5 border-l border-slate-100 pl-1.5 dark:border-white/5"},B1=["onClick"],P1={class:"flex min-w-0 flex-1 items-center gap-2"},F1={class:"border-t border-slate-200 bg-slate-50/50 p-3.5 text-[10px] leading-relaxed text-slate-400 dark:border-white/5 dark:bg-slate-900/30 dark:text-slate-500"},V1={class:"flex items-start gap-1.5"},U1=60,If=s.defineComponent({__name:"TOCSidebar",props:{editor:{}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref([]),o=s.ref(""),l=s.ref(null);let c=null;function u(){c!==null&&clearTimeout(c),c=setTimeout(()=>{c=null,f()},U1)}function f(){if(!n.editor)return;const v=[];n.editor.state.doc.descendants((x,k)=>{if(x.type.name==="heading"){if(x.attrs.tocExclude===!0||x.attrs["data-toc-exclude"]==="true"||x.attrs["data-toc-exclude"]===!0)return!0;const w=x.attrs.level;if(w===1||w===2||w===3){const S=x.textContent.trim();v.push({id:`heading-${k}`,text:S||r("sidebars.toc.untitledHeading").replace("{level}",String(w)),level:w,pos:k})}}return!0}),a.value=v}function m(){const v=n.editor;if(!v)return;const{from:x}=v.state.selection,k=v.state.doc.resolve(Math.max(0,x-1));for(let w=k.depth;w>0;w--){const S=k.node(w);if(S&&S.type.name==="heading"){l.value=`heading-${k.before(w+1)-1}`;return}}l.value=null}s.onMounted(()=>{var v,x;f(),m(),(v=n.editor)==null||v.on("update",u),(x=n.editor)==null||x.on("selectionUpdate",m)}),s.onUnmounted(()=>{var v,x;(v=n.editor)==null||v.off("update",u),(x=n.editor)==null||x.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null)}),s.watch(()=>n.editor,(v,x)=>{x==null||x.off("update",u),x==null||x.off("selectionUpdate",m),c!==null&&(clearTimeout(c),c=null),f(),m(),v==null||v.on("update",u),v==null||v.on("selectionUpdate",m)});const p=s.computed(()=>a.value.filter(v=>v.text.toLowerCase().includes(o.value.toLowerCase())));function h(v){if(!n.editor)return;const x=n.editor;x.chain().focus().setTextSelection(v.pos).run(),l.value=v.id,setTimeout(()=>{var A;const k=document.querySelector(".docs-editor-scroll");if(!k)return;const w=p1(x,v.pos);if(w){w.scrollIntoView({behavior:"smooth",block:"center"});return}const S=k.querySelectorAll(".ProseMirror h1, .ProseMirror h2, .ProseMirror h3");for(const I of Array.from(S))if(((A=I.textContent)==null?void 0:A.trim())===v.text){I.scrollIntoView({behavior:"smooth",block:"center"});return}},50)}function g(v){if(!n.editor)return;const x=r(v===1?"header.heading1":v===2?"header.heading2":"header.heading3"),k=r("sidebars.toc.newSection"),w=r("sidebars.toc.startWriting");n.editor.chain().focus().insertContent(`<h${v}>${k.replace("{tag}",x)}</h${v}><p>${w}</p>`).run()}function b(v,x){const k="group w-full flex items-center justify-between rounded-lg p-1.5 text-left transition-all relative",w="bg-cyan-500/10 text-cyan-600 dark:text-cyan-400",S="text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-white/5";return v===1?[k,x?w:S,"pl-0 font-bold text-xs text-slate-800 dark:text-slate-200"]:v===2?[k,x?w:S,"pl-3.5 font-semibold text-[11px] text-slate-600 dark:text-slate-300"]:[k,x?w:S,"pl-6 text-[10px] text-slate-400 dark:text-slate-400"]}function y(v){return v===1?"bg-cyan-500":v===2?"bg-emerald-500":"bg-amber-500"}return(v,x)=>(s.openBlock(),s.createElementBlock("div",m1,[s.createElementVNode("div",h1,[s.createElementVNode("div",null,[s.createElementVNode("h3",b1,[s.createVNode(s.unref(Vn),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.title")),1)]),s.createElementVNode("p",g1,s.toDisplayString(s.unref(r)("sidebars.toc.empty")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.toc.closeOutline"),onClick:x[0]||(x[0]=k=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,v1)]),a.value.length>0?(s.openBlock(),s.createElementBlock("div",x1,[s.createElementVNode("div",y1,[s.createVNode(s.unref(xr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=k=>o.value=k),type:"text",placeholder:s.unref(r)("sidebars.toc.searchHeadings"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,k1),[[s.vModelText,o.value]]),o.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:x[2]||(x[2]=k=>o.value="")},[s.createVNode(s.unref(Wt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),s.createElementVNode("div",w1,[a.value.length===0?(s.openBlock(),s.createElementBlock("div",_1,[s.createElementVNode("div",S1,[s.createVNode(s.unref(Vn),{class:"h-6 w-6"})]),s.createElementVNode("h4",C1,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadings")),1),s.createElementVNode("p",E1,s.toDisplayString(s.unref(r)("sidebars.toc.noHeadingsDescription")),1),s.createElementVNode("div",A1,[s.createElementVNode("span",T1,s.toDisplayString(s.unref(r)("sidebars.toc.quickInsert")),1),(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList([1,2,3],k=>s.createElementVNode("button",{key:k,type:"button",class:"flex w-full items-center justify-between rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-[11px] font-semibold text-slate-700 transition-all hover:bg-slate-100 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:w=>g(k)},[s.createElementVNode("span",O1,[s.createVNode(s.unref(Ua),{class:s.normalizeClass(["h-3 w-3",k===1?"text-cyan-500":k===2?"text-emerald-500":"text-amber-500"])},null,8,["class"]),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.toc.headingLevel").replace("{level}",String(k))),1)]),s.createVNode(s.unref($n),{class:"h-3.5 w-3.5 text-slate-400"})],8,N1)),64))])])):p.value.length===0?(s.openBlock(),s.createElementBlock("div",M1,[s.createVNode(s.unref(xr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",D1,s.toDisplayString(s.unref(r)("sidebars.toc.noMatchingHeaders")),1),s.createElementVNode("p",z1,s.toDisplayString(s.unref(r)("sidebars.toc.tryDifferentTerm")),1)])):(s.openBlock(),s.createElementBlock("div",I1,[s.createElementVNode("span",R1,s.toDisplayString(s.unref(r)("sidebars.toc.outlineLayout")),1),s.createElementVNode("div",L1,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(p.value,k=>(s.openBlock(),s.createElementBlock("button",{key:k.id,type:"button",class:s.normalizeClass(b(k.level,l.value===k.id)),onClick:w=>h(k)},[s.createElementVNode("div",P1,[s.createElementVNode("span",{class:s.normalizeClass(["h-1.5 w-1.5 shrink-0 rounded-full transition-all",[y(k.level),l.value===k.id?"scale-125 opacity-100":"opacity-40 group-hover:scale-110 group-hover:opacity-100"]])},null,2),s.createElementVNode("span",{class:s.normalizeClass(["flex-1 truncate leading-tight",l.value===k.id?"text-cyan-600 dark:text-cyan-400":""])},s.toDisplayString(k.text),3)]),s.createVNode(s.unref(Mb),{class:s.normalizeClass(["h-3 w-3 shrink-0 text-cyan-500 opacity-0 transition-opacity group-hover:opacity-100",l.value===k.id?"opacity-100 text-cyan-600 dark:text-cyan-400":""])},null,8,["class"])],10,B1))),128))])]))]),s.createElementVNode("div",F1,[s.createElementVNode("div",V1,[s.createVNode(s.unref(u0),{class:"mt-0.5 h-3.5 w-3.5 shrink-0 text-cyan-500"}),s.createElementVNode("p",null,s.toDisplayString(s.unref(r)("sidebars.toc.outlineSync")),1)])])]))}}),H1={class:"references-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all animate-fadeIn dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},q1={class:"flex items-center justify-between border-b border-slate-200 p-4 dark:border-white/5"},j1={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},$1={class:"mt-1 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},W1=["title"],G1={class:"border-b border-slate-100 px-4 pb-3 pt-3 dark:border-white/5"},K1={class:"mb-1.5 block text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},X1=["value"],J1=["value"],Z1={class:"flex items-center gap-2 px-4 pb-2 pt-3"},Q1={class:"relative flex flex-1 items-center"},Y1=["placeholder"],ex=["title"],tx={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},nx={key:0,class:"flex flex-col items-center justify-center py-12 text-center"},ix={class:"mb-3 rounded-full bg-cyan-500/10 p-3 text-cyan-500 dark:bg-cyan-400/5"},rx={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},ax={class:"mt-1.5 max-w-[220px] text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},ox={key:1,class:"flex flex-col items-center justify-center py-12 text-center text-slate-400"},sx={class:"text-xs font-semibold"},lx={key:2,class:"space-y-2 font-sans"},cx={class:"min-w-0 flex-1"},ux=["title"],dx={class:"mt-0.5 truncate text-[10px] text-slate-500 dark:text-slate-400"},fx={key:0},px={key:1},mx={key:2},hx={class:"mt-1.5 inline-block rounded bg-slate-200/70 px-1.5 py-0.5 text-[9px] font-mono uppercase tracking-wide text-slate-500 dark:bg-white/10 dark:text-slate-400"},bx={class:"mt-2.5 flex items-center gap-1.5"},gx=["onClick"],vx=["title","onClick"],xx=["title","onClick"],yx={key:0,class:"border-t border-slate-200 dark:border-white/5"},kx={key:0,class:"space-y-3 px-4 pb-4"},wx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},_x={class:"flex items-center gap-1.5"},Sx=["placeholder"],Cx=["disabled","title"],Ex={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Ax=["disabled"],Tx={key:0,class:"text-[10px] leading-relaxed text-slate-500 dark:text-slate-400"},Nx={class:"flex items-center gap-2 border-b border-slate-100 px-4 py-3 dark:border-white/5"},Ox=["title"],Mx={class:"text-xs font-bold text-slate-700 dark:text-slate-300"},Dx={class:"custom-scrollbar flex-1 overflow-y-auto p-4"},zx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Ix=["value"],Rx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Lx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Bx={class:"space-y-2"},Px=["onUpdate:modelValue","placeholder"],Fx=["onUpdate:modelValue","placeholder"],Vx=["onClick"],Ux={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Hx={key:0},qx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},jx={key:1,class:"grid grid-cols-2 gap-2"},$x={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Wx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Gx={key:2,class:"grid grid-cols-3 gap-2"},Kx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Xx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Jx={class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},Zx={key:3},Qx={key:4},Yx={class:"flex items-center gap-2 pt-1.5"},ey=["disabled"],ty=s.defineComponent({__name:"ReferencesSidebar",props:{sources:{},activeStyle:{},pickerMode:{type:Boolean,default:!1},availableStyles:{default:()=>[{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)"},{id:"chicago-author-date",name:"Chicago (author-date)"},{id:"apa",name:"APA"},{id:"modern-language-association",name:"MLA"}]},canImport:{type:Boolean,default:!1},importing:{type:Boolean,default:!1},importMessage:{default:""}},emits:["close","insert","create","update","remove","update:style","import-doi","import-bibliography"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=["book","article-journal","chapter","webpage","report","thesis","document"];function l(G){const H=G.author??[];if(H.length===0)return r("sidebars.references.anonymous");const q=H[0],re=q.family??q.literal??"";return H.length>1?`${re} ${r("sidebars.references.etAl")}`:re}function c(G){var q,re;const H=(re=(q=G.issued)==null?void 0:q["date-parts"])==null?void 0:re[0];return H!=null&&H[0]?String(H[0]):""}function u(G){const H=`sidebars.references.types.${G}`,q=r(H);return q===H?G:q}const f=s.computed(()=>{const G=a.value.trim().toLowerCase();return G?n.sources.filter(H=>[H.title,H["container-title"],H.publisher,H.DOI,H.URL,...(H.author??[]).map(re=>`${re.family??""} ${re.given??""} ${re.literal??""}`)].filter(Boolean).join(" ").toLowerCase().includes(G)):n.sources}),m=s.ref("list"),p=s.ref(null),h=s.ref("book"),g=s.ref(""),b=s.ref([{family:"",given:""}]),y=s.ref(""),v=s.ref(""),x=s.ref(""),k=s.ref(""),w=s.ref(""),S=s.ref(""),A=s.ref(""),I=s.ref(""),_=s.ref("");function E(){h.value="book",g.value="",b.value=[{family:"",given:""}],y.value="",v.value="",x.value="",k.value="",w.value="",S.value="",A.value="",I.value="",_.value=""}function z(){p.value=null,E(),m.value="form"}function P(G){p.value=G.id,h.value=G.type||"book",g.value=G.title??"",b.value=(G.author??[]).filter(q=>!q.literal).map(q=>({family:q.family??"",given:q.given??""}));const H=(G.author??[]).find(q=>q.literal);b.value.length===0&&(b.value=[{family:(H==null?void 0:H.literal)??"",given:""}]),y.value=c(G),v.value=G.publisher??"",x.value=G["publisher-place"]??"",k.value=G["container-title"]??"",w.value=G.volume??"",S.value=G.issue??"",A.value=G.page??"",I.value=G.DOI??"",_.value=G.URL??"",m.value="form"}function U(){b.value.push({family:"",given:""})}function V(G){b.value.splice(G,1),b.value.length===0&&b.value.push({family:"",given:""})}const B=s.computed(()=>["book","chapter","report","thesis","document"].includes(h.value)),j=s.computed(()=>["article-journal","chapter"].includes(h.value)),$=s.computed(()=>["article-journal","chapter"].includes(h.value)),Y=s.computed(()=>["webpage","report"].includes(h.value)),W=s.computed(()=>g.value.trim().length>0);function oe(){const G=b.value.filter(re=>re.family.trim()||re.given.trim()).map(re=>({family:re.family.trim(),given:re.given.trim()})),H=parseInt(y.value,10),q={id:p.value??crypto.randomUUID(),type:h.value,title:g.value.trim()};return G.length>0&&(q.author=G),Number.isFinite(H)&&(q.issued={"date-parts":[[H]]}),v.value.trim()&&(q.publisher=v.value.trim()),x.value.trim()&&(q["publisher-place"]=x.value.trim()),k.value.trim()&&(q["container-title"]=k.value.trim()),w.value.trim()&&(q.volume=w.value.trim()),S.value.trim()&&(q.issue=S.value.trim()),A.value.trim()&&(q.page=A.value.trim()),I.value.trim()&&(q.DOI=I.value.trim()),_.value.trim()&&(q.URL=_.value.trim()),q}function R(){if(!W.value)return;const G=oe();p.value?i("update",G):i("create",G),m.value="list"}function N(G){window.confirm(r("sidebars.references.confirmDelete").replace("{title}",G.title??G.id))&&i("remove",G.id)}const L=s.ref(!1),D=s.ref(""),K=s.ref(null);function ne(){const G=D.value.trim();!G||n.importing||(i("import-doi",G),D.value="")}function ee(){var G;n.importing||(G=K.value)==null||G.click()}async function ie(G){var fe;const H=G.target,q=(fe=H.files)==null?void 0:fe[0];if(H.value="",!q)return;const re=/\.ris$/i.test(q.name)?"ris":"bibtex",ce=await q.text();i("import-bibliography",{format:re,text:ce})}return(G,H)=>(s.openBlock(),s.createElementBlock("div",H1,[s.createElementVNode("div",q1,[s.createElementVNode("div",null,[s.createElementVNode("h3",j1,[s.createVNode(s.unref(js),{class:"h-4 w-4 text-cyan-500"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.title")),1)]),s.createElementVNode("p",$1,s.toDisplayString(s.unref(r)("sidebars.references.subtitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.close"),onClick:H[0]||(H[0]=q=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,W1)]),m.value==="list"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",G1,[s.createElementVNode("label",K1,s.toDisplayString(s.unref(r)("sidebars.references.citationStyle")),1),s.createElementVNode("select",{value:e.activeStyle,class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onChange:H[1]||(H[1]=q=>i("update:style",q.target.value))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.availableStyles,q=>(s.openBlock(),s.createElementBlock("option",{key:q.id,value:q.id},s.toDisplayString(q.name),9,J1))),128))],40,X1)]),s.createElementVNode("div",Z1,[s.createElementVNode("div",Q1,[s.createVNode(s.unref(xr),{class:"absolute left-3 h-3.5 w-3.5 text-slate-400 dark:text-slate-500"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[2]||(H[2]=q=>a.value=q),type:"text",placeholder:s.unref(r)("sidebars.references.searchSources"),class:"w-full rounded-xl border border-slate-200/80 bg-slate-50 py-2 pl-9 pr-8 text-xs text-slate-700 transition-all focus:outline-none focus:ring-1 focus:ring-cyan-500/50 dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200 dark:focus:ring-cyan-400/30"},null,8,Y1),[[s.vModelText,a.value]]),a.value?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"absolute right-2.5 rounded-md p-0.5 text-slate-400 hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",onClick:H[3]||(H[3]=q=>a.value="")},[s.createVNode(s.unref(Wt),{class:"h-3 w-3"})])):s.createCommentVNode("",!0)]),s.createElementVNode("button",{type:"button",class:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-xl bg-blue-600 text-white shadow transition-colors hover:bg-blue-700",title:s.unref(r)("sidebars.references.addSource"),onClick:z},[s.createVNode(s.unref($n),{class:"h-4 w-4"})],8,ex)]),s.createElementVNode("div",tx,[e.sources.length===0?(s.openBlock(),s.createElementBlock("div",nx,[s.createElementVNode("div",ix,[s.createVNode(s.unref(js),{class:"h-6 w-6"})]),s.createElementVNode("h4",rx,s.toDisplayString(s.unref(r)("sidebars.references.noSources")),1),s.createElementVNode("p",ax,s.toDisplayString(s.unref(r)("sidebars.references.noSourcesDescription")),1),s.createElementVNode("button",{type:"button",class:"mt-5 flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-[11px] font-semibold text-white shadow transition-colors hover:bg-blue-700",onClick:z},[s.createVNode(s.unref($n),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.addSource")),1)])])):f.value.length===0?(s.openBlock(),s.createElementBlock("div",ox,[s.createVNode(s.unref(xr),{class:"mb-2 h-5 w-5 text-slate-300"}),s.createElementVNode("p",sx,s.toDisplayString(s.unref(r)("sidebars.references.noMatchingSources")),1)])):(s.openBlock(),s.createElementBlock("div",lx,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.value,q=>(s.openBlock(),s.createElementBlock("div",{key:q.id,class:"group rounded-xl border border-slate-200/80 bg-slate-50/60 p-3 transition-all hover:border-slate-300 dark:border-white/10 dark:bg-white/[0.02] dark:hover:border-white/20"},[s.createElementVNode("div",cx,[s.createElementVNode("p",{class:"truncate text-xs font-semibold text-slate-800 dark:text-slate-200",title:q.title},s.toDisplayString(q.title),9,ux),s.createElementVNode("p",dx,[s.createTextVNode(s.toDisplayString(l(q)),1),c(q)?(s.openBlock(),s.createElementBlock("span",fx," ("+s.toDisplayString(c(q))+")",1)):s.createCommentVNode("",!0),q["container-title"]?(s.openBlock(),s.createElementBlock("span",px," · "+s.toDisplayString(q["container-title"]),1)):q.publisher?(s.openBlock(),s.createElementBlock("span",mx," · "+s.toDisplayString(q.publisher),1)):s.createCommentVNode("",!0)]),s.createElementVNode("span",hx,s.toDisplayString(u(q.type)),1)]),s.createElementVNode("div",bx,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex flex-1 items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-[10px] font-semibold transition-colors",e.pickerMode?"bg-blue-600 text-white hover:bg-blue-700":"bg-slate-200/80 text-slate-700 hover:bg-blue-600 hover:text-white dark:bg-white/10 dark:text-slate-300 dark:hover:bg-blue-600"]),onClick:re=>i("insert",q.id)},[s.createVNode(s.unref(Ha),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.cite")),1)],10,gx),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-white",title:s.unref(r)("sidebars.references.edit"),onClick:re=>P(q)},[s.createVNode(s.unref(jl),{class:"h-3.5 w-3.5"})],8,vx),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-lg text-slate-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",title:s.unref(r)("sidebars.references.delete"),onClick:re=>N(q)},[s.createVNode(s.unref(kr),{class:"h-3.5 w-3.5"})],8,xx)])]))),128))]))]),e.canImport?(s.openBlock(),s.createElementBlock("div",yx,[s.createElementVNode("button",{type:"button",class:"flex w-full items-center justify-between px-4 py-2.5 text-[10px] font-bold uppercase tracking-widest text-slate-400 transition-colors hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300",onClick:H[4]||(H[4]=q=>L.value=!L.value)},[s.createElementVNode("span",null,s.toDisplayString(s.unref(r)("sidebars.references.import.title")),1),s.createVNode(s.unref(en),{class:s.normalizeClass(["h-3.5 w-3.5 transition-transform",L.value?"rotate-180":""])},null,8,["class"])]),L.value?(s.openBlock(),s.createElementBlock("div",kx,[s.createElementVNode("div",null,[s.createElementVNode("label",wx,s.toDisplayString(s.unref(r)("sidebars.references.import.fromDoi")),1),s.createElementVNode("div",_x,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[5]||(H[5]=q=>D.value=q),type:"text",placeholder:s.unref(r)("sidebars.references.import.doiPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200",onKeydown:s.withKeys(ne,["enter"])},null,40,Sx),[[s.vModelText,D.value]]),s.createElementVNode("button",{type:"button",disabled:e.importing||!D.value.trim(),class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg bg-blue-600 text-white transition-colors hover:bg-blue-700 disabled:opacity-40",title:s.unref(r)("sidebars.references.import.importDoi"),onClick:ne},[s.createVNode(s.unref(vf),{class:"h-3.5 w-3.5"})],8,Cx)])]),s.createElementVNode("div",null,[s.createElementVNode("label",Ex,s.toDisplayString(s.unref(r)("sidebars.references.import.fromFile")),1),s.createElementVNode("button",{type:"button",disabled:e.importing,class:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-slate-300 px-3 py-2 text-[11px] font-semibold text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-600 disabled:opacity-40 dark:border-white/15 dark:text-slate-400 dark:hover:border-blue-500 dark:hover:text-blue-400",onClick:ee},[s.createVNode(s.unref(Ub),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(e.importing?s.unref(r)("sidebars.references.import.importing"):s.unref(r)("sidebars.references.import.pickFile")),1)],8,Ax),s.createElementVNode("input",{ref_key:"bibFileInput",ref:K,type:"file",accept:".bib,.ris,application/x-bibtex,text/plain",class:"hidden",onChange:ie},null,544)]),e.importMessage?(s.openBlock(),s.createElementBlock("p",Tx,s.toDisplayString(e.importMessage),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",Nx,[s.createElementVNode("button",{type:"button",class:"rounded-lg p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-white",title:s.unref(r)("sidebars.references.back"),onClick:H[6]||(H[6]=q=>m.value="list")},[s.createVNode(s.unref(Ob),{class:"h-4 w-4"})],8,Ox),s.createElementVNode("h4",Mx,s.toDisplayString(p.value?s.unref(r)("sidebars.references.editSource"):s.unref(r)("sidebars.references.addSource")),1)]),s.createElementVNode("div",Dx,[s.createElementVNode("form",{class:"space-y-3.5",onSubmit:s.withModifiers(R,["prevent"])},[s.createElementVNode("div",null,[s.createElementVNode("label",zx,s.toDisplayString(s.unref(r)("sidebars.references.form.type")),1),s.withDirectives(s.createElementVNode("select",{"onUpdate:modelValue":H[7]||(H[7]=q=>h.value=q),class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(o,q=>s.createElementVNode("option",{key:q,value:q},s.toDisplayString(u(q)),9,Ix)),64))],512),[[s.vModelSelect,h.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Rx,s.toDisplayString(s.unref(r)("sidebars.references.form.title"))+" *",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[8]||(H[8]=q=>g.value=q),type:"text",required:"",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,g.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Lx,s.toDisplayString(s.unref(r)("sidebars.references.form.authors")),1),s.createElementVNode("div",Bx,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(b.value,(q,re)=>(s.openBlock(),s.createElementBlock("div",{key:re,class:"flex items-center gap-1.5"},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":ce=>q.family=ce,type:"text",placeholder:s.unref(r)("sidebars.references.form.familyName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Px),[[s.vModelText,q.family]]),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":ce=>q.given=ce,type:"text",placeholder:s.unref(r)("sidebars.references.form.givenName"),class:"w-1/2 rounded-lg border border-slate-200/80 bg-slate-50 px-2.5 py-1.5 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,8,Fx),[[s.vModelText,q.given]]),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-lg text-slate-400 hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-500/10",onClick:ce=>V(re)},[s.createVNode(s.unref(Wt),{class:"h-3.5 w-3.5"})],8,Vx)]))),128))]),s.createElementVNode("button",{type:"button",class:"mt-1.5 flex items-center gap-1 text-[10px] font-semibold text-blue-600 hover:text-blue-700 dark:text-blue-400",onClick:U},[s.createVNode(s.unref($n),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.references.form.addAuthor")),1)])]),s.createElementVNode("div",null,[s.createElementVNode("label",Ux,s.toDisplayString(s.unref(r)("sidebars.references.form.year")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[9]||(H[9]=q=>y.value=q),type:"number",min:"0",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,y.value]])]),j.value?(s.openBlock(),s.createElementBlock("div",Hx,[s.createElementVNode("label",qx,s.toDisplayString(h.value==="chapter"?s.unref(r)("sidebars.references.form.bookTitle"):s.unref(r)("sidebars.references.form.journal")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[10]||(H[10]=q=>k.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,k.value]])])):s.createCommentVNode("",!0),B.value?(s.openBlock(),s.createElementBlock("div",jx,[s.createElementVNode("div",null,[s.createElementVNode("label",$x,s.toDisplayString(s.unref(r)("sidebars.references.form.publisher")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[11]||(H[11]=q=>v.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,v.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Wx,s.toDisplayString(s.unref(r)("sidebars.references.form.publisherPlace")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[12]||(H[12]=q=>x.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,x.value]])])])):s.createCommentVNode("",!0),$.value?(s.openBlock(),s.createElementBlock("div",Gx,[s.createElementVNode("div",null,[s.createElementVNode("label",Kx,s.toDisplayString(s.unref(r)("sidebars.references.form.volume")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[13]||(H[13]=q=>w.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,w.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Xx,s.toDisplayString(s.unref(r)("sidebars.references.form.issue")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[14]||(H[14]=q=>S.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,S.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",Jx,s.toDisplayString(s.unref(r)("sidebars.references.form.pages")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[15]||(H[15]=q=>A.value=q),type:"text",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,A.value]])])])):s.createCommentVNode("",!0),h.value==="article-journal"?(s.openBlock(),s.createElementBlock("div",Zx,[H[19]||(H[19]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"DOI",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[16]||(H[16]=q=>I.value=q),type:"text",placeholder:"10.xxxx/xxxxx",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,I.value]])])):s.createCommentVNode("",!0),Y.value?(s.openBlock(),s.createElementBlock("div",Qx,[H[20]||(H[20]=s.createElementVNode("label",{class:"mb-1 block text-[10px] font-semibold text-slate-500 dark:text-slate-400"},"URL",-1)),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":H[17]||(H[17]=q=>_.value=q),type:"url",placeholder:"https://…",class:"w-full rounded-lg border border-slate-200/80 bg-slate-50 px-3 py-2 text-xs dark:border-white/10 dark:bg-slate-900/40 dark:text-slate-200"},null,512),[[s.vModelText,_.value]])])):s.createCommentVNode("",!0),s.createElementVNode("div",Yx,[s.createElementVNode("button",{type:"submit",disabled:!W.value,class:"flex-1 rounded-lg bg-blue-600 px-4 py-2 text-xs font-semibold text-white shadow transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-40"},s.toDisplayString(p.value?s.unref(r)("sidebars.references.form.save"):s.unref(r)("sidebars.references.form.create")),9,ey),s.createElementVNode("button",{type:"button",class:"rounded-lg border border-slate-200 px-4 py-2 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 dark:border-white/10 dark:text-slate-300 dark:hover:bg-white/5",onClick:H[18]||(H[18]=q=>m.value="list")},s.toDisplayString(s.unref(r)("sidebars.references.form.cancel")),1)])],32)])],64))]))}});function ot(e){this.content=e}ot.prototype={constructor:ot,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,r=i.find(e),a=i.content.slice();return r==-1?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new ot(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ot(n)},addToStart:function(e,t){return new ot([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ot(n)},addBefore:function(e,t,n){var i=this.remove(t),r=i.content.slice(),a=i.find(e);return r.splice(a==-1?r.length:a,0,t,n),new ot(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ot.from(e),e.size?new ot(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ot.from(e),e.size?new ot(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ot.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};ot.from=function(e){if(e instanceof ot)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ot(t)};function Rf(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(i),a=t.child(i);if(r==a){n+=r.nodeSize;continue}if(!r.sameMarkup(a))return n;if(r.isText&&r.text!=a.text){let o=r.text,l=a.text,c=0;for(;o[c]==l[c];c++)n++;return c&&c<o.length&&c<l.length&&Pf(o.charCodeAt(c-1))&&Bf(o.charCodeAt(c))&&n--,n}if(r.content.size||a.content.size){let o=Rf(r.content,a.content,n+1);if(o!=null)return o}n+=r.nodeSize}}function Lf(e,t,n,i){for(let r=e.childCount,a=t.childCount;;){if(r==0||a==0)return r==a?null:{a:n,b:i};let o=e.child(--r),l=t.child(--a),c=o.nodeSize;if(o==l){n-=c,i-=c;continue}if(!o.sameMarkup(l))return{a:n,b:i};if(o.isText&&o.text!=l.text){let u=o.text,f=l.text,m=u.length,p=f.length;for(;m>0&&p>0&&u[m-1]==f[p-1];)m--,p--,n--,i--;return m&&p&&m<u.length&&Pf(u.charCodeAt(m-1))&&Bf(u.charCodeAt(m))&&(n++,i++),{a:n,b:i}}if(o.content.size||l.content.size){let u=Lf(o.content,l.content,n-1,i-1);if(u)return u}n-=c,i-=c}}function Bf(e){return e>=56320&&e<57344}function Pf(e){return e>=55296&&e<56320}class J{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;i<t.length;i++)this.size+=t[i].nodeSize}nodesBetween(t,n,i,r=0,a){for(let o=0,l=0;l<n;o++){let c=this.content[o],u=l+c.nodeSize;if(u>t&&i(c,r+l,a||null,o)!==!1&&c.content.size){let f=l+1;c.nodesBetween(Math.max(0,t-f),Math.min(c.content.size,n-f),i,r+f)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,r){let a="",o=!0;return this.nodesBetween(t,n,(l,c)=>{let u=l.isText?l.text.slice(Math.max(t,c)-c,n-c):l.isLeaf?r?typeof r=="function"?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(o?o=!1:a+=i),a+=u},0),a}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,r=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(i)&&(r[r.length-1]=n.withText(n.text+i.text),a=1);a<t.content.length;a++)r.push(t.content[a]);return new J(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let i=[],r=0;if(n>t)for(let a=0,o=0;o<n;a++){let l=this.content[a],c=o+l.nodeSize;c>t&&((o<t||c>n)&&(l.isText?l=l.cut(Math.max(0,t-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,t-o-1),Math.min(l.content.size,n-o-1))),i.push(l),r+=l.nodeSize),o=c}return new J(i,r)}cutByIndex(t,n){return t==n?J.empty:t==0&&n==this.content.length?this:new J(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let r=this.content.slice(),a=this.size+n.nodeSize-i.nodeSize;return r[t]=n,new J(r,a)}addToStart(t){return new J([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new J(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,i=0;n<this.content.length;n++){let r=this.content[n];t(r,i,n),i+=r.nodeSize}}findDiffStart(t,n=0){return Rf(this,t,n)}findDiffEnd(t,n=this.size,i=t.size){return Lf(this,t,n,i)}findIndex(t){if(t==0)return pa(0,t);if(t==this.size)return pa(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let r=this.child(n),a=i+r.nodeSize;if(a>=t)return a==t?pa(n+1,a):pa(n,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return J.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return J.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return J.empty;let n,i=0;for(let r=0;r<t.length;r++){let a=t[r];i+=a.nodeSize,r&&a.isText&&t[r-1].sameMarkup(a)?(n||(n=t.slice(0,r)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new J(n||t,i)}static from(t){if(!t)return J.empty;if(t instanceof J)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new J([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const ds={index:0,offset:0};function pa(e,t){return ds.index=e,ds.offset=t,ds}function qa(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!qa(e[i],t[i]))return!1}else{for(let i in e)if(!(i in t)||!qa(e[i],t[i]))return!1;for(let i in t)if(!(i in e))return!1}return!0}let Re=class Ys{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,i=!1;for(let r=0;r<t.length;r++){let a=t[r];if(this.eq(a))return t;if(this.type.excludes(a.type))n||(n=t.slice(0,r));else{if(a.type.excludes(this.type))return t;!i&&a.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),i=!0),n&&n.push(a)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&qa(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let i=t.marks[n.type];if(!i)throw new RangeError(`There is no mark type ${n.type} in this schema`);let r=i.create(n.attrs);return i.checkAttrs(r.attrs),r}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].eq(n[i]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return Ys.none;if(t instanceof Ys)return[t];let n=t.slice();return n.sort((i,r)=>i.type.rank-r.type.rank),n}};Re.none=[];class wr extends Error{}class ae{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=Vf(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new ae(i,this.openStart,this.openEnd)}removeBetween(t,n){return new ae(Ff(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return ae.empty;let i=n.openStart||0,r=n.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ae(J.fromJSON(t,n.content),i,r)}static maxOpen(t,n=!0){let i=0,r=0;for(let a=t.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)i++;for(let a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)r++;return new ae(t,i,r)}}ae.empty=new ae(J.empty,0,0);function Ff(e,t,n){let{index:i,offset:r}=e.findIndex(t),a=e.maybeChild(i),{index:o,offset:l}=e.findIndex(n);if(r==t||a.isText){if(l!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(i,a.copy(Ff(a.content,t-r-1,n-r-1)))}function Vf(e,t,n,i,r,a){let{index:o,offset:l}=e.findIndex(t),c=e.maybeChild(o);if(l==t||c.isText)return a&&i<=0&&r<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=Vf(c.content,t-l-1,n,o==0?i-1:0,o==e.childCount-1?r-1:0,c);return u&&e.replaceChild(o,c.copy(u))}function ny(e,t,n){if(n.openStart>e.depth)throw new wr("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wr("Inconsistent open depths");return Uf(e,t,n,0)}function Uf(e,t,n,i){let r=e.index(i),a=e.node(i);if(r==t.index(i)&&i<e.depth-n.openStart){let o=Uf(e,t,n,i+1);return a.copy(a.content.replaceChild(r,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==i&&t.depth==i){let o=e.parent,l=o.content;return fi(o,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:o,end:l}=iy(n,e);return fi(a,qf(e,o,l,t,i))}else return fi(a,ja(e,t,i))}function Hf(e,t){if(!t.type.compatibleContent(e.type))throw new wr("Cannot join "+t.type.name+" onto "+e.type.name)}function el(e,t,n){let i=e.node(n);return Hf(i,t.node(n)),i}function di(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function cr(e,t,n,i){let r=(t||e).node(n),a=0,o=t?t.index(n):r.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(di(e.nodeAfter,i),a++));for(let l=a;l<o;l++)di(r.child(l),i);t&&t.depth==n&&t.textOffset&&di(t.nodeBefore,i)}function fi(e,t){if(!e.type.validContent(t))throw new wr("Invalid content for node "+e.type.name);return e.copy(t)}function qf(e,t,n,i,r){let a=e.depth>r&&el(e,t,r+1),o=i.depth>r&&el(n,i,r+1),l=[];return cr(null,e,r,l),a&&o&&t.index(r)==n.index(r)?(Hf(a,o),di(fi(a,qf(e,t,n,i,r+1)),l)):(a&&di(fi(a,ja(e,t,r+1)),l),cr(t,n,r,l),o&&di(fi(o,ja(n,i,r+1)),l)),cr(i,null,r,l),new J(l)}function ja(e,t,n){let i=[];if(cr(null,e,n,i),e.depth>n){let r=el(e,t,n+1);di(fi(r,ja(e,t,n+1)),i)}return cr(t,null,n,i),new J(i)}function iy(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let a=n-1;a>=0;a--)r=t.node(a).copy(J.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}class _r{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],r=t.child(n);return i?t.child(n).cut(i):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let a=0;a<t;a++)r+=i.child(a).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return Re.none;if(this.textOffset)return t.child(n).marks;let i=t.maybeChild(n-1),r=t.maybeChild(n);if(!i){let l=i;i=r,r=l}let a=i.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!r||!a[o].isInSet(r.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,r=t.parent.maybeChild(t.index());for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);i>=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new $a(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],r=0,a=n;for(let o=t;;){let{index:l,offset:c}=o.content.findIndex(a),u=a-c;if(i.push(o,l,r+c),!u||(o=o.child(l),o.isText))break;a=u-1,r+=c+1}return new _r(n,i,a)}static resolveCached(t,n){let i=vu.get(t);if(i)for(let a=0;a<i.elts.length;a++){let o=i.elts[a];if(o.pos==n)return o}else vu.set(t,i=new ry);let r=i.elts[i.i]=_r.resolve(t,n);return i.i=(i.i+1)%ay,r}}class ry{constructor(){this.elts=[],this.i=0}}const ay=12,vu=new WeakMap;class $a{constructor(t,n,i){this.$from=t,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const oy=Object.create(null);let pi=class tl{constructor(t,n,i,r=Re.none){this.type=t,this.attrs=n,this.marks=r,this.content=i||J.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,i,r=0){this.content.nodesBetween(t,n,i,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,i,r){return this.content.textBetween(t,n,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,i){return this.type==t&&qa(this.attrs,n||t.defaultAttrs||oy)&&Re.sameSet(this.marks,i||Re.none)}copy(t=null){return t==this.content?this:new tl(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new tl(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,i=!1){if(t==n)return ae.empty;let r=this.resolve(t),a=this.resolve(n),o=i?0:r.sharedDepth(n),l=r.start(o),u=r.node(o).content.cut(r.pos-l,a.pos-l);return new ae(u,r.depth-o,a.depth-o)}replace(t,n,i){return ny(this.resolve(t),this.resolve(n),i)}nodeAt(t){for(let n=this;;){let{index:i,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(i),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:i}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(t);if(i<t)return{node:this.content.child(n),index:n,offset:i};let r=this.content.child(n-1);return{node:r,index:n-1,offset:i-r.nodeSize}}resolve(t){return _r.resolveCached(this,t)}resolveNoCache(t){return _r.resolve(this,t)}rangeHasMark(t,n,i){let r=!1;return n>t&&this.nodesBetween(t,n,a=>(i.isInSet(a.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),jf(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=J.empty,r=0,a=i.childCount){let o=this.contentMatchAt(t).matchFragment(i,r,a),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=r;c<a;c++)if(!this.type.allowsMarks(i.child(c).marks))return!1;return!0}canReplaceWith(t,n,i,r){if(r&&!this.type.allowsMarks(r))return!1;let a=this.contentMatchAt(t).matchType(i),o=a&&a.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=Re.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),t=i.addToSet(t)}if(!Re.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let r=J.fromJSON(t,n.content),a=t.nodeType(n.type).create(n.attrs,r,i);return a.type.checkAttrs(a.attrs),a}};pi.prototype.text=void 0;class Wa extends pi{constructor(t,n,i,r){if(super(t,n,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Wa(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Wa(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function jf(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class bi{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new sy(t,n);if(i.next==null)return bi.empty;let r=$f(i);i.next&&i.err("Unexpected trailing text");let a=my(py(r));return hy(a,i),a}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,i=t.childCount){let r=this;for(let a=n;r&&a<i;a++)r=r.matchType(t.child(a).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let i=0;i<t.next.length;i++)if(this.next[n].type==t.next[i].type)return!0;return!1}fillBefore(t,n=!1,i=0){let r=[this];function a(o,l){let c=o.matchFragment(t,i);if(c&&(!n||c.validEnd))return J.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:m}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&r.indexOf(m)==-1){r.push(m);let p=a(m,l.concat(f));if(p)return p}}return null}return a(this,[])}findWrapping(t){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==t)return this.wrapCache[i+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),a=r.match;if(a.matchType(t)){let o=[];for(let l=r;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:l,next:c}=a.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!r.type||c.validEnd)&&(i.push({match:l.contentMatch,type:l,via:r}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let r=0;r<i.next.length;r++)t.indexOf(i.next[r].next)==-1&&n(i.next[r].next)}return n(this),t.map((i,r)=>{let a=r+(i.validEnd?"*":" ")+" ";for(let o=0;o<i.next.length;o++)a+=(o?", ":"")+i.next[o].type.name+"->"+t.indexOf(i.next[o].next);return a}).join(`
598
+ `)}}bi.empty=new bi(!0);class sy{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function $f(e){let t=[];do t.push(ly(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function ly(e){let t=[];do t.push(cy(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function cy(e){let t=fy(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=uy(e,t);else break;return t}function xu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function uy(e,t){let n=xu(e),i=n;return e.eat(",")&&(e.next!="}"?i=xu(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function dy(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let r=[];for(let a in n){let o=n[a];o.isInGroup(t)&&r.push(o)}return r.length==0&&e.err("No node type or group '"+t+"' found"),r}function fy(e){if(e.eat("(")){let t=$f(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=dy(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function py(e){let t=[[]];return r(a(e,0),n()),t;function n(){return t.push([])-1}function i(o,l,c){let u={term:c,to:l};return t[o].push(u),u}function r(o,l){o.forEach(c=>c.to=l)}function a(o,l){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(a(u,l)),[]);if(o.type=="seq")for(let c=0;;c++){let u=a(o.exprs[c],l);if(c==o.exprs.length-1)return u;r(u,l=n())}else if(o.type=="star"){let c=n();return i(l,c),r(a(o.expr,c),c),[i(c)]}else if(o.type=="plus"){let c=n();return r(a(o.expr,l),c),r(a(o.expr,c),c),[i(c)]}else{if(o.type=="opt")return[i(l)].concat(a(o.expr,l));if(o.type=="range"){let c=l;for(let u=0;u<o.min;u++){let f=n();r(a(o.expr,c),f),c=f}if(o.max==-1)r(a(o.expr,c),c);else for(let u=o.min;u<o.max;u++){let f=n();i(c,f),r(a(o.expr,c),f),c=f}return[i(c)]}else{if(o.type=="name")return[i(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Wf(e,t){return t-e}function yu(e,t){let n=[];return i(t),n.sort(Wf);function i(r){let a=e[r];if(a.length==1&&!a[0].term)return i(a[0].to);n.push(r);for(let o=0;o<a.length;o++){let{term:l,to:c}=a[o];!l&&n.indexOf(c)==-1&&i(c)}}}function my(e){let t=Object.create(null);return n(yu(e,0));function n(i){let r=[];i.forEach(o=>{e[o].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let f=0;f<r.length;f++)r[f][0]==l&&(u=r[f][1]);yu(e,c).forEach(f=>{u||r.push([l,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let a=t[i.join(",")]=new bi(i.indexOf(e.length-1)>-1);for(let o=0;o<r.length;o++){let l=r[o][1].sort(Wf);a.next.push({type:r[o][0],next:t[l.join(",")]||n(l)})}return a}}function hy(e,t){for(let n=0,i=[e];n<i.length;n++){let r=i[n],a=!r.validEnd,o=[];for(let l=0;l<r.next.length;l++){let{type:c,next:u}=r.next[l];o.push(c.name),a&&!(c.isText||c.hasRequiredAttrs())&&(a=!1),i.indexOf(u)==-1&&i.push(u)}a&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Gf(e){let t=Object.create(null);for(let n in e){let i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function Kf(e,t){let n=Object.create(null);for(let i in e){let r=t&&t[i];if(r===void 0){let a=e[i];if(a.hasDefault)r=a.default;else throw new RangeError("No value supplied for attribute "+i)}n[i]=r}return n}function Xf(e,t,n,i){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${i}`);for(let r in e)e[r].validate&&e[r].validate(t[r])}function Jf(e,t){let n=Object.create(null);if(t)for(let i in t)n[i]=new gy(e,i,t[i]);return n}let ku=class Zf{constructor(t,n,i){this.name=t,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=Jf(t,i.attrs),this.defaultAttrs=Gf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==bi.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Kf(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new pi(this,this.computeAttrs(t),J.from(n),Re.setFrom(i))}createChecked(t=null,n,i){return n=J.from(n),this.checkContent(n),new pi(this,this.computeAttrs(t),n,Re.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=J.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let r=this.contentMatch.matchFragment(n),a=r&&r.fillBefore(J.empty,!0);return a?new pi(this,t,n.append(a),Re.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i<t.childCount;i++)if(!this.allowsMarks(t.child(i).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Xf(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let i=0;i<t.length;i++)this.allowsMarkType(t[i].type)?n&&n.push(t[i]):n||(n=t.slice(0,i));return n?n.length?n:Re.none:t}static compile(t,n){let i=Object.create(null);t.forEach((a,o)=>i[a]=new Zf(a,n,o));let r=n.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let a in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function by(e,t,n){let i=n.split("|");return r=>{let a=r===null?"null":typeof r;if(i.indexOf(a)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${a}`)}}class gy{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?by(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class Lo{constructor(t,n,i,r){this.name=t,this.rank=n,this.schema=i,this.spec=r,this.attrs=Jf(t,r.attrs),this.excluded=null;let a=Gf(this.attrs);this.instance=a?new Re(this,a):null}create(t=null){return!t&&this.instance?this.instance:new Re(this,Kf(this.attrs,t))}static compile(t,n){let i=Object.create(null),r=0;return t.forEach((a,o)=>i[a]=new Lo(a,r++,n,o)),i}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Xf(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Qf{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=ot.from(t.nodes),n.marks=ot.from(t.marks||{}),this.nodes=ku.compile(this.spec.nodes,this),this.marks=Lo.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let a=this.nodes[r],o=a.spec.content||"",l=a.spec.marks;if(a.contentMatch=i[o]||(i[o]=bi.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=l=="_"?null:l?wu(this,l.split(" ")):l==""||!a.inlineContent?[]:null}for(let r in this.marks){let a=this.marks[r],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:wu(this,o.split(" "))}this.nodeFromJSON=r=>pi.fromJSON(this,r),this.markFromJSON=r=>Re.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof ku){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,r)}text(t,n){let i=this.nodes.text;return new Wa(i,i.defaultAttrs,t,Re.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function wu(e,t){let n=[];for(let i=0;i<t.length;i++){let r=t[i],a=e.marks[r],o=a;if(a)n.push(a);else for(let l in e.marks){let c=e.marks[l];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&n.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function vy(e){return e.tag!=null}function xy(e){return e.style!=null}let ur=class nl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(vy(r))this.tags.push(r);else if(xy(r)){let a=/[^=]*/.exec(r.style)[0];i.indexOf(a)<0&&i.push(a),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let a=t.nodes[r.node];return a.contentMatch.matchType(a)})}parse(t,n={}){let i=new Su(this,n,!1);return i.addAll(t,Re.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new Su(this,n,!0);return i.addAll(t,Re.none,n.from,n.to),ae.maxOpen(i.finish())}matchTag(t,n,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let a=this.tags[r];if(wy(t,a.tag)&&(a.namespace===void 0||t.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(t);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(t,n,i,r){for(let a=r?this.styles.indexOf(r)+1:0;a<this.styles.length;a++){let o=this.styles[a],l=o.style;if(!(l.indexOf(t)!=0||o.context&&!i.matchesContext(o.context)||l.length>t.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(o.getAttrs){let c=o.getAttrs(n);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(t){let n=[];function i(r){let a=r.priority==null?50:r.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<a)break}n.splice(o,0,r)}for(let r in t.marks){let a=t.marks[r].spec.parseDOM;a&&a.forEach(o=>{i(o=Cu(o)),o.mark||o.ignore||o.clearMark||(o.mark=r)})}for(let r in t.nodes){let a=t.nodes[r].spec.parseDOM;a&&a.forEach(o=>{i(o=Cu(o)),o.node||o.ignore||o.mark||(o.node=r)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new nl(t,nl.schemaRules(t)))}};const Yf={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},yy={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ep={ol:!0,ul:!0},Sr=1,il=2,dr=4;function _u(e,t,n){return t!=null?(t?Sr:0)|(t==="full"?il:0):e&&e.whitespace=="pre"?Sr|il:n&~dr}class ma{constructor(t,n,i,r,a,o){this.type=t,this.attrs=n,this.marks=i,this.solid=r,this.options=o,this.content=[],this.activeMarks=Re.none,this.match=a||(o&dr?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(J.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(t.type))?(this.match=i,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Sr)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let a=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-r[0].length))}}let n=J.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Yf.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class Su{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=n.topNode,a,o=_u(null,n.preserveWhitespace,0)|(i?dr:0);r?a=new ma(r.type,r.attrs,Re.none,!0,n.topMatch||r.type.contentMatch,o):i?a=new ma(null,null,Re.none,!0,null,o):a=new ma(t.schema.topNodeType,null,Re.none,!0,null,o),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,r=this.top,a=r.options&il?"full":this.localPreserveWS||(r.options&Sr)>0,{schema:o}=this.parser;if(a==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(a)if(a==="full")i=i.replace(/\r\n?/g,`
599
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[c]&&this.insertNode(o.text(l[c]),n,!/\S/.test(l[c]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=r.content[r.content.length-1],c=t.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(o.text(i),n,!/\S/.test(i)),this.findInText(t)}else this.findInside(t)}addElement(t,n,i){let r=this.localPreserveWS,a=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),l;ep.hasOwnProperty(o)&&this.parser.normalizeLists&&ky(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,i));e:if(c?c.ignore:yy.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let u,f=this.needsBlock;if(Yf.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let m=c&&c.skip?n:this.readStyles(t,n);m&&this.addAll(t,m),u&&this.sync(a),this.needsBlock=f}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,c,u,c.consuming===!1?l:void 0)}this.localPreserveWS=r}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
600
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let i=t.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let a=this.parser.matchedStyles[r],o=i.getPropertyValue(a);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(a,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,i,r){let a,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let c=this.enter(o,n.attrs||null,i,n.preserveWhitespace);c&&(a=!0,i=c)}else{let c=this.parser.schema.marks[n.mark];i=i.concat(c.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,i,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,i),this.findAround(t,c,!1)}a&&this.sync(l)&&this.open--}addAll(t,n,i,r){let a=i||0;for(let o=i?t.childNodes[i]:t.firstChild,l=r==null?null:t.childNodes[r];o!=l;o=o.nextSibling,++a)this.findAtPoint(t,a),this.addDOM(o,n);this.findAtPoint(t,a)}findPlace(t,n,i){let r,a;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(t);if(u&&(!r||r.length>u.length+l)&&(r=u,a=c,!u.length))break;if(c.solid){if(i)break;l+=2}}if(!r)return null;this.sync(a);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(t,n,i){if(t.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let r=this.findPlace(t,n,i);if(r){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(t.type));let o=Re.none;for(let l of r.concat(t.marks))(a.type?a.type.allowsMarkType(l.type):Eu(l.type,t.type))&&(o=l.addToSet(o));return a.content.push(t.mark(o)),!0}return!1}enter(t,n,i,r){let a=this.findPlace(t.create(n),i,!1);return a&&(a=this.enterInner(t,n,i,!0,r)),a}enterInner(t,n,i,r=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let l=_u(t,a,o.options);o.options&dr&&o.content.length==0&&(l|=dr);let c=Re.none;return i=i.filter(u=>(o.type?o.type.allowsMarkType(u.type):Eu(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new ma(t,n,c,r,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Sr)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let r=i.length-1;r>=0;r--)t+=i[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==t&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,i){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),a=-(i?i.depth+1:0)+(r?0:1),o=(l,c)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;c>=a;c--)if(o(l-1,c))return!0;return!1}else{let f=c>0||c==0&&r?this.nodes[c].type:i&&c>=a?i.node(c-a).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function ky(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&ep.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function wy(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Cu(e){let t={};for(let n in e)t[n]=e[n];return t}function Eu(e,t){let n=t.schema.nodes;for(let i in n){let r=n[i];if(!r.allowsMarkType(e))continue;let a=[],o=l=>{a.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:f}=l.edge(c);if(u==t||a.indexOf(f)<0&&o(f))return!0}};if(o(r.contentMatch))return!0}}class Hi{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},i){i||(i=ha(n).createDocumentFragment());let r=i,a=[];return t.forEach(o=>{if(a.length||o.marks.length){let l=0,c=0;for(;l<a.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(a[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<a.length;)r=a.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],f=this.serializeMark(u,o.isInline,n);f&&(a.push([u,r]),r.appendChild(f.dom),r=f.contentDOM||f.dom)}}r.appendChild(this.serializeNodeInner(o,n))}),i}serializeNodeInner(t,n){if(t.isText)return ha(n).createTextNode(t.text);let{dom:i,contentDOM:r}=Da(ha(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return i}serializeNode(t,n={}){let i=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let a=this.serializeMark(t.marks[r],t.isInline,n);a&&((a.contentDOM||a.dom).appendChild(i),i=a.dom)}return i}serializeMark(t,n,i={}){let r=this.marks[t.type.name];return r&&Da(ha(i),r(t,n),null,t.attrs)}static renderSpec(t,n,i=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:Da(t,n,i,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Hi(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=Au(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return Au(t.marks)}}function Au(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function ha(e){return e.document||window.document}const Tu=new WeakMap;function _y(e){let t=Tu.get(e);return t===void 0&&Tu.set(e,t=Sy(e)),t}function Sy(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let r=0;r<i.length;r++)n(i[r]);else for(let r in i)n(i[r])}return n(e),t}function Da(e,t,n,i){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let r=t[0],a;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(a=_y(i))&&a.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=r.indexOf(" ");o>0&&(n=r.slice(0,o),r=r.slice(o+1));let l,c=n?e.createElementNS(n,r):e.createElement(r),u=t[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let m in u)if(u[m]!=null){let p=m.indexOf(" ");p>0?c.setAttributeNS(m.slice(0,p),m.slice(p+1),u[m]):m=="style"&&c.style?c.style.cssText=u[m]:c.setAttribute(m,u[m])}}for(let m=f;m<t.length;m++){let p=t[m];if(p===0){if(m<t.length-1||m>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else if(typeof p=="string")c.appendChild(e.createTextNode(p));else{let{dom:h,contentDOM:g}=Da(e,p,n,i);if(c.appendChild(h),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const tp=65535,np=Math.pow(2,16);function Cy(e,t){return e+t*np}function Nu(e){return e&tp}function Ey(e){return(e-(e&tp))/np}const ip=1,rp=2,za=4,ap=8;class rl{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&ap)>0}get deletedBefore(){return(this.delInfo&(ip|za))>0}get deletedAfter(){return(this.delInfo&(rp|za))>0}get deletedAcross(){return(this.delInfo&za)>0}}class Dt{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Dt.empty)return Dt.empty}recover(t){let n=0,i=Nu(t);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+n+Ey(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,i){let r=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[l+a],f=this.ranges[l+o],m=c+u;if(t<=m){let p=u?t==c?-1:t==m?1:n:n,h=c+r+(p<0?0:f);if(i)return h;let g=t==(n<0?c:m)?null:Cy(l/3,t-c),b=t==c?rp:t==m?ip:za;return(n<0?t!=c:t!=m)&&(b|=ap),new rl(h,b,g)}r+=f-u}return i?t+r:new rl(t+r,0,null)}touches(t,n){let i=0,r=Nu(n),a=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[l+a],f=c+u;if(t<=f&&l==r*3)return!0;i+=this.ranges[l+o]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,a=0;r<this.ranges.length;r+=3){let o=this.ranges[r],l=o-(this.inverted?a:0),c=o+(this.inverted?0:a),u=this.ranges[r+n],f=this.ranges[r+i];t(l,l+u,c,c+f),a+=f-u}}invert(){return new Dt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Dt.empty:new Dt(t<0?[0,-t,0]:[0,0,t])}}Dt.empty=new Dt([]);class Ga{constructor(t,n,i=0,r=t?t.length:0){this.mirror=n,this.from=i,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Ga(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,i=this._maps.length;n<t._maps.length;n++){let r=t.getMirror(n);this.appendMap(t._maps[n],r!=null&&r<n?i+r:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,i=this._maps.length+t._maps.length;n>=0;n--){let r=t.getMirror(n);this.appendMap(t._maps[n].invert(),r!=null&&r>n?i-r-1:void 0)}}invert(){let t=new Ga;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;i<this.to;i++)t=this._maps[i].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,i){let r=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],l=o.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(a);if(c!=null&&c>a&&c<this.to){a=c,t=this._maps[c].recover(l.recover);continue}}r|=l.delInfo,t=l.pos}return i?t:new rl(t,r,null)}}const fs=Object.create(null);class bt{getMap(){return Dt.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=fs[n.stepType];if(!i)throw new RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in fs)throw new RangeError("Duplicate use of step JSON ID "+t);return fs[t]=n,n.prototype.jsonID=t,n}}class Qe{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Qe(t,null)}static fail(t){return new Qe(null,t)}static fromReplace(t,n,i,r){try{return Qe.ok(t.replace(n,i,r))}catch(a){if(a instanceof wr)return Qe.fail(a.message);throw a}}}function Gl(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let a=e.child(r);a.content.size&&(a=a.copy(Gl(a.content,t,a))),a.isInline&&(a=t(a,n,r)),i.push(a)}return J.fromArray(i)}class Hn extends bt{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=t.resolve(this.from),r=i.node(i.sharedDepth(this.to)),a=new ae(Gl(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),r),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,a)}invert(){return new tn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Hn(n.pos,i.pos,this.mark)}merge(t){return t instanceof Hn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Hn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Hn(n.from,n.to,t.markFromJSON(n.mark))}}bt.jsonID("addMark",Hn);class tn extends bt{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new ae(Gl(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,i)}invert(){return new Hn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new tn(n.pos,i.pos,this.mark)}merge(t){return t instanceof tn&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new tn(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new tn(n.from,n.to,t.markFromJSON(n.mark))}}bt.jsonID("removeMark",tn);class qn extends bt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(i))return new qn(this.pos,n.marks[r]);return new qn(this.pos,this.mark)}}return new gi(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new qn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qn(n.pos,t.markFromJSON(n.mark))}}bt.jsonID("addNodeMark",qn);class gi extends bt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qn(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new gi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new gi(n.pos,t.markFromJSON(n.mark))}}bt.jsonID("removeNodeMark",gi);class Ze extends bt{constructor(t,n,i,r=!1){super(),this.from=t,this.to=n,this.slice=i,this.structure=r}apply(t){return this.structure&&al(t,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Dt([this.from,this.to-this.from,this.slice.size])}invert(t){return new Ze(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),i=this.from==this.to&&Ze.MAP_BIAS<0?n:t.mapResult(this.from,1);return i.deletedAcross&&n.deletedAcross?null:new Ze(i.pos,Math.max(i.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Ze)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Ze(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?ae.empty:new ae(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Ze(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ze(n.from,n.to,ae.fromJSON(t,n.slice),!!n.structure)}}Ze.MAP_BIAS=1;bt.jsonID("replace",Ze);class Ye extends bt{constructor(t,n,i,r,a,o,l=!1){super(),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=r,this.slice=a,this.insert=o,this.structure=l}apply(t){if(this.structure&&(al(t,this.from,this.gapFrom)||al(t,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Qe.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?Qe.fromReplace(t,this.from,this.to,i):Qe.fail("Content does not fit in gap")}getMap(){return new Dt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Ye(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?i.pos:t.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||r<n.pos||a>i.pos?null:new Ye(n.pos,i.pos,r,a,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(n.from,n.to,n.gapFrom,n.gapTo,ae.fromJSON(t,n.slice),n.insert,!!n.structure)}}bt.jsonID("replaceAround",Ye);function al(e,t,n){let i=e.resolve(t),r=n-t,a=i.depth;for(;r>0&&a>0&&i.indexAfter(a)==i.node(a).childCount;)a--,r--;if(r>0){let o=i.node(a).maybeChild(i.indexAfter(a));for(;r>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,r--}}return!1}function Ay(e,t,n,i){let r=[],a=[],o,l;e.doc.nodesBetween(t,n,(c,u,f)=>{if(!c.isInline)return;let m=c.marks;if(!i.isInSet(m)&&f.type.allowsMarkType(i.type)){let p=Math.max(u,t),h=Math.min(u+c.nodeSize,n),g=i.addToSet(m);for(let b=0;b<m.length;b++)m[b].isInSet(g)||(o&&o.to==p&&o.mark.eq(m[b])?o.to=h:r.push(o=new tn(p,h,m[b])));l&&l.to==p?l.to=h:a.push(l=new Hn(p,h,i))}}),r.forEach(c=>e.step(c)),a.forEach(c=>e.step(c))}function Ty(e,t,n,i){let r=[],a=0;e.doc.nodesBetween(t,n,(o,l)=>{if(!o.isInline)return;a++;let c=null;if(i instanceof Lo){let u=o.marks,f;for(;f=i.isInSet(u);)(c||(c=[])).push(f),u=f.removeFromSet(u)}else i?i.isInSet(o.marks)&&(c=[i]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,n);for(let f=0;f<c.length;f++){let m=c[f],p;for(let h=0;h<r.length;h++){let g=r[h];g.step==a-1&&m.eq(r[h].style)&&(p=g)}p?(p.to=u,p.step=a):r.push({style:m,from:Math.max(l,t),to:u,step:a})}}}),r.forEach(o=>e.step(new tn(o.from,o.to,o.style)))}function Kl(e,t,n,i=n.contentMatch,r=!0){let a=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c<a.childCount;c++){let u=a.child(c),f=l+u.nodeSize,m=i.matchType(u.type);if(!m)o.push(new Ze(l,f,ae.empty));else{i=m;for(let p=0;p<u.marks.length;p++)n.allowsMarkType(u.marks[p].type)||e.step(new tn(l,f,u.marks[p]));if(r&&u.isText&&n.whitespace!="pre"){let p,h=/\r?\n|\r/g,g;for(;p=h.exec(u.text);)g||(g=new ae(J.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new Ze(l+p.index,l+p.index+p[0].length,g))}}l=f}if(!i.validEnd){let c=i.fillBefore(J.empty,!0);e.replace(l,l,new ae(c,0,0))}for(let c=o.length-1;c>=0;c--)e.step(o[c])}function Ny(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function qi(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,r=0,a=0;;--i){let o=e.$from.node(i),l=e.$from.index(i)+r,c=e.$to.indexAfter(i)-a;if(i<e.depth&&o.canReplace(l,c,n))return i;if(i==0||o.type.spec.isolating||!Ny(o,l,c))break;l&&(r=1),c<o.childCount&&(a=1)}return null}function Oy(e,t,n){let{$from:i,$to:r,depth:a}=t,o=i.before(a+1),l=r.after(a+1),c=o,u=l,f=J.empty,m=0;for(let g=a,b=!1;g>n;g--)b||i.index(g)>0?(b=!0,f=J.from(i.node(g).copy(f)),m++):c--;let p=J.empty,h=0;for(let g=a,b=!1;g>n;g--)b||r.after(g+1)<r.end(g)?(b=!0,p=J.from(r.node(g).copy(p)),h++):u++;e.step(new Ye(c,u,o,l,new ae(f.append(p),m,h),f.size-m,!0))}function Xl(e,t,n=null,i=e){let r=My(e,t),a=r&&Dy(i,t);return a?r.map(Ou).concat({type:t,attrs:n}).concat(a.map(Ou)):null}function Ou(e){return{type:e,attrs:null}}function My(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.contentMatchAt(i).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(i,r,o)?a:null}function Dy(e,t){let{parent:n,startIndex:i,endIndex:r}=e,a=n.child(i),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let c=(o.length?o[o.length-1]:t).contentMatch;for(let u=i;c&&u<r;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:o}function zy(e,t,n){let i=J.empty;for(let o=n.length-1;o>=0;o--){if(i.size){let l=n[o].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=J.from(n[o].type.create(n[o].attrs,i))}let r=t.start,a=t.end;e.step(new Ye(r,a,r,a,new ae(i,0,0),n.length,!0))}function Iy(e,t,n,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=e.steps.length;e.doc.nodesBetween(t,n,(o,l)=>{let c=typeof r=="function"?r(o):r;if(o.isTextblock&&!o.hasMarkup(i,c)&&Ry(e.doc,e.mapping.slice(a).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",g=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!g?u=!1:!h&&g&&(u=!0)}u===!1&&sp(e,o,l,a),Kl(e,e.mapping.slice(a).map(l,1),i,void 0,u===null);let f=e.mapping.slice(a),m=f.map(l,1),p=f.map(l+o.nodeSize,1);return e.step(new Ye(m,p,m+1,p-1,new ae(J.from(i.create(c,null,o.marks)),0,0),1,!0)),u===!0&&op(e,o,l,a),!1}})}function op(e,t,n,i){t.forEach((r,a)=>{if(r.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(r.text);){let c=e.mapping.slice(i).map(n+1+a+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function sp(e,t,n,i){t.forEach((r,a)=>{if(r.type==r.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(n+1+a);e.replaceWith(o,o+1,t.type.schema.text(`
601
+ `))}})}function Ry(e,t,n){let i=e.resolve(t),r=i.index();return i.parent.canReplaceWith(r,r+1,n)}function Ly(e,t,n,i,r){let a=e.doc.nodeAt(t);if(!a)throw new RangeError("No node at given position");n||(n=a.type);let o=n.create(i,null,r||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Ye(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new ae(J.from(o),0,0),1,!0))}function Tn(e,t,n=1,i){let r=e.resolve(t),a=r.depth-n,o=i&&i[i.length-1]||r.parent;if(a<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!o.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,f=n-2;u>a;u--,f--){let m=r.node(u),p=r.index(u);if(m.type.spec.isolating)return!1;let h=m.content.cutByIndex(p,m.childCount),g=i&&i[f+1];g&&(h=h.replaceChild(0,g.type.create(g.attrs)));let b=i&&i[f]||m;if(!m.canReplace(p+1,m.childCount)||!b.type.validContent(h))return!1}let l=r.indexAfter(a),c=i&&i[0];return r.node(a).canReplaceWith(l,l,c?c.type:r.node(a+1).type)}function By(e,t,n=1,i){let r=e.doc.resolve(t),a=J.empty,o=J.empty;for(let l=r.depth,c=r.depth-n,u=n-1;l>c;l--,u--){a=J.from(r.node(l).copy(a));let f=i&&i[u];o=J.from(f?f.type.create(f.attrs,o):r.node(l).copy(o))}e.step(new Ze(t,t,new ae(a.append(o),n,n),!0))}function Xn(e,t){let n=e.resolve(t),i=n.index();return lp(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Py(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let r=0;r<t.childCount;r++){let a=t.child(r),o=a.type==i?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function lp(e,t){return!!(e&&t&&!e.isLeaf&&Py(e,t))}function Bo(e,t,n=-1){let i=e.resolve(t);for(let r=i.depth;;r--){let a,o,l=i.index(r);if(r==i.depth?(a=i.nodeBefore,o=i.nodeAfter):n>0?(a=i.node(r+1),l++,o=i.node(r).maybeChild(l)):(a=i.node(r).maybeChild(l-1),o=i.node(r+1)),a&&!a.isTextblock&&lp(a,o)&&i.node(r).canReplace(l,l+1))return t;if(r==0)break;t=n<0?i.before(r):i.after(r)}}function Fy(e,t,n){let i=null,{linebreakReplacement:r}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(r&&o.inlineContent){let f=o.whitespace=="pre",m=!!o.contentMatch.matchType(r);f&&!m?i=!1:!f&&m&&(i=!0)}let l=e.steps.length;if(i===!1){let f=e.doc.resolve(t+n);sp(e,f.node(),f.before(),l)}o.inlineContent&&Kl(e,t+n-1,o,a.node().contentMatchAt(a.index()),i==null);let c=e.mapping.slice(l),u=c.map(t-n);if(e.step(new Ze(u,c.map(t+n,-1),ae.empty,!0)),i===!0){let f=e.doc.resolve(u);op(e,f.node(),f.before(),e.steps.length)}return e}function Vy(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let a=i.index(r);if(i.node(r).canReplaceWith(a,a,n))return i.before(r+1);if(a>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let a=i.indexAfter(r);if(i.node(r).canReplaceWith(a,a,n))return i.after(r+1);if(a<i.node(r).childCount)return null}return null}function Uy(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let a=0;a<n.openStart;a++)r=r.firstChild.content;for(let a=1;a<=(n.openStart==0&&n.size?2:1);a++)for(let o=i.depth;o>=0;o--){let l=o==i.depth?0:i.pos<=(i.start(o+1)+i.end(o+1))/2?-1:1,c=i.index(o)+(l>0?1:0),u=i.node(o),f=!1;if(a==1)f=u.canReplace(c,c,r);else{let m=u.contentMatchAt(c).findWrapping(r.firstChild.type);f=m&&u.canReplaceWith(c,c,m[0])}if(f)return l==0?i.pos:l<0?i.before(o+1):i.after(o+1)}return null}function Po(e,t,n=t,i=ae.empty){if(t==n&&!i.size)return null;let r=e.resolve(t),a=e.resolve(n);return cp(r,a,i)?new Ze(t,n,i):new Hy(r,a,i).fit()}function cp(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Hy{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=J.empty;for(let r=0;r<=t.depth;r++){let a=t.node(r);this.frontier.push({type:a.type,match:a.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=J.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(t<0?this.$to:i.doc.resolve(t));if(!r)return null;let a=this.placed,o=i.depth,l=r.depth;for(;o&&l&&a.childCount==1;)a=a.firstChild.content,o--,l--;let c=new ae(a,o,l);return t>-1?new Ye(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new Ze(i.pos,r.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<t;i++){let a=n.firstChild;if(n.childCount>1&&(r=0),a.type.spec.isolating&&r<=i){t=i;break}n=a.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let r,a=null;i?(a=ps(this.unplaced.content,i-1).firstChild,r=a.content):r=this.unplaced.content;let o=r.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],f,m=null;if(n==1&&(o?u.matchType(o.type)||(m=u.fillBefore(J.from(o),!1)):a&&c.compatibleContent(a.type)))return{sliceDepth:i,frontierDepth:l,parent:a,inject:m};if(n==2&&o&&(f=u.findWrapping(o.type)))return{sliceDepth:i,frontierDepth:l,parent:a,wrap:f};if(a&&u.matchType(a.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=ps(t,n);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new ae(t,n+1,Math.max(i,r.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,r=ps(t,n);if(r.childCount<=1&&n>0){let a=t.size-n<=n+r.size;this.unplaced=new ae(or(t,n-1,1),n-1,a?n-1:i)}else this.unplaced=new ae(or(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:r,wrap:a}){for(;this.depth>n;)this.closeFrontierNode();if(a)for(let b=0;b<a.length;b++)this.openFrontierNode(a[b]);let o=this.unplaced,l=i?i.content:o.content,c=o.openStart-t,u=0,f=[],{match:m,type:p}=this.frontier[n];if(r){for(let b=0;b<r.childCount;b++)f.push(r.child(b));m=m.matchFragment(r)}let h=l.size+t-(o.content.size-o.openEnd);for(;u<l.childCount;){let b=l.child(u),y=m.matchType(b.type);if(!y)break;u++,(u>1||c==0||b.content.size)&&(m=y,f.push(up(b.mark(p.allowedMarks(b.marks)),u==1?c:0,u==l.childCount?h:-1)))}let g=u==l.childCount;g||(h=-1),this.placed=sr(this.placed,n,J.from(f)),this.frontier[n].match=m,g&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,y=l;b<h;b++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=g?t==0?ae.empty:new ae(or(o.content,t-1,1),t-1,h<0?o.openEnd:t-1):new ae(or(o.content,t,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!ms(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:r}=this.frontier[n],a=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=ms(t,n,r,i,a);if(o){for(let l=n-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],f=ms(t,l,u,c,!0);if(!f||f.childCount)continue e}return{depth:n,fit:o,move:a?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=sr(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let r=t.node(i),a=r.type.contentMatch.fillBefore(r.content,!0,t.index(i));this.openFrontierNode(r.type,r.attrs,a)}return t}openFrontierNode(t,n=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=sr(this.placed,this.depth,J.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(J.empty,!0);n.childCount&&(this.placed=sr(this.placed,this.frontier.length,n))}}function or(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(or(e.firstChild.content,t-1,n)))}function sr(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(sr(e.lastChild.content,t-1,n)))}function ps(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function up(e,t,n){if(t<=0)return e;let i=e.content;return t>1&&(i=i.replaceChild(0,up(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(J.empty,!0)))),e.copy(i)}function ms(e,t,n,i,r){let a=e.node(t),o=r?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let l=i.fillBefore(a.content,!0,o);return l&&!qy(n,a.content,o)?l:null}function qy(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}function jy(e){return e.spec.defining||e.spec.definingForContent}function $y(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),a=e.doc.resolve(n);if(cp(r,a,i))return e.step(new Ze(t,n,i));let o=fp(r,a);o[o.length-1]==0&&o.pop();let l=-(r.depth+1);o.unshift(l);for(let p=r.depth,h=r.pos-1;p>0;p--,h--){let g=r.node(p).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(p)>-1?l=p:r.before(p)==h&&o.splice(1,0,-p)}let c=o.indexOf(l),u=[],f=i.openStart;for(let p=i.content,h=0;;h++){let g=p.firstChild;if(u.push(g),h==i.openStart)break;p=g.content}for(let p=f-1;p>=0;p--){let h=u[p],g=jy(h.type);if(g&&!h.sameMarkup(r.node(Math.abs(l)-1)))f=p;else if(g||!h.type.isTextblock)break}for(let p=i.openStart;p>=0;p--){let h=(p+f+1)%(i.openStart+1),g=u[h];if(g)for(let b=0;b<o.length;b++){let y=o[(b+c)%o.length],v=!0;y<0&&(v=!1,y=-y);let x=r.node(y-1),k=r.index(y-1);if(x.canReplaceWith(k,k,g.type,g.marks))return e.replace(r.before(y),v?a.after(y):n,new ae(dp(i.content,0,i.openStart,h),h,i.openEnd))}}let m=e.steps.length;for(let p=o.length-1;p>=0&&(e.replace(t,n,i),!(e.steps.length>m));p--){let h=o[p];h<0||(t=r.before(h),n=a.after(h))}}function dp(e,t,n,i,r){if(t<n){let a=e.firstChild;e=e.replaceChild(0,a.copy(dp(a.content,t+1,n,i,a)))}if(t>i){let a=r.contentMatchAt(0),o=a.fillBefore(e).append(e);e=o.append(a.matchFragment(o).fillBefore(J.empty,!0))}return e}function Wy(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=Vy(e.doc,t,i.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new ae(J.from(i),0,0))}function Gy(e,t,n){let i=e.doc.resolve(t),r=e.doc.resolve(n);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let o=i.sharedDepth(n),l=!1;for(let c=i.depth;c>o;c--)i.node(c).type.spec.isolating&&(l=!0);for(let c=r.depth;c>o;c--)r.node(c).type.spec.isolating&&(l=!0);if(!l){for(let c=i.depth;c>0&&t==i.start(c);c--)t=i.before(c);for(let c=r.depth;c>0&&n==r.start(c);c--)n=r.before(c);i=e.doc.resolve(t),r=e.doc.resolve(n)}}let a=fp(i,r);for(let o=0;o<a.length;o++){let l=a[o],c=o==a.length-1;if(c&&l==0||i.node(l).type.contentMatch.validEnd)return e.delete(i.start(l),r.end(l));if(l>0&&(c||i.node(l-1).canReplace(i.index(l-1),r.indexAfter(l-1))))return e.delete(i.before(l),r.after(l))}for(let o=1;o<=i.depth&&o<=r.depth;o++)if(t-i.start(o)==i.depth-o&&n>i.end(o)&&r.end(o)-n!=r.depth-o&&i.start(o-1)==r.start(o-1)&&i.node(o-1).canReplace(i.index(o-1),r.index(o-1)))return e.delete(i.before(o),n);e.delete(t,n)}function fp(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let r=i;r>=0;r--){let a=e.start(r);if(a<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(a==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==a-1)&&n.push(r)}return n}class Ii extends bt{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return Qe.fail("No node at attribute step's position");let i=Object.create(null);for(let a in n.attrs)i[a]=n.attrs[a];i[this.attr]=this.value;let r=n.type.create(i,null,n.marks);return Qe.fromReplace(t,this.pos,this.pos+1,new ae(J.from(r),0,n.isLeaf?0:1))}getMap(){return Dt.empty}invert(t){return new Ii(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ii(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ii(n.pos,n.attr,n.value)}}bt.jsonID("attr",Ii);class Cr extends bt{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return Qe.ok(i)}getMap(){return Dt.empty}invert(t){return new Cr(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cr(n.attr,n.value)}}bt.jsonID("docAttr",Cr);let Li=class extends Error{};Li=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Li.prototype=Object.create(Error.prototype);Li.prototype.constructor=Li;Li.prototype.name="TransformError";class pp{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ga}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Li(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((a,o,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=ae.empty){let r=Po(this.doc,t,n,i);return r&&this.step(r),this}replaceWith(t,n,i){return this.replace(t,n,new ae(J.from(i),0,0))}delete(t,n){return this.replace(t,n,ae.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return $y(this,t,n,i),this}replaceRangeWith(t,n,i){return Wy(this,t,n,i),this}deleteRange(t,n){return Gy(this,t,n),this}lift(t,n){return Oy(this,t,n),this}join(t,n=1){return Fy(this,t,n),this}wrap(t,n){return zy(this,t,n),this}setBlockType(t,n=t,i,r=null){return Iy(this,t,n,i,r),this}setNodeMarkup(t,n,i=null,r){return Ly(this,t,n,i,r),this}setNodeAttribute(t,n,i){return this.step(new Ii(t,n,i)),this}setDocAttribute(t,n){return this.step(new Cr(t,n)),this}addNodeMark(t,n){return this.step(new qn(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Re)n.isInSet(i.marks)&&this.step(new gi(t,n));else{let r=i.marks,a,o=[];for(;a=n.isInSet(r);)o.push(new gi(t,a)),r=a.removeFromSet(r);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,n=1,i){return By(this,t,n,i),this}addMark(t,n,i){return Ay(this,t,n,i),this}removeMark(t,n,i){return Ty(this,t,n,i),this}clearIncompatible(t,n,i){return Kl(this,t,n,i),this}}const hs=Object.create(null);class ke{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new mp(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=ae.empty){let i=n.content.lastChild,r=null;for(let l=0;l<n.openEnd;l++)r=i,i=i.lastChild;let a=t.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:u}=o[l],f=t.mapping.slice(a);t.replaceRange(f.map(c.pos),f.map(u.pos),l?ae.empty:n),l==0&&zu(t,a,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let i=t.steps.length,r=this.ranges;for(let a=0;a<r.length;a++){let{$from:o,$to:l}=r[a],c=t.mapping.slice(i),u=c.map(o.pos),f=c.map(l.pos);a?t.deleteRange(u,f):(t.replaceRangeWith(u,f,n),zu(t,i,n.isInline?-1:1))}}static findFrom(t,n,i=!1){let r=t.parent.inlineContent?new ge(t):Mi(t.node(0),t.parent,t.pos,t.index(),n,i);if(r)return r;for(let a=t.depth-1;a>=0;a--){let o=n<0?Mi(t.node(0),t.node(a),t.before(a+1),t.index(a),n,i):Mi(t.node(0),t.node(a),t.after(a+1),t.index(a)+1,n,i);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new It(t.node(0))}static atStart(t){return Mi(t,t,0,0,1)||new It(t)}static atEnd(t){return Mi(t,t,t.content.size,t.childCount,-1)||new It(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=hs[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in hs)throw new RangeError("Duplicate use of selection JSON ID "+t);return hs[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ge.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class mp{constructor(t,n){this.$from=t,this.$to=n}}let Mu=!1;function Du(e){!Mu&&!e.parent.inlineContent&&(Mu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ge extends ke{constructor(t,n=t){Du(t),Du(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return ke.near(i);let r=t.resolve(n.map(this.anchor));return new ge(r.parent.inlineContent?r:i,i)}replace(t,n=ae.empty){if(super.replace(t,n),n==ae.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ge&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Fo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ge(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let r=t.resolve(n);return new this(r,i==n?r:t.resolve(i))}static between(t,n,i){let r=t.pos-n.pos;if((!i||r)&&(i=r>=0?1:-1),!n.parent.inlineContent){let a=ke.findFrom(n,i,!0)||ke.findFrom(n,-i,!0);if(a)n=a.$head;else return ke.near(n,i)}return t.parent.inlineContent||(r==0?t=n:(t=(ke.findFrom(t,-i,!0)||ke.findFrom(t,i,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new ge(t,n)}}ke.jsonID("text",ge);class Fo{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Fo(t.map(this.anchor),t.map(this.head))}resolve(t){return ge.between(t.resolve(this.anchor),t.resolve(this.head))}}class be extends ke{constructor(t){let n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);super(t,i),this.node=n}map(t,n){let{deleted:i,pos:r}=n.mapResult(this.anchor),a=t.resolve(r);return i?ke.near(a):new be(a)}content(){return new ae(J.from(this.node),0,0)}eq(t){return t instanceof be&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Jl(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new be(t.resolve(n.anchor))}static create(t,n){return new be(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}be.prototype.visible=!1;ke.jsonID("node",be);class Jl{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:i}=t.mapResult(this.anchor);return n?new Fo(i,i):new Jl(i)}resolve(t){let n=t.resolve(this.anchor),i=n.nodeAfter;return i&&be.isSelectable(i)?new be(n):ke.near(n)}}class It extends ke{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=ae.empty){if(n==ae.empty){t.delete(0,t.doc.content.size);let i=ke.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new It(t)}map(t){return new It(t)}eq(t){return t instanceof It}getBookmark(){return Ky}}ke.jsonID("all",It);const Ky={map(){return this},resolve(e){return new It(e)}};function Mi(e,t,n,i,r,a=!1){if(t.inlineContent)return ge.create(e,n);for(let o=i-(r>0?0:1);r>0?o<t.childCount:o>=0;o+=r){let l=t.child(o);if(l.isAtom){if(!a&&be.isSelectable(l))return be.create(e,n-(r<0?l.nodeSize:0))}else{let c=Mi(e,l,n+r,r<0?l.childCount:0,r,a);if(c)return c}n+=l.nodeSize*r}return null}function zu(e,t,n){let i=e.steps.length-1;if(i<t)return;let r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;let a=e.mapping.maps[i],o;a.forEach((l,c,u,f)=>{o==null&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}function Iu(e,t){return!t||!e?e:e.bind(t)}class ba{constructor(t,n,i){this.name=t,this.init=Iu(n.init,i),this.apply=Iu(n.apply,i)}}new ba("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ba("selection",{init(e,t){return e.selection||ke.atStart(t.doc)},apply(e){return e.selection}}),new ba("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new ba("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}});function hp(e,t,n){for(let i in e){let r=e[i];r instanceof Function?r=r.bind(t):i=="handleDOMEvents"&&(r=hp(r,t,{})),n[i]=r}return n}class ct{constructor(t){this.spec=t,this.props={},t.props&&hp(t.props,this,this.props),this.key=t.key?t.key.key:bp("plugin")}getState(t){return t[this.key]}}const bs=Object.create(null);function bp(e){return e in bs?e+"$"+ ++bs[e]:(bs[e]=0,e+"$")}class rt{constructor(t="key"){this.key=bp(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const yi=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},gp=function(e,t,n,i){return n&&(Ru(e,t,n,i,-1)||Ru(e,t,n,i,1))},Xy=/^(img|br|input|textarea|hr)$/i;function Ru(e,t,n,i,r){for(var a;;){if(e==n&&t==i)return!0;if(t==(r<0?0:Ka(e))){let o=e.parentNode;if(!o||o.nodeType!=1||Zl(e)||Xy.test(e.nodeName)||e.contentEditable=="false")return!1;t=yi(e)+(r<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(r<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)t+=r;else return!1;else e=o,t=r<0?Ka(e):0}else return!1}}function Ka(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Jy(e,t,n){for(let i=t==0,r=t==Ka(e);i||r;){if(e==n)return!0;let a=yi(e);if(e=e.parentNode,!e)return!1;i=i&&a==0,r=r&&a==Ka(e)}}function Zl(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const vp=function(e){return e.focusNode&&gp(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function xp(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const an=typeof navigator<"u"?navigator:null,Lu=typeof document<"u"?document:null,Jn=an&&an.userAgent||"",ol=/Edge\/(\d+)/.exec(Jn),yp=/MSIE \d/.exec(Jn),sl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jn),Lr=!!(yp||sl||ol),kp=yp?document.documentMode:sl?+sl[1]:ol?+ol[1]:0,Vo=!Lr&&/gecko\/(\d+)/i.test(Jn);Vo&&+(/Firefox\/(\d+)/.exec(Jn)||[0,0])[1];const ll=!Lr&&/Chrome\/(\d+)/.exec(Jn),Zn=!!ll,wp=ll?+ll[1]:0,ki=!Lr&&!!an&&/Apple Computer/.test(an.vendor),Ql=ki&&(/Mobile\/\w+/.test(Jn)||!!an&&an.maxTouchPoints>2),Vt=Ql||(an?/Mac/.test(an.platform):!1),_p=an?/Win/.test(an.platform):!1,Br=/Android \d/.test(Jn),Yl=!!Lu&&"webkitFontSmoothing"in Lu.documentElement.style,Zy=Yl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qy(e,t=null){let n=e.domSelectionRange(),i=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),a=r&&r.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=i.resolve(o),c,u;if(vp(n)){for(c=o;r&&!r.node;)r=r.parent;let m=r.node;if(r&&m.isAtom&&be.isSelectable(m)&&r.parent&&!(m.isInline&&Jy(n.focusNode,n.focusOffset,r.dom))){let p=r.posBefore;u=new be(o==p?l:i.resolve(p))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let m=o,p=o;for(let h=0;h<n.rangeCount;h++){let g=n.getRangeAt(h);m=Math.min(m,e.docView.posFromDOM(g.startContainer,g.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(m<0)return null;[c,o]=p==e.state.selection.anchor?[p,m]:[m,p],l=i.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let f=i.resolve(c);if(!u){let m=t=="pointer"||e.state.selection.head<l.pos&&!a?1:-1;u=Cp(e,f,l,m)}return u}function Sp(e){return e.editable?e.hasFocus():nk(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ec(e,t=!1){let n=e.state.selection;if(tk(e,n),!Sp(e))return;let i=e.input.mouseDown;if(!t&&Zn&&i){let r=e.domSelectionRange(),a=e.domObserver.currentSelection;if(r.anchorNode&&a.anchorNode&&gp(r.anchorNode,r.anchorOffset,a.anchorNode,a.anchorOffset)&&i.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)ek(e);else{let{anchor:r,head:a}=n,o,l;Bu&&!(n instanceof ge)&&(n.$from.parent.inlineContent||(o=Pu(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=Pu(e,n.to))),e.docView.setSelection(r,a,e,t),Bu&&(o&&Fu(o),l&&Fu(l)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Yy(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const Bu=ki||Zn&&wp<63;function Pu(e,t){let{node:n,offset:i}=e.docView.domFromPos(t,0),r=i<n.childNodes.length?n.childNodes[i]:null,a=i?n.childNodes[i-1]:null;if(ki&&r&&r.contentEditable=="false")return gs(r);if((!r||r.contentEditable=="false")&&(!a||a.contentEditable=="false")){if(r)return gs(r);if(a)return gs(a)}}function gs(e){return e.contentEditable="true",ki&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Fu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Yy(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),i=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=i||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Sp(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function ek(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.collapse(n.parentNode,yi(n)+1):t.collapse(n,0),!i&&!e.state.selection.visible&&Lr&&kp<=11&&(n.disabled=!0,n.disabled=!1)}function tk(e,t){if(t instanceof be){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vu(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vu(e)}function Vu(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Cp(e,t,n,i){return e.someProp("createSelectionBetween",r=>r(e,t,n))||ge.between(t,n,i)}function nk(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function cl(e,t){let{$anchor:n,$head:i}=e.selection,r=t>0?n.max(i):n.min(i),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&ke.findFrom(a,t)}function Ln(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Uu(e,t,n){let i=e.state.selection;if(i instanceof ge)if(n.indexOf("s")>-1){let{$head:r}=i,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=e.state.doc.resolve(r.pos+a.nodeSize*(t<0?-1:1));return Ln(e,new ge(i.$anchor,o))}else if(i.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=cl(e.state,t);return r&&r instanceof be?Ln(e,r):!1}else if(!(Vt&&n.indexOf("m")>-1)){let r=i.$head,a=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,o;if(!a||a.isText)return!1;let l=t<0?r.pos-a.nodeSize:r.pos;return a.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?be.isSelectable(a)?Ln(e,new be(t<0?e.state.doc.resolve(r.pos-a.nodeSize):r)):Yl?Ln(e,new ge(e.state.doc.resolve(t<0?l:l+a.nodeSize))):!1:!1}}else return!1;else{if(i instanceof be&&i.node.isInline)return Ln(e,new ge(t>0?i.$to:i.$from));{let r=cl(e.state,t);return r?Ln(e,r):!1}}}function Xa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fr(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function Ti(e,t){return t<0?ik(e):rk(e)}function ik(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r,a,o=!1;for(Vo&&n.nodeType==1&&i<Xa(n)&&fr(n.childNodes[i],-1)&&(o=!0);;)if(i>0){if(n.nodeType!=1)break;{let l=n.childNodes[i-1];if(fr(l,-1))r=n,a=--i;else if(l.nodeType==3)n=l,i=n.nodeValue.length;else break}}else{if(Ep(n))break;{let l=n.previousSibling;for(;l&&fr(l,-1);)r=n.parentNode,a=yi(l),l=l.previousSibling;if(l)n=l,i=Xa(n);else{if(n=n.parentNode,n==e.dom)break;i=0}}}o?ul(e,n,i):r&&ul(e,r,a)}function rk(e){let t=e.domSelectionRange(),n=t.focusNode,i=t.focusOffset;if(!n)return;let r=Xa(n),a,o;for(;;)if(i<r){if(n.nodeType!=1)break;let l=n.childNodes[i];if(fr(l,1))a=n,o=++i;else break}else{if(Ep(n))break;{let l=n.nextSibling;for(;l&&fr(l,1);)a=l.parentNode,o=yi(l)+1,l=l.nextSibling;if(l)n=l,i=0,r=Xa(n);else{if(n=n.parentNode,n==e.dom)break;i=r=0}}}a&&ul(e,a,o)}function Ep(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function ak(e,t){for(;e&&t==e.childNodes.length&&!Zl(e);)t=yi(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function ok(e,t){for(;e&&!t&&!Zl(e);)t=yi(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function ul(e,t,n){if(t.nodeType!=3){let a,o;(o=ak(t,n))?(t=o,n=0):(a=ok(t,n))&&(t=a,n=a.nodeValue.length)}let i=e.domSelection();if(!i)return;if(vp(i)){let a=document.createRange();a.setEnd(t,n),a.setStart(t,n),i.removeAllRanges(),i.addRange(a)}else i.extend&&i.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&ec(e)},50)}function Hu(e,t){let n=e.state.doc.resolve(t);if(!(Zn||_p)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let a=e.coordsAtPos(t-1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left<r.left?"ltr":"rtl"}if(t<n.end()){let a=e.coordsAtPos(t+1),o=(a.top+a.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(a.left-r.left)>1)return a.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function qu(e,t,n){let i=e.state.selection;if(i instanceof ge&&!i.empty||n.indexOf("s")>-1||Vt&&n.indexOf("m")>-1)return!1;let{$from:r,$to:a}=i;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=cl(e.state,t);if(o&&o instanceof be)return Ln(e,o)}if(!r.parent.inlineContent){let o=t<0?r:a,l=i instanceof It?ke.near(o,t):ke.findFrom(o,t);return l?Ln(e,l):!1}return!1}function ju(e,t){if(!(e.state.selection instanceof ge))return!0;let{$head:n,$anchor:i,empty:r}=e.state.selection;if(!n.sameParent(i))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let o=e.state.tr;return t<0?o.delete(n.pos-a.nodeSize,n.pos):o.delete(n.pos,n.pos+a.nodeSize),e.dispatch(o),!0}return!1}function $u(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function sk(e){if(!ki||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let i=t.firstChild;$u(e,i,"true"),setTimeout(()=>$u(e,i,"false"),20)}return!1}function lk(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function ck(e,t){let n=t.keyCode,i=lk(t);if(n==8||Vt&&n==72&&i=="c")return ju(e,-1)||Ti(e,-1);if(n==46&&!t.shiftKey||Vt&&n==68&&i=="c")return ju(e,1)||Ti(e,1);if(n==13||n==27)return!0;if(n==37||Vt&&n==66&&i=="c"){let r=n==37?Hu(e,e.state.selection.from)=="ltr"?-1:1:-1;return Uu(e,r,i)||Ti(e,r)}else if(n==39||Vt&&n==70&&i=="c"){let r=n==39?Hu(e,e.state.selection.from)=="ltr"?1:-1:1;return Uu(e,r,i)||Ti(e,r)}else{if(n==38||Vt&&n==80&&i=="c")return qu(e,-1,i)||Ti(e,-1);if(n==40||Vt&&n==78&&i=="c")return sk(e)||qu(e,1,i)||Ti(e,1);if(i==(Vt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Ap(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:i,openStart:r,openEnd:a}=t;for(;r>1&&a>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,a--;let h=i.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),i=h.content}let o=e.someProp("clipboardSerializer")||Hi.fromSchema(e.state.schema),l=zp(),c=l.createElement("div");c.appendChild(o.serializeFragment(i,{document:l}));let u=c.firstChild,f,m=0;for(;u&&u.nodeType==1&&(f=Dp[u.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let g=l.createElement(f[h]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),m++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${r} ${a}${m?` -${m}`:""} ${JSON.stringify(n)}`);let p=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
602
602
 
603
603
  `);return{dom:c,text:p,slice:t}}function Tp(e,t,n,i,r){let a=r.parent.type.spec.code,o,l;if(!n&&!t)return null;let c=!!t&&(i||a||!n);if(c){if(e.someProp("transformPastedText",p=>{t=p(t,a||i,e)}),a)return l=new ae(J.from(e.state.schema.text(t.replace(/\r\n?/g,`
604
- `))),0,0),e.someProp("transformPasted",p=>{l=p(l,e,!0)}),l;let m=e.someProp("clipboardTextParser",p=>p(t,r,i,e));if(m)l=m;else{let p=r.marks(),{schema:h}=e.state,g=Hi.fromSchema(h);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let y=o.appendChild(document.createElement("p"));b&&y.appendChild(g.serializeNode(h.text(b,p)))})}}else e.someProp("transformPastedHTML",m=>{n=m(n,e)}),o=fk(n),Yl&&pk(o);let u=o&&o.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let m=+f[3];m>0;m--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||ur.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!ck.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)l=mk(Wu(l,+f[1],+f[2]),f[4]);else if(l=ae.maxOpen(uk(l.content,r),!0),l.openStart||l.openEnd){let m=0,p=0;for(let h=l.content.firstChild;m<l.openStart&&!h.type.spec.isolating;m++,h=h.firstChild);for(let h=l.content.lastChild;p<l.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);l=Wu(l,m,p)}return e.someProp("transformPasted",m=>{l=m(l,e,c)}),l}const ck=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function uk(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,o=[];if(e.forEach(l=>{if(!o)return;let c=r.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&a.length&&Op(c,a,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Mp(o[o.length-1],a.length));let f=Np(l,c);o.push(f),r=r.matchType(f.type),a=c}}),o)return J.from(o)}return e}function Np(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,J.from(e));return e}function Op(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=Op(e,t,n,i.lastChild,r+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(J.from(Np(n,e,r+1))))}}function Mp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Mp(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(J.empty,!0);return e.copy(n.append(i))}function dl(e,t,n,i,r,a){let o=t<0?e.firstChild:e.lastChild,l=o.content;return e.childCount>1&&(a=0),r<i-1&&(l=dl(l,t,n,i,r+1,a)),r>=n&&(l=t<0?o.contentMatchAt(0).fillBefore(l,a<=r).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function Wu(e,t,n){return t<e.openStart&&(e=new ae(dl(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(dl(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Dp={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function zp(){return document.implementation.createHTMLDocument("title")}let vs=null;function dk(e){let t=window.trustedTypes;return t?(vs||(vs=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),vs.createHTML(e)):e}function fk(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=zp(),i=n.body,r=/<([a-z][^>\s]+)/i.exec(e),a;if((a=r&&Dp[r[1].toLowerCase()])&&(e=a.map(o=>"<"+o+">").join("")+e+a.map(o=>"</"+o+">").reverse().join("")),i.innerHTML=dk(e),a)for(let o=0;o<a.length;o++)i=i.querySelector(a[o])||i;for(let o=0;o<n.styleSheets.length;o++){let l=n.styleSheets[o];for(let c=0;c<l.rules.length;c++){let u=l.rules[c];if(u instanceof CSSStyleRule){let f=i.querySelectorAll(u.selectorText);for(let m=0;m<f.length;m++)f[m].style.cssText+=u.style.cssText}}}return i}function pk(e){let t=e.querySelectorAll(Zn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}function mk(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:o}=e;for(let l=i.length-2;l>=0;l-=2){let c=n.nodes[i[l]];if(!c||c.hasRequiredAttrs())break;r=J.from(c.create(i[l+1],r)),a++,o++}return new ae(r,a,o)}const Gt={},Rt={};function An(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Rt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Bp(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Br&&Zn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ql&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",r=>r(e,xp(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||lk(e,n)?n.preventDefault():An(e,"key")};Rt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Rt.keypress=(e,t)=>{let n=t;if(Bp(e)||!n.charCode||n.ctrlKey&&!n.altKey||Vt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof ge)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",o=>o(e,i.$from.pos,i.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function Pr(e){return{left:e.clientX,top:e.clientY}}function hk(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function tc(e,t,n,i,r){if(i==-1)return!1;let a=e.state.doc.resolve(i);for(let o=a.depth+1;o>0;o--)if(e.someProp(t,l=>o>a.depth?l(e,n,a.nodeAfter,a.before(o),r,!0):l(e,n,a.node(o),a.before(o),r,!1)))return!0;return!1}function Fr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function bk(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&be.isSelectable(i)?(Fr(e,new be(n)),!0):!1}function gk(e,t){if(t==-1)return!1;let n=e.state.selection,i,r;n instanceof be&&(i=n.node);let a=e.state.doc.resolve(t);for(let o=a.depth+1;o>0;o--){let l=o>a.depth?a.nodeAfter:a.node(o);if(be.isSelectable(l)){i&&n.$from.depth>0&&o>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(o);break}}return r!=null?(Fr(e,be.create(e.state.doc,r)),!0):!1}function vk(e,t,n,i,r){return tc(e,"handleClickOn",t,n,i)||e.someProp("handleClick",a=>a(e,t,i))||(r?gk(e,n):bk(e,n))}function xk(e,t,n,i){return tc(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",r=>r(e,t,i))}function yk(e,t,n,i){return tc(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",r=>r(e,t,i))||kk(e,n,i)}function kk(e,t,n){if(n.button!=0)return!1;let i=Ip(e,t,!0),r=e.state.doc;return i?(Fr(e,i),i instanceof ge&&r.eq(e.state.doc)&&(e.input.mouseDown=new _k(e,i)),!0):!1}function Ip(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?ge.create(i,0,i.content.size):null;let r=i.resolve(t);for(let a=r.depth+1;a>0;a--){let o=a>r.depth?r.nodeAfter:r.node(a),l=r.before(a);if(o.inlineContent)return ge.create(i,l+1,l+1+o.content.size);if(n&&be.isSelectable(o))return be.create(i,l)}return null}function nc(e){return Ja(e)}const Rp=Vt?"metaKey":"ctrlKey";Gt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=nc(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&hk(n,e.input.lastClick)&&!n[Rp]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Pr(n));o&&(a=="singleClick"?e.input.mouseDown=new wk(e,o,n,!!i):(a=="doubleClick"?xk:yk)(e,o.pos,o.inside,n)?n.preventDefault():An(e,"pointer"))};class Lp{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class wk extends Lp{constructor(t,n,i,r){super(t),this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[Rp],this.allowDefault=i.shiftKey;let a,o;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),o=n.inside;else{let f=t.state.doc.resolve(n.pos);a=f.parent,o=f.depth?f.before():0}const l=r?null:i.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof be&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Vo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),An(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ec(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pr(t))),this.updateAllowDefault(t),this.allowDefault||!n?An(this.view,"pointer"):vk(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||ki&&this.mightDrag&&!this.mightDrag.node.isAtom||Zn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Fr(this.view,ke.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):An(this.view,"pointer")}move(t){this.updateAllowDefault(t),An(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class _k extends Lp{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),An(this.view,"pointer");let n=this.view.posAtCoords(Pr(t)),i=n&&Ip(this.view,n.inside,!1);if(!i)return;let{doc:r}=this.view.state,a=this.startSelection,[o,l]=i.from<a.from?[a.to,i.from]:[a.from,i.to];Fr(this.view,ge.create(r,o,l))}}Gt.touchstart=e=>{e.input.lastTouch=Date.now(),nc(e),An(e,"pointer")};Gt.touchmove=e=>{e.input.lastTouch=Date.now(),An(e,"pointer")};Gt.contextmenu=e=>nc(e);function Bp(e,t){return e.composing?!0:ki&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Sk=Br?5e3:-1;Rt.compositionstart=Rt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ge&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||Zn&&_p&&Ck(e)))e.markCursor=e.state.storedMarks||n.marks(),Ja(e,!0),e.markCursor=null;else if(Ja(e,!t.selection.empty),Vo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let r=i.focusNode,a=i.focusOffset;r&&r.nodeType==1&&a!=0;){let o=a<0?r.lastChild:r.childNodes[a-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else r=o,a=-1}}e.input.composing=!0}Pp(e,Sk)};function Ck(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Rt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Pp(e,20))};function Pp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ja(e),t))}function Ek(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ja(e,t=!1){if(!(Br&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ek(e),t||e.docView&&e.docView.dirty){let n=Zy(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Ak(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Er=Lr&&kp<15||Ql&&Jy<604;Gt.copy=Rt.cut=(e,t)=>{let n=t,i=e.state.selection,r=n.type=="cut";if(i.empty)return;let a=Er?null:n.clipboardData,o=i.content(),{dom:l,text:c}=Ap(e,o);a?(n.preventDefault(),a.clearData(),a.setData("text/html",l.innerHTML),a.setData("text/plain",c)):Ak(e,l),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Tk(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Nk(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?fl(e,i.value,null,r,t):fl(e,i.textContent,i.innerHTML,r,t)},50)}function fl(e,t,n,i,r){let a=Tp(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,r,a||ae.empty)))return!0;if(!a)return!1;let o=Tk(a),l=o?e.state.tr.replaceSelectionWith(o,i):e.state.tr.replaceSelection(a);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Fp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rt.paste=(e,t)=>{let n=t;if(e.composing&&!Br)return;let i=Er?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&fl(e,Fp(i),i.getData("text/html"),r,n)?n.preventDefault():Nk(e,n)};class Ok{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const Mk=Vt?"altKey":"ctrlKey";function Vp(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[Mk]}Gt.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(Pr(n)),o;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof be?r.to-1:r.to))){if(i&&i.mightDrag)o=be.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=e.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=e.docView&&(o=be.create(e.state.doc,m.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:u,slice:f}=Ap(e,l);(!n.dataTransfer.files.length||!Zn||wp>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Er?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Er||n.dataTransfer.setData("text/plain",u),e.dragging=new Ok(f,Vp(e,n),o)};Gt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Rt.dragover=Rt.dragenter=(e,t)=>t.preventDefault();Rt.drop=(e,t)=>{try{Dk(e,t,e.dragging)}finally{e.dragging=null}};function Dk(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Pr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=Tp(e,Fp(t.dataTransfer),Er?null:t.dataTransfer.getData("text/html"),!1,r);let o=!!(n&&Vp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let l=a?Vy(e.state.doc,r.pos,a):r.pos;l==null&&(l=r.pos);let c=e.state.tr;if(o){let{node:h}=n;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,m=c.doc;if(f?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(m))return;let p=c.doc.resolve(u);if(f&&be.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new be(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,y,v)=>h=v),c.setSelection(Cp(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}Gt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ec(e)},20))};Gt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Gt.beforeinput=(e,t)=>{if(Br&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,xp(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Rt)Gt[e]=Rt[e];function Ar(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Za{constructor(t,n){this.toDOM=t,this.spec=n||mi,this.side=this.spec.side||0}map(t,n,i,r){let{pos:a,deleted:o}=t.mapResult(n.from+r,this.side<0?-1:1);return o?null:new ft(a-i,a-i,this)}valid(){return!0}eq(t){return this==t||t instanceof Za&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ar(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Wn{constructor(t,n){this.attrs=t,this.spec=n||mi}map(t,n,i,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,o=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return a>=o?null:new ft(a,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Wn&&Ar(this.attrs,t.attrs)&&Ar(this.spec,t.spec)}static is(t){return t.type instanceof Wn}destroy(){}}class ic{constructor(t,n){this.attrs=t,this.spec=n||mi}map(t,n,i,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let o=t.mapResult(n.to+r,-1);return o.deleted||o.pos<=a.pos?null:new ft(a.pos-i,o.pos-i,this)}valid(t,n){let{index:i,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(i)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof ic&&Ar(this.attrs,t.attrs)&&Ar(this.spec,t.spec)}destroy(){}}class ft{constructor(t,n,i){this.from=t,this.to=n,this.type=i}copy(t,n){return new ft(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,i){return this.type.map(t,this,n,i)}static widget(t,n,i){return new ft(t,t,new Za(n,i))}static inline(t,n,i,r){return new ft(t,n,new Wn(i,r))}static node(t,n,i,r){return new ft(t,n,new ic(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Wn}get widget(){return this.type instanceof Za}}const Di=[],mi={};class je{constructor(t,n){this.local=t.length?t:Di,this.children=n.length?n:Di}static create(t,n){return n.length?Qa(n,t,0,mi):kt}find(t,n,i){let r=[];return this.findInner(t??0,n??1e9,r,0,i),r}findInner(t,n,i,r,a){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=t&&(!a||a(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let l=this.children[o]+1;this.children[o+2].findInner(t-l,n-l,i,r+l,a)}}map(t,n,i){return this==kt||t.maps.length==0?this:this.mapInner(t,n,0,0,i||mi)}mapInner(t,n,i,r,a){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,i,r);c&&c.type.valid(n,c)?(o||(o=[])).push(c):a.onRemove&&a.onRemove(this.local[l].spec)}return this.children.length?zk(this.children,o||[],t,n,i,r,a):o?new je(o.sort(hi),Di):kt}add(t,n){return n.length?this==kt?je.create(t,n):this.addInner(t,n,0):this}addInner(t,n,i){let r,a=0;t.forEach((l,c)=>{let u=c+i,f;if(f=Hp(n,l,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<c;)a+=3;r[a]==c?r[a+2]=r[a+2].addInner(l,f,u+1):r.splice(a,0,c,c+l.nodeSize,Qa(f,l,u+1,mi)),a+=3}});let o=Up(a?qp(n):n,-i);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||o.splice(l--,1);return new je(o.length?this.local.concat(o).sort(hi):this.local,r||this.children)}remove(t){return t.length==0||this==kt?this:this.removeInner(t,0)}removeInner(t,n){let i=this.children,r=this.local;for(let a=0;a<i.length;a+=3){let o,l=i[a]+n,c=i[a+1]+n;for(let f=0,m;f<t.length;f++)(m=t[f])&&m.from>l&&m.to<c&&(t[f]=null,(o||(o=[])).push(m));if(!o)continue;i==this.children&&(i=this.children.slice());let u=i[a+2].removeInner(o,l+1);u!=kt?i[a+2]=u:(i.splice(a,3),a-=3)}if(r.length){for(let a=0,o;a<t.length;a++)if(o=t[a])for(let l=0;l<r.length;l++)r[l].eq(o,n)&&(r==this.local&&(r=this.local.slice()),r.splice(l--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new je(r,i):kt}forChild(t,n){if(this==kt)return this;if(n.isLeaf)return je.empty;let i,r;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(i=this.children[l+2]);break}let a=t+1,o=a+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>a&&c.type instanceof Wn){let u=Math.max(a,c.from)-a,f=Math.min(o,c.to)-a;u<f&&(r||(r=[])).push(c.copy(u,f))}}if(r){let l=new je(r.sort(hi),Di);return i?new oi([l,i]):l}return i||kt}eq(t){if(this==t)return!0;if(!(t instanceof je)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return rc(this.localsInner(t))}localsInner(t){if(this==kt)return Di;if(t.inlineContent||!this.local.some(Wn.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Wn||n.push(this.local[i]);return n}forEachSet(t){t(this)}}je.empty=new je([],[]);je.removeOverlap=rc;const kt=je.empty;class oi{constructor(t){this.members=t}map(t,n){const i=this.members.map(r=>r.map(t,n,mi));return oi.from(i)}forChild(t,n){if(n.isLeaf)return je.empty;let i=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=kt&&(a instanceof oi?i=i.concat(a.members):i.push(a))}return oi.from(i)}eq(t){if(!(t instanceof oi)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,i=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{i&&(n=n.slice(),i=!1);for(let o=0;o<a.length;o++)n.push(a[o])}}return n?rc(i?n:n.sort(hi)):Di}static from(t){switch(t.length){case 0:return kt;case 1:return t[0];default:return new oi(t.every(n=>n instanceof je)?t:t.reduce((n,i)=>n.concat(i instanceof je?i:i.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function zk(e,t,n,i,r,a,o){let l=e.slice();for(let u=0,f=a;u<n.maps.length;u++){let m=0;n.maps[u].forEach((p,h,g,b)=>{let y=b-g-(h-p);for(let v=0;v<l.length;v+=3){let x=l[v+1];if(x<0||p>x+f-m)continue;let k=l[v]+f-m;h>=k?l[v+1]=p<=k?-2:-1:p>=f&&y&&(l[v]+=y,l[v+1]+=y)}m+=y}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){c=!0,l[u+1]=-1;continue}let f=n.map(e[u]+a),m=f-r;if(m<0||m>=i.content.size){c=!0;continue}let p=n.map(e[u+1]+a,-1),h=p-r,{index:g,offset:b}=i.content.findIndex(m),y=i.maybeChild(g);if(y&&b==m&&b+y.nodeSize==h){let v=l[u+2].mapInner(n,y,f+1,e[u]+a+1,o);v!=kt?(l[u]=m,l[u+1]=h,l[u+2]=v):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=Ik(l,e,t,n,r,a,o),f=Qa(u,i,0,o);t=f.local;for(let m=0;m<l.length;m+=3)l[m+1]<0&&(l.splice(m,3),m-=3);for(let m=0,p=0;m<f.children.length;m+=3){let h=f.children[m];for(;p<l.length&&l[p]<h;)p+=3;l.splice(p,0,f.children[m],f.children[m+1],f.children[m+2])}}return new je(t.sort(hi),l)}function Up(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new ft(r.from+t,r.to+t,r.type))}return n}function Ik(e,t,n,i,r,a,o){function l(c,u){for(let f=0;f<c.local.length;f++){let m=c.local[f].map(i,r,u);m?n.push(m):o.onRemove&&o.onRemove(c.local[f].spec)}for(let f=0;f<c.children.length;f+=3)l(c.children[f+2],c.children[f]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+a+1);return n}function Hp(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let a=0,o;a<e.length;a++)(o=e[a])&&o.from>n&&o.to<i&&((r||(r=[])).push(o),e[a]=null);return r}function qp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Qa(e,t,n,i){let r=[],a=!1;t.forEach((l,c)=>{let u=Hp(e,l,c+n);if(u){a=!0;let f=Qa(u,l,n+c+1,i);f!=kt&&r.push(c,c+l.nodeSize,f)}});let o=Up(a?qp(e):e,-n).sort(hi);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(i.onRemove&&i.onRemove(o[l].spec),o.splice(l--,1));return o.length||r.length?new je(o,r):kt}function hi(e,t){return e.from-t.from||e.to-t.to}function rc(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==i.from){a.to!=i.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,i.to),Gu(t,r+1,a.copy(i.to,a.to)));continue}else{a.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,a.from),Gu(t,r,i.copy(a.from,i.to)));break}}}return t}function Gu(e,t,n){for(;t<e.length&&hi(n,e[t])>0;)t++;e.splice(t,0,n)}var Gn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ya={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rk=typeof navigator<"u"&&/Mac/.test(navigator.platform),Lk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)Gn[48+st]=Gn[96+st]=String(st);for(var st=1;st<=24;st++)Gn[st+111]="F"+st;for(var st=65;st<=90;st++)Gn[st]=String.fromCharCode(st+32),Ya[st]=String.fromCharCode(st);for(var xs in Gn)Ya.hasOwnProperty(xs)||(Ya[xs]=Gn[xs]);function Bk(e){var t=Rk&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Lk&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ya:Gn)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Pk=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Fk=typeof navigator<"u"&&/Win/.test(navigator.platform);function Vk(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))Pk?o=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),o&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function Uk(e){let t=Object.create(null);for(let n in e)t[Vk(n)]=e[n];return t}function ys(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Hk(e){let t=Uk(e);return function(n,i){let r=Bk(i),a,o=t[ys(r,i)];if(o&&o(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let l=t[ys(r,i,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(Fk&&i.ctrlKey&&i.altKey)&&(a=Gn[i.keyCode])&&a!=r){let l=t[ys(a,i)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ac=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function jp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const $p=(e,t,n)=>{let i=jp(e,n);if(!i)return!1;let r=oc(i);if(!r){let o=i.blockRange(),l=o&&qi(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let a=r.nodeBefore;if(em(e,r,t,-1))return!0;if(i.parent.content.size==0&&(Bi(a,"end")||be.isSelectable(a)))for(let o=i.depth;;o--){let l=Po(e.doc,i.before(o),i.after(o),ae.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(Bi(a,"end")?ke.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):be.create(c.doc,r.pos-a.nodeSize)),t(c.scrollIntoView())}return!0}if(o==1||i.node(o-1).childCount>1)break}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},qk=(e,t,n)=>{let i=jp(e,n);if(!i)return!1;let r=oc(i);return r?Wp(e,r,t):!1},jk=(e,t,n)=>{let i=Kp(e,n);if(!i)return!1;let r=sc(i);return r?Wp(e,r,t):!1};function Wp(e,t,n){let i=t.nodeBefore,r=i,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let u=Po(e.doc,a,c,ae.empty);if(!u||u.from!=a||u instanceof Ze&&u.slice.size>=c-a)return!1;if(n){let f=e.tr.step(u);f.setSelection(ge.create(f.doc,a)),n(f.scrollIntoView())}return!0}function Bi(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const Gp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;a=oc(i)}let o=a&&a.nodeBefore;return!o||!be.isSelectable(o)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function oc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Kp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Xp=(e,t,n)=>{let i=Kp(e,n);if(!i)return!1;let r=sc(i);if(!r)return!1;let a=r.nodeAfter;if(em(e,r,t,1))return!0;if(i.parent.content.size==0&&(Bi(a,"start")||be.isSelectable(a))){let o=Po(e.doc,i.before(),i.after(),ae.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(Bi(a,"start")?ke.findFrom(l.doc.resolve(l.mapping.map(r.pos)),1):be.create(l.doc,l.mapping.map(r.pos))),t(l.scrollIntoView())}return!0}}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},Jp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;a=sc(i)}let o=a&&a.nodeAfter;return!o||!be.isSelectable(o)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,a.pos)).scrollIntoView()),!0)};function sc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const $k=(e,t)=>{let n=e.selection,i=n instanceof be,r;if(i){if(n.node.isTextblock||!Xn(e.doc,n.from))return!1;r=n.from}else if(r=Bo(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);i&&a.setSelection(be.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},Wk=(e,t)=>{let n=e.selection,i;if(n instanceof be){if(n.node.isTextblock||!Xn(e.doc,n.to))return!1;i=n.to}else if(i=Bo(e.doc,n.to,1),i==null)return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},Gk=(e,t)=>{let{$from:n,$to:i}=e.selection,r=n.blockRange(i),a=r&&qi(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},Zp=(e,t)=>{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(`
605
- `).scrollIntoView()),!0)};function lc(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Kk=(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),a=n.indexAfter(-1),o=lc(r.contentMatchAt(a));if(!o||!r.canReplaceWith(a,a,o))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(ke.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},Qp=(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof It||i.parent.inlineContent||r.parent.inlineContent)return!1;let a=lc(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let o=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,l=e.tr.insert(o,a.createAndFill());l.setSelection(ge.create(l.doc,o+1)),t(l.scrollIntoView())}return!0},Yp=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(Tn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let i=n.blockRange(),r=i&&qi(i);return r==null?!1:(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)};function Xk(e){return(t,n)=>{if(t.selection instanceof be&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!Tn(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let i=t.tr;!t.selection.empty&&(t.selection instanceof ge||t.selection instanceof It)&&i.deleteSelection();let{$from:r}=i.selection,a=i.steps.length,o=[],l,c,u=!1,f=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){u=r.end(h)==r.pos+(r.depth-h),f=r.start(h)==r.pos-(r.depth-h),c=lc(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),o.unshift(u&&c?{type:c}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let m=r.pos,p=Tn(i.doc,m,o.length,o);if(p||(o[0]=c?{type:c}:null,p=Tn(i.doc,m,o.length,o)),!p)return!1;if(i.split(m,o.length,o),!u&&f&&r.node(l).type!=c){let h=i.mapping.slice(a),g=h.map(r.before(l)),b=i.doc.resolve(g);c&&r.node(l-1).canReplaceWith(b.index(),b.index()+1,c)&&i.setNodeMarkup(h.map(r.before(l)),c)}return n&&n(i.scrollIntoView()),!0}}const Jk=Xk(),Zk=(e,t)=>{let{$from:n,to:i}=e.selection,r,a=n.sharedDepth(i);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(be.create(e.doc,r))),!0)};function Qk(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,a=t.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Xn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function em(e,t,n,i){let r=t.nodeBefore,a=t.nodeAfter,o,l,c=r.type.spec.isolating||a.type.spec.isolating;if(!c&&Qk(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&l.matchType(o[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,g=J.empty;for(let v=o.length-1;v>=0;v--)g=J.from(o[v].create(null,g));g=J.from(r.copy(g));let b=e.tr.step(new Ye(t.pos-1,h,t.pos,h,new ae(g,1,0),o.length,!0)),y=b.doc.resolve(h+2*o.length);y.nodeAfter&&y.nodeAfter.type==r.type&&Xn(b.doc,y.pos)&&b.join(y.pos),n(b.scrollIntoView())}return!0}let f=a.type.spec.isolating||i>0&&c?null:ke.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),p=m&&qi(m);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(m,p).scrollIntoView()),!0;if(u&&Bi(a,"start",!0)&&Bi(r,"end")){let h=r,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=a,y=1;for(;!b.isTextblock;b=b.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let v=J.empty;for(let k=g.length-1;k>=0;k--)v=J.from(g[k].copy(v));let x=e.tr.step(new Ye(t.pos-g.length,t.pos+a.nodeSize,t.pos+y,t.pos+a.nodeSize-y,new ae(v,g.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function tm(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(ge.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const Yk=tm(-1),e2=tm(1);function t2(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a),l=o&&Xl(o,e,t);return l?(i&&i(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ku(e,t=null){return function(n,i){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[a];n.doc.nodesBetween(o,l,(c,u)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)r=!0;else{let f=n.doc.resolve(u),m=f.index();r=f.parent.canReplaceWith(m,m+1,e)}})}if(!r)return!1;if(i){let a=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];a.setBlockType(l,c,e,t)}i(a.scrollIntoView())}return!0}}function cc(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}cc(ac,$p,Gp);cc(ac,Xp,Jp);cc(Zp,Qp,Yp,Jk);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function n2(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a);if(!o)return!1;let l=i?n.tr:null;return i2(l,o,e,t)?(i&&i(l.scrollIntoView()),!0):!1}}function i2(e,t,n,i=null){let r=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);a=new $a(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new $a(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let l=Xl(a,n,i,t);return l?(e&&r2(e,t,l,r,n),!0):!1}function r2(e,t,n,i,r){let a=J.empty;for(let f=n.length-1;f>=0;f--)a=J.from(n[f].type.create(n[f].attrs,a));e.step(new Ye(t.start-(i?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let o=0;for(let f=0;f<n.length;f++)n[f].type==r&&(o=f+1);let l=n.length-o,c=t.start+n.length-(i?2:0),u=t.parent;for(let f=t.startIndex,m=t.endIndex,p=!0;f<m;f++,p=!1)!p&&Tn(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=u.child(f).nodeSize;return e}function a2(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==e);return a?n?i.node(a.depth-1).type==e?o2(t,n,e,a):s2(t,n,a):!0:!1}}function o2(e,t,n,i){let r=e.tr,a=i.end,o=i.$to.end(i.depth);a<o&&(r.step(new Ye(a-1,o,a,o,new ae(J.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new $a(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=qi(i);if(l==null)return!1;r.lift(i,l);let c=r.doc.resolve(r.mapping.map(a,-1)-1);return Xn(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),t(r.scrollIntoView()),!0}function s2(e,t,n){let i=e.tr,r=n.parent;for(let h=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)h-=r.child(g).nodeSize,i.delete(h-1,h+1);let a=i.doc.resolve(n.start),o=a.nodeAfter;if(i.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==r.childCount,u=a.node(-1),f=a.index(-1);if(!u.canReplace(f+(l?0:1),f+1,o.content.append(c?J.empty:J.from(r))))return!1;let m=a.pos,p=m+o.nodeSize;return i.step(new Ye(m-(l?1:0),p+(c?1:0),m+1,p-1,new ae((l?J.empty:J.from(r.copy(J.empty))).append(c?J.empty:J.from(r.copy(J.empty))),l?0:1,c?0:1),l?0:1)),t(i.scrollIntoView()),!0}function l2(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let l=a.parent,c=l.child(o-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==l.type,f=J.from(u?e.create():null),m=new ae(J.from(e.create(null,J.from(l.type.create(null,f)))),u?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Ye(p-(u?3:1),h,p,h,m,1,!0)).scrollIntoView())}return!0}}function nm(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,a=n.storedMarks,n}}}class c2{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:i}=this,{view:r}=n,{tr:a}=i,o=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...f)=>{const m=c(...f)(o);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l=[],c=!!t,u=t||a.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(p=>p===!0)),m={...Object.fromEntries(Object.entries(i).map(([p,h])=>[p,(...b)=>{const y=this.buildProps(u,n),v=h(...b)(y);return l.push(v),m}])),run:f};return m}createCan(t){const{rawCommands:n,state:i}=this,r=!1,a=t||i.tr,o=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...o,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l={tr:t,editor:r,view:o,state:nm({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(i).map(([c,u])=>[c,(...f)=>u(...f)(l)]))}};return l}}function pt(e,t,n){return e.config[t]===void 0&&e.parent?pt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?pt(e.parent,t,n):null}):e.config[t]}function u2(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),i=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:i}}function lt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Fe(...e){return e.filter(t=>!!t).reduce((t,n)=>{const i={...t};return Object.entries(n).forEach(([r,a])=>{if(!i[r]){i[r]=a;return}if(r==="class"){const l=a?String(a).split(" "):[],c=i[r]?i[r].split(" "):[],u=l.filter(f=>!c.includes(f));i[r]=[...c,...u].join(" ")}else if(r==="style"){const l=a?a.split(";").map(f=>f.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;c.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),l.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),i[r]=Array.from(u.entries()).map(([f,m])=>`${f}: ${m}`).join("; ")}else i[r]=a}),i},{})}function d2(e){return typeof e=="function"}function it(e,t=void 0,...n){return d2(e)?t?e.bind(t)(...n):e(...n):e}function im(e,t){const n=Hi.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function f2(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class uc{constructor(t){this.find=t.find,this.handler=t.handler}}function p2(e){return Object.prototype.toString.call(e).slice(8,-1)}function ga(e){return p2(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Uo(e,t){const n={...e};return ga(e)&&ga(t)&&Object.keys(t).forEach(i=>{ga(t[i])&&ga(e[i])?n[i]=Uo(e[i],t[i]):n[i]=t[i]}),n}class Et{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Et(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Et(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:i}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),t.view.dispatch(i),!0}return!1}}class m2{constructor(t){this.find=t.find,this.handler=t.handler}}class Ke{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ke(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Ke({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}}function h2(e,t,n){const{from:i,to:r}=t,{blockSeparator:a=`
604
+ `))),0,0),e.someProp("transformPasted",p=>{l=p(l,e,!0)}),l;let m=e.someProp("clipboardTextParser",p=>p(t,r,i,e));if(m)l=m;else{let p=r.marks(),{schema:h}=e.state,g=Hi.fromSchema(h);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(b=>{let y=o.appendChild(document.createElement("p"));b&&y.appendChild(g.serializeNode(h.text(b,p)))})}}else e.someProp("transformPastedHTML",m=>{n=m(n,e)}),o=pk(n),Yl&&mk(o);let u=o&&o.querySelector("[data-pm-slice]"),f=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let m=+f[3];m>0;m--){let p=o.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;o=p}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||ur.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||f),context:r,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!uk.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)l=hk(Wu(l,+f[1],+f[2]),f[4]);else if(l=ae.maxOpen(dk(l.content,r),!0),l.openStart||l.openEnd){let m=0,p=0;for(let h=l.content.firstChild;m<l.openStart&&!h.type.spec.isolating;m++,h=h.firstChild);for(let h=l.content.lastChild;p<l.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);l=Wu(l,m,p)}return e.someProp("transformPasted",m=>{l=m(l,e,c)}),l}const uk=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function dk(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),a,o=[];if(e.forEach(l=>{if(!o)return;let c=r.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&a.length&&Op(c,a,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Mp(o[o.length-1],a.length));let f=Np(l,c);o.push(f),r=r.matchType(f.type),a=c}}),o)return J.from(o)}return e}function Np(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,J.from(e));return e}function Op(e,t,n,i,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let a=Op(e,t,n,i.lastChild,r+1);if(a)return i.copy(i.content.replaceChild(i.childCount-1,a));if(i.contentMatchAt(i.childCount).matchType(r==e.length-1?n.type:e[r+1]))return i.copy(i.content.append(J.from(Np(n,e,r+1))))}}function Mp(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Mp(e.lastChild,t-1)),i=e.contentMatchAt(e.childCount).fillBefore(J.empty,!0);return e.copy(n.append(i))}function dl(e,t,n,i,r,a){let o=t<0?e.firstChild:e.lastChild,l=o.content;return e.childCount>1&&(a=0),r<i-1&&(l=dl(l,t,n,i,r+1,a)),r>=n&&(l=t<0?o.contentMatchAt(0).fillBefore(l,a<=r).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(J.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function Wu(e,t,n){return t<e.openStart&&(e=new ae(dl(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new ae(dl(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Dp={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function zp(){return document.implementation.createHTMLDocument("title")}let vs=null;function fk(e){let t=window.trustedTypes;return t?(vs||(vs=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),vs.createHTML(e)):e}function pk(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=zp(),i=n.body,r=/<([a-z][^>\s]+)/i.exec(e),a;if((a=r&&Dp[r[1].toLowerCase()])&&(e=a.map(o=>"<"+o+">").join("")+e+a.map(o=>"</"+o+">").reverse().join("")),i.innerHTML=fk(e),a)for(let o=0;o<a.length;o++)i=i.querySelector(a[o])||i;for(let o=0;o<n.styleSheets.length;o++){let l=n.styleSheets[o];for(let c=0;c<l.rules.length;c++){let u=l.rules[c];if(u instanceof CSSStyleRule){let f=i.querySelectorAll(u.selectorText);for(let m=0;m<f.length;m++)f[m].style.cssText+=u.style.cssText}}}return i}function mk(e){let t=e.querySelectorAll(Zn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let i=t[n];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}function hk(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,i;try{i=JSON.parse(t)}catch{return e}let{content:r,openStart:a,openEnd:o}=e;for(let l=i.length-2;l>=0;l-=2){let c=n.nodes[i[l]];if(!c||c.hasRequiredAttrs())break;r=J.from(c.create(i[l+1],r)),a++,o++}return new ae(r,a,o)}const Gt={},Rt={};function An(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}Rt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Bp(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Br&&Zn&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ql&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let i=Date.now();e.input.lastIOSEnter=i,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==i&&(e.someProp("handleKeyDown",r=>r(e,xp(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",i=>i(e,n))||ck(e,n)?n.preventDefault():An(e,"key")};Rt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Rt.keypress=(e,t)=>{let n=t;if(Bp(e)||!n.charCode||n.ctrlKey&&!n.altKey||Vt&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let i=e.state.selection;if(!(i instanceof ge)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(n.charCode),a=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",o=>o(e,i.$from.pos,i.$to.pos,r,a))&&e.dispatch(a()),n.preventDefault()}};function Pr(e){return{left:e.clientX,top:e.clientY}}function bk(e,t){let n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}function tc(e,t,n,i,r){if(i==-1)return!1;let a=e.state.doc.resolve(i);for(let o=a.depth+1;o>0;o--)if(e.someProp(t,l=>o>a.depth?l(e,n,a.nodeAfter,a.before(o),r,!0):l(e,n,a.node(o),a.before(o),r,!1)))return!0;return!1}function Fr(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let i=e.state.tr.setSelection(t);i.setMeta("pointer",!0),e.dispatch(i)}function gk(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),i=n.nodeAfter;return i&&i.isAtom&&be.isSelectable(i)?(Fr(e,new be(n)),!0):!1}function vk(e,t){if(t==-1)return!1;let n=e.state.selection,i,r;n instanceof be&&(i=n.node);let a=e.state.doc.resolve(t);for(let o=a.depth+1;o>0;o--){let l=o>a.depth?a.nodeAfter:a.node(o);if(be.isSelectable(l)){i&&n.$from.depth>0&&o>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?r=a.before(n.$from.depth):r=a.before(o);break}}return r!=null?(Fr(e,be.create(e.state.doc,r)),!0):!1}function xk(e,t,n,i,r){return tc(e,"handleClickOn",t,n,i)||e.someProp("handleClick",a=>a(e,t,i))||(r?vk(e,n):gk(e,n))}function yk(e,t,n,i){return tc(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",r=>r(e,t,i))}function kk(e,t,n,i){return tc(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",r=>r(e,t,i))||wk(e,n,i)}function wk(e,t,n){if(n.button!=0)return!1;let i=Ip(e,t,!0),r=e.state.doc;return i?(Fr(e,i),i instanceof ge&&r.eq(e.state.doc)&&(e.input.mouseDown=new Sk(e,i)),!0):!1}function Ip(e,t,n){let i=e.state.doc;if(t==-1)return i.inlineContent?ge.create(i,0,i.content.size):null;let r=i.resolve(t);for(let a=r.depth+1;a>0;a--){let o=a>r.depth?r.nodeAfter:r.node(a),l=r.before(a);if(o.inlineContent)return ge.create(i,l+1,l+1+o.content.size);if(n&&be.isSelectable(o))return be.create(i,l)}return null}function nc(e){return Ja(e)}const Rp=Vt?"metaKey":"ctrlKey";Gt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let i=nc(e),r=Date.now(),a="singleClick";r-e.input.lastClick.time<500&&bk(n,e.input.lastClick)&&!n[Rp]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?a="doubleClick":e.input.lastClick.type=="doubleClick"&&(a="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Pr(n));o&&(a=="singleClick"?e.input.mouseDown=new _k(e,o,n,!!i):(a=="doubleClick"?yk:kk)(e,o.pos,o.inside,n)?n.preventDefault():An(e,"pointer"))};class Lp{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class _k extends Lp{constructor(t,n,i,r){super(t),this.pos=n,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!i[Rp],this.allowDefault=i.shiftKey;let a,o;if(n.inside>-1)a=t.state.doc.nodeAt(n.inside),o=n.inside;else{let f=t.state.doc.resolve(n.pos);a=f.parent,o=f.depth?f.before():0}const l=r?null:i.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;i.button==0&&(a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof be&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Vo&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),An(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ec(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pr(t))),this.updateAllowDefault(t),this.allowDefault||!n?An(this.view,"pointer"):xk(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||ki&&this.mightDrag&&!this.mightDrag.node.isAtom||Zn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Fr(this.view,ke.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):An(this.view,"pointer")}move(t){this.updateAllowDefault(t),An(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class Sk extends Lp{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),An(this.view,"pointer");let n=this.view.posAtCoords(Pr(t)),i=n&&Ip(this.view,n.inside,!1);if(!i)return;let{doc:r}=this.view.state,a=this.startSelection,[o,l]=i.from<a.from?[a.to,i.from]:[a.from,i.to];Fr(this.view,ge.create(r,o,l))}}Gt.touchstart=e=>{e.input.lastTouch=Date.now(),nc(e),An(e,"pointer")};Gt.touchmove=e=>{e.input.lastTouch=Date.now(),An(e,"pointer")};Gt.contextmenu=e=>nc(e);function Bp(e,t){return e.composing?!0:ki&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Ck=Br?5e3:-1;Rt.compositionstart=Rt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ge&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||Zn&&_p&&Ek(e)))e.markCursor=e.state.storedMarks||n.marks(),Ja(e,!0),e.markCursor=null;else if(Ja(e,!t.selection.empty),Vo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let i=e.domSelectionRange();for(let r=i.focusNode,a=i.focusOffset;r&&r.nodeType==1&&a!=0;){let o=a<0?r.lastChild:r.childNodes[a-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else r=o,a=-1}}e.input.composing=!0}Pp(e,Ck)};function Ek(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let i=t.childNodes[n];return i.nodeType==1&&i.contentEditable=="false"}Rt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Pp(e,20))};function Pp(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Ja(e),t))}function Ak(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Ja(e,t=!1){if(!(Br&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ak(e),t||e.docView&&e.docView.dirty){let n=Qy(e),i=e.state.selection;return n&&!n.eq(i)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Tk(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Er=Lr&&kp<15||Ql&&Zy<604;Gt.copy=Rt.cut=(e,t)=>{let n=t,i=e.state.selection,r=n.type=="cut";if(i.empty)return;let a=Er?null:n.clipboardData,o=i.content(),{dom:l,text:c}=Ap(e,o);a?(n.preventDefault(),a.clearData(),a.setData("text/html",l.innerHTML),a.setData("text/plain",c)):Tk(e,l),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Nk(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ok(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?fl(e,i.value,null,r,t):fl(e,i.textContent,i.innerHTML,r,t)},50)}function fl(e,t,n,i,r){let a=Tp(e,t,n,i,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,r,a||ae.empty)))return!0;if(!a)return!1;let o=Nk(a),l=o?e.state.tr.replaceSelectionWith(o,i):e.state.tr.replaceSelection(a);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Fp(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Rt.paste=(e,t)=>{let n=t;if(e.composing&&!Br)return;let i=Er?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;i&&fl(e,Fp(i),i.getData("text/html"),r,n)?n.preventDefault():Ok(e,n)};class Mk{constructor(t,n,i){this.slice=t,this.move=n,this.node=i}}const Dk=Vt?"altKey":"ctrlKey";function Vp(e,t){let n;return e.someProp("dragCopies",i=>{n=n||i(t)}),n!=null?!n:!t[Dk]}Gt.dragstart=(e,t)=>{let n=t,i=e.input.mouseDown;if(i&&i.done(),!n.dataTransfer)return;let r=e.state.selection,a=r.empty?null:e.posAtCoords(Pr(n)),o;if(!(a&&a.pos>=r.from&&a.pos<=(r instanceof be?r.to-1:r.to))){if(i&&i.mightDrag)o=be.create(e.state.doc,i.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let m=e.docView.nearestDesc(n.target,!0);m&&m.node.type.spec.draggable&&m!=e.docView&&(o=be.create(e.state.doc,m.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:u,slice:f}=Ap(e,l);(!n.dataTransfer.files.length||!Zn||wp>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Er?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",Er||n.dataTransfer.setData("text/plain",u),e.dragging=new Mk(f,Vp(e,n),o)};Gt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Rt.dragover=Rt.dragenter=(e,t)=>t.preventDefault();Rt.drop=(e,t)=>{try{zk(e,t,e.dragging)}finally{e.dragging=null}};function zk(e,t,n){if(!t.dataTransfer)return;let i=e.posAtCoords(Pr(t));if(!i)return;let r=e.state.doc.resolve(i.pos),a=n&&n.slice;a?e.someProp("transformPasted",h=>{a=h(a,e,!1)}):a=Tp(e,Fp(t.dataTransfer),Er?null:t.dataTransfer.getData("text/html"),!1,r);let o=!!(n&&Vp(e,t));if(e.someProp("handleDrop",h=>h(e,t,a||ae.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let l=a?Uy(e.state.doc,r.pos,a):r.pos;l==null&&(l=r.pos);let c=e.state.tr;if(o){let{node:h}=n;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,m=c.doc;if(f?c.replaceRangeWith(u,u,a.content.firstChild):c.replaceRange(u,u,a),c.doc.eq(m))return;let p=c.doc.resolve(u);if(f&&be.isSelectable(a.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new be(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,y,v)=>h=v),c.setSelection(Cp(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}Gt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ec(e)},20))};Gt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Gt.beforeinput=(e,t)=>{if(Br&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:i}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=i||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",a=>a(e,xp(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Rt)Gt[e]=Rt[e];function Ar(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Za{constructor(t,n){this.toDOM=t,this.spec=n||mi,this.side=this.spec.side||0}map(t,n,i,r){let{pos:a,deleted:o}=t.mapResult(n.from+r,this.side<0?-1:1);return o?null:new ft(a-i,a-i,this)}valid(){return!0}eq(t){return this==t||t instanceof Za&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ar(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Wn{constructor(t,n){this.attrs=t,this.spec=n||mi}map(t,n,i,r){let a=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-i,o=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-i;return a>=o?null:new ft(a,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Wn&&Ar(this.attrs,t.attrs)&&Ar(this.spec,t.spec)}static is(t){return t.type instanceof Wn}destroy(){}}class ic{constructor(t,n){this.attrs=t,this.spec=n||mi}map(t,n,i,r){let a=t.mapResult(n.from+r,1);if(a.deleted)return null;let o=t.mapResult(n.to+r,-1);return o.deleted||o.pos<=a.pos?null:new ft(a.pos-i,o.pos-i,this)}valid(t,n){let{index:i,offset:r}=t.content.findIndex(n.from),a;return r==n.from&&!(a=t.child(i)).isText&&r+a.nodeSize==n.to}eq(t){return this==t||t instanceof ic&&Ar(this.attrs,t.attrs)&&Ar(this.spec,t.spec)}destroy(){}}class ft{constructor(t,n,i){this.from=t,this.to=n,this.type=i}copy(t,n){return new ft(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,i){return this.type.map(t,this,n,i)}static widget(t,n,i){return new ft(t,t,new Za(n,i))}static inline(t,n,i,r){return new ft(t,n,new Wn(i,r))}static node(t,n,i,r){return new ft(t,n,new ic(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof Wn}get widget(){return this.type instanceof Za}}const Di=[],mi={};class je{constructor(t,n){this.local=t.length?t:Di,this.children=n.length?n:Di}static create(t,n){return n.length?Qa(n,t,0,mi):kt}find(t,n,i){let r=[];return this.findInner(t??0,n??1e9,r,0,i),r}findInner(t,n,i,r,a){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=t&&(!a||a(l.spec))&&i.push(l.copy(l.from+r,l.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let l=this.children[o]+1;this.children[o+2].findInner(t-l,n-l,i,r+l,a)}}map(t,n,i){return this==kt||t.maps.length==0?this:this.mapInner(t,n,0,0,i||mi)}mapInner(t,n,i,r,a){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,i,r);c&&c.type.valid(n,c)?(o||(o=[])).push(c):a.onRemove&&a.onRemove(this.local[l].spec)}return this.children.length?Ik(this.children,o||[],t,n,i,r,a):o?new je(o.sort(hi),Di):kt}add(t,n){return n.length?this==kt?je.create(t,n):this.addInner(t,n,0):this}addInner(t,n,i){let r,a=0;t.forEach((l,c)=>{let u=c+i,f;if(f=Hp(n,l,u)){for(r||(r=this.children.slice());a<r.length&&r[a]<c;)a+=3;r[a]==c?r[a+2]=r[a+2].addInner(l,f,u+1):r.splice(a,0,c,c+l.nodeSize,Qa(f,l,u+1,mi)),a+=3}});let o=Up(a?qp(n):n,-i);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||o.splice(l--,1);return new je(o.length?this.local.concat(o).sort(hi):this.local,r||this.children)}remove(t){return t.length==0||this==kt?this:this.removeInner(t,0)}removeInner(t,n){let i=this.children,r=this.local;for(let a=0;a<i.length;a+=3){let o,l=i[a]+n,c=i[a+1]+n;for(let f=0,m;f<t.length;f++)(m=t[f])&&m.from>l&&m.to<c&&(t[f]=null,(o||(o=[])).push(m));if(!o)continue;i==this.children&&(i=this.children.slice());let u=i[a+2].removeInner(o,l+1);u!=kt?i[a+2]=u:(i.splice(a,3),a-=3)}if(r.length){for(let a=0,o;a<t.length;a++)if(o=t[a])for(let l=0;l<r.length;l++)r[l].eq(o,n)&&(r==this.local&&(r=this.local.slice()),r.splice(l--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new je(r,i):kt}forChild(t,n){if(this==kt)return this;if(n.isLeaf)return je.empty;let i,r;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(i=this.children[l+2]);break}let a=t+1,o=a+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>a&&c.type instanceof Wn){let u=Math.max(a,c.from)-a,f=Math.min(o,c.to)-a;u<f&&(r||(r=[])).push(c.copy(u,f))}}if(r){let l=new je(r.sort(hi),Di);return i?new oi([l,i]):l}return i||kt}eq(t){if(this==t)return!0;if(!(t instanceof je)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return rc(this.localsInner(t))}localsInner(t){if(this==kt)return Di;if(t.inlineContent||!this.local.some(Wn.is))return this.local;let n=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof Wn||n.push(this.local[i]);return n}forEachSet(t){t(this)}}je.empty=new je([],[]);je.removeOverlap=rc;const kt=je.empty;class oi{constructor(t){this.members=t}map(t,n){const i=this.members.map(r=>r.map(t,n,mi));return oi.from(i)}forChild(t,n){if(n.isLeaf)return je.empty;let i=[];for(let r=0;r<this.members.length;r++){let a=this.members[r].forChild(t,n);a!=kt&&(a instanceof oi?i=i.concat(a.members):i.push(a))}return oi.from(i)}eq(t){if(!(t instanceof oi)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,i=!0;for(let r=0;r<this.members.length;r++){let a=this.members[r].localsInner(t);if(a.length)if(!n)n=a;else{i&&(n=n.slice(),i=!1);for(let o=0;o<a.length;o++)n.push(a[o])}}return n?rc(i?n:n.sort(hi)):Di}static from(t){switch(t.length){case 0:return kt;case 1:return t[0];default:return new oi(t.every(n=>n instanceof je)?t:t.reduce((n,i)=>n.concat(i instanceof je?i:i.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Ik(e,t,n,i,r,a,o){let l=e.slice();for(let u=0,f=a;u<n.maps.length;u++){let m=0;n.maps[u].forEach((p,h,g,b)=>{let y=b-g-(h-p);for(let v=0;v<l.length;v+=3){let x=l[v+1];if(x<0||p>x+f-m)continue;let k=l[v]+f-m;h>=k?l[v+1]=p<=k?-2:-1:p>=f&&y&&(l[v]+=y,l[v+1]+=y)}m+=y}),f=n.maps[u].map(f,-1)}let c=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){c=!0,l[u+1]=-1;continue}let f=n.map(e[u]+a),m=f-r;if(m<0||m>=i.content.size){c=!0;continue}let p=n.map(e[u+1]+a,-1),h=p-r,{index:g,offset:b}=i.content.findIndex(m),y=i.maybeChild(g);if(y&&b==m&&b+y.nodeSize==h){let v=l[u+2].mapInner(n,y,f+1,e[u]+a+1,o);v!=kt?(l[u]=m,l[u+1]=h,l[u+2]=v):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=Rk(l,e,t,n,r,a,o),f=Qa(u,i,0,o);t=f.local;for(let m=0;m<l.length;m+=3)l[m+1]<0&&(l.splice(m,3),m-=3);for(let m=0,p=0;m<f.children.length;m+=3){let h=f.children[m];for(;p<l.length&&l[p]<h;)p+=3;l.splice(p,0,f.children[m],f.children[m+1],f.children[m+2])}}return new je(t.sort(hi),l)}function Up(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;i<e.length;i++){let r=e[i];n.push(new ft(r.from+t,r.to+t,r.type))}return n}function Rk(e,t,n,i,r,a,o){function l(c,u){for(let f=0;f<c.local.length;f++){let m=c.local[f].map(i,r,u);m?n.push(m):o.onRemove&&o.onRemove(c.local[f].spec)}for(let f=0;f<c.children.length;f+=3)l(c.children[f+2],c.children[f]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+a+1);return n}function Hp(e,t,n){if(t.isLeaf)return null;let i=n+t.nodeSize,r=null;for(let a=0,o;a<e.length;a++)(o=e[a])&&o.from>n&&o.to<i&&((r||(r=[])).push(o),e[a]=null);return r}function qp(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Qa(e,t,n,i){let r=[],a=!1;t.forEach((l,c)=>{let u=Hp(e,l,c+n);if(u){a=!0;let f=Qa(u,l,n+c+1,i);f!=kt&&r.push(c,c+l.nodeSize,f)}});let o=Up(a?qp(e):e,-n).sort(hi);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(i.onRemove&&i.onRemove(o[l].spec),o.splice(l--,1));return o.length||r.length?new je(o,r):kt}function hi(e,t){return e.from-t.from||e.to-t.to}function rc(e){let t=e;for(let n=0;n<t.length-1;n++){let i=t[n];if(i.from!=i.to)for(let r=n+1;r<t.length;r++){let a=t[r];if(a.from==i.from){a.to!=i.to&&(t==e&&(t=e.slice()),t[r]=a.copy(a.from,i.to),Gu(t,r+1,a.copy(i.to,a.to)));continue}else{a.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,a.from),Gu(t,r,i.copy(a.from,i.to)));break}}}return t}function Gu(e,t,n){for(;t<e.length&&hi(n,e[t])>0;)t++;e.splice(t,0,n)}var Gn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ya={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lk=typeof navigator<"u"&&/Mac/.test(navigator.platform),Bk=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var st=0;st<10;st++)Gn[48+st]=Gn[96+st]=String(st);for(var st=1;st<=24;st++)Gn[st+111]="F"+st;for(var st=65;st<=90;st++)Gn[st]=String.fromCharCode(st+32),Ya[st]=String.fromCharCode(st);for(var xs in Gn)Ya.hasOwnProperty(xs)||(Ya[xs]=Gn[xs]);function Pk(e){var t=Lk&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Bk&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ya:Gn)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Fk=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Vk=typeof navigator<"u"&&/Win/.test(navigator.platform);function Uk(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))Fk?o=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(n="Alt-"+n),r&&(n="Ctrl-"+n),o&&(n="Meta-"+n),a&&(n="Shift-"+n),n}function Hk(e){let t=Object.create(null);for(let n in e)t[Uk(n)]=e[n];return t}function ys(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function qk(e){let t=Hk(e);return function(n,i){let r=Pk(i),a,o=t[ys(r,i)];if(o&&o(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let l=t[ys(r,i,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(Vk&&i.ctrlKey&&i.altKey)&&(a=Gn[i.keyCode])&&a!=r){let l=t[ys(a,i)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const ac=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function jp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const $p=(e,t,n)=>{let i=jp(e,n);if(!i)return!1;let r=oc(i);if(!r){let o=i.blockRange(),l=o&&qi(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let a=r.nodeBefore;if(em(e,r,t,-1))return!0;if(i.parent.content.size==0&&(Bi(a,"end")||be.isSelectable(a)))for(let o=i.depth;;o--){let l=Po(e.doc,i.before(o),i.after(o),ae.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(Bi(a,"end")?ke.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):be.create(c.doc,r.pos-a.nodeSize)),t(c.scrollIntoView())}return!0}if(o==1||i.node(o-1).childCount>1)break}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos-a.nodeSize,r.pos).scrollIntoView()),!0):!1},jk=(e,t,n)=>{let i=jp(e,n);if(!i)return!1;let r=oc(i);return r?Wp(e,r,t):!1},$k=(e,t,n)=>{let i=Kp(e,n);if(!i)return!1;let r=sc(i);return r?Wp(e,r,t):!1};function Wp(e,t,n){let i=t.nodeBefore,r=i,a=t.pos-1;for(;!r.isTextblock;a--){if(r.type.spec.isolating)return!1;let f=r.lastChild;if(!f)return!1;r=f}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let u=Po(e.doc,a,c,ae.empty);if(!u||u.from!=a||u instanceof Ze&&u.slice.size>=c-a)return!1;if(n){let f=e.tr.step(u);f.setSelection(ge.create(f.doc,a)),n(f.scrollIntoView())}return!0}function Bi(e,t,n=!1){for(let i=e;i;i=t=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(n&&i.childCount!=1)return!1}return!1}const Gp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):i.parentOffset>0)return!1;a=oc(i)}let o=a&&a.nodeBefore;return!o||!be.isSelectable(o)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function oc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Kp(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const Xp=(e,t,n)=>{let i=Kp(e,n);if(!i)return!1;let r=sc(i);if(!r)return!1;let a=r.nodeAfter;if(em(e,r,t,1))return!0;if(i.parent.content.size==0&&(Bi(a,"start")||be.isSelectable(a))){let o=Po(e.doc,i.before(),i.after(),ae.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(Bi(a,"start")?ke.findFrom(l.doc.resolve(l.mapping.map(r.pos)),1):be.create(l.doc,l.mapping.map(r.pos))),t(l.scrollIntoView())}return!0}}return a.isAtom&&r.depth==i.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+a.nodeSize).scrollIntoView()),!0):!1},Jp=(e,t,n)=>{let{$head:i,empty:r}=e.selection,a=i;if(!r)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size)return!1;a=sc(i)}let o=a&&a.nodeAfter;return!o||!be.isSelectable(o)?!1:(t&&t(e.tr.setSelection(be.create(e.doc,a.pos)).scrollIntoView()),!0)};function sc(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const Wk=(e,t)=>{let n=e.selection,i=n instanceof be,r;if(i){if(n.node.isTextblock||!Xn(e.doc,n.from))return!1;r=n.from}else if(r=Bo(e.doc,n.from,-1),r==null)return!1;if(t){let a=e.tr.join(r);i&&a.setSelection(be.create(a.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(a.scrollIntoView())}return!0},Gk=(e,t)=>{let n=e.selection,i;if(n instanceof be){if(n.node.isTextblock||!Xn(e.doc,n.to))return!1;i=n.to}else if(i=Bo(e.doc,n.to,1),i==null)return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},Kk=(e,t)=>{let{$from:n,$to:i}=e.selection,r=n.blockRange(i),a=r&&qi(r);return a==null?!1:(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)},Zp=(e,t)=>{let{$head:n,$anchor:i}=e.selection;return!n.parent.type.spec.code||!n.sameParent(i)?!1:(t&&t(e.tr.insertText(`
605
+ `).scrollIntoView()),!0)};function lc(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Xk=(e,t)=>{let{$head:n,$anchor:i}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let r=n.node(-1),a=n.indexAfter(-1),o=lc(r.contentMatchAt(a));if(!o||!r.canReplaceWith(a,a,o))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(ke.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},Qp=(e,t)=>{let n=e.selection,{$from:i,$to:r}=n;if(n instanceof It||i.parent.inlineContent||r.parent.inlineContent)return!1;let a=lc(r.parent.contentMatchAt(r.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let o=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,l=e.tr.insert(o,a.createAndFill());l.setSelection(ge.create(l.doc,o+1)),t(l.scrollIntoView())}return!0},Yp=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let a=n.before();if(Tn(e.doc,a))return t&&t(e.tr.split(a).scrollIntoView()),!0}let i=n.blockRange(),r=i&&qi(i);return r==null?!1:(t&&t(e.tr.lift(i,r).scrollIntoView()),!0)};function Jk(e){return(t,n)=>{if(t.selection instanceof be&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!Tn(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let i=t.tr;!t.selection.empty&&(t.selection instanceof ge||t.selection instanceof It)&&i.deleteSelection();let{$from:r}=i.selection,a=i.steps.length,o=[],l,c,u=!1,f=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){u=r.end(h)==r.pos+(r.depth-h),f=r.start(h)==r.pos-(r.depth-h),c=lc(r.node(h-1).contentMatchAt(r.indexAfter(h-1))),o.unshift(u&&c?{type:c}:null),l=h;break}else{if(h==1)return!1;o.unshift(null)}let m=r.pos,p=Tn(i.doc,m,o.length,o);if(p||(o[0]=c?{type:c}:null,p=Tn(i.doc,m,o.length,o)),!p)return!1;if(i.split(m,o.length,o),!u&&f&&r.node(l).type!=c){let h=i.mapping.slice(a),g=h.map(r.before(l)),b=i.doc.resolve(g);c&&r.node(l-1).canReplaceWith(b.index(),b.index()+1,c)&&i.setNodeMarkup(h.map(r.before(l)),c)}return n&&n(i.scrollIntoView()),!0}}const Zk=Jk(),Qk=(e,t)=>{let{$from:n,to:i}=e.selection,r,a=n.sharedDepth(i);return a==0?!1:(r=n.before(a),t&&t(e.tr.setSelection(be.create(e.doc,r))),!0)};function Yk(e,t,n){let i=t.nodeBefore,r=t.nodeAfter,a=t.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(r.isTextblock||Xn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function em(e,t,n,i){let r=t.nodeBefore,a=t.nodeAfter,o,l,c=r.type.spec.isolating||a.type.spec.isolating;if(!c&&Yk(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(o=(l=r.contentMatchAt(r.childCount)).findWrapping(a.type))&&l.matchType(o[0]||a.type).validEnd){if(n){let h=t.pos+a.nodeSize,g=J.empty;for(let v=o.length-1;v>=0;v--)g=J.from(o[v].create(null,g));g=J.from(r.copy(g));let b=e.tr.step(new Ye(t.pos-1,h,t.pos,h,new ae(g,1,0),o.length,!0)),y=b.doc.resolve(h+2*o.length);y.nodeAfter&&y.nodeAfter.type==r.type&&Xn(b.doc,y.pos)&&b.join(y.pos),n(b.scrollIntoView())}return!0}let f=a.type.spec.isolating||i>0&&c?null:ke.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),p=m&&qi(m);if(p!=null&&p>=t.depth)return n&&n(e.tr.lift(m,p).scrollIntoView()),!0;if(u&&Bi(a,"start",!0)&&Bi(r,"end")){let h=r,g=[];for(;g.push(h),!h.isTextblock;)h=h.lastChild;let b=a,y=1;for(;!b.isTextblock;b=b.firstChild)y++;if(h.canReplace(h.childCount,h.childCount,b.content)){if(n){let v=J.empty;for(let k=g.length-1;k>=0;k--)v=J.from(g[k].copy(v));let x=e.tr.step(new Ye(t.pos-g.length,t.pos+a.nodeSize,t.pos+y,t.pos+a.nodeSize-y,new ae(v,g.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function tm(e){return function(t,n){let i=t.selection,r=e<0?i.$from:i.$to,a=r.depth;for(;r.node(a).isInline;){if(!a)return!1;a--}return r.node(a).isTextblock?(n&&n(t.tr.setSelection(ge.create(t.doc,e<0?r.start(a):r.end(a)))),!0):!1}}const e2=tm(-1),t2=tm(1);function n2(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a),l=o&&Xl(o,e,t);return l?(i&&i(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Ku(e,t=null){return function(n,i){let r=!1;for(let a=0;a<n.selection.ranges.length&&!r;a++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[a];n.doc.nodesBetween(o,l,(c,u)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)r=!0;else{let f=n.doc.resolve(u),m=f.index();r=f.parent.canReplaceWith(m,m+1,e)}})}if(!r)return!1;if(i){let a=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];a.setBlockType(l,c,e,t)}i(a.scrollIntoView())}return!0}}function cc(...e){return function(t,n,i){for(let r=0;r<e.length;r++)if(e[r](t,n,i))return!0;return!1}}cc(ac,$p,Gp);cc(ac,Xp,Jp);cc(Zp,Qp,Yp,Zk);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function i2(e,t=null){return function(n,i){let{$from:r,$to:a}=n.selection,o=r.blockRange(a);if(!o)return!1;let l=i?n.tr:null;return r2(l,o,e,t)?(i&&i(l.scrollIntoView()),!0):!1}}function r2(e,t,n,i=null){let r=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);a=new $a(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new $a(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let l=Xl(a,n,i,t);return l?(e&&a2(e,t,l,r,n),!0):!1}function a2(e,t,n,i,r){let a=J.empty;for(let f=n.length-1;f>=0;f--)a=J.from(n[f].type.create(n[f].attrs,a));e.step(new Ye(t.start-(i?2:0),t.end,t.start,t.end,new ae(a,0,0),n.length,!0));let o=0;for(let f=0;f<n.length;f++)n[f].type==r&&(o=f+1);let l=n.length-o,c=t.start+n.length-(i?2:0),u=t.parent;for(let f=t.startIndex,m=t.endIndex,p=!0;f<m;f++,p=!1)!p&&Tn(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=u.child(f).nodeSize;return e}function o2(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,o=>o.childCount>0&&o.firstChild.type==e);return a?n?i.node(a.depth-1).type==e?s2(t,n,e,a):l2(t,n,a):!0:!1}}function s2(e,t,n,i){let r=e.tr,a=i.end,o=i.$to.end(i.depth);a<o&&(r.step(new Ye(a-1,o,a,o,new ae(J.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new $a(r.doc.resolve(i.$from.pos),r.doc.resolve(o),i.depth));const l=qi(i);if(l==null)return!1;r.lift(i,l);let c=r.doc.resolve(r.mapping.map(a,-1)-1);return Xn(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),t(r.scrollIntoView()),!0}function l2(e,t,n){let i=e.tr,r=n.parent;for(let h=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)h-=r.child(g).nodeSize,i.delete(h-1,h+1);let a=i.doc.resolve(n.start),o=a.nodeAfter;if(i.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==r.childCount,u=a.node(-1),f=a.index(-1);if(!u.canReplace(f+(l?0:1),f+1,o.content.append(c?J.empty:J.from(r))))return!1;let m=a.pos,p=m+o.nodeSize;return i.step(new Ye(m-(l?1:0),p+(c?1:0),m+1,p-1,new ae((l?J.empty:J.from(r.copy(J.empty))).append(c?J.empty:J.from(r.copy(J.empty))),l?0:1,c?0:1),l?0:1)),t(i.scrollIntoView()),!0}function c2(e){return function(t,n){let{$from:i,$to:r}=t.selection,a=i.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let l=a.parent,c=l.child(o-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==l.type,f=J.from(u?e.create():null),m=new ae(J.from(e.create(null,J.from(l.type.create(null,f)))),u?3:1,0),p=a.start,h=a.end;n(t.tr.step(new Ye(p-(u?3:1),h,p,h,m,1,!0)).scrollIntoView())}return!0}}function nm(e){const{state:t,transaction:n}=e;let{selection:i}=n,{doc:r}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return i},get doc(){return r},get tr(){return i=n.selection,r=n.doc,a=n.storedMarks,n}}}class u2{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:i}=this,{view:r}=n,{tr:a}=i,o=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...f)=>{const m=c(...f)(o);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(a),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l=[],c=!!t,u=t||a.tr,f=()=>(!c&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(p=>p===!0)),m={...Object.fromEntries(Object.entries(i).map(([p,h])=>[p,(...b)=>{const y=this.buildProps(u,n),v=h(...b)(y);return l.push(v),m}])),run:f};return m}createCan(t){const{rawCommands:n,state:i}=this,r=!1,a=t||i.tr,o=this.buildProps(a,r);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...o,dispatch:void 0})])),chain:()=>this.createChain(a,r)}}buildProps(t,n=!0){const{rawCommands:i,editor:r,state:a}=this,{view:o}=r,l={tr:t,editor:r,view:o,state:nm({state:a,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(i).map(([c,u])=>[c,(...f)=>u(...f)(l)]))}};return l}}function pt(e,t,n){return e.config[t]===void 0&&e.parent?pt(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?pt(e.parent,t,n):null}):e.config[t]}function d2(e){const t=e.filter(r=>r.type==="extension"),n=e.filter(r=>r.type==="node"),i=e.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:i}}function lt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Fe(...e){return e.filter(t=>!!t).reduce((t,n)=>{const i={...t};return Object.entries(n).forEach(([r,a])=>{if(!i[r]){i[r]=a;return}if(r==="class"){const l=a?String(a).split(" "):[],c=i[r]?i[r].split(" "):[],u=l.filter(f=>!c.includes(f));i[r]=[...c,...u].join(" ")}else if(r==="style"){const l=a?a.split(";").map(f=>f.trim()).filter(Boolean):[],c=i[r]?i[r].split(";").map(f=>f.trim()).filter(Boolean):[],u=new Map;c.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),l.forEach(f=>{const[m,p]=f.split(":").map(h=>h.trim());u.set(m,p)}),i[r]=Array.from(u.entries()).map(([f,m])=>`${f}: ${m}`).join("; ")}else i[r]=a}),i},{})}function f2(e){return typeof e=="function"}function it(e,t=void 0,...n){return f2(e)?t?e.bind(t)(...n):e(...n):e}function im(e,t){const n=Hi.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function p2(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class uc{constructor(t){this.find=t.find,this.handler=t.handler}}function m2(e){return Object.prototype.toString.call(e).slice(8,-1)}function ga(e){return m2(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Uo(e,t){const n={...e};return ga(e)&&ga(t)&&Object.keys(t).forEach(i=>{ga(t[i])&&ga(e[i])?n[i]=Uo(e[i],t[i]):n[i]=t[i]}),n}class Et{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Et(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Et(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:i}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const o=r.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),t.view.dispatch(i),!0}return!1}}class h2{constructor(t){this.find=t.find,this.handler=t.handler}}class Ke{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ke(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Ke({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}}function b2(e,t,n){const{from:i,to:r}=t,{blockSeparator:a=`
606
606
 
607
- `,textSerializers:o={}}=n||{};let l="";return e.nodesBetween(i,r,(c,u,f,m)=>{var p;c.isBlock&&u>i&&(l+=a);const h=o==null?void 0:o[c.type.name];if(h)return f&&(l+=h({node:c,pos:u,parent:f,index:m,range:t})),!1;c.isText&&(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(i,u)-u,r-u))}),l}function b2(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const g2=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new rt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:r}=t,{ranges:a}=r,o=Math.min(...a.map(f=>f.$from.pos)),l=Math.max(...a.map(f=>f.$to.pos)),c=b2(n);return h2(i,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),v2=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),x2=(e=!1)=>({commands:t})=>t.setContent("",e),y2=()=>({state:e,tr:t,dispatch:n})=>{const{selection:i}=t,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:o})=>{e.doc.nodesBetween(a.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:f}=t,m=u.resolve(f.map(c)),p=u.resolve(f.map(c+l.nodeSize)),h=m.blockRange(p);if(!h)return;const g=qi(h);if(l.type.isTextblock){const{defaultType:b}=m.parent.contentMatchAt(m.index());t.setNodeMarkup(h.start,b)}(g||g===0)&&t.lift(h,g)})}),!0},k2=e=>t=>e(t),w2=()=>({state:e,dispatch:t})=>Qp(e,t),_2=(e,t)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);const o=i.mapping.map(t);return i.insert(o,a.content),i.setSelection(new ge(i.doc.resolve(Math.max(o-1,0)))),!0},S2=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,i=n.$anchor.node();if(i.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(t){const l=r.before(a),c=r.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},C2=e=>({tr:t,state:n,dispatch:i})=>{const r=lt(e,n.schema),a=t.selection.$anchor;for(let o=a.depth;o>0;o-=1)if(a.node(o).type===r){if(i){const c=a.before(o),u=a.after(o);t.delete(c,u).scrollIntoView()}return!0}return!1},E2=e=>({tr:t,dispatch:n})=>{const{from:i,to:r}=e;return n&&t.delete(i,r),!0},A2=()=>({state:e,dispatch:t})=>ac(e,t),T2=()=>({commands:e})=>e.keyboardShortcut("Enter"),N2=()=>({state:e,dispatch:t})=>Kk(e,t);function eo(e,t,n={strict:!0}){const i=Object.keys(t);return i.length?i.every(r=>n.strict?t[r]===e[r]:f2(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function rm(e,t,n={}){return e.find(i=>i.type===t&&eo(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function Xu(e,t,n={}){return!!rm(e,t,n)}function dc(e,t,n){var i;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===t)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!rm([...r.node.marks],t,n)))return;let o=r.index,l=e.start()+r.offset,c=o+1,u=l+r.node.nodeSize;for(;o>0&&Xu([...e.parent.child(o-1).marks],t,n);)o-=1,l-=e.parent.child(o).nodeSize;for(;c<e.parent.childCount&&Xu([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:l,to:u}}function Qn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const O2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const a=Qn(e,i.schema),{doc:o,selection:l}=n,{$from:c,from:u,to:f}=l;if(r){const m=dc(c,a,t);if(m&&m.from<=u&&m.to>=f){const p=ge.create(o,m.from,m.to);n.setSelection(p)}}return!0},M2=e=>t=>{const n=typeof e=="function"?e(t):e;for(let i=0;i<n.length;i+=1)if(n[i](t))return!0;return!1};function am(e){return e instanceof ge}function li(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function D2(e,t=null){if(!t)return null;const n=ke.atStart(e),i=ke.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return i;const r=n.from,a=i.to;return t==="all"?ge.create(e,li(0,r,a),li(e.content.size,r,a)):ge.create(e,li(t,r,a),li(t,r,a))}function Ju(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function to(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function z2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const I2=(e=null,t={})=>({editor:n,view:i,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const o=()=>{(to()||Ju())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),z2()&&!to()&&!Ju()&&i.dom.focus({preventScroll:!0}))})};if(i.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!am(n.state.selection))return o(),!0;const l=D2(r.doc,e)||n.state.selection,c=n.state.selection.eq(l);return a&&(c||r.setSelection(l),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),o()),!0},R2=(e,t)=>n=>e.every((i,r)=>t(i,{...n,index:r})),L2=(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),om=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const i=t[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?e.removeChild(i):i.nodeType===1&&om(i)}return e};function va(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return om(n)}function Pi(e,t,n){if(e instanceof pi||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};const i=typeof e=="object"&&e!==null,r=typeof e=="string";if(i)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Pi("",t,n)}if(r){if(n.errorOnInvalidContent){let o=!1,l="";const c=new Qf({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?ur.fromSchema(c).parseSlice(va(e),n.parseOptions):ur.fromSchema(c).parse(va(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=ur.fromSchema(t);return n.slice?a.parseSlice(va(e),n.parseOptions).content:a.parse(va(e),n.parseOptions)}return Pi("",t,n)}function B2(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}const P2=e=>!("type"in e),F2=(e,t,n)=>({tr:i,dispatch:r,editor:a})=>{var o;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=y=>{a.emit("contentError",{editor:a,error:y,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Pi(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){c(y)}try{l=Pi(t,a.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:a.options.enableContentCheck})}catch(y){return c(y),!1}let{from:f,to:m}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if((P2(l)?l:[l]).forEach(y=>{y.check(),p=p?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),f===m&&h){const{parent:y}=i.doc.resolve(f);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(f-=1,m+=1)}let b;if(p){if(Array.isArray(t))b=t.map(y=>y.text||"").join("");else if(t instanceof J){let y="";t.forEach(v=>{v.text&&(y+=v.text)}),b=y}else typeof t=="object"&&t&&t.text?b=t.text:b=t;i.insertText(b,f,m)}else b=l,i.replaceWith(f,m,b);n.updateSelection&&B2(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:f,text:b})}return!0},V2=()=>({state:e,dispatch:t})=>$k(e,t),U2=()=>({state:e,dispatch:t})=>Wk(e,t),H2=()=>({state:e,dispatch:t})=>$p(e,t),q2=()=>({state:e,dispatch:t})=>Xp(e,t),j2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Bo(e.doc,e.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},$2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Bo(e.doc,e.selection.$from.pos,1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},W2=()=>({state:e,dispatch:t})=>qk(e,t),G2=()=>({state:e,dispatch:t})=>jk(e,t);function sm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function K2(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))to()||sm()?o=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const X2=e=>({editor:t,view:n,tr:i,dispatch:r})=>{const a=K2(e).split(/-(?!$)/),o=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,l))});return c==null||c.steps.forEach(u=>{const f=u.map(i.mapping);f&&r&&i.maybeStep(f)}),!0};function fc(e,t,n={}){const{from:i,to:r,empty:a}=e.selection,o=t?lt(t,e.schema):null,l=[];e.doc.nodesBetween(i,r,(m,p)=>{if(m.isText)return;const h=Math.max(i,p),g=Math.min(r,p+m.nodeSize);l.push({node:m,from:h,to:g})});const c=r-i,u=l.filter(m=>o?o.name===m.node.type.name:!0).filter(m=>eo(m.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((m,p)=>m+p.to-p.from,0)>=c}const J2=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return fc(n,r,t)?Gk(n,i):!1},Z2=()=>({state:e,dispatch:t})=>Yp(e,t),Q2=e=>({state:t,dispatch:n})=>{const i=lt(e,t.schema);return a2(i)(t,n)},Y2=()=>({state:e,dispatch:t})=>Zp(e,t);function pc(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Zu(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((i,r)=>(n.includes(r)||(i[r]=e[r]),i),{})}const ew=(e,t)=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=pc(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=lt(e,i.schema)),l==="mark"&&(o=Qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{i.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{a&&a===u.type&&n.setNodeMarkup(f,void 0,Zu(u.attrs,t)),o&&u.marks.length&&u.marks.forEach(m=>{o===m.type&&n.addMark(f,f+u.nodeSize,o.create(Zu(m.attrs,t)))})})}),!0):!1},tw=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),nw=()=>({tr:e,dispatch:t})=>{if(t){const n=new It(e.doc);e.setSelection(n)}return!0},iw=()=>({state:e,dispatch:t})=>Gp(e,t),rw=()=>({state:e,dispatch:t})=>Jp(e,t),aw=()=>({state:e,dispatch:t})=>Zk(e,t),ow=()=>({state:e,dispatch:t})=>e2(e,t),sw=()=>({state:e,dispatch:t})=>Yk(e,t);function lw(e,t,n={},i={}){return Pi(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const cw=(e,t=!1,n={},i={})=>({editor:r,tr:a,dispatch:o,commands:l})=>{var c,u;const{doc:f}=a;if(n.preserveWhitespace!=="full"){const m=lw(e,r.schema,n,{errorOnInvalidContent:(c=i.errorOnInvalidContent)!==null&&c!==void 0?c:r.options.enableContentCheck});return o&&a.replaceWith(0,f.content.size,m).setMeta("preventUpdate",!t),!0}return o&&a.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:f.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function lm(e,t){const n=Qn(t,e.schema),{from:i,to:r,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,r,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function uw(e,t){const n=new pp(e);return t.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function dw(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function fw(e,t,n){const i=[];return e.nodesBetween(t.from,t.to,(r,a)=>{n(r)&&i.push({node:r,pos:a})}),i}function cm(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}function mc(e){return t=>cm(t.$from,e)}function pw(e,t){const n=lt(t,e.schema),{from:i,to:r}=e.selection,a=[];e.doc.nodesBetween(i,r,l=>{a.push(l)});const o=a.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function mw(e,t){const n=pc(typeof t=="string"?t:t.name,e.schema);return n==="node"?pw(e,t):n==="mark"?lm(e,t):{}}function hw(e,t=JSON.stringify){const n={};return e.filter(i=>{const r=t(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function bw(e){const t=hw(e);return t.length===1?t:t.filter((n,i)=>!t.filter((a,o)=>o!==i).some(a=>n.oldRange.from>=a.oldRange.from&&n.oldRange.to<=a.oldRange.to&&n.newRange.from>=a.newRange.from&&n.newRange.to<=a.newRange.to))}function gw(e){const{mapping:t,steps:n}=e,i=[];return t.maps.forEach((r,a)=>{const o=[];if(r.ranges.length)r.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=n[a];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const u=t.slice(a).map(l,-1),f=t.slice(a).map(c),m=t.invert().map(u,-1),p=t.invert().map(f);i.push({oldRange:{from:m,to:p},newRange:{from:u,to:f}})})}),bw(i)}function hc(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),o=dc(a,r.type);o&&i.push({mark:r,...o})}):n.nodesBetween(e,t,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(o=>({from:a,to:a+r.nodeSize,mark:o})))}),i}function Ia(e,t,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=e.find(a=>a.type===t&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function vw(e,t,n={}){const{empty:i,ranges:r}=e.selection,a=t?Qn(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(m=>a?a.name===m.type.name:!0).find(m=>eo(m.attrs,n,{strict:!1}));let o=0;const l=[];if(r.forEach(({$from:m,$to:p})=>{const h=m.pos,g=p.pos;e.doc.nodesBetween(h,g,(b,y)=>{if(!b.isText&&!b.marks.length)return;const v=Math.max(h,y),x=Math.min(g,y+b.nodeSize),k=x-v;o+=k,l.push(...b.marks.map(w=>({mark:w,from:v,to:x})))})}),o===0)return!1;const c=l.filter(m=>a?a.name===m.mark.type.name:!0).filter(m=>eo(m.mark.attrs,n,{strict:!1})).reduce((m,p)=>m+p.to-p.from,0),u=l.filter(m=>a?m.mark.type!==a&&m.mark.type.excludes(a):!0).reduce((m,p)=>m+p.to-p.from,0);return(c>0?c+u:c)>=o}function Qu(e,t){const{nodeExtensions:n}=u2(t),i=n.find(o=>o.name===e);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=it(pt(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function bc(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((i=e.text)!==null&&i!==void 0?i:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(bc(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function xw(e,t,n){var i;const{selection:r}=t;let a=null;if(am(r)&&(a=r.$cursor),a){const l=(i=e.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:o}=r;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(f,m,p)=>{if(u)return!1;if(f.isInline){const h=!p||p.type.allowsMarkType(n),g=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));u=h&&g}return!u}),u})}const yw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:o,ranges:l}=a,c=Qn(e,i.schema);if(r)if(o){const u=lm(i,c);n.addStoredMark(c.create({...u,...t}))}else l.forEach(u=>{const f=u.$from.pos,m=u.$to.pos;i.doc.nodesBetween(f,m,(p,h)=>{const g=Math.max(h,f),b=Math.min(h+p.nodeSize,m);p.marks.find(v=>v.type===c)?p.marks.forEach(v=>{c===v.type&&n.addMark(g,b,c.create({...v.attrs,...t}))}):n.addMark(g,b,c.create(t))})});return xw(i,n,c)},kw=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),ww=(e,t={})=>({state:n,dispatch:i,chain:r})=>{const a=lt(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:l})=>Ku(a,{...o,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Ku(a,{...o,...t})(l,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},_w=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,r=li(e,0,i.content.size),a=be.create(i,r);t.setSelection(a)}return!0},Sw=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,o=ge.atStart(i).from,l=ge.atEnd(i).to,c=li(r,o,l),u=li(a,o,l),f=ge.create(i,c,u);t.setSelection(f)}return!0},Cw=e=>({state:t,dispatch:n})=>{const i=lt(e,t.schema);return l2(i)(t,n)};function Yu(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter(r=>t==null?void 0:t.includes(r.type.name));e.tr.ensureMarks(i)}}const Ew=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:o}=t,{$from:l,$to:c}=a,u=r.extensionManager.attributes,f=Ia(u,l.node().type.name,l.node().attrs);if(a instanceof be&&a.node.isBlock)return!l.parentOffset||!Tn(o,l.pos)?!1:(i&&(e&&Yu(n,r.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:dw(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=m&&p?[{type:p,attrs:f}]:void 0,g=Tn(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!g&&Tn(t.doc,t.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(g=!0,h=p?[{type:p,attrs:f}]:void 0),i){if(g&&(a instanceof ge&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),p&&!m&&!l.parentOffset&&l.parent.type!==p)){const b=t.mapping.map(l.before()),y=t.doc.resolve(b);l.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(l.before()),p)}e&&Yu(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return g},Aw=(e,t={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var o;const l=lt(e,i.schema),{$from:c,$to:u}=i.selection,f=i.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(u))return!1;const m=c.node(-1);if(m.type!==l)return!1;const p=a.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let v=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let _=c.depth-x;_>=c.depth-3;_-=1)v=J.from(c.node(_).copy(v));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,w={...Ia(p,c.node().type.name,c.node().attrs),...t},S=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(w))||void 0;v=v.append(J.from(l.createAndFill(null,S)||void 0));const A=c.before(c.depth-(x-1));n.replace(A,c.after(-k),new ae(v,4-x,0));let I=-1;n.doc.nodesBetween(A,n.doc.content.size,(_,E)=>{if(I>-1)return!1;_.isTextblock&&_.content.size===0&&(I=E+1)}),I>-1&&n.setSelection(ge.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const h=u.pos===c.end()?m.contentMatchAt(0).defaultType:null,g={...Ia(p,m.type.name,m.attrs),...t},b={...Ia(p,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const y=h?[{type:l,attrs:g},{type:h,attrs:b}]:[{type:l,attrs:g}];if(!Tn(n.doc,c.pos,2))return!1;if(r){const{selection:v,storedMarks:x}=i,{splittableMarks:k}=a.extensionManager,w=x||v.$to.parentOffset&&v.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!w||!r)return!0;const S=w.filter(A=>k.includes(A.type.name));n.ensureMarks(S)}return!0},ks=(e,t)=>{const n=mc(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Xn(e.doc,n.pos)&&e.join(n.pos),!0},ws=(e,t)=>{const n=mc(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Xn(e.doc,i)&&e.join(i),!0},Tw=(e,t,n,i={})=>({editor:r,tr:a,state:o,dispatch:l,chain:c,commands:u,can:f})=>{const{extensions:m,splittableMarks:p}=r.extensionManager,h=lt(e,o.schema),g=lt(t,o.schema),{selection:b,storedMarks:y}=o,{$from:v,$to:x}=b,k=v.blockRange(x),w=y||b.$to.parentOffset&&b.$from.marks();if(!k)return!1;const S=mc(A=>Qu(A.type.name,m))(b);if(k.depth>=1&&S&&k.depth-S.depth<=1){if(S.node.type===h)return u.liftListItem(g);if(Qu(S.node.type.name,m)&&h.validContent(S.node.content)&&l)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>ks(a,h)).command(()=>ws(a,h)).run()}return!n||!w||!l?c().command(()=>f().wrapInList(h,i)?!0:u.clearNodes()).wrapInList(h,i).command(()=>ks(a,h)).command(()=>ws(a,h)).run():c().command(()=>{const A=f().wrapInList(h,i),I=w.filter(_=>p.includes(_.type.name));return a.ensureMarks(I),A?!0:u.clearNodes()}).wrapInList(h,i).command(()=>ks(a,h)).command(()=>ws(a,h)).run()},Nw=(e,t={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,o=Qn(e,i.schema);return vw(i,o,t)?r.unsetMark(o,{extendEmptyMarkRange:a}):r.setMark(o,t)},Ow=(e,t,n={})=>({state:i,commands:r})=>{const a=lt(e,i.schema),o=lt(t,i.schema),l=fc(i,a,n);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),l?r.setNode(o,c):r.setNode(a,{...c,...n})},Mw=(e,t={})=>({state:n,commands:i})=>{const r=lt(e,n.schema);return fc(n,r,t)?i.lift(r):i.wrapIn(r,t)},Dw=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const o=e.tr,l=a.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(a.text){const c=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,e.schema.text(a.text,c))}else o.delete(a.from,a.to)}return!0}}return!1},zw=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:r}=n;return i||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},Iw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=Qn(e,i.schema),{$from:u,empty:f,ranges:m}=l;if(!r)return!0;if(f&&o){let{from:p,to:h}=l;const g=(a=u.marks().find(y=>y.type===c))===null||a===void 0?void 0:a.attrs,b=dc(u,c,g);b&&(p=b.from,h=b.to),n.removeMark(p,h,c)}else m.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},Rw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=pc(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=lt(e,i.schema)),l==="mark"&&(o=Qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;let m,p,h,g;n.selection.empty?i.doc.nodesBetween(u,f,(b,y)=>{a&&a===b.type&&(h=Math.max(y,u),g=Math.min(y+b.nodeSize,f),m=y,p=b)}):i.doc.nodesBetween(u,f,(b,y)=>{y<u&&a&&a===b.type&&(h=Math.max(y,u),g=Math.min(y+b.nodeSize,f),m=y,p=b),y>=u&&y<=f&&(a&&a===b.type&&n.setNodeMarkup(y,void 0,{...b.attrs,...t}),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type){const x=Math.max(y,u),k=Math.min(y+b.nodeSize,f);n.addMark(x,k,o.create({...v.attrs,...t}))}}))}),p&&(m!==void 0&&n.setNodeMarkup(m,void 0,{...p.attrs,...t}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&n.addMark(h,g,o.create({...b.attrs,...t}))}))}),!0):!1},Lw=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return t2(r,t)(n,i)},Bw=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return n2(r,t)(n,i)};var Pw=Object.freeze({__proto__:null,blur:v2,clearContent:x2,clearNodes:y2,command:k2,createParagraphNear:w2,cut:_2,deleteCurrentNode:S2,deleteNode:C2,deleteRange:E2,deleteSelection:A2,enter:T2,exitCode:N2,extendMarkRange:O2,first:M2,focus:I2,forEach:R2,insertContent:L2,insertContentAt:F2,joinBackward:H2,joinDown:U2,joinForward:q2,joinItemBackward:j2,joinItemForward:$2,joinTextblockBackward:W2,joinTextblockForward:G2,joinUp:V2,keyboardShortcut:X2,lift:J2,liftEmptyBlock:Z2,liftListItem:Q2,newlineInCode:Y2,resetAttributes:ew,scrollIntoView:tw,selectAll:nw,selectNodeBackward:iw,selectNodeForward:rw,selectParentNode:aw,selectTextblockEnd:ow,selectTextblockStart:sw,setContent:cw,setMark:yw,setMeta:kw,setNode:ww,setNodeSelection:_w,setTextSelection:Sw,sinkListItem:Cw,splitBlock:Ew,splitListItem:Aw,toggleList:Tw,toggleMark:Nw,toggleNode:Ow,toggleWrap:Mw,undoInputRule:Dw,unsetAllMarks:zw,unsetMark:Iw,updateAttributes:Rw,wrapIn:Lw,wrapInList:Bw});const Fw=Ke.create({name:"commands",addCommands(){return{...Pw}}}),Vw=Ke.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new rt("tiptapDrop"),props:{handleDrop:(e,t,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:i})}}})]}}),Uw=Ke.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new rt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),um=new rt("focusEvents"),Hw=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new ct({key:um,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),qw=Ke.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:f,$anchor:m}=c,{pos:p,parent:h}=m,g=m.parent.isTextblock&&p>0?l.doc.resolve(p-1):m,b=g.parent.type.spec.isolating,y=m.pos-m.parentOffset,v=b&&g.parent.childCount===1?y===m.pos:ke.atStart(u).from===p;return!f||!h.type.isTextblock||h.textContent.length||!v||v&&m.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return to()||sm()?a:r},addProseMirrorPlugins(){return[new ct({key:new rt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const i=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),r=e.some(b=>b.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:o,to:l}=t.selection,c=ke.atStart(t.doc).from,u=ke.atEnd(t.doc).to;if(a||!(o===c&&l===u)||!bc(n.doc))return;const p=n.tr,h=nm({state:n,transaction:p}),{commands:g}=new c2({editor:this.editor,state:h});if(g.clearNodes(),!!p.steps.length)return p}})]}}),jw=Ke.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new rt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),$w=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new rt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Ww=Object.freeze({__proto__:null,ClipboardTextSerializer:g2,Commands:Fw,Drop:Vw,Editable:Uw,FocusEvents:Hw,Keymap:qw,Paste:jw,Tabindex:$w,focusEventsPluginKey:um});function Gw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i})=>{const r=it(e.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=t,o=i[i.length-1],l=i[0];if(o){const c=l.search(/\S/),u=n.from+l.indexOf(o),f=u+o.length;if(hc(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(b=>b===e.type&&b!==h.mark.type)).filter(h=>h.to>u).length)return null;f<n.to&&a.delete(f,n.to),u>n.from&&a.delete(n.from+c,u);const p=n.from+c+o.length;a.addMark(n.from+c,p,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function Kw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i})=>{const r=it(e.getAttributes,void 0,i)||{},{tr:a}=t,o=n.from;let l=n.to;const c=e.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let f=o+u;f>l?f=l:l=f+i[1].length;const m=i[0][i[0].length-1];a.insertText(m,o+i[0].length-1),a.replaceWith(f,l,c)}else if(i[0]){const u=e.type.isInline?o:o-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(o),a.mapping.map(l))}a.scrollIntoView()}})}function Xw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i,chain:r})=>{const a=it(e.getAttributes,void 0,i)||{},o=t.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),u=c&&Xl(c,e.type,a);if(!u)return null;if(o.wrap(c,u),e.keepMarks&&e.editor){const{selection:m,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,g=p||m.$to.parentOffset&&m.$from.marks();if(g){const b=g.filter(y=>h.includes(y.type.name));o.ensureMarks(b)}}if(e.keepAttributes){const m=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(m,a).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Xn(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,f))&&o.join(n.from-1)}})}let Ae=class pl{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new pl(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new pl(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}};function dm(e){return new m2({find:e.find,handler:({state:t,range:n,match:i,pasteEvent:r})=>{const a=it(e.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:o}=t,l=i[i.length-1],c=i[0];let u=n.to;if(l){const f=c.search(/\S/),m=n.from+c.indexOf(l),p=m+l.length;if(hc(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(y=>y===e.type&&y!==g.mark.type)).filter(g=>g.to>m).length)return null;p<n.to&&o.delete(p,n.to),m>n.from&&o.delete(n.from+f,m),u=n.from+f+l.length,o.addMark(n.from+f,u,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}const Jw=Et.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Zw=Ae.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Fe(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Qw=/^\s*(\[([( |x])?\])\s$/,Yw=Ae.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Fe(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:i})=>{const r=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),u=()=>{var f,m;l.ariaLabel=((m=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||m===void 0?void 0:m.call(f,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return u(),a.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",f=>f.preventDefault()),l.addEventListener("change",f=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=f.target;i.isEditable&&typeof n=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g==null?void 0:g.attrs,checked:m}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,m])=>{r.setAttribute(f,m)}),r.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,a.append(l,o),r.append(a,c),Object.entries(t).forEach(([f,m])=>{r.setAttribute(f,m)}),{dom:r,contentDOM:c,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,l.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[Xw({find:Qw,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),e_=Ke.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),t_="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",n_="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ml="numeric",hl="ascii",bl="alpha",pr="asciinumeric",lr="alphanumeric",gl="domain",fm="emoji",i_="scheme",r_="slashscheme",_s="whitespace";function a_(e,t){return e in t||(t[e]=[]),t[e]}function ci(e,t,n){t[ml]&&(t[pr]=!0,t[lr]=!0),t[hl]&&(t[pr]=!0,t[bl]=!0),t[pr]&&(t[lr]=!0),t[bl]&&(t[lr]=!0),t[lr]&&(t[gl]=!0),t[fm]&&(t[gl]=!0);for(const i in t){const r=a_(i,n);r.indexOf(e)<0&&r.push(e)}}function o_(e,t){const n={};for(const i in t)t[i].indexOf(e)>=0&&(n[i]=!0);return n}function Ct(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Ct.groups={};Ct.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let i=0;i<t.jr.length;i++){const r=t.jr[i][0],a=t.jr[i][1];if(a&&r.test(e))return a}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,i){for(let r=0;r<e.length;r++)this.tt(e[r],t,n,i)},tr(e,t,n,i){i=i||Ct.groups;let r;return t&&t.j?r=t:(r=new Ct(t),n&&i&&ci(t,n,i)),this.jr.push([e,r]),r},ts(e,t,n,i){let r=this;const a=e.length;if(!a)return r;for(let o=0;o<a-1;o++)r=r.tt(e[o]);return r.tt(e[a-1],t,n,i)},tt(e,t,n,i){i=i||Ct.groups;const r=this;if(t&&t.j)return r.j[e]=t,t;const a=t;let o,l=r.go(e);if(l?(o=new Ct,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new Ct,a){if(i)if(o.t&&typeof o.t=="string"){const c=Object.assign(o_(o.t,i),n);ci(a,c,i)}else n&&ci(a,n,i);o.t=a}return r.j[e]=o,o}};const we=(e,t,n,i,r)=>e.ta(t,n,i,r),We=(e,t,n,i,r)=>e.tr(t,n,i,r),ed=(e,t,n,i,r)=>e.ts(t,n,i,r),te=(e,t,n,i,r)=>e.tt(t,n,i,r),Sn="WORD",vl="UWORD",pm="ASCIINUMERICAL",mm="ALPHANUMERICAL",Tr="LOCALHOST",xl="TLD",yl="UTLD",Ra="SCHEME",zi="SLASH_SCHEME",gc="NUM",kl="WS",vc="NL",mr="OPENBRACE",hr="CLOSEBRACE",no="OPENBRACKET",io="CLOSEBRACKET",ro="OPENPAREN",ao="CLOSEPAREN",oo="OPENANGLEBRACKET",so="CLOSEANGLEBRACKET",lo="FULLWIDTHLEFTPAREN",co="FULLWIDTHRIGHTPAREN",uo="LEFTCORNERBRACKET",fo="RIGHTCORNERBRACKET",po="LEFTWHITECORNERBRACKET",mo="RIGHTWHITECORNERBRACKET",ho="FULLWIDTHLESSTHAN",bo="FULLWIDTHGREATERTHAN",go="AMPERSAND",vo="APOSTROPHE",xo="ASTERISK",Bn="AT",yo="BACKSLASH",ko="BACKTICK",wo="CARET",ui="COLON",xc="COMMA",_o="DOLLAR",Qt="DOT",So="EQUALS",yc="EXCLAMATION",Ft="HYPHEN",br="PERCENT",Co="PIPE",Eo="PLUS",Ao="POUND",gr="QUERY",kc="QUOTE",hm="FULLWIDTHMIDDLEDOT",wc="SEMI",Yt="SLASH",vr="TILDE",To="UNDERSCORE",bm="EMOJI",No="SYM";var gm=Object.freeze({__proto__:null,ALPHANUMERICAL:mm,AMPERSAND:go,APOSTROPHE:vo,ASCIINUMERICAL:pm,ASTERISK:xo,AT:Bn,BACKSLASH:yo,BACKTICK:ko,CARET:wo,CLOSEANGLEBRACKET:so,CLOSEBRACE:hr,CLOSEBRACKET:io,CLOSEPAREN:ao,COLON:ui,COMMA:xc,DOLLAR:_o,DOT:Qt,EMOJI:bm,EQUALS:So,EXCLAMATION:yc,FULLWIDTHGREATERTHAN:bo,FULLWIDTHLEFTPAREN:lo,FULLWIDTHLESSTHAN:ho,FULLWIDTHMIDDLEDOT:hm,FULLWIDTHRIGHTPAREN:co,HYPHEN:Ft,LEFTCORNERBRACKET:uo,LEFTWHITECORNERBRACKET:po,LOCALHOST:Tr,NL:vc,NUM:gc,OPENANGLEBRACKET:oo,OPENBRACE:mr,OPENBRACKET:no,OPENPAREN:ro,PERCENT:br,PIPE:Co,PLUS:Eo,POUND:Ao,QUERY:gr,QUOTE:kc,RIGHTCORNERBRACKET:fo,RIGHTWHITECORNERBRACKET:mo,SCHEME:Ra,SEMI:wc,SLASH:Yt,SLASH_SCHEME:zi,SYM:No,TILDE:vr,TLD:xl,UNDERSCORE:To,UTLD:yl,UWORD:vl,WORD:Sn,WS:kl});const wn=/[a-z]/,tr=new RegExp("\\p{L}","u"),Ss=new RegExp("\\p{Emoji}","u"),_n=/\d/,Cs=/\s/,td="\r",Es=`
608
- `,s_="️",l_="‍",As="";let xa=null,ya=null;function c_(e=[]){const t={};Ct.groups=t;const n=new Ct;xa==null&&(xa=nd(t_)),ya==null&&(ya=nd(n_)),te(n,"'",vo),te(n,"{",mr),te(n,"}",hr),te(n,"[",no),te(n,"]",io),te(n,"(",ro),te(n,")",ao),te(n,"<",oo),te(n,">",so),te(n,"(",lo),te(n,")",co),te(n,"「",uo),te(n,"」",fo),te(n,"『",po),te(n,"』",mo),te(n,"<",ho),te(n,">",bo),te(n,"&",go),te(n,"*",xo),te(n,"@",Bn),te(n,"`",ko),te(n,"^",wo),te(n,":",ui),te(n,",",xc),te(n,"$",_o),te(n,".",Qt),te(n,"=",So),te(n,"!",yc),te(n,"-",Ft),te(n,"%",br),te(n,"|",Co),te(n,"+",Eo),te(n,"#",Ao),te(n,"?",gr),te(n,'"',kc),te(n,"/",Yt),te(n,";",wc),te(n,"~",vr),te(n,"_",To),te(n,"\\",yo),te(n,"・",hm);const i=We(n,_n,gc,{[ml]:!0});We(i,_n,i);const r=We(i,wn,pm,{[pr]:!0}),a=We(i,tr,mm,{[lr]:!0}),o=We(n,wn,Sn,{[hl]:!0});We(o,_n,r),We(o,wn,o),We(r,_n,r),We(r,wn,r);const l=We(n,tr,vl,{[bl]:!0});We(l,wn),We(l,_n,a),We(l,tr,l),We(a,_n,a),We(a,wn),We(a,tr,a);const c=te(n,Es,vc,{[_s]:!0}),u=te(n,td,kl,{[_s]:!0}),f=We(n,Cs,kl,{[_s]:!0});te(n,As,f),te(u,Es,c),te(u,As,f),We(u,Cs,f),te(f,td),te(f,Es),We(f,Cs,f),te(f,As,f);const m=We(n,Ss,bm,{[fm]:!0});te(m,"#"),We(m,Ss,m),te(m,s_,m);const p=te(m,l_);te(p,"#"),We(p,Ss,m);const h=[[wn,o],[_n,r]],g=[[wn,null],[tr,l],[_n,a]];for(let b=0;b<xa.length;b++)Rn(n,xa[b],xl,Sn,h);for(let b=0;b<ya.length;b++)Rn(n,ya[b],yl,vl,g);ci(xl,{tld:!0,ascii:!0},t),ci(yl,{utld:!0,alpha:!0},t),Rn(n,"file",Ra,Sn,h),Rn(n,"mailto",Ra,Sn,h),Rn(n,"http",zi,Sn,h),Rn(n,"https",zi,Sn,h),Rn(n,"ftp",zi,Sn,h),Rn(n,"ftps",zi,Sn,h),ci(Ra,{scheme:!0,ascii:!0},t),ci(zi,{slashscheme:!0,ascii:!0},t),e=e.sort((b,y)=>b[0]>y[0]?1:-1);for(let b=0;b<e.length;b++){const y=e[b][0],x=e[b][1]?{[i_]:!0}:{[r_]:!0};y.indexOf("-")>=0?x[gl]=!0:wn.test(y)?_n.test(y)?x[pr]=!0:x[hl]=!0:x[ml]=!0,ed(n,y,y,x)}return ed(n,"localhost",Tr,{ascii:!0}),n.jd=new Ct(No),{start:n,tokens:Object.assign({groups:t},gm)}}function vm(e,t){const n=u_(t.replace(/[A-Z]/g,l=>l.toLowerCase())),i=n.length,r=[];let a=0,o=0;for(;o<i;){let l=e,c=null,u=0,f=null,m=-1,p=-1;for(;o<i&&(c=l.go(n[o]));)l=c,l.accepts()?(m=0,p=0,f=l):m>=0&&(m+=n[o].length,p++),u+=n[o].length,a+=n[o].length,o++;a-=m,o-=p,u-=m,r.push({t:f.t,v:t.slice(a-u,a),s:a-u,e:a})}return r}function u_(e){const t=[],n=e.length;let i=0;for(;i<n;){let r=e.charCodeAt(i),a,o=r<55296||r>56319||i+1===n||(a=e.charCodeAt(i+1))<56320||a>57343?e[i]:e.slice(i,i+2);t.push(o),i+=o.length}return t}function Rn(e,t,n,i,r){let a;const o=t.length;for(let l=0;l<o-1;l++){const c=t[l];e.j[c]?a=e.j[c]:(a=new Ct(i),a.jr=r.slice(),e.j[c]=a),e=a}return a=new Ct(n),a.jr=r.slice(),e.j[t[o-1]]=a,a}function nd(e){const t=[],n=[];let i=0,r="0123456789";for(;i<e.length;){let a=0;for(;r.indexOf(e[i+a])>=0;)a++;if(a>0){t.push(n.join(""));for(let o=parseInt(e.substring(i,i+a),10);o>0;o--)n.pop();i+=a}else n.push(e[i]),i++}return t}const Nr={defaultProtocol:"http",events:null,format:id,formatHref:id,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _c(e,t=null){let n=Object.assign({},Nr);e&&(n=Object.assign(n,e instanceof _c?e.o:e));const i=n.ignoreTags,r=[];for(let a=0;a<i.length;a++)r.push(i[a].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=r}_c.prototype={o:Nr,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const i=t!=null;let r=this.o[e];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:Nr[e],typeof r=="function"&&i&&(r=r(t,n))):typeof r=="function"&&i&&(r=r(t,n.t,n)),r)},getObj(e,t,n){let i=this.o[e];return typeof i=="function"&&t!=null&&(i=i(t,n.t,n)),i},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function id(e){return e}function xm(e,t){this.t="token",this.v=e,this.tk=t}xm.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),i=e.get("format",t,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Nr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),i=e.get("formatHref",n,this),r=e.get("tagName",n,t),a=this.toFormattedString(e),o={},l=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),m=e.getObj("events",n,t);return o.href=i,l&&(o.class=l),c&&(o.target=c),u&&(o.rel=u),f&&Object.assign(o,f),{tagName:r,attributes:o,content:a,eventListeners:m}}};function Ho(e,t){class n extends xm{constructor(r,a){super(r,a),this.t=e}}for(const i in t)n.prototype[i]=t[i];return n.t=e,n}const d_=Ho("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rd=Ho("text"),f_=Ho("nl"),ka=Ho("url",{isLink:!0,toHref(e=Nr.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Tr&&e[1].t===ui}}),Pt=e=>new Ct(e);function p_({groups:e}){const t=e.domain.concat([go,xo,Bn,yo,ko,wo,_o,So,Ft,gc,br,Co,Eo,Ao,Yt,No,vr,To]),n=[vo,ui,xc,Qt,yc,br,gr,kc,wc,oo,so,mr,hr,io,no,ro,ao,lo,co,uo,fo,po,mo,ho,bo],i=[go,vo,xo,yo,ko,wo,_o,So,Ft,mr,hr,br,Co,Eo,Ao,gr,Yt,No,vr,To],r=Pt(),a=te(r,vr);we(a,i,a),we(a,e.domain,a);const o=Pt(),l=Pt(),c=Pt();we(r,e.domain,o),we(r,e.scheme,l),we(r,e.slashscheme,c),we(o,i,a),we(o,e.domain,o);const u=te(o,Bn);te(a,Bn,u),te(l,Bn,u),te(c,Bn,u);const f=te(a,Qt);we(f,i,a),we(f,e.domain,a);const m=Pt();we(u,e.domain,m),we(m,e.domain,m);const p=te(m,Qt);we(p,e.domain,m);const h=Pt(d_);we(p,e.tld,h),we(p,e.utld,h),te(u,Tr,h);const g=te(m,Ft);te(g,Ft,g),we(g,e.domain,m),we(h,e.domain,m),te(h,Qt,p),te(h,Ft,g);const b=te(o,Ft),y=te(o,Qt);te(b,Ft,b),we(b,e.domain,o),we(y,i,a),we(y,e.domain,o);const v=Pt(ka);we(y,e.tld,v),we(y,e.utld,v),we(v,e.domain,o),we(v,i,a),te(v,Qt,y),te(v,Ft,b),te(v,Bn,u);const x=te(v,ui),k=Pt(ka);we(x,e.numeric,k);const w=Pt(ka),S=Pt();we(w,t,w),we(w,n,S),we(S,t,w),we(S,n,S),te(v,Yt,w),te(k,Yt,w);const A=te(l,ui),I=te(c,ui),_=te(I,Yt),E=te(_,Yt);we(l,e.domain,o),te(l,Qt,y),te(l,Ft,b),we(c,e.domain,o),te(c,Qt,y),te(c,Ft,b),we(A,e.domain,w),te(A,Yt,w),te(A,gr,w),we(E,e.domain,w),we(E,t,w),te(E,Yt,w);const z=[[mr,hr],[no,io],[ro,ao],[oo,so],[lo,co],[uo,fo],[po,mo],[ho,bo]];for(let P=0;P<z.length;P++){const[U,V]=z[P],B=te(w,U);te(S,U,B);const j=Pt(ka);we(B,t,j);const $=Pt();we(B,n,$),te(B,V,w),we(j,t,j),we(j,n,$),we($,t,j),we($,n,$),te(j,V,w),te($,V,w)}return te(r,Tr,v),te(r,vc,f_),{start:r,tokens:gm}}function m_(e,t,n){let i=n.length,r=0,a=[],o=[];for(;r<i;){let l=e,c=null,u=null,f=0,m=null,p=-1;for(;r<i&&!(c=l.go(n[r].t));)o.push(n[r++]);for(;r<i&&(u=c||l.go(n[r].t));)c=null,l=u,l.accepts()?(p=0,m=l):p>=0&&p++,r++,f++;if(p<0)r-=f,r<i&&(o.push(n[r]),r++);else{o.length>0&&(a.push(Ts(rd,t,o)),o=[]),r-=p,f-=p;const h=m.t,g=n.slice(r-f,r);a.push(Ts(h,t,g))}}return o.length>0&&a.push(Ts(rd,t,o)),a}function Ts(e,t,n){const i=n[0].s,r=n[n.length-1].e,a=t.slice(i,r);return new e(a,n)}const h_=typeof console<"u"&&console&&console.warn||(()=>{}),b_="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ue={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function g_(){return Ct.groups={},Ue.scanner=null,Ue.parser=null,Ue.tokenQueue=[],Ue.pluginQueue=[],Ue.customSchemes=[],Ue.initialized=!1,Ue}function ad(e,t=!1){if(Ue.initialized&&h_(`linkifyjs: already initialized - will not register custom scheme "${e}" ${b_}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
607
+ `,textSerializers:o={}}=n||{};let l="";return e.nodesBetween(i,r,(c,u,f,m)=>{var p;c.isBlock&&u>i&&(l+=a);const h=o==null?void 0:o[c.type.name];if(h)return f&&(l+=h({node:c,pos:u,parent:f,index:m,range:t})),!1;c.isText&&(l+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(i,u)-u,r-u))}),l}function g2(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const v2=Ke.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new rt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:i,selection:r}=t,{ranges:a}=r,o=Math.min(...a.map(f=>f.$from.pos)),l=Math.max(...a.map(f=>f.$to.pos)),c=g2(n);return b2(i,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),x2=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),y2=(e=!1)=>({commands:t})=>t.setContent("",e),k2=()=>({state:e,tr:t,dispatch:n})=>{const{selection:i}=t,{ranges:r}=i;return n&&r.forEach(({$from:a,$to:o})=>{e.doc.nodesBetween(a.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:f}=t,m=u.resolve(f.map(c)),p=u.resolve(f.map(c+l.nodeSize)),h=m.blockRange(p);if(!h)return;const g=qi(h);if(l.type.isTextblock){const{defaultType:b}=m.parent.contentMatchAt(m.index());t.setNodeMarkup(h.start,b)}(g||g===0)&&t.lift(h,g)})}),!0},w2=e=>t=>e(t),_2=()=>({state:e,dispatch:t})=>Qp(e,t),S2=(e,t)=>({editor:n,tr:i})=>{const{state:r}=n,a=r.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);const o=i.mapping.map(t);return i.insert(o,a.content),i.setSelection(new ge(i.doc.resolve(Math.max(o-1,0)))),!0},C2=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,i=n.$anchor.node();if(i.content.size>0)return!1;const r=e.selection.$anchor;for(let a=r.depth;a>0;a-=1)if(r.node(a).type===i.type){if(t){const l=r.before(a),c=r.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},E2=e=>({tr:t,state:n,dispatch:i})=>{const r=lt(e,n.schema),a=t.selection.$anchor;for(let o=a.depth;o>0;o-=1)if(a.node(o).type===r){if(i){const c=a.before(o),u=a.after(o);t.delete(c,u).scrollIntoView()}return!0}return!1},A2=e=>({tr:t,dispatch:n})=>{const{from:i,to:r}=e;return n&&t.delete(i,r),!0},T2=()=>({state:e,dispatch:t})=>ac(e,t),N2=()=>({commands:e})=>e.keyboardShortcut("Enter"),O2=()=>({state:e,dispatch:t})=>Xk(e,t);function eo(e,t,n={strict:!0}){const i=Object.keys(t);return i.length?i.every(r=>n.strict?t[r]===e[r]:p2(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function rm(e,t,n={}){return e.find(i=>i.type===t&&eo(Object.fromEntries(Object.keys(n).map(r=>[r,i.attrs[r]])),n))}function Xu(e,t,n={}){return!!rm(e,t,n)}function dc(e,t,n){var i;if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(f=>f.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(f=>f.type===t)||(n=n||((i=r.node.marks[0])===null||i===void 0?void 0:i.attrs),!rm([...r.node.marks],t,n)))return;let o=r.index,l=e.start()+r.offset,c=o+1,u=l+r.node.nodeSize;for(;o>0&&Xu([...e.parent.child(o-1).marks],t,n);)o-=1,l-=e.parent.child(o).nodeSize;for(;c<e.parent.childCount&&Xu([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:l,to:u}}function Qn(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const M2=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const a=Qn(e,i.schema),{doc:o,selection:l}=n,{$from:c,from:u,to:f}=l;if(r){const m=dc(c,a,t);if(m&&m.from<=u&&m.to>=f){const p=ge.create(o,m.from,m.to);n.setSelection(p)}}return!0},D2=e=>t=>{const n=typeof e=="function"?e(t):e;for(let i=0;i<n.length;i+=1)if(n[i](t))return!0;return!1};function am(e){return e instanceof ge}function li(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function z2(e,t=null){if(!t)return null;const n=ke.atStart(e),i=ke.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return i;const r=n.from,a=i.to;return t==="all"?ge.create(e,li(0,r,a),li(e.content.size,r,a)):ge.create(e,li(t,r,a),li(t,r,a))}function Ju(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function to(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function I2(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const R2=(e=null,t={})=>({editor:n,view:i,tr:r,dispatch:a})=>{t={scrollIntoView:!0,...t};const o=()=>{(to()||Ju())&&i.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(i.focus(),I2()&&!to()&&!Ju()&&i.dom.focus({preventScroll:!0}))})};if(i.hasFocus()&&e===null||e===!1)return!0;if(a&&e===null&&!am(n.state.selection))return o(),!0;const l=z2(r.doc,e)||n.state.selection,c=n.state.selection.eq(l);return a&&(c||r.setSelection(l),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),o()),!0},L2=(e,t)=>n=>e.every((i,r)=>t(i,{...n,index:r})),B2=(e,t)=>({tr:n,commands:i})=>i.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),om=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const i=t[n];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?e.removeChild(i):i.nodeType===1&&om(i)}return e};function va(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return om(n)}function Pi(e,t,n){if(e instanceof pi||e instanceof J)return e;n={slice:!0,parseOptions:{},...n};const i=typeof e=="object"&&e!==null,r=typeof e=="string";if(i)try{if(Array.isArray(e)&&e.length>0)return J.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(a){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",a),Pi("",t,n)}if(r){if(n.errorOnInvalidContent){let o=!1,l="";const c=new Qf({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?ur.fromSchema(c).parseSlice(va(e),n.parseOptions):ur.fromSchema(c).parse(va(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const a=ur.fromSchema(t);return n.slice?a.parseSlice(va(e),n.parseOptions).content:a.parse(va(e),n.parseOptions)}return Pi("",t,n)}function P2(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}const F2=e=>!("type"in e),V2=(e,t,n)=>({tr:i,dispatch:r,editor:a})=>{var o;if(r){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=y=>{a.emit("contentError",{editor:a,error:y,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Pi(t,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){c(y)}try{l=Pi(t,a.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:a.options.enableContentCheck})}catch(y){return c(y),!1}let{from:f,to:m}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0;if((F2(l)?l:[l]).forEach(y=>{y.check(),p=p?y.isText&&y.marks.length===0:!1,h=h?y.isBlock:!1}),f===m&&h){const{parent:y}=i.doc.resolve(f);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(f-=1,m+=1)}let b;if(p){if(Array.isArray(t))b=t.map(y=>y.text||"").join("");else if(t instanceof J){let y="";t.forEach(v=>{v.text&&(y+=v.text)}),b=y}else typeof t=="object"&&t&&t.text?b=t.text:b=t;i.insertText(b,f,m)}else b=l,i.replaceWith(f,m,b);n.updateSelection&&P2(i,i.steps.length-1,-1),n.applyInputRules&&i.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&i.setMeta("applyPasteRules",{from:f,text:b})}return!0},U2=()=>({state:e,dispatch:t})=>Wk(e,t),H2=()=>({state:e,dispatch:t})=>Gk(e,t),q2=()=>({state:e,dispatch:t})=>$p(e,t),j2=()=>({state:e,dispatch:t})=>Xp(e,t),$2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Bo(e.doc,e.selection.$from.pos,-1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},W2=()=>({state:e,dispatch:t,tr:n})=>{try{const i=Bo(e.doc,e.selection.$from.pos,1);return i==null?!1:(n.join(i,2),t&&t(n),!0)}catch{return!1}},G2=()=>({state:e,dispatch:t})=>jk(e,t),K2=()=>({state:e,dispatch:t})=>$k(e,t);function sm(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function X2(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let i,r,a,o;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))a=!0;else if(/^mod$/i.test(c))to()||sm()?o=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}const J2=e=>({editor:t,view:n,tr:i,dispatch:r})=>{const a=X2(e).split(/-(?!$)/),o=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,l))});return c==null||c.steps.forEach(u=>{const f=u.map(i.mapping);f&&r&&i.maybeStep(f)}),!0};function fc(e,t,n={}){const{from:i,to:r,empty:a}=e.selection,o=t?lt(t,e.schema):null,l=[];e.doc.nodesBetween(i,r,(m,p)=>{if(m.isText)return;const h=Math.max(i,p),g=Math.min(r,p+m.nodeSize);l.push({node:m,from:h,to:g})});const c=r-i,u=l.filter(m=>o?o.name===m.node.type.name:!0).filter(m=>eo(m.node.attrs,n,{strict:!1}));return a?!!u.length:u.reduce((m,p)=>m+p.to-p.from,0)>=c}const Z2=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return fc(n,r,t)?Kk(n,i):!1},Q2=()=>({state:e,dispatch:t})=>Yp(e,t),Y2=e=>({state:t,dispatch:n})=>{const i=lt(e,t.schema);return o2(i)(t,n)},ew=()=>({state:e,dispatch:t})=>Zp(e,t);function pc(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Zu(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((i,r)=>(n.includes(r)||(i[r]=e[r]),i),{})}const tw=(e,t)=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=pc(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=lt(e,i.schema)),l==="mark"&&(o=Qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{i.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,f)=>{a&&a===u.type&&n.setNodeMarkup(f,void 0,Zu(u.attrs,t)),o&&u.marks.length&&u.marks.forEach(m=>{o===m.type&&n.addMark(f,f+u.nodeSize,o.create(Zu(m.attrs,t)))})})}),!0):!1},nw=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),iw=()=>({tr:e,dispatch:t})=>{if(t){const n=new It(e.doc);e.setSelection(n)}return!0},rw=()=>({state:e,dispatch:t})=>Gp(e,t),aw=()=>({state:e,dispatch:t})=>Jp(e,t),ow=()=>({state:e,dispatch:t})=>Qk(e,t),sw=()=>({state:e,dispatch:t})=>t2(e,t),lw=()=>({state:e,dispatch:t})=>e2(e,t);function cw(e,t,n={},i={}){return Pi(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:i.errorOnInvalidContent})}const uw=(e,t=!1,n={},i={})=>({editor:r,tr:a,dispatch:o,commands:l})=>{var c,u;const{doc:f}=a;if(n.preserveWhitespace!=="full"){const m=cw(e,r.schema,n,{errorOnInvalidContent:(c=i.errorOnInvalidContent)!==null&&c!==void 0?c:r.options.enableContentCheck});return o&&a.replaceWith(0,f.content.size,m).setMeta("preventUpdate",!t),!0}return o&&a.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:f.content.size},e,{parseOptions:n,errorOnInvalidContent:(u=i.errorOnInvalidContent)!==null&&u!==void 0?u:r.options.enableContentCheck})};function lm(e,t){const n=Qn(t,e.schema),{from:i,to:r,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(i,r,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function dw(e,t){const n=new pp(e);return t.forEach(i=>{i.steps.forEach(r=>{n.step(r)})}),n}function fw(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function pw(e,t,n){const i=[];return e.nodesBetween(t.from,t.to,(r,a)=>{n(r)&&i.push({node:r,pos:a})}),i}function cm(e,t){for(let n=e.depth;n>0;n-=1){const i=e.node(n);if(t(i))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:i}}}function mc(e){return t=>cm(t.$from,e)}function mw(e,t){const n=lt(t,e.schema),{from:i,to:r}=e.selection,a=[];e.doc.nodesBetween(i,r,l=>{a.push(l)});const o=a.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function hw(e,t){const n=pc(typeof t=="string"?t:t.name,e.schema);return n==="node"?mw(e,t):n==="mark"?lm(e,t):{}}function bw(e,t=JSON.stringify){const n={};return e.filter(i=>{const r=t(i);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function gw(e){const t=bw(e);return t.length===1?t:t.filter((n,i)=>!t.filter((a,o)=>o!==i).some(a=>n.oldRange.from>=a.oldRange.from&&n.oldRange.to<=a.oldRange.to&&n.newRange.from>=a.newRange.from&&n.newRange.to<=a.newRange.to))}function vw(e){const{mapping:t,steps:n}=e,i=[];return t.maps.forEach((r,a)=>{const o=[];if(r.ranges.length)r.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=n[a];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const u=t.slice(a).map(l,-1),f=t.slice(a).map(c),m=t.invert().map(u,-1),p=t.invert().map(f);i.push({oldRange:{from:m,to:p},newRange:{from:u,to:f}})})}),gw(i)}function hc(e,t,n){const i=[];return e===t?n.resolve(e).marks().forEach(r=>{const a=n.resolve(e),o=dc(a,r.type);o&&i.push({mark:r,...o})}):n.nodesBetween(e,t,(r,a)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(o=>({from:a,to:a+r.nodeSize,mark:o})))}),i}function Ia(e,t,n){return Object.fromEntries(Object.entries(n).filter(([i])=>{const r=e.find(a=>a.type===t&&a.name===i);return r?r.attribute.keepOnSplit:!1}))}function xw(e,t,n={}){const{empty:i,ranges:r}=e.selection,a=t?Qn(t,e.schema):null;if(i)return!!(e.storedMarks||e.selection.$from.marks()).filter(m=>a?a.name===m.type.name:!0).find(m=>eo(m.attrs,n,{strict:!1}));let o=0;const l=[];if(r.forEach(({$from:m,$to:p})=>{const h=m.pos,g=p.pos;e.doc.nodesBetween(h,g,(b,y)=>{if(!b.isText&&!b.marks.length)return;const v=Math.max(h,y),x=Math.min(g,y+b.nodeSize),k=x-v;o+=k,l.push(...b.marks.map(w=>({mark:w,from:v,to:x})))})}),o===0)return!1;const c=l.filter(m=>a?a.name===m.mark.type.name:!0).filter(m=>eo(m.mark.attrs,n,{strict:!1})).reduce((m,p)=>m+p.to-p.from,0),u=l.filter(m=>a?m.mark.type!==a&&m.mark.type.excludes(a):!0).reduce((m,p)=>m+p.to-p.from,0);return(c>0?c+u:c)>=o}function Qu(e,t){const{nodeExtensions:n}=d2(t),i=n.find(o=>o.name===e);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},a=it(pt(i,"group",r));return typeof a!="string"?!1:a.split(" ").includes("list")}function bc(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var i;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((i=e.text)!==null&&i!==void 0?i:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(a=>{r!==!1&&(bc(a,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function yw(e,t,n){var i;const{selection:r}=t;let a=null;if(am(r)&&(a=r.$cursor),a){const l=(i=e.storedMarks)!==null&&i!==void 0?i:a.marks();return!!n.isInSet(l)||!l.some(c=>c.type.excludes(n))}const{ranges:o}=r;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(f,m,p)=>{if(u)return!1;if(f.isInline){const h=!p||p.type.allowsMarkType(n),g=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));u=h&&g}return!u}),u})}const kw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{const{selection:a}=n,{empty:o,ranges:l}=a,c=Qn(e,i.schema);if(r)if(o){const u=lm(i,c);n.addStoredMark(c.create({...u,...t}))}else l.forEach(u=>{const f=u.$from.pos,m=u.$to.pos;i.doc.nodesBetween(f,m,(p,h)=>{const g=Math.max(h,f),b=Math.min(h+p.nodeSize,m);p.marks.find(v=>v.type===c)?p.marks.forEach(v=>{c===v.type&&n.addMark(g,b,c.create({...v.attrs,...t}))}):n.addMark(g,b,c.create(t))})});return yw(i,n,c)},ww=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),_w=(e,t={})=>({state:n,dispatch:i,chain:r})=>{const a=lt(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?r().command(({commands:l})=>Ku(a,{...o,...t})(n)?!0:l.clearNodes()).command(({state:l})=>Ku(a,{...o,...t})(l,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Sw=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,r=li(e,0,i.content.size),a=be.create(i,r);t.setSelection(a)}return!0},Cw=e=>({tr:t,dispatch:n})=>{if(n){const{doc:i}=t,{from:r,to:a}=typeof e=="number"?{from:e,to:e}:e,o=ge.atStart(i).from,l=ge.atEnd(i).to,c=li(r,o,l),u=li(a,o,l),f=ge.create(i,c,u);t.setSelection(f)}return!0},Ew=e=>({state:t,dispatch:n})=>{const i=lt(e,t.schema);return c2(i)(t,n)};function Yu(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const i=n.filter(r=>t==null?void 0:t.includes(r.type.name));e.tr.ensureMarks(i)}}const Aw=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:i,editor:r})=>{const{selection:a,doc:o}=t,{$from:l,$to:c}=a,u=r.extensionManager.attributes,f=Ia(u,l.node().type.name,l.node().attrs);if(a instanceof be&&a.node.isBlock)return!l.parentOffset||!Tn(o,l.pos)?!1:(i&&(e&&Yu(n,r.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:fw(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=m&&p?[{type:p,attrs:f}]:void 0,g=Tn(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!g&&Tn(t.doc,t.mapping.map(l.pos),1,p?[{type:p}]:void 0)&&(g=!0,h=p?[{type:p,attrs:f}]:void 0),i){if(g&&(a instanceof ge&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),p&&!m&&!l.parentOffset&&l.parent.type!==p)){const b=t.mapping.map(l.before()),y=t.doc.resolve(b);l.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(l.before()),p)}e&&Yu(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return g},Tw=(e,t={})=>({tr:n,state:i,dispatch:r,editor:a})=>{var o;const l=lt(e,i.schema),{$from:c,$to:u}=i.selection,f=i.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(u))return!1;const m=c.node(-1);if(m.type!==l)return!1;const p=a.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let v=J.empty;const x=c.index(-1)?1:c.index(-2)?2:3;for(let _=c.depth-x;_>=c.depth-3;_-=1)v=J.from(c.node(_).copy(v));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,w={...Ia(p,c.node().type.name,c.node().attrs),...t},S=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(w))||void 0;v=v.append(J.from(l.createAndFill(null,S)||void 0));const A=c.before(c.depth-(x-1));n.replace(A,c.after(-k),new ae(v,4-x,0));let I=-1;n.doc.nodesBetween(A,n.doc.content.size,(_,E)=>{if(I>-1)return!1;_.isTextblock&&_.content.size===0&&(I=E+1)}),I>-1&&n.setSelection(ge.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const h=u.pos===c.end()?m.contentMatchAt(0).defaultType:null,g={...Ia(p,m.type.name,m.attrs),...t},b={...Ia(p,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const y=h?[{type:l,attrs:g},{type:h,attrs:b}]:[{type:l,attrs:g}];if(!Tn(n.doc,c.pos,2))return!1;if(r){const{selection:v,storedMarks:x}=i,{splittableMarks:k}=a.extensionManager,w=x||v.$to.parentOffset&&v.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!w||!r)return!0;const S=w.filter(A=>k.includes(A.type.name));n.ensureMarks(S)}return!0},ks=(e,t)=>{const n=mc(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Xn(e.doc,n.pos)&&e.join(n.pos),!0},ws=(e,t)=>{const n=mc(o=>o.type===t)(e.selection);if(!n)return!0;const i=e.doc.resolve(n.start).after(n.depth);if(i===void 0)return!0;const r=e.doc.nodeAt(i);return n.node.type===(r==null?void 0:r.type)&&Xn(e.doc,i)&&e.join(i),!0},Nw=(e,t,n,i={})=>({editor:r,tr:a,state:o,dispatch:l,chain:c,commands:u,can:f})=>{const{extensions:m,splittableMarks:p}=r.extensionManager,h=lt(e,o.schema),g=lt(t,o.schema),{selection:b,storedMarks:y}=o,{$from:v,$to:x}=b,k=v.blockRange(x),w=y||b.$to.parentOffset&&b.$from.marks();if(!k)return!1;const S=mc(A=>Qu(A.type.name,m))(b);if(k.depth>=1&&S&&k.depth-S.depth<=1){if(S.node.type===h)return u.liftListItem(g);if(Qu(S.node.type.name,m)&&h.validContent(S.node.content)&&l)return c().command(()=>(a.setNodeMarkup(S.pos,h),!0)).command(()=>ks(a,h)).command(()=>ws(a,h)).run()}return!n||!w||!l?c().command(()=>f().wrapInList(h,i)?!0:u.clearNodes()).wrapInList(h,i).command(()=>ks(a,h)).command(()=>ws(a,h)).run():c().command(()=>{const A=f().wrapInList(h,i),I=w.filter(_=>p.includes(_.type.name));return a.ensureMarks(I),A?!0:u.clearNodes()}).wrapInList(h,i).command(()=>ks(a,h)).command(()=>ws(a,h)).run()},Ow=(e,t={},n={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:a=!1}=n,o=Qn(e,i.schema);return xw(i,o,t)?r.unsetMark(o,{extendEmptyMarkRange:a}):r.setMark(o,t)},Mw=(e,t,n={})=>({state:i,commands:r})=>{const a=lt(e,i.schema),o=lt(t,i.schema),l=fc(i,a,n);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),l?r.setNode(o,c):r.setNode(a,{...c,...n})},Dw=(e,t={})=>({state:n,commands:i})=>{const r=lt(e,n.schema);return fc(n,r,t)?i.lift(r):i.wrapIn(r,t)},zw=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i<n.length;i+=1){const r=n[i];let a;if(r.spec.isInputRules&&(a=r.getState(e))){if(t){const o=e.tr,l=a.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(a.text){const c=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,e.schema.text(a.text,c))}else o.delete(a.from,a.to)}return!0}}return!1},Iw=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:i,ranges:r}=n;return i||t&&r.forEach(a=>{e.removeMark(a.$from.pos,a.$to.pos)}),!0},Rw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{var a;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=Qn(e,i.schema),{$from:u,empty:f,ranges:m}=l;if(!r)return!0;if(f&&o){let{from:p,to:h}=l;const g=(a=u.marks().find(y=>y.type===c))===null||a===void 0?void 0:a.attrs,b=dc(u,c,g);b&&(p=b.from,h=b.to),n.removeMark(p,h,c)}else m.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},Lw=(e,t={})=>({tr:n,state:i,dispatch:r})=>{let a=null,o=null;const l=pc(typeof e=="string"?e:e.name,i.schema);return l?(l==="node"&&(a=lt(e,i.schema)),l==="mark"&&(o=Qn(e,i.schema)),r&&n.selection.ranges.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;let m,p,h,g;n.selection.empty?i.doc.nodesBetween(u,f,(b,y)=>{a&&a===b.type&&(h=Math.max(y,u),g=Math.min(y+b.nodeSize,f),m=y,p=b)}):i.doc.nodesBetween(u,f,(b,y)=>{y<u&&a&&a===b.type&&(h=Math.max(y,u),g=Math.min(y+b.nodeSize,f),m=y,p=b),y>=u&&y<=f&&(a&&a===b.type&&n.setNodeMarkup(y,void 0,{...b.attrs,...t}),o&&b.marks.length&&b.marks.forEach(v=>{if(o===v.type){const x=Math.max(y,u),k=Math.min(y+b.nodeSize,f);n.addMark(x,k,o.create({...v.attrs,...t}))}}))}),p&&(m!==void 0&&n.setNodeMarkup(m,void 0,{...p.attrs,...t}),o&&p.marks.length&&p.marks.forEach(b=>{o===b.type&&n.addMark(h,g,o.create({...b.attrs,...t}))}))}),!0):!1},Bw=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return n2(r,t)(n,i)},Pw=(e,t={})=>({state:n,dispatch:i})=>{const r=lt(e,n.schema);return i2(r,t)(n,i)};var Fw=Object.freeze({__proto__:null,blur:x2,clearContent:y2,clearNodes:k2,command:w2,createParagraphNear:_2,cut:S2,deleteCurrentNode:C2,deleteNode:E2,deleteRange:A2,deleteSelection:T2,enter:N2,exitCode:O2,extendMarkRange:M2,first:D2,focus:R2,forEach:L2,insertContent:B2,insertContentAt:V2,joinBackward:q2,joinDown:H2,joinForward:j2,joinItemBackward:$2,joinItemForward:W2,joinTextblockBackward:G2,joinTextblockForward:K2,joinUp:U2,keyboardShortcut:J2,lift:Z2,liftEmptyBlock:Q2,liftListItem:Y2,newlineInCode:ew,resetAttributes:tw,scrollIntoView:nw,selectAll:iw,selectNodeBackward:rw,selectNodeForward:aw,selectParentNode:ow,selectTextblockEnd:sw,selectTextblockStart:lw,setContent:uw,setMark:kw,setMeta:ww,setNode:_w,setNodeSelection:Sw,setTextSelection:Cw,sinkListItem:Ew,splitBlock:Aw,splitListItem:Tw,toggleList:Nw,toggleMark:Ow,toggleNode:Mw,toggleWrap:Dw,undoInputRule:zw,unsetAllMarks:Iw,unsetMark:Rw,updateAttributes:Lw,wrapIn:Bw,wrapInList:Pw});const Vw=Ke.create({name:"commands",addCommands(){return{...Fw}}}),Uw=Ke.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new rt("tiptapDrop"),props:{handleDrop:(e,t,n,i)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:i})}}})]}}),Hw=Ke.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new rt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),um=new rt("focusEvents"),qw=Ke.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new ct({key:um,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const i=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1},blur:(t,n)=>{e.isFocused=!1;const i=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(i),!1}}}})]}}),jw=Ke.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:f,$anchor:m}=c,{pos:p,parent:h}=m,g=m.parent.isTextblock&&p>0?l.doc.resolve(p-1):m,b=g.parent.type.spec.isolating,y=m.pos-m.parentOffset,v=b&&g.parent.childCount===1?y===m.pos:ke.atStart(u).from===p;return!f||!h.type.isTextblock||h.textContent.length||!v||v&&m.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},a={...i,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return to()||sm()?a:r},addProseMirrorPlugins(){return[new ct({key:new rt("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(b=>b.getMeta("composition")))return;const i=e.some(b=>b.docChanged)&&!t.doc.eq(n.doc),r=e.some(b=>b.getMeta("preventClearDocument"));if(!i||r)return;const{empty:a,from:o,to:l}=t.selection,c=ke.atStart(t.doc).from,u=ke.atEnd(t.doc).to;if(a||!(o===c&&l===u)||!bc(n.doc))return;const p=n.tr,h=nm({state:n,transaction:p}),{commands:g}=new u2({editor:this.editor,state:h});if(g.clearNodes(),!!p.steps.length)return p}})]}}),$w=Ke.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new rt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Ww=Ke.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new rt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Gw=Object.freeze({__proto__:null,ClipboardTextSerializer:v2,Commands:Vw,Drop:Uw,Editable:Hw,FocusEvents:qw,Keymap:jw,Paste:$w,Tabindex:Ww,focusEventsPluginKey:um});function Kw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i})=>{const r=it(e.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:a}=t,o=i[i.length-1],l=i[0];if(o){const c=l.search(/\S/),u=n.from+l.indexOf(o),f=u+o.length;if(hc(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(b=>b===e.type&&b!==h.mark.type)).filter(h=>h.to>u).length)return null;f<n.to&&a.delete(f,n.to),u>n.from&&a.delete(n.from+c,u);const p=n.from+c+o.length;a.addMark(n.from+c,p,e.type.create(r||{})),a.removeStoredMark(e.type)}}})}function Xw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i})=>{const r=it(e.getAttributes,void 0,i)||{},{tr:a}=t,o=n.from;let l=n.to;const c=e.type.create(r);if(i[1]){const u=i[0].lastIndexOf(i[1]);let f=o+u;f>l?f=l:l=f+i[1].length;const m=i[0][i[0].length-1];a.insertText(m,o+i[0].length-1),a.replaceWith(f,l,c)}else if(i[0]){const u=e.type.isInline?o:o-1;a.insert(u,e.type.create(r)).delete(a.mapping.map(o),a.mapping.map(l))}a.scrollIntoView()}})}function Jw(e){return new uc({find:e.find,handler:({state:t,range:n,match:i,chain:r})=>{const a=it(e.getAttributes,void 0,i)||{},o=t.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),u=c&&Xl(c,e.type,a);if(!u)return null;if(o.wrap(c,u),e.keepMarks&&e.editor){const{selection:m,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,g=p||m.$to.parentOffset&&m.$from.marks();if(g){const b=g.filter(y=>h.includes(y.type.name));o.ensureMarks(b)}}if(e.keepAttributes){const m=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(m,a).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Xn(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(i,f))&&o.join(n.from-1)}})}let Ae=class pl{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=it(pt(this,"addOptions",{name:this.name}))),this.storage=it(pt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new pl(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Uo(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new pl(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=it(pt(n,"addOptions",{name:n.name})),n.storage=it(pt(n,"addStorage",{name:n.name,options:n.options})),n}};function dm(e){return new h2({find:e.find,handler:({state:t,range:n,match:i,pasteEvent:r})=>{const a=it(e.getAttributes,void 0,i,r);if(a===!1||a===null)return null;const{tr:o}=t,l=i[i.length-1],c=i[0];let u=n.to;if(l){const f=c.search(/\S/),m=n.from+c.indexOf(l),p=m+l.length;if(hc(n.from,n.to,t.doc).filter(g=>g.mark.type.excluded.find(y=>y===e.type&&y!==g.mark.type)).filter(g=>g.to>m).length)return null;p<n.to&&o.delete(p,n.to),m>n.from&&o.delete(n.from+f,m),u=n.from+f+l.length,o.addMark(n.from+f,u,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}const Zw=Et.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Qw=Ae.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",Fe(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Yw=/^\s*(\[([( |x])?\])\s$/,e_=Ae.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Fe(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:i})=>{const r=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),u=()=>{var f,m;l.ariaLabel=((m=(f=this.options.a11y)===null||f===void 0?void 0:f.checkboxLabel)===null||m===void 0?void 0:m.call(f,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return u(),a.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",f=>f.preventDefault()),l.addEventListener("change",f=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=f.target;i.isEditable&&typeof n=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const h=n();if(typeof h!="number")return!1;const g=p.doc.nodeAt(h);return p.setNodeMarkup(h,void 0,{...g==null?void 0:g.attrs,checked:m}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,m])=>{r.setAttribute(f,m)}),r.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,a.append(l,o),r.append(a,c),Object.entries(t).forEach(([f,m])=>{r.setAttribute(f,m)}),{dom:r,contentDOM:c,update:f=>f.type!==this.type?!1:(r.dataset.checked=f.attrs.checked,l.checked=f.attrs.checked,u(),!0)}}},addInputRules(){return[Jw({find:Yw,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),t_=Ke.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{const t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(n=>n):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(t=>t),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),n_="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",i_="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",ml="numeric",hl="ascii",bl="alpha",pr="asciinumeric",lr="alphanumeric",gl="domain",fm="emoji",r_="scheme",a_="slashscheme",_s="whitespace";function o_(e,t){return e in t||(t[e]=[]),t[e]}function ci(e,t,n){t[ml]&&(t[pr]=!0,t[lr]=!0),t[hl]&&(t[pr]=!0,t[bl]=!0),t[pr]&&(t[lr]=!0),t[bl]&&(t[lr]=!0),t[lr]&&(t[gl]=!0),t[fm]&&(t[gl]=!0);for(const i in t){const r=o_(i,n);r.indexOf(e)<0&&r.push(e)}}function s_(e,t){const n={};for(const i in t)t[i].indexOf(e)>=0&&(n[i]=!0);return n}function Ct(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Ct.groups={};Ct.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let i=0;i<t.jr.length;i++){const r=t.jr[i][0],a=t.jr[i][1];if(a&&r.test(e))return a}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,i){for(let r=0;r<e.length;r++)this.tt(e[r],t,n,i)},tr(e,t,n,i){i=i||Ct.groups;let r;return t&&t.j?r=t:(r=new Ct(t),n&&i&&ci(t,n,i)),this.jr.push([e,r]),r},ts(e,t,n,i){let r=this;const a=e.length;if(!a)return r;for(let o=0;o<a-1;o++)r=r.tt(e[o]);return r.tt(e[a-1],t,n,i)},tt(e,t,n,i){i=i||Ct.groups;const r=this;if(t&&t.j)return r.j[e]=t,t;const a=t;let o,l=r.go(e);if(l?(o=new Ct,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new Ct,a){if(i)if(o.t&&typeof o.t=="string"){const c=Object.assign(s_(o.t,i),n);ci(a,c,i)}else n&&ci(a,n,i);o.t=a}return r.j[e]=o,o}};const we=(e,t,n,i,r)=>e.ta(t,n,i,r),We=(e,t,n,i,r)=>e.tr(t,n,i,r),ed=(e,t,n,i,r)=>e.ts(t,n,i,r),te=(e,t,n,i,r)=>e.tt(t,n,i,r),Sn="WORD",vl="UWORD",pm="ASCIINUMERICAL",mm="ALPHANUMERICAL",Tr="LOCALHOST",xl="TLD",yl="UTLD",Ra="SCHEME",zi="SLASH_SCHEME",gc="NUM",kl="WS",vc="NL",mr="OPENBRACE",hr="CLOSEBRACE",no="OPENBRACKET",io="CLOSEBRACKET",ro="OPENPAREN",ao="CLOSEPAREN",oo="OPENANGLEBRACKET",so="CLOSEANGLEBRACKET",lo="FULLWIDTHLEFTPAREN",co="FULLWIDTHRIGHTPAREN",uo="LEFTCORNERBRACKET",fo="RIGHTCORNERBRACKET",po="LEFTWHITECORNERBRACKET",mo="RIGHTWHITECORNERBRACKET",ho="FULLWIDTHLESSTHAN",bo="FULLWIDTHGREATERTHAN",go="AMPERSAND",vo="APOSTROPHE",xo="ASTERISK",Bn="AT",yo="BACKSLASH",ko="BACKTICK",wo="CARET",ui="COLON",xc="COMMA",_o="DOLLAR",Qt="DOT",So="EQUALS",yc="EXCLAMATION",Ft="HYPHEN",br="PERCENT",Co="PIPE",Eo="PLUS",Ao="POUND",gr="QUERY",kc="QUOTE",hm="FULLWIDTHMIDDLEDOT",wc="SEMI",Yt="SLASH",vr="TILDE",To="UNDERSCORE",bm="EMOJI",No="SYM";var gm=Object.freeze({__proto__:null,ALPHANUMERICAL:mm,AMPERSAND:go,APOSTROPHE:vo,ASCIINUMERICAL:pm,ASTERISK:xo,AT:Bn,BACKSLASH:yo,BACKTICK:ko,CARET:wo,CLOSEANGLEBRACKET:so,CLOSEBRACE:hr,CLOSEBRACKET:io,CLOSEPAREN:ao,COLON:ui,COMMA:xc,DOLLAR:_o,DOT:Qt,EMOJI:bm,EQUALS:So,EXCLAMATION:yc,FULLWIDTHGREATERTHAN:bo,FULLWIDTHLEFTPAREN:lo,FULLWIDTHLESSTHAN:ho,FULLWIDTHMIDDLEDOT:hm,FULLWIDTHRIGHTPAREN:co,HYPHEN:Ft,LEFTCORNERBRACKET:uo,LEFTWHITECORNERBRACKET:po,LOCALHOST:Tr,NL:vc,NUM:gc,OPENANGLEBRACKET:oo,OPENBRACE:mr,OPENBRACKET:no,OPENPAREN:ro,PERCENT:br,PIPE:Co,PLUS:Eo,POUND:Ao,QUERY:gr,QUOTE:kc,RIGHTCORNERBRACKET:fo,RIGHTWHITECORNERBRACKET:mo,SCHEME:Ra,SEMI:wc,SLASH:Yt,SLASH_SCHEME:zi,SYM:No,TILDE:vr,TLD:xl,UNDERSCORE:To,UTLD:yl,UWORD:vl,WORD:Sn,WS:kl});const wn=/[a-z]/,tr=new RegExp("\\p{L}","u"),Ss=new RegExp("\\p{Emoji}","u"),_n=/\d/,Cs=/\s/,td="\r",Es=`
608
+ `,l_="️",c_="‍",As="";let xa=null,ya=null;function u_(e=[]){const t={};Ct.groups=t;const n=new Ct;xa==null&&(xa=nd(n_)),ya==null&&(ya=nd(i_)),te(n,"'",vo),te(n,"{",mr),te(n,"}",hr),te(n,"[",no),te(n,"]",io),te(n,"(",ro),te(n,")",ao),te(n,"<",oo),te(n,">",so),te(n,"(",lo),te(n,")",co),te(n,"「",uo),te(n,"」",fo),te(n,"『",po),te(n,"』",mo),te(n,"<",ho),te(n,">",bo),te(n,"&",go),te(n,"*",xo),te(n,"@",Bn),te(n,"`",ko),te(n,"^",wo),te(n,":",ui),te(n,",",xc),te(n,"$",_o),te(n,".",Qt),te(n,"=",So),te(n,"!",yc),te(n,"-",Ft),te(n,"%",br),te(n,"|",Co),te(n,"+",Eo),te(n,"#",Ao),te(n,"?",gr),te(n,'"',kc),te(n,"/",Yt),te(n,";",wc),te(n,"~",vr),te(n,"_",To),te(n,"\\",yo),te(n,"・",hm);const i=We(n,_n,gc,{[ml]:!0});We(i,_n,i);const r=We(i,wn,pm,{[pr]:!0}),a=We(i,tr,mm,{[lr]:!0}),o=We(n,wn,Sn,{[hl]:!0});We(o,_n,r),We(o,wn,o),We(r,_n,r),We(r,wn,r);const l=We(n,tr,vl,{[bl]:!0});We(l,wn),We(l,_n,a),We(l,tr,l),We(a,_n,a),We(a,wn),We(a,tr,a);const c=te(n,Es,vc,{[_s]:!0}),u=te(n,td,kl,{[_s]:!0}),f=We(n,Cs,kl,{[_s]:!0});te(n,As,f),te(u,Es,c),te(u,As,f),We(u,Cs,f),te(f,td),te(f,Es),We(f,Cs,f),te(f,As,f);const m=We(n,Ss,bm,{[fm]:!0});te(m,"#"),We(m,Ss,m),te(m,l_,m);const p=te(m,c_);te(p,"#"),We(p,Ss,m);const h=[[wn,o],[_n,r]],g=[[wn,null],[tr,l],[_n,a]];for(let b=0;b<xa.length;b++)Rn(n,xa[b],xl,Sn,h);for(let b=0;b<ya.length;b++)Rn(n,ya[b],yl,vl,g);ci(xl,{tld:!0,ascii:!0},t),ci(yl,{utld:!0,alpha:!0},t),Rn(n,"file",Ra,Sn,h),Rn(n,"mailto",Ra,Sn,h),Rn(n,"http",zi,Sn,h),Rn(n,"https",zi,Sn,h),Rn(n,"ftp",zi,Sn,h),Rn(n,"ftps",zi,Sn,h),ci(Ra,{scheme:!0,ascii:!0},t),ci(zi,{slashscheme:!0,ascii:!0},t),e=e.sort((b,y)=>b[0]>y[0]?1:-1);for(let b=0;b<e.length;b++){const y=e[b][0],x=e[b][1]?{[r_]:!0}:{[a_]:!0};y.indexOf("-")>=0?x[gl]=!0:wn.test(y)?_n.test(y)?x[pr]=!0:x[hl]=!0:x[ml]=!0,ed(n,y,y,x)}return ed(n,"localhost",Tr,{ascii:!0}),n.jd=new Ct(No),{start:n,tokens:Object.assign({groups:t},gm)}}function vm(e,t){const n=d_(t.replace(/[A-Z]/g,l=>l.toLowerCase())),i=n.length,r=[];let a=0,o=0;for(;o<i;){let l=e,c=null,u=0,f=null,m=-1,p=-1;for(;o<i&&(c=l.go(n[o]));)l=c,l.accepts()?(m=0,p=0,f=l):m>=0&&(m+=n[o].length,p++),u+=n[o].length,a+=n[o].length,o++;a-=m,o-=p,u-=m,r.push({t:f.t,v:t.slice(a-u,a),s:a-u,e:a})}return r}function d_(e){const t=[],n=e.length;let i=0;for(;i<n;){let r=e.charCodeAt(i),a,o=r<55296||r>56319||i+1===n||(a=e.charCodeAt(i+1))<56320||a>57343?e[i]:e.slice(i,i+2);t.push(o),i+=o.length}return t}function Rn(e,t,n,i,r){let a;const o=t.length;for(let l=0;l<o-1;l++){const c=t[l];e.j[c]?a=e.j[c]:(a=new Ct(i),a.jr=r.slice(),e.j[c]=a),e=a}return a=new Ct(n),a.jr=r.slice(),e.j[t[o-1]]=a,a}function nd(e){const t=[],n=[];let i=0,r="0123456789";for(;i<e.length;){let a=0;for(;r.indexOf(e[i+a])>=0;)a++;if(a>0){t.push(n.join(""));for(let o=parseInt(e.substring(i,i+a),10);o>0;o--)n.pop();i+=a}else n.push(e[i]),i++}return t}const Nr={defaultProtocol:"http",events:null,format:id,formatHref:id,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _c(e,t=null){let n=Object.assign({},Nr);e&&(n=Object.assign(n,e instanceof _c?e.o:e));const i=n.ignoreTags,r=[];for(let a=0;a<i.length;a++)r.push(i[a].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=r}_c.prototype={o:Nr,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const i=t!=null;let r=this.o[e];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:Nr[e],typeof r=="function"&&i&&(r=r(t,n))):typeof r=="function"&&i&&(r=r(t,n.t,n)),r)},getObj(e,t,n){let i=this.o[e];return typeof i=="function"&&t!=null&&(i=i(t,n.t,n)),i},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function id(e){return e}function xm(e,t){this.t="token",this.v=e,this.tk=t}xm.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),i=e.get("format",t,this);return n&&i.length>n?i.substring(0,n)+"…":i},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Nr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),i=e.get("formatHref",n,this),r=e.get("tagName",n,t),a=this.toFormattedString(e),o={},l=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),f=e.getObj("attributes",n,t),m=e.getObj("events",n,t);return o.href=i,l&&(o.class=l),c&&(o.target=c),u&&(o.rel=u),f&&Object.assign(o,f),{tagName:r,attributes:o,content:a,eventListeners:m}}};function Ho(e,t){class n extends xm{constructor(r,a){super(r,a),this.t=e}}for(const i in t)n.prototype[i]=t[i];return n.t=e,n}const f_=Ho("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),rd=Ho("text"),p_=Ho("nl"),ka=Ho("url",{isLink:!0,toHref(e=Nr.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Tr&&e[1].t===ui}}),Pt=e=>new Ct(e);function m_({groups:e}){const t=e.domain.concat([go,xo,Bn,yo,ko,wo,_o,So,Ft,gc,br,Co,Eo,Ao,Yt,No,vr,To]),n=[vo,ui,xc,Qt,yc,br,gr,kc,wc,oo,so,mr,hr,io,no,ro,ao,lo,co,uo,fo,po,mo,ho,bo],i=[go,vo,xo,yo,ko,wo,_o,So,Ft,mr,hr,br,Co,Eo,Ao,gr,Yt,No,vr,To],r=Pt(),a=te(r,vr);we(a,i,a),we(a,e.domain,a);const o=Pt(),l=Pt(),c=Pt();we(r,e.domain,o),we(r,e.scheme,l),we(r,e.slashscheme,c),we(o,i,a),we(o,e.domain,o);const u=te(o,Bn);te(a,Bn,u),te(l,Bn,u),te(c,Bn,u);const f=te(a,Qt);we(f,i,a),we(f,e.domain,a);const m=Pt();we(u,e.domain,m),we(m,e.domain,m);const p=te(m,Qt);we(p,e.domain,m);const h=Pt(f_);we(p,e.tld,h),we(p,e.utld,h),te(u,Tr,h);const g=te(m,Ft);te(g,Ft,g),we(g,e.domain,m),we(h,e.domain,m),te(h,Qt,p),te(h,Ft,g);const b=te(o,Ft),y=te(o,Qt);te(b,Ft,b),we(b,e.domain,o),we(y,i,a),we(y,e.domain,o);const v=Pt(ka);we(y,e.tld,v),we(y,e.utld,v),we(v,e.domain,o),we(v,i,a),te(v,Qt,y),te(v,Ft,b),te(v,Bn,u);const x=te(v,ui),k=Pt(ka);we(x,e.numeric,k);const w=Pt(ka),S=Pt();we(w,t,w),we(w,n,S),we(S,t,w),we(S,n,S),te(v,Yt,w),te(k,Yt,w);const A=te(l,ui),I=te(c,ui),_=te(I,Yt),E=te(_,Yt);we(l,e.domain,o),te(l,Qt,y),te(l,Ft,b),we(c,e.domain,o),te(c,Qt,y),te(c,Ft,b),we(A,e.domain,w),te(A,Yt,w),te(A,gr,w),we(E,e.domain,w),we(E,t,w),te(E,Yt,w);const z=[[mr,hr],[no,io],[ro,ao],[oo,so],[lo,co],[uo,fo],[po,mo],[ho,bo]];for(let P=0;P<z.length;P++){const[U,V]=z[P],B=te(w,U);te(S,U,B);const j=Pt(ka);we(B,t,j);const $=Pt();we(B,n,$),te(B,V,w),we(j,t,j),we(j,n,$),we($,t,j),we($,n,$),te(j,V,w),te($,V,w)}return te(r,Tr,v),te(r,vc,p_),{start:r,tokens:gm}}function h_(e,t,n){let i=n.length,r=0,a=[],o=[];for(;r<i;){let l=e,c=null,u=null,f=0,m=null,p=-1;for(;r<i&&!(c=l.go(n[r].t));)o.push(n[r++]);for(;r<i&&(u=c||l.go(n[r].t));)c=null,l=u,l.accepts()?(p=0,m=l):p>=0&&p++,r++,f++;if(p<0)r-=f,r<i&&(o.push(n[r]),r++);else{o.length>0&&(a.push(Ts(rd,t,o)),o=[]),r-=p,f-=p;const h=m.t,g=n.slice(r-f,r);a.push(Ts(h,t,g))}}return o.length>0&&a.push(Ts(rd,t,o)),a}function Ts(e,t,n){const i=n[0].s,r=n[n.length-1].e,a=t.slice(i,r);return new e(a,n)}const b_=typeof console<"u"&&console&&console.warn||(()=>{}),g_="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ue={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function v_(){return Ct.groups={},Ue.scanner=null,Ue.parser=null,Ue.tokenQueue=[],Ue.pluginQueue=[],Ue.customSchemes=[],Ue.initialized=!1,Ue}function ad(e,t=!1){if(Ue.initialized&&b_(`linkifyjs: already initialized - will not register custom scheme "${e}" ${g_}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
609
609
  1. Must only contain digits, lowercase ASCII letters or "-"
610
610
  2. Cannot start or end with "-"
611
- 3. "-" cannot repeat`);Ue.customSchemes.push([e,t])}function v_(){Ue.scanner=c_(Ue.customSchemes);for(let e=0;e<Ue.tokenQueue.length;e++)Ue.tokenQueue[e][1]({scanner:Ue.scanner});Ue.parser=p_(Ue.scanner.tokens);for(let e=0;e<Ue.pluginQueue.length;e++)Ue.pluginQueue[e][1]({scanner:Ue.scanner,parser:Ue.parser});return Ue.initialized=!0,Ue}function Sc(e){return Ue.initialized||v_(),m_(Ue.parser.start,e,vm(Ue.scanner.start,e))}Sc.scan=vm;function ym(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const i=new _c(n),r=Sc(e),a=[];for(let o=0;o<r.length;o++){const l=r[o];l.isLink&&(!t||l.t===t)&&i.check(l)&&a.push(l.toFormattedObject(i))}return a}const Cc="[\0-   ᠎ -\u2029  ]",x_=new RegExp(Cc),y_=new RegExp(`${Cc}$`),k_=new RegExp(Cc,"g");function w_(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function __(e){return new ct({key:new rt("autolink"),appendTransaction:(t,n,i)=>{const r=t.some(u=>u.docChanged)&&!n.doc.eq(i.doc),a=t.some(u=>u.getMeta("preventAutolink"));if(!r||a)return;const{tr:o}=i,l=uw(n.doc,[...t]);if(gw(l).forEach(({newRange:u})=>{const f=fw(i.doc,u,h=>h.isTextblock);let m,p;if(f.length>1)m=f[0],p=i.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(f.length){const h=i.doc.textBetween(u.from,u.to," "," ");if(!y_.test(h))return;m=f[0],p=i.doc.textBetween(m.pos,u.to,void 0," ")}if(m&&p){const h=p.split(x_).filter(Boolean);if(h.length<=0)return!1;const g=h[h.length-1],b=m.pos+p.lastIndexOf(g);if(!g)return!1;const y=Sc(g).map(v=>v.toObject(e.defaultProtocol));if(!w_(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:b+v.start+1,to:b+v.end+1})).filter(v=>i.schema.marks.code?!i.doc.rangeHasMark(v.from,v.to,i.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{hc(v.from,v.to,i.doc).some(x=>x.mark.type===e.type)||o.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function S_(e){return new ct({key:new rt("handleClickLink"),props:{handleClick:(t,n,i)=>{var r,a;if(i.button!==0||!t.editable)return!1;let o=i.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;const c=mw(t.state,e.type.name),u=i.target,f=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:c.href,m=(a=u==null?void 0:u.target)!==null&&a!==void 0?a:c.target;return u&&f?(window.open(f,m),!0):!1}}})}function C_(e){return new ct({key:new rt("handlePasteLink"),props:{handlePaste:(t,n,i)=>{const{state:r}=t,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";i.content.forEach(u=>{l+=u.textContent});const c=ym(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function ri(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!e||e.replace(k_,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const E_=Et.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){ad(e);return}ad(e.scheme,e.optionalSlashes)})},onDestroy(){g_()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ri(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ri(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ri(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Fe(this.options.HTMLAttributes,e),0]:["a",Fe(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!ri(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!ri(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[dm({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:i}=this.options,r=ym(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!ri(o,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(a=>t.push({text:a.value,data:{href:a.href},index:a.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(__({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!ri(r,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(S_({type:this.type})),this.options.linkOnPaste&&e.push(C_({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),A_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,T_=Ae.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Fe(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Kw({find:A_,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});let wl,_l;if(typeof WeakMap<"u"){let e=new WeakMap;wl=t=>e.get(t),_l=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;wl=i=>{for(let r=0;r<e.length;r+=2)if(e[r]==i)return e[r+1]},_l=(i,r)=>(n==10&&(n=0),e[n++]=i,e[n++]=r)}var Ge=class{constructor(e,t,n,i){this.width=e,this.height=t,this.map=n,this.problems=i}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const i=t%this.width,r=t/this.width|0;let a=i+1,o=r+1;for(let l=1;a<this.width&&this.map[t+l]==n;l++)a++;for(let l=1;o<this.height&&this.map[t+this.width*l]==n;l++)o++;return{left:i,top:r,right:a,bottom:o}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:i,right:r,top:a,bottom:o}=this.findCell(e);return t=="horiz"?(n<0?i==0:r==this.width)?null:this.map[a*this.width+(n<0?i-1:r)]:(n<0?a==0:o==this.height)?null:this.map[i+this.width*(n<0?a-1:o)]}rectBetween(e,t){const{left:n,right:i,top:r,bottom:a}=this.findCell(e),{left:o,right:l,top:c,bottom:u}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(i,l),bottom:Math.max(a,u)}}cellsInRect(e){const t=[],n={};for(let i=e.top;i<e.bottom;i++)for(let r=e.left;r<e.right;r++){const a=i*this.width+r,o=this.map[a];n[o]||(n[o]=!0,!(r==e.left&&r&&this.map[a-1]==o||i==e.top&&i&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let i=0,r=0;;i++){const a=r+n.child(i).nodeSize;if(i==e){let o=t+e*this.width;const l=(e+1)*this.width;for(;o<l&&this.map[o]<r;)o++;return o==l?a-1:this.map[o]}r=a}}static get(e){return wl(e)||_l(e,N_(e))}};function N_(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=O_(e),n=e.childCount,i=[];let r=0,a=null;const o=[];for(let u=0,f=t*n;u<f;u++)i[u]=0;for(let u=0,f=0;u<n;u++){const m=e.child(u);f++;for(let g=0;;g++){for(;r<i.length&&i[r]!=0;)r++;if(g==m.childCount)break;const b=m.child(g),{colspan:y,rowspan:v,colwidth:x}=b.attrs;for(let k=0;k<v;k++){if(k+u>=n){(a||(a=[])).push({type:"overlong_rowspan",pos:f,n:v-k});break}const w=r+k*t;for(let S=0;S<y;S++){i[w+S]==0?i[w+S]=f:(a||(a=[])).push({type:"collision",row:u,pos:f,n:y-S});const A=x&&x[S];if(A){const I=(w+S)%t*2,_=o[I];_==null||_!=A&&o[I+1]==1?(o[I]=A,o[I+1]=1):_==A&&o[I+1]++}}}r+=y,f+=b.nodeSize}const p=(u+1)*t;let h=0;for(;r<p;)i[r++]==0&&h++;h&&(a||(a=[])).push({type:"missing",row:u,n:h}),f++}(t===0||n===0)&&(a||(a=[])).push({type:"zero_sized"});const l=new Ge(t,n,i,a);let c=!1;for(let u=0;!c&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(c=!0);return c&&M_(l,o,e),l}function O_(e){let t=-1,n=!1;for(let i=0;i<e.childCount;i++){const r=e.child(i);let a=0;if(n)for(let o=0;o<i;o++){const l=e.child(o);for(let c=0;c<l.childCount;c++){const u=l.child(c);o+u.attrs.rowspan>i&&(a+=u.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const l=r.child(o);a+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function M_(e,t,n){e.problems||(e.problems=[]);const i={};for(let r=0;r<e.map.length;r++){const a=e.map[r];if(i[a])continue;i[a]=!0;const o=n.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let l=null;const c=o.attrs;for(let u=0;u<c.colspan;u++){const f=t[(r+u)%e.width*2];f!=null&&(!c.colwidth||c.colwidth[u]!=f)&&((l||(l=D_(c)))[u]=f)}l&&e.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:l})}}function D_(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function mt(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const i=e.nodes[n],r=i.spec.tableRole;r&&(t[r]=i)}}return t}const Fn=new rt("selectingCells");function vi(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function z_(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function Kt(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function qo(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=vi(t.$head)||I_(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function I_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Sl(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function R_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ec(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function km(e,t,n){const i=e.node(-1),r=Ge.get(i),a=e.start(-1),o=r.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function xi(e,t,n=1){const i={...e,colspan:e.colspan-n};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(t,n),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function wm(e,t,n=1){const i={...e,colspan:e.colspan+n};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<n;r++)i.colwidth.splice(t,0,0)}return i}function L_(e,t,n){const i=mt(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=i)return!1;return!0}var Pe=class Cn extends ke{constructor(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=r.cellsInRect(o).filter(f=>f!=n.pos-a);c.unshift(n.pos-a);const u=c.map(f=>{const m=i.nodeAt(f);if(!m)throw new RangeError(`No cell with offset ${f} found`);const p=a+f+1;return new mp(l.resolve(p),l.resolve(p+m.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){const i=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(Sl(i)&&Sl(r)&&Ec(i,r)){const a=this.$anchorCell.node(-1)!=i.node(-1);return a&&this.isRowSelection()?Cn.rowSelection(i,r):a&&this.isColSelection()?Cn.colSelection(i,r):new Cn(i,r)}return ge.between(i,r)}content(){const t=this.$anchorCell.node(-1),n=Ge.get(t),i=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),a={},o=[];for(let c=r.top;c<r.bottom;c++){const u=[];for(let f=c*n.width+r.left,m=r.left;m<r.right;m++,f++){const p=n.map[f];if(a[p])continue;a[p]=!0;const h=n.findCell(p);let g=t.nodeAt(p);if(!g)throw new RangeError(`No cell with offset ${p} found`);const b=r.left-h.left,y=h.right-r.right;if(b>0||y>0){let v=g.attrs;if(b>0&&(v=xi(v,0,b)),y>0&&(v=xi(v,v.colspan-y,y)),h.left<r.left){if(g=g.type.createAndFill(v),!g)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else g=g.type.create(v,g.content)}if(h.top<r.top||h.bottom>r.bottom){const v={...g.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?g=g.type.createAndFill(v):g=g.type.create(v,g.content)}u.push(g)}o.push(t.child(c).copy(J.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?t:o;return new ae(J.from(l),1,1)}replace(t,n=ae.empty){const i=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:l,$to:c}=r[o],u=t.mapping.slice(i);t.replace(u.map(l.pos),u.map(c.pos),o?ae.empty:n)}const a=ke.findFrom(t.doc.resolve(t.mapping.slice(i).map(this.to)),-1);a&&t.setSelection(a)}replaceWith(t,n){this.replace(t,new ae(J.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),i=Ge.get(n),r=this.$anchorCell.start(-1),a=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<a.length;o++)t(n.nodeAt(a[o]),r+a[o])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const i=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.top<=l.top?(o.top>0&&(t=c.resolve(a+r.map[o.left])),l.bottom<r.height&&(n=c.resolve(a+r.map[r.width*(r.height-1)+l.right-1]))):(l.top>0&&(n=c.resolve(a+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(a+r.map[r.width*(r.height-1)+o.right-1]))),new Cn(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=Ge.get(t),i=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-i),a=n.colCount(this.$headCell.pos-i);if(Math.min(r,a)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,l=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(t){return t instanceof Cn&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.left<=l.left?(o.left>0&&(t=c.resolve(a+r.map[o.top*r.width])),l.right<r.width&&(n=c.resolve(a+r.map[r.width*(l.top+1)-1]))):(l.left>0&&(n=c.resolve(a+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(a+r.map[r.width*(o.top+1)-1]))),new Cn(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Cn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){return new Cn(t.resolve(n),t.resolve(i))}getBookmark(){return new B_(this.$anchorCell.pos,this.$headCell.pos)}};Pe.prototype.visible=!1;ke.jsonID("cell",Pe);var B_=class _m{constructor(t,n){this.anchor=t,this.head=n}map(t){return new _m(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),i=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&Ec(n,i)?new Pe(n,i):ke.near(i,1)}};function P_(e){if(!(e.selection instanceof Pe))return null;const t=[];return e.selection.forEachCell((n,i)=>{t.push(ft.node(i,i+n.nodeSize,{class:"selectedCell"}))}),je.create(e.doc,t)}function F_({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,i=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let a=t.depth;a>=0&&!(t.before(a+1)>t.start(a));a--,i--);return n==i&&/row|table/.test(e.node(r).type.spec.tableRole)}function V_({$from:e,$to:t}){let n,i;for(let r=e.depth;r>0;r--){const a=e.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}for(let r=t.depth;r>0;r--){const a=t.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){i=a;break}}return n!==i&&t.parentOffset===0}function U_(e,t,n){const i=(t||e).selection,r=(t||e).doc;let a,o;if(i instanceof be&&(o=i.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=Pe.create(r,i.from);else if(o=="row"){const l=r.resolve(i.from+1);a=Pe.rowSelection(l,l)}else if(!n){const l=Ge.get(i.node),c=i.from+1,u=c+l.map[l.width*l.height-1];a=Pe.create(r,c+1,u)}}else i instanceof ge&&F_(i)?a=ge.create(r,i.from):i instanceof ge&&V_(i)&&(a=ge.create(r,i.$from.start(),i.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}const H_=new rt("fix-tables");function Sm(e,t,n,i){const r=e.childCount,a=t.childCount;e:for(let o=0,l=0;o<a;o++){const c=t.child(o);for(let u=l,f=Math.min(r,o+3);u<f;u++)if(e.child(u)==c){l=u+1,n+=c.nodeSize;continue e}i(c,n),l<r&&e.child(l).sameMarkup(c)?Sm(e.child(l),c,n+1,i):c.nodesBetween(0,c.content.size,i,n+1),n+=c.nodeSize}}function Cm(e,t){let n;const i=(r,a)=>{r.type.spec.tableRole=="table"&&(n=q_(e,r,a,n))};return t?t.doc!=e.doc&&Sm(t.doc,e.doc,0,i):e.doc.descendants(i),n}function q_(e,t,n,i){const r=Ge.get(t);if(!r.problems)return i;i||(i=e.tr);const a=[];for(let c=0;c<r.height;c++)a.push(0);for(let c=0;c<r.problems.length;c++){const u=r.problems[c];if(u.type=="collision"){const f=t.nodeAt(u.pos);if(!f)continue;const m=f.attrs;for(let p=0;p<m.rowspan;p++)a[u.row+p]+=u.n;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,xi(m,m.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const f=i.mapping.map(n);i.delete(f,f+t.nodeSize)}}let o,l;for(let c=0;c<a.length;c++)a[c]&&(o==null&&(o=c),l=c);for(let c=0,u=n+1;c<r.height;c++){const f=t.child(c),m=u+f.nodeSize,p=a[c];if(p>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);const g=[];for(let y=0;y<p;y++){const v=mt(e.schema)[h].createAndFill();v&&g.push(v)}const b=(c==0||o==c-1)&&l==c?u+1:m-1;i.insert(i.mapping.map(b),g)}u=m}return i.setMeta(H_,{fixTables:!0})}function on(e){const t=e.selection,n=qo(e),i=n.node(-1),r=n.start(-1),a=Ge.get(i);return{...t instanceof Pe?a.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):a.findCell(n.pos-r),tableStart:r,map:a,table:i}}function Em(e,{map:t,tableStart:n,table:i},r){let a=r>0?-1:0;L_(t,i,r+a)&&(a=r==0||r==t.width?null:0);for(let o=0;o<t.height;o++){const l=o*t.width+r;if(r>0&&r<t.width&&t.map[l-1]==t.map[l]){const c=t.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(n+c),null,wm(u.attrs,r-t.colCount(c))),o+=u.attrs.rowspan-1}else{const c=a==null?mt(i.type.schema).cell:i.nodeAt(t.map[l+a]).type,u=t.positionAt(o,r,i);e.insert(e.mapping.map(n+u),c.createAndFill())}}return e}function j_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Em(e.tr,n,n.left))}return!0}function $_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Em(e.tr,n,n.right))}return!0}function W_(e,{map:t,table:n,tableStart:i},r){const a=e.mapping.maps.length;for(let o=0;o<t.height;){const l=o*t.width+r,c=t.map[l],u=n.nodeAt(c),f=u.attrs;if(r>0&&t.map[l-1]==c||r<t.width-1&&t.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,xi(f,r-t.colCount(c)));else{const m=e.mapping.slice(a).map(i+c);e.delete(m,m+u.nodeSize)}o+=f.rowspan}}function G_(e,t){if(!Kt(e))return!1;if(t){const n=on(e),i=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;W_(i,n,r),r!=n.left;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=Ge.get(a)}t(i)}return!0}function K_(e,t,n){var i;const r=mt(t.type.schema).header_cell;for(let a=0;a<e.width;a++)if(((i=t.nodeAt(e.map[a+n*e.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function Am(e,{map:t,tableStart:n,table:i},r){let a=n;for(let u=0;u<r;u++)a+=i.child(u).nodeSize;const o=[];let l=r>0?-1:0;K_(t,i,r+l)&&(l=r==0||r==t.height?null:0);for(let u=0,f=t.width*r;u<t.width;u++,f++)if(r>0&&r<t.height&&t.map[f]==t.map[f-t.width]){const m=t.map[f],p=i.nodeAt(m).attrs;e.setNodeMarkup(n+m,null,{...p,rowspan:p.rowspan+1}),u+=p.colspan-1}else{var c;const m=l==null?mt(i.type.schema).cell:(c=i.nodeAt(t.map[f+l*t.width]))===null||c===void 0?void 0:c.type,p=m==null?void 0:m.createAndFill();p&&o.push(p)}return e.insert(a,mt(i.type.schema).row.create(null,o)),e}function X_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Am(e.tr,n,n.top))}return!0}function J_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Am(e.tr,n,n.bottom))}return!0}function Z_(e,{map:t,table:n,tableStart:i},r){let a=0;for(let u=0;u<r;u++)a+=n.child(u).nodeSize;const o=a+n.child(r).nodeSize,l=e.mapping.maps.length;e.delete(a+i,o+i);const c=new Set;for(let u=0,f=r*t.width;u<t.width;u++,f++){const m=t.map[f];if(!c.has(m)){if(c.add(m),r>0&&m==t.map[f-t.width]){const p=n.nodeAt(m).attrs;e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p,rowspan:p.rowspan-1}),u+=p.colspan-1}else if(r<t.height&&m==t.map[f+t.width]){const p=n.nodeAt(m),h=p.attrs,g=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),b=t.positionAt(r+1,u,n);e.insert(e.mapping.slice(l).map(i+b),g),u+=h.colspan-1}}}}function Q_(e,t){if(!Kt(e))return!1;if(t){const n=on(e),i=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;Z_(i,n,r),r!=n.top;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=Ge.get(n.table)}t(i)}return!0}function od(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Y_({width:e,height:t,map:n},i){let r=i.top*e+i.left,a=r,o=(i.bottom-1)*e+i.left,l=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&n[a]==n[a-1]||i.right<e&&n[l]==n[l+1])return!0;a+=e,l+=e}for(let c=i.left;c<i.right;c++){if(i.top>0&&n[r]==n[r-e]||i.bottom<t&&n[o]==n[o+e])return!0;r++,o++}return!1}function sd(e,t){const n=e.selection;if(!(n instanceof Pe)||n.$anchorCell.pos==n.$headCell.pos)return!1;const i=on(e),{map:r}=i;if(Y_(r,i))return!1;if(t){const a=e.tr,o={};let l=J.empty,c,u;for(let f=i.top;f<i.bottom;f++)for(let m=i.left;m<i.right;m++){const p=r.map[f*r.width+m],h=i.table.nodeAt(p);if(!(o[p]||!h))if(o[p]=!0,c==null)c=p,u=h;else{od(h)||(l=l.append(h.content));const g=a.mapping.map(p+i.tableStart);a.delete(g,g+h.nodeSize)}}if(c==null||u==null)return!0;if(a.setNodeMarkup(c+i.tableStart,null,{...wm(u.attrs,u.attrs.colspan,i.right-i.left-u.attrs.colspan),rowspan:i.bottom-i.top}),l.size>0){const f=c+1+u.content.size,m=od(u)?c+1:f;a.replaceWith(m+i.tableStart,f+i.tableStart,l)}a.setSelection(new Pe(a.doc.resolve(c+i.tableStart))),t(a)}return!0}function ld(e,t){const n=mt(e.schema);return e3(({node:i})=>n[i.type.spec.tableRole])(e,t)}function e3(e){return(t,n)=>{const i=t.selection;let r,a;if(i instanceof Pe){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{var o;if(r=z_(i.$from),!r)return!1;a=(o=vi(i.$from))===null||o===void 0?void 0:o.pos}if(r==null||a==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(n){let l=r.attrs;const c=[],u=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=on(t),m=t.tr;for(let h=0;h<f.right-f.left;h++)c.push(u?{...l,colwidth:u&&u[h]?[u[h]]:null}:l);let p;for(let h=f.top;h<f.bottom;h++){let g=f.map.positionAt(h,f.left,f.table);h==f.top&&(g+=r.nodeSize);for(let b=f.left,y=0;b<f.right;b++,y++)b==f.left&&h==f.top||m.insert(p=m.mapping.map(g+f.tableStart,1),e({node:r,row:h,col:b}).createAndFill(c[y]))}m.setNodeMarkup(a,e({node:r,row:f.top,col:f.left}),c[0]),i instanceof Pe&&m.setSelection(new Pe(m.doc.resolve(i.$anchorCell.pos),p?m.doc.resolve(p):void 0)),n(m)}return!0}}function t3(e,t){return function(n,i){if(!Kt(n))return!1;const r=qo(n);if(r.nodeAfter.attrs[e]===t)return!1;if(i){const a=n.tr;n.selection instanceof Pe?n.selection.forEachCell((o,l)=>{o.attrs[e]!==t&&a.setNodeMarkup(l,null,{...o.attrs,[e]:t})}):a.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),i(a)}return!0}}function n3(e){return function(t,n){if(!Kt(t))return!1;if(n){const i=mt(t.schema),r=on(t),a=t.tr,o=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),l=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)l[c].type==i.header_cell&&a.setNodeMarkup(r.tableStart+o[c],i.cell,l[c].attrs);if(a.steps.length===0)for(let c=0;c<o.length;c++)a.setNodeMarkup(r.tableStart+o[c],i.header_cell,l[c].attrs);n(a)}return!0}}function cd(e,t,n){const i=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<i.length;r++){const a=t.table.nodeAt(i[r]);if(a&&a.type!==n.header_cell)return!1}return!0}function Or(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?n3(e):function(n,i){if(!Kt(n))return!1;if(i){const r=mt(n.schema),a=on(n),o=n.tr,l=cd("row",a,r),c=cd("column",a,r),u=(e==="column"?l:e==="row"&&c)?1:0,f=e=="column"?{left:0,top:u,right:1,bottom:a.map.height}:e=="row"?{left:u,top:0,right:a.map.width,bottom:1}:a,m=e=="column"?c?r.cell:r.header_cell:e=="row"?l?r.cell:r.header_cell:r.cell;a.map.cellsInRect(f).forEach(p=>{const h=p+a.tableStart,g=o.doc.nodeAt(h);g&&o.setNodeMarkup(h,m,g.attrs)}),i(o)}return!0}}Or("row",{useDeprecatedLogic:!0});Or("column",{useDeprecatedLogic:!0});const i3=Or("cell",{useDeprecatedLogic:!0});function r3(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let i=e.index(-1)-1,r=e.before();i>=0;i--){const a=e.node(-1).child(i),o=a.lastChild;if(o)return r-1-o.nodeSize;r-=a.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let i=e.indexAfter(-1),r=e.after();i<n.childCount;i++){const a=n.child(i);if(a.childCount)return r+1;r+=a.nodeSize}}return null}function ud(e){return function(t,n){if(!Kt(t))return!1;const i=r3(qo(t),e);if(i==null)return!1;if(n){const r=t.doc.resolve(i);n(t.tr.setSelection(ge.between(r,R_(r))).scrollIntoView())}return!0}}function a3(e,t){const n=e.selection.$anchor;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(i),n.after(i)).scrollIntoView()),!0;return!1}function wa(e,t){const n=e.selection;if(!(n instanceof Pe))return!1;if(t){const i=e.tr,r=mt(e.schema).cell.createAndFill().content;n.forEachCell((a,o)=>{a.content.eq(r)||i.replace(i.mapping.map(o+1),i.mapping.map(o+a.nodeSize-1),new ae(r,0,0))}),i.docChanged&&t(i)}return!0}function o3(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:i}=e;for(;t.childCount==1&&(n>0&&i>0||t.child(0).type.spec.tableRole=="table");)n--,i--,t=t.child(0).content;const r=t.child(0),a=r.type.spec.tableRole,o=r.type.schema,l=[];if(a=="row")for(let c=0;c<t.childCount;c++){let u=t.child(c).content;const f=c?0:Math.max(0,n-1),m=c<t.childCount-1?0:Math.max(0,i-1);(f||m)&&(u=Cl(mt(o).row,new ae(u,f,m)).content),l.push(u)}else if(a=="cell"||a=="header_cell")l.push(n||i?Cl(mt(o).row,new ae(t,n,i)).content:t);else return null;return s3(o,l)}function s3(e,t){const n=[];for(let r=0;r<t.length;r++){const a=t[r];for(let o=a.childCount-1;o>=0;o--){const{rowspan:l,colspan:c}=a.child(o).attrs;for(let u=r;u<r+l;u++)n[u]=(n[u]||0)+c}}let i=0;for(let r=0;r<n.length;r++)i=Math.max(i,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(J.empty),n[r]<i){const a=mt(e).cell.createAndFill(),o=[];for(let l=n[r];l<i;l++)o.push(a);t[r]=t[r].append(J.from(o))}return{height:t.length,width:i,rows:t}}function Cl(e,t){const n=e.createAndFill();return new pp(n).replace(0,n.content.size,t).doc}function l3({width:e,height:t,rows:n},i,r){if(e!=i){const a=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],u=[];for(let f=a[l]||0,m=0;f<i;m++){let p=c.child(m%c.childCount);f+p.attrs.colspan>i&&(p=p.type.createChecked(xi(p.attrs,p.attrs.colspan,f+p.attrs.colspan-i),p.content)),u.push(p),f+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)a[l+h]=(a[l+h]||0)+p.attrs.colspan}o.push(J.from(u))}n=o,e=i}if(t!=r){const a=[];for(let o=0,l=0;o<r;o++,l++){const c=[],u=n[l%t];for(let f=0;f<u.childCount;f++){let m=u.child(f);o+m.attrs.rowspan>r&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,r-m.attrs.rowspan)},m.content)),c.push(m)}a.push(J.from(c))}n=a,t=r}return{width:e,height:t,rows:n}}function c3(e,t,n,i,r,a,o){const l=e.doc.type.schema,c=mt(l);let u,f;if(r>t.width)for(let m=0,p=0;m<t.height;m++){const h=n.child(m);p+=h.nodeSize;const g=[];let b;h.lastChild==null||h.lastChild.type==c.cell?b=u||(u=c.cell.createAndFill()):b=f||(f=c.header_cell.createAndFill());for(let y=t.width;y<r;y++)g.push(b);e.insert(e.mapping.slice(o).map(p-1+i),g)}if(a>t.height){const m=[];for(let g=0,b=(t.height-1)*t.width;g<Math.max(t.width,r);g++){const y=g>=t.width?!1:n.nodeAt(t.map[b+g]).type==c.header_cell;m.push(y?f||(f=c.header_cell.createAndFill()):u||(u=c.cell.createAndFill()))}const p=c.row.create(null,J.from(m)),h=[];for(let g=t.height;g<a;g++)h.push(p);e.insert(e.mapping.slice(o).map(i+n.nodeSize-2),h)}return!!(u||f)}function dd(e,t,n,i,r,a,o,l){if(o==0||o==t.height)return!1;let c=!1;for(let u=r;u<a;u++){const f=o*t.width+u,m=t.map[f];if(t.map[f-t.width]==m){c=!0;const p=n.nodeAt(m),{top:h,left:g}=t.findCell(m);e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p.attrs,rowspan:o-h}),e.insert(e.mapping.slice(l).map(t.positionAt(o,g,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-o})),u+=p.attrs.colspan-1}}return c}function fd(e,t,n,i,r,a,o,l){if(o==0||o==t.width)return!1;let c=!1;for(let u=r;u<a;u++){const f=u*t.width+o,m=t.map[f];if(t.map[f-1]==m){c=!0;const p=n.nodeAt(m),h=t.colCount(m),g=e.mapping.slice(l).map(m+i);e.setNodeMarkup(g,null,xi(p.attrs,o-h,p.attrs.colspan-(o-h))),e.insert(g+p.nodeSize,p.type.createAndFill(xi(p.attrs,0,o-h))),u+=p.attrs.rowspan-1}}return c}function pd(e,t,n,i,r){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw new Error("No table found");let o=Ge.get(a);const{top:l,left:c}=i,u=c+r.width,f=l+r.height,m=e.tr;let p=0;function h(){if(a=n?m.doc.nodeAt(n-1):m.doc,!a)throw new Error("No table found");o=Ge.get(a),p=m.mapping.maps.length}c3(m,o,a,n,u,f,p)&&h(),dd(m,o,a,n,c,u,l,p)&&h(),dd(m,o,a,n,c,u,f,p)&&h(),fd(m,o,a,n,l,f,c,p)&&h(),fd(m,o,a,n,l,f,u,p)&&h();for(let g=l;g<f;g++){const b=o.positionAt(g,c,a),y=o.positionAt(g,u,a);m.replace(m.mapping.slice(p).map(b+n),m.mapping.slice(p).map(y+n),new ae(r.rows[g-l],0,0))}h(),m.setSelection(new Pe(m.doc.resolve(n+o.positionAt(l,c,a)),m.doc.resolve(n+o.positionAt(f-1,u-1,a)))),t(m)}const u3=Hk({ArrowLeft:_a("horiz",-1),ArrowRight:_a("horiz",1),ArrowUp:_a("vert",-1),ArrowDown:_a("vert",1),"Shift-ArrowLeft":Sa("horiz",-1),"Shift-ArrowRight":Sa("horiz",1),"Shift-ArrowUp":Sa("vert",-1),"Shift-ArrowDown":Sa("vert",1),Backspace:wa,"Mod-Backspace":wa,Delete:wa,"Mod-Delete":wa});function La(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function _a(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;if(a instanceof Pe)return La(n,i,ke.near(a.$headCell,t));if(e!="horiz"&&!a.empty)return!1;const o=Tm(r,e,t);if(o==null)return!1;if(e=="horiz")return La(n,i,ke.near(n.doc.resolve(a.head+t),t));{const l=n.doc.resolve(o),c=km(l,e,t);let u;return c?u=ke.near(c,1):t<0?u=ke.near(n.doc.resolve(l.before(-1)),-1):u=ke.near(n.doc.resolve(l.after(-1)),1),La(n,i,u)}}}function Sa(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;let o;if(a instanceof Pe)o=a;else{const c=Tm(r,e,t);if(c==null)return!1;o=new Pe(n.doc.resolve(c))}const l=km(o.$headCell,e,t);return l?La(n,i,new Pe(o.$anchorCell,l)):!1}}function d3(e,t){const n=e.state.doc,i=vi(n.resolve(t));return i?(e.dispatch(e.state.tr.setSelection(new Pe(i))),!0):!1}function f3(e,t,n){if(!Kt(e.state))return!1;let i=o3(n);const r=e.state.selection;if(r instanceof Pe){i||(i={width:1,height:1,rows:[J.from(Cl(mt(e.state.schema).cell,n))]});const a=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),l=Ge.get(a).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return i=l3(i,l.right-l.left,l.bottom-l.top),pd(e.state,e.dispatch,o,l,i),!0}else if(i){const a=qo(e.state),o=a.start(-1);return pd(e.state,e.dispatch,o,Ge.get(a.node(-1)).findCell(a.pos-o),i),!0}else return!1}function p3(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const i=md(e,t.target);let r;if(t.shiftKey&&e.state.selection instanceof Pe)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&(r=vi(e.state.selection.$anchor))!=null&&((n=Ns(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)a(r,t),t.preventDefault();else if(!i)return;function a(c,u){let f=Ns(e,u);const m=Fn.getState(e.state)==null;if(!f||!Ec(c,f))if(m)f=c;else return;const p=new Pe(c,f);if(m||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);m&&h.setMeta(Fn,c.pos),e.dispatch(h)}}function o(){e.root.removeEventListener("mouseup",o),e.root.removeEventListener("dragstart",o),e.root.removeEventListener("mousemove",l),Fn.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Fn,-1))}function l(c){const u=c,f=Fn.getState(e.state);let m;if(f!=null)m=e.state.doc.resolve(f);else if(md(e,u.target)!=i&&(m=Ns(e,t),!m))return o();m&&a(m,u)}e.root.addEventListener("mouseup",o),e.root.addEventListener("dragstart",o),e.root.addEventListener("mousemove",l)}function Tm(e,t,n){if(!(e.state.selection instanceof ge))return null;const{$head:i}=e.state.selection;for(let r=i.depth-1;r>=0;r--){const a=i.node(r);if((n<0?i.index(r):i.indexAfter(r))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const o=i.before(r),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?o:null}}return null}function md(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Ns(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:i,pos:r}=n;return i>=0&&vi(e.state.doc.resolve(i))||vi(e.state.doc.resolve(r))}var m3=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),El(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,El(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function El(e,t,n,i,r,a){let o=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let m=0,p=0;m<u.childCount;m++){const{colspan:h,colwidth:g}=u.child(m).attrs;for(let b=0;b<h;b++,p++){const y=r==p?a:g&&g[b],v=y?y+"px":"";if(o+=y||i,y||(l=!1),c)c.style.width!=v&&(c.style.width=v),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=v,t.appendChild(x)}}}for(;c;){var f;const m=c.nextSibling;(f=c.parentNode)===null||f===void 0||f.removeChild(c),c=m}l?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const zt=new rt("tableColumnResizing");function h3({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:i=m3,lastColumnResizable:r=!0}={}){const a=new ct({key:zt,state:{init(o,l){var c;const u=(c=a.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,f=mt(l.schema).table.name;return i&&u&&(u[f]=(m,p)=>new i(m,n,p)),new b3(-1,!1)},apply(o,l){return l.apply(o)}},props:{attributes:o=>{const l=zt.getState(o);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,l)=>{g3(o,l,e,r)},mouseleave:o=>{v3(o)},mousedown:(o,l)=>{x3(o,l,t,n)}},decorations:o=>{const l=zt.getState(o);if(l&&l.activeHandle>-1)return S3(o,l.activeHandle)},nodeViews:{}}});return a}var b3=class Ba{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,i=t.getMeta(zt);if(i&&i.setHandle!=null)return new Ba(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new Ba(n.activeHandle,i.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Sl(t.doc.resolve(r))||(r=-1),new Ba(r,n.dragging)}return n}};function g3(e,t,n,i){if(!e.editable)return;const r=zt.getState(e.state);if(r&&!r.dragging){const a=k3(t.target);let o=-1;if(a){const{left:l,right:c}=a.getBoundingClientRect();t.clientX-l<=n?o=hd(e,t,"left",n):c-t.clientX<=n&&(o=hd(e,t,"right",n))}if(o!=r.activeHandle){if(!i&&o!==-1){const l=e.state.doc.resolve(o),c=l.node(-1),u=Ge.get(c),f=l.start(-1);if(u.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==u.width-1)return}Nm(e,o)}}}function v3(e){if(!e.editable)return;const t=zt.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Nm(e,-1)}function x3(e,t,n,i){var r;if(!e.editable)return!1;const a=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,o=zt.getState(e.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const l=e.state.doc.nodeAt(o.activeHandle),c=y3(e,o.activeHandle,l.attrs);e.dispatch(e.state.tr.setMeta(zt,{setDragging:{startX:t.clientX,startWidth:c}}));function u(m){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",f);const p=zt.getState(e.state);p!=null&&p.dragging&&(w3(e,p.activeHandle,bd(p.dragging,m,n)),e.dispatch(e.state.tr.setMeta(zt,{setDragging:null})))}function f(m){if(!m.which)return u(m);const p=zt.getState(e.state);if(p&&p.dragging){const h=bd(p.dragging,m,n);gd(e,p.activeHandle,h,i)}}return gd(e,o.activeHandle,c,i),a.addEventListener("mouseup",u),a.addEventListener("mousemove",f),t.preventDefault(),!0}function y3(e,t,{colspan:n,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const a=e.domAtPos(t);let o=a.node.childNodes[a.offset].offsetWidth,l=n;if(i)for(let c=0;c<n;c++)i[c]&&(o-=i[c],l--);return o/l}function k3(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function hd(e,t,n,i){const r=n=="right"?-i:i,a=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!a)return-1;const{pos:o}=a,l=vi(e.state.doc.resolve(o));if(!l)return-1;if(n=="right")return l.pos;const c=Ge.get(l.node(-1)),u=l.start(-1),f=c.map.indexOf(l.pos-u);return f%c.width==0?-1:u+c.map[f-1]}function bd(e,t,n){const i=t.clientX-e.startX;return Math.max(n,e.startWidth+i)}function Nm(e,t){e.dispatch(e.state.tr.setMeta(zt,{setHandle:t}))}function w3(e,t,n){const i=e.state.doc.resolve(t),r=i.node(-1),a=Ge.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let u=0;u<a.height;u++){const f=u*a.width+l;if(u&&a.map[f]==a.map[f-a.width])continue;const m=a.map[f],p=r.nodeAt(m).attrs,h=p.colspan==1?0:l-a.colCount(m);if(p.colwidth&&p.colwidth[h]==n)continue;const g=p.colwidth?p.colwidth.slice():_3(p.colspan);g[h]=n,c.setNodeMarkup(o+m,null,{...p,colwidth:g})}c.docChanged&&e.dispatch(c)}function gd(e,t,n,i){const r=e.state.doc.resolve(t),a=r.node(-1),o=r.start(-1),l=Ge.get(a).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=e.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&El(a,c.firstChild,c,i,l,n)}function _3(e){return Array(e).fill(0)}function S3(e,t){const n=[],i=e.doc.resolve(t),r=i.node(-1);if(!r)return je.empty;const a=Ge.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const f=l+u*a.width;if((l==a.width-1||a.map[f]!=a.map[f+1])&&(u==0||a.map[f]!=a.map[f-a.width])){var c;const m=a.map[f],p=o+m+r.nodeAt(m).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=zt.getState(e))===null||c===void 0)&&c.dragging&&n.push(ft.node(o+m,o+m+r.nodeAt(m).nodeSize,{class:"column-resize-dragging"})),n.push(ft.widget(p,h))}}return je.create(e.doc,n)}function C3({allowTableNodeSelection:e=!1}={}){return new ct({key:Fn,state:{init(){return null},apply(t,n){const i=t.getMeta(Fn);if(i!=null)return i==-1?null:i;if(n==null||!t.docChanged)return n;const{deleted:r,pos:a}=t.mapping.mapResult(n);return r?null:a}},props:{decorations:P_,handleDOMEvents:{mousedown:p3},createSelectionBetween(t){return Fn.getState(t.state)!=null?t.state.selection:null},handleTripleClick:d3,handleKeyDown:u3,handlePaste:f3},appendTransaction(t,n,i){return U_(i,Cm(i,n),e)}})}function Al(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function vd(e,t,n,i,r,a){var o;let l=0,c=!0,u=t.firstChild;const f=e.firstChild;if(f!==null)for(let m=0,p=0;m<f.childCount;m+=1){const{colspan:h,colwidth:g}=f.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const y=r===p?a:g&&g[b],v=y?`${y}px`:"";if(l+=y||i,y||(c=!1),u){if(u.style.width!==v){const[x,k]=Al(i,y);u.style.setProperty(x,k)}u=u.nextSibling}else{const x=document.createElement("col"),[k,w]=Al(i,y);x.style.setProperty(k,w),t.appendChild(x)}}}for(;u;){const m=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=m}c?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class E3{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),vd(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,vd(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function A3(e,t,n,i){let r=0,a=!0;const o=[],l=e.firstChild;if(!l)return{};for(let m=0,p=0;m<l.childCount;m+=1){const{colspan:h,colwidth:g}=l.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const y=n===p?i:g&&g[b];r+=y||t,y||(a=!1);const[v,x]=Al(t,y);o.push(["col",{style:`${v}: ${x}`}])}}const c=a?`${r}px`:"",u=a?"":`${r}px`;return{colgroup:["colgroup",{},...o],tableWidth:c,tableMinWidth:u}}function xd(e,t){return e.createAndFill()}function T3(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const i=e.nodes[n];i.spec.tableRole&&(t[i.spec.tableRole]=i)}),e.cached.tableNodeTypes=t,t}function N3(e,t,n,i,r){const a=T3(e),o=[],l=[];for(let u=0;u<n;u+=1){const f=xd(a.cell);if(f&&l.push(f),i){const m=xd(a.header_cell);m&&o.push(m)}}const c=[];for(let u=0;u<t;u+=1)c.push(a.row.createChecked(null,i&&u===0?o:l));return a.table.createChecked(null,c)}function O3(e){return e instanceof Pe}const Ca=({editor:e})=>{const{selection:t}=e.state;if(!O3(t))return!1;let n=0;const i=cm(t.ranges[0].$from,a=>a.type.name==="table");return i==null||i.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},M3=Ae.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:E3,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:i,tableMinWidth:r}=A3(e,this.options.cellMinWidth),a=["table",Fe(this.options.HTMLAttributes,t,{style:i?`width: ${i}`:`min-width: ${r}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:i,dispatch:r,editor:a})=>{const o=N3(a.schema,e,t,n);if(r){const l=i.selection.from+1;i.replaceSelectionWith(o).scrollIntoView().setSelection(ge.near(i.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>j_(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>$_(e,t),deleteColumn:()=>({state:e,dispatch:t})=>G_(e,t),addRowBefore:()=>({state:e,dispatch:t})=>X_(e,t),addRowAfter:()=>({state:e,dispatch:t})=>J_(e,t),deleteRow:()=>({state:e,dispatch:t})=>Q_(e,t),deleteTable:()=>({state:e,dispatch:t})=>a3(e,t),mergeCells:()=>({state:e,dispatch:t})=>sd(e,t),splitCell:()=>({state:e,dispatch:t})=>ld(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Or("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Or("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>i3(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>sd(e,t)?!0:ld(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:i})=>t3(e,t)(n,i),goToNextCell:()=>({state:e,dispatch:t})=>ud(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>ud(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Cm(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const i=Pe.create(t.doc,e.anchorCell,e.headCell);t.setSelection(i)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ca,"Mod-Backspace":Ca,Delete:Ca,"Mod-Delete":Ca}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[h3({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],C3({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:it(pt(e,"tableRole",t))}}}),D3=Ae.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Fe(this.options.HTMLAttributes,e),0]}}),z3=Ae.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Fe(this.options.HTMLAttributes,e),0]}}),I3=Ae.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Fe(this.options.HTMLAttributes,e),0]}}),R3=Ke.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ct({key:new rt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,r=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((o,l)=>{const c=i>=l&&i<=l+o.nodeSize,u=!o.isLeaf&&bc(o);if((c||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const m=ft.node(l,l+o.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:c}):this.options.placeholder});r.push(m)}return this.options.includeChildren}),je.create(e,r)}}})]}}),L3=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var i,r;const a=n.getAttribute("style"),o=(r=(i=n.parentElement)===null||i===void 0?void 0:i.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${o};${a}`)})};Et.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&L3(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,i)=>{if(n.isTextblock)return!0;n.marks.filter(r=>r.type===this.type).some(r=>Object.values(r.attrs).some(a=>!!a))||e.removeMark(i,i+n.nodeSize,this.type)}),!0}}}});const B3=Ke.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),P3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,F3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,V3=Et.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Gw({find:P3,type:this.type})]},addPasteRules(){return[dm({find:F3,type:this.type})]}});function Om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={PROCESSOR_VERSION:"1.4.61",error:function(e){throw typeof Error>"u"?new Error("citeproc-js error: "+e):"citeproc-js error: "+e},debug:function(e){typeof console>"u"?dump("CSL: "+e+`
611
+ 3. "-" cannot repeat`);Ue.customSchemes.push([e,t])}function x_(){Ue.scanner=u_(Ue.customSchemes);for(let e=0;e<Ue.tokenQueue.length;e++)Ue.tokenQueue[e][1]({scanner:Ue.scanner});Ue.parser=m_(Ue.scanner.tokens);for(let e=0;e<Ue.pluginQueue.length;e++)Ue.pluginQueue[e][1]({scanner:Ue.scanner,parser:Ue.parser});return Ue.initialized=!0,Ue}function Sc(e){return Ue.initialized||x_(),h_(Ue.parser.start,e,vm(Ue.scanner.start,e))}Sc.scan=vm;function ym(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const i=new _c(n),r=Sc(e),a=[];for(let o=0;o<r.length;o++){const l=r[o];l.isLink&&(!t||l.t===t)&&i.check(l)&&a.push(l.toFormattedObject(i))}return a}const Cc="[\0-   ᠎ -\u2029  ]",y_=new RegExp(Cc),k_=new RegExp(`${Cc}$`),w_=new RegExp(Cc,"g");function __(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function S_(e){return new ct({key:new rt("autolink"),appendTransaction:(t,n,i)=>{const r=t.some(u=>u.docChanged)&&!n.doc.eq(i.doc),a=t.some(u=>u.getMeta("preventAutolink"));if(!r||a)return;const{tr:o}=i,l=dw(n.doc,[...t]);if(vw(l).forEach(({newRange:u})=>{const f=pw(i.doc,u,h=>h.isTextblock);let m,p;if(f.length>1)m=f[0],p=i.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ");else if(f.length){const h=i.doc.textBetween(u.from,u.to," "," ");if(!k_.test(h))return;m=f[0],p=i.doc.textBetween(m.pos,u.to,void 0," ")}if(m&&p){const h=p.split(y_).filter(Boolean);if(h.length<=0)return!1;const g=h[h.length-1],b=m.pos+p.lastIndexOf(g);if(!g)return!1;const y=Sc(g).map(v=>v.toObject(e.defaultProtocol));if(!__(y))return!1;y.filter(v=>v.isLink).map(v=>({...v,from:b+v.start+1,to:b+v.end+1})).filter(v=>i.schema.marks.code?!i.doc.rangeHasMark(v.from,v.to,i.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{hc(v.from,v.to,i.doc).some(x=>x.mark.type===e.type)||o.addMark(v.from,v.to,e.type.create({href:v.href}))})}}),!!o.steps.length)return o}})}function C_(e){return new ct({key:new rt("handleClickLink"),props:{handleClick:(t,n,i)=>{var r,a;if(i.button!==0||!t.editable)return!1;let o=i.target;const l=[];for(;o.nodeName!=="DIV";)l.push(o),o=o.parentNode;if(!l.find(p=>p.nodeName==="A"))return!1;const c=hw(t.state,e.type.name),u=i.target,f=(r=u==null?void 0:u.href)!==null&&r!==void 0?r:c.href,m=(a=u==null?void 0:u.target)!==null&&a!==void 0?a:c.target;return u&&f?(window.open(f,m),!0):!1}}})}function E_(e){return new ct({key:new rt("handlePasteLink"),props:{handlePaste:(t,n,i)=>{const{state:r}=t,{selection:a}=r,{empty:o}=a;if(o)return!1;let l="";i.content.forEach(u=>{l+=u.textContent});const c=ym(l,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===l);return!l||!c?!1:e.editor.commands.setMark(e.type,{href:c.href})}}})}function ri(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&n.push(r)}),!e||e.replace(w_,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const A_=Et.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){ad(e);return}ad(e.scheme,e.optionalSlashes)})},onDestroy(){v_()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ri(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ri(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ri(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Fe(this.options.HTMLAttributes,e),0]:["a",Fe(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!ri(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:i=>!!ri(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[dm({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:i}=this.options,r=ym(e).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!ri(o,n),protocols:n,defaultProtocol:i}));r.length&&r.forEach(a=>t.push({text:a.value,data:{href:a.href},index:a.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(S_({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!ri(r,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(C_({type:this.type})),this.options.linkOnPaste&&e.push(E_({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),T_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,N_=Ae.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",Fe(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Xw({find:T_,type:this.type,getAttributes:e=>{const[,,t,n,i]=e;return{src:n,alt:t,title:i}}})]}});let wl,_l;if(typeof WeakMap<"u"){let e=new WeakMap;wl=t=>e.get(t),_l=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;wl=i=>{for(let r=0;r<e.length;r+=2)if(e[r]==i)return e[r+1]},_l=(i,r)=>(n==10&&(n=0),e[n++]=i,e[n++]=r)}var Ge=class{constructor(e,t,n,i){this.width=e,this.height=t,this.map=n,this.problems=i}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const i=t%this.width,r=t/this.width|0;let a=i+1,o=r+1;for(let l=1;a<this.width&&this.map[t+l]==n;l++)a++;for(let l=1;o<this.height&&this.map[t+this.width*l]==n;l++)o++;return{left:i,top:r,right:a,bottom:o}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:i,right:r,top:a,bottom:o}=this.findCell(e);return t=="horiz"?(n<0?i==0:r==this.width)?null:this.map[a*this.width+(n<0?i-1:r)]:(n<0?a==0:o==this.height)?null:this.map[i+this.width*(n<0?a-1:o)]}rectBetween(e,t){const{left:n,right:i,top:r,bottom:a}=this.findCell(e),{left:o,right:l,top:c,bottom:u}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(r,c),right:Math.max(i,l),bottom:Math.max(a,u)}}cellsInRect(e){const t=[],n={};for(let i=e.top;i<e.bottom;i++)for(let r=e.left;r<e.right;r++){const a=i*this.width+r,o=this.map[a];n[o]||(n[o]=!0,!(r==e.left&&r&&this.map[a-1]==o||i==e.top&&i&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let i=0,r=0;;i++){const a=r+n.child(i).nodeSize;if(i==e){let o=t+e*this.width;const l=(e+1)*this.width;for(;o<l&&this.map[o]<r;)o++;return o==l?a-1:this.map[o]}r=a}}static get(e){return wl(e)||_l(e,O_(e))}};function O_(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=M_(e),n=e.childCount,i=[];let r=0,a=null;const o=[];for(let u=0,f=t*n;u<f;u++)i[u]=0;for(let u=0,f=0;u<n;u++){const m=e.child(u);f++;for(let g=0;;g++){for(;r<i.length&&i[r]!=0;)r++;if(g==m.childCount)break;const b=m.child(g),{colspan:y,rowspan:v,colwidth:x}=b.attrs;for(let k=0;k<v;k++){if(k+u>=n){(a||(a=[])).push({type:"overlong_rowspan",pos:f,n:v-k});break}const w=r+k*t;for(let S=0;S<y;S++){i[w+S]==0?i[w+S]=f:(a||(a=[])).push({type:"collision",row:u,pos:f,n:y-S});const A=x&&x[S];if(A){const I=(w+S)%t*2,_=o[I];_==null||_!=A&&o[I+1]==1?(o[I]=A,o[I+1]=1):_==A&&o[I+1]++}}}r+=y,f+=b.nodeSize}const p=(u+1)*t;let h=0;for(;r<p;)i[r++]==0&&h++;h&&(a||(a=[])).push({type:"missing",row:u,n:h}),f++}(t===0||n===0)&&(a||(a=[])).push({type:"zero_sized"});const l=new Ge(t,n,i,a);let c=!1;for(let u=0;!c&&u<o.length;u+=2)o[u]!=null&&o[u+1]<n&&(c=!0);return c&&D_(l,o,e),l}function M_(e){let t=-1,n=!1;for(let i=0;i<e.childCount;i++){const r=e.child(i);let a=0;if(n)for(let o=0;o<i;o++){const l=e.child(o);for(let c=0;c<l.childCount;c++){const u=l.child(c);o+u.attrs.rowspan>i&&(a+=u.attrs.colspan)}}for(let o=0;o<r.childCount;o++){const l=r.child(o);a+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function D_(e,t,n){e.problems||(e.problems=[]);const i={};for(let r=0;r<e.map.length;r++){const a=e.map[r];if(i[a])continue;i[a]=!0;const o=n.nodeAt(a);if(!o)throw new RangeError(`No cell with offset ${a} found`);let l=null;const c=o.attrs;for(let u=0;u<c.colspan;u++){const f=t[(r+u)%e.width*2];f!=null&&(!c.colwidth||c.colwidth[u]!=f)&&((l||(l=z_(c)))[u]=f)}l&&e.problems.unshift({type:"colwidth mismatch",pos:a,colwidth:l})}}function z_(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function mt(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const i=e.nodes[n],r=i.spec.tableRole;r&&(t[r]=i)}}return t}const Fn=new rt("selectingCells");function vi(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function I_(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function Kt(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function qo(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=vi(t.$head)||R_(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function R_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const i=t.type.spec.tableRole;if(i=="cell"||i=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Sl(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function L_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ec(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function km(e,t,n){const i=e.node(-1),r=Ge.get(i),a=e.start(-1),o=r.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function xi(e,t,n=1){const i={...e,colspan:e.colspan-n};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(t,n),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function wm(e,t,n=1){const i={...e,colspan:e.colspan+n};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<n;r++)i.colwidth.splice(t,0,0)}return i}function B_(e,t,n){const i=mt(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=i)return!1;return!0}var Pe=class Cn extends ke{constructor(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.rectBetween(t.pos-a,n.pos-a),l=t.node(0),c=r.cellsInRect(o).filter(f=>f!=n.pos-a);c.unshift(n.pos-a);const u=c.map(f=>{const m=i.nodeAt(f);if(!m)throw new RangeError(`No cell with offset ${f} found`);const p=a+f+1;return new mp(l.resolve(p),l.resolve(p+m.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){const i=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(Sl(i)&&Sl(r)&&Ec(i,r)){const a=this.$anchorCell.node(-1)!=i.node(-1);return a&&this.isRowSelection()?Cn.rowSelection(i,r):a&&this.isColSelection()?Cn.colSelection(i,r):new Cn(i,r)}return ge.between(i,r)}content(){const t=this.$anchorCell.node(-1),n=Ge.get(t),i=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),a={},o=[];for(let c=r.top;c<r.bottom;c++){const u=[];for(let f=c*n.width+r.left,m=r.left;m<r.right;m++,f++){const p=n.map[f];if(a[p])continue;a[p]=!0;const h=n.findCell(p);let g=t.nodeAt(p);if(!g)throw new RangeError(`No cell with offset ${p} found`);const b=r.left-h.left,y=h.right-r.right;if(b>0||y>0){let v=g.attrs;if(b>0&&(v=xi(v,0,b)),y>0&&(v=xi(v,v.colspan-y,y)),h.left<r.left){if(g=g.type.createAndFill(v),!g)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(v)}`)}else g=g.type.create(v,g.content)}if(h.top<r.top||h.bottom>r.bottom){const v={...g.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?g=g.type.createAndFill(v):g=g.type.create(v,g.content)}u.push(g)}o.push(t.child(c).copy(J.from(u)))}const l=this.isColSelection()&&this.isRowSelection()?t:o;return new ae(J.from(l),1,1)}replace(t,n=ae.empty){const i=t.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){const{$from:l,$to:c}=r[o],u=t.mapping.slice(i);t.replace(u.map(l.pos),u.map(c.pos),o?ae.empty:n)}const a=ke.findFrom(t.doc.resolve(t.mapping.slice(i).map(this.to)),-1);a&&t.setSelection(a)}replaceWith(t,n){this.replace(t,new ae(J.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),i=Ge.get(n),r=this.$anchorCell.start(-1),a=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let o=0;o<a.length;o++)t(n.nodeAt(a[o]),r+a[o])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const i=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.top<=l.top?(o.top>0&&(t=c.resolve(a+r.map[o.left])),l.bottom<r.height&&(n=c.resolve(a+r.map[r.width*(r.height-1)+l.right-1]))):(l.top>0&&(n=c.resolve(a+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(a+r.map[r.width*(r.height-1)+o.right-1]))),new Cn(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=Ge.get(t),i=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-i),a=n.colCount(this.$headCell.pos-i);if(Math.min(r,a)>0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,l=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,l)==n.width}eq(t){return t instanceof Cn&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const i=t.node(-1),r=Ge.get(i),a=t.start(-1),o=r.findCell(t.pos-a),l=r.findCell(n.pos-a),c=t.node(0);return o.left<=l.left?(o.left>0&&(t=c.resolve(a+r.map[o.top*r.width])),l.right<r.width&&(n=c.resolve(a+r.map[r.width*(l.top+1)-1]))):(l.left>0&&(n=c.resolve(a+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(a+r.map[r.width*(o.top+1)-1]))),new Cn(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Cn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){return new Cn(t.resolve(n),t.resolve(i))}getBookmark(){return new P_(this.$anchorCell.pos,this.$headCell.pos)}};Pe.prototype.visible=!1;ke.jsonID("cell",Pe);var P_=class _m{constructor(t,n){this.anchor=t,this.head=n}map(t){return new _m(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),i=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&Ec(n,i)?new Pe(n,i):ke.near(i,1)}};function F_(e){if(!(e.selection instanceof Pe))return null;const t=[];return e.selection.forEachCell((n,i)=>{t.push(ft.node(i,i+n.nodeSize,{class:"selectedCell"}))}),je.create(e.doc,t)}function V_({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,i=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let a=t.depth;a>=0&&!(t.before(a+1)>t.start(a));a--,i--);return n==i&&/row|table/.test(e.node(r).type.spec.tableRole)}function U_({$from:e,$to:t}){let n,i;for(let r=e.depth;r>0;r--){const a=e.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}for(let r=t.depth;r>0;r--){const a=t.node(r);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){i=a;break}}return n!==i&&t.parentOffset===0}function H_(e,t,n){const i=(t||e).selection,r=(t||e).doc;let a,o;if(i instanceof be&&(o=i.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=Pe.create(r,i.from);else if(o=="row"){const l=r.resolve(i.from+1);a=Pe.rowSelection(l,l)}else if(!n){const l=Ge.get(i.node),c=i.from+1,u=c+l.map[l.width*l.height-1];a=Pe.create(r,c+1,u)}}else i instanceof ge&&V_(i)?a=ge.create(r,i.from):i instanceof ge&&U_(i)&&(a=ge.create(r,i.$from.start(),i.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}const q_=new rt("fix-tables");function Sm(e,t,n,i){const r=e.childCount,a=t.childCount;e:for(let o=0,l=0;o<a;o++){const c=t.child(o);for(let u=l,f=Math.min(r,o+3);u<f;u++)if(e.child(u)==c){l=u+1,n+=c.nodeSize;continue e}i(c,n),l<r&&e.child(l).sameMarkup(c)?Sm(e.child(l),c,n+1,i):c.nodesBetween(0,c.content.size,i,n+1),n+=c.nodeSize}}function Cm(e,t){let n;const i=(r,a)=>{r.type.spec.tableRole=="table"&&(n=j_(e,r,a,n))};return t?t.doc!=e.doc&&Sm(t.doc,e.doc,0,i):e.doc.descendants(i),n}function j_(e,t,n,i){const r=Ge.get(t);if(!r.problems)return i;i||(i=e.tr);const a=[];for(let c=0;c<r.height;c++)a.push(0);for(let c=0;c<r.problems.length;c++){const u=r.problems[c];if(u.type=="collision"){const f=t.nodeAt(u.pos);if(!f)continue;const m=f.attrs;for(let p=0;p<m.rowspan;p++)a[u.row+p]+=u.n;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,xi(m,m.colspan-u.n,u.n))}else if(u.type=="missing")a[u.row]+=u.n;else if(u.type=="overlong_rowspan"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){const f=t.nodeAt(u.pos);if(!f)continue;i.setNodeMarkup(i.mapping.map(n+1+u.pos),null,{...f.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){const f=i.mapping.map(n);i.delete(f,f+t.nodeSize)}}let o,l;for(let c=0;c<a.length;c++)a[c]&&(o==null&&(o=c),l=c);for(let c=0,u=n+1;c<r.height;c++){const f=t.child(c),m=u+f.nodeSize,p=a[c];if(p>0){let h="cell";f.firstChild&&(h=f.firstChild.type.spec.tableRole);const g=[];for(let y=0;y<p;y++){const v=mt(e.schema)[h].createAndFill();v&&g.push(v)}const b=(c==0||o==c-1)&&l==c?u+1:m-1;i.insert(i.mapping.map(b),g)}u=m}return i.setMeta(q_,{fixTables:!0})}function on(e){const t=e.selection,n=qo(e),i=n.node(-1),r=n.start(-1),a=Ge.get(i);return{...t instanceof Pe?a.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):a.findCell(n.pos-r),tableStart:r,map:a,table:i}}function Em(e,{map:t,tableStart:n,table:i},r){let a=r>0?-1:0;B_(t,i,r+a)&&(a=r==0||r==t.width?null:0);for(let o=0;o<t.height;o++){const l=o*t.width+r;if(r>0&&r<t.width&&t.map[l-1]==t.map[l]){const c=t.map[l],u=i.nodeAt(c);e.setNodeMarkup(e.mapping.map(n+c),null,wm(u.attrs,r-t.colCount(c))),o+=u.attrs.rowspan-1}else{const c=a==null?mt(i.type.schema).cell:i.nodeAt(t.map[l+a]).type,u=t.positionAt(o,r,i);e.insert(e.mapping.map(n+u),c.createAndFill())}}return e}function $_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Em(e.tr,n,n.left))}return!0}function W_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Em(e.tr,n,n.right))}return!0}function G_(e,{map:t,table:n,tableStart:i},r){const a=e.mapping.maps.length;for(let o=0;o<t.height;){const l=o*t.width+r,c=t.map[l],u=n.nodeAt(c),f=u.attrs;if(r>0&&t.map[l-1]==c||r<t.width-1&&t.map[l+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(i+c),null,xi(f,r-t.colCount(c)));else{const m=e.mapping.slice(a).map(i+c);e.delete(m,m+u.nodeSize)}o+=f.rowspan}}function K_(e,t){if(!Kt(e))return!1;if(t){const n=on(e),i=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;G_(i,n,r),r!=n.left;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=Ge.get(a)}t(i)}return!0}function X_(e,t,n){var i;const r=mt(t.type.schema).header_cell;for(let a=0;a<e.width;a++)if(((i=t.nodeAt(e.map[a+n*e.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function Am(e,{map:t,tableStart:n,table:i},r){let a=n;for(let u=0;u<r;u++)a+=i.child(u).nodeSize;const o=[];let l=r>0?-1:0;X_(t,i,r+l)&&(l=r==0||r==t.height?null:0);for(let u=0,f=t.width*r;u<t.width;u++,f++)if(r>0&&r<t.height&&t.map[f]==t.map[f-t.width]){const m=t.map[f],p=i.nodeAt(m).attrs;e.setNodeMarkup(n+m,null,{...p,rowspan:p.rowspan+1}),u+=p.colspan-1}else{var c;const m=l==null?mt(i.type.schema).cell:(c=i.nodeAt(t.map[f+l*t.width]))===null||c===void 0?void 0:c.type,p=m==null?void 0:m.createAndFill();p&&o.push(p)}return e.insert(a,mt(i.type.schema).row.create(null,o)),e}function J_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Am(e.tr,n,n.top))}return!0}function Z_(e,t){if(!Kt(e))return!1;if(t){const n=on(e);t(Am(e.tr,n,n.bottom))}return!0}function Q_(e,{map:t,table:n,tableStart:i},r){let a=0;for(let u=0;u<r;u++)a+=n.child(u).nodeSize;const o=a+n.child(r).nodeSize,l=e.mapping.maps.length;e.delete(a+i,o+i);const c=new Set;for(let u=0,f=r*t.width;u<t.width;u++,f++){const m=t.map[f];if(!c.has(m)){if(c.add(m),r>0&&m==t.map[f-t.width]){const p=n.nodeAt(m).attrs;e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p,rowspan:p.rowspan-1}),u+=p.colspan-1}else if(r<t.height&&m==t.map[f+t.width]){const p=n.nodeAt(m),h=p.attrs,g=p.type.create({...h,rowspan:p.attrs.rowspan-1},p.content),b=t.positionAt(r+1,u,n);e.insert(e.mapping.slice(l).map(i+b),g),u+=h.colspan-1}}}}function Y_(e,t){if(!Kt(e))return!1;if(t){const n=on(e),i=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;Q_(i,n,r),r!=n.top;r--){const a=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc;if(!a)throw new RangeError("No table found");n.table=a,n.map=Ge.get(n.table)}t(i)}return!0}function od(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function e3({width:e,height:t,map:n},i){let r=i.top*e+i.left,a=r,o=(i.bottom-1)*e+i.left,l=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&n[a]==n[a-1]||i.right<e&&n[l]==n[l+1])return!0;a+=e,l+=e}for(let c=i.left;c<i.right;c++){if(i.top>0&&n[r]==n[r-e]||i.bottom<t&&n[o]==n[o+e])return!0;r++,o++}return!1}function sd(e,t){const n=e.selection;if(!(n instanceof Pe)||n.$anchorCell.pos==n.$headCell.pos)return!1;const i=on(e),{map:r}=i;if(e3(r,i))return!1;if(t){const a=e.tr,o={};let l=J.empty,c,u;for(let f=i.top;f<i.bottom;f++)for(let m=i.left;m<i.right;m++){const p=r.map[f*r.width+m],h=i.table.nodeAt(p);if(!(o[p]||!h))if(o[p]=!0,c==null)c=p,u=h;else{od(h)||(l=l.append(h.content));const g=a.mapping.map(p+i.tableStart);a.delete(g,g+h.nodeSize)}}if(c==null||u==null)return!0;if(a.setNodeMarkup(c+i.tableStart,null,{...wm(u.attrs,u.attrs.colspan,i.right-i.left-u.attrs.colspan),rowspan:i.bottom-i.top}),l.size>0){const f=c+1+u.content.size,m=od(u)?c+1:f;a.replaceWith(m+i.tableStart,f+i.tableStart,l)}a.setSelection(new Pe(a.doc.resolve(c+i.tableStart))),t(a)}return!0}function ld(e,t){const n=mt(e.schema);return t3(({node:i})=>n[i.type.spec.tableRole])(e,t)}function t3(e){return(t,n)=>{const i=t.selection;let r,a;if(i instanceof Pe){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,a=i.$anchorCell.pos}else{var o;if(r=I_(i.$from),!r)return!1;a=(o=vi(i.$from))===null||o===void 0?void 0:o.pos}if(r==null||a==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(n){let l=r.attrs;const c=[],u=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=on(t),m=t.tr;for(let h=0;h<f.right-f.left;h++)c.push(u?{...l,colwidth:u&&u[h]?[u[h]]:null}:l);let p;for(let h=f.top;h<f.bottom;h++){let g=f.map.positionAt(h,f.left,f.table);h==f.top&&(g+=r.nodeSize);for(let b=f.left,y=0;b<f.right;b++,y++)b==f.left&&h==f.top||m.insert(p=m.mapping.map(g+f.tableStart,1),e({node:r,row:h,col:b}).createAndFill(c[y]))}m.setNodeMarkup(a,e({node:r,row:f.top,col:f.left}),c[0]),i instanceof Pe&&m.setSelection(new Pe(m.doc.resolve(i.$anchorCell.pos),p?m.doc.resolve(p):void 0)),n(m)}return!0}}function n3(e,t){return function(n,i){if(!Kt(n))return!1;const r=qo(n);if(r.nodeAfter.attrs[e]===t)return!1;if(i){const a=n.tr;n.selection instanceof Pe?n.selection.forEachCell((o,l)=>{o.attrs[e]!==t&&a.setNodeMarkup(l,null,{...o.attrs,[e]:t})}):a.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),i(a)}return!0}}function i3(e){return function(t,n){if(!Kt(t))return!1;if(n){const i=mt(t.schema),r=on(t),a=t.tr,o=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),l=o.map(c=>r.table.nodeAt(c));for(let c=0;c<o.length;c++)l[c].type==i.header_cell&&a.setNodeMarkup(r.tableStart+o[c],i.cell,l[c].attrs);if(a.steps.length===0)for(let c=0;c<o.length;c++)a.setNodeMarkup(r.tableStart+o[c],i.header_cell,l[c].attrs);n(a)}return!0}}function cd(e,t,n){const i=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<i.length;r++){const a=t.table.nodeAt(i[r]);if(a&&a.type!==n.header_cell)return!1}return!0}function Or(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?i3(e):function(n,i){if(!Kt(n))return!1;if(i){const r=mt(n.schema),a=on(n),o=n.tr,l=cd("row",a,r),c=cd("column",a,r),u=(e==="column"?l:e==="row"&&c)?1:0,f=e=="column"?{left:0,top:u,right:1,bottom:a.map.height}:e=="row"?{left:u,top:0,right:a.map.width,bottom:1}:a,m=e=="column"?c?r.cell:r.header_cell:e=="row"?l?r.cell:r.header_cell:r.cell;a.map.cellsInRect(f).forEach(p=>{const h=p+a.tableStart,g=o.doc.nodeAt(h);g&&o.setNodeMarkup(h,m,g.attrs)}),i(o)}return!0}}Or("row",{useDeprecatedLogic:!0});Or("column",{useDeprecatedLogic:!0});const r3=Or("cell",{useDeprecatedLogic:!0});function a3(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let i=e.index(-1)-1,r=e.before();i>=0;i--){const a=e.node(-1).child(i),o=a.lastChild;if(o)return r-1-o.nodeSize;r-=a.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let i=e.indexAfter(-1),r=e.after();i<n.childCount;i++){const a=n.child(i);if(a.childCount)return r+1;r+=a.nodeSize}}return null}function ud(e){return function(t,n){if(!Kt(t))return!1;const i=a3(qo(t),e);if(i==null)return!1;if(n){const r=t.doc.resolve(i);n(t.tr.setSelection(ge.between(r,L_(r))).scrollIntoView())}return!0}}function o3(e,t){const n=e.selection.$anchor;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(i),n.after(i)).scrollIntoView()),!0;return!1}function wa(e,t){const n=e.selection;if(!(n instanceof Pe))return!1;if(t){const i=e.tr,r=mt(e.schema).cell.createAndFill().content;n.forEachCell((a,o)=>{a.content.eq(r)||i.replace(i.mapping.map(o+1),i.mapping.map(o+a.nodeSize-1),new ae(r,0,0))}),i.docChanged&&t(i)}return!0}function s3(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:i}=e;for(;t.childCount==1&&(n>0&&i>0||t.child(0).type.spec.tableRole=="table");)n--,i--,t=t.child(0).content;const r=t.child(0),a=r.type.spec.tableRole,o=r.type.schema,l=[];if(a=="row")for(let c=0;c<t.childCount;c++){let u=t.child(c).content;const f=c?0:Math.max(0,n-1),m=c<t.childCount-1?0:Math.max(0,i-1);(f||m)&&(u=Cl(mt(o).row,new ae(u,f,m)).content),l.push(u)}else if(a=="cell"||a=="header_cell")l.push(n||i?Cl(mt(o).row,new ae(t,n,i)).content:t);else return null;return l3(o,l)}function l3(e,t){const n=[];for(let r=0;r<t.length;r++){const a=t[r];for(let o=a.childCount-1;o>=0;o--){const{rowspan:l,colspan:c}=a.child(o).attrs;for(let u=r;u<r+l;u++)n[u]=(n[u]||0)+c}}let i=0;for(let r=0;r<n.length;r++)i=Math.max(i,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(J.empty),n[r]<i){const a=mt(e).cell.createAndFill(),o=[];for(let l=n[r];l<i;l++)o.push(a);t[r]=t[r].append(J.from(o))}return{height:t.length,width:i,rows:t}}function Cl(e,t){const n=e.createAndFill();return new pp(n).replace(0,n.content.size,t).doc}function c3({width:e,height:t,rows:n},i,r){if(e!=i){const a=[],o=[];for(let l=0;l<n.length;l++){const c=n[l],u=[];for(let f=a[l]||0,m=0;f<i;m++){let p=c.child(m%c.childCount);f+p.attrs.colspan>i&&(p=p.type.createChecked(xi(p.attrs,p.attrs.colspan,f+p.attrs.colspan-i),p.content)),u.push(p),f+=p.attrs.colspan;for(let h=1;h<p.attrs.rowspan;h++)a[l+h]=(a[l+h]||0)+p.attrs.colspan}o.push(J.from(u))}n=o,e=i}if(t!=r){const a=[];for(let o=0,l=0;o<r;o++,l++){const c=[],u=n[l%t];for(let f=0;f<u.childCount;f++){let m=u.child(f);o+m.attrs.rowspan>r&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,r-m.attrs.rowspan)},m.content)),c.push(m)}a.push(J.from(c))}n=a,t=r}return{width:e,height:t,rows:n}}function u3(e,t,n,i,r,a,o){const l=e.doc.type.schema,c=mt(l);let u,f;if(r>t.width)for(let m=0,p=0;m<t.height;m++){const h=n.child(m);p+=h.nodeSize;const g=[];let b;h.lastChild==null||h.lastChild.type==c.cell?b=u||(u=c.cell.createAndFill()):b=f||(f=c.header_cell.createAndFill());for(let y=t.width;y<r;y++)g.push(b);e.insert(e.mapping.slice(o).map(p-1+i),g)}if(a>t.height){const m=[];for(let g=0,b=(t.height-1)*t.width;g<Math.max(t.width,r);g++){const y=g>=t.width?!1:n.nodeAt(t.map[b+g]).type==c.header_cell;m.push(y?f||(f=c.header_cell.createAndFill()):u||(u=c.cell.createAndFill()))}const p=c.row.create(null,J.from(m)),h=[];for(let g=t.height;g<a;g++)h.push(p);e.insert(e.mapping.slice(o).map(i+n.nodeSize-2),h)}return!!(u||f)}function dd(e,t,n,i,r,a,o,l){if(o==0||o==t.height)return!1;let c=!1;for(let u=r;u<a;u++){const f=o*t.width+u,m=t.map[f];if(t.map[f-t.width]==m){c=!0;const p=n.nodeAt(m),{top:h,left:g}=t.findCell(m);e.setNodeMarkup(e.mapping.slice(l).map(m+i),null,{...p.attrs,rowspan:o-h}),e.insert(e.mapping.slice(l).map(t.positionAt(o,g,n)),p.type.createAndFill({...p.attrs,rowspan:h+p.attrs.rowspan-o})),u+=p.attrs.colspan-1}}return c}function fd(e,t,n,i,r,a,o,l){if(o==0||o==t.width)return!1;let c=!1;for(let u=r;u<a;u++){const f=u*t.width+o,m=t.map[f];if(t.map[f-1]==m){c=!0;const p=n.nodeAt(m),h=t.colCount(m),g=e.mapping.slice(l).map(m+i);e.setNodeMarkup(g,null,xi(p.attrs,o-h,p.attrs.colspan-(o-h))),e.insert(g+p.nodeSize,p.type.createAndFill(xi(p.attrs,0,o-h))),u+=p.attrs.rowspan-1}}return c}function pd(e,t,n,i,r){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw new Error("No table found");let o=Ge.get(a);const{top:l,left:c}=i,u=c+r.width,f=l+r.height,m=e.tr;let p=0;function h(){if(a=n?m.doc.nodeAt(n-1):m.doc,!a)throw new Error("No table found");o=Ge.get(a),p=m.mapping.maps.length}u3(m,o,a,n,u,f,p)&&h(),dd(m,o,a,n,c,u,l,p)&&h(),dd(m,o,a,n,c,u,f,p)&&h(),fd(m,o,a,n,l,f,c,p)&&h(),fd(m,o,a,n,l,f,u,p)&&h();for(let g=l;g<f;g++){const b=o.positionAt(g,c,a),y=o.positionAt(g,u,a);m.replace(m.mapping.slice(p).map(b+n),m.mapping.slice(p).map(y+n),new ae(r.rows[g-l],0,0))}h(),m.setSelection(new Pe(m.doc.resolve(n+o.positionAt(l,c,a)),m.doc.resolve(n+o.positionAt(f-1,u-1,a)))),t(m)}const d3=qk({ArrowLeft:_a("horiz",-1),ArrowRight:_a("horiz",1),ArrowUp:_a("vert",-1),ArrowDown:_a("vert",1),"Shift-ArrowLeft":Sa("horiz",-1),"Shift-ArrowRight":Sa("horiz",1),"Shift-ArrowUp":Sa("vert",-1),"Shift-ArrowDown":Sa("vert",1),Backspace:wa,"Mod-Backspace":wa,Delete:wa,"Mod-Delete":wa});function La(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function _a(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;if(a instanceof Pe)return La(n,i,ke.near(a.$headCell,t));if(e!="horiz"&&!a.empty)return!1;const o=Tm(r,e,t);if(o==null)return!1;if(e=="horiz")return La(n,i,ke.near(n.doc.resolve(a.head+t),t));{const l=n.doc.resolve(o),c=km(l,e,t);let u;return c?u=ke.near(c,1):t<0?u=ke.near(n.doc.resolve(l.before(-1)),-1):u=ke.near(n.doc.resolve(l.after(-1)),1),La(n,i,u)}}}function Sa(e,t){return(n,i,r)=>{if(!r)return!1;const a=n.selection;let o;if(a instanceof Pe)o=a;else{const c=Tm(r,e,t);if(c==null)return!1;o=new Pe(n.doc.resolve(c))}const l=km(o.$headCell,e,t);return l?La(n,i,new Pe(o.$anchorCell,l)):!1}}function f3(e,t){const n=e.state.doc,i=vi(n.resolve(t));return i?(e.dispatch(e.state.tr.setSelection(new Pe(i))),!0):!1}function p3(e,t,n){if(!Kt(e.state))return!1;let i=s3(n);const r=e.state.selection;if(r instanceof Pe){i||(i={width:1,height:1,rows:[J.from(Cl(mt(e.state.schema).cell,n))]});const a=r.$anchorCell.node(-1),o=r.$anchorCell.start(-1),l=Ge.get(a).rectBetween(r.$anchorCell.pos-o,r.$headCell.pos-o);return i=c3(i,l.right-l.left,l.bottom-l.top),pd(e.state,e.dispatch,o,l,i),!0}else if(i){const a=qo(e.state),o=a.start(-1);return pd(e.state,e.dispatch,o,Ge.get(a.node(-1)).findCell(a.pos-o),i),!0}else return!1}function m3(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;const i=md(e,t.target);let r;if(t.shiftKey&&e.state.selection instanceof Pe)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&(r=vi(e.state.selection.$anchor))!=null&&((n=Ns(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)a(r,t),t.preventDefault();else if(!i)return;function a(c,u){let f=Ns(e,u);const m=Fn.getState(e.state)==null;if(!f||!Ec(c,f))if(m)f=c;else return;const p=new Pe(c,f);if(m||!e.state.selection.eq(p)){const h=e.state.tr.setSelection(p);m&&h.setMeta(Fn,c.pos),e.dispatch(h)}}function o(){e.root.removeEventListener("mouseup",o),e.root.removeEventListener("dragstart",o),e.root.removeEventListener("mousemove",l),Fn.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Fn,-1))}function l(c){const u=c,f=Fn.getState(e.state);let m;if(f!=null)m=e.state.doc.resolve(f);else if(md(e,u.target)!=i&&(m=Ns(e,t),!m))return o();m&&a(m,u)}e.root.addEventListener("mouseup",o),e.root.addEventListener("dragstart",o),e.root.addEventListener("mousemove",l)}function Tm(e,t,n){if(!(e.state.selection instanceof ge))return null;const{$head:i}=e.state.selection;for(let r=i.depth-1;r>=0;r--){const a=i.node(r);if((n<0?i.index(r):i.indexAfter(r))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const o=i.before(r),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?o:null}}return null}function md(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Ns(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:i,pos:r}=n;return i>=0&&vi(e.state.doc.resolve(i))||vi(e.state.doc.resolve(r))}var h3=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),El(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,El(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function El(e,t,n,i,r,a){let o=0,l=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let m=0,p=0;m<u.childCount;m++){const{colspan:h,colwidth:g}=u.child(m).attrs;for(let b=0;b<h;b++,p++){const y=r==p?a:g&&g[b],v=y?y+"px":"";if(o+=y||i,y||(l=!1),c)c.style.width!=v&&(c.style.width=v),c=c.nextSibling;else{const x=document.createElement("col");x.style.width=v,t.appendChild(x)}}}for(;c;){var f;const m=c.nextSibling;(f=c.parentNode)===null||f===void 0||f.removeChild(c),c=m}l?(n.style.width=o+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=o+"px")}}const zt=new rt("tableColumnResizing");function b3({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:i=h3,lastColumnResizable:r=!0}={}){const a=new ct({key:zt,state:{init(o,l){var c;const u=(c=a.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,f=mt(l.schema).table.name;return i&&u&&(u[f]=(m,p)=>new i(m,n,p)),new g3(-1,!1)},apply(o,l){return l.apply(o)}},props:{attributes:o=>{const l=zt.getState(o);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,l)=>{v3(o,l,e,r)},mouseleave:o=>{x3(o)},mousedown:(o,l)=>{y3(o,l,t,n)}},decorations:o=>{const l=zt.getState(o);if(l&&l.activeHandle>-1)return C3(o,l.activeHandle)},nodeViews:{}}});return a}var g3=class Ba{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,i=t.getMeta(zt);if(i&&i.setHandle!=null)return new Ba(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new Ba(n.activeHandle,i.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Sl(t.doc.resolve(r))||(r=-1),new Ba(r,n.dragging)}return n}};function v3(e,t,n,i){if(!e.editable)return;const r=zt.getState(e.state);if(r&&!r.dragging){const a=w3(t.target);let o=-1;if(a){const{left:l,right:c}=a.getBoundingClientRect();t.clientX-l<=n?o=hd(e,t,"left",n):c-t.clientX<=n&&(o=hd(e,t,"right",n))}if(o!=r.activeHandle){if(!i&&o!==-1){const l=e.state.doc.resolve(o),c=l.node(-1),u=Ge.get(c),f=l.start(-1);if(u.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==u.width-1)return}Nm(e,o)}}}function x3(e){if(!e.editable)return;const t=zt.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Nm(e,-1)}function y3(e,t,n,i){var r;if(!e.editable)return!1;const a=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,o=zt.getState(e.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const l=e.state.doc.nodeAt(o.activeHandle),c=k3(e,o.activeHandle,l.attrs);e.dispatch(e.state.tr.setMeta(zt,{setDragging:{startX:t.clientX,startWidth:c}}));function u(m){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",f);const p=zt.getState(e.state);p!=null&&p.dragging&&(_3(e,p.activeHandle,bd(p.dragging,m,n)),e.dispatch(e.state.tr.setMeta(zt,{setDragging:null})))}function f(m){if(!m.which)return u(m);const p=zt.getState(e.state);if(p&&p.dragging){const h=bd(p.dragging,m,n);gd(e,p.activeHandle,h,i)}}return gd(e,o.activeHandle,c,i),a.addEventListener("mouseup",u),a.addEventListener("mousemove",f),t.preventDefault(),!0}function k3(e,t,{colspan:n,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const a=e.domAtPos(t);let o=a.node.childNodes[a.offset].offsetWidth,l=n;if(i)for(let c=0;c<n;c++)i[c]&&(o-=i[c],l--);return o/l}function w3(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function hd(e,t,n,i){const r=n=="right"?-i:i,a=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!a)return-1;const{pos:o}=a,l=vi(e.state.doc.resolve(o));if(!l)return-1;if(n=="right")return l.pos;const c=Ge.get(l.node(-1)),u=l.start(-1),f=c.map.indexOf(l.pos-u);return f%c.width==0?-1:u+c.map[f-1]}function bd(e,t,n){const i=t.clientX-e.startX;return Math.max(n,e.startWidth+i)}function Nm(e,t){e.dispatch(e.state.tr.setMeta(zt,{setHandle:t}))}function _3(e,t,n){const i=e.state.doc.resolve(t),r=i.node(-1),a=Ge.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let u=0;u<a.height;u++){const f=u*a.width+l;if(u&&a.map[f]==a.map[f-a.width])continue;const m=a.map[f],p=r.nodeAt(m).attrs,h=p.colspan==1?0:l-a.colCount(m);if(p.colwidth&&p.colwidth[h]==n)continue;const g=p.colwidth?p.colwidth.slice():S3(p.colspan);g[h]=n,c.setNodeMarkup(o+m,null,{...p,colwidth:g})}c.docChanged&&e.dispatch(c)}function gd(e,t,n,i){const r=e.state.doc.resolve(t),a=r.node(-1),o=r.start(-1),l=Ge.get(a).colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;let c=e.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&El(a,c.firstChild,c,i,l,n)}function S3(e){return Array(e).fill(0)}function C3(e,t){const n=[],i=e.doc.resolve(t),r=i.node(-1);if(!r)return je.empty;const a=Ge.get(r),o=i.start(-1),l=a.colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1;for(let u=0;u<a.height;u++){const f=l+u*a.width;if((l==a.width-1||a.map[f]!=a.map[f+1])&&(u==0||a.map[f]!=a.map[f-a.width])){var c;const m=a.map[f],p=o+m+r.nodeAt(m).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((c=zt.getState(e))===null||c===void 0)&&c.dragging&&n.push(ft.node(o+m,o+m+r.nodeAt(m).nodeSize,{class:"column-resize-dragging"})),n.push(ft.widget(p,h))}}return je.create(e.doc,n)}function E3({allowTableNodeSelection:e=!1}={}){return new ct({key:Fn,state:{init(){return null},apply(t,n){const i=t.getMeta(Fn);if(i!=null)return i==-1?null:i;if(n==null||!t.docChanged)return n;const{deleted:r,pos:a}=t.mapping.mapResult(n);return r?null:a}},props:{decorations:F_,handleDOMEvents:{mousedown:m3},createSelectionBetween(t){return Fn.getState(t.state)!=null?t.state.selection:null},handleTripleClick:f3,handleKeyDown:d3,handlePaste:p3},appendTransaction(t,n,i){return H_(i,Cm(i,n),e)}})}function Al(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function vd(e,t,n,i,r,a){var o;let l=0,c=!0,u=t.firstChild;const f=e.firstChild;if(f!==null)for(let m=0,p=0;m<f.childCount;m+=1){const{colspan:h,colwidth:g}=f.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const y=r===p?a:g&&g[b],v=y?`${y}px`:"";if(l+=y||i,y||(c=!1),u){if(u.style.width!==v){const[x,k]=Al(i,y);u.style.setProperty(x,k)}u=u.nextSibling}else{const x=document.createElement("col"),[k,w]=Al(i,y);x.style.setProperty(k,w),t.appendChild(x)}}}for(;u;){const m=u.nextSibling;(o=u.parentNode)===null||o===void 0||o.removeChild(u),u=m}c?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class A3{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),vd(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,vd(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}function T3(e,t,n,i){let r=0,a=!0;const o=[],l=e.firstChild;if(!l)return{};for(let m=0,p=0;m<l.childCount;m+=1){const{colspan:h,colwidth:g}=l.child(m).attrs;for(let b=0;b<h;b+=1,p+=1){const y=n===p?i:g&&g[b];r+=y||t,y||(a=!1);const[v,x]=Al(t,y);o.push(["col",{style:`${v}: ${x}`}])}}const c=a?`${r}px`:"",u=a?"":`${r}px`;return{colgroup:["colgroup",{},...o],tableWidth:c,tableMinWidth:u}}function xd(e,t){return e.createAndFill()}function N3(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const i=e.nodes[n];i.spec.tableRole&&(t[i.spec.tableRole]=i)}),e.cached.tableNodeTypes=t,t}function O3(e,t,n,i,r){const a=N3(e),o=[],l=[];for(let u=0;u<n;u+=1){const f=xd(a.cell);if(f&&l.push(f),i){const m=xd(a.header_cell);m&&o.push(m)}}const c=[];for(let u=0;u<t;u+=1)c.push(a.row.createChecked(null,i&&u===0?o:l));return a.table.createChecked(null,c)}function M3(e){return e instanceof Pe}const Ca=({editor:e})=>{const{selection:t}=e.state;if(!M3(t))return!1;let n=0;const i=cm(t.ranges[0].$from,a=>a.type.name==="table");return i==null||i.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},D3=Ae.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:A3,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:i,tableMinWidth:r}=T3(e,this.options.cellMinWidth),a=["table",Fe(this.options.HTMLAttributes,t,{style:i?`width: ${i}`:`min-width: ${r}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:i,dispatch:r,editor:a})=>{const o=O3(a.schema,e,t,n);if(r){const l=i.selection.from+1;i.replaceSelectionWith(o).scrollIntoView().setSelection(ge.near(i.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>$_(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>W_(e,t),deleteColumn:()=>({state:e,dispatch:t})=>K_(e,t),addRowBefore:()=>({state:e,dispatch:t})=>J_(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Z_(e,t),deleteRow:()=>({state:e,dispatch:t})=>Y_(e,t),deleteTable:()=>({state:e,dispatch:t})=>o3(e,t),mergeCells:()=>({state:e,dispatch:t})=>sd(e,t),splitCell:()=>({state:e,dispatch:t})=>ld(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Or("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Or("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>r3(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>sd(e,t)?!0:ld(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:i})=>n3(e,t)(n,i),goToNextCell:()=>({state:e,dispatch:t})=>ud(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>ud(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Cm(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const i=Pe.create(t.doc,e.anchorCell,e.headCell);t.setSelection(i)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ca,"Mod-Backspace":Ca,Delete:Ca,"Mod-Delete":Ca}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[b3({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],E3({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:it(pt(e,"tableRole",t))}}}),z3=Ae.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",Fe(this.options.HTMLAttributes,e),0]}}),I3=Ae.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",Fe(this.options.HTMLAttributes,e),0]}}),R3=Ae.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(i=>parseInt(i,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",Fe(this.options.HTMLAttributes,e),0]}}),L3=Ke.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new ct({key:new rt("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=t,r=[];if(!n)return null;const a=this.editor.isEmpty;return e.descendants((o,l)=>{const c=i>=l&&i<=l+o.nodeSize,u=!o.isLeaf&&bc(o);if((c||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];a&&f.push(this.options.emptyEditorClass);const m=ft.node(l,l+o.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:l,hasAnchor:c}):this.options.placeholder});r.push(m)}return this.options.includeChildren}),je.create(e,r)}}})]}}),B3=e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(n=>{var i,r;const a=n.getAttribute("style"),o=(r=(i=n.parentElement)===null||i===void 0?void 0:i.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${o};${a}`)})};Et.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:e=>e.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&B3(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return["span",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(n,i)=>{if(n.isTextblock)return!0;n.marks.filter(r=>r.type===this.type).some(r=>Object.values(r.attrs).some(a=>!!a))||e.removeMark(i,i+n.nodeSize,this.type)}),!0}}}});const P3=Ke.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return(t=e.style.color)===null||t===void 0?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),F3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,V3=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,U3=Et.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:e}){return["mark",Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Kw({find:F3,type:this.type})]},addPasteRules(){return[dm({find:V3,type:this.type})]}});function Om(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d={PROCESSOR_VERSION:"1.4.61",error:function(e){throw typeof Error>"u"?new Error("citeproc-js error: "+e):"citeproc-js error: "+e},debug:function(e){typeof console>"u"?dump("CSL: "+e+`
612
612
  `):console.log("citeproc-js warning: "+e)},toLocaleUpperCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleUpperCase(t)}catch{e=e.toUpperCase()}return e},toLocaleLowerCase(e){var t=this.tmp.lang_array;try{e=e.toLocaleLowerCase(t)}catch{e=e.toLowerCase()}return e},LOCATOR_LABELS_REGEXP:new RegExp("^((vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\\.)\\s+(.*)"),STATUTE_SUBDIV_PLAIN_REGEX:/(?:(?:^| )(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_PLAIN_REGEX_FRONT:/(?:^\s*[.,;]*\s*(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_STRINGS:{"vrs.":"verse","sv.":"sub-verbo","subpara.":"subparagraph","op.":"opus","subch.":"subchapter","add.":"addendum","amend.":"amendment","annot.":"annotation","app.":"appendix","art.":"article","bibliog.":"bibliography","bk.":"book","ch.":"chapter","cl.":"clause","col.":"column","cmt.":"comment","dec.":"decision","dept.":"department","ex.":"example","fig.":"figure","fld.":"field","fol.":"folio","n.":"note","hypo.":"hypothetical","illus.":"illustration","intro.":"introduction","l.":"line","no.":"issue","p.":"page","pp.":"page","para.":"paragraph","pt.":"part","pmbl.":"preamble","princ.":"principle","pub.":"publication","r.":"rule","rn.":"randnummer","sched.":"schedule","sec.":"section","ser.":"series,","subdiv.":"subdivision","subsec.":"subsection","supp.":"supplement","tbl.":"table","tit.":"title","vol.":"volume"},STATUTE_SUBDIV_STRINGS_REVERSE:{verse:"vrs.","sub-verbo":"sv.","sub verbo":"sv.",subparagraph:"subpara.",opus:"op.",subchapter:"subch.",addendum:"add.",amendment:"amend.",annotation:"annot.",appendix:"app.",article:"art.",bibliography:"bibliog.",book:"bk.",chapter:"ch.",clause:"cl.",column:"col.",comment:"cmt.",decision:"dec.",department:"dept.",example:"ex.",figure:"fig.",field:"fld.",folio:"fol.",note:"n.",hypothetical:"hypo.",illustration:"illus.",introduction:"intro.",line:"l.",issue:"no.",page:"p.",paragraph:"para.",part:"pt.",preamble:"pmbl.",principle:"princ.",publication:"pub.",rule:"r.",randnummer:"rn.",schedule:"sched.",section:"sec.","series,":"ser.",subdivision:"subdiv.",subsection:"subsec.",supplement:"supp.",table:"tbl.",title:"tit.",volume:"vol."},LOCATOR_LABELS_MAP:{vrs:"verse",sv:"sub-verbo",subpara:"subparagraph",op:"opus",subch:"subchapter",add:"addendum",amend:"amendment",annot:"annotation",app:"appendix",art:"article",bibliog:"bibliography",bk:"book",ch:"chapter",cl:"clause",col:"column",cmt:"comment",dec:"decision",dept:"department",ex:"example",fig:"figure",fld:"field",fol:"folio",n:"note",hypo:"hypothetical",illus:"illustration",intro:"introduction",l:"line",no:"issue",p:"page",pp:"page",para:"paragraph",pt:"part",pmbl:"preamble",princ:"principle",pub:"publication",r:"rule",rn:"randnummer",sched:"schedule",sec:"section",ser:"series,",subdiv:"subdivision",subsec:"subsection",supp:"supplement",tbl:"table",tit:"title",vol:"volume"},MODULE_MACROS:{"juris-pretitle":!0,"juris-title":!0,"juris-pretitle-short":!0,"juris-title-short":!0,"juris-main":!0,"juris-main-short":!0,"juris-tail":!0,"juris-tail-short":!0,"juris-locator":!0},MODULE_TYPES:{legal_case:!0,legislation:!0,bill:!0,hearing:!0,gazette:!0,report:!0,regulation:!0,standard:!0,patent:!0,locator:!0},checkNestedBrace:function(e){e.opt.xclass==="note"?(this.depth=0,this.update=function(n){for(var n=n||"",i=n.split(/([\(\)])/),r=1,a=i.length;r<a;r+=2)i[r]==="("?(this.depth%2===1&&(i[r]="["),this.depth+=1):i[r]===")"&&(this.depth%2===0&&(i[r]="]"),this.depth-=1);var o=i.join("");return o}):this.update=function(t){return t}},MULTI_FIELDS:["event","publisher","publisher-place","event-place","title","container-title","collection-title","authority","genre","title-short","medium","country","jurisdiction","archive","archive-place"],LangPrefsMap:{title:"titles","title-short":"titles",event:"titles",genre:"titles",medium:"titles","container-title":"journals","collection-title":"titles",archive:"journals",publisher:"publishers",authority:"publishers","publisher-place":"places","event-place":"places","archive-place":"places",jurisdiction:"places",number:"places",edition:"places",issue:"places",volume:"places"},AbbreviationSegments:function(){this["container-title"]={},this["collection-title"]={},this["institution-entire"]={},this["institution-part"]={},this.nickname={},this.number={},this.title={},this.place={},this.hereinafter={},this.classic={},this["container-phrase"]={},this["title-phrase"]={}},getAbbrevsDomain:function(e,t,n){var i=null;if(e.opt.availableAbbrevDomains&&t&&t!=="default"){var r=e.locale[e.opt.lang].opts["jurisdiction-preference"],a=null;if(e.locale[n]&&(a=e.locale[n].opts["jurisdiction-preference"]),a){for(var o=a.length-1;o>-1;o--)if(e.opt.availableAbbrevDomains[t].indexOf(a[o])>-1){i=a[o];break}}if(!i&&r){for(var o=r.length-1;o>-1;o--)if(e.opt.availableAbbrevDomains[t].indexOf(r[o])>-1){i=r[o];break}}}return i},FIELD_CATEGORY_REMAP:{title:"title","container-title":"container-title","collection-title":"collection-title",country:"place",number:"number",place:"place",archive:"container-title","title-short":"title",genre:"title",event:"title",medium:"title","archive-place":"place","publisher-place":"place","event-place":"place",jurisdiction:"place","language-name":"place","language-name-original":"place","call-number":"number","chapter-number":"number","collection-number":"number",edition:"number",page:"number",issue:"number",locator:"number","locator-extra":"number","number-of-pages":"number","number-of-volumes":"number",volume:"number","citation-number":"number",publisher:"institution-part"},parseLocator:function(e){if(this.opt.development_extensions.locator_date_and_revision&&e.locator){e.locator=""+e.locator;var t=e.locator.indexOf("|");if(t>-1){var n=e.locator;e.locator=n.slice(0,t),n=n.slice(t+1);var i=n.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*/);i&&(e["locator-date"]=this.fun.dateparser.parseDateToObject(i[1]),n=n.slice(i[1].length)),e["locator-extra"]=n.replace(/^\s+/,"").replace(/\s+$/,"")}}return e.locator&&(e.locator=(""+e.locator).replace(/\s+$/,"")),e},normalizeLocaleStr:function(e){if(e){var t=e.split("-");return t[0]=t[0].toLowerCase(),t[1]&&(t[1]=t[1].toUpperCase()),t.join("-")}},parseNoteFieldHacks:function(e,t,n){if(typeof e.note=="string"){for(var i=[],r=e.note.split(`
613
613
  `),a=0,o=r.length;a<o;a++){var l=r[a],i=[],c=l.match(d.NOTE_FIELDS_REGEXP);if(c){for(var u=l.split(d.NOTE_FIELDS_REGEXP),f=0,m=u.length-1;f<m;f++)i.push(u[f]),i.push(c[f]);i.push(u[u.length-1]);for(var f=1,m=i.length;f<m&&!(i[f-1].trim()&&(a>0||f>1)&&!i[f-1].match(d.NOTE_FIELD_REGEXP));f+=2)i[f]=`
614
614
  `+i[f].slice(2,-1).trim()+`
@@ -657,8 +657,8 @@
657
657
  `},"@display/block":function(e,t){return`
658
658
  `+t},"@display/left-margin":function(e,t){return t},"@display/right-inline":function(e,t){return t},"@display/indent":function(e,t){return`
659
659
  `+t},"@showid/true":function(e,t,n){return t},"@URL/true":function(e,t){return t},"@DOI/true":function(e,t){return t}};d.Output.Formats=new d.Output.Formats;d.Registry=function(e){this.debug=!1,this.state=e,this.registry={},this.reflist=[],this.refhash={},this.namereg=new d.Registry.NameReg(e),this.citationreg=new d.Registry.CitationReg(e),this.authorstrings={},this.masterMap={},this.mylist=[],this.myhash={},this.deletes=[],this.inserts=[],this.uncited={},this.refreshes={},this.akeys={},this.oldseq={},this.return_data={},this.ambigcites={},this.ambigresets={},this.sorter=new d.Registry.Comparifier(e,"bibliography_sort"),this.getSortedIds=function(){for(var t=[],n=0,i=this.reflist.length;n<i;n+=1)t.push(""+this.reflist[n].id);return t},this.getSortedRegistryItems=function(){for(var t=[],n=0,i=this.reflist.length;n<i;n+=1)t.push(this.reflist[n]);return t}};d.Registry.prototype.init=function(e,t){var n,i;if(this.oldseq={},t){this.uncited={};for(var n=0,i=e.length;n<i;n+=1)this.myhash[e[n]]||this.mylist.push(""+e[n]),this.uncited[e[n]]=!0,this.myhash[e[n]]=!0}else{for(var r in this.uncited)e.push(r);var a={};for(n=e.length-1;n>-1;n+=-1)a[e[n]]?e=e.slice(0,n).concat(e.slice(n+1)):a[e[n]]=!0;this.mylist=e,this.myhash=a}this.refreshes={},this.touched={},this.ambigsTouched={},this.ambigresets={}};d.Registry.prototype.dopurge=function(e){for(var t=this.mylist.length-1;t>-1;t+=-1)this.citationreg.citationsByItemId&&(!this.citationreg.citationsByItemId||!this.citationreg.citationsByItemId[this.mylist[t]])&&!e[this.mylist[t]]&&(delete this.myhash[this.mylist[t]],delete this.uncited[this.mylist[t]],this.mylist=this.mylist.slice(0,t).concat(this.mylist.slice(t+1)));this.dodeletes(this.myhash)};d.Registry.prototype.dodeletes=function(e){var t,n,i,r,a,o,l,c,u;if(typeof e=="string"){var n=e;e={},e[n]=!0}for(var n in this.registry)if(!e[n]){if(this.uncited[n])continue;t=this.namereg.delitems(n);for(l in t)this.refreshes[l]=!0;for(i=this.registry[n].ambig,c=this.ambigcites[i].indexOf(n),c>-1&&(o=this.ambigcites[i].slice(),this.ambigcites[i]=o.slice(0,c).concat(o.slice(c+1,o.length)),this.ambigresets[i]=this.ambigcites[i].length),a=this.ambigcites[i].length,r=0;r<a;r+=1)u=""+this.ambigcites[i][r],this.refreshes[u]=!0;if(this.registry[n].siblings){if(this.registry[n].siblings.length==1){var f=this.registry[n].siblings[0];this.registry[f].siblings&&(this.registry[f].siblings.pop(),this.registry[f].master=!0)}else if(this.registry[n].siblings.length>1){var m=[n];if(this.registry[n].master){var p=this.registry[n].siblings[0],h=this.registry[p];h.master=!0,m.push(p)}for(var g=[],b=this.registry[n].siblings.length-1;b>-1;b+=-1){var y=this.registry[n].siblings.pop();m.indexOf(y)===-1&&g.push(y)}for(var b=g.length-1;b>-1;b+=-1)this.registry[n].siblings.push(g[b])}}for(var v=this.reflist.length-1;v>-1;v--)this.reflist[v].id===n&&(this.reflist=this.reflist.slice(0,v).concat(this.reflist.slice(v+1)));delete this.registry[n],delete this.refhash[n],this.return_data.bibchange=!0}};d.Registry.prototype.doinserts=function(e){var t,n,i,r,a,o,l;typeof e=="string"&&(e=[e]);for(var o=0,l=e.length;o<l;o+=1)t=e[o],this.registry[t]||(n=this.state.retrieveItem(t),i=d.getAmbiguousCite.call(this.state,n),this.ambigsTouched[i]=!0,n.legislation_id||(this.akeys[i]=!0),r={id:""+t,seq:0,offset:0,sortkeys:!1,ambig:!1,rendered:!1,disambig:!1,ref:n,newItem:!0},this.registry[t]=r,this.citationreg.citationsByItemId&&this.citationreg.citationsByItemId[t]&&(this.registry[t]["first-reference-note-number"]=this.citationreg.citationsByItemId[t][0].properties.noteIndex),a=d.getAmbigConfig.call(this.state),this.registerAmbigToken(i,t,a),this.touched[t]=!0,this.return_data.bibchange=!0)};d.Registry.prototype.rebuildlist=function(e){var t,n,i,r;if(e)for(this.reflist=[],t=this.mylist.length,n=0;n<t;n+=1)i=this.mylist[n],r=this.registry[i],this.reflist.push(r),this.oldseq[i]=this.registry[i].seq,this.registry[i].seq=n+1;else for(this.reflist_inserts=[],t=this.mylist.length,n=0;n<t;n+=1)i=this.mylist[n],r=this.registry[i],r.newItem&&this.reflist_inserts.push(r),this.oldseq[i]=this.registry[i].seq,this.registry[i].seq=n+1};d.Registry.prototype.dorefreshes=function(){var e,t,n,i,r;for(var e in this.refreshes)if(t=this.registry[e],!!t){t.sortkeys=void 0,n=this.state.refetchItem(e);var i=t.ambig;typeof i>"u"&&(this.state.tmp.disambig_settings=!1,i=d.getAmbiguousCite.call(this.state,n),r=d.getAmbigConfig.call(this.state),this.registerAmbigToken(i,e,r));for(var a in this.ambigresets)if(this.ambigresets[a]===1){var o=this.ambigcites[i][0],n=this.state.refetchItem(o);this.registry[o].disambig=new d.AmbigConfig,this.state.tmp.disambig_settings=!1;var i=d.getAmbiguousCite.call(this.state,n),r=d.getAmbigConfig.call(this.state);this.registerAmbigToken(i,o,r)}this.state.tmp.taintedItemIDs[e]=!0,this.ambigsTouched[i]=!0,n.legislation_id||(this.akeys[i]=!0),this.touched[e]=!0}};d.Registry.prototype.setdisambigs=function(){for(var e in this.ambigsTouched)this.state.disambiguate.run(e);this.ambigsTouched={},this.akeys={}};d.Registry.prototype.renumber=function(){var e,t,n;for(this.state.bibliography_sort.opt.citation_number_sort_direction===d.DESCENDING&&(this.state.bibliography_sort.tmp.citation_number_map={}),e=this.reflist.length,t=0;t<e;t+=1)n=this.reflist[t],n.seq=t+1,this.state.bibliography_sort.opt.citation_number_sort_direction===d.DESCENDING&&(this.state.bibliography_sort.tmp.citation_number_map[n.seq]=this.reflist.length-n.seq+1),this.state.opt.update_mode===d.NUMERIC&&n.seq!=this.oldseq[n.id]&&(this.state.tmp.taintedItemIDs[n.id]=!0),n.seq!=this.oldseq[n.id]&&(this.return_data.bibchange=!0)};d.Registry.prototype.setsortkeys=function(){for(var e,t=0,n=this.mylist.length;t<n;t+=1){var e=this.mylist[t];(this.touched[e]||this.state.tmp.taintedItemIDs[e]||!this.registry[e].sortkeys)&&(this.registry[e].sortkeys=d.getSortKeys.call(this.state,this.state.retrieveItem(e),"bibliography_sort"))}};d.Registry.prototype._insertItem=function(e,t){return t.splice(this._locationOf(e,t)+1,0,e),t};d.Registry.prototype._locationOf=function(e,t,n,i){if(t.length===0)return-1;n=n||0,i=i||t.length;var r=n+i>>1,a=this.sorter.compareKeys(e,t[r]);if(i-n<=1)return a==-1?r-1:r;switch(a){case-1:return this._locationOf(e,t,n,r);case 0:return r;case 1:return this._locationOf(e,t,r,i)}};d.Registry.prototype.sorttokens=function(e){var t,n,i,r;if(!e){for(this.reflist_inserts=[],t=this.mylist.length,r=0;r<t;r+=1)n=this.mylist[r],i=this.registry[n],i.newItem&&this.reflist_inserts.push(i);for(var a in this.state.tmp.taintedItemIDs)if(this.registry[a]&&!this.registry[a].newItem)for(var o=this.reflist.length-1;o>-1;o--)this.reflist[o].id===a&&(this.reflist_inserts.push(this.reflist[o]),this.reflist=this.reflist.slice(0,o).concat(this.reflist.slice(o+1)));for(var o=0,l=this.reflist_inserts.length;o<l;o++){var i=this.reflist_inserts[o];delete i.newItem,this.reflist=this._insertItem(i,this.reflist)}for(r=0;r<t;r+=1)n=this.mylist[r],i=this.registry[n],this.registry[n].seq=r+1}};d.Registry.Comparifier=function(e,t){var n,i,r,a,o=d.getSortCompare.call(e,e.opt["default-locale-sort"]);n=e[t].opt.sort_directions,this.compareKeys=function(l,c){for(i=l.sortkeys?l.sortkeys.length:0,r=0;r<i;r+=1){var u=0;if(l.sortkeys[r]===c.sortkeys[r]?u=0:typeof l.sortkeys[r]>"u"?u=n[r][1]:typeof c.sortkeys[r]>"u"?u=n[r][0]:u=o(l.sortkeys[r],c.sortkeys[r]),0<u)return n[r][1];if(0>u)return n[r][0]}return l.seq>c.seq?1:l.seq<c.seq?-1:0},a=this.compareKeys,this.compareCompositeKeys=function(l,c){return a(l[1],c[1])}};d.Registry.prototype.compareRegistryTokens=function(e,t){return e.seq>t.seq?1:e.seq<t.seq?-1:0};d.Registry.prototype.registerAmbigToken=function(e,t,n){if(this.registry[t]||d.debug("Warning: unregistered item: itemID=("+t+"), akey=("+e+")"),this.registry[t]&&this.registry[t].disambig&&this.registry[t].disambig.names)for(var i=0,r=n.names.length;i<r;i+=1){var a=n.names[i],o=this.registry[t].disambig.names[i];if(a!==o)this.state.tmp.taintedItemIDs[t]=!0;else if(n.givens[i])for(var l=0,c=n.givens[i].length;l<c;l+=1){var u=n.givens[i][l],f=this.registry[t].disambig.givens[i][l];u!==f&&(this.state.tmp.taintedItemIDs[t]=!0)}}this.ambigcites[e]||(this.ambigcites[e]=[]),this.ambigcites[e].indexOf(""+t)===-1&&this.ambigcites[e].push(""+t),this.registry[t].ambig=e,this.registry[t].disambig=d.cloneAmbigConfig(n)};d.getSortKeys=function(e,t){var n,i,r,a,o,l;for(n=this.tmp.area,i=this.tmp.root,r=this.tmp.extension,a=d.Util.Sort.strip_prepositions,this.tmp.area=t,this.tmp.root=t.indexOf("_")>-1?t.slice(0,-5):t,this.tmp.extension="_sort",this.tmp.disambig_override=!0,this.tmp.disambig_request=!1,this.tmp.suppress_decorations=!0,d.getCite.call(this,e),this.tmp.suppress_decorations=!1,this.tmp.disambig_override=!1,o=this[t].keys.length,l=0;l<o;l+=1)this[t].keys[l]=a(this[t].keys[l]);return this.tmp.area=n,this.tmp.root=i,this.tmp.extension=r,this[t].keys};d.Registry.NameReg=function(e){var t,n,i,r,a,o,l,c,u,f,m,p;this.state=e,this.namereg={},this.nameind={},this.nameindpkeys={},this.itemkeyreg={},l=function(h){return h||(h=""),h.replace(/\./g," ").replace(/\s+/g," ").replace(/\s+$/,"")},c=function(h,g,b){t=l(b.family),h.opt["demote-non-dropping-particle"]==="never"&&b["non-dropping-particle"]&&b.family&&(t=`${t} ${b["non-dropping-particle"]}`),i=l(b.given);var y=i.match(/[,\!]* ([^,]+)$/);y&&y[1]===y[1].toLowerCase()&&(i=i.replace(/[,\!]* [^,]+$/,"")),n=d.Util.Names.initializeWith(h,i,"%s"),h.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&(t=""+g+t)},u=function(h,g,b,y,v,x){var k;if(e.tmp.area.slice(0,12)==="bibliography"&&!v)return typeof x=="string"?1:2;var w=e.nameOutput.getName(g,"locale-translit",!0);g=w.name,c(this.state,""+h,g),k=2,r=e.opt["disambiguate-add-givenname"],a=e.citation.opt["givenname-disambiguation-rule"];var S=a;if(a==="by-cite"&&(a="all-names"),v==="short"?k=0:typeof x=="string"&&(k=1),typeof this.namereg[t]>"u"||typeof this.namereg[t].ikey[n]>"u")return k;if(S==="by-cite"&&k<=y)return y;if(!r||typeof a=="string"&&a.slice(0,12)==="primary-name"&&b>0||(!a||a==="all-names"||a==="primary-name"?(this.namereg[t].count>1&&(k=1),(this.namereg[t].ikey&&this.namereg[t].ikey[n].count>1||this.namereg[t].count>1&&typeof x!="string")&&(k=2)):(a==="all-names-with-initials"||a==="primary-name-with-initials")&&(this.namereg[t].count>1?k=1:k=0),e.registry.registry[h]))return k;if(v=="short")return 0;if(typeof x=="string")return 1},f=function(h){var g,b,y,v,x;(typeof h=="string"||typeof h=="number")&&(h=[""+h]);var k={};for(b=h.length,g=0;g<b;g+=1)if(v=""+h[g],!!this.nameind[v]){for(x in this.nameind[v])if(this.nameind[v].hasOwnProperty(x)){var w=x.split("::");if(t=w[0],n=w[1],i=w[2],typeof this.namereg[t]>"u")continue;if(o=this.namereg[t].items,i&&this.namereg[t].ikey[n]&&this.namereg[t].ikey[n].skey[i]&&(p=this.namereg[t].ikey[n].skey[i].items,y=p.indexOf(""+v),y>-1&&(this.namereg[t].ikey[n].skey[i].items=p.slice(0,y).concat(p.slice([y+1]))),this.namereg[t].ikey[n].skey[i].items.length===0&&(delete this.namereg[t].ikey[n].skey[i],this.namereg[t].ikey[n].count+=-1,this.namereg[t].ikey[n].count<2)))for(var S=0,A=this.namereg[t].ikey[n].items.length;S<A;S+=1)e.tmp.taintedItemIDs[this.namereg[t].ikey[n].items[S]]=!0;if(n&&this.namereg[t].ikey[n]&&(y=this.namereg[t].ikey[n].items.indexOf(""+v),y>-1&&(o=this.namereg[t].ikey[n].items.slice(),this.namereg[t].ikey[n].items=o.slice(0,y).concat(o.slice([y+1]))),this.namereg[t].ikey[n].items.length===0&&(delete this.namereg[t].ikey[n],this.namereg[t].count+=-1,this.namereg[t].count<2)))for(var S=0,A=this.namereg[t].items.length;S<A;S+=1)e.tmp.taintedItemIDs[this.namereg[t].items[S]]=!0;t&&(y=this.namereg[t].items.indexOf(""+v),y>-1&&(o=this.namereg[t].items.slice(),this.namereg[t].items=o.slice(0,y).concat(o.slice([y+1],o.length))),this.namereg[t].items.length<2&&delete this.namereg[t]),delete this.nameind[v][x]}delete this.nameind[v],delete this.nameindpkeys[v]}return k},m=function(h,g,b){var y,v,x=e.nameOutput.getName(g,"locale-translit",!0);if(g=x.name,!(e.citation.opt["givenname-disambiguation-rule"]&&e.citation.opt["givenname-disambiguation-rule"].slice(0,8)==="primary-"&&b!==0)){if(c(this.state,""+h,g),t&&(typeof this.namereg[t]>"u"?(this.namereg[t]={},this.namereg[t].count=0,this.namereg[t].ikey={},this.namereg[t].items=[h]):this.namereg[t].items.indexOf(h)===-1&&this.namereg[t].items.push(h)),t&&n)if(typeof this.namereg[t].ikey[n]>"u"){if(this.namereg[t].ikey[n]={},this.namereg[t].ikey[n].count=0,this.namereg[t].ikey[n].skey={},this.namereg[t].ikey[n].items=[h],this.namereg[t].count+=1,this.namereg[t].count===2)for(var y=0,v=this.namereg[t].items.length;y<v;y+=1)e.tmp.taintedItemIDs[this.namereg[t].items[y]]=!0}else this.namereg[t].ikey[n].items.indexOf(h)===-1&&this.namereg[t].ikey[n].items.push(h);if(t&&n&&i)if(typeof this.namereg[t].ikey[n].skey[i]>"u"){if(this.namereg[t].ikey[n].skey[i]={},this.namereg[t].ikey[n].skey[i].items=[h],this.namereg[t].ikey[n].count+=1,this.namereg[t].ikey[n].count===2)for(var y=0,v=this.namereg[t].ikey[n].items.length;y<v;y+=1)e.tmp.taintedItemIDs[this.namereg[t].ikey[n].items[y]]=!0}else this.namereg[t].ikey[n].skey[i].items.indexOf(h)===-1&&this.namereg[t].ikey[n].skey[i].items.push(h);typeof this.nameind[h]>"u"&&(this.nameind[h]={},this.nameindpkeys[h]={}),t&&(this.nameind[h][t+"::"+n+"::"+i]=!0,this.nameindpkeys[h][t]=this.namereg[t])}},this.addname=m,this.delitems=f,this.evalname=u};d.Registry.CitationReg=function(){this.citationById={},this.citationByIndex=[]};d.Disambiguation=function(e){this.state=e,this.sys=this.state.sys,this.registry=e.registry.registry,this.ambigcites=e.registry.ambigcites,this.configModes(),this.debug=!1};d.Disambiguation.prototype.run=function(e){this.modes.length&&(this.debug&&this.state.sys.print("[A] === RUN ==="),this.akey=e,this.initVars(e)&&this.runDisambig())};d.Disambiguation.prototype.runDisambig=function(){var e;for(this.debug&&this.state.sys.print("[C] === runDisambig() ==="),this.initGivens=!0;this.lists.length;){for(this.gnameset=0,this.gname=0,this.clashes=[1,0];this.lists[0][1].length;)this.listpos=0,this.base||(this.base=this.lists[0][0]),e=this.incrementDisambig(),this.scanItems(this.lists[0]),this.evalScan(e);this.lists=this.lists.slice(1)}};d.Disambiguation.prototype.scanItems=function(e){var t,n,i;this.debug&&this.state.sys.print("[2] === scanItems() ==="),this.Item=e[1][0],this.ItemCite=d.getAmbiguousCite.call(this.state,this.Item,this.base,!0),this.scanlist=e[1],this.partners=[],this.partners.push(this.Item),this.nonpartners=[];for(var r=0,t=1,n=e[1].length;t<n;t+=1){i=e[1][t];var a=d.getAmbiguousCite.call(this.state,i,this.base,!0);this.debug&&t>1&&this.state.sys.print(" -----------"),this.ItemCite===a?(this.debug&&(this.state.sys.print(" [CLASH]--> "+this.Item.id+": "+this.ItemCite),this.state.sys.print(" "+i.id+": "+a)),r+=1,this.partners.push(i)):(this.debug&&(this.state.sys.print(" [clear]--> "+this.Item.id+": "+this.ItemCite),this.state.sys.print(" "+i.id+": "+a)),this.nonpartners.push(i))}this.clashes[0]=this.clashes[1],this.clashes[1]=r};d.Disambiguation.prototype.evalScan=function(e){this[this.modes[this.modeindex]](e),e&&(this.modeindex<this.modes.length-1?this.modeindex+=1:this.lists[this.listpos+1]=[this.base,[]])};d.Disambiguation.prototype.disNames=function(e){var t,n;if(this.debug&&this.state.sys.print("[3] == disNames() =="),this.clashes[1]===0&&this.nonpartners.length===1)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [a]: lone partner, one nonpartner"),this.state.sys.print(" registering "+this.partners[0].id+" and "+this.nonpartners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase),this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,[]];else if(this.clashes[1]===0)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [b]: lone partner, unknown number of remaining nonpartners"),this.state.sys.print(" registering "+this.partners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.partners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,this.nonpartners],this.nonpartners.length&&(this.initGivens=!0);else if(this.nonpartners.length===1)this.captureStepToBase(),this.debug&&(this.state.sys.print(" ** RESOLUTION [c]: lone nonpartner, unknown number of partners remaining"),this.state.sys.print(" registering "+this.nonpartners[0].id)),this.state.registry.registerAmbigToken(this.akey,""+this.nonpartners[0].id,this.betterbase),this.lists[this.listpos]=[this.betterbase,this.partners];else if(this.clashes[1]<this.clashes[0])this.captureStepToBase(),this.debug&&this.state.sys.print(" ** RESOLUTION [d]: better result, but no entries safe to register"),this.lists[this.listpos]=[this.betterbase,this.partners],this.lists.push([this.betterbase,this.nonpartners]);else if(this.debug&&this.state.sys.print(" ** RESOLUTION [e]: no improvement, and clashes remain"),e&&(this.lists[this.listpos]=[this.betterbase,this.nonpartners],this.lists.push([this.betterbase,this.partners]),this.modeindex===this.modes.length-1)){this.debug&&this.state.sys.print(" (registering clashing entries because we've run out of options)");for(var t=0,n=this.partners.length;t<n;t+=1)this.state.registry.registerAmbigToken(this.akey,""+this.partners[t].id,this.betterbase);this.lists[this.listpos]=[this.betterbase,[]]}};d.Disambiguation.prototype.disExtraText=function(){this.debug&&this.state.sys.print("[3] === disExtraText ==");var e=!1;if(this.clashes[1]===0&&this.nonpartners.length<2&&(e=!0),!e&&(!this.base.disambiguate||this.state.tmp.disambiguate_count!==this.state.tmp.disambiguate_maxMax))if(this.modeindex=0,this.base.disambiguate=this.state.tmp.disambiguate_count,this.betterbase.disambiguate=this.state.tmp.disambiguate_count,this.base.disambiguate)this.disNames();else{this.initGivens=!0,this.base.disambiguate=1;for(var t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0}else if(e||this.state.tmp.disambiguate_count===this.state.tmp.disambiguate_maxMax)if(e||this.modeindex===this.modes.length-1){for(var i=this.lists[this.listpos][0],t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0,this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][t].id,i);this.lists[this.listpos]=[this.betterbase,[]]}else{this.modeindex=this.modes.length-1;var i=this.lists[this.listpos][0];i.disambiguate=!0;for(var t=0,n=this.lists[this.listpos][1].length;t<n;t+=1)this.state.tmp.taintedItemIDs[this.lists[this.listpos][1][t].id]=!0,this.state.registry.registerAmbigToken(this.akey,""+this.lists[this.listpos][1][t].id,i)}};d.Disambiguation.prototype.disYears=function(){var e,t,n,i;this.debug&&this.state.sys.print("[3] === disYears =="),n=[];var r=this.lists[this.listpos][0];if(this.clashes[1])for(var a=0,o=this.state.registry.mylist.length;a<o;a+=1)for(var l=this.state.registry.mylist[a],c=0,u=this.lists[this.listpos][1].length;c<u;c+=1){var i=this.lists[this.listpos][1][c];if(i.id==l){n.push(this.registry[i.id]);break}}n.sort(this.state.registry.sorter.compareKeys);for(var e=0,t=n.length;e<t;e+=1){r.year_suffix=""+e;var f=this.state.registry.registry[n[e].id].disambig;this.state.registry.registerAmbigToken(this.akey,""+n[e].id,r),d.ambigConfigDiff(f,r)&&(this.state.tmp.taintedItemIDs[n[e].id]=!0)}this.lists[this.listpos]=[this.betterbase,[]]};d.Disambiguation.prototype.incrementDisambig=function(){if(this.debug&&this.state.sys.print(`
660
- [1] === incrementDisambig() ===`),this.initGivens)return this.initGivens=!1,!1;var e=!1,t=!0;if(this.modes[this.modeindex]==="disNames"){t=!1,typeof this.givensMax!="number"&&(t=!0);var n=!1;typeof this.namesMax!="number"&&(n=!0),typeof this.givensMax=="number"&&(this.base.givens.length&&this.base.givens[this.gnameset][this.gname]<this.givensMax?this.base.givens[this.gnameset][this.gname]+=1:t=!0),typeof this.namesMax=="number"&&t&&(this.state.opt["disambiguate-add-names"]?(n=!1,this.gname<this.namesMax?(this.base.names[this.gnameset]+=1,this.gname+=1):n=!0):n=!0),typeof this.namesetsMax=="number"&&n&&this.gnameset<this.namesetsMax&&(this.gnameset+=1,this.base.names[this.gnameset]=1,this.gname=0),this.debug&&(this.state.sys.print(" ------------------"),this.state.sys.print(" incremented values"),this.state.sys.print(" ------------------"),this.state.sys.print(" | gnameset: "+this.gnameset),this.state.sys.print(" | gname: "+this.gname),this.state.sys.print(" | names value: "+this.base.names[this.gnameset]),this.base.givens.length?this.state.sys.print(" | givens value: "+this.base.givens[this.gnameset][this.gname]):this.state.sys.print(" | givens value: nil"),this.state.sys.print(" | namesetsMax: "+this.namesetsMax),this.state.sys.print(" | namesMax: "+this.namesMax),this.state.sys.print(" | givensMax: "+this.givensMax)),(typeof this.namesetsMax!="number"||this.namesetsMax===-1||this.gnameset===this.namesetsMax)&&(!this.state.opt["disambiguate-add-names"]||typeof this.namesMax!="number"||this.gname===this.namesMax)&&(typeof this.givensMax!="number"||typeof this.base.givens[this.gnameset]>"u"||typeof this.base.givens[this.gnameset][this.gname]>"u"||this.base.givens[this.gnameset][this.gname]===this.givensMax)&&(e=!0,this.debug&&this.state.sys.print(" MAXED"))}else this.modes[this.modeindex]==="disExtraText"&&(this.base.disambiguate+=1,this.betterbase.disambiguate+=1);return e};d.Disambiguation.prototype.initVars=function(e){var a,o,t,n,i;if(this.debug&&this.state.sys.print("[B] === initVars() ==="),this.lists=[],this.base=!1,this.betterbase=!1,this.akey=e,this.maxNamesByItemId={},n=[],t=this.ambigcites[e],!t||!t.length)return!1;var r=this.state.refetchItem(""+t[0]);if(this.getCiteData(r),this.base=d.getAmbigConfig.call(this.state),t&&t.length>1){n.push([this.maxNamesByItemId[r.id],r]);for(var a=1,o=t.length;a<o;a+=1)r=this.state.refetchItem(""+t[a]),this.getCiteData(r,this.base),n.push([this.maxNamesByItemId[r.id],r]);n.sort(function(l,c){return l[0]>c[0]?1:l[0]<c[0]?-1:l[1].id>c[1].id?1:l[1].id<c[1].id?-1:0}),i=[];for(var a=0,o=n.length;a<o;a+=1)i.push(n[a][1]);this.lists.push([this.base,i]),this.Item=this.lists[0][1][0]}else this.Item=this.state.refetchItem(""+t[0]);this.modeindex=0;var a,o;return this.state.citation.opt["disambiguate-add-names"],this.namesMax=this.maxNamesByItemId[this.Item.id][0],this.padBase(this.base),this.padBase(this.betterbase),this.base.year_suffix=!1,this.base.disambiguate=!1,this.betterbase.year_suffix=!1,this.betterbase.disambiguate=!1,this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.state.opt["disambiguate-add-givenname"]&&(this.givensMax=2),!0};d.Disambiguation.prototype.padBase=function(e){for(var t=0,n=e.names.length;t<n;t+=1){e.givens[t]||(e.givens[t]=[]);for(var i=0,r=e.names[t];i<r;i+=1)e.givens[t][i]||(e.givens[t][i]=0)}};d.Disambiguation.prototype.configModes=function(){var e,t;this.modes=[],e=this.state.opt["disambiguate-add-givenname"],t=this.state.citation.opt["givenname-disambiguation-rule"],(this.state.opt["disambiguate-add-names"]||e&&t==="by-cite")&&this.modes.push("disNames"),this.state.opt.development_extensions.prioritize_disambiguate_condition?(this.state.opt.has_disambiguate&&this.modes.push("disExtraText"),this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears")):(this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears"),this.state.opt.has_disambiguate&&this.modes.push("disExtraText"))};d.Disambiguation.prototype.getCiteData=function(e,t){if(!this.maxNamesByItemId[e.id]){d.getAmbiguousCite.call(this.state,e,t),t=d.getAmbigConfig.call(this.state),this.maxNamesByItemId[e.id]=d.getMaxVals.call(this.state),this.state.registry.registry[e.id].disambig.givens=this.state.tmp.disambig_settings.givens.slice();for(var n=0,i=this.state.registry.registry[e.id].disambig.givens.length;n<i;n+=1)this.state.registry.registry[e.id].disambig.givens[n]=this.state.tmp.disambig_settings.givens[n].slice();this.namesetsMax=this.state.registry.registry[e.id].disambig.names.length-1,this.base||(this.base=t,this.betterbase=d.cloneAmbigConfig(t)),t.names.length<this.base.names.length&&(this.base=t);for(var n=0,i=t.names.length;n<i;n+=1)t.names[n]>this.base.names[n]&&(this.base.givens[n]=t.givens[n].slice(),this.base.names[n]=t.names[n],this.betterbase.names=this.base.names.slice(),this.betterbase.givens=this.base.givens.slice(),this.padBase(this.base),this.padBase(this.betterbase));this.betterbase.givens=this.base.givens.slice();for(var r=0,a=this.base.givens.length;r<a;r+=1)this.betterbase.givens[r]=this.base.givens[r].slice()}};d.Disambiguation.prototype.captureStepToBase=function(){this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.base.givens&&this.base.givens.length&&typeof this.base.givens[this.gnameset][this.gname]<"u"&&(this.betterbase.givens.length<this.base.givens.length&&(this.betterbase.givens=JSON.parse(JSON.stringify(this.base.givens))),this.betterbase.givens[this.gnameset][this.gname]=this.base.givens[this.gnameset][this.gname]),this.betterbase.names[this.gnameset]=this.base.names[this.gnameset]};d.Engine.prototype.getJurisdictionList=function(e){for(var t=[],n=e.split(":"),i=n.length;i>0;i--){var r=n.slice(0,i).join(":");if(t.push(r),this.opt.jurisdiction_fallbacks[r]){var a=this.opt.jurisdiction_fallbacks[r];t.push(a)}}return t.indexOf("us")===-1&&t.push("us"),t};d.Engine.prototype.loadStyleModule=function(e,t,n){var i=null;this.juris[e]={};var r=d.setupXml(t);r.addMissingNameNodes(r.dataObj),r.addInstitutionNodes(r.dataObj),r.insertPublisherAndPlace(r.dataObj),r.flagDateMacros(r.dataObj);for(var m=r.getNodesByName(r.dataObj,"law-module"),a=0,o=m.length;a<o;a++){var l=r.getAttributeValue(m[a],"types");if(l){this.juris[e].types={},l=l.split(/\s+/);for(var c=0,u=l.length;c<u;c++)this.juris[e].types[l[c]]=!0}n||(i=r.getAttributeValue(m[a],"fallback"),i&&e!=="us"&&(this.opt.jurisdiction_fallbacks[e]=i))}var f=this.opt.lang?this.opt.lang:this.opt["default-locale"][0];d.SET_COURT_CLASSES(this,f,r,r.dataObj),this.juris[e].types||(this.juris[e].types=d.MODULE_TYPES);for(var m=r.getNodesByName(r.dataObj,"macro"),a=0,o=m.length;a<o;a++){var p=r.getAttributeValue(m[a],"name");if(!d.MODULE_MACROS[p]){d.debug('CSL: skipping non-modular macro name "'+p+'" in module context');continue}this.juris[e][p]=[],this.buildTokenLists(m[a],this.juris[e][p]),this.configureTokenList(this.juris[e][p])}return i};d.Engine.prototype.retrieveAllStyleModules=function(e){var t={},n=this.locale[this.opt.lang].opts["jurisdiction-preference"];n=n||[],n=[""].concat(n);for(var i=n.length-1;i>-1;i--)for(var r=n[i],a=0,o=e.length;a<o;a++){var l=e[a];if(!this.opt.jurisdictions_seen[l]){var c=this.sys.retrieveStyleModule(l,r);(!c&&!r||c)&&(this.opt.jurisdictions_seen[l]=!0),c&&(t[l]=c)}}return t};d.ParticleList=function(){var e=[[[0,1],null]],t=[[[0,3],null]],n=[[null,[0,1]]],i=[[null,[0,2]]],r=[[null,[0,3]]],a=[[null,[0,1]],[[0,1],null]],o=[[null,[0,2]],[[0,2],null]],l=[[[0,1],null],[null,[0,1]]],c=[[[0,2],null],[null,[0,2]]],u=[[[0,3],null],[null,[0,3]]],f=[[null,[0,2]],[[0,1],[1,2]]],m=[["'s",n],["'s-",n],["'t",n],["a",n],["aan 't",i],["aan de",i],["aan den",i],["aan der",i],["aan het",i],["aan t",i],["aan",n],["ad-",a],["adh-",a],["af",a],["al",a],["al-",a],["am de",i],["am",n],["an-",a],["ar-",a],["as-",a],["ash-",a],["at-",a],["ath-",a],["auf dem",c],["auf den",c],["auf der",c],["auf ter",i],["auf",l],["aus 'm",c],["aus dem",c],["aus den",c],["aus der",c],["aus m",c],["aus",l],["aus'm",c],["az-",a],["aš-",a],["aḍ-",a],["aḏ-",a],["aṣ-",a],["aṭ-",a],["aṯ-",a],["aẓ-",a],["ben",n],["bij 't",i],["bij de",i],["bij den",i],["bij het",i],["bij t",i],["bij",n],["bin",n],["boven d",i],["boven d'",i],["d",n],["d'",a],["da",a],["dal",n],["dal'",n],["dall'",n],["dalla",n],["das",a],["de die le",r],["de die",i],["de l",i],["de l'",i],["de la",f],["de las",f],["de le",i],["de li",o],["de van der",r],["de",a],["de'",a],["deca",n],["degli",a],["dei",a],["del",a],["dela",e],["dell'",a],["della",a],["delle",a],["dello",a],["den",a],["der",a],["des",a],["di",a],["die le",i],["do",n],["don",n],["dos",a],["du",a],["ed-",a],["edh-",a],["el",a],["el-",a],["en-",a],["er-",a],["es-",a],["esh-",a],["et-",a],["eth-",a],["ez-",a],["eš-",a],["eḍ-",a],["eḏ-",a],["eṣ-",a],["eṭ-",a],["eṯ-",a],["eẓ-",a],["het",n],["i",n],["il",e],["im",n],["in 't",i],["in de",i],["in den",i],["in der",o],["in het",i],["in t",i],["in",n],["l",n],["l'",n],["la",n],["las",n],["le",n],["les",a],["lo",a],["los",n],["lou",n],["of",n],["onder 't",i],["onder de",i],["onder den",i],["onder het",i],["onder t",i],["onder",n],["op 't",i],["op de",o],["op den",i],["op der",i],["op gen",i],["op het",i],["op t",i],["op ten",i],["op",n],["over 't",i],["over de",i],["over den",i],["over het",i],["over t",i],["over",n],["s",n],["s'",n],["sen",e],["t",n],["te",n],["ten",n],["ter",n],["tho",n],["thoe",n],["thor",n],["to",n],["toe",n],["tot",n],["uijt 't",i],["uijt de",i],["uijt den",i],["uijt te de",r],["uijt ten",i],["uijt",n],["uit 't",i],["uit de",i],["uit den",i],["uit het",i],["uit t",i],["uit te de",r],["uit ten",i],["uit",n],["unter",n],["v",n],["v.",n],["v.d.",n],["van 't",i],["van de l",r],["van de l'",r],["van de",i],["van de",i],["van den",i],["van der",i],["van gen",i],["van het",i],["van la",i],["van t",i],["van ter",i],["van van de",r],["van",a],["vander",n],["vd",n],["ver",n],["vom und zum",t],["vom",a],["von 't",i],["von dem",c],["von den",c],["von der",c],["von t",i],["von und zu",u],["von zu",c],["von",l],["voor 't",i],["voor de",i],["voor den",i],["voor in 't",r],["voor in t",r],["voor",n],["vor der",c],["vor",l],["z",e],["ze",e],["zu",l],["zum",a],["zur",a]];return m}();d.parseParticles=function(){function e(i,r,a){var o=i;i=i;var l=[],c,u;r?(i=i.split("").reverse().join(""),c=d.PARTICLE_GIVEN_REGEXP):c=d.PARTICLE_FAMILY_REGEXP;for(var f=i.match(c);f;){var m=r?f[1].split("").reverse().join(""):f[1],p=f?m:!1,p=p?m.replace(/^[-\'\u02bb\u2019\s]*(.).*$/,"$1"):!1;if(u=p?p.toUpperCase()!==p:!1,!u)break;r?(l.push(o.slice(m.length*-1)),o=o.slice(0,m.length*-1)):(l.push(o.slice(0,m.length)),o=o.slice(m.length)),i=f[2],f=i.match(c)}if(r){i=i.split("").reverse().join(""),l.reverse();for(var h=1,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h-1]+=" ");for(var h=0,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h]=l[h].slice(1));i=o.slice(0,i.length)}else i=o.slice(i.length*-1);return[u,i,l]}function t(i){var r=i.slice(-1);return i=i.trim(),r===" "&&["'","’"].indexOf(i.slice(-1))>-1&&(i+=" "),i}function n(i){if(!i.suffix&&i.given){var r=i.given.match(/(\s*,!*\s*)/);if(r){var a=i.given.indexOf(r[1]),o=i.given.slice(a+r[1].length),l=i.given.slice(a,a+r[1].length).replace(/\s*/g,"");o.replace(/\./g,"")==="et al"&&!i["dropping-particle"]?(i["dropping-particle"]=o,i["comma-dropping-particle"]=","):(l.length===2&&(i["comma-suffix"]=!0),i.suffix=o),i.given=i.given.slice(0,a)}}}return function(i){var l=e(i.family),r=l[1],a=l[2];i.family=r;var o=t(a.join(""));o&&(i["non-dropping-particle"]=o),n(i);var l=e(i.given,!0),c=l[1],u=l[2];i.given=c;var f=u.join("").trim();f&&(i["dropping-particle"]=f)}}();var U3=d;const H3=Om(U3),yd={};function q3(e){let t=yd[e];if(t)return t;t=yd[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t[i]="%"+("0"+i.toString(16).toUpperCase()).slice(-2)}return t}function Fi(e,t){typeof t!="string"&&(t=Fi.defaultChars);const n=q3(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(i){let r="";for(let a=0,o=i.length;a<o;a+=3){const l=parseInt(i.slice(a+1,a+3),16);if(l<128){r+=n[l];continue}if((l&224)===192&&a+3<o){const c=parseInt(i.slice(a+4,a+6),16);if((c&192)===128){const u=l<<6&1984|c&63;u<128?r+="��":r+=String.fromCharCode(u),a+=3;continue}}if((l&240)===224&&a+6<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16);if((c&192)===128&&(u&192)===128){const f=l<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?r+="���":r+=String.fromCharCode(f),a+=6;continue}}if((l&248)===240&&a+9<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16),f=parseInt(i.slice(a+10,a+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let m=l<<18&1835008|c<<12&258048|u<<6&4032|f&63;m<65536||m>1114111?r+="����":(m-=65536,r+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),a+=9;continue}}r+="�"}return r})}Fi.defaultChars=";/?:@&=+$,#";Fi.componentChars="";const kd={};function j3(e){let t=kd[e];if(t)return t;t=kd[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Vr(e,t,n){typeof t!="string"&&(n=t,t=Vr.defaultChars),typeof n>"u"&&(n=!0);const i=j3(t);let r="";for(let a=0,o=e.length;a<o;a++){const l=e.charCodeAt(a);if(n&&l===37&&a+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){r+=e.slice(a,a+3),a+=2;continue}if(l<128){r+=i[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<o){const c=e.charCodeAt(a+1);if(c>=56320&&c<=57343){r+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[a])}return r}Vr.defaultChars=";/?:@&=+$,-_.!~*'()#";Vr.componentChars="-_.!~*'()";function Ac(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Oo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const $3=/^([a-z0-9.+-]+:)/i,W3=/:[0-9]*$/,G3=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,K3=["<",">",'"',"`"," ","\r",`
661
- `," "],X3=["{","}","|","\\","^","`"].concat(K3),J3=["'"].concat(X3),wd=["%","/","?",";","#"].concat(J3),_d=["/","?","#"],Z3=255,Sd=/^[+a-z0-9A-Z_-]{0,63}$/,Q3=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Cd={javascript:!0,"javascript:":!0},Ed={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Tc(e,t){if(e&&e instanceof Oo)return e;const n=new Oo;return n.parse(e,t),n}Oo.prototype.parse=function(e,t){let n,i,r,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const u=G3.exec(a);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=$3.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=a.substr(0,2)==="//",r&&!(o&&Cd[o])&&(a=a.substr(2),this.slashes=!0)),!Cd[o]&&(r||o&&!Ed[o])){let u=-1;for(let g=0;g<_d.length;g++)i=a.indexOf(_d[g]),i!==-1&&(u===-1||i<u)&&(u=i);let f,m;u===-1?m=a.lastIndexOf("@"):m=a.lastIndexOf("@",u),m!==-1&&(f=a.slice(0,m),a=a.slice(m+1),this.auth=f),u=-1;for(let g=0;g<wd.length;g++)i=a.indexOf(wd[g]),i!==-1&&(u===-1||i<u)&&(u=i);u===-1&&(u=a.length),a[u-1]===":"&&u--;const p=a.slice(0,u);a=a.slice(u),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const g=this.hostname.split(/\./);for(let b=0,y=g.length;b<y;b++){const v=g[b];if(v&&!v.match(Sd)){let x="";for(let k=0,w=v.length;k<w;k++)v.charCodeAt(k)>127?x+="x":x+=v[k];if(!x.match(Sd)){const k=g.slice(0,b),w=g.slice(b+1),S=v.match(Q3);S&&(k.push(S[1]),w.unshift(S[2])),w.length&&(a=w.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>Z3&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));const c=a.indexOf("?");return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Ed[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Oo.prototype.parseHost=function(e){let t=W3.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Y3=Object.freeze(Object.defineProperty({__proto__:null,decode:Fi,encode:Vr,format:Ac,parse:Tc},Symbol.toStringTag,{value:"Module"})),Mm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Dm=/[\0-\x1F\x7F-\x9F]/,eS=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Nc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,zm=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Im=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,tS=Object.freeze(Object.defineProperty({__proto__:null,Any:Mm,Cc:Dm,Cf:eS,P:Nc,S:zm,Z:Im},Symbol.toStringTag,{value:"Module"})),nS=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),iS=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Os;const rS=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),aS=(Os=String.fromCodePoint)!==null&&Os!==void 0?Os:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function oS(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=rS.get(e))!==null&&t!==void 0?t:e}var nt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(nt||(nt={}));const sS=32;var jn;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(jn||(jn={}));function Tl(e){return e>=nt.ZERO&&e<=nt.NINE}function lS(e){return e>=nt.UPPER_A&&e<=nt.UPPER_F||e>=nt.LOWER_A&&e<=nt.LOWER_F}function cS(e){return e>=nt.UPPER_A&&e<=nt.UPPER_Z||e>=nt.LOWER_A&&e<=nt.LOWER_Z||Tl(e)}function uS(e){return e===nt.EQUALS||cS(e)}var tt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(tt||(tt={}));var En;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(En||(En={}));class dS{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=tt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=En.Strict}startEntity(t){this.decodeMode=t,this.state=tt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case tt.EntityStart:return t.charCodeAt(n)===nt.NUM?(this.state=tt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=tt.NamedEntity,this.stateNamedEntity(t,n));case tt.NumericStart:return this.stateNumericStart(t,n);case tt.NumericDecimal:return this.stateNumericDecimal(t,n);case tt.NumericHex:return this.stateNumericHex(t,n);case tt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|sS)===nt.LOWER_X?(this.state=tt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=tt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const a=i-n;this.result=this.result*Math.pow(r,a)+parseInt(t.substr(n,a),r),this.consumed+=a}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(Tl(r)||lS(r))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(Tl(r))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===nt.SEMI)this.consumed+=1;else if(this.decodeMode===En.Strict)return 0;return this.emitCodePoint(oS(this.result),this.consumed),this.errors&&(t!==nt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let r=i[this.treeIndex],a=(r&jn.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=fS(i,r,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===En.Attribute&&(a===0||uS(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],a=(r&jn.VALUE_LENGTH)>>14,a!==0){if(o===nt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==En.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&jn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~jn.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case tt.NamedEntity:return this.result!==0&&(this.decodeMode!==En.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tt.NumericDecimal:return this.emitNumericEntity(0,2);case tt.NumericHex:return this.emitNumericEntity(0,3);case tt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tt.EntityStart:return 0}}}function Rm(e){let t="";const n=new dS(e,i=>t+=aS(i));return function(r,a){let o=0,l=0;for(;(l=r.indexOf("&",l))>=0;){t+=r.slice(o,l),n.startEntity(a);const u=n.write(r,l+1);if(u<0){o=l+n.end();break}o=l+u,l=u===0?o+1:o}const c=t+r.slice(o);return t="",c}}function fS(e,t,n,i){const r=(t&jn.BRANCH_LENGTH)>>7,a=t&jn.JUMP_TABLE;if(r===0)return a!==0&&i===a?n:-1;if(a){const c=i-a;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(u<i)o=c+1;else if(u>i)l=c-1;else return e[c+r]}return-1}const Lm=Rm(nS);Rm(iS);function pS(e,t=En.Legacy){return Lm(e,t)}function mS(e){return Lm(e,En.Strict)}function hS(e){return Object.prototype.toString.call(e)}function Oc(e){return hS(e)==="[object String]"}const bS=Object.prototype.hasOwnProperty;function gS(e,t){return bS.call(e,t)}function jo(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(i){e[i]=n[i]})}}),e}function Bm(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Mc(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Pm=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,vS=/&([a-z#][a-z0-9]{1,31});/gi,xS=new RegExp(Pm.source+"|"+vS.source,"gi"),yS=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kS(e,t){if(t.charCodeAt(0)===35&&yS.test(t)){const i=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Mc(i)?Mr(i):e}const n=pS(e);return n!==e?n:e}function wS(e){return e.indexOf("\\")<0?e:e.replace(Pm,"$1")}function Vi(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(xS,function(t,n,i){return n||kS(t,i)})}const _S=/[&<>"]/,SS=/[&<>"]/g,CS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function ES(e){return CS[e]}function Kn(e){return _S.test(e)?e.replace(SS,ES):e}const AS=/[.?*+^$[\]\\(){}|-]/g;function TS(e){return e.replace(AS,"\\$&")}function Be(e){switch(e){case 9:case 32:return!0}return!1}function Dr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Fm(e){return Nc.test(e)||zm.test(e)}function zr(e){return Fm(Mr(e))}function Ir(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function $o(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Ad(e){return e===32||e===9||e===10||e===13}function Wo(e){let t=0;for(;t<e.length&&Ad(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ad(e.charCodeAt(n));n--);return e.slice(t,n+1)}const NS={mdurl:Y3,ucmicro:tS},OS=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Bm,asciiTrim:Wo,assign:jo,escapeHtml:Kn,escapeRE:TS,fromCodePoint:Mr,has:gS,isMdAsciiPunct:Ir,isPunctChar:Fm,isPunctCharCode:zr,isSpace:Be,isString:Oc,isValidEntityCode:Mc,isWhiteSpace:Dr,lib:NS,normalizeReference:$o,unescapeAll:Vi,unescapeMd:wS},Symbol.toStringTag,{value:"Module"}));function MS(e,t,n){let i,r,a,o;const l=e.posMax,c=e.pos;for(e.pos=t+1,i=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(i--,i===0)){r=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)i++;else if(n)return e.pos=c,-1}}let u=-1;return r&&(u=e.pos),e.pos=c,u}function DS(e,t,n){let i,r=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(i=e.charCodeAt(r),i===10||i===60)return a;if(i===62)return a.pos=r+1,a.str=Vi(e.slice(t+1,r)),a.ok=!0,a;if(i===92&&r+1<n){r+=2;continue}r++}return a}let o=0;for(;r<n&&(i=e.charCodeAt(r),!(i===32||i<32||i===127));){if(i===92&&r+1<n){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(i===40&&(o++,o>32))return a;if(i===41){if(o===0)break;o--}r++}return t===r||o!==0||(a.str=Vi(e.slice(t,r)),a.pos=r,a.ok=!0),a}function zS(e,t,n,i){let r,a=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)o.str=i.str,o.marker=i.marker;else{if(a>=n)return o;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return o;t++,a++,l===40&&(l=41),o.marker=l}for(;a<n;){if(r=e.charCodeAt(a),r===o.marker)return o.pos=a+1,o.str+=Vi(e.slice(t,a)),o.ok=!0,o;if(r===40&&o.marker===41)return o;r===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Vi(e.slice(t,a)),o}const IS=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:DS,parseLinkLabel:MS,parseLinkTitle:zS},Symbol.toStringTag,{value:"Module"})),sn={};sn.code_inline=function(e,t,n,i,r){const a=e[t];return"<code"+r.renderAttrs(a)+">"+Kn(a.content)+"</code>"};sn.code_block=function(e,t,n,i,r){const a=e[t];return"<pre"+r.renderAttrs(a)+"><code>"+Kn(e[t].content)+`</code></pre>
660
+ [1] === incrementDisambig() ===`),this.initGivens)return this.initGivens=!1,!1;var e=!1,t=!0;if(this.modes[this.modeindex]==="disNames"){t=!1,typeof this.givensMax!="number"&&(t=!0);var n=!1;typeof this.namesMax!="number"&&(n=!0),typeof this.givensMax=="number"&&(this.base.givens.length&&this.base.givens[this.gnameset][this.gname]<this.givensMax?this.base.givens[this.gnameset][this.gname]+=1:t=!0),typeof this.namesMax=="number"&&t&&(this.state.opt["disambiguate-add-names"]?(n=!1,this.gname<this.namesMax?(this.base.names[this.gnameset]+=1,this.gname+=1):n=!0):n=!0),typeof this.namesetsMax=="number"&&n&&this.gnameset<this.namesetsMax&&(this.gnameset+=1,this.base.names[this.gnameset]=1,this.gname=0),this.debug&&(this.state.sys.print(" ------------------"),this.state.sys.print(" incremented values"),this.state.sys.print(" ------------------"),this.state.sys.print(" | gnameset: "+this.gnameset),this.state.sys.print(" | gname: "+this.gname),this.state.sys.print(" | names value: "+this.base.names[this.gnameset]),this.base.givens.length?this.state.sys.print(" | givens value: "+this.base.givens[this.gnameset][this.gname]):this.state.sys.print(" | givens value: nil"),this.state.sys.print(" | namesetsMax: "+this.namesetsMax),this.state.sys.print(" | namesMax: "+this.namesMax),this.state.sys.print(" | givensMax: "+this.givensMax)),(typeof this.namesetsMax!="number"||this.namesetsMax===-1||this.gnameset===this.namesetsMax)&&(!this.state.opt["disambiguate-add-names"]||typeof this.namesMax!="number"||this.gname===this.namesMax)&&(typeof this.givensMax!="number"||typeof this.base.givens[this.gnameset]>"u"||typeof this.base.givens[this.gnameset][this.gname]>"u"||this.base.givens[this.gnameset][this.gname]===this.givensMax)&&(e=!0,this.debug&&this.state.sys.print(" MAXED"))}else this.modes[this.modeindex]==="disExtraText"&&(this.base.disambiguate+=1,this.betterbase.disambiguate+=1);return e};d.Disambiguation.prototype.initVars=function(e){var a,o,t,n,i;if(this.debug&&this.state.sys.print("[B] === initVars() ==="),this.lists=[],this.base=!1,this.betterbase=!1,this.akey=e,this.maxNamesByItemId={},n=[],t=this.ambigcites[e],!t||!t.length)return!1;var r=this.state.refetchItem(""+t[0]);if(this.getCiteData(r),this.base=d.getAmbigConfig.call(this.state),t&&t.length>1){n.push([this.maxNamesByItemId[r.id],r]);for(var a=1,o=t.length;a<o;a+=1)r=this.state.refetchItem(""+t[a]),this.getCiteData(r,this.base),n.push([this.maxNamesByItemId[r.id],r]);n.sort(function(l,c){return l[0]>c[0]?1:l[0]<c[0]?-1:l[1].id>c[1].id?1:l[1].id<c[1].id?-1:0}),i=[];for(var a=0,o=n.length;a<o;a+=1)i.push(n[a][1]);this.lists.push([this.base,i]),this.Item=this.lists[0][1][0]}else this.Item=this.state.refetchItem(""+t[0]);this.modeindex=0;var a,o;return this.state.citation.opt["disambiguate-add-names"],this.namesMax=this.maxNamesByItemId[this.Item.id][0],this.padBase(this.base),this.padBase(this.betterbase),this.base.year_suffix=!1,this.base.disambiguate=!1,this.betterbase.year_suffix=!1,this.betterbase.disambiguate=!1,this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.state.opt["disambiguate-add-givenname"]&&(this.givensMax=2),!0};d.Disambiguation.prototype.padBase=function(e){for(var t=0,n=e.names.length;t<n;t+=1){e.givens[t]||(e.givens[t]=[]);for(var i=0,r=e.names[t];i<r;i+=1)e.givens[t][i]||(e.givens[t][i]=0)}};d.Disambiguation.prototype.configModes=function(){var e,t;this.modes=[],e=this.state.opt["disambiguate-add-givenname"],t=this.state.citation.opt["givenname-disambiguation-rule"],(this.state.opt["disambiguate-add-names"]||e&&t==="by-cite")&&this.modes.push("disNames"),this.state.opt.development_extensions.prioritize_disambiguate_condition?(this.state.opt.has_disambiguate&&this.modes.push("disExtraText"),this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears")):(this.state.opt["disambiguate-add-year-suffix"]&&this.modes.push("disYears"),this.state.opt.has_disambiguate&&this.modes.push("disExtraText"))};d.Disambiguation.prototype.getCiteData=function(e,t){if(!this.maxNamesByItemId[e.id]){d.getAmbiguousCite.call(this.state,e,t),t=d.getAmbigConfig.call(this.state),this.maxNamesByItemId[e.id]=d.getMaxVals.call(this.state),this.state.registry.registry[e.id].disambig.givens=this.state.tmp.disambig_settings.givens.slice();for(var n=0,i=this.state.registry.registry[e.id].disambig.givens.length;n<i;n+=1)this.state.registry.registry[e.id].disambig.givens[n]=this.state.tmp.disambig_settings.givens[n].slice();this.namesetsMax=this.state.registry.registry[e.id].disambig.names.length-1,this.base||(this.base=t,this.betterbase=d.cloneAmbigConfig(t)),t.names.length<this.base.names.length&&(this.base=t);for(var n=0,i=t.names.length;n<i;n+=1)t.names[n]>this.base.names[n]&&(this.base.givens[n]=t.givens[n].slice(),this.base.names[n]=t.names[n],this.betterbase.names=this.base.names.slice(),this.betterbase.givens=this.base.givens.slice(),this.padBase(this.base),this.padBase(this.betterbase));this.betterbase.givens=this.base.givens.slice();for(var r=0,a=this.base.givens.length;r<a;r+=1)this.betterbase.givens[r]=this.base.givens[r].slice()}};d.Disambiguation.prototype.captureStepToBase=function(){this.state.citation.opt["givenname-disambiguation-rule"]==="by-cite"&&this.base.givens&&this.base.givens.length&&typeof this.base.givens[this.gnameset][this.gname]<"u"&&(this.betterbase.givens.length<this.base.givens.length&&(this.betterbase.givens=JSON.parse(JSON.stringify(this.base.givens))),this.betterbase.givens[this.gnameset][this.gname]=this.base.givens[this.gnameset][this.gname]),this.betterbase.names[this.gnameset]=this.base.names[this.gnameset]};d.Engine.prototype.getJurisdictionList=function(e){for(var t=[],n=e.split(":"),i=n.length;i>0;i--){var r=n.slice(0,i).join(":");if(t.push(r),this.opt.jurisdiction_fallbacks[r]){var a=this.opt.jurisdiction_fallbacks[r];t.push(a)}}return t.indexOf("us")===-1&&t.push("us"),t};d.Engine.prototype.loadStyleModule=function(e,t,n){var i=null;this.juris[e]={};var r=d.setupXml(t);r.addMissingNameNodes(r.dataObj),r.addInstitutionNodes(r.dataObj),r.insertPublisherAndPlace(r.dataObj),r.flagDateMacros(r.dataObj);for(var m=r.getNodesByName(r.dataObj,"law-module"),a=0,o=m.length;a<o;a++){var l=r.getAttributeValue(m[a],"types");if(l){this.juris[e].types={},l=l.split(/\s+/);for(var c=0,u=l.length;c<u;c++)this.juris[e].types[l[c]]=!0}n||(i=r.getAttributeValue(m[a],"fallback"),i&&e!=="us"&&(this.opt.jurisdiction_fallbacks[e]=i))}var f=this.opt.lang?this.opt.lang:this.opt["default-locale"][0];d.SET_COURT_CLASSES(this,f,r,r.dataObj),this.juris[e].types||(this.juris[e].types=d.MODULE_TYPES);for(var m=r.getNodesByName(r.dataObj,"macro"),a=0,o=m.length;a<o;a++){var p=r.getAttributeValue(m[a],"name");if(!d.MODULE_MACROS[p]){d.debug('CSL: skipping non-modular macro name "'+p+'" in module context');continue}this.juris[e][p]=[],this.buildTokenLists(m[a],this.juris[e][p]),this.configureTokenList(this.juris[e][p])}return i};d.Engine.prototype.retrieveAllStyleModules=function(e){var t={},n=this.locale[this.opt.lang].opts["jurisdiction-preference"];n=n||[],n=[""].concat(n);for(var i=n.length-1;i>-1;i--)for(var r=n[i],a=0,o=e.length;a<o;a++){var l=e[a];if(!this.opt.jurisdictions_seen[l]){var c=this.sys.retrieveStyleModule(l,r);(!c&&!r||c)&&(this.opt.jurisdictions_seen[l]=!0),c&&(t[l]=c)}}return t};d.ParticleList=function(){var e=[[[0,1],null]],t=[[[0,3],null]],n=[[null,[0,1]]],i=[[null,[0,2]]],r=[[null,[0,3]]],a=[[null,[0,1]],[[0,1],null]],o=[[null,[0,2]],[[0,2],null]],l=[[[0,1],null],[null,[0,1]]],c=[[[0,2],null],[null,[0,2]]],u=[[[0,3],null],[null,[0,3]]],f=[[null,[0,2]],[[0,1],[1,2]]],m=[["'s",n],["'s-",n],["'t",n],["a",n],["aan 't",i],["aan de",i],["aan den",i],["aan der",i],["aan het",i],["aan t",i],["aan",n],["ad-",a],["adh-",a],["af",a],["al",a],["al-",a],["am de",i],["am",n],["an-",a],["ar-",a],["as-",a],["ash-",a],["at-",a],["ath-",a],["auf dem",c],["auf den",c],["auf der",c],["auf ter",i],["auf",l],["aus 'm",c],["aus dem",c],["aus den",c],["aus der",c],["aus m",c],["aus",l],["aus'm",c],["az-",a],["aš-",a],["aḍ-",a],["aḏ-",a],["aṣ-",a],["aṭ-",a],["aṯ-",a],["aẓ-",a],["ben",n],["bij 't",i],["bij de",i],["bij den",i],["bij het",i],["bij t",i],["bij",n],["bin",n],["boven d",i],["boven d'",i],["d",n],["d'",a],["da",a],["dal",n],["dal'",n],["dall'",n],["dalla",n],["das",a],["de die le",r],["de die",i],["de l",i],["de l'",i],["de la",f],["de las",f],["de le",i],["de li",o],["de van der",r],["de",a],["de'",a],["deca",n],["degli",a],["dei",a],["del",a],["dela",e],["dell'",a],["della",a],["delle",a],["dello",a],["den",a],["der",a],["des",a],["di",a],["die le",i],["do",n],["don",n],["dos",a],["du",a],["ed-",a],["edh-",a],["el",a],["el-",a],["en-",a],["er-",a],["es-",a],["esh-",a],["et-",a],["eth-",a],["ez-",a],["eš-",a],["eḍ-",a],["eḏ-",a],["eṣ-",a],["eṭ-",a],["eṯ-",a],["eẓ-",a],["het",n],["i",n],["il",e],["im",n],["in 't",i],["in de",i],["in den",i],["in der",o],["in het",i],["in t",i],["in",n],["l",n],["l'",n],["la",n],["las",n],["le",n],["les",a],["lo",a],["los",n],["lou",n],["of",n],["onder 't",i],["onder de",i],["onder den",i],["onder het",i],["onder t",i],["onder",n],["op 't",i],["op de",o],["op den",i],["op der",i],["op gen",i],["op het",i],["op t",i],["op ten",i],["op",n],["over 't",i],["over de",i],["over den",i],["over het",i],["over t",i],["over",n],["s",n],["s'",n],["sen",e],["t",n],["te",n],["ten",n],["ter",n],["tho",n],["thoe",n],["thor",n],["to",n],["toe",n],["tot",n],["uijt 't",i],["uijt de",i],["uijt den",i],["uijt te de",r],["uijt ten",i],["uijt",n],["uit 't",i],["uit de",i],["uit den",i],["uit het",i],["uit t",i],["uit te de",r],["uit ten",i],["uit",n],["unter",n],["v",n],["v.",n],["v.d.",n],["van 't",i],["van de l",r],["van de l'",r],["van de",i],["van de",i],["van den",i],["van der",i],["van gen",i],["van het",i],["van la",i],["van t",i],["van ter",i],["van van de",r],["van",a],["vander",n],["vd",n],["ver",n],["vom und zum",t],["vom",a],["von 't",i],["von dem",c],["von den",c],["von der",c],["von t",i],["von und zu",u],["von zu",c],["von",l],["voor 't",i],["voor de",i],["voor den",i],["voor in 't",r],["voor in t",r],["voor",n],["vor der",c],["vor",l],["z",e],["ze",e],["zu",l],["zum",a],["zur",a]];return m}();d.parseParticles=function(){function e(i,r,a){var o=i;i=i;var l=[],c,u;r?(i=i.split("").reverse().join(""),c=d.PARTICLE_GIVEN_REGEXP):c=d.PARTICLE_FAMILY_REGEXP;for(var f=i.match(c);f;){var m=r?f[1].split("").reverse().join(""):f[1],p=f?m:!1,p=p?m.replace(/^[-\'\u02bb\u2019\s]*(.).*$/,"$1"):!1;if(u=p?p.toUpperCase()!==p:!1,!u)break;r?(l.push(o.slice(m.length*-1)),o=o.slice(0,m.length*-1)):(l.push(o.slice(0,m.length)),o=o.slice(m.length)),i=f[2],f=i.match(c)}if(r){i=i.split("").reverse().join(""),l.reverse();for(var h=1,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h-1]+=" ");for(var h=0,g=l.length;h<g;h++)l[h].slice(0,1)==" "&&(l[h]=l[h].slice(1));i=o.slice(0,i.length)}else i=o.slice(i.length*-1);return[u,i,l]}function t(i){var r=i.slice(-1);return i=i.trim(),r===" "&&["'","’"].indexOf(i.slice(-1))>-1&&(i+=" "),i}function n(i){if(!i.suffix&&i.given){var r=i.given.match(/(\s*,!*\s*)/);if(r){var a=i.given.indexOf(r[1]),o=i.given.slice(a+r[1].length),l=i.given.slice(a,a+r[1].length).replace(/\s*/g,"");o.replace(/\./g,"")==="et al"&&!i["dropping-particle"]?(i["dropping-particle"]=o,i["comma-dropping-particle"]=","):(l.length===2&&(i["comma-suffix"]=!0),i.suffix=o),i.given=i.given.slice(0,a)}}}return function(i){var l=e(i.family),r=l[1],a=l[2];i.family=r;var o=t(a.join(""));o&&(i["non-dropping-particle"]=o),n(i);var l=e(i.given,!0),c=l[1],u=l[2];i.given=c;var f=u.join("").trim();f&&(i["dropping-particle"]=f)}}();var H3=d;const q3=Om(H3),yd={};function j3(e){let t=yd[e];if(t)return t;t=yd[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t[i]="%"+("0"+i.toString(16).toUpperCase()).slice(-2)}return t}function Fi(e,t){typeof t!="string"&&(t=Fi.defaultChars);const n=j3(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(i){let r="";for(let a=0,o=i.length;a<o;a+=3){const l=parseInt(i.slice(a+1,a+3),16);if(l<128){r+=n[l];continue}if((l&224)===192&&a+3<o){const c=parseInt(i.slice(a+4,a+6),16);if((c&192)===128){const u=l<<6&1984|c&63;u<128?r+="��":r+=String.fromCharCode(u),a+=3;continue}}if((l&240)===224&&a+6<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16);if((c&192)===128&&(u&192)===128){const f=l<<12&61440|c<<6&4032|u&63;f<2048||f>=55296&&f<=57343?r+="���":r+=String.fromCharCode(f),a+=6;continue}}if((l&248)===240&&a+9<o){const c=parseInt(i.slice(a+4,a+6),16),u=parseInt(i.slice(a+7,a+9),16),f=parseInt(i.slice(a+10,a+12),16);if((c&192)===128&&(u&192)===128&&(f&192)===128){let m=l<<18&1835008|c<<12&258048|u<<6&4032|f&63;m<65536||m>1114111?r+="����":(m-=65536,r+=String.fromCharCode(55296+(m>>10),56320+(m&1023))),a+=9;continue}}r+="�"}return r})}Fi.defaultChars=";/?:@&=+$,#";Fi.componentChars="";const kd={};function $3(e){let t=kd[e];if(t)return t;t=kd[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Vr(e,t,n){typeof t!="string"&&(n=t,t=Vr.defaultChars),typeof n>"u"&&(n=!0);const i=$3(t);let r="";for(let a=0,o=e.length;a<o;a++){const l=e.charCodeAt(a);if(n&&l===37&&a+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(a+1,a+3))){r+=e.slice(a,a+3),a+=2;continue}if(l<128){r+=i[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&a+1<o){const c=e.charCodeAt(a+1);if(c>=56320&&c<=57343){r+=encodeURIComponent(e[a]+e[a+1]),a++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[a])}return r}Vr.defaultChars=";/?:@&=+$,-_.!~*'()#";Vr.componentChars="-_.!~*'()";function Ac(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Oo(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const W3=/^([a-z0-9.+-]+:)/i,G3=/:[0-9]*$/,K3=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,X3=["<",">",'"',"`"," ","\r",`
661
+ `," "],J3=["{","}","|","\\","^","`"].concat(X3),Z3=["'"].concat(J3),wd=["%","/","?",";","#"].concat(Z3),_d=["/","?","#"],Q3=255,Sd=/^[+a-z0-9A-Z_-]{0,63}$/,Y3=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Cd={javascript:!0,"javascript:":!0},Ed={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Tc(e,t){if(e&&e instanceof Oo)return e;const n=new Oo;return n.parse(e,t),n}Oo.prototype.parse=function(e,t){let n,i,r,a=e;if(a=a.trim(),!t&&e.split("#").length===1){const u=K3.exec(a);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=W3.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=a.substr(0,2)==="//",r&&!(o&&Cd[o])&&(a=a.substr(2),this.slashes=!0)),!Cd[o]&&(r||o&&!Ed[o])){let u=-1;for(let g=0;g<_d.length;g++)i=a.indexOf(_d[g]),i!==-1&&(u===-1||i<u)&&(u=i);let f,m;u===-1?m=a.lastIndexOf("@"):m=a.lastIndexOf("@",u),m!==-1&&(f=a.slice(0,m),a=a.slice(m+1),this.auth=f),u=-1;for(let g=0;g<wd.length;g++)i=a.indexOf(wd[g]),i!==-1&&(u===-1||i<u)&&(u=i);u===-1&&(u=a.length),a[u-1]===":"&&u--;const p=a.slice(0,u);a=a.slice(u),this.parseHost(p),this.hostname=this.hostname||"";const h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){const g=this.hostname.split(/\./);for(let b=0,y=g.length;b<y;b++){const v=g[b];if(v&&!v.match(Sd)){let x="";for(let k=0,w=v.length;k<w;k++)v.charCodeAt(k)>127?x+="x":x+=v[k];if(!x.match(Sd)){const k=g.slice(0,b),w=g.slice(b+1),S=v.match(Y3);S&&(k.push(S[1]),w.unshift(S[2])),w.length&&(a=w.join(".")+a),this.hostname=k.join(".");break}}}}this.hostname.length>Q3&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=a.indexOf("#");l!==-1&&(this.hash=a.substr(l),a=a.slice(0,l));const c=a.indexOf("?");return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Ed[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Oo.prototype.parseHost=function(e){let t=G3.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const eS=Object.freeze(Object.defineProperty({__proto__:null,decode:Fi,encode:Vr,format:Ac,parse:Tc},Symbol.toStringTag,{value:"Module"})),Mm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Dm=/[\0-\x1F\x7F-\x9F]/,tS=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Nc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,zm=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Im=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,nS=Object.freeze(Object.defineProperty({__proto__:null,Any:Mm,Cc:Dm,Cf:tS,P:Nc,S:zm,Z:Im},Symbol.toStringTag,{value:"Module"})),iS=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),rS=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Os;const aS=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),oS=(Os=String.fromCodePoint)!==null&&Os!==void 0?Os:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function sS(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=aS.get(e))!==null&&t!==void 0?t:e}var nt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(nt||(nt={}));const lS=32;var jn;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(jn||(jn={}));function Tl(e){return e>=nt.ZERO&&e<=nt.NINE}function cS(e){return e>=nt.UPPER_A&&e<=nt.UPPER_F||e>=nt.LOWER_A&&e<=nt.LOWER_F}function uS(e){return e>=nt.UPPER_A&&e<=nt.UPPER_Z||e>=nt.LOWER_A&&e<=nt.LOWER_Z||Tl(e)}function dS(e){return e===nt.EQUALS||uS(e)}var tt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(tt||(tt={}));var En;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(En||(En={}));class fS{constructor(t,n,i){this.decodeTree=t,this.emitCodePoint=n,this.errors=i,this.state=tt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=En.Strict}startEntity(t){this.decodeMode=t,this.state=tt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case tt.EntityStart:return t.charCodeAt(n)===nt.NUM?(this.state=tt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=tt.NamedEntity,this.stateNamedEntity(t,n));case tt.NumericStart:return this.stateNumericStart(t,n);case tt.NumericDecimal:return this.stateNumericDecimal(t,n);case tt.NumericHex:return this.stateNumericHex(t,n);case tt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|lS)===nt.LOWER_X?(this.state=tt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=tt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,i,r){if(n!==i){const a=i-n;this.result=this.result*Math.pow(r,a)+parseInt(t.substr(n,a),r),this.consumed+=a}}stateNumericHex(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(Tl(r)||cS(r))n+=1;else return this.addToNumericResult(t,i,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,i,n,16),-1}stateNumericDecimal(t,n){const i=n;for(;n<t.length;){const r=t.charCodeAt(n);if(Tl(r))n+=1;else return this.addToNumericResult(t,i,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,i,n,10),-1}emitNumericEntity(t,n){var i;if(this.consumed<=n)return(i=this.errors)===null||i===void 0||i.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===nt.SEMI)this.consumed+=1;else if(this.decodeMode===En.Strict)return 0;return this.emitCodePoint(sS(this.result),this.consumed),this.errors&&(t!==nt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:i}=this;let r=i[this.treeIndex],a=(r&jn.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=pS(i,r,this.treeIndex+Math.max(1,a),o),this.treeIndex<0)return this.result===0||this.decodeMode===En.Attribute&&(a===0||dS(o))?0:this.emitNotTerminatedNamedEntity();if(r=i[this.treeIndex],a=(r&jn.VALUE_LENGTH)>>14,a!==0){if(o===nt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==En.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:i}=this,r=(i[n]&jn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,i){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~jn.VALUE_LENGTH:r[t+1],i),n===3&&this.emitCodePoint(r[t+2],i),i}end(){var t;switch(this.state){case tt.NamedEntity:return this.result!==0&&(this.decodeMode!==En.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tt.NumericDecimal:return this.emitNumericEntity(0,2);case tt.NumericHex:return this.emitNumericEntity(0,3);case tt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tt.EntityStart:return 0}}}function Rm(e){let t="";const n=new fS(e,i=>t+=oS(i));return function(r,a){let o=0,l=0;for(;(l=r.indexOf("&",l))>=0;){t+=r.slice(o,l),n.startEntity(a);const u=n.write(r,l+1);if(u<0){o=l+n.end();break}o=l+u,l=u===0?o+1:o}const c=t+r.slice(o);return t="",c}}function pS(e,t,n,i){const r=(t&jn.BRANCH_LENGTH)>>7,a=t&jn.JUMP_TABLE;if(r===0)return a!==0&&i===a?n:-1;if(a){const c=i-a;return c<0||c>=r?-1:e[n+c]-1}let o=n,l=o+r-1;for(;o<=l;){const c=o+l>>>1,u=e[c];if(u<i)o=c+1;else if(u>i)l=c-1;else return e[c+r]}return-1}const Lm=Rm(iS);Rm(rS);function mS(e,t=En.Legacy){return Lm(e,t)}function hS(e){return Lm(e,En.Strict)}function bS(e){return Object.prototype.toString.call(e)}function Oc(e){return bS(e)==="[object String]"}const gS=Object.prototype.hasOwnProperty;function vS(e,t){return gS.call(e,t)}function jo(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(i){e[i]=n[i]})}}),e}function Bm(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Mc(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mr(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const Pm=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,xS=/&([a-z#][a-z0-9]{1,31});/gi,yS=new RegExp(Pm.source+"|"+xS.source,"gi"),kS=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function wS(e,t){if(t.charCodeAt(0)===35&&kS.test(t)){const i=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Mc(i)?Mr(i):e}const n=mS(e);return n!==e?n:e}function _S(e){return e.indexOf("\\")<0?e:e.replace(Pm,"$1")}function Vi(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(yS,function(t,n,i){return n||wS(t,i)})}const SS=/[&<>"]/,CS=/[&<>"]/g,ES={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function AS(e){return ES[e]}function Kn(e){return SS.test(e)?e.replace(CS,AS):e}const TS=/[.?*+^$[\]\\(){}|-]/g;function NS(e){return e.replace(TS,"\\$&")}function Be(e){switch(e){case 9:case 32:return!0}return!1}function Dr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Fm(e){return Nc.test(e)||zm.test(e)}function zr(e){return Fm(Mr(e))}function Ir(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function $o(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function Ad(e){return e===32||e===9||e===10||e===13}function Wo(e){let t=0;for(;t<e.length&&Ad(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ad(e.charCodeAt(n));n--);return e.slice(t,n+1)}const OS={mdurl:eS,ucmicro:nS},MS=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Bm,asciiTrim:Wo,assign:jo,escapeHtml:Kn,escapeRE:NS,fromCodePoint:Mr,has:vS,isMdAsciiPunct:Ir,isPunctChar:Fm,isPunctCharCode:zr,isSpace:Be,isString:Oc,isValidEntityCode:Mc,isWhiteSpace:Dr,lib:OS,normalizeReference:$o,unescapeAll:Vi,unescapeMd:_S},Symbol.toStringTag,{value:"Module"}));function DS(e,t,n){let i,r,a,o;const l=e.posMax,c=e.pos;for(e.pos=t+1,i=1;e.pos<l;){if(a=e.src.charCodeAt(e.pos),a===93&&(i--,i===0)){r=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)i++;else if(n)return e.pos=c,-1}}let u=-1;return r&&(u=e.pos),e.pos=c,u}function zS(e,t,n){let i,r=t;const a={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(i=e.charCodeAt(r),i===10||i===60)return a;if(i===62)return a.pos=r+1,a.str=Vi(e.slice(t+1,r)),a.ok=!0,a;if(i===92&&r+1<n){r+=2;continue}r++}return a}let o=0;for(;r<n&&(i=e.charCodeAt(r),!(i===32||i<32||i===127));){if(i===92&&r+1<n){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(i===40&&(o++,o>32))return a;if(i===41){if(o===0)break;o--}r++}return t===r||o!==0||(a.str=Vi(e.slice(t,r)),a.pos=r,a.ok=!0),a}function IS(e,t,n,i){let r,a=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)o.str=i.str,o.marker=i.marker;else{if(a>=n)return o;let l=e.charCodeAt(a);if(l!==34&&l!==39&&l!==40)return o;t++,a++,l===40&&(l=41),o.marker=l}for(;a<n;){if(r=e.charCodeAt(a),r===o.marker)return o.pos=a+1,o.str+=Vi(e.slice(t,a)),o.ok=!0,o;if(r===40&&o.marker===41)return o;r===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=Vi(e.slice(t,a)),o}const RS=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:zS,parseLinkLabel:DS,parseLinkTitle:IS},Symbol.toStringTag,{value:"Module"})),sn={};sn.code_inline=function(e,t,n,i,r){const a=e[t];return"<code"+r.renderAttrs(a)+">"+Kn(a.content)+"</code>"};sn.code_block=function(e,t,n,i,r){const a=e[t];return"<pre"+r.renderAttrs(a)+"><code>"+Kn(e[t].content)+`</code></pre>
662
662
  `};sn.fence=function(e,t,n,i,r){const a=e[t],o=a.info?Vi(a.info).trim():"";let l="",c="";if(o){const f=o.split(/(\s+)/g);l=f[0],c=f.slice(2).join("")}let u;if(n.highlight?u=n.highlight(a.content,l,c)||Kn(a.content):u=Kn(a.content),u.indexOf("<pre")===0)return u+`
663
663
  `;if(o){const f=a.attrIndex("class"),m=a.attrs?a.attrs.slice():[];f<0?m.push(["class",n.langPrefix+l]):(m[f]=m[f].slice(),m[f][1]+=" "+n.langPrefix+l);const p={attrs:m};return`<pre><code${r.renderAttrs(p)}>${u}</code></pre>
664
664
  `}return`<pre><code${r.renderAttrs(a)}>${u}</code></pre>
@@ -670,25 +670,25 @@
670
670
  `};sn.text=function(e,t){return Kn(e[t].content)};sn.html_block=function(e,t){return e[t].content};sn.html_inline=function(e,t){return e[t].content};function ji(){this.rules=jo({},sn)}ji.prototype.renderAttrs=function(t){let n,i,r;if(!t.attrs)return"";for(r="",n=0,i=t.attrs.length;n<i;n++)r+=" "+Kn(t.attrs[n][0])+'="'+Kn(t.attrs[n][1])+'"';return r};ji.prototype.renderToken=function(t,n,i){const r=t[n];let a="";if(r.hidden)return"";r.block&&r.nesting!==-1&&n&&t[n-1].hidden&&(a+=`
671
671
  `),a+=(r.nesting===-1?"</":"<")+r.tag,a+=this.renderAttrs(r),r.nesting===0&&i.xhtmlOut&&(a+=" /");let o=!1;if(r.block&&(o=!0,r.nesting===1&&n+1<t.length)){const l=t[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===r.tag)&&(o=!1)}return a+=o?`>
672
672
  `:">",a};ji.prototype.renderInline=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t)}return i};ji.prototype.renderInlineAsText=function(e,t,n){let i="";for(let r=0,a=e.length;r<a;r++)switch(e[r].type){case"text":i+=e[r].content;break;case"image":i+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":i+=e[r].content;break;case"softbreak":case"hardbreak":i+=`
673
- `;break}return i};ji.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;l==="inline"?i+=this.renderInline(e[a].children,t,n):typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t,n)}return i};function At(){this.__rules__=[],this.__cache__=null}At.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};At.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})};At.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null};At.prototype.before=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};At.prototype.after=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};At.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null};At.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n};At.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};At.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n};At.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Xt(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Xt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1};Xt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Xt.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r};Xt.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i};Xt.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function Vm(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Vm.prototype.Token=Xt;const RS=/\r\n?|\n/g,LS=/\0/g;function BS(e){let t;t=e.src.replace(RS,`
674
- `),t=t.replace(LS,"�"),e.src=t}function PS(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function FS(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function VS(e){return/^<a[>\s]/i.test(e)}function US(e){return/^<\/a\s*>/i.test(e)}function HS(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,a=0;for(let o=r.length-1;o>=0;o--){const l=r[o];if(l.type==="link_close"){for(o--;r[o].level!==l.level&&r[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(VS(l.content)&&a>0&&a--,US(l.content)&&a++),!(a>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let u=e.md.linkify.match(c);const f=[];let m=l.level,p=0;u.length>0&&u[0].index===0&&o>0&&r[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;h<u.length;h++){const g=u[h].url,b=e.md.normalizeLink(g);if(!e.md.validateLink(b))continue;let y=u[h].text;u[h].schema?u[h].schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,"");const v=u[h].index;if(v>p){const S=new e.Token("text","",0);S.content=c.slice(p,v),S.level=m,f.push(S)}const x=new e.Token("link_open","a",1);x.attrs=[["href",b]],x.level=m++,x.markup="linkify",x.info="auto",f.push(x);const k=new e.Token("text","",0);k.content=y,k.level=m,f.push(k);const w=new e.Token("link_close","a",-1);w.level=--m,w.markup="linkify",w.info="auto",f.push(w),p=u[h].lastIndex}if(p<c.length){const h=new e.Token("text","",0);h.content=c.slice(p),h.level=m,f.push(h)}t[n].children=r=Bm(r,o,f)}}}}const Um=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,qS=/\((c|tm|r)\)/i,jS=/\((c|tm|r)\)/ig,$S={c:"©",r:"®",tm:"™"};function WS(e,t){return $S[t.toLowerCase()]}function GS(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(jS,WS)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function KS(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&Um.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function XS(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(qS.test(e.tokens[t].content)&&GS(e.tokens[t].children),Um.test(e.tokens[t].content)&&KS(e.tokens[t].children))}const JS=/['"]/,Td=/['"]/g,Nd="’";function Ea(e,t,n,i){e[t]||(e[t]=[]),e[t].push({pos:n,ch:i})}function ZS(e,t){let n="",i=0;t.sort((r,a)=>r.pos-a.pos);for(let r=0;r<t.length;r++){const a=t[r];n+=e.slice(i,a.pos)+a.ch,i=a.pos+1}return n+e.slice(i)}function QS(e,t){let n;const i=[],r={};for(let a=0;a<e.length;a++){const o=e[a],l=e[a].level;for(n=i.length-1;n>=0&&!(i[n].level<=l);n--);if(i.length=n+1,o.type!=="text")continue;const c=o.content;let u=0;const f=c.length;e:for(;u<f;){Td.lastIndex=u;const m=Td.exec(c);if(!m)break;let p=!0,h=!0;u=m.index+1;const g=m[0]==="'";let b=32;if(m.index-1>=0)b=c.charCodeAt(m.index-1);else for(n=a-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){b=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u<f)y=c.charCodeAt(u);else for(n=a+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const v=Ir(b)||zr(b),x=Ir(y)||zr(y),k=Dr(b),w=Dr(y);if(w?p=!1:x&&(k||v||(p=!1)),k?h=!1:v&&(w||x||(h=!1)),y===34&&m[0]==='"'&&b>=48&&b<=57&&(h=p=!1),p&&h&&(p=v,h=x),!p&&!h){g&&Ea(r,a,m.index,Nd);continue}if(h)for(n=i.length-1;n>=0;n--){let S=i[n];if(i[n].level<l)break;if(S.single===g&&i[n].level===l){S=i[n];let A,I;g?(A=t.md.options.quotes[2],I=t.md.options.quotes[3]):(A=t.md.options.quotes[0],I=t.md.options.quotes[1]),Ea(r,a,m.index,I),Ea(r,S.token,S.pos,A),i.length=n;continue e}}p?i.push({token:a,pos:m.index,single:g,level:l}):h&&g&&Ea(r,a,m.index,Nd)}}Object.keys(r).forEach(function(a){e[a].content=ZS(e[a].content,r[a])})}function YS(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!JS.test(e.tokens[t].content)||QS(e.tokens[t].children,e)}function e4(e){let t,n;const i=e.tokens,r=i.length;for(let a=0;a<r;a++){if(i[a].type!=="inline")continue;const o=i[a].children,l=o.length;for(t=0;t<l;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<l;t++)o[t].type==="text"&&t+1<l&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const Ms=[["normalize",BS],["block",PS],["inline",FS],["linkify",HS],["replacements",XS],["smartquotes",YS],["text_join",e4]];function Dc(){this.ruler=new At;for(let e=0;e<Ms.length;e++)this.ruler.push(Ms[e][0],Ms[e][1])}Dc.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)};Dc.prototype.State=Vm;function ln(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let a=0,o=0,l=0,c=0,u=r.length,f=!1;o<u;o++){const m=r.charCodeAt(o);if(!f)if(Be(m)){l++,m===9?c+=4-c%4:c++;continue}else f=!0;(m===10||o===u-1)&&(m!==10&&o++,this.bMarks.push(a),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),f=!1,l=0,c=0,a=o+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ln.prototype.push=function(e,t,n){const i=new Xt(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i};ln.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};ln.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};ln.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Be(i))break}return t};ln.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Be(this.src.charCodeAt(--t)))return t+1;return t};ln.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t};ln.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t};ln.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const a=new Array(n-t);for(let o=0,l=t;l<n;l++,o++){let c=0;const u=this.bMarks[l];let f=u,m;for(l+1<n||r?m=this.eMarks[l]+1:m=this.eMarks[l];f<m&&c<i;){const p=this.src.charCodeAt(f);if(Be(p))p===9?c+=4-(c+this.bsCount[l])%4:c++;else if(f-u<this.tShift[l])c++;else break;f++}c>i?a[o]=new Array(c-i+1).join(" ")+this.src.slice(f,m):a[o]=this.src.slice(f,m)}return a.join("")};ln.prototype.Token=Xt;const t4=65536;function Ds(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Od(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),a=!1,o=0,l="";for(;i<n;)r===124&&(a?(l+=e.substring(o,i-1),o=i):(t.push(l+e.substring(o,i)),l="",o=i+1)),a=r===92,i++,r=e.charCodeAt(i);return t.push(l+e.substring(o)),t}function n4(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let a=e.bMarks[r]+e.tShift[r];if(a>=e.eMarks[r])return!1;const o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[r])return!1;const l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Be(l)||o===45&&Be(l))return!1;for(;a<e.eMarks[r];){const w=e.src.charCodeAt(a);if(w!==124&&w!==45&&w!==58&&!Be(w))return!1;a++}let c=Ds(e,t+1),u=c.split("|");const f=[];for(let w=0;w<u.length;w++){const S=u[w].trim();if(!S){if(w===0||w===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?f.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=Ds(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Od(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const m=u.length;if(m===0||m!==f.length)return!1;if(i)return!0;const p=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),b=[t,0];g.map=b;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let w=0;w<u.length;w++){const S=e.push("th_open","th",1);f[w]&&(S.attrs=[["style","text-align:"+f[w]]]);const A=e.push("inline","",0);A.content=u[w].trim(),A.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,k=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let w=!1;for(let A=0,I=h.length;A<I;A++)if(h[A](e,r,n,!0)){w=!0;break}if(w||(c=Ds(e,r).trim(),!c)||e.sCount[r]-e.blkIndent>=4||(u=Od(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=m-u.length,k>t4))break;if(r===t+2){const A=e.push("tbody_open","tbody",1);A.map=x=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[r,r+1];for(let A=0;A<m;A++){const I=e.push("td_open","td",1);f[A]&&(I.attrs=[["style","text-align:"+f[A]]]);const _=e.push("inline","",0);_.content=u[A]?u[A].trim():"",_.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=r),e.push("table_close","table",-1),b[1]=r,e.parentType=p,e.line=r,!0}function i4(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const a=e.push("code_block","code",0);return a.content=e.getLines(t,r,4+e.blkIndent,!1)+`
675
- `,a.map=[t,e.line],!0}function r4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>a)return!1;const o=e.src.charCodeAt(r);if(o!==126&&o!==96)return!1;let l=r;r=e.skipChars(r,o);let c=r-l;if(c<3)return!1;const u=e.src.slice(l,r),f=e.src.slice(r,a);if(o===96&&f.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let m=t,p=!1;for(;m++,!(m>=n||(r=l=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],r<a&&e.sCount[m]<e.blkIndent));)if(e.src.charCodeAt(r)===o&&!(e.sCount[m]-e.blkIndent>=4)&&(r=e.skipChars(r,o),!(r-l<c)&&(r=e.skipSpaces(r),!(r<a)))){p=!0;break}c=e.sCount[t],e.line=m+(p?1:0);const h=e.push("fence","code",0);return h.info=f,h.content=e.getLines(t+1,m,c,!0),h.markup=u,h.map=[t,e.line],!0}function a4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const l=[],c=[],u=[],f=[],m=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let h=!1,g;for(g=t;g<n;g++){const k=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],a=e.eMarks[g],r>=a)break;if(e.src.charCodeAt(r++)===62&&!k){let S=e.sCount[g]+1,A,I;e.src.charCodeAt(r)===32?(r++,S++,I=!1,A=!0):e.src.charCodeAt(r)===9?(A=!0,(e.bsCount[g]+S)%4===3?(r++,S++,I=!1):I=!0):A=!1;let _=S;for(l.push(e.bMarks[g]),e.bMarks[g]=r;r<a;){const E=e.src.charCodeAt(r);if(Be(E))E===9?_+=4-(_+e.bsCount[g]+(I?1:0))%4:_++;else break;r++}h=r>=a,c.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(A?1:0),u.push(e.sCount[g]),e.sCount[g]=_-S,f.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(h)break;let w=!1;for(let S=0,A=m.length;S<A;S++)if(m[S](e,g,n,!0)){w=!0;break}if(w){e.lineMax=g,e.blkIndent!==0&&(l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]=-1}const b=e.blkIndent;e.blkIndent=0;const y=e.push("blockquote_open","blockquote",1);y.markup=">";const v=[t,0];y.map=v,e.md.block.tokenize(e,t,g);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=o,e.parentType=p,v[1]=e.line;for(let k=0;k<f.length;k++)e.bMarks[k+t]=l[k],e.tShift[k+t]=f[k],e.sCount[k+t]=u[k],e.bsCount[k+t]=c[k];return e.blkIndent=b,!0}function o4(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;a<r;){const u=e.src.charCodeAt(a++);if(u!==o&&!Be(u))return!1;u===o&&l++}if(l<3)return!1;if(i)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(l+1).join(String.fromCharCode(o)),!0}function Md(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const a=e.src.charCodeAt(i);if(!Be(a))return-1}return i}function Dd(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let a=e.src.charCodeAt(r++);if(a<48||a>57)return-1;for(;;){if(r>=i)return-1;if(a=e.src.charCodeAt(r++),a>=48&&a<=57){if(r-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return r<i&&(a=e.src.charCodeAt(r),!Be(a))?-1:r}function s4(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function l4(e,t,n,i){let r,a,o,l,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;i&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let m,p,h;if((h=Dd(e,c))>=0){if(m=!0,o=e.bMarks[c]+e.tShift[c],p=Number(e.src.slice(o,h-1)),f&&p!==1)return!1}else if((h=Md(e,c))>=0)m=!1;else return!1;if(f&&e.skipSpaces(h)>=e.eMarks[c])return!1;if(i)return!0;const g=e.src.charCodeAt(h-1),b=e.tokens.length;m?(l=e.push("ordered_list_open","ol",1),p!==1&&(l.attrs=[["start",p]])):l=e.push("bullet_list_open","ul",1);const y=[c,0];l.map=y,l.markup=String.fromCharCode(g);let v=!1;const x=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";c<n;){a=h,r=e.eMarks[c];const w=e.sCount[c]+h-(e.bMarks[c]+e.tShift[c]);let S=w;for(;a<r;){const j=e.src.charCodeAt(a);if(j===9)S+=4-(S+e.bsCount[c])%4;else if(j===32)S++;else break;a++}const A=a;let I;A>=r?I=1:I=S-w,I>4&&(I=1);const _=w+I;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(g);const E=[c,0];l.map=E,m&&(l.info=e.src.slice(o,h-1));const z=e.tight,P=e.tShift[c],U=e.sCount[c],V=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=_,e.tight=!0,e.tShift[c]=A-e.bMarks[c],e.sCount[c]=S,A>=r&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=V,e.tShift[c]=P,e.sCount[c]=U,e.tight=z,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(g),c=e.line,E[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let B=!1;for(let j=0,$=x.length;j<$;j++)if(x[j](e,c,n,!0)){B=!0;break}if(B)break;if(m){if(h=Dd(e,c),h<0)break;o=e.bMarks[c]+e.tShift[c]}else if(h=Md(e,c),h<0)break;if(g!==e.src.charCodeAt(h-1))break}return m?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(g),y[1]=c,e.line=c,e.parentType=k,u&&s4(e,b),!0}function c4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function l(x){const k=e.lineMax;if(x>=k||e.isEmpty(x))return null;let w=!1;if(e.sCount[x]-e.blkIndent>3&&(w=!0),e.sCount[x]<0&&(w=!0),!w){const I=e.md.block.ruler.getRules("reference"),_=e.parentType;e.parentType="reference";let E=!1;for(let z=0,P=I.length;z<P;z++)if(I[z](e,x,k,!0)){E=!0;break}if(e.parentType=_,E)return null}const S=e.bMarks[x]+e.tShift[x],A=e.eMarks[x];return e.src.slice(S,A+1)}let c=e.src.slice(r,a+1);a=c.length;let u=-1;for(r=1;r<a;r++){const x=c.charCodeAt(r);if(x===91)return!1;if(x===93){u=r;break}else if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(x===92&&(r++,r<a&&c.charCodeAt(r)===10)){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(r=u+2;r<a;r++){const x=c.charCodeAt(r);if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Be(x))break}const f=e.md.helpers.parseLinkDestination(c,r,a);if(!f.ok)return!1;const m=e.md.normalizeLink(f.str);if(!e.md.validateLink(m))return!1;r=f.pos;const p=r,h=o,g=r;for(;r<a;r++){const x=c.charCodeAt(r);if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Be(x))break}let b=e.md.helpers.parseLinkTitle(c,r,a);for(;b.can_continue;){const x=l(o);if(x===null)break;c+=x,r=a,a=c.length,o++,b=e.md.helpers.parseLinkTitle(c,r,a,b)}let y;for(r<a&&g!==r&&b.ok?(y=b.str,r=b.pos):(y="",r=p,o=h);r<a;){const x=c.charCodeAt(r);if(!Be(x))break;r++}if(r<a&&c.charCodeAt(r)!==10&&y)for(y="",r=p,o=h;r<a;){const x=c.charCodeAt(r);if(!Be(x))break;r++}if(r<a&&c.charCodeAt(r)!==10)return!1;const v=$o(c.slice(1,u));return v?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:y,href:m}),e.line=o),!0):!1}const u4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],d4="[a-zA-Z_:][a-zA-Z0-9:._-]*",f4="[^\"'=<>`\\x00-\\x20]+",p4="'[^']*'",m4='"[^"]*"',h4="(?:"+f4+"|"+p4+"|"+m4+")",b4="(?:\\s+"+d4+"(?:\\s*=\\s*"+h4+")?)",Hm="<[A-Za-z][A-Za-z0-9\\-]*"+b4+"*\\s*\\/?>",qm="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",g4="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",v4="<[?][\\s\\S]*?[?]>",x4="<![A-Za-z][^>]*>",y4="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",k4=new RegExp("^(?:"+Hm+"|"+qm+"|"+g4+"|"+v4+"|"+x4+"|"+y4+")"),w4=new RegExp("^(?:"+Hm+"|"+qm+")"),ai=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+u4.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(w4.source+"\\s*$"),/^$/,!1]];function _4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let o=e.src.slice(r,a),l=0;for(;l<ai.length&&!ai[l][0].test(o);l++);if(l===ai.length)return!1;if(i)return ai[l][2];let c=t+1;const u=ai[l][1].test("");if(!ai[l][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(r=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(r,a),ai[l][1].test(o)){o.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function S4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(r);if(o!==35||r>=a)return!1;let l=1;for(o=e.src.charCodeAt(++r);o===35&&r<a&&l<=6;)l++,o=e.src.charCodeAt(++r);if(l>6||r<a&&!Be(o))return!1;if(i)return!0;a=e.skipSpacesBack(a,r);const c=e.skipCharsBack(a,35,r);c>r&&Be(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;const u=e.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[t,e.line];const f=e.push("inline","",0);f.content=Wo(e.src.slice(r,a)),f.map=[t,e.line],f.children=[];const m=e.push("heading_close","h"+String(l),-1);return m.markup="########".slice(0,l),!0}function C4(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let a=0,o,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let h=e.bMarks[l]+e.tShift[l];const g=e.eMarks[l];if(h<g&&(o=e.src.charCodeAt(h),(o===45||o===61)&&(h=e.skipChars(h,o),h=e.skipSpaces(h),h>=g))){a=o===61?1:2;break}}if(e.sCount[l]<0)continue;let p=!1;for(let h=0,g=i.length;h<g;h++)if(i[h](e,l,n,!0)){p=!0;break}if(p)break}if(!a)return e.parentType=r,!1;const c=Wo(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const u=e.push("heading_open","h"+String(a),1);u.markup=String.fromCharCode(o),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const m=e.push("heading_close","h"+String(a),-1);return m.markup=String.fromCharCode(o),e.parentType=r,!0}function E4(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let a=t+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let u=!1;for(let f=0,m=i.length;f<m;f++)if(i[f](e,a,n,!0)){u=!0;break}if(u)break}const o=Wo(e.getLines(t,a,e.blkIndent,!1));e.line=a;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Aa=[["table",n4,["paragraph","reference"]],["code",i4],["fence",r4,["paragraph","reference","blockquote","list"]],["blockquote",a4,["paragraph","reference","blockquote","list"]],["hr",o4,["paragraph","reference","blockquote","list"]],["list",l4,["paragraph","reference","blockquote"]],["reference",c4],["html_block",_4,["paragraph","reference","blockquote"]],["heading",S4,["paragraph","reference","blockquote"]],["lheading",C4],["paragraph",E4]];function Go(){this.ruler=new At;for(let e=0;e<Aa.length;e++)this.ruler.push(Aa[e][0],Aa[e][1],{alt:(Aa[e][2]||[]).slice()})}Go.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,a=e.md.options.maxNesting;let o=t,l=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<r;f++)if(u=i[f](e,o,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),o=e.line,o<n&&e.isEmpty(o)&&(l=!0,o++,e.line=o)}};Go.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)};Go.prototype.State=ln;function Ur(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ur.prototype.pushPending=function(){const e=new Xt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ur.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Xt(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Ur.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const y=this.src.charCodeAt(e-2);r=(y&64512)===55296?65536+(y-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===i;)a++;const o=a-e;let l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){const y=this.src.charCodeAt(a+1);l=(y&64512)===56320?65536+(l-55296<<10)+(y-56320):65533}else(l&64512)===56320&&(l=65533);const c=Ir(r)||zr(r),u=Ir(l)||zr(l),f=Dr(r),m=Dr(l),p=!m&&(!u||f||c),h=!f&&(!c||m||u);return{can_open:p&&(t||!h||c),can_close:h&&(t||!p||u),length:o}};Ur.prototype.Token=Xt;function A4(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function T4(e,t){let n=e.pos;for(;n<e.posMax&&!A4(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const N4=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function O4(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(N4);if(!r)return!1;const a=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let l=o.url;if(l.length<=a.length)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const m=e.push("text","",0);m.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-a.length,!0}function M4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let a=i-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Be(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const zc=[];for(let e=0;e<256;e++)zc.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){zc[e.charCodeAt(0)]=1});function D4(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Be(r));)n++;return e.pos=n,!0}if(r===32){if(!t){const l=e.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return e.pos=n,!0}let a=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}const o="\\"+a;if(!t){const l=e.push("text_special","",0);r<256&&zc[r]!==0?l.content=a:l.content=o,l.markup=o,l.info="escape"}return e.pos=n+1,!0}function z4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const a=e.posMax;for(;n<a&&e.src.charCodeAt(n)===96;)n++;const o=e.src.slice(r,n),l=o.length;if(e.backticksScanned&&(e.backticks[l]||0)<=r)return t||(e.pending+=o),e.pos+=l,!0;let c=n,u;for(;(u=e.src.indexOf("`",c))!==-1;){for(c=u+1;c<a&&e.src.charCodeAt(c)===96;)c++;const f=c-u;if(f===l){if(!t){const m=e.push("code_inline","code",0);m.markup=o,m.content=e.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[f]=u}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0}function I4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let a=r.length;const o=String.fromCharCode(i);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=o,a--);for(let c=0;c<a;c+=2)l=e.push("text","",0),l.content=o+o,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function zd(e,t){let n;const i=[],r=t.length;for(let a=0;a<r;a++){const o=t[a];if(o.marker!==126||o.end===-1)continue;const l=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&i.push(l.token-1)}for(;i.length;){const a=i.pop();let o=a+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,a!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[a],e.tokens[a]=n)}}function R4(e){const t=e.tokens_meta,n=e.tokens_meta.length;zd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&zd(e,t[i].delimiters)}const jm={tokenize:I4,postProcess:R4};function L4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let a=0;a<r.length;a++){const o=e.push("text","",0);o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Id(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const a=t[r.end],o=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===a.token+1,l=String.fromCharCode(r.marker),c=e.tokens[r.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?l+l:l,c.content="";const u=e.tokens[a.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function B4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Id(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Id(e,t[i].delimiters)}const $m={tokenize:L4,postProcess:B4};function P4(e,t){let n,i,r,a,o="",l="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,m=e.posMax,p=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let g=h+1;if(g<m&&e.src.charCodeAt(g)===40){for(u=!1,g++;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);if(g>=m)return!1;if(c=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(o=e.md.normalizeLink(r.str),e.md.validateLink(o)?g=r.pos:o="",c=g;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<m&&c!==g&&r.ok)for(l=r.str,g=r.pos;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);}(g>=m||e.src.charCodeAt(g)!==41)&&(u=!0),g++}if(u){if(typeof e.env.references>"u")return!1;if(g<m&&e.src.charCodeAt(g)===91?(c=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?i=e.src.slice(c,g++):g=h+1):g=h+1,i||(i=e.src.slice(p,h)),a=e.env.references[$o(i)],!a)return e.pos=f,!1;o=a.href,l=a.title}if(!t){e.pos=p,e.posMax=h;const b=e.push("link_open","a",1),y=[["href",o]];b.attrs=y,l&&y.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=m,!0}function F4(e,t){let n,i,r,a,o,l,c,u,f="";const m=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(a=g+1,a<p&&e.src.charCodeAt(a)===40){for(a++;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);if(a>=p)return!1;for(u=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f=""),u=a;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<p&&u!==a&&l.ok)for(c=l.str,a=l.pos;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);else c="";if(a>=p||e.src.charCodeAt(a)!==41)return e.pos=m,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<p&&e.src.charCodeAt(a)===91?(u=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?r=e.src.slice(u,a++):a=g+1):a=g+1,r||(r=e.src.slice(h,g)),o=e.env.references[$o(r)],!o)return e.pos=m,!1;f=o.href,c=o.title}if(!t){i=e.src.slice(h,g);const b=[];e.md.inline.parse(i,e.md,e.env,b);const y=e.push("image","img",0),v=[["src",f],["alt",""]];y.attrs=v,y.children=b,y.content=i,c&&v.push(["title",c])}return e.pos=a,e.posMax=p,!0}const V4=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,U4=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function H4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const a=e.src.slice(i+1,n);if(U4.test(a)){const o=e.md.normalizeLink(a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}if(V4.test(a)){const o=e.md.normalizeLink("mailto:"+a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}return!1}function q4(e){return/^<a[>\s]/i.test(e)}function j4(e){return/^<\/a\s*>/i.test(e)}function $4(e){const t=e|32;return t>=97&&t<=122}function W4(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!$4(r))return!1;const a=e.src.slice(i).match(k4);if(!a)return!1;if(!t){const o=e.push("html_inline","",0);o.content=a[0],q4(o.content)&&e.linkLevel++,j4(o.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}const G4=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,K4=/^&([a-z][a-z0-9]{1,31});/i;function X4(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const a=e.src.slice(n).match(G4);if(a){if(!t){const o=a[1][0].toLowerCase()==="x"?parseInt(a[1].slice(1),16):parseInt(a[1],10),l=e.push("text_special","",0);l.content=Mc(o)?Mr(o):Mr(65533),l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}else{const a=e.src.slice(n).match(K4);if(a){const o=mS(a[0]);if(o!==a[0]){if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}}return!1}function Rd(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const a=[];for(let o=0;o<n;o++){const l=e[o];if(a.push(0),(e[i].marker!==l.marker||r!==l.token-1)&&(i=o),r=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[l.marker][(l.open?3:0)+l.length%3];let u=i-a[i]-1,f=u;for(;u>c;u-=a[u]+1){const m=e[u];if(m.marker===l.marker&&m.open&&m.end<0){let p=!1;if((m.close||l.open)&&(m.length+l.length)%3===0&&(m.length%3!==0||l.length%3!==0)&&(p=!0),!p){const h=u>0&&!e[u-1].open?a[u-1]+1:0;a[o]=o-u+h,a[u]=h,l.open=!1,m.end=o,m.close=!1,f=-1,r=-2;break}}}f!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function J4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Rd(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Rd(t[i].delimiters)}function Z4(e){let t,n,i=0;const r=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<a&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const zs=[["text",T4],["linkify",O4],["newline",M4],["escape",D4],["backticks",z4],["strikethrough",jm.tokenize],["emphasis",$m.tokenize],["link",P4],["image",F4],["autolink",H4],["html_inline",W4],["entity",X4]],Is=[["balance_pairs",J4],["strikethrough",jm.postProcess],["emphasis",$m.postProcess],["fragments_join",Z4]];function Hr(){this.ruler=new At;for(let e=0;e<zs.length;e++)this.ruler.push(zs[e][0],zs[e][1]);this.ruler2=new At;for(let e=0;e<Is.length;e++)this.ruler2.push(Is[e][0],Is[e][1])}Hr.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,a=e.cache;if(typeof a[t]<"u"){e.pos=a[t];return}let o=!1;if(e.level<r){for(let l=0;l<i;l++)if(e.level++,o=n[l](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos};Hr.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const a=e.pos;let o=!1;if(e.level<r){for(let l=0;l<n;l++)if(o=t[l](e,!1),o){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Hr.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const a=this.ruler2.getRules(""),o=a.length;for(let l=0;l<o;l++)a[l](r)};Hr.prototype.State=Ur;function Q4(e){const t={};e=e||{},t.src_Any=Mm.source,t.src_Cc=Dm.source,t.src_Z=Im.source,t.src_P=Nc.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain="(?:"+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy="(?:"+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Nl(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Ko(e){return Object.prototype.toString.call(e)}function Y4(e){return Ko(e)==="[object String]"}function eC(e){return Ko(e)==="[object Object]"}function tC(e){return Ko(e)==="[object RegExp]"}function Ld(e){return Ko(e)==="[object Function]"}function nC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Wm={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function iC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Wm.hasOwnProperty(n)},!1)}const rC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},aC="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",oC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function sC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function Bd(){return function(e,t){t.normalize(e)}}function Mo(e){const t=e.re=Q4(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(aC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(i(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(i(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(i(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function a(l,c){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${c}`)}Object.keys(e.__schemas__).forEach(function(l){const c=e.__schemas__[l];if(c===null)return;const u={validate:null,link:null};if(e.__compiled__[l]=u,eC(c)){tC(c.validate)?u.validate=sC(c.validate):Ld(c.validate)?u.validate=c.validate:a(l,c),Ld(c.normalize)?u.normalize=c.normalize:c.normalize?a(l,c):u.normalize=Bd();return}if(Y4(c)){r.push(l);return}a(l,c)}),r.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Bd()};const o=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(nC).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${o})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${o})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function Gm(e,t,n,i){const r=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}function Lt(e,t){if(!(this instanceof Lt))return new Lt(e,t);t||iC(e)&&(t=e,e={}),this.__opts__=Nl({},Wm,t),this.__schemas__=Nl({},rC,e),this.__compiled__={},this.__tlds__=oC,this.__tlds_replaced__=!1,this.re={},Mo(this)}Lt.prototype.add=function(t,n){return this.__schemas__[t]=n,Mo(this),this};Lt.prototype.set=function(t){return this.__opts__=Nl(this.__opts__,t),this};Lt.prototype.test=function(t){if(!t.length)return!1;let n,i;if(this.re.schema_test.test(t)){for(i=this.re.schema_search,i.lastIndex=0;(n=i.exec(t))!==null;)if(this.testSchemaAt(t,n[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Lt.prototype.pretest=function(t){return this.re.pretest.test(t)};Lt.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0};Lt.prototype.match=function(t){const n=[],i=[],r=[],a=[];let o,l,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(t))!==null;)l=this.testSchemaAt(t,o[2],c.lastIndex),l&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)a.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const f=[0,0,0];let m=0;for(;;){const p=[i[f[0]],a[f[1]],r[f[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?f[0]++:h===p[1]?f[1]++:f[2]++,h.index<m)continue;const g=new Gm(t,h.schema,h.index,h.lastIndex);this.__compiled__[g.schema].normalize(g,this),n.push(g),m=h.lastIndex}return n.length?n:null};Lt.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);if(!i)return null;const r=new Gm(t,n[2],n.index+n[1].length,n.index+n[0].length+i);return this.__compiled__[r.schema].normalize(r,this),r};Lt.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,a){return i!==a[r-1]}).reverse(),Mo(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Mo(this),this)};Lt.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)};Lt.prototype.onCompile=function(){};const Ri=2147483647,nn=36,Ic=1,Rr=26,lC=38,cC=700,Km=72,Xm=128,Jm="-",uC=/^xn--/,dC=/[^\0-\x7F]/,fC=/[\x2E\u3002\uFF0E\uFF61]/g,pC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rs=nn-Ic,rn=Math.floor,Ls=String.fromCharCode;function Pn(e){throw new RangeError(pC[e])}function mC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Zm(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(fC,".");const r=e.split("."),a=mC(r,t).join(".");return i+a}function Qm(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const a=e.charCodeAt(n++);(a&64512)==56320?t.push(((r&1023)<<10)+(a&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const hC=e=>String.fromCodePoint(...e),bC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:nn},Pd=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ym=function(e,t,n){let i=0;for(e=n?rn(e/cC):e>>1,e+=rn(e/t);e>Rs*Rr>>1;i+=nn)e=rn(e/Rs);return rn(i+(Rs+1)*e/(e+lC))},eh=function(e){const t=[],n=e.length;let i=0,r=Xm,a=Km,o=e.lastIndexOf(Jm);o<0&&(o=0);for(let l=0;l<o;++l)e.charCodeAt(l)>=128&&Pn("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const c=i;for(let f=1,m=nn;;m+=nn){l>=n&&Pn("invalid-input");const p=bC(e.charCodeAt(l++));p>=nn&&Pn("invalid-input"),p>rn((Ri-i)/f)&&Pn("overflow"),i+=p*f;const h=m<=a?Ic:m>=a+Rr?Rr:m-a;if(p<h)break;const g=nn-h;f>rn(Ri/g)&&Pn("overflow"),f*=g}const u=t.length+1;a=Ym(i-c,u,c==0),rn(i/u)>Ri-r&&Pn("overflow"),r+=rn(i/u),i%=u,t.splice(i++,0,r)}return String.fromCodePoint(...t)},th=function(e){const t=[];e=Qm(e);const n=e.length;let i=Xm,r=0,a=Km;for(const c of e)c<128&&t.push(Ls(c));const o=t.length;let l=o;for(o&&t.push(Jm);l<n;){let c=Ri;for(const f of e)f>=i&&f<c&&(c=f);const u=l+1;c-i>rn((Ri-r)/u)&&Pn("overflow"),r+=(c-i)*u,i=c;for(const f of e)if(f<i&&++r>Ri&&Pn("overflow"),f===i){let m=r;for(let p=nn;;p+=nn){const h=p<=a?Ic:p>=a+Rr?Rr:p-a;if(m<h)break;const g=m-h,b=nn-h;t.push(Ls(Pd(h+g%b,0))),m=rn(g/b)}t.push(Ls(Pd(m,0))),a=Ym(r,u,l===o),r=0,++l}++r,++i}return t.join("")},gC=function(e){return Zm(e,function(t){return uC.test(t)?eh(t.slice(4).toLowerCase()):t})},vC=function(e){return Zm(e,function(t){return dC.test(t)?"xn--"+th(t):t})},nh={version:"2.3.1",ucs2:{decode:Qm,encode:hC},decode:eh,encode:th,toASCII:vC,toUnicode:gC},xC={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},yC={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},kC={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},wC={default:xC,zero:yC,commonmark:kC},_C=/^(vbscript|javascript|file|data):/,SC=/^data:image\/(gif|png|jpeg|webp);/;function CC(e){const t=e.trim().toLowerCase();return _C.test(t)?SC.test(t):!0}const ih=["http:","https:","mailto:"];function EC(e){const t=Tc(e,!0);if(t.hostname&&(!t.protocol||ih.indexOf(t.protocol)>=0))try{t.hostname=nh.toASCII(t.hostname)}catch{}return Vr(Ac(t))}function AC(e){const t=Tc(e,!0);if(t.hostname&&(!t.protocol||ih.indexOf(t.protocol)>=0))try{t.hostname=nh.toUnicode(t.hostname)}catch{}return Fi(Ac(t),Fi.defaultChars+"%")}function Tt(e,t){if(!(this instanceof Tt))return new Tt(e,t);t||Oc(e)||(t=e||{},e="default"),this.inline=new Hr,this.block=new Go,this.core=new Dc,this.renderer=new ji,this.linkify=new Lt,this.validateLink=CC,this.normalizeLink=EC,this.normalizeLinkText=AC,this.utils=OS,this.helpers=jo({},IS),this.options={},this.configure(e),t&&this.set(t)}Tt.prototype.set=function(e){return jo(this.options,e),this};Tt.prototype.configure=function(e){const t=this;if(Oc(e)){const n=e;if(e=wC[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Tt.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Tt.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Tt.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Tt.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Tt.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Tt.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Tt.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const TC=new Qf({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function NC(e,t){if(e.isText&&t.isText&&Re.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class OC{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:Re.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),i=n.content,r=i[i.length-1],a=this.schema.text(t,n.marks),o;r&&(o=NC(r,a))?i[i.length-1]=o:i.push(a)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let i=t[n],r=this.tokenHandlers[i.type];if(!r)throw new Error("Token type `"+i.type+"` not supported by Markdown parser");r(this,i,t,n)}}addNode(t,n,i){let r=this.top(),a=t.createAndFill(n,i,r?r.marks:[]);return a?(this.push(a),a):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:Re.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function nr(e,t,n,i){return e.getAttrs?e.getAttrs(t,n,i):e.attrs instanceof Function?e.attrs(t):e.attrs}function Bs(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function Fd(e){return e[e.length-1]==`
676
- `?e.slice(0,e.length-1):e}function Ps(){}function MC(e,t){let n=Object.create(null);for(let i in t){let r=t[i];if(r.block){let a=e.nodeType(r.block);Bs(r,i)?n[i]=(o,l,c,u)=>{o.openNode(a,nr(r,l,c,u)),o.addText(Fd(l.content)),o.closeNode()}:(n[i+"_open"]=(o,l,c,u)=>o.openNode(a,nr(r,l,c,u)),n[i+"_close"]=o=>o.closeNode())}else if(r.node){let a=e.nodeType(r.node);n[i]=(o,l,c,u)=>o.addNode(a,nr(r,l,c,u))}else if(r.mark){let a=e.marks[r.mark];Bs(r,i)?n[i]=(o,l,c,u)=>{o.openMark(a.create(nr(r,l,c,u))),o.addText(Fd(l.content)),o.closeMark(a)}:(n[i+"_open"]=(o,l,c,u)=>o.openMark(a.create(nr(r,l,c,u))),n[i+"_close"]=o=>o.closeMark(a))}else if(r.ignore)Bs(r,i)?n[i]=Ps:(n[i+"_open"]=Ps,n[i+"_close"]=Ps);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(r))}return n.text=(i,r)=>i.addText(r.content),n.inline=(i,r)=>i.parseTokens(r.children),n.softbreak=n.softbreak||(i=>i.addText(" ")),n}let DC=class{constructor(t,n,i){this.schema=t,this.tokenizer=n,this.tokens=i,this.tokenHandlers=MC(t,i)}parse(t,n={}){let i=new OC(this.schema,this.tokenHandlers),r;i.parseTokens(this.tokenizer.parse(t,n));do r=i.closeNode();while(i.stack.length);return r||this.schema.topNodeType.createAndFill()}};function Vd(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new DC(TC,Tt("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:Vd(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:Vd(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const zC={open:"",close:"",mixable:!0};let IC=class{constructor(t,n,i={}){this.nodes=t,this.marks=n,this.options=i}serialize(t,n={}){n=Object.assign({},this.options,n);let i=new rh(this.nodes,this.marks,n);return i.renderContent(t),i.out}};const cn=new IC({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),i=n?n.sort().slice(-1)[0]+"`":"```";e.write(i+(t.attrs.params||"")+`
673
+ `;break}return i};ji.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let a=0,o=e.length;a<o;a++){const l=e[a].type;l==="inline"?i+=this.renderInline(e[a].children,t,n):typeof r[l]<"u"?i+=r[l](e,a,t,n,this):i+=this.renderToken(e,a,t,n)}return i};function At(){this.__rules__=[],this.__cache__=null}At.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};At.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})};At.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null};At.prototype.before=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};At.prototype.after=function(e,t,n,i){const r=this.__find__(e),a=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null};At.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null};At.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n};At.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};At.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n};At.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Xt(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Xt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1};Xt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Xt.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r};Xt.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i};Xt.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function Vm(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Vm.prototype.Token=Xt;const LS=/\r\n?|\n/g,BS=/\0/g;function PS(e){let t;t=e.src.replace(LS,`
674
+ `),t=t.replace(BS,"�"),e.src=t}function FS(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function VS(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function US(e){return/^<a[>\s]/i.test(e)}function HS(e){return/^<\/a\s*>/i.test(e)}function qS(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,a=0;for(let o=r.length-1;o>=0;o--){const l=r[o];if(l.type==="link_close"){for(o--;r[o].level!==l.level&&r[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(US(l.content)&&a>0&&a--,HS(l.content)&&a++),!(a>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let u=e.md.linkify.match(c);const f=[];let m=l.level,p=0;u.length>0&&u[0].index===0&&o>0&&r[o-1].type==="text_special"&&(u=u.slice(1));for(let h=0;h<u.length;h++){const g=u[h].url,b=e.md.normalizeLink(g);if(!e.md.validateLink(b))continue;let y=u[h].text;u[h].schema?u[h].schema==="mailto:"&&!/^mailto:/i.test(y)?y=e.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):y=e.md.normalizeLinkText(y):y=e.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,"");const v=u[h].index;if(v>p){const S=new e.Token("text","",0);S.content=c.slice(p,v),S.level=m,f.push(S)}const x=new e.Token("link_open","a",1);x.attrs=[["href",b]],x.level=m++,x.markup="linkify",x.info="auto",f.push(x);const k=new e.Token("text","",0);k.content=y,k.level=m,f.push(k);const w=new e.Token("link_close","a",-1);w.level=--m,w.markup="linkify",w.info="auto",f.push(w),p=u[h].lastIndex}if(p<c.length){const h=new e.Token("text","",0);h.content=c.slice(p),h.level=m,f.push(h)}t[n].children=r=Bm(r,o,f)}}}}const Um=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,jS=/\((c|tm|r)\)/i,$S=/\((c|tm|r)\)/ig,WS={c:"©",r:"®",tm:"™"};function GS(e,t){return WS[t.toLowerCase()]}function KS(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace($S,GS)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function XS(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&Um.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function JS(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(jS.test(e.tokens[t].content)&&KS(e.tokens[t].children),Um.test(e.tokens[t].content)&&XS(e.tokens[t].children))}const ZS=/['"]/,Td=/['"]/g,Nd="’";function Ea(e,t,n,i){e[t]||(e[t]=[]),e[t].push({pos:n,ch:i})}function QS(e,t){let n="",i=0;t.sort((r,a)=>r.pos-a.pos);for(let r=0;r<t.length;r++){const a=t[r];n+=e.slice(i,a.pos)+a.ch,i=a.pos+1}return n+e.slice(i)}function YS(e,t){let n;const i=[],r={};for(let a=0;a<e.length;a++){const o=e[a],l=e[a].level;for(n=i.length-1;n>=0&&!(i[n].level<=l);n--);if(i.length=n+1,o.type!=="text")continue;const c=o.content;let u=0;const f=c.length;e:for(;u<f;){Td.lastIndex=u;const m=Td.exec(c);if(!m)break;let p=!0,h=!0;u=m.index+1;const g=m[0]==="'";let b=32;if(m.index-1>=0)b=c.charCodeAt(m.index-1);else for(n=a-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){b=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u<f)y=c.charCodeAt(u);else for(n=a+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){y=e[n].content.charCodeAt(0);break}const v=Ir(b)||zr(b),x=Ir(y)||zr(y),k=Dr(b),w=Dr(y);if(w?p=!1:x&&(k||v||(p=!1)),k?h=!1:v&&(w||x||(h=!1)),y===34&&m[0]==='"'&&b>=48&&b<=57&&(h=p=!1),p&&h&&(p=v,h=x),!p&&!h){g&&Ea(r,a,m.index,Nd);continue}if(h)for(n=i.length-1;n>=0;n--){let S=i[n];if(i[n].level<l)break;if(S.single===g&&i[n].level===l){S=i[n];let A,I;g?(A=t.md.options.quotes[2],I=t.md.options.quotes[3]):(A=t.md.options.quotes[0],I=t.md.options.quotes[1]),Ea(r,a,m.index,I),Ea(r,S.token,S.pos,A),i.length=n;continue e}}p?i.push({token:a,pos:m.index,single:g,level:l}):h&&g&&Ea(r,a,m.index,Nd)}}Object.keys(r).forEach(function(a){e[a].content=QS(e[a].content,r[a])})}function e4(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!ZS.test(e.tokens[t].content)||YS(e.tokens[t].children,e)}function t4(e){let t,n;const i=e.tokens,r=i.length;for(let a=0;a<r;a++){if(i[a].type!=="inline")continue;const o=i[a].children,l=o.length;for(t=0;t<l;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<l;t++)o[t].type==="text"&&t+1<l&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const Ms=[["normalize",PS],["block",FS],["inline",VS],["linkify",qS],["replacements",JS],["smartquotes",e4],["text_join",t4]];function Dc(){this.ruler=new At;for(let e=0;e<Ms.length;e++)this.ruler.push(Ms[e][0],Ms[e][1])}Dc.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)};Dc.prototype.State=Vm;function ln(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let a=0,o=0,l=0,c=0,u=r.length,f=!1;o<u;o++){const m=r.charCodeAt(o);if(!f)if(Be(m)){l++,m===9?c+=4-c%4:c++;continue}else f=!0;(m===10||o===u-1)&&(m!==10&&o++,this.bMarks.push(a),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),f=!1,l=0,c=0,a=o+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ln.prototype.push=function(e,t,n){const i=new Xt(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i};ln.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};ln.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};ln.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Be(i))break}return t};ln.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Be(this.src.charCodeAt(--t)))return t+1;return t};ln.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t};ln.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t};ln.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const a=new Array(n-t);for(let o=0,l=t;l<n;l++,o++){let c=0;const u=this.bMarks[l];let f=u,m;for(l+1<n||r?m=this.eMarks[l]+1:m=this.eMarks[l];f<m&&c<i;){const p=this.src.charCodeAt(f);if(Be(p))p===9?c+=4-(c+this.bsCount[l])%4:c++;else if(f-u<this.tShift[l])c++;else break;f++}c>i?a[o]=new Array(c-i+1).join(" ")+this.src.slice(f,m):a[o]=this.src.slice(f,m)}return a.join("")};ln.prototype.Token=Xt;const n4=65536;function Ds(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Od(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),a=!1,o=0,l="";for(;i<n;)r===124&&(a?(l+=e.substring(o,i-1),o=i):(t.push(l+e.substring(o,i)),l="",o=i+1)),a=r===92,i++,r=e.charCodeAt(i);return t.push(l+e.substring(o)),t}function i4(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let a=e.bMarks[r]+e.tShift[r];if(a>=e.eMarks[r])return!1;const o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[r])return!1;const l=e.src.charCodeAt(a++);if(l!==124&&l!==45&&l!==58&&!Be(l)||o===45&&Be(l))return!1;for(;a<e.eMarks[r];){const w=e.src.charCodeAt(a);if(w!==124&&w!==45&&w!==58&&!Be(w))return!1;a++}let c=Ds(e,t+1),u=c.split("|");const f=[];for(let w=0;w<u.length;w++){const S=u[w].trim();if(!S){if(w===0||w===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?f.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?f.push("left"):f.push("")}if(c=Ds(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=Od(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const m=u.length;if(m===0||m!==f.length)return!1;if(i)return!0;const p=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),b=[t,0];g.map=b;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let w=0;w<u.length;w++){const S=e.push("th_open","th",1);f[w]&&(S.attrs=[["style","text-align:"+f[w]]]);const A=e.push("inline","",0);A.content=u[w].trim(),A.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,k=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let w=!1;for(let A=0,I=h.length;A<I;A++)if(h[A](e,r,n,!0)){w=!0;break}if(w||(c=Ds(e,r).trim(),!c)||e.sCount[r]-e.blkIndent>=4||(u=Od(c),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=m-u.length,k>n4))break;if(r===t+2){const A=e.push("tbody_open","tbody",1);A.map=x=[t+2,0]}const S=e.push("tr_open","tr",1);S.map=[r,r+1];for(let A=0;A<m;A++){const I=e.push("td_open","td",1);f[A]&&(I.attrs=[["style","text-align:"+f[A]]]);const _=e.push("inline","",0);_.content=u[A]?u[A].trim():"",_.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=r),e.push("table_close","table",-1),b[1]=r,e.parentType=p,e.line=r,!0}function r4(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const a=e.push("code_block","code",0);return a.content=e.getLines(t,r,4+e.blkIndent,!1)+`
675
+ `,a.map=[t,e.line],!0}function a4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>a)return!1;const o=e.src.charCodeAt(r);if(o!==126&&o!==96)return!1;let l=r;r=e.skipChars(r,o);let c=r-l;if(c<3)return!1;const u=e.src.slice(l,r),f=e.src.slice(r,a);if(o===96&&f.indexOf(String.fromCharCode(o))>=0)return!1;if(i)return!0;let m=t,p=!1;for(;m++,!(m>=n||(r=l=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],r<a&&e.sCount[m]<e.blkIndent));)if(e.src.charCodeAt(r)===o&&!(e.sCount[m]-e.blkIndent>=4)&&(r=e.skipChars(r,o),!(r-l<c)&&(r=e.skipSpaces(r),!(r<a)))){p=!0;break}c=e.sCount[t],e.line=m+(p?1:0);const h=e.push("fence","code",0);return h.info=f,h.content=e.getLines(t+1,m,c,!0),h.markup=u,h.map=[t,e.line],!0}function o4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const l=[],c=[],u=[],f=[],m=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let h=!1,g;for(g=t;g<n;g++){const k=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],a=e.eMarks[g],r>=a)break;if(e.src.charCodeAt(r++)===62&&!k){let S=e.sCount[g]+1,A,I;e.src.charCodeAt(r)===32?(r++,S++,I=!1,A=!0):e.src.charCodeAt(r)===9?(A=!0,(e.bsCount[g]+S)%4===3?(r++,S++,I=!1):I=!0):A=!1;let _=S;for(l.push(e.bMarks[g]),e.bMarks[g]=r;r<a;){const E=e.src.charCodeAt(r);if(Be(E))E===9?_+=4-(_+e.bsCount[g]+(I?1:0))%4:_++;else break;r++}h=r>=a,c.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(A?1:0),u.push(e.sCount[g]),e.sCount[g]=_-S,f.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(h)break;let w=!1;for(let S=0,A=m.length;S<A;S++)if(m[S](e,g,n,!0)){w=!0;break}if(w){e.lineMax=g,e.blkIndent!==0&&(l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}l.push(e.bMarks[g]),c.push(e.bsCount[g]),f.push(e.tShift[g]),u.push(e.sCount[g]),e.sCount[g]=-1}const b=e.blkIndent;e.blkIndent=0;const y=e.push("blockquote_open","blockquote",1);y.markup=">";const v=[t,0];y.map=v,e.md.block.tokenize(e,t,g);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=o,e.parentType=p,v[1]=e.line;for(let k=0;k<f.length;k++)e.bMarks[k+t]=l[k],e.tShift[k+t]=f[k],e.sCount[k+t]=u[k],e.bsCount[k+t]=c[k];return e.blkIndent=b,!0}function s4(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;a<r;){const u=e.src.charCodeAt(a++);if(u!==o&&!Be(u))return!1;u===o&&l++}if(l<3)return!1;if(i)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(l+1).join(String.fromCharCode(o)),!0}function Md(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const a=e.src.charCodeAt(i);if(!Be(a))return-1}return i}function Dd(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let a=e.src.charCodeAt(r++);if(a<48||a>57)return-1;for(;;){if(r>=i)return-1;if(a=e.src.charCodeAt(r++),a>=48&&a<=57){if(r-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return r<i&&(a=e.src.charCodeAt(r),!Be(a))?-1:r}function l4(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function c4(e,t,n,i){let r,a,o,l,c=t,u=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let f=!1;i&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(f=!0);let m,p,h;if((h=Dd(e,c))>=0){if(m=!0,o=e.bMarks[c]+e.tShift[c],p=Number(e.src.slice(o,h-1)),f&&p!==1)return!1}else if((h=Md(e,c))>=0)m=!1;else return!1;if(f&&e.skipSpaces(h)>=e.eMarks[c])return!1;if(i)return!0;const g=e.src.charCodeAt(h-1),b=e.tokens.length;m?(l=e.push("ordered_list_open","ol",1),p!==1&&(l.attrs=[["start",p]])):l=e.push("bullet_list_open","ul",1);const y=[c,0];l.map=y,l.markup=String.fromCharCode(g);let v=!1;const x=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";c<n;){a=h,r=e.eMarks[c];const w=e.sCount[c]+h-(e.bMarks[c]+e.tShift[c]);let S=w;for(;a<r;){const j=e.src.charCodeAt(a);if(j===9)S+=4-(S+e.bsCount[c])%4;else if(j===32)S++;else break;a++}const A=a;let I;A>=r?I=1:I=S-w,I>4&&(I=1);const _=w+I;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(g);const E=[c,0];l.map=E,m&&(l.info=e.src.slice(o,h-1));const z=e.tight,P=e.tShift[c],U=e.sCount[c],V=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=_,e.tight=!0,e.tShift[c]=A-e.bMarks[c],e.sCount[c]=S,A>=r&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||v)&&(u=!1),v=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=V,e.tShift[c]=P,e.sCount[c]=U,e.tight=z,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(g),c=e.line,E[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let B=!1;for(let j=0,$=x.length;j<$;j++)if(x[j](e,c,n,!0)){B=!0;break}if(B)break;if(m){if(h=Dd(e,c),h<0)break;o=e.bMarks[c]+e.tShift[c]}else if(h=Md(e,c),h<0)break;if(g!==e.src.charCodeAt(h-1))break}return m?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(g),y[1]=c,e.line=c,e.parentType=k,u&&l4(e,b),!0}function u4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function l(x){const k=e.lineMax;if(x>=k||e.isEmpty(x))return null;let w=!1;if(e.sCount[x]-e.blkIndent>3&&(w=!0),e.sCount[x]<0&&(w=!0),!w){const I=e.md.block.ruler.getRules("reference"),_=e.parentType;e.parentType="reference";let E=!1;for(let z=0,P=I.length;z<P;z++)if(I[z](e,x,k,!0)){E=!0;break}if(e.parentType=_,E)return null}const S=e.bMarks[x]+e.tShift[x],A=e.eMarks[x];return e.src.slice(S,A+1)}let c=e.src.slice(r,a+1);a=c.length;let u=-1;for(r=1;r<a;r++){const x=c.charCodeAt(r);if(x===91)return!1;if(x===93){u=r;break}else if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(x===92&&(r++,r<a&&c.charCodeAt(r)===10)){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(r=u+2;r<a;r++){const x=c.charCodeAt(r);if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Be(x))break}const f=e.md.helpers.parseLinkDestination(c,r,a);if(!f.ok)return!1;const m=e.md.normalizeLink(f.str);if(!e.md.validateLink(m))return!1;r=f.pos;const p=r,h=o,g=r;for(;r<a;r++){const x=c.charCodeAt(r);if(x===10){const k=l(o);k!==null&&(c+=k,a=c.length,o++)}else if(!Be(x))break}let b=e.md.helpers.parseLinkTitle(c,r,a);for(;b.can_continue;){const x=l(o);if(x===null)break;c+=x,r=a,a=c.length,o++,b=e.md.helpers.parseLinkTitle(c,r,a,b)}let y;for(r<a&&g!==r&&b.ok?(y=b.str,r=b.pos):(y="",r=p,o=h);r<a;){const x=c.charCodeAt(r);if(!Be(x))break;r++}if(r<a&&c.charCodeAt(r)!==10&&y)for(y="",r=p,o=h;r<a;){const x=c.charCodeAt(r);if(!Be(x))break;r++}if(r<a&&c.charCodeAt(r)!==10)return!1;const v=$o(c.slice(1,u));return v?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:y,href:m}),e.line=o),!0):!1}const d4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],f4="[a-zA-Z_:][a-zA-Z0-9:._-]*",p4="[^\"'=<>`\\x00-\\x20]+",m4="'[^']*'",h4='"[^"]*"',b4="(?:"+p4+"|"+m4+"|"+h4+")",g4="(?:\\s+"+f4+"(?:\\s*=\\s*"+b4+")?)",Hm="<[A-Za-z][A-Za-z0-9\\-]*"+g4+"*\\s*\\/?>",qm="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",v4="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",x4="<[?][\\s\\S]*?[?]>",y4="<![A-Za-z][^>]*>",k4="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",w4=new RegExp("^(?:"+Hm+"|"+qm+"|"+v4+"|"+x4+"|"+y4+"|"+k4+")"),_4=new RegExp("^(?:"+Hm+"|"+qm+")"),ai=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+d4.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(_4.source+"\\s*$"),/^$/,!1]];function S4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let o=e.src.slice(r,a),l=0;for(;l<ai.length&&!ai[l][0].test(o);l++);if(l===ai.length)return!1;if(i)return ai[l][2];let c=t+1;const u=ai[l][1].test("");if(!ai[l][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(u||!e.isEmpty(c)));c++)if(r=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(r,a),ai[l][1].test(o)){o.length!==0&&c++;break}}e.line=c;const f=e.push("html_block","",0);return f.map=[t,c],f.content=e.getLines(t,c,e.blkIndent,!0),!0}function C4(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(r);if(o!==35||r>=a)return!1;let l=1;for(o=e.src.charCodeAt(++r);o===35&&r<a&&l<=6;)l++,o=e.src.charCodeAt(++r);if(l>6||r<a&&!Be(o))return!1;if(i)return!0;a=e.skipSpacesBack(a,r);const c=e.skipCharsBack(a,35,r);c>r&&Be(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;const u=e.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[t,e.line];const f=e.push("inline","",0);f.content=Wo(e.src.slice(r,a)),f.map=[t,e.line],f.children=[];const m=e.push("heading_close","h"+String(l),-1);return m.markup="########".slice(0,l),!0}function E4(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let a=0,o,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let h=e.bMarks[l]+e.tShift[l];const g=e.eMarks[l];if(h<g&&(o=e.src.charCodeAt(h),(o===45||o===61)&&(h=e.skipChars(h,o),h=e.skipSpaces(h),h>=g))){a=o===61?1:2;break}}if(e.sCount[l]<0)continue;let p=!1;for(let h=0,g=i.length;h<g;h++)if(i[h](e,l,n,!0)){p=!0;break}if(p)break}if(!a)return e.parentType=r,!1;const c=Wo(e.getLines(t,l,e.blkIndent,!1));e.line=l+1;const u=e.push("heading_open","h"+String(a),1);u.markup=String.fromCharCode(o),u.map=[t,e.line];const f=e.push("inline","",0);f.content=c,f.map=[t,e.line-1],f.children=[];const m=e.push("heading_close","h"+String(a),-1);return m.markup=String.fromCharCode(o),e.parentType=r,!0}function A4(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let a=t+1;for(e.parentType="paragraph";a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let u=!1;for(let f=0,m=i.length;f<m;f++)if(i[f](e,a,n,!0)){u=!0;break}if(u)break}const o=Wo(e.getLines(t,a,e.blkIndent,!1));e.line=a;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Aa=[["table",i4,["paragraph","reference"]],["code",r4],["fence",a4,["paragraph","reference","blockquote","list"]],["blockquote",o4,["paragraph","reference","blockquote","list"]],["hr",s4,["paragraph","reference","blockquote","list"]],["list",c4,["paragraph","reference","blockquote"]],["reference",u4],["html_block",S4,["paragraph","reference","blockquote"]],["heading",C4,["paragraph","reference","blockquote"]],["lheading",E4],["paragraph",A4]];function Go(){this.ruler=new At;for(let e=0;e<Aa.length;e++)this.ruler.push(Aa[e][0],Aa[e][1],{alt:(Aa[e][2]||[]).slice()})}Go.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,a=e.md.options.maxNesting;let o=t,l=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}const c=e.line;let u=!1;for(let f=0;f<r;f++)if(u=i[f](e,o,n,!1),u){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),o=e.line,o<n&&e.isEmpty(o)&&(l=!0,o++,e.line=o)}};Go.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)};Go.prototype.State=ln;function Ur(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ur.prototype.pushPending=function(){const e=new Xt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ur.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new Xt(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i};Ur.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const y=this.src.charCodeAt(e-2);r=(y&64512)===55296?65536+(y-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===i;)a++;const o=a-e;let l=a<n?this.src.charCodeAt(a):32;if((l&64512)===55296){const y=this.src.charCodeAt(a+1);l=(y&64512)===56320?65536+(l-55296<<10)+(y-56320):65533}else(l&64512)===56320&&(l=65533);const c=Ir(r)||zr(r),u=Ir(l)||zr(l),f=Dr(r),m=Dr(l),p=!m&&(!u||f||c),h=!f&&(!c||m||u);return{can_open:p&&(t||!h||c),can_close:h&&(t||!p||u),length:o}};Ur.prototype.Token=Xt;function T4(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function N4(e,t){let n=e.pos;for(;n<e.posMax&&!T4(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const O4=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function M4(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(O4);if(!r)return!1;const a=r[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let l=o.url;if(l.length<=a.length)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);const f=e.push("link_open","a",1);f.attrs=[["href",u]],f.markup="linkify",f.info="auto";const m=e.push("text","",0);m.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-a.length,!0}function D4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let a=i-1;for(;a>=1&&e.pending.charCodeAt(a-1)===32;)a--;e.pending=e.pending.slice(0,a),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&Be(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const zc=[];for(let e=0;e<256;e++)zc.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){zc[e.charCodeAt(0)]=1});function z4(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Be(r));)n++;return e.pos=n,!0}if(r===32){if(!t){const l=e.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return e.pos=n,!0}let a=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(a+=e.src[n+1],n++)}const o="\\"+a;if(!t){const l=e.push("text_special","",0);r<256&&zc[r]!==0?l.content=a:l.content=o,l.markup=o,l.info="escape"}return e.pos=n+1,!0}function I4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const a=e.posMax;for(;n<a&&e.src.charCodeAt(n)===96;)n++;const o=e.src.slice(r,n),l=o.length;if(e.backticksScanned&&(e.backticks[l]||0)<=r)return t||(e.pending+=o),e.pos+=l,!0;let c=n,u;for(;(u=e.src.indexOf("`",c))!==-1;){for(c=u+1;c<a&&e.src.charCodeAt(c)===96;)c++;const f=c-u;if(f===l){if(!t){const m=e.push("code_inline","code",0);m.markup=o,m.content=e.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[f]=u}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0}function R4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let a=r.length;const o=String.fromCharCode(i);if(a<2)return!1;let l;a%2&&(l=e.push("text","",0),l.content=o,a--);for(let c=0;c<a;c+=2)l=e.push("text","",0),l.content=o+o,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function zd(e,t){let n;const i=[],r=t.length;for(let a=0;a<r;a++){const o=t[a];if(o.marker!==126||o.end===-1)continue;const l=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&i.push(l.token-1)}for(;i.length;){const a=i.pop();let o=a+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,a!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[a],e.tokens[a]=n)}}function L4(e){const t=e.tokens_meta,n=e.tokens_meta.length;zd(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&zd(e,t[i].delimiters)}const jm={tokenize:R4,postProcess:L4};function B4(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let a=0;a<r.length;a++){const o=e.push("text","",0);o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Id(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const a=t[r.end],o=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===a.token+1,l=String.fromCharCode(r.marker),c=e.tokens[r.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?l+l:l,c.content="";const u=e.tokens[a.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function P4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Id(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Id(e,t[i].delimiters)}const $m={tokenize:B4,postProcess:P4};function F4(e,t){let n,i,r,a,o="",l="",c=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const f=e.pos,m=e.posMax,p=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let g=h+1;if(g<m&&e.src.charCodeAt(g)===40){for(u=!1,g++;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);if(g>=m)return!1;if(c=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(o=e.md.normalizeLink(r.str),e.md.validateLink(o)?g=r.pos:o="",c=g;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<m&&c!==g&&r.ok)for(l=r.str,g=r.pos;g<m&&(n=e.src.charCodeAt(g),!(!Be(n)&&n!==10));g++);}(g>=m||e.src.charCodeAt(g)!==41)&&(u=!0),g++}if(u){if(typeof e.env.references>"u")return!1;if(g<m&&e.src.charCodeAt(g)===91?(c=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?i=e.src.slice(c,g++):g=h+1):g=h+1,i||(i=e.src.slice(p,h)),a=e.env.references[$o(i)],!a)return e.pos=f,!1;o=a.href,l=a.title}if(!t){e.pos=p,e.posMax=h;const b=e.push("link_open","a",1),y=[["href",o]];b.attrs=y,l&&y.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=m,!0}function V4(e,t){let n,i,r,a,o,l,c,u,f="";const m=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(a=g+1,a<p&&e.src.charCodeAt(a)===40){for(a++;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);if(a>=p)return!1;for(u=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok&&(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f=""),u=a;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<p&&u!==a&&l.ok)for(c=l.str,a=l.pos;a<p&&(n=e.src.charCodeAt(a),!(!Be(n)&&n!==10));a++);else c="";if(a>=p||e.src.charCodeAt(a)!==41)return e.pos=m,!1;a++}else{if(typeof e.env.references>"u")return!1;if(a<p&&e.src.charCodeAt(a)===91?(u=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?r=e.src.slice(u,a++):a=g+1):a=g+1,r||(r=e.src.slice(h,g)),o=e.env.references[$o(r)],!o)return e.pos=m,!1;f=o.href,c=o.title}if(!t){i=e.src.slice(h,g);const b=[];e.md.inline.parse(i,e.md,e.env,b);const y=e.push("image","img",0),v=[["src",f],["alt",""]];y.attrs=v,y.children=b,y.content=i,c&&v.push(["title",c])}return e.pos=a,e.posMax=p,!0}const U4=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,H4=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function q4(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const a=e.src.slice(i+1,n);if(H4.test(a)){const o=e.md.normalizeLink(a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}if(U4.test(a)){const o=e.md.normalizeLink("mailto:"+a);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(a);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=a.length+2,!0}return!1}function j4(e){return/^<a[>\s]/i.test(e)}function $4(e){return/^<\/a\s*>/i.test(e)}function W4(e){const t=e|32;return t>=97&&t<=122}function G4(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!W4(r))return!1;const a=e.src.slice(i).match(w4);if(!a)return!1;if(!t){const o=e.push("html_inline","",0);o.content=a[0],j4(o.content)&&e.linkLevel++,$4(o.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}const K4=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,X4=/^&([a-z][a-z0-9]{1,31});/i;function J4(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const a=e.src.slice(n).match(K4);if(a){if(!t){const o=a[1][0].toLowerCase()==="x"?parseInt(a[1].slice(1),16):parseInt(a[1],10),l=e.push("text_special","",0);l.content=Mc(o)?Mr(o):Mr(65533),l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}else{const a=e.src.slice(n).match(X4);if(a){const o=hS(a[0]);if(o!==a[0]){if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=a[0],l.info="entity"}return e.pos+=a[0].length,!0}}}return!1}function Rd(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const a=[];for(let o=0;o<n;o++){const l=e[o];if(a.push(0),(e[i].marker!==l.marker||r!==l.token-1)&&(i=o),r=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[l.marker][(l.open?3:0)+l.length%3];let u=i-a[i]-1,f=u;for(;u>c;u-=a[u]+1){const m=e[u];if(m.marker===l.marker&&m.open&&m.end<0){let p=!1;if((m.close||l.open)&&(m.length+l.length)%3===0&&(m.length%3!==0||l.length%3!==0)&&(p=!0),!p){const h=u>0&&!e[u-1].open?a[u-1]+1:0;a[o]=o-u+h,a[u]=h,l.open=!1,m.end=o,m.close=!1,f=-1,r=-2;break}}}f!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function Z4(e){const t=e.tokens_meta,n=e.tokens_meta.length;Rd(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Rd(t[i].delimiters)}function Q4(e){let t,n,i=0;const r=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<a&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const zs=[["text",N4],["linkify",M4],["newline",D4],["escape",z4],["backticks",I4],["strikethrough",jm.tokenize],["emphasis",$m.tokenize],["link",F4],["image",V4],["autolink",q4],["html_inline",G4],["entity",J4]],Is=[["balance_pairs",Z4],["strikethrough",jm.postProcess],["emphasis",$m.postProcess],["fragments_join",Q4]];function Hr(){this.ruler=new At;for(let e=0;e<zs.length;e++)this.ruler.push(zs[e][0],zs[e][1]);this.ruler2=new At;for(let e=0;e<Is.length;e++)this.ruler2.push(Is[e][0],Is[e][1])}Hr.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,a=e.cache;if(typeof a[t]<"u"){e.pos=a[t];return}let o=!1;if(e.level<r){for(let l=0;l<i;l++)if(e.level++,o=n[l](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos};Hr.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const a=e.pos;let o=!1;if(e.level<r){for(let l=0;l<n;l++)if(o=t[l](e,!1),o){if(a>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Hr.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const a=this.ruler2.getRules(""),o=a.length;for(let l=0;l<o;l++)a[l](r)};Hr.prototype.State=Ur;function Y4(e){const t={};e=e||{},t.src_Any=Mm.source,t.src_Cc=Dm.source,t.src_Z=Im.source,t.src_P=Nc.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain="(?:"+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy="(?:"+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${t.src_ZPCc}))((?![$+<=>^\`||])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Nl(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Ko(e){return Object.prototype.toString.call(e)}function eC(e){return Ko(e)==="[object String]"}function tC(e){return Ko(e)==="[object Object]"}function nC(e){return Ko(e)==="[object RegExp]"}function Ld(e){return Ko(e)==="[object Function]"}function iC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Wm={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function rC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Wm.hasOwnProperty(n)},!1)}const aC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},oC="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",sC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function lC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function Bd(){return function(e,t){t.normalize(e)}}function Mo(e){const t=e.re=Y4(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(oC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(i(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(i(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(i(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function a(l,c){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${c}`)}Object.keys(e.__schemas__).forEach(function(l){const c=e.__schemas__[l];if(c===null)return;const u={validate:null,link:null};if(e.__compiled__[l]=u,tC(c)){nC(c.validate)?u.validate=lC(c.validate):Ld(c.validate)?u.validate=c.validate:a(l,c),Ld(c.normalize)?u.normalize=c.normalize:c.normalize?a(l,c):u.normalize=Bd();return}if(eC(c)){r.push(l);return}a(l,c)}),r.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Bd()};const o=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(iC).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${o})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${t.src_ZPCc}))(${o})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function Gm(e,t,n,i){const r=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=r,this.text=r,this.url=r}function Lt(e,t){if(!(this instanceof Lt))return new Lt(e,t);t||rC(e)&&(t=e,e={}),this.__opts__=Nl({},Wm,t),this.__schemas__=Nl({},aC,e),this.__compiled__={},this.__tlds__=sC,this.__tlds_replaced__=!1,this.re={},Mo(this)}Lt.prototype.add=function(t,n){return this.__schemas__[t]=n,Mo(this),this};Lt.prototype.set=function(t){return this.__opts__=Nl(this.__opts__,t),this};Lt.prototype.test=function(t){if(!t.length)return!1;let n,i;if(this.re.schema_test.test(t)){for(i=this.re.schema_search,i.lastIndex=0;(n=i.exec(t))!==null;)if(this.testSchemaAt(t,n[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Lt.prototype.pretest=function(t){return this.re.pretest.test(t)};Lt.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0};Lt.prototype.match=function(t){const n=[],i=[],r=[],a=[];let o,l,c;function u(p,h){return p?h?p.index!==h.index?p.index<h.index?p:h:p.lastIndex>=h.lastIndex?p:h:p:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(t))!==null;)l=this.testSchemaAt(t,o[2],c.lastIndex),l&&i.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(t))!==null;)a.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const f=[0,0,0];let m=0;for(;;){const p=[i[f[0]],a[f[1]],r[f[2]]],h=u(u(p[0],p[1]),p[2]);if(!h)break;if(h===p[0]?f[0]++:h===p[1]?f[1]++:f[2]++,h.index<m)continue;const g=new Gm(t,h.schema,h.index,h.lastIndex);this.__compiled__[g.schema].normalize(g,this),n.push(g),m=h.lastIndex}return n.length?n:null};Lt.prototype.matchAtStart=function(t){if(!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);if(!i)return null;const r=new Gm(t,n[2],n.index+n[1].length,n.index+n[0].length+i);return this.__compiled__[r.schema].normalize(r,this),r};Lt.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,a){return i!==a[r-1]}).reverse(),Mo(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Mo(this),this)};Lt.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)};Lt.prototype.onCompile=function(){};const Ri=2147483647,nn=36,Ic=1,Rr=26,cC=38,uC=700,Km=72,Xm=128,Jm="-",dC=/^xn--/,fC=/[^\0-\x7F]/,pC=/[\x2E\u3002\uFF0E\uFF61]/g,mC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rs=nn-Ic,rn=Math.floor,Ls=String.fromCharCode;function Pn(e){throw new RangeError(mC[e])}function hC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Zm(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(pC,".");const r=e.split("."),a=hC(r,t).join(".");return i+a}function Qm(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const a=e.charCodeAt(n++);(a&64512)==56320?t.push(((r&1023)<<10)+(a&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const bC=e=>String.fromCodePoint(...e),gC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:nn},Pd=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ym=function(e,t,n){let i=0;for(e=n?rn(e/uC):e>>1,e+=rn(e/t);e>Rs*Rr>>1;i+=nn)e=rn(e/Rs);return rn(i+(Rs+1)*e/(e+cC))},eh=function(e){const t=[],n=e.length;let i=0,r=Xm,a=Km,o=e.lastIndexOf(Jm);o<0&&(o=0);for(let l=0;l<o;++l)e.charCodeAt(l)>=128&&Pn("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const c=i;for(let f=1,m=nn;;m+=nn){l>=n&&Pn("invalid-input");const p=gC(e.charCodeAt(l++));p>=nn&&Pn("invalid-input"),p>rn((Ri-i)/f)&&Pn("overflow"),i+=p*f;const h=m<=a?Ic:m>=a+Rr?Rr:m-a;if(p<h)break;const g=nn-h;f>rn(Ri/g)&&Pn("overflow"),f*=g}const u=t.length+1;a=Ym(i-c,u,c==0),rn(i/u)>Ri-r&&Pn("overflow"),r+=rn(i/u),i%=u,t.splice(i++,0,r)}return String.fromCodePoint(...t)},th=function(e){const t=[];e=Qm(e);const n=e.length;let i=Xm,r=0,a=Km;for(const c of e)c<128&&t.push(Ls(c));const o=t.length;let l=o;for(o&&t.push(Jm);l<n;){let c=Ri;for(const f of e)f>=i&&f<c&&(c=f);const u=l+1;c-i>rn((Ri-r)/u)&&Pn("overflow"),r+=(c-i)*u,i=c;for(const f of e)if(f<i&&++r>Ri&&Pn("overflow"),f===i){let m=r;for(let p=nn;;p+=nn){const h=p<=a?Ic:p>=a+Rr?Rr:p-a;if(m<h)break;const g=m-h,b=nn-h;t.push(Ls(Pd(h+g%b,0))),m=rn(g/b)}t.push(Ls(Pd(m,0))),a=Ym(r,u,l===o),r=0,++l}++r,++i}return t.join("")},vC=function(e){return Zm(e,function(t){return dC.test(t)?eh(t.slice(4).toLowerCase()):t})},xC=function(e){return Zm(e,function(t){return fC.test(t)?"xn--"+th(t):t})},nh={version:"2.3.1",ucs2:{decode:Qm,encode:bC},decode:eh,encode:th,toASCII:xC,toUnicode:vC},yC={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},kC={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},wC={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},_C={default:yC,zero:kC,commonmark:wC},SC=/^(vbscript|javascript|file|data):/,CC=/^data:image\/(gif|png|jpeg|webp);/;function EC(e){const t=e.trim().toLowerCase();return SC.test(t)?CC.test(t):!0}const ih=["http:","https:","mailto:"];function AC(e){const t=Tc(e,!0);if(t.hostname&&(!t.protocol||ih.indexOf(t.protocol)>=0))try{t.hostname=nh.toASCII(t.hostname)}catch{}return Vr(Ac(t))}function TC(e){const t=Tc(e,!0);if(t.hostname&&(!t.protocol||ih.indexOf(t.protocol)>=0))try{t.hostname=nh.toUnicode(t.hostname)}catch{}return Fi(Ac(t),Fi.defaultChars+"%")}function Tt(e,t){if(!(this instanceof Tt))return new Tt(e,t);t||Oc(e)||(t=e||{},e="default"),this.inline=new Hr,this.block=new Go,this.core=new Dc,this.renderer=new ji,this.linkify=new Lt,this.validateLink=EC,this.normalizeLink=AC,this.normalizeLinkText=TC,this.utils=MS,this.helpers=jo({},RS),this.options={},this.configure(e),t&&this.set(t)}Tt.prototype.set=function(e){return jo(this.options,e),this};Tt.prototype.configure=function(e){const t=this;if(Oc(e)){const n=e;if(e=_C[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Tt.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};Tt.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};Tt.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Tt.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Tt.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Tt.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Tt.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const NC=new Qf({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function OC(e,t){if(e.isText&&t.isText&&Re.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class MC{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:Re.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),i=n.content,r=i[i.length-1],a=this.schema.text(t,n.marks),o;r&&(o=OC(r,a))?i[i.length-1]=o:i.push(a)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let i=t[n],r=this.tokenHandlers[i.type];if(!r)throw new Error("Token type `"+i.type+"` not supported by Markdown parser");r(this,i,t,n)}}addNode(t,n,i){let r=this.top(),a=t.createAndFill(n,i,r?r.marks:[]);return a?(this.push(a),a):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:Re.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function nr(e,t,n,i){return e.getAttrs?e.getAttrs(t,n,i):e.attrs instanceof Function?e.attrs(t):e.attrs}function Bs(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function Fd(e){return e[e.length-1]==`
676
+ `?e.slice(0,e.length-1):e}function Ps(){}function DC(e,t){let n=Object.create(null);for(let i in t){let r=t[i];if(r.block){let a=e.nodeType(r.block);Bs(r,i)?n[i]=(o,l,c,u)=>{o.openNode(a,nr(r,l,c,u)),o.addText(Fd(l.content)),o.closeNode()}:(n[i+"_open"]=(o,l,c,u)=>o.openNode(a,nr(r,l,c,u)),n[i+"_close"]=o=>o.closeNode())}else if(r.node){let a=e.nodeType(r.node);n[i]=(o,l,c,u)=>o.addNode(a,nr(r,l,c,u))}else if(r.mark){let a=e.marks[r.mark];Bs(r,i)?n[i]=(o,l,c,u)=>{o.openMark(a.create(nr(r,l,c,u))),o.addText(Fd(l.content)),o.closeMark(a)}:(n[i+"_open"]=(o,l,c,u)=>o.openMark(a.create(nr(r,l,c,u))),n[i+"_close"]=o=>o.closeMark(a))}else if(r.ignore)Bs(r,i)?n[i]=Ps:(n[i+"_open"]=Ps,n[i+"_close"]=Ps);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(r))}return n.text=(i,r)=>i.addText(r.content),n.inline=(i,r)=>i.parseTokens(r.children),n.softbreak=n.softbreak||(i=>i.addText(" ")),n}let zC=class{constructor(t,n,i){this.schema=t,this.tokenizer=n,this.tokens=i,this.tokenHandlers=DC(t,i)}parse(t,n={}){let i=new MC(this.schema,this.tokenHandlers),r;i.parseTokens(this.tokenizer.parse(t,n));do r=i.closeNode();while(i.stack.length);return r||this.schema.topNodeType.createAndFill()}};function Vd(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new zC(NC,Tt("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:Vd(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:Vd(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const IC={open:"",close:"",mixable:!0};let RC=class{constructor(t,n,i={}){this.nodes=t,this.marks=n,this.options=i}serialize(t,n={}){n=Object.assign({},this.options,n);let i=new rh(this.nodes,this.marks,n);return i.renderContent(t),i.out}};const cn=new RC({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),i=n?n.sort().slice(-1)[0]+"`":"```";e.write(i+(t.attrs.params||"")+`
677
677
  `),e.text(t.textContent,!1),e.write(`
678
678
  `),e.write(i),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){var n;let i=(n=t.attrs.order)!==null&&n!==void 0?n:1,r=String(i+t.childCount-1).length,a=e.repeat(" ",r+2);e.renderList(t,a,o=>{let l=String(i+o);return e.repeat(" ",r-l.length)+l+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("!["+e.esc(t.attrs.alt||"")+"]("+t.attrs.src.replace(/[\(\)]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(`\\
679
- `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,i){return e.inAutolink=RC(t,n,i),e.inAutolink?"<":"["},close(e,t,n,i){let{inAutolink:r}=e;return e.inAutolink=void 0,r?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,i){return Ud(n.child(i),-1)},close(e,t,n,i){return Ud(n.child(i-1),1)},escape:!1}});function Ud(e,t){let n=/`+/g,i,r=0;if(e.isText)for(;i=n.exec(e.text);)r=Math.max(r,i[0].length);let a=r>0&&t>0?" `":"`";for(let o=0;o<r;o++)a+="`";return r>0&&t<0&&(a+=" "),a}function RC(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let i=t.child(n);return!i.isText||i.text!=e.attrs.href||i.marks[i.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let rh=class{constructor(t,n,i){this.nodes=t,this.marks=n,this.options=i,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
679
+ `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,i){return e.inAutolink=LC(t,n,i),e.inAutolink?"<":"["},close(e,t,n,i){let{inAutolink:r}=e;return e.inAutolink=void 0,r?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,i){return Ud(n.child(i),-1)},close(e,t,n,i){return Ud(n.child(i-1),1)},escape:!1}});function Ud(e,t){let n=/`+/g,i,r=0;if(e.isText)for(;i=n.exec(e.text);)r=Math.max(r,i[0].length);let a=r>0&&t>0?" `":"`";for(let o=0;o<r;o++)a+="`";return r>0&&t<0&&(a+=" "),a}function LC(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let i=t.child(n);return!i.isText||i.text!=e.attrs.href||i.marks[i.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let rh=class{constructor(t,n,i){this.nodes=t,this.marks=n,this.options=i,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
680
680
  `),t>1){let n=this.delim,i=/\s+$/.exec(n);i&&(n=n.slice(0,n.length-i[0].length));for(let r=1;r<t;r++)this.out+=n+`
681
- `}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=zC}return n}wrapBlock(t,n,i,r){let a=this.delim;this.write(n??t),this.delim+=t,r(),this.delim=a,this.closeBlock(i)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
681
+ `}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=IC}return n}wrapBlock(t,n,i,r){let a=this.delim;this.write(n??t),this.delim+=t,r(),this.delim=a,this.closeBlock(i)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
682
682
  `)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let i=t.split(`
683
683
  `);for(let r=0;r<i.length;r++)this.write(),!n&&i[r][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(i[r],this.atBlockStart):i[r],r!=i.length-1&&(this.out+=`
684
- `)}render(t,n,i){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,i);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,i,r)=>this.render(n,t,r))}renderInline(t,n=!0){this.atBlockStart=n;let i=[],r="",a=(o,l,c)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(b=>{if(c+1==t.childCount)return!1;let y=t.child(c+1);return b.isInSet(y.marks)&&(!y.isText||/\S/.test(y.text))}));let f=r;if(r="",o&&o.isText&&u.some(b=>{let y=this.getMark(b.type.name);return y&&y.expelEnclosingWhitespace&&!b.isInSet(i)})){let[b,y,v]=/^(\s*)(.*)$/m.exec(o.text);y&&(f+=y,o=v?o.withText(v):null,o||(u=i))}if(o&&o.isText&&u.some(b=>{let y=this.getMark(b.type.name);return y&&y.expelEnclosingWhitespace&&!this.isMarkAhead(t,c+1,b)})){let[b,y,v]=/^(.*?)(\s*)$/m.exec(o.text);v&&(r=v,o=y?o.withText(y):null,o||(u=i))}let m=u.length?u[u.length-1]:null,p=m&&this.getMark(m.type.name).escape===!1,h=u.length-(p?1:0);e:for(let b=0;b<h;b++){let y=u[b];if(!this.getMark(y.type.name).mixable)break;for(let v=0;v<i.length;v++){let x=i[v];if(!this.getMark(x.type.name).mixable)break;if(y.eq(x)){b>v?u=u.slice(0,v).concat(y).concat(u.slice(v,b)).concat(u.slice(b+1,h)):v>b&&(u=u.slice(0,b).concat(u.slice(b+1,v)).concat(y).concat(u.slice(v,h)));continue e}}}let g=0;for(;g<Math.min(i.length,h)&&u[g].eq(i[g]);)++g;for(;g<i.length;)this.text(this.markString(i.pop(),!1,t,c),!1);if(f&&this.text(f),o){for(;i.length<h;){let b=u[i.length];i.push(b),this.text(this.markString(b,!0,t,c),!1),this.atBlockStart=!1}p&&o.isText?this.text(this.markString(m,!0,t,c)+o.text+this.markString(m,!1,t,c+1),!1):this.render(o,t,c),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(a),a(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,i){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,a=this.inTightList;this.inTightList=r,t.forEach((o,l,c)=>{c&&r&&this.flushClose(1),this.wrapBlock(n,i(c),t,()=>this.render(o,t,c))}),this.inTightList=a}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(i,r)=>i=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?i:"\\"+i),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let i="";for(let r=0;r<n;r++)i+=t;return i}markString(t,n,i,r){let a=this.getMark(t.type.name),o=n?a.open:a.close;return typeof o=="string"?o:o(this,t,i,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,i){for(;;n++){if(n>=t.childCount)return!1;let r=t.child(n);if(r.type.name!=this.options.hardBreakNodeName)return i.isInSet(r.marks);n++}}};var Ol=!0,ah=!1,oh=!1,LC=function(e,t){t&&(Ol=!t.enabled,ah=!!t.label,oh=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)PC(i,r)&&(FC(i[r],n.Token),Hd(i[r-2],"class","task-list-item"+(Ol?"":" enabled")),Hd(i[BC(i,r-2)],"class","contains-task-list"))})};function Hd(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function BC(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function PC(e,t){return jC(e[t])&&$C(e[t-1])&&WC(e[t-2])&&GC(e[t])}function FC(e,t){if(e.children.unshift(VC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),ah)if(oh){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(qC(e.content,n,t))}else e.children.unshift(UC(t)),e.children.push(HC(t))}function VC(e,t){var n=new t("html_inline","",0),i=Ol?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function UC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function HC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function qC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function jC(e){return e.type==="inline"}function $C(e){return e.type==="paragraph_open"}function WC(e){return e.type==="list_item_open"}function GC(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const KC=Om(LC);var XC=Object.defineProperty,JC=(e,t,n)=>t in e?XC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Do=(e,t,n)=>(JC(e,typeof t!="symbol"?t+"":t,n),n);const ZC=Ke.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:i,commands:r}=n;function a(o){if(!i.isActive(o))return!1;const l=i.getAttributes(o);return r.updateAttributes(o,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(o=>a(o))}}}}}),qd=Tt();function sh(e,t){return qd.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new qd.inline.State(e,null,null,[]).scanDelims(t,!0)}function lh(e,t,n,i){let r=e.substring(0,n)+e.substring(n+t.length);return r=r.substring(0,n+i)+t+r.substring(n+i),r}function QC(e,t,n,i){let r=n,a=e;for(;r<i&&!sh(a,r).can_open;)a=lh(a,t,r,1),r++;return{text:a,from:r,to:i}}function YC(e,t,n,i){let r=i,a=e;for(;r>n&&!sh(a,r).can_close;)a=lh(a,t,r,-1),r--;return{text:a,from:n,to:r}}function eE(e,t,n,i){let r={text:e,from:n,to:i};return r=QC(r.text,t,r.from,r.to),r=YC(r.text,t,r.from,r.to),r.to-r.from<t.length+1&&(r.text=r.text.substring(0,r.from)+r.text.substring(r.to+t.length)),r.text}class tE extends rh{constructor(t,n,i){super(t,n,i??{}),Do(this,"inTable",!1),this.inlines=[]}render(t,n,i){super.render(t,n,i);const r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!==null&&r!==void 0&&r.end){const{delimiter:a,start:o,end:l}=this.normalizeInline(r);this.out=eE(this.out,a,o,l),this.inlines.pop()}}markString(t,n,i,r){const a=this.marks[t.type.name];if(a.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:a.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,n,i,r)}normalizeInline(t){let{start:n,end:i}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const ch=Et.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,i;return this.editor.storage.markdown.options.html?(n=(i=jd(t))===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,i;return this.editor.storage.markdown.options.html&&(n=(i=jd(t))===null||i===void 0?void 0:i[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function jd(e){const t=e.type.schema,n=t.text(" ",[e]),r=im(J.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function Rc(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function nE(e){return e==null?void 0:e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function iE(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function rE(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Xo=Ae.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(aE(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function aE(e,t){const n=e.type.schema,i=im(J.from(e),n);return e.isBlock&&(t instanceof J||t.type.name===n.topNodeType.name)?oE(i):i}function oE(e){const n=Rc(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
684
+ `)}render(t,n,i){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,i);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,i,r)=>this.render(n,t,r))}renderInline(t,n=!0){this.atBlockStart=n;let i=[],r="",a=(o,l,c)=>{let u=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(u=u.filter(b=>{if(c+1==t.childCount)return!1;let y=t.child(c+1);return b.isInSet(y.marks)&&(!y.isText||/\S/.test(y.text))}));let f=r;if(r="",o&&o.isText&&u.some(b=>{let y=this.getMark(b.type.name);return y&&y.expelEnclosingWhitespace&&!b.isInSet(i)})){let[b,y,v]=/^(\s*)(.*)$/m.exec(o.text);y&&(f+=y,o=v?o.withText(v):null,o||(u=i))}if(o&&o.isText&&u.some(b=>{let y=this.getMark(b.type.name);return y&&y.expelEnclosingWhitespace&&!this.isMarkAhead(t,c+1,b)})){let[b,y,v]=/^(.*?)(\s*)$/m.exec(o.text);v&&(r=v,o=y?o.withText(y):null,o||(u=i))}let m=u.length?u[u.length-1]:null,p=m&&this.getMark(m.type.name).escape===!1,h=u.length-(p?1:0);e:for(let b=0;b<h;b++){let y=u[b];if(!this.getMark(y.type.name).mixable)break;for(let v=0;v<i.length;v++){let x=i[v];if(!this.getMark(x.type.name).mixable)break;if(y.eq(x)){b>v?u=u.slice(0,v).concat(y).concat(u.slice(v,b)).concat(u.slice(b+1,h)):v>b&&(u=u.slice(0,b).concat(u.slice(b+1,v)).concat(y).concat(u.slice(v,h)));continue e}}}let g=0;for(;g<Math.min(i.length,h)&&u[g].eq(i[g]);)++g;for(;g<i.length;)this.text(this.markString(i.pop(),!1,t,c),!1);if(f&&this.text(f),o){for(;i.length<h;){let b=u[i.length];i.push(b),this.text(this.markString(b,!0,t,c),!1),this.atBlockStart=!1}p&&o.isText?this.text(this.markString(m,!0,t,c)+o.text+this.markString(m,!1,t,c+1),!1):this.render(o,t,c),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(a),a(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,i){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,a=this.inTightList;this.inTightList=r,t.forEach((o,l,c)=>{c&&r&&this.flushClose(1),this.wrapBlock(n,i(c),t,()=>this.render(o,t,c))}),this.inTightList=a}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(i,r)=>i=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?i:"\\"+i),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let i="";for(let r=0;r<n;r++)i+=t;return i}markString(t,n,i,r){let a=this.getMark(t.type.name),o=n?a.open:a.close;return typeof o=="string"?o:o(this,t,i,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,i){for(;;n++){if(n>=t.childCount)return!1;let r=t.child(n);if(r.type.name!=this.options.hardBreakNodeName)return i.isInSet(r.marks);n++}}};var Ol=!0,ah=!1,oh=!1,BC=function(e,t){t&&(Ol=!t.enabled,ah=!!t.label,oh=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var i=n.tokens,r=2;r<i.length;r++)FC(i,r)&&(VC(i[r],n.Token),Hd(i[r-2],"class","task-list-item"+(Ol?"":" enabled")),Hd(i[PC(i,r-2)],"class","contains-task-list"))})};function Hd(e,t,n){var i=e.attrIndex(t),r=[t,n];i<0?e.attrPush(r):e.attrs[i]=r}function PC(e,t){for(var n=e[t].level-1,i=t-1;i>=0;i--)if(e[i].level===n)return i;return-1}function FC(e,t){return $C(e[t])&&WC(e[t-1])&&GC(e[t-2])&&KC(e[t])}function VC(e,t){if(e.children.unshift(UC(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),ah)if(oh){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(jC(e.content,n,t))}else e.children.unshift(HC(t)),e.children.push(qC(t))}function UC(e,t){var n=new t("html_inline","",0),i=Ol?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+i+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+i+'type="checkbox">'),n}function HC(e){var t=new e("html_inline","",0);return t.content="<label>",t}function qC(e){var t=new e("html_inline","",0);return t.content="</label>",t}function jC(e,t,n){var i=new n("html_inline","",0);return i.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",i.attrs=[{for:t}],i}function $C(e){return e.type==="inline"}function WC(e){return e.type==="paragraph_open"}function GC(e){return e.type==="list_item_open"}function KC(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}const XC=Om(BC);var JC=Object.defineProperty,ZC=(e,t,n)=>t in e?JC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Do=(e,t,n)=>(ZC(e,typeof t!="symbol"?t+"":t,n),n);const QC=Ke.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:i,commands:r}=n;function a(o){if(!i.isActive(o))return!1;const l=i.getAttributes(o);return r.updateAttributes(o,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(o=>a(o))}}}}}),qd=Tt();function sh(e,t){return qd.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new qd.inline.State(e,null,null,[]).scanDelims(t,!0)}function lh(e,t,n,i){let r=e.substring(0,n)+e.substring(n+t.length);return r=r.substring(0,n+i)+t+r.substring(n+i),r}function YC(e,t,n,i){let r=n,a=e;for(;r<i&&!sh(a,r).can_open;)a=lh(a,t,r,1),r++;return{text:a,from:r,to:i}}function eE(e,t,n,i){let r=i,a=e;for(;r>n&&!sh(a,r).can_close;)a=lh(a,t,r,-1),r--;return{text:a,from:n,to:r}}function tE(e,t,n,i){let r={text:e,from:n,to:i};return r=YC(r.text,t,r.from,r.to),r=eE(r.text,t,r.from,r.to),r.to-r.from<t.length+1&&(r.text=r.text.substring(0,r.from)+r.text.substring(r.to+t.length)),r.text}class nE extends rh{constructor(t,n,i){super(t,n,i??{}),Do(this,"inTable",!1),this.inlines=[]}render(t,n,i){super.render(t,n,i);const r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!==null&&r!==void 0&&r.end){const{delimiter:a,start:o,end:l}=this.normalizeInline(r);this.out=tE(this.out,a,o,l),this.inlines.pop()}}markString(t,n,i,r){const a=this.marks[t.type.name];if(a.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:a.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,n,i,r)}normalizeInline(t){let{start:n,end:i}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const ch=Et.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,i;return this.editor.storage.markdown.options.html?(n=(i=jd(t))===null||i===void 0?void 0:i[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,i;return this.editor.storage.markdown.options.html&&(n=(i=jd(t))===null||i===void 0?void 0:i[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function jd(e){const t=e.type.schema,n=t.text(" ",[e]),r=im(J.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function Rc(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function iE(e){return e==null?void 0:e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rE(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function aE(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const Xo=Ae.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(oE(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function oE(e,t){const n=e.type.schema,i=im(J.from(e),n);return e.isBlock&&(t instanceof J||t.type.name===n.topNodeType.name)?sE(i):i}function sE(e){const n=Rc(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
685
685
  ${n.innerHTML}
686
686
  `:`
687
- `,n.outerHTML}const sE=Ae.create({name:"blockquote"}),lE=sE.extend({addStorage(){return{markdown:{serialize:cn.nodes.blockquote,parse:{}}}}}),cE=Ae.create({name:"bulletList"}),uh=cE.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),uE=Ae.create({name:"codeBlock"}),dE=uE.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
688
- `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),fE=Ae.create({name:"hardBreak"}),dh=fE.extend({addStorage(){return{markdown:{serialize(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(e.inTable?Xo.storage.markdown.serialize.call(this,e,t,n):`\\
689
- `);return}},parse:{}}}}}),pE=Ae.create({name:"heading"}),mE=pE.extend({addStorage(){return{markdown:{serialize:cn.nodes.heading,parse:{}}}}}),hE=Ae.create({name:"horizontalRule"}),bE=hE.extend({addStorage(){return{markdown:{serialize:cn.nodes.horizontal_rule,parse:{}}}}}),gE=Ae.create({name:"image"}),vE=gE.extend({addStorage(){return{markdown:{serialize:cn.nodes.image,parse:{}}}}}),xE=Ae.create({name:"listItem"}),yE=xE.extend({addStorage(){return{markdown:{serialize:cn.nodes.list_item,parse:{}}}}}),kE=Ae.create({name:"orderedList"});function wE(e,t,n){let i=0;for(;n-i>0&&t.child(n-i-1).type.name===e.type.name;i++);return i}const _E=kE.extend({addStorage(){return{markdown:{serialize(e,t,n,i){const r=t.attrs.start||1,a=String(r+t.childCount-1).length,o=e.repeat(" ",a+2),c=wE(t,n,i)%2?") ":". ";e.renderList(t,o,u=>{const f=String(r+u);return e.repeat(" ",a-f.length)+f+c})},parse:{}}}}}),SE=Ae.create({name:"paragraph"}),CE=SE.extend({addStorage(){return{markdown:{serialize:cn.nodes.paragraph,parse:{}}}}});function Fs(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const EE=Ae.create({name:"table"}),AE=EE.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!TE(t)){Xo.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((i,r,a)=>{if(e.write("| "),i.forEach((o,l,c)=>{c&&e.write(" | ");const u=o.firstChild;u.textContent.trim()&&e.renderInline(u)}),e.write(" |"),e.ensureNewLine(),!a){const o=Array.from({length:i.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function $d(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function TE(e){const t=Fs(e),n=t[0],i=t.slice(1);return!(Fs(n).some(r=>r.type.name!=="tableHeader"||$d(r)||r.childCount>1)||i.some(r=>Fs(r).some(a=>a.type.name==="tableHeader"||$d(a)||a.childCount>1)))}const NE=Ae.create({name:"taskItem"}),OE=NE.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),ME=Ae.create({name:"taskList"}),DE=ME.extend({addStorage(){return{markdown:{serialize:uh.storage.markdown.serialize,parse:{setup(e){e.use(KC)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),zE=Ae.create({name:"text"}),IE=zE.extend({addStorage(){return{markdown:{serialize(e,t){e.text(nE(t.text))},parse:{}}}}}),RE=Et.create({name:"bold"}),LE=RE.extend({addStorage(){return{markdown:{serialize:cn.marks.strong,parse:{}}}}}),BE=Et.create({name:"code"}),PE=BE.extend({addStorage(){return{markdown:{serialize:cn.marks.code,parse:{}}}}}),FE=Et.create({name:"italic"}),VE=FE.extend({addStorage(){return{markdown:{serialize:cn.marks.em,parse:{}}}}}),UE=Et.create({name:"link"}),HE=UE.extend({addStorage(){return{markdown:{serialize:cn.marks.link,parse:{}}}}}),qE=Et.create({name:"strike"}),jE=qE.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),$E=[lE,uh,dE,dh,mE,bE,Xo,vE,yE,_E,CE,AE,OE,DE,IE,LE,PE,ch,VE,HE,jE];function zo(e){var t,n;const i=(t=e.storage)===null||t===void 0?void 0:t.markdown,r=(n=$E.find(a=>a.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return i||r?{...r,...i}:null}class WE{constructor(t){Do(this,"editor",null),this.editor=t}serialize(t){const n=new tE(this.nodes,this.marks,{hardBreakNodeName:dh.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Xo)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(ch)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=zo(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const i=(n=zo(t))===null||n===void 0?void 0:n.serialize;return i?{...i,open:typeof i.open=="function"?i.open.bind({editor:this.editor,options:t.options}):i.open,close:typeof i.close=="function"?i.close.bind({editor:this.editor,options:t.options}):i.close}:null}}class GE{constructor(t,n){Do(this,"editor",null),Do(this,"md",null);let{html:i,linkify:r,breaks:a}=n;this.editor=t,this.md=this.withPatchedRenderer(Tt({html:i,linkify:r,breaks:a}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=zo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},this.md)});const i=this.md.render(t),r=Rc(i);return this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=zo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},r)}),this.normalizeDOM(r,{inline:n,content:t}),r.innerHTML}return t}normalizeDOM(t,n){let{inline:i,content:r}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(a=>{var o;((o=a.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!a.closest("pre")&&(a.nextSibling.textContent=a.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(t,r),t}normalizeBlocks(t){const i=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var a;return(a=r.spec.parseDOM)===null||a===void 0?void 0:a.map(o=>o.tag)}).flat().filter(Boolean).join(",");i&&[...t.querySelectorAll(i)].forEach(r=>{r.parentElement.matches("p")&&iE(r)})}normalizeInline(t,n){var i;if((i=t.firstElementChild)!==null&&i!==void 0&&i.matches("p")){var r,a,o,l;const c=t.firstElementChild,{nextElementSibling:u}=c,f=(r=(a=n.match(/^\s+/))===null||a===void 0?void 0:a[0])!==null&&r!==void 0?r:"",m=u?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${m}`;return}rE(c),t.innerHTML=`${f}${t.innerHTML}${m}`}}withPatchedRenderer(t){const n=i=>function(){const r=i(...arguments);return r===`
687
+ `,n.outerHTML}const lE=Ae.create({name:"blockquote"}),cE=lE.extend({addStorage(){return{markdown:{serialize:cn.nodes.blockquote,parse:{}}}}}),uE=Ae.create({name:"bulletList"}),uh=uE.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),dE=Ae.create({name:"codeBlock"}),fE=dE.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
688
+ `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),pE=Ae.create({name:"hardBreak"}),dh=pE.extend({addStorage(){return{markdown:{serialize(e,t,n,i){for(let r=i+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(e.inTable?Xo.storage.markdown.serialize.call(this,e,t,n):`\\
689
+ `);return}},parse:{}}}}}),mE=Ae.create({name:"heading"}),hE=mE.extend({addStorage(){return{markdown:{serialize:cn.nodes.heading,parse:{}}}}}),bE=Ae.create({name:"horizontalRule"}),gE=bE.extend({addStorage(){return{markdown:{serialize:cn.nodes.horizontal_rule,parse:{}}}}}),vE=Ae.create({name:"image"}),xE=vE.extend({addStorage(){return{markdown:{serialize:cn.nodes.image,parse:{}}}}}),yE=Ae.create({name:"listItem"}),kE=yE.extend({addStorage(){return{markdown:{serialize:cn.nodes.list_item,parse:{}}}}}),wE=Ae.create({name:"orderedList"});function _E(e,t,n){let i=0;for(;n-i>0&&t.child(n-i-1).type.name===e.type.name;i++);return i}const SE=wE.extend({addStorage(){return{markdown:{serialize(e,t,n,i){const r=t.attrs.start||1,a=String(r+t.childCount-1).length,o=e.repeat(" ",a+2),c=_E(t,n,i)%2?") ":". ";e.renderList(t,o,u=>{const f=String(r+u);return e.repeat(" ",a-f.length)+f+c})},parse:{}}}}}),CE=Ae.create({name:"paragraph"}),EE=CE.extend({addStorage(){return{markdown:{serialize:cn.nodes.paragraph,parse:{}}}}});function Fs(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const AE=Ae.create({name:"table"}),TE=AE.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!NE(t)){Xo.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((i,r,a)=>{if(e.write("| "),i.forEach((o,l,c)=>{c&&e.write(" | ");const u=o.firstChild;u.textContent.trim()&&e.renderInline(u)}),e.write(" |"),e.ensureNewLine(),!a){const o=Array.from({length:i.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function $d(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function NE(e){const t=Fs(e),n=t[0],i=t.slice(1);return!(Fs(n).some(r=>r.type.name!=="tableHeader"||$d(r)||r.childCount>1)||i.some(r=>Fs(r).some(a=>a.type.name==="tableHeader"||$d(a)||a.childCount>1)))}const OE=Ae.create({name:"taskItem"}),ME=OE.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),DE=Ae.create({name:"taskList"}),zE=DE.extend({addStorage(){return{markdown:{serialize:uh.storage.markdown.serialize,parse:{setup(e){e.use(XC)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),IE=Ae.create({name:"text"}),RE=IE.extend({addStorage(){return{markdown:{serialize(e,t){e.text(iE(t.text))},parse:{}}}}}),LE=Et.create({name:"bold"}),BE=LE.extend({addStorage(){return{markdown:{serialize:cn.marks.strong,parse:{}}}}}),PE=Et.create({name:"code"}),FE=PE.extend({addStorage(){return{markdown:{serialize:cn.marks.code,parse:{}}}}}),VE=Et.create({name:"italic"}),UE=VE.extend({addStorage(){return{markdown:{serialize:cn.marks.em,parse:{}}}}}),HE=Et.create({name:"link"}),qE=HE.extend({addStorage(){return{markdown:{serialize:cn.marks.link,parse:{}}}}}),jE=Et.create({name:"strike"}),$E=jE.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),WE=[cE,uh,fE,dh,hE,gE,Xo,xE,kE,SE,EE,TE,ME,zE,RE,BE,FE,ch,UE,qE,$E];function zo(e){var t,n;const i=(t=e.storage)===null||t===void 0?void 0:t.markdown,r=(n=WE.find(a=>a.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return i||r?{...r,...i}:null}class GE{constructor(t){Do(this,"editor",null),this.editor=t}serialize(t){const n=new nE(this.nodes,this.marks,{hardBreakNodeName:dh.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Xo)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(ch)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=zo(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const i=(n=zo(t))===null||n===void 0?void 0:n.serialize;return i?{...i,open:typeof i.open=="function"?i.open.bind({editor:this.editor,options:t.options}):i.open,close:typeof i.close=="function"?i.close.bind({editor:this.editor,options:t.options}):i.close}:null}}class KE{constructor(t,n){Do(this,"editor",null),Do(this,"md",null);let{html:i,linkify:r,breaks:a}=n;this.editor=t,this.md=this.withPatchedRenderer(Tt({html:i,linkify:r,breaks:a}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=zo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},this.md)});const i=this.md.render(t),r=Rc(i);return this.editor.extensionManager.extensions.forEach(a=>{var o;return(o=zo(a))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:a.options},r)}),this.normalizeDOM(r,{inline:n,content:t}),r.innerHTML}return t}normalizeDOM(t,n){let{inline:i,content:r}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(a=>{var o;((o=a.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!a.closest("pre")&&(a.nextSibling.textContent=a.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(t,r),t}normalizeBlocks(t){const i=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var a;return(a=r.spec.parseDOM)===null||a===void 0?void 0:a.map(o=>o.tag)}).flat().filter(Boolean).join(",");i&&[...t.querySelectorAll(i)].forEach(r=>{r.parentElement.matches("p")&&rE(r)})}normalizeInline(t,n){var i;if((i=t.firstElementChild)!==null&&i!==void 0&&i.matches("p")){var r,a,o,l;const c=t.firstElementChild,{nextElementSibling:u}=c,f=(r=(a=n.match(/^\s+/))===null||a===void 0?void 0:a[0])!==null&&r!==void 0?r:"",m=u?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${m}`;return}aE(c),t.innerHTML=`${f}${t.innerHTML}${m}`}}withPatchedRenderer(t){const n=i=>function(){const r=i(...arguments);return r===`
690
690
  `?r:r[r.length-1]===`
691
- `?r.slice(0,-1):r};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const KE=Ke.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new ct({key:new rt("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const i=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ur.fromSchema(this.editor.schema).parseSlice(Rc(i),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),XE=Ke.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=Ww.Commands.config.addCommands();return{setContent:(t,n,i)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n,i)(r),insertContentAt:(t,n,i)=>r=>e.insertContentAt(t,r.editor.storage.markdown.parser.parse(n,{inline:!0}),i)(r)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new GE(this.editor,this.options),serializer:new WE(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[ZC.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),KE.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});Ee.definePlugin({id:"formatting",tiptapExtensions:[Jw],toolbar:[{id:"bold",label:"Bold",action:"toggleBold",iconComponent:"Bold"},{id:"italic",label:"Italic",action:"toggleItalic",iconComponent:"Italic"},{id:"underline",label:"Underline",action:"toggleUnderline",iconComponent:"Underline"},{id:"strike",label:"Strikethrough",action:"toggleStrike",iconComponent:"Strikethrough"}]});function Ni(e){return t=>t.commands.toggleHeading({level:e})}Ee.definePlugin({id:"headings",toolbar:[{id:"heading-1",label:"Heading 1",action:"toggleHeading1",iconComponent:"Heading1"},{id:"heading-2",label:"Heading 2",action:"toggleHeading2",iconComponent:"Heading2"},{id:"heading-3",label:"Heading 3",action:"toggleHeading3",iconComponent:"Heading3"},{id:"heading-4",label:"Heading 4",action:"toggleHeading4",iconComponent:"Heading4"},{id:"heading-5",label:"Heading 5",action:"toggleHeading5",iconComponent:"Heading5"},{id:"heading-6",label:"Heading 6",action:"toggleHeading6",iconComponent:"Heading6"}],slashCommands:[{name:"Heading 1",command:"toggleHeading1"},{name:"Heading 2",command:"toggleHeading2"},{name:"Heading 3",command:"toggleHeading3"}],commands:{toggleHeading1:Ni(1),toggleHeading2:Ni(2),toggleHeading3:Ni(3),toggleHeading4:Ni(4),toggleHeading5:Ni(5),toggleHeading6:Ni(6)}});Ee.definePlugin({id:"lists",tiptapExtensions:[Zw,Yw.configure({nested:!0})],toolbar:[{id:"bullet-list",label:"Bullet List",action:"toggleBulletList",iconComponent:"List"},{id:"ordered-list",label:"Ordered List",action:"toggleOrderedList",iconComponent:"ListOrdered"},{id:"task-list",label:"Task List",action:"toggleTaskList",iconComponent:"CheckSquare"}],slashCommands:[{name:"Bullet List",command:"toggleBulletList"},{name:"Ordered List",command:"toggleOrderedList"},{name:"Task List",command:"toggleTaskList"}]});function Ta(e){return t=>t.commands.setTextAlign(e)}Ee.definePlugin({id:"alignment",tiptapExtensions:[e_.configure({types:["heading","paragraph"]})],toolbar:[{id:"align-left",label:"Align Left",action:"alignLeft",iconComponent:"AlignLeft"},{id:"align-center",label:"Align Center",action:"alignCenter",iconComponent:"AlignCenter"},{id:"align-right",label:"Align Right",action:"alignRight",iconComponent:"AlignRight"},{id:"align-justify",label:"Align Justify",action:"alignJustify",iconComponent:"AlignJustify"}],commands:{alignLeft:Ta("left"),alignCenter:Ta("center"),alignRight:Ta("right"),alignJustify:Ta("justify")}});Ee.definePlugin({id:"link",tiptapExtensions:[E_.configure({openOnClick:!0})],toolbar:[{id:"set-link",label:"Link",action:"setLink",iconComponent:"Link"}],slashCommands:[{name:"Link",command:"setLink"}],commands:{setLink:(e,...t)=>{if(e.isActive("link"))return e.chain().focus().unsetLink().run();const n=t[0],i=(n==null?void 0:n.href)??(typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter link URL:","https://"):null);return i?e.chain().focus().setLink({href:i,target:"_blank"}).run():!1}}});function JE(){return typeof document>"u"?Promise.resolve(null):new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept="image/*";const n=()=>t.remove();t.onchange=()=>{var r;const i=((r=t.files)==null?void 0:r[0])??null;n(),e(i)},t.oncancel=()=>{n(),e(null)},document.body.appendChild(t),t.click()})}Ee.definePlugin({id:"image",tiptapExtensions:[T_],toolbar:[{id:"insert-image",label:"Image",action:"insertImage",iconComponent:"Image"}],slashCommands:[{name:"Image",command:"insertImage"}],commands:{insertImage:(e,...t)=>{const n=t[0];if(n!=null&&n.src)return e.commands.setImage({src:n.src,alt:n.alt,title:n.title});const i=e.storage.editorContext,r=i==null?void 0:i.onImageUpload;if(r)return JE().then(async a=>{if(a)try{const o=await r(a);o!=null&&o.src&&e.commands.setImage({src:o.src,alt:o.alt,title:o.title})}catch(o){console.error("[image] upload failed:",o)}}),!0;if(typeof window<"u"&&typeof window.prompt=="function"){const a=window.prompt("Enter image URL:","https://");return a?e.commands.setImage({src:a}):!1}return!1}}});var ZE=M3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),tablePageSplit:{default:null,parseHTML:()=>null,renderHTML:()=>({})}}},renderHTML({node:e,HTMLAttributes:t}){let n=0;const i=e.firstChild;i&&i.forEach(c=>{n+=c.attrs.colspan||1});const r=[];let a=0,o=!1;if(n>0)for(let c=0;c<n;c++){let u=null;if(i){let f=0;i.forEach(m=>{const p=m.attrs.colspan||1;if(c>=f&&c<f+p){const h=m.attrs.colwidth;if(h&&Array.isArray(h)){const g=c-f,b=h[g];typeof b=="number"&&b>0&&(u=b)}}f+=p})}u&&(a+=u,o=!0),r.push(["col",u?{style:`width: ${u}px !important`,width:String(u)}:{}])}const l=Fe(t);if(l["data-tps-splittable"]="",o&&a>0){const c=l.style||"";l.style=c?`${c}; width: ${a}px !important`:`width: ${a}px !important`,l["data-colwidth"]="explicit"}return["table",l,["colgroup",...r],["tbody",0]]}}),QE=z3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}}),YE=I3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}});Ee.definePlugin({id:"table",tiptapExtensions:[ZE.configure({resizable:!1}),D3,QE,YE],toolbar:[{id:"insert-table",label:"Insert Table",action:"insertTable",args:[{rows:3,cols:3,withHeaderRow:!0}],iconComponent:"Table"}],slashCommands:[{name:"Table",command:"insertTable"}]});Ee.definePlugin({id:"blockquote",toolbar:[{id:"blockquote",label:"Blockquote",action:"toggleBlockquote",iconComponent:"Quote"}],slashCommands:[{name:"Blockquote",command:"toggleBlockquote"}]});Ee.definePlugin({id:"code-block",toolbar:[{id:"code-block",label:"Code Block",action:"toggleCodeBlock",iconComponent:"Code"}],slashCommands:[{name:"Code Block",command:"toggleCodeBlock"}]});function e5(e={}){return Ee.definePlugin({id:"placeholder",tiptapExtensions:[R3.configure({placeholder:e.placeholder??"Start writing…"})]})}e5();var t5=Ae.create({name:"pageBreak",group:"block",selectable:!1,draggable:!1,parseHTML(){return[{tag:'div[data-page-break="true"]'}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-page-break":"true","data-node-type":"pageBreak",class:"docs-editor-page-break"}),["span",{class:"docs-editor-page-break__label"},"Page break"]]},addNodeView(){return()=>{const e=document.createElement("div");e.className="docs-editor-page-break",e.setAttribute("data-page-break","true"),e.setAttribute("data-node-type","pageBreak"),e.setAttribute("contenteditable","false");const t=document.createElement("div");t.className="docs-editor-page-break__inner";const n=document.createElement("div");n.className="docs-editor-page-break__line";const i=document.createElement("span");return i.className="docs-editor-page-break__label-text",i.textContent="Page break",t.appendChild(n),t.appendChild(i),e.appendChild(t),{dom:e,contentDOM:void 0}}}});Ee.definePlugin({id:"pageBreak",tiptapExtensions:[t5],toolbar:[{id:"insert-page-break",label:"Page Break",action:"insertPageBreak",iconComponent:"FileText"}],slashCommands:[{name:"Page Break",command:"insertPageBreak"}],commands:{insertPageBreak:e=>e.chain().focus().insertContent([{type:"pageBreak"},{type:"paragraph"}]).run()}});var n5=Ae.create({name:"footnote",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{content:{default:"",parseHTML:e=>e.getAttribute("data-footnote-content")??"",renderHTML:e=>({"data-footnote-content":e.content})},citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>e.citationId?{"data-citation-id":e.citationId}:{}},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-footnote-source-id"),renderHTML:e=>e.sourceId?{"data-footnote-source-id":e.sourceId}:{}},locator:{default:"",parseHTML:e=>e.getAttribute("data-footnote-locator")??"",renderHTML:e=>e.locator?{"data-footnote-locator":e.locator}:{}}}},parseHTML(){return[{tag:'span[data-node-type="footnote"]'}]},renderHTML({HTMLAttributes:e}){return["span",Fe(e,{"data-node-type":"footnote",class:"docs-footnote-ref"}),"1"]},addNodeView(){return e=>{const t=e.node??e,n=t&&typeof t=="object"&&"attrs"in t?t.attrs:{},i=document.createElement("span");return i.className="docs-footnote-ref",i.setAttribute("data-node-type","footnote"),i.setAttribute("data-footnote-content",String(n.content??"")),n.sourceId&&(i.setAttribute("data-footnote-source-id",String(n.sourceId)),i.setAttribute("data-citation-id",String(n.citationId??"")),n.locator&&i.setAttribute("data-footnote-locator",String(n.locator))),i.textContent="1",{dom:i,update(r){try{const a=(r==null?void 0:r.attrs)??{};i.setAttribute("data-footnote-content",String(a.content??"")),a.sourceId?(i.setAttribute("data-footnote-source-id",String(a.sourceId)),i.setAttribute("data-citation-id",String(a.citationId??"")),a.locator&&i.setAttribute("data-footnote-locator",String(a.locator))):(i.removeAttribute("data-footnote-source-id"),i.removeAttribute("data-citation-id"),i.removeAttribute("data-footnote-locator"))}catch{}return!0}}}}});Ee.definePlugin({id:"footnote",tiptapExtensions:[n5],toolbar:[{id:"insert-footnote",label:"Catatan Kaki",action:"insertFootnote",iconComponent:"FileText"}],slashCommands:[{name:"Catatan Kaki",command:"insertFootnote"}],commands:{insertFootnote:(e,...t)=>{const n=t[0];return e.chain().focus().insertContent({type:"footnote",attrs:{content:(n==null?void 0:n.content)??""}}).run()}}});function fh(e){const t=[];return e.descendants((n,i)=>{if(n.type.name==="heading"){const r=n.attrs.level;(r===1||r===2||r===3)&&t.push({level:r,text:n.textContent.trim(),pos:i})}return!0}),t}function i5(e){return fh(e.state.doc)}function ph(e){let t=[];try{const i=e.view.dom.querySelector("[data-rm-pagination]");i&&(t=Array.from(i.querySelectorAll(".rm-page-break .breaker")).filter(r=>r instanceof HTMLElement))}catch{}if(t.length===0)return()=>null;const n=e.view.dom;return i=>{try{const a=e.view.coordsAtPos(i).top-n.getBoundingClientRect().top+n.scrollTop;let o=1;for(const l of t){if(a<l.offsetTop)return o;o++}return o}catch{return null}}}function r5(e,t,n){const i=e.nodes.tocEntry;return t.length===0?[i.create({level:1,pos:0})]:t.map(r=>{const a=[];r.text&&a.push(e.text(r.text));const o=n(r.pos);return o!==null&&a.push(e.nodes.tocPageNum.create({page:o})),i.create({level:r.level,pos:r.pos},a)})}function a5(e){const t=i5(e);if(t.length===0)return[{type:"tocEntry",attrs:{level:1,pos:0}}];const n=ph(e);return t.map(i=>{const r=[];i.text&&r.push({type:"text",text:i.text});const a=n(i.pos);return a!==null&&r.push({type:"tocPageNum",attrs:{page:a}}),{type:"tocEntry",attrs:{level:i.level,pos:i.pos},...r.length>0?{content:r}:{}}})}function mh(e,t){const n=e.schema.nodes.toc;if(!n)return!1;const i=[];if(t.doc.descendants((a,o)=>a.type.name==="toc"?(i.push({pos:o,nodeSize:a.nodeSize}),!1):!0),i.length===0)return!1;const r=r5(e.schema,fh(t.doc),ph(e));for(const a of i.reverse())t.replaceWith(a.pos,a.pos+a.nodeSize,n.create(null,r));return!0}function hh(e){const t=e.state.tr;return mh(e,t)?(e.view.dispatch(t),!0):!1}var o5=Ke.create({name:"tocCommands",addCommands(){return{insertToc:()=>({editor:e,chain:t})=>t().focus().insertContent({type:"toc",content:a5(e)}).run(),refreshToc:()=>({editor:e,tr:t})=>mh(e,t)}}}),s5=Ae.create({name:"tocPageNum",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{page:{default:null,parseHTML:e=>Number(e.textContent)||null,renderHTML:e=>e.page?{"data-page":e.page}:{}}}},parseHTML(){return[{tag:"span[data-toc-page]"}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-toc-page":"",class:"docs-toc__page"}),String(e.attrs.page??"")]}}),l5=Ae.create({name:"tocEntry",content:"inline*",defining:!0,addAttributes(){return{level:{default:1,parseHTML:e=>Number(e.getAttribute("data-level")??1),renderHTML:e=>({"data-level":e.level})},pos:{default:0,parseHTML:e=>Number(e.getAttribute("data-pos")??0),renderHTML:e=>({"data-pos":e.pos})}}},parseHTML(){return[{tag:"p[data-toc-entry]"}]},renderHTML({HTMLAttributes:e}){return["p",Fe(e,{"data-toc-entry":"",class:"docs-toc__entry"}),0]}}),c5=Ae.create({name:"toc",group:"block",content:"tocEntry+",defining:!0,parseHTML(){return[{tag:"div[data-toc]"}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-toc":"",class:"docs-toc"}),0]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-toc",n.setAttribute("data-toc","");const i=document.createElement("div");i.className="docs-toc__chrome",i.contentEditable="false";const r=document.createElement("span");r.className="docs-toc__caption",r.textContent="Table of contents";const a=document.createElement("button");a.type="button",a.className="docs-toc__refresh",a.title="Refresh table of contents",a.textContent="⟳",i.appendChild(r),i.appendChild(a);const o=document.createElement("div");o.className="docs-toc__entries",n.appendChild(i),n.appendChild(o);const l=u=>{u.preventDefault(),hh(t)},c=u=>{var h,g;const f=(g=(h=u.target)==null?void 0:h.closest)==null?void 0:g.call(h,"[data-toc-entry]");if(!f)return;const m=Number(f.getAttribute("data-pos")??0),p=Math.min(Math.max(0,m),t.state.doc.content.size);t.chain().focus().setTextSelection(p).scrollIntoView().run()};return a.addEventListener("click",l),n.addEventListener("click",c),{dom:n,contentDOM:o,update(u){var f;return((f=u==null?void 0:u.type)==null?void 0:f.name)==="toc"},destroy(){a.removeEventListener("click",l),n.removeEventListener("click",c)}}}}});Ee.definePlugin({id:"toc",tiptapExtensions:[s5,l5,c5,o5],slashCommands:[{name:"Table of contents",description:"Daftar isi",command:"insertToc"}],commands:{insertToc:e=>e.commands.insertToc(),refreshToc:e=>hh(e)}});Ee.definePlugin({id:"font-size",tiptapExtensions:[Ee.FontSizeExtension],commands:{setFontSize:(e,...t)=>{const n=t[0]||"16px";return n==="16px"?e.commands.unsetFontSize():e.commands.setFontSize(n),e.commands.focus(),!0}}});Ee.definePlugin({id:"text-color",tiptapExtensions:[B3],toolbar:[{id:"text-color",label:"Text Color",action:"setTextColor",iconComponent:"Palette"}],commands:{setTextColor:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetColor().run():e.chain().focus().setColor(n).run():!1}}});var u5=V3.extend({parseHTML(){return[{tag:"mark"},{tag:"span",style:"background-color"}]},renderHTML({HTMLAttributes:e}){return["mark",Fe(this.options.HTMLAttributes,e),0]}});Ee.definePlugin({id:"highlight",tiptapExtensions:[u5.configure({multicolor:!0})],toolbar:[{id:"highlight",label:"Highlight",action:"setHighlight",iconComponent:"Highlighter"}],commands:{setHighlight:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetHighlight().run():e.chain().focus().toggleHighlight({color:n}).run():e.chain().focus().toggleHighlight().run()}}});var d5=`<?xml version="1.0" encoding="utf-8"?>
691
+ `?r.slice(0,-1):r};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const XE=Ke.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new ct({key:new rt("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const i=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ur.fromSchema(this.editor.schema).parseSlice(Rc(i),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),JE=Ke.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=Gw.Commands.config.addCommands();return{setContent:(t,n,i)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n,i)(r),insertContentAt:(t,n,i)=>r=>e.insertContentAt(t,r.editor.storage.markdown.parser.parse(n,{inline:!0}),i)(r)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new KE(this.editor,this.options),serializer:new GE(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[QC.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),XE.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});Ee.definePlugin({id:"formatting",tiptapExtensions:[Zw],toolbar:[{id:"bold",label:"Bold",action:"toggleBold",iconComponent:"Bold"},{id:"italic",label:"Italic",action:"toggleItalic",iconComponent:"Italic"},{id:"underline",label:"Underline",action:"toggleUnderline",iconComponent:"Underline"},{id:"strike",label:"Strikethrough",action:"toggleStrike",iconComponent:"Strikethrough"}]});function Ni(e){return t=>t.commands.toggleHeading({level:e})}Ee.definePlugin({id:"headings",toolbar:[{id:"heading-1",label:"Heading 1",action:"toggleHeading1",iconComponent:"Heading1"},{id:"heading-2",label:"Heading 2",action:"toggleHeading2",iconComponent:"Heading2"},{id:"heading-3",label:"Heading 3",action:"toggleHeading3",iconComponent:"Heading3"},{id:"heading-4",label:"Heading 4",action:"toggleHeading4",iconComponent:"Heading4"},{id:"heading-5",label:"Heading 5",action:"toggleHeading5",iconComponent:"Heading5"},{id:"heading-6",label:"Heading 6",action:"toggleHeading6",iconComponent:"Heading6"}],slashCommands:[{name:"Heading 1",command:"toggleHeading1"},{name:"Heading 2",command:"toggleHeading2"},{name:"Heading 3",command:"toggleHeading3"}],commands:{toggleHeading1:Ni(1),toggleHeading2:Ni(2),toggleHeading3:Ni(3),toggleHeading4:Ni(4),toggleHeading5:Ni(5),toggleHeading6:Ni(6)}});Ee.definePlugin({id:"lists",tiptapExtensions:[Qw,e_.configure({nested:!0})],toolbar:[{id:"bullet-list",label:"Bullet List",action:"toggleBulletList",iconComponent:"List"},{id:"ordered-list",label:"Ordered List",action:"toggleOrderedList",iconComponent:"ListOrdered"},{id:"task-list",label:"Task List",action:"toggleTaskList",iconComponent:"CheckSquare"}],slashCommands:[{name:"Bullet List",command:"toggleBulletList"},{name:"Ordered List",command:"toggleOrderedList"},{name:"Task List",command:"toggleTaskList"}]});function Ta(e){return t=>t.commands.setTextAlign(e)}Ee.definePlugin({id:"alignment",tiptapExtensions:[t_.configure({types:["heading","paragraph"]})],toolbar:[{id:"align-left",label:"Align Left",action:"alignLeft",iconComponent:"AlignLeft"},{id:"align-center",label:"Align Center",action:"alignCenter",iconComponent:"AlignCenter"},{id:"align-right",label:"Align Right",action:"alignRight",iconComponent:"AlignRight"},{id:"align-justify",label:"Align Justify",action:"alignJustify",iconComponent:"AlignJustify"}],commands:{alignLeft:Ta("left"),alignCenter:Ta("center"),alignRight:Ta("right"),alignJustify:Ta("justify")}});Ee.definePlugin({id:"link",tiptapExtensions:[A_.configure({openOnClick:!0})],toolbar:[{id:"set-link",label:"Link",action:"setLink",iconComponent:"Link"}],slashCommands:[{name:"Link",command:"setLink"}],commands:{setLink:(e,...t)=>{if(e.isActive("link"))return e.chain().focus().unsetLink().run();const n=t[0],i=(n==null?void 0:n.href)??(typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter link URL:","https://"):null);return i?e.chain().focus().setLink({href:i,target:"_blank"}).run():!1}}});function ZE(){return typeof document>"u"?Promise.resolve(null):new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept="image/*";const n=()=>t.remove();t.onchange=()=>{var r;const i=((r=t.files)==null?void 0:r[0])??null;n(),e(i)},t.oncancel=()=>{n(),e(null)},document.body.appendChild(t),t.click()})}Ee.definePlugin({id:"image",tiptapExtensions:[N_],toolbar:[{id:"insert-image",label:"Image",action:"insertImage",iconComponent:"Image"}],slashCommands:[{name:"Image",command:"insertImage"}],commands:{insertImage:(e,...t)=>{const n=t[0];if(n!=null&&n.src)return e.commands.setImage({src:n.src,alt:n.alt,title:n.title});const i=e.storage.editorContext,r=i==null?void 0:i.onImageUpload;if(r)return ZE().then(async a=>{if(a)try{const o=await r(a);o!=null&&o.src&&e.commands.setImage({src:o.src,alt:o.alt,title:o.title})}catch(o){console.error("[image] upload failed:",o)}}),!0;if(typeof window<"u"&&typeof window.prompt=="function"){const a=window.prompt("Enter image URL:","https://");return a?e.commands.setImage({src:a}):!1}return!1}}});var QE=D3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),tablePageSplit:{default:null,parseHTML:()=>null,renderHTML:()=>({})}}},renderHTML({node:e,HTMLAttributes:t}){let n=0;const i=e.firstChild;i&&i.forEach(c=>{n+=c.attrs.colspan||1});const r=[];let a=0,o=!1;if(n>0)for(let c=0;c<n;c++){let u=null;if(i){let f=0;i.forEach(m=>{const p=m.attrs.colspan||1;if(c>=f&&c<f+p){const h=m.attrs.colwidth;if(h&&Array.isArray(h)){const g=c-f,b=h[g];typeof b=="number"&&b>0&&(u=b)}}f+=p})}u&&(a+=u,o=!0),r.push(["col",u?{style:`width: ${u}px !important`,width:String(u)}:{}])}const l=Fe(t);if(l["data-tps-splittable"]="",o&&a>0){const c=l.style||"";l.style=c?`${c}; width: ${a}px !important`:`width: ${a}px !important`,l["data-colwidth"]="explicit"}return["table",l,["colgroup",...r],["tbody",0]]}}),YE=I3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}}),e5=R3.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("width")||t.style.width;if(n){const r=parseInt(n,10);return isNaN(r)||r<=0?null:[r]}const i=t.getAttribute("colwidth");return i?i.split(",").map(r=>parseInt(r,10)).filter(r=>!isNaN(r)&&r>0):null},renderHTML:t=>{if(!t.colwidth||!Array.isArray(t.colwidth)||t.colwidth.length===0)return{};const n=t.colwidth.filter(r=>typeof r=="number"&&r>0);if(n.length===0)return{};const i=n[0];return{colwidth:n.join(","),style:`width: ${i}px !important`,width:String(i)}}}}}});Ee.definePlugin({id:"table",tiptapExtensions:[QE.configure({resizable:!1}),z3,YE,e5],toolbar:[{id:"insert-table",label:"Insert Table",action:"insertTable",args:[{rows:3,cols:3,withHeaderRow:!0}],iconComponent:"Table"}],slashCommands:[{name:"Table",command:"insertTable"}]});Ee.definePlugin({id:"blockquote",toolbar:[{id:"blockquote",label:"Blockquote",action:"toggleBlockquote",iconComponent:"Quote"}],slashCommands:[{name:"Blockquote",command:"toggleBlockquote"}]});Ee.definePlugin({id:"code-block",toolbar:[{id:"code-block",label:"Code Block",action:"toggleCodeBlock",iconComponent:"Code"}],slashCommands:[{name:"Code Block",command:"toggleCodeBlock"}]});function t5(e={}){return Ee.definePlugin({id:"placeholder",tiptapExtensions:[L3.configure({placeholder:e.placeholder??"Start writing…"})]})}t5();var n5=Ae.create({name:"pageBreak",group:"block",selectable:!1,draggable:!1,parseHTML(){return[{tag:'div[data-page-break="true"]'}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-page-break":"true","data-node-type":"pageBreak",class:"docs-editor-page-break"}),["span",{class:"docs-editor-page-break__label"},"Page break"]]},addNodeView(){return()=>{const e=document.createElement("div");e.className="docs-editor-page-break",e.setAttribute("data-page-break","true"),e.setAttribute("data-node-type","pageBreak"),e.setAttribute("contenteditable","false");const t=document.createElement("div");t.className="docs-editor-page-break__inner";const n=document.createElement("div");n.className="docs-editor-page-break__line";const i=document.createElement("span");return i.className="docs-editor-page-break__label-text",i.textContent="Page break",t.appendChild(n),t.appendChild(i),e.appendChild(t),{dom:e,contentDOM:void 0}}}});Ee.definePlugin({id:"pageBreak",tiptapExtensions:[n5],toolbar:[{id:"insert-page-break",label:"Page Break",action:"insertPageBreak",iconComponent:"FileText"}],slashCommands:[{name:"Page Break",command:"insertPageBreak"}],commands:{insertPageBreak:e=>e.chain().focus().insertContent([{type:"pageBreak"},{type:"paragraph"}]).run()}});var i5=Ae.create({name:"footnote",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{content:{default:"",parseHTML:e=>e.getAttribute("data-footnote-content")??"",renderHTML:e=>({"data-footnote-content":e.content})},citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>e.citationId?{"data-citation-id":e.citationId}:{}},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-footnote-source-id"),renderHTML:e=>e.sourceId?{"data-footnote-source-id":e.sourceId}:{}},locator:{default:"",parseHTML:e=>e.getAttribute("data-footnote-locator")??"",renderHTML:e=>e.locator?{"data-footnote-locator":e.locator}:{}}}},parseHTML(){return[{tag:'span[data-node-type="footnote"]'}]},renderHTML({HTMLAttributes:e}){return["span",Fe(e,{"data-node-type":"footnote",class:"docs-footnote-ref"}),"1"]},addNodeView(){return e=>{const t=e.node??e,n=t&&typeof t=="object"&&"attrs"in t?t.attrs:{},i=document.createElement("span");return i.className="docs-footnote-ref",i.setAttribute("data-node-type","footnote"),i.setAttribute("data-footnote-content",String(n.content??"")),n.sourceId&&(i.setAttribute("data-footnote-source-id",String(n.sourceId)),i.setAttribute("data-citation-id",String(n.citationId??"")),n.locator&&i.setAttribute("data-footnote-locator",String(n.locator))),i.textContent="1",{dom:i,update(r){try{const a=(r==null?void 0:r.attrs)??{};i.setAttribute("data-footnote-content",String(a.content??"")),a.sourceId?(i.setAttribute("data-footnote-source-id",String(a.sourceId)),i.setAttribute("data-citation-id",String(a.citationId??"")),a.locator&&i.setAttribute("data-footnote-locator",String(a.locator))):(i.removeAttribute("data-footnote-source-id"),i.removeAttribute("data-citation-id"),i.removeAttribute("data-footnote-locator"))}catch{}return!0}}}}});Ee.definePlugin({id:"footnote",tiptapExtensions:[i5],toolbar:[{id:"insert-footnote",label:"Catatan Kaki",action:"insertFootnote",iconComponent:"FileText"}],slashCommands:[{name:"Catatan Kaki",command:"insertFootnote"}],commands:{insertFootnote:(e,...t)=>{const n=t[0];return e.chain().focus().insertContent({type:"footnote",attrs:{content:(n==null?void 0:n.content)??""}}).run()}}});function fh(e){const t=[];return e.descendants((n,i)=>{if(n.type.name==="heading"){const r=n.attrs.level;(r===1||r===2||r===3)&&t.push({level:r,text:n.textContent.trim(),pos:i})}return!0}),t}function r5(e){return fh(e.state.doc)}function ph(e){let t=[];try{const i=e.view.dom.querySelector("[data-rm-pagination]");i&&(t=Array.from(i.querySelectorAll(".rm-page-break .breaker")).filter(r=>r instanceof HTMLElement))}catch{}if(t.length===0)return()=>null;const n=e.view.dom;return i=>{try{const a=e.view.coordsAtPos(i).top-n.getBoundingClientRect().top+n.scrollTop;let o=1;for(const l of t){if(a<l.offsetTop)return o;o++}return o}catch{return null}}}function a5(e,t,n){const i=e.nodes.tocEntry;return t.length===0?[i.create({level:1,pos:0})]:t.map(r=>{const a=[];r.text&&a.push(e.text(r.text));const o=n(r.pos);return o!==null&&a.push(e.nodes.tocPageNum.create({page:o})),i.create({level:r.level,pos:r.pos},a)})}function o5(e){const t=r5(e);if(t.length===0)return[{type:"tocEntry",attrs:{level:1,pos:0}}];const n=ph(e);return t.map(i=>{const r=[];i.text&&r.push({type:"text",text:i.text});const a=n(i.pos);return a!==null&&r.push({type:"tocPageNum",attrs:{page:a}}),{type:"tocEntry",attrs:{level:i.level,pos:i.pos},...r.length>0?{content:r}:{}}})}function mh(e,t){const n=e.schema.nodes.toc;if(!n)return!1;const i=[];if(t.doc.descendants((a,o)=>a.type.name==="toc"?(i.push({pos:o,nodeSize:a.nodeSize}),!1):!0),i.length===0)return!1;const r=a5(e.schema,fh(t.doc),ph(e));for(const a of i.reverse())t.replaceWith(a.pos,a.pos+a.nodeSize,n.create(null,r));return!0}function hh(e){const t=e.state.tr;return mh(e,t)?(e.view.dispatch(t),!0):!1}var s5=Ke.create({name:"tocCommands",addCommands(){return{insertToc:()=>({editor:e,chain:t})=>t().focus().insertContent({type:"toc",content:o5(e)}).run(),refreshToc:()=>({editor:e,tr:t})=>mh(e,t)}}}),l5=Ae.create({name:"tocPageNum",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{page:{default:null,parseHTML:e=>Number(e.textContent)||null,renderHTML:e=>e.page?{"data-page":e.page}:{}}}},parseHTML(){return[{tag:"span[data-toc-page]"}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-toc-page":"",class:"docs-toc__page"}),String(e.attrs.page??"")]}}),c5=Ae.create({name:"tocEntry",content:"inline*",defining:!0,addAttributes(){return{level:{default:1,parseHTML:e=>Number(e.getAttribute("data-level")??1),renderHTML:e=>({"data-level":e.level})},pos:{default:0,parseHTML:e=>Number(e.getAttribute("data-pos")??0),renderHTML:e=>({"data-pos":e.pos})}}},parseHTML(){return[{tag:"p[data-toc-entry]"}]},renderHTML({HTMLAttributes:e}){return["p",Fe(e,{"data-toc-entry":"",class:"docs-toc__entry"}),0]}}),u5=Ae.create({name:"toc",group:"block",content:"tocEntry+",defining:!0,parseHTML(){return[{tag:"div[data-toc]"}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-toc":"",class:"docs-toc"}),0]},addNodeView(){return e=>{const t=e.editor,n=document.createElement("div");n.className="docs-toc",n.setAttribute("data-toc","");const i=document.createElement("div");i.className="docs-toc__chrome",i.contentEditable="false";const r=document.createElement("span");r.className="docs-toc__caption",r.textContent="Table of contents";const a=document.createElement("button");a.type="button",a.className="docs-toc__refresh",a.title="Refresh table of contents",a.textContent="⟳",i.appendChild(r),i.appendChild(a);const o=document.createElement("div");o.className="docs-toc__entries",n.appendChild(i),n.appendChild(o);const l=u=>{u.preventDefault(),hh(t)},c=u=>{var h,g;const f=(g=(h=u.target)==null?void 0:h.closest)==null?void 0:g.call(h,"[data-toc-entry]");if(!f)return;const m=Number(f.getAttribute("data-pos")??0),p=Math.min(Math.max(0,m),t.state.doc.content.size);t.chain().focus().setTextSelection(p).scrollIntoView().run()};return a.addEventListener("click",l),n.addEventListener("click",c),{dom:n,contentDOM:o,update(u){var f;return((f=u==null?void 0:u.type)==null?void 0:f.name)==="toc"},destroy(){a.removeEventListener("click",l),n.removeEventListener("click",c)}}}}});Ee.definePlugin({id:"toc",tiptapExtensions:[l5,c5,u5,s5],slashCommands:[{name:"Table of contents",description:"Daftar isi",command:"insertToc"}],commands:{insertToc:e=>e.commands.insertToc(),refreshToc:e=>hh(e)}});Ee.definePlugin({id:"font-size",tiptapExtensions:[Ee.FontSizeExtension],commands:{setFontSize:(e,...t)=>{const n=t[0]||"16px";return n==="16px"?e.commands.unsetFontSize():e.commands.setFontSize(n),e.commands.focus(),!0}}});Ee.definePlugin({id:"text-color",tiptapExtensions:[P3],toolbar:[{id:"text-color",label:"Text Color",action:"setTextColor",iconComponent:"Palette"}],commands:{setTextColor:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetColor().run():e.chain().focus().setColor(n).run():!1}}});var d5=U3.extend({parseHTML(){return[{tag:"mark"},{tag:"span",style:"background-color"}]},renderHTML({HTMLAttributes:e}){return["mark",Fe(this.options.HTMLAttributes,e),0]}});Ee.definePlugin({id:"highlight",tiptapExtensions:[d5.configure({multicolor:!0})],toolbar:[{id:"highlight",label:"Highlight",action:"setHighlight",iconComponent:"Highlighter"}],commands:{setHighlight:(e,...t)=>{const n=t[0];return n?n==="default"?e.chain().focus().unsetHighlight().run():e.chain().focus().toggleHighlight({color:n}).run():e.chain().focus().toggleHighlight().run()}}});var f5=`<?xml version="1.0" encoding="utf-8"?>
692
692
  <style xmlns="http://purl.org/net/xbiblio/csl" class="note" initialize-with=". " page-range-format="chicago-16" version="1.0">
693
693
  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
694
694
  <info>
@@ -6694,7 +6694,7 @@ ${n.innerHTML}
6694
6694
  </layout>
6695
6695
  </bibliography>
6696
6696
  </style>
6697
- `,f5=d5,p5=`<?xml version="1.0" encoding="utf-8"?>
6697
+ `,p5=f5,m5=`<?xml version="1.0" encoding="utf-8"?>
6698
6698
  <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" initialize-with=". " page-range-format="chicago-16" version="1.0">
6699
6699
  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
6700
6700
  <info>
@@ -10910,7 +10910,7 @@ ${n.innerHTML}
10910
10910
  </layout>
10911
10911
  </bibliography>
10912
10912
  </style>
10913
- `,m5=p5,h5=`<?xml version="1.0" encoding="utf-8"?>
10913
+ `,h5=m5,b5=`<?xml version="1.0" encoding="utf-8"?>
10914
10914
  <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" demote-non-dropping-particle="never" initialize-with=". " names-delimiter=", " page-range-format="expanded" version="1.0">
10915
10915
  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
10916
10916
  <info>
@@ -13183,7 +13183,7 @@ ${n.innerHTML}
13183
13183
  </layout>
13184
13184
  </bibliography>
13185
13185
  </style>
13186
- `,b5=h5,g5=`<?xml version="1.0" encoding="utf-8"?>
13186
+ `,g5=b5,v5=`<?xml version="1.0" encoding="utf-8"?>
13187
13187
  <style xmlns="http://purl.org/net/xbiblio/csl" and="text" class="in-text" demote-non-dropping-particle="never" initialize-with=". " page-range-format="minimal-two" version="1.0">
13188
13188
  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
13189
13189
  <info>
@@ -14367,7 +14367,7 @@ ${n.innerHTML}
14367
14367
  </layout>
14368
14368
  </bibliography>
14369
14369
  </style>
14370
- `,v5=g5,x5=`<?xml version="1.0" encoding="utf-8"?>
14370
+ `,x5=v5,y5=`<?xml version="1.0" encoding="utf-8"?>
14371
14371
  <locale xmlns="http://purl.org/net/xbiblio/csl" version="1.0" xml:lang="en-US">
14372
14372
  <!-- The abbreviations in this file follow the recommendations of The Chicago Manual of Style, 18th ed. (2024), sec. 10.48 (cited hereafter as CMOS), unless stated otherwise. -->
14373
14373
  <!-- Additional abbreviations are from:
@@ -15231,15 +15231,15 @@ ${n.innerHTML}
15231
15231
  <term name="season-04">Winter</term>
15232
15232
  </terms>
15233
15233
  </locale>
15234
- `,y5=x5,Na={"chicago-notes-bibliography":{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)",category:"note",xml:f5},"chicago-author-date":{id:"chicago-author-date",name:"Chicago (author-date)",category:"in-text",xml:m5},apa:{id:"apa",name:"APA",category:"in-text",xml:b5},"modern-language-association":{id:"modern-language-association",name:"MLA",category:"in-text",xml:v5}},k5="chicago-notes-bibliography",w5=y5,Wd=0;function bh(){return Wd+=1,`cite-${Date.now().toString(36)}-${Wd.toString(36)}`}var _5=/^<\/?(i|b|em|strong|sup|sub|span|nobr)( style="font-variant: ?small-caps;?")?\/?>$|^<div class="csl-entry">$|^<\/div>$/;function Gd(e){return e.replace(/<[^>]*>/g,t=>_5.test(t)?t:t.replace(/</g,"&lt;").replace(/>/g,"&gt;"))}var S5=class{constructor(e={}){kn(this,"sources",new Map);kn(this,"style");kn(this,"clusters",new Map);kn(this,"order",[]);kn(this,"rendered",new Map);kn(this,"bibliography",[]);kn(this,"listeners",new Set);kn(this,"lastSignature","");this.style=e.style&&Na[e.style]?e.style:k5,this.updateSources(e.sources??[],!1)}getStyle(){return this.style}isNoteStyle(){var e;return((e=Na[this.style])==null?void 0:e.category)==="note"}getSource(e){return this.sources.get(e)}getSourceIds(){return[...this.sources.keys()]}getCitedSourceIds(){const e=new Set;for(const t of this.clusters.values())t.sourceId&&e.add(t.sourceId);return[...e]}setStyle(e){!Na[e]||e===this.style||(this.style=e,this.recompute(),this.emitChange())}updateSources(e,t=!0){this.sources=new Map(e.map(n=>[n.id,n])),this.recompute(),t&&this.emitChange()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}syncCitations(e){const t=e.map(n=>{const i=n.attrs;return`${n.citationId}|${i.sourceId??""}|${i.locator??""}|${i.label??""}|${i.mode??""}|${i.prefix??""}|${i.suffix??""}`}).join(`
15235
- `);return t===this.lastSignature?!1:(this.lastSignature=t,this.clusters=new Map(e.map(n=>[n.citationId,n.attrs])),this.order=e.map(n=>n.citationId),this.recompute(),this.emitChange(),!0)}renderCluster(e){return this.rendered.get(e)??""}getBibliography(){return this.bibliography}emitChange(){for(const e of this.listeners)e()}recompute(){const e=Na[this.style],t=new H3.Engine({retrieveLocale:()=>w5,retrieveItem:a=>this.sources.get(a)},e.xml,"en-US"),n=new Map,i=[];let r=0;for(const a of this.order){const o=this.clusters.get(a);if(!(o!=null&&o.sourceId)||!this.sources.has(o.sourceId)){n.set(a,"");continue}r+=1;try{const[,l]=t.processCitationCluster({citationID:a,citationItems:[{id:o.sourceId,locator:o.locator||void 0,label:o.label||void 0,prefix:o.prefix||void 0,suffix:o.suffix||void 0,"suppress-author":o.mode==="suppress-author"||void 0,"author-only":o.mode==="author-only"||void 0}],properties:{noteIndex:e.category==="note"?r:0}},i,[]);i.push([a,r]);for(const[,c,u]of l??[])n.set(u,Gd(c));n.has(a)||n.set(a,"")}catch{n.set(a,"")}}this.rendered=n;try{const a=t.makeBibliography();this.bibliography=a?a[1].map(o=>Gd(o).trim()):[]}catch{this.bibliography=[]}}};function Kd(e){const t=e.storage.citationEngine;return(t==null?void 0:t.engine)??null}function ir(e){return e===!1||e==="false"}function Oa(e){return typeof e=="string"&&e!==""?e:"Bibliography"}var C5=Ae.create({name:"bibliography",group:"block",selectable:!0,draggable:!0,atom:!0,addAttributes(){return{showHeading:{default:!0,parseHTML:e=>!ir(e.getAttribute("data-show-heading")),renderHTML:e=>ir(e.showHeading)?{"data-show-heading":"false"}:{}},headingText:{default:"Bibliography",parseHTML:e=>Oa(e.getAttribute("data-heading-text")),renderHTML:e=>typeof e.headingText=="string"&&e.headingText!=="Bibliography"?{"data-heading-text":e.headingText}:{}}}},parseHTML(){return[{tag:'div[data-node-type="bibliography"]'}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-node-type":"bibliography",class:"docs-bibliography"})]},addNodeView(){return e=>{var l;const t=e.editor,n=document.createElement("div");n.className="docs-bibliography",n.setAttribute("data-node-type","bibliography");let i=((l=e.node)==null?void 0:l.attrs)??{};const r=()=>{const c=Kd(t),u=(c==null?void 0:c.getBibliography())??[],f=!ir(i.showHeading),m=Oa(i.headingText);if(n.innerHTML="",u.length===0){if(!f)return;const h=document.createElement("p");h.className="docs-bibliography__empty",h.textContent=m,n.appendChild(h);return}if(f){const h=document.createElement("h2");h.className="docs-bibliography__heading",h.textContent=m,n.appendChild(h)}const p=document.createElement("div");p.className="docs-bibliography__entries";for(const h of u){const g=document.createElement("p");g.className="docs-bibliography__entry",g.innerHTML=h,p.appendChild(g)}n.appendChild(p)};r();const a=Kd(t),o=a==null?void 0:a.onChange(r);return{dom:n,update(c){var m;if(((m=c==null?void 0:c.type)==null?void 0:m.name)!=="bibliography")return!1;const u=c.attrs??{},f=ir(u.showHeading)!==ir(i.showHeading)||Oa(u.headingText)!==Oa(i.headingText);return i=u,f&&r(),!0},destroy(){o==null||o()}}}}});function gh(e,t){const n=bh();return e.isNoteStyle()?{type:"footnote",attrs:{content:"",sourceId:t.sourceId,locator:t.locator??"",citationId:n}}:{type:"citation",attrs:{citationId:n,sourceId:t.sourceId,locator:t.locator??""}}}function Ui(e){return e.storage.citationEngine?e.storage.citationEngine.engine??null:null}var E5=Ke.create({name:"citationEngine",addStorage(){return{engine:null}},onUpdate(){var r,a;const e=this.editor,t=Ui(e);if(!t)return;{const o=new Set,l=[];if(e.state.doc.descendants((c,u)=>{if(c.type.name==="citation"||c.type.name==="footnote"&&c.attrs.sourceId){const f=c.attrs.citationId;f&&(o.has(f)?l.push({pos:u,attrs:{...c.attrs}}):o.add(f))}return!0}),l.length>0){const c=e.state.tr;for(const{pos:u,attrs:f}of l)c.setNodeMarkup(u,void 0,{...f,citationId:bh()});e.view.dispatch(c);return}}const n=[];if(e.state.doc.descendants((o,l)=>((o.type.name==="citation"||o.type.name==="footnote"&&o.attrs.sourceId)&&n.push({citationId:o.attrs.citationId??`anon-${l}`,attrs:{sourceId:o.attrs.sourceId??null,locator:o.attrs.locator||"",label:o.attrs.label||"page",mode:o.attrs.mode||"normal",prefix:o.attrs.prefix||"",suffix:o.attrs.suffix||""}}),!0)),t.syncCitations(n)){const o=e.storage.editorContext;(a=(r=o==null?void 0:o.citation)==null?void 0:r.onSourcesChange)==null||a.call(r,t.getCitedSourceIds())}{const o=[];if(e.state.doc.descendants((l,c)=>{if(l.type.name==="footnote"&&l.attrs.sourceId){const u=l.attrs.citationId;if(!u)return!0;const f=t.renderCluster(u);f&&f!==l.attrs.content&&o.push({pos:c,content:f})}return!0}),o.length>0){const l=e.state.tr;for(const{pos:c,content:u}of o){const f=e.state.doc.nodeAt(c);f&&l.setNodeMarkup(c,void 0,{...f.attrs,content:u})}e.view.dispatch(l)}}}}),A5=Ae.create({name:"citation",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>({"data-citation-id":e.citationId})},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-citation-source-id"),renderHTML:e=>({"data-citation-source-id":e.sourceId})},locator:{default:"",parseHTML:e=>e.getAttribute("data-citation-locator")??"",renderHTML:e=>({"data-citation-locator":e.locator})},label:{default:"page",parseHTML:e=>e.getAttribute("data-citation-label")??"page",renderHTML:e=>({"data-citation-label":e.label})},mode:{default:"normal",parseHTML:e=>e.getAttribute("data-citation-mode")??"normal",renderHTML:e=>({"data-citation-mode":e.mode})},prefix:{default:""},suffix:{default:""}}},parseHTML(){return[{tag:'span[data-node-type="citation"]'}]},renderHTML({HTMLAttributes:e}){return["span",Fe(e,{"data-node-type":"citation",class:"docs-citation"}),""]},addNodeView(){return e=>{const t=e.editor,n=e.node??e,i=document.createElement("span");i.className="docs-citation",i.setAttribute("data-node-type","citation");const r=()=>{const l=Ui(t),c=n.attrs.citationId,u=l&&c?l.renderCluster(c):"";u?(i.innerHTML=u,i.classList.remove("docs-citation--missing")):(i.textContent="[?]",i.classList.add("docs-citation--missing")),i.setAttribute("data-citation-id",String(n.attrs.citationId??"")),i.setAttribute("data-citation-source-id",String(n.attrs.sourceId??""))};r();const a=Ui(t),o=a==null?void 0:a.onChange(r);return{dom:i,update(l){var c;if(((c=l==null?void 0:l.type)==null?void 0:c.name)!=="citation")return!1;try{Object.assign(n.attrs,l.attrs),r()}catch{}return!0},destroy(){o==null||o()}}}}});function Xd(e,t,n){const i=gh(t,n);return i.type==="footnote"&&!e.schema.nodes.footnote?!1:e.chain().focus().insertContent({type:i.type,attrs:i.attrs}).run()}Ee.definePlugin({id:"citation",tiptapExtensions:[E5,A5,C5],toolbar:[{id:"insert-citation",label:"Citation",action:"insertCitation",iconComponent:"Quote"}],slashCommands:[{name:"Citation",command:"insertCitation"},{name:"Bibliography",command:"insertBibliography"}],commands:{insertCitation:(e,...t)=>{var o;const n=Ui(e);if(!n)return console.warn("[citation] no citation engine — inject the CitationPort to enable citations"),!1;const i=t[0];if(i!=null&&i.sourceId)return Xd(e,n,{sourceId:i.sourceId,locator:i.locator});const r=e.storage.editorContext,a=(o=r==null?void 0:r.citation)==null?void 0:o.onSourceRequest;return a?(a().then(l=>{l&&Xd(e,n,{sourceId:l})}),!0):!1},insertBibliography:e=>{let t=!1;return e.state.doc.descendants(n=>(n.type.name==="bibliography"&&(t=!0),!t)),t?!1:e.chain().focus().insertContent({type:"bibliography"}).run()},setCitationStyle:(e,...t)=>{const n=Ui(e),i=t[0];return!n||!i?!1:(n.setStyle(i),!0)}},hooks:{onInit(e){const t=e.storage.editorContext,n=t==null?void 0:t.citation;if(!n)return;const i=typeof n.sources=="function"?n.sources():n.sources,r=new S5({sources:i,style:n.style});e.storage.citationEngine.engine=r},onDestroy(e){e.storage.citationEngine.engine=null}}});function T5(e){const t=e.storage.markdown;if(!t||typeof t!="object")return;const n=t.parser;if(!(!n||typeof n!="object"||!("parse"in n)))return n}function vh(e,t,n){const i=T5(e);if(!i)return null;let r;try{r=i.parse(t,{inline:n.inline})}catch{return null}if(typeof r!="string")return null;const a=Pi(r,e.schema,{slice:!0,parseOptions:{preserveWhitespace:"full"}});if(a instanceof J)return a;const o=a;return o&&typeof o.forEach=="function"&&typeof o.size=="number"?o:J.from(a)}function N5(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}function Jd(e,t,n,i,r){const a=vh(e,r,{inline:!1});if(!a){t.dispatch(t.state.tr.insertText(r,n,i));return}const o=t.state.tr;let l=n,c=i;if(l===c){let f=!0;if(a.forEach(m=>{m.isBlock||(f=!1)}),f){const p=o.doc.resolve(l).parent;p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}}let u=!0;if(a.forEach(f=>{(!f.isText||f.marks.length>0)&&(u=!1)}),u){let f="";a.forEach(m=>{m.isText&&(f+=m.text??"")}),o.insertText(f,l,c)}else o.replaceWith(l,c,a);N5(o,0,-1),t.dispatch(o)}var at=new rt("docflow-ai"),Zd=1500;function Ml(e){var t;return(t=e.storage.editorContext)==null?void 0:t.aiStream}function Qd(e,t,n){return{before:e.doc.textBetween(Math.max(0,t-Zd),t,`
15234
+ `,k5=y5,Na={"chicago-notes-bibliography":{id:"chicago-notes-bibliography",name:"Chicago (notes & bibliography)",category:"note",xml:p5},"chicago-author-date":{id:"chicago-author-date",name:"Chicago (author-date)",category:"in-text",xml:h5},apa:{id:"apa",name:"APA",category:"in-text",xml:g5},"modern-language-association":{id:"modern-language-association",name:"MLA",category:"in-text",xml:x5}},w5="chicago-notes-bibliography",_5=k5,Wd=0;function bh(){return Wd+=1,`cite-${Date.now().toString(36)}-${Wd.toString(36)}`}var S5=/^<\/?(i|b|em|strong|sup|sub|span|nobr)( style="font-variant: ?small-caps;?")?\/?>$|^<div class="csl-entry">$|^<\/div>$/;function Gd(e){return e.replace(/<[^>]*>/g,t=>S5.test(t)?t:t.replace(/</g,"&lt;").replace(/>/g,"&gt;"))}var C5=class{constructor(e={}){kn(this,"sources",new Map);kn(this,"style");kn(this,"clusters",new Map);kn(this,"order",[]);kn(this,"rendered",new Map);kn(this,"bibliography",[]);kn(this,"listeners",new Set);kn(this,"lastSignature","");this.style=e.style&&Na[e.style]?e.style:w5,this.updateSources(e.sources??[],!1)}getStyle(){return this.style}isNoteStyle(){var e;return((e=Na[this.style])==null?void 0:e.category)==="note"}getSource(e){return this.sources.get(e)}getSourceIds(){return[...this.sources.keys()]}getCitedSourceIds(){const e=new Set;for(const t of this.clusters.values())t.sourceId&&e.add(t.sourceId);return[...e]}setStyle(e){!Na[e]||e===this.style||(this.style=e,this.recompute(),this.emitChange())}updateSources(e,t=!0){this.sources=new Map(e.map(n=>[n.id,n])),this.recompute(),t&&this.emitChange()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}syncCitations(e){const t=e.map(n=>{const i=n.attrs;return`${n.citationId}|${i.sourceId??""}|${i.locator??""}|${i.label??""}|${i.mode??""}|${i.prefix??""}|${i.suffix??""}`}).join(`
15235
+ `);return t===this.lastSignature?!1:(this.lastSignature=t,this.clusters=new Map(e.map(n=>[n.citationId,n.attrs])),this.order=e.map(n=>n.citationId),this.recompute(),this.emitChange(),!0)}renderCluster(e){return this.rendered.get(e)??""}getBibliography(){return this.bibliography}emitChange(){for(const e of this.listeners)e()}recompute(){const e=Na[this.style],t=new q3.Engine({retrieveLocale:()=>_5,retrieveItem:a=>this.sources.get(a)},e.xml,"en-US"),n=new Map,i=[];let r=0;for(const a of this.order){const o=this.clusters.get(a);if(!(o!=null&&o.sourceId)||!this.sources.has(o.sourceId)){n.set(a,"");continue}r+=1;try{const[,l]=t.processCitationCluster({citationID:a,citationItems:[{id:o.sourceId,locator:o.locator||void 0,label:o.label||void 0,prefix:o.prefix||void 0,suffix:o.suffix||void 0,"suppress-author":o.mode==="suppress-author"||void 0,"author-only":o.mode==="author-only"||void 0}],properties:{noteIndex:e.category==="note"?r:0}},i,[]);i.push([a,r]);for(const[,c,u]of l??[])n.set(u,Gd(c));n.has(a)||n.set(a,"")}catch{n.set(a,"")}}this.rendered=n;try{const a=t.makeBibliography();this.bibliography=a?a[1].map(o=>Gd(o).trim()):[]}catch{this.bibliography=[]}}};function Kd(e){const t=e.storage.citationEngine;return(t==null?void 0:t.engine)??null}function ir(e){return e===!1||e==="false"}function Oa(e){return typeof e=="string"&&e!==""?e:"Bibliography"}var E5=Ae.create({name:"bibliography",group:"block",selectable:!0,draggable:!0,atom:!0,addAttributes(){return{showHeading:{default:!0,parseHTML:e=>!ir(e.getAttribute("data-show-heading")),renderHTML:e=>ir(e.showHeading)?{"data-show-heading":"false"}:{}},headingText:{default:"Bibliography",parseHTML:e=>Oa(e.getAttribute("data-heading-text")),renderHTML:e=>typeof e.headingText=="string"&&e.headingText!=="Bibliography"?{"data-heading-text":e.headingText}:{}}}},parseHTML(){return[{tag:'div[data-node-type="bibliography"]'}]},renderHTML({HTMLAttributes:e}){return["div",Fe(e,{"data-node-type":"bibliography",class:"docs-bibliography"})]},addNodeView(){return e=>{var c;const t=e.editor,n=document.createElement("div");n.className="docs-bibliography",n.setAttribute("data-node-type","bibliography");let i=((c=e.node)==null?void 0:c.attrs)??{};const r=()=>{const u=Kd(t),f=(u==null?void 0:u.getBibliography())??[],m=!ir(i.showHeading),p=Oa(i.headingText);if(n.innerHTML="",f.length===0){if(!m)return;const g=document.createElement("p");g.className="docs-bibliography__empty",g.textContent=p,n.appendChild(g);return}if(m){const g=document.createElement("h2");g.className="docs-bibliography__heading",g.textContent=p,n.appendChild(g)}const h=document.createElement("div");h.className="docs-bibliography__entries";for(const g of f){const b=document.createElement("p");b.className="docs-bibliography__entry",b.innerHTML=g,h.appendChild(b)}n.appendChild(h)};r();let a=null,o=null;const l=()=>{const u=Kd(t);u!==o&&(a==null||a(),o=u,a=u?u.onChange(r):null,r())};return l(),t.on("create",l),t.on("citationEngineReady",l),{dom:n,update(u){var p;if(((p=u==null?void 0:u.type)==null?void 0:p.name)!=="bibliography")return!1;const f=u.attrs??{},m=ir(f.showHeading)!==ir(i.showHeading)||Oa(f.headingText)!==Oa(i.headingText);return i=f,m&&r(),!0},destroy(){t.off("create",l),t.off("citationEngineReady",l),a==null||a()}}}}});function gh(e,t){const n=bh();return e.isNoteStyle()?{type:"footnote",attrs:{content:"",sourceId:t.sourceId,locator:t.locator??"",citationId:n}}:{type:"citation",attrs:{citationId:n,sourceId:t.sourceId,locator:t.locator??""}}}function Ui(e){return e.storage.citationEngine?e.storage.citationEngine.engine??null:null}var A5=Ke.create({name:"citationEngine",addStorage(){return{engine:null}},onUpdate(){vh(this.editor)}});function vh(e){var r,a;const t=Ui(e);if(!t)return;{const o=new Set,l=[];if(e.state.doc.descendants((c,u)=>{if(c.type.name==="citation"||c.type.name==="footnote"&&c.attrs.sourceId){const f=c.attrs.citationId;f&&(o.has(f)?l.push({pos:u,attrs:{...c.attrs}}):o.add(f))}return!0}),l.length>0){const c=e.state.tr;for(const{pos:u,attrs:f}of l)c.setNodeMarkup(u,void 0,{...f,citationId:bh()});e.view.dispatch(c);return}}const n=[];if(e.state.doc.descendants((o,l)=>((o.type.name==="citation"||o.type.name==="footnote"&&o.attrs.sourceId)&&n.push({citationId:o.attrs.citationId??`anon-${l}`,attrs:{sourceId:o.attrs.sourceId??null,locator:o.attrs.locator||"",label:o.attrs.label||"page",mode:o.attrs.mode||"normal",prefix:o.attrs.prefix||"",suffix:o.attrs.suffix||""}}),!0)),t.syncCitations(n)){const o=e.storage.editorContext;(a=(r=o==null?void 0:o.citation)==null?void 0:r.onSourcesChange)==null||a.call(r,t.getCitedSourceIds())}{const o=[];if(e.state.doc.descendants((l,c)=>{if(l.type.name==="footnote"&&l.attrs.sourceId){const u=l.attrs.citationId;if(!u)return!0;const f=t.renderCluster(u);f&&f!==l.attrs.content&&o.push({pos:c,content:f})}return!0}),o.length>0){const l=e.state.tr;for(const{pos:c,content:u}of o){const f=e.state.doc.nodeAt(c);f&&l.setNodeMarkup(c,void 0,{...f.attrs,content:u})}e.view.dispatch(l)}}}var T5=Ae.create({name:"citation",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{citationId:{default:null,parseHTML:e=>e.getAttribute("data-citation-id"),renderHTML:e=>({"data-citation-id":e.citationId})},sourceId:{default:null,parseHTML:e=>e.getAttribute("data-citation-source-id"),renderHTML:e=>({"data-citation-source-id":e.sourceId})},locator:{default:"",parseHTML:e=>e.getAttribute("data-citation-locator")??"",renderHTML:e=>({"data-citation-locator":e.locator})},label:{default:"page",parseHTML:e=>e.getAttribute("data-citation-label")??"page",renderHTML:e=>({"data-citation-label":e.label})},mode:{default:"normal",parseHTML:e=>e.getAttribute("data-citation-mode")??"normal",renderHTML:e=>({"data-citation-mode":e.mode})},prefix:{default:""},suffix:{default:""}}},parseHTML(){return[{tag:'span[data-node-type="citation"]'}]},renderHTML({HTMLAttributes:e}){return["span",Fe(e,{"data-node-type":"citation",class:"docs-citation"}),""]},addNodeView(){return e=>{const t=e.editor,n=e.node??e,i=document.createElement("span");i.className="docs-citation",i.setAttribute("data-node-type","citation");const r=()=>{const c=Ui(t),u=n.attrs.citationId,f=c&&u?c.renderCluster(u):"";f?(i.innerHTML=f,i.classList.remove("docs-citation--missing")):(i.textContent="[?]",i.classList.add("docs-citation--missing")),i.setAttribute("data-citation-id",String(n.attrs.citationId??"")),i.setAttribute("data-citation-source-id",String(n.attrs.sourceId??""))};r();let a=null,o=null;const l=()=>{const c=Ui(t);c!==o&&(a==null||a(),o=c,a=c?c.onChange(r):null,r())};return l(),t.on("create",l),t.on("citationEngineReady",l),{dom:i,update(c){var u;if(((u=c==null?void 0:c.type)==null?void 0:u.name)!=="citation")return!1;try{Object.assign(n.attrs,c.attrs),r()}catch{}return!0},destroy(){t.off("create",l),t.off("citationEngineReady",l),a==null||a()}}}}});function Xd(e,t,n){const i=gh(t,n);return i.type==="footnote"&&!e.schema.nodes.footnote?!1:e.chain().focus().insertContent({type:i.type,attrs:i.attrs}).run()}Ee.definePlugin({id:"citation",tiptapExtensions:[A5,T5,E5],toolbar:[{id:"insert-citation",label:"Citation",action:"insertCitation",iconComponent:"Quote"}],slashCommands:[{name:"Citation",command:"insertCitation"},{name:"Bibliography",command:"insertBibliography"}],commands:{insertCitation:(e,...t)=>{var o;const n=Ui(e);if(!n)return console.warn("[citation] no citation engine — inject the CitationPort to enable citations"),!1;const i=t[0];if(i!=null&&i.sourceId)return Xd(e,n,{sourceId:i.sourceId,locator:i.locator});const r=e.storage.editorContext,a=(o=r==null?void 0:r.citation)==null?void 0:o.onSourceRequest;return a?(a().then(l=>{l&&Xd(e,n,{sourceId:l})}),!0):!1},insertBibliography:e=>{let t=!1;return e.state.doc.descendants(n=>(n.type.name==="bibliography"&&(t=!0),!t)),t?!1:e.chain().focus().insertContent({type:"bibliography"}).run()},setCitationStyle:(e,...t)=>{const n=Ui(e),i=t[0];return!n||!i?!1:(n.setStyle(i),!0)}},hooks:{onInit(e){const t=e.storage.editorContext,n=t==null?void 0:t.citation;if(!n)return;const i=typeof n.sources=="function"?n.sources():n.sources,r=new C5({sources:i,style:n.style});e.storage.citationEngine.engine=r,e.emit("citationEngineReady",{editor:e}),vh(e)},onDestroy(e){e.storage.citationEngine.engine=null}}});function N5(e){const t=e.storage.markdown;if(!t||typeof t!="object")return;const n=t.parser;if(!(!n||typeof n!="object"||!("parse"in n)))return n}function xh(e,t,n){const i=N5(e);if(!i)return null;let r;try{r=i.parse(t,{inline:n.inline})}catch{return null}if(typeof r!="string")return null;const a=Pi(r,e.schema,{slice:!0,parseOptions:{preserveWhitespace:"full"}});if(a instanceof J)return a;const o=a;return o&&typeof o.forEach=="function"&&typeof o.size=="number"?o:J.from(a)}function O5(e,t,n){const i=e.steps.length-1;if(i<t)return;const r=e.steps[i];if(!(r instanceof Ze||r instanceof Ye))return;const a=e.mapping.maps[i];let o=0;a.forEach((l,c,u,f)=>{o===0&&(o=f)}),e.setSelection(ke.near(e.doc.resolve(o),n))}function Jd(e,t,n,i,r){const a=xh(e,r,{inline:!1});if(!a){t.dispatch(t.state.tr.insertText(r,n,i));return}const o=t.state.tr;let l=n,c=i;if(l===c){let f=!0;if(a.forEach(m=>{m.isBlock||(f=!1)}),f){const p=o.doc.resolve(l).parent;p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}}let u=!0;if(a.forEach(f=>{(!f.isText||f.marks.length>0)&&(u=!1)}),u){let f="";a.forEach(m=>{m.isText&&(f+=m.text??"")}),o.insertText(f,l,c)}else o.replaceWith(l,c,a);O5(o,0,-1),t.dispatch(o)}var at=new rt("docflow-ai"),Zd=1500;function Ml(e){var t;return(t=e.storage.editorContext)==null?void 0:t.aiStream}function Qd(e,t,n){return{before:e.doc.textBetween(Math.max(0,t-Zd),t,`
15236
15236
  `," "),after:e.doc.textBetween(n,Math.min(e.doc.content.size,n+Zd),`
15237
- `," ")}}function Yd(e,t,n){const i=Ml(e);i&&(async()=>{const r=a=>{n.signal.aborted||e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(at,a))};try{for await(const a of i(t,n.signal)){if(n.signal.aborted||e.isDestroyed)return;r({type:"chunk",text:a})}r({type:"done"})}catch(a){r({type:"error",message:a instanceof Error?a.message:"AI request failed"})}})()}function ef(e){var n;const t=e.storage.ai;(n=t.abort)==null||n.abort(),t.abort=null}var O5=Ke.create({name:"ai",addStorage(){return{preview:null,abort:null}},addCommands(){return{aiTransform:e=>({editor:t,state:n,dispatch:i})=>{if(at.getState(n))return!1;if(!Ml(t))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const{from:r,to:a,empty:o}=n.selection;if(o)return!1;const l=n.doc.textBetween(r,a,`
15238
- `," ");if(!l.trim())return!1;const c=new AbortController;t.storage.ai.abort=c,i==null||i(n.tr.setMeta(at,{type:"start",mode:"transform",status:"streaming",from:r,to:a,originalText:l,action:e.action}));const u={action:e.action,selection:l,context:Qd(n,r,a),...e.prompt?{prompt:e.prompt}:{}};return Yd(t,u,c),!0},aiGenerate:()=>({editor:e,state:t,dispatch:n})=>{if(at.getState(t))return!1;if(!Ml(e))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const i=t.selection.to;return n==null||n(t.tr.setMeta(at,{type:"start",mode:"generate",status:"prompt",from:i,to:i,originalText:"",action:"generate"})),!0},aiPromptSubmit:e=>({editor:t,state:n,dispatch:i})=>{var c;const r=at.getState(n);if(!r||r.mode!=="generate"||r.status!=="prompt")return!1;const a=(c=e.prompt)==null?void 0:c.trim();if(!a)return!1;const o=new AbortController;t.storage.ai.abort=o,i==null||i(n.tr.setMeta(at,{type:"start",mode:"generate",status:"streaming",from:r.from,to:r.to,originalText:"",action:"generate"}));const l={action:"generate",prompt:a,context:Qd(n,r.from,r.to)};return Yd(t,l,o),t.commands.focus(),!0},aiAccept:()=>({editor:e,state:t,dispatch:n})=>{const i=at.getState(t);if(!i||i.status==="prompt")return!1;if(ef(e),!n)return!0;const r=t.tr;if(i.text.trim()){const a=vh(e,i.text,{inline:!0});a?r.replaceWith(i.from,i.to,a):r.replaceWith(i.from,i.to,t.schema.text(i.text))}return r.setMeta(at,{type:"clear"}),n(r),!0},aiReject:()=>({editor:e,state:t,dispatch:n})=>at.getState(t)?(ef(e),n==null||n(t.tr.setMeta(at,{type:"clear"})),!0):!1}},addProseMirrorPlugins(){const e=this.editor;let t=null;function n(){if(t)return t;const r=document.createElement("span");r.className="docs-ai-prompt";const a=document.createElement("input");return a.type="text",a.className="docs-ai-prompt__input",a.placeholder="Ask AI to write… (Enter ⏎ · Esc cancel)",a.addEventListener("keydown",o=>{o.key==="Enter"?(o.preventDefault(),e.commands.aiPromptSubmit({prompt:a.value})):o.key==="Escape"&&(o.preventDefault(),e.commands.aiReject())}),a.addEventListener("blur",()=>{const o=at.getState(e.state);(o==null?void 0:o.status)==="prompt"&&e.commands.aiReject()}),r.appendChild(a),setTimeout(()=>a.focus(),0),t={dom:r,stopEvent:o=>o.target instanceof Node&&r.contains(o.target)},t}function i(r){const a=document.createElement("span");let o=null;if(r.status==="error")a.className="docs-ai-ghost docs-ai-ghost--error",a.textContent=` ${r.error??"AI error"} — press Esc`;else{a.className="docs-ai-ghost";const l=document.createElement("span");if(!r.text&&r.status==="streaming"?(l.textContent="AI writing…",l.className="docs-ai-ghost-placeholder"):l.textContent=r.text+(r.status==="streaming"?"▌":""),a.appendChild(l),r.status==="done"){o=document.createElement("span"),o.className="docs-ai-ghost-actions";const c=document.createElement("button");c.type="button",c.className="docs-ai-ghost-btn docs-ai-ghost-btn--accept",c.textContent="✓ Accept",c.title="Accept (Enter)",c.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiAccept()});const u=document.createElement("button");u.type="button",u.className="docs-ai-ghost-btn docs-ai-ghost-btn--reject",u.textContent="✗ Reject",u.title="Reject (Esc)",u.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiReject()}),o.appendChild(c),o.appendChild(u),a.appendChild(o)}}return{dom:a,stopEvent:l=>o!==null&&l.target instanceof Node&&o.contains(l.target)}}return[new ct({key:at,state:{init:()=>null,apply(r,a){const o=r.getMeta(at);if(o)switch(o.type){case"start":return{mode:o.mode,status:o.status,from:o.from,to:o.to,originalText:o.originalText,text:"",action:o.action};case"chunk":return a&&{...a,text:a.text+o.text};case"done":return a&&{...a,status:"done"};case"error":return a&&{...a,status:"error",error:o.message};case"clear":return null}if(!a)return a;if(a.status==="prompt"&&r.selectionSet)return null;if(r.docChanged){if(a.mode==="generate"){const u=r.mapping.map(a.from,1);return{...a,from:u,to:u}}const l=r.mapping.map(a.from,-1),c=r.mapping.map(a.to,1);return c<=l||r.doc.textBetween(l,c,`
15239
- `," ")!==a.originalText?null:{...a,from:l,to:c}}return a}},props:{decorations(r){const a=at.getState(r);if(!a)return t=null,je.empty;const o=[];if(a.mode==="transform"&&a.to>a.from&&o.push(ft.inline(a.from,a.to,{class:"docs-ai-selection"})),a.status==="prompt"){const l=n();o.push(ft.widget(a.to,l.dom,{key:"docs-ai-prompt",side:1,stopEvent:l.stopEvent}))}else{t=null;const l=i(a);o.push(ft.widget(a.to,l.dom,{key:`docs-ai-ghost-${a.status}-${a.text.length}-${(a.error??"").length}`,side:1,stopEvent:l.stopEvent}))}return je.create(r.doc,o)},handleKeyDown(r,a){const o=at.getState(e.state);return o?a.key==="Escape"?(e.commands.aiReject(),!0):o.status==="prompt"?!1:(a.key==="Enter"||a.key==="Tab")&&o.status!=="error"?(a.preventDefault(),e.commands.aiAccept(),!0):!1:!1}}})]},onTransaction(){const e=this.editor.storage.ai;e.preview=at.getState(this.editor.state)??null},onDestroy(){var t;const e=this.editor.storage.ai;(t=e.abort)==null||t.abort(),e.abort=null,e.preview=null}});Ee.definePlugin({id:"ai",tiptapExtensions:[O5,XE.configure({html:!0,linkify:!0,breaks:!1})],slashCommands:[{name:"AI",description:"Generate text with AI",command:"aiGenerate"}]});Et.create({name:"comment",inclusive:!0,addAttributes(){return{threadId:{default:null,parseHTML:e=>e.getAttribute("data-comment-thread"),renderHTML:e=>e.threadId?{"data-comment-thread":e.threadId,class:"docs-comment"}:{}},pos:{default:null,renderHTML:()=>({})}}},parseHTML(){return[{tag:"span[data-comment-thread]"}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}});function Dl(){return new Date().toISOString().slice(0,10)}function tf(e){if(!e)return"Pick a date";const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?"Pick a date":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function M5(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}var si=["To Do","In Progress","Review","Approved"];function nf(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}var D5=Ae.create({name:"dateChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{date:{default:Dl(),parseHTML:e=>e.getAttribute("data-date")??Dl(),renderHTML:e=>({"data-date":e.date??""})}}},parseHTML(){return[{tag:'span[data-node-type="date-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"date-chip",class:"docs-chip docs-chip--date"}),tf(e.attrs.date)]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--date",r.setAttribute("data-node-type","date-chip"),r.setAttribute("contenteditable","false");const a=()=>{r.querySelector("input")||(r.textContent=tf(t.attrs.date),r.setAttribute("data-date",t.attrs.date))};return a(),r.addEventListener("click",o=>{if(o.preventDefault(),o.stopPropagation(),r.querySelector("input"))return;const l=document.createElement("input");l.type="date",l.value=t.attrs.date,l.className="docs-chip-date-input",r.replaceChildren(l),l.focus();const c=()=>{const u=l.value,f=n();typeof f=="number"&&i.dispatch(i.state.tr.setNodeMarkup(f,void 0,{date:u})),setTimeout(a,30)};l.addEventListener("change",c),l.addEventListener("blur",()=>setTimeout(a,30))}),{dom:r,update(o){return o.type.name!=="dateChip"?!1:(t=o,a(),!0)}}}}}),z5=Ae.create({name:"peopleChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{userId:{default:"",parseHTML:e=>e.getAttribute("data-user-id")??"",renderHTML:e=>e.userId?{"data-user-id":e.userId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="people-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"people-chip",class:"docs-chip docs-chip--people"}),`@${e.attrs.name||"user"}`]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--people",n.setAttribute("data-node-type","people-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"user";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-avatar",a.textContent=M5(r),n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent="@"+r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="peopleChip"?!1:(t=r,i(),!0)}}}}}),I5=Ae.create({name:"fileChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{fileId:{default:"",parseHTML:e=>e.getAttribute("data-file-id")??"",renderHTML:e=>e.fileId?{"data-file-id":e.fileId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="file-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"file-chip",class:"docs-chip docs-chip--file"}),e.attrs.name||"file"]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--file",n.setAttribute("data-node-type","file-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"Untitled file";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="🗎",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="fileChip"?!1:(t=r,i(),!0)}}}}}),R5=Ae.create({name:"dropdownChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{options:{default:si,parseHTML:e=>{const t=e.getAttribute("data-options")??"",n=t?t.split("|"):[];return n.length?n:si},renderHTML:e=>({"data-options":(e.options??[]).join("|")})},selected:{default:si[0],parseHTML:e=>e.getAttribute("data-selected")??si[0],renderHTML:e=>({"data-selected":e.selected??""})}}},parseHTML(){return[{tag:'span[data-node-type="dropdown-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"dropdown-chip",class:"docs-chip docs-chip--dropdown"}),e.attrs.selected||""]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--dropdown",r.setAttribute("data-node-type","dropdown-chip"),r.setAttribute("contenteditable","false");const a=()=>{const o=t.attrs.options??si,l=t.attrs.selected??o[0]??"";r.innerHTML="";const c=document.createElement("select");c.className="docs-chip-select",c.addEventListener("mousedown",u=>u.stopPropagation());for(const u of o){const f=document.createElement("option");f.value=u,f.textContent=u,u===l&&(f.selected=!0),c.appendChild(f)}c.addEventListener("change",()=>{const u=n();typeof u=="number"&&i.dispatch(i.state.tr.setNodeMarkup(u,void 0,{...t.attrs,selected:c.value}))}),r.appendChild(c)};return a(),{dom:r,update(o){return o.type.name!=="dropdownChip"?!1:(t=o,a(),!0)}}}}}),L5=Ae.create({name:"locationChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{label:{default:"",parseHTML:e=>e.getAttribute("data-label")??"",renderHTML:e=>({"data-label":e.label??""})},lat:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lat");return t===null?null:Number(t)},renderHTML:e=>e.lat!=null?{"data-lat":e.lat}:{}},lng:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lng");return t===null?null:Number(t)},renderHTML:e=>e.lng!=null?{"data-lng":e.lng}:{}}}},parseHTML(){return[{tag:'span[data-node-type="location-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"location-chip",class:"docs-chip docs-chip--location"}),e.attrs.label||""]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--location",n.setAttribute("data-node-type","location-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.label||"Add location";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="📍",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="locationChip"?!1:(t=r,i(),!0)}}}}});Ee.definePlugin({id:"smart-elements",tiptapExtensions:[D5,z5,I5,R5,L5],slashCommands:[{name:"Date",command:"insertDateChip"},{name:"People",command:"insertPeopleChip"},{name:"File",command:"insertFileChip"},{name:"Dropdown",command:"insertDropdownChip"},{name:"Location",command:"insertLocationChip"}],commands:{insertDateChip:e=>e.chain().focus().insertContent({type:"dateChip",attrs:{date:Dl()}}).run(),insertPeopleChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter user name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"peopleChip",attrs:{userId:nf(n),name:n}}).run()},insertFileChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter file/document name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"fileChip",attrs:{fileId:nf(n),name:n}}).run()},insertDropdownChip:e=>e.chain().focus().insertContent({type:"dropdownChip",attrs:{options:si,selected:si[0]}}).run(),insertLocationChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter location name:","")??"":"";return t.trim()?e.chain().focus().insertContent({type:"locationChip",attrs:{label:t.trim()}}).run():!1}}});var zl=new rt("docflow/table-page-split"),xh="head",yh=16;function B5(e,t){var r,a,o,l,c;const n=(r=t==null?void 0:t.storage)==null?void 0:r.PaginationPlus;if(n&&typeof n.pageHeight=="number"){const u=((o=(a=n.headerHeight)==null?void 0:a.get)==null?void 0:o.call(a,1))??0,f=((c=(l=n.footerHeight)==null?void 0:l.get)==null?void 0:c.call(l,1))??0,m=n.pageHeight-(n.marginTop??0)-(n.marginBottom??0)-(n.contentMarginTop??0)-(n.contentMarginBottom??0)-u-f;if(Number.isFinite(m)&&m>0)return m}const i=e.dom.style.getPropertyValue("--rm-max-content-child-height");if(i){const u=parseFloat(i);if(Number.isFinite(u)&&u>0)return u}return null}function P5(e){return!e||!(e instanceof HTMLElement)?0:e.getBoundingClientRect().height}function F5(e,t,n){try{const r=e.coordsAtPos(t+1).top,a=e.dom.querySelector("[data-rm-pagination]");if(!a)return n;const o=a.querySelectorAll(".rm-page-break .breaker");for(let l=0;l<o.length;l++){const c=o[l];if(!(c instanceof HTMLElement))continue;const u=c.getBoundingClientRect().top;if(u>r)return Math.max(1,Math.floor(u-r))}return n}catch{return null}}function V5(e,t){const n=e.childCount,i=t.querySelectorAll(":scope > tbody > tr");if(i.length!==n)return null;const r=[];let a=0;for(let o=0;o<i.length;o++){const l=P5(i[o]);a+=l,r.push({rowIndex:o,heightPx:l,cumulativePx:a})}return r}function kh(e,t){if(e.length<2||e[e.length-1].cumulativePx<=t)return-1;let n=0,i=e.length-2,r=-1;for(;n<=i;){const a=n+i>>1;e[a].cumulativePx<=t?(r=a,n=a+1):i=a-1}return r}function U5(e,t){if(t<0||e.childCount===0)return 0;let n=0;return e.forEach((i,r,a)=>{a<=t&&(n=r+i.nodeSize)}),n}function wh(e,t){const n=[];let i=0;for(let r=t+1;r<e.length;r++)i+=e[r].heightPx,n.push({rowIndex:r,heightPx:e[r].heightPx,cumulativePx:i});return n}function _h(e,t,n,i,r,a,o){const c=kh(t,o===0?n:i);if(c<0)return[e];if(o>=yh)return[e];const u=U5(e,c),f=e.content,m=f.cut(0,u),p=f.cut(u),h={...e.attrs,tablePageSplit:xh},g={...e.attrs,tablePageSplit:null},b=a.create(h,m,e.marks),y=a.create(g,p,e.marks),v=e.childCount,x=b.childCount,k=y.childCount;if(x+k!==v)throw new Error(`[tablePageSplitPlugin] row-count invariant violated: expected ${v}, got ${x} + ${k} = ${x+k}`);const w=wh(t,c),S=_h(y,w,n,i,r,a,o+1);return S.length===1?[b,y]:[b,...S]}function H5(e,t,n){var o,l;let i=e,r=t,a=0;for(let c=0;c<yh;c++){const u=kh(i,r);if(u<0)return a===0?null:((o=i[i.length-1])==null?void 0:o.cumulativePx)??0;a++,i=wh(i,u),r=n}return((l=i[i.length-1])==null?void 0:l.cumulativePx)??0}function q5(e,t){var m;if(!e||e.isDestroyed)return;const n=e,i=n.state,{schema:r}=i,a=r.nodes.table;if(!a)return;const o=B5(n,t);if(o==null)return;const l=[];if(i.doc.descendants((p,h)=>{if(p.type!==a||p.attrs.tablePageSplit===xh)return!0;const g=n.nodeDOM(h);if(!(g instanceof HTMLElement))return!0;const b=V5(p,g);return b&&l.push({pos:h,node:p,measurements:b}),!0}),l.length===0)return;const c=[];let u=null;for(let p=0;p<l.length;p++){const{pos:h,node:g,measurements:b}=l[p],y=p===0?F5(n,h,o)??o:u??o,v=_h(g,b,y,o,r,a,0);v.length>1&&c.push({pos:h,node:g,chain:v});const x=H5(b,y,o);if(x===null){const k=((m=b[b.length-1])==null?void 0:m.cumulativePx)??0;u=Math.max(0,y-k)}else u=Math.max(0,o-x)}if(c.length===0)return;const f=i.tr;c.sort((p,h)=>h.pos-p.pos);for(const{pos:p,node:h,chain:g}of c)f.replaceWith(p,p+h.nodeSize,g);f.setMeta(zl,{splitAtRow:-1}),n.dispatch(f)}var j5=Ke.create({name:"tablePageSplit",addProseMirrorPlugins(){let e=null,t=!1;const i=this.editor??null;return[new ct({key:zl,view(r){return e=r,{destroy(){e=null}}},appendTransaction(r,a,o){return r.some(l=>l.getMeta("PAGE_COUNT_META_KEY")!==void 0)||r.some(l=>{const c=l.getMeta(zl);return c!==void 0&&c.splitAtRow!==void 0})||!e||e.isDestroyed||t||(t=!0,queueMicrotask(()=>{t=!1,!(!e||e.isDestroyed)&&q5(e,i)})),null}})]}});Ee.definePlugin({id:"tablePageSplit",tiptapExtensions:[j5]});var yt={open:!1,query:"",position:{top:0,left:0},commands:[],selectedIndex:0},$5=[];function Io(){$5.forEach(e=>e())}function Vs(){yt={...yt,open:!1,query:""},Io()}function Ma(e,t){const{selection:n}=e.state,i=n.head,r=e.coordsAtPos(i),a=G5(),o=t?a.filter(l=>l.name.toLowerCase().includes(t.toLowerCase())):a;yt={open:!0,query:t,position:{top:r.bottom+4,left:r.left},commands:o.map(l=>({...l,action:null})),selectedIndex:0},Io()}var Il=new Map;function W5(e,t){const n=Il.get(e)||[];Il.set(e,[...n,...t])}function G5(){const e=[];Il.forEach(n=>{e.push(...n)});const t=new Set;return e.filter(n=>t.has(n.name)?!1:(t.add(n.name),!0))}var K5=Ke.create({name:"slashMenu",addProseMirrorPlugins(){return[new ct({key:new rt("slashMenu"),props:{handleTextInput(e,t,n,i){if(i==="/"){const r=e.state.doc.resolve(t),a=r.parent.textContent.slice(0,r.parentOffset);if(a===""||a.endsWith(" "))return setTimeout(()=>Ma(e,""),10),!1}if(yt.open&&i.length===1&&/[a-zA-Z]/.test(i)){const r=yt.query+i;return Ma(e,r),!1}return!1},handleKeyDown(e,t){if(!yt.open)return!1;if(t.key==="ArrowDown")return t.preventDefault(),yt.selectedIndex=Math.min(yt.selectedIndex+1,yt.commands.length-1),Io(),!0;if(t.key==="ArrowUp")return t.preventDefault(),yt.selectedIndex=Math.max(yt.selectedIndex-1,0),Io(),!0;if(t.key==="Enter"){t.preventDefault();const n=yt.commands[yt.selectedIndex];if(n){const i=e.state.doc.resolve(e.state.selection.head),r=i.start(),a=r+i.parent.textContent.lastIndexOf("/");if(a>=r){const l=e.state.tr.delete(a,e.state.selection.head);e.dispatch(l)}const o=e._tiptapEditor;if(o){const l=o;typeof l[n.command]=="function"&&l[n.command]()}}return Vs(),!0}if(t.key==="Escape")return Vs(),!0;if(t.key==="Backspace")if(yt.query.length>0){const n=yt.query.slice(0,-1);return n?Ma(e,n):Ma(e,""),!1}else{const n=e.state.doc.resolve(e.state.selection.head),i=n.start(),r=n.parent.textContent.lastIndexOf("/");if(r>=0){const a=e.state.tr.delete(i+r,e.state.selection.head);e.dispatch(a)}return Vs(),!0}return!1}}})]}});Ee.definePlugin({id:"slash-menu",tiptapExtensions:[K5],hooks:{onInit(e){W5("default",[])}}});const Rl=/\[(\d{1,3})\]/g;function X5(e){return e.replace(Rl,"")}function J5(e,t,n){const i=[];let r=0;Rl.lastIndex=0;let a;for(;(a=Rl.exec(e))!==null;){const l=Number(a[1]),c=t.get(l),u=e.slice(r,a.index);if(u&&i.push(u),!c){r=a.index+a[0].length;continue}i.push(gh(n,{sourceId:c.sourceId})),r=a.index+a[0].length}const o=e.slice(r);return o&&i.push(o),i}const Z5={class:"ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},Q5={class:"flex items-start justify-between border-b border-slate-200 p-4 dark:border-white/5"},Y5={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},e6={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},t6=["aria-label"],n6={key:0,class:"flex flex-1 flex-col items-center justify-center p-6 text-center text-slate-400 dark:text-slate-500"},i6={class:"text-xs"},r6={class:"space-y-2 border-b border-slate-200 p-4 dark:border-white/5"},a6={class:"block font-mono text-[10px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},o6={class:"grid grid-cols-2 gap-2"},s6=["disabled","title","onClick"],l6={key:0,class:"flex h-full flex-col items-center justify-center p-4 text-center text-slate-400 dark:text-slate-500"},c6={class:"text-[10px]"},u6={class:"flex items-center gap-1 font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},d6={key:0,class:"animate-pulse text-cyan-500"},f6={key:0,class:"flex flex-wrap gap-1 pl-1"},p6={key:1,class:"flex gap-1.5"},m6=["onClick"],h6=["onClick"],b6={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},g6={key:0,class:"mb-2 space-y-1"},v6={class:"block font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},x6={class:"flex flex-wrap gap-1"},y6={key:0,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},k6=["title"],w6={class:"truncate"},_6=["disabled","placeholder","onKeydown"],S6={class:"flex justify-end"},C6=["disabled"],Sh=s.defineComponent({__name:"AISidebar",props:{editor:{},aiStream:{type:Function},aiDraft:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht();function a(){return n.editor?s.toRaw(n.editor):null}const o=s.ref([]),l=s.ref(""),c=s.ref(!1),u=s.ref(null),f=s.ref(null),m=s.ref(null);let p=null;const h=s.computed(()=>{var R,N,L;return n.aiStream?n.aiStream:(L=(N=(R=a())==null?void 0:R.storage)==null?void 0:N.editorContext)==null?void 0:L.aiStream}),g=s.computed(()=>{var R,N,L;return n.aiDraft?n.aiDraft:(L=(N=(R=a())==null?void 0:R.storage)==null?void 0:N.editorContext)==null?void 0:L.aiDraft}),b=s.ref(!1),y=s.ref(0);function v(){y.value++}s.watch(()=>n.editor,(R,N)=>{N&&s.toRaw(N).off("transaction",v),R&&s.toRaw(R).on("transaction",v)},{immediate:!0});const x=s.computed(()=>{var D;y.value;const R=(D=a())==null?void 0:D.state;if(!R||R.selection.empty)return null;const{from:N,to:L}=R.selection;return{from:N,to:L,text:R.doc.textBetween(N,L,`
15237
+ `," ")}}function Yd(e,t,n){const i=Ml(e);i&&(async()=>{const r=a=>{n.signal.aborted||e.isDestroyed||e.view.dispatch(e.state.tr.setMeta(at,a))};try{for await(const a of i(t,n.signal)){if(n.signal.aborted||e.isDestroyed)return;r({type:"chunk",text:a})}r({type:"done"})}catch(a){r({type:"error",message:a instanceof Error?a.message:"AI request failed"})}})()}function ef(e){var n;const t=e.storage.ai;(n=t.abort)==null||n.abort(),t.abort=null}var M5=Ke.create({name:"ai",addStorage(){return{preview:null,abort:null}},addCommands(){return{aiTransform:e=>({editor:t,state:n,dispatch:i})=>{if(at.getState(n))return!1;if(!Ml(t))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const{from:r,to:a,empty:o}=n.selection;if(o)return!1;const l=n.doc.textBetween(r,a,`
15238
+ `," ");if(!l.trim())return!1;const c=new AbortController;t.storage.ai.abort=c,i==null||i(n.tr.setMeta(at,{type:"start",mode:"transform",status:"streaming",from:r,to:a,originalText:l,action:e.action}));const u={action:e.action,selection:l,context:Qd(n,r,a),...e.prompt?{prompt:e.prompt}:{}};return Yd(t,u,c),!0},aiGenerate:()=>({editor:e,state:t,dispatch:n})=>{if(at.getState(t))return!1;if(!Ml(e))return console.warn("[ai] no aiStream port injected — AI actions are inert"),!1;const i=t.selection.to;return n==null||n(t.tr.setMeta(at,{type:"start",mode:"generate",status:"prompt",from:i,to:i,originalText:"",action:"generate"})),!0},aiPromptSubmit:e=>({editor:t,state:n,dispatch:i})=>{var c;const r=at.getState(n);if(!r||r.mode!=="generate"||r.status!=="prompt")return!1;const a=(c=e.prompt)==null?void 0:c.trim();if(!a)return!1;const o=new AbortController;t.storage.ai.abort=o,i==null||i(n.tr.setMeta(at,{type:"start",mode:"generate",status:"streaming",from:r.from,to:r.to,originalText:"",action:"generate"}));const l={action:"generate",prompt:a,context:Qd(n,r.from,r.to)};return Yd(t,l,o),t.commands.focus(),!0},aiAccept:()=>({editor:e,state:t,dispatch:n})=>{const i=at.getState(t);if(!i||i.status==="prompt")return!1;if(ef(e),!n)return!0;const r=t.tr;if(i.text.trim()){const a=xh(e,i.text,{inline:!0});a?r.replaceWith(i.from,i.to,a):r.replaceWith(i.from,i.to,t.schema.text(i.text))}return r.setMeta(at,{type:"clear"}),n(r),!0},aiReject:()=>({editor:e,state:t,dispatch:n})=>at.getState(t)?(ef(e),n==null||n(t.tr.setMeta(at,{type:"clear"})),!0):!1}},addProseMirrorPlugins(){const e=this.editor;let t=null;function n(){if(t)return t;const r=document.createElement("span");r.className="docs-ai-prompt";const a=document.createElement("input");return a.type="text",a.className="docs-ai-prompt__input",a.placeholder="Ask AI to write… (Enter ⏎ · Esc cancel)",a.addEventListener("keydown",o=>{o.key==="Enter"?(o.preventDefault(),e.commands.aiPromptSubmit({prompt:a.value})):o.key==="Escape"&&(o.preventDefault(),e.commands.aiReject())}),a.addEventListener("blur",()=>{const o=at.getState(e.state);(o==null?void 0:o.status)==="prompt"&&e.commands.aiReject()}),r.appendChild(a),setTimeout(()=>a.focus(),0),t={dom:r,stopEvent:o=>o.target instanceof Node&&r.contains(o.target)},t}function i(r){const a=document.createElement("span");let o=null;if(r.status==="error")a.className="docs-ai-ghost docs-ai-ghost--error",a.textContent=` ${r.error??"AI error"} — press Esc`;else{a.className="docs-ai-ghost";const l=document.createElement("span");if(!r.text&&r.status==="streaming"?(l.textContent="AI writing…",l.className="docs-ai-ghost-placeholder"):l.textContent=r.text+(r.status==="streaming"?"▌":""),a.appendChild(l),r.status==="done"){o=document.createElement("span"),o.className="docs-ai-ghost-actions";const c=document.createElement("button");c.type="button",c.className="docs-ai-ghost-btn docs-ai-ghost-btn--accept",c.textContent="✓ Accept",c.title="Accept (Enter)",c.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiAccept()});const u=document.createElement("button");u.type="button",u.className="docs-ai-ghost-btn docs-ai-ghost-btn--reject",u.textContent="✗ Reject",u.title="Reject (Esc)",u.addEventListener("mousedown",f=>{f.preventDefault(),e.commands.aiReject()}),o.appendChild(c),o.appendChild(u),a.appendChild(o)}}return{dom:a,stopEvent:l=>o!==null&&l.target instanceof Node&&o.contains(l.target)}}return[new ct({key:at,state:{init:()=>null,apply(r,a){const o=r.getMeta(at);if(o)switch(o.type){case"start":return{mode:o.mode,status:o.status,from:o.from,to:o.to,originalText:o.originalText,text:"",action:o.action};case"chunk":return a&&{...a,text:a.text+o.text};case"done":return a&&{...a,status:"done"};case"error":return a&&{...a,status:"error",error:o.message};case"clear":return null}if(!a)return a;if(a.status==="prompt"&&r.selectionSet)return null;if(r.docChanged){if(a.mode==="generate"){const u=r.mapping.map(a.from,1);return{...a,from:u,to:u}}const l=r.mapping.map(a.from,-1),c=r.mapping.map(a.to,1);return c<=l||r.doc.textBetween(l,c,`
15239
+ `," ")!==a.originalText?null:{...a,from:l,to:c}}return a}},props:{decorations(r){const a=at.getState(r);if(!a)return t=null,je.empty;const o=[];if(a.mode==="transform"&&a.to>a.from&&o.push(ft.inline(a.from,a.to,{class:"docs-ai-selection"})),a.status==="prompt"){const l=n();o.push(ft.widget(a.to,l.dom,{key:"docs-ai-prompt",side:1,stopEvent:l.stopEvent}))}else{t=null;const l=i(a);o.push(ft.widget(a.to,l.dom,{key:`docs-ai-ghost-${a.status}-${a.text.length}-${(a.error??"").length}`,side:1,stopEvent:l.stopEvent}))}return je.create(r.doc,o)},handleKeyDown(r,a){const o=at.getState(e.state);return o?a.key==="Escape"?(e.commands.aiReject(),!0):o.status==="prompt"?!1:(a.key==="Enter"||a.key==="Tab")&&o.status!=="error"?(a.preventDefault(),e.commands.aiAccept(),!0):!1:!1}}})]},onTransaction(){const e=this.editor.storage.ai;e.preview=at.getState(this.editor.state)??null},onDestroy(){var t;const e=this.editor.storage.ai;(t=e.abort)==null||t.abort(),e.abort=null,e.preview=null}});Ee.definePlugin({id:"ai",tiptapExtensions:[M5,JE.configure({html:!0,linkify:!0,breaks:!1})],slashCommands:[{name:"AI",description:"Generate text with AI",command:"aiGenerate"}]});Et.create({name:"comment",inclusive:!0,addAttributes(){return{threadId:{default:null,parseHTML:e=>e.getAttribute("data-comment-thread"),renderHTML:e=>e.threadId?{"data-comment-thread":e.threadId,class:"docs-comment"}:{}},pos:{default:null,renderHTML:()=>({})}}},parseHTML(){return[{tag:"span[data-comment-thread]"}]},renderHTML({HTMLAttributes:e}){return["span",e,0]}});function Dl(){return new Date().toISOString().slice(0,10)}function tf(e){if(!e)return"Pick a date";const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?"Pick a date":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function D5(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}var si=["To Do","In Progress","Review","Approved"];function nf(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}var z5=Ae.create({name:"dateChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{date:{default:Dl(),parseHTML:e=>e.getAttribute("data-date")??Dl(),renderHTML:e=>({"data-date":e.date??""})}}},parseHTML(){return[{tag:'span[data-node-type="date-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"date-chip",class:"docs-chip docs-chip--date"}),tf(e.attrs.date)]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--date",r.setAttribute("data-node-type","date-chip"),r.setAttribute("contenteditable","false");const a=()=>{r.querySelector("input")||(r.textContent=tf(t.attrs.date),r.setAttribute("data-date",t.attrs.date))};return a(),r.addEventListener("click",o=>{if(o.preventDefault(),o.stopPropagation(),r.querySelector("input"))return;const l=document.createElement("input");l.type="date",l.value=t.attrs.date,l.className="docs-chip-date-input",r.replaceChildren(l),l.focus();const c=()=>{const u=l.value,f=n();typeof f=="number"&&i.dispatch(i.state.tr.setNodeMarkup(f,void 0,{date:u})),setTimeout(a,30)};l.addEventListener("change",c),l.addEventListener("blur",()=>setTimeout(a,30))}),{dom:r,update(o){return o.type.name!=="dateChip"?!1:(t=o,a(),!0)}}}}}),I5=Ae.create({name:"peopleChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{userId:{default:"",parseHTML:e=>e.getAttribute("data-user-id")??"",renderHTML:e=>e.userId?{"data-user-id":e.userId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="people-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"people-chip",class:"docs-chip docs-chip--people"}),`@${e.attrs.name||"user"}`]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--people",n.setAttribute("data-node-type","people-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"user";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-avatar",a.textContent=D5(r),n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent="@"+r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="peopleChip"?!1:(t=r,i(),!0)}}}}}),R5=Ae.create({name:"fileChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{fileId:{default:"",parseHTML:e=>e.getAttribute("data-file-id")??"",renderHTML:e=>e.fileId?{"data-file-id":e.fileId}:{}},name:{default:"",parseHTML:e=>e.getAttribute("data-name")??"",renderHTML:e=>({"data-name":e.name??""})}}},parseHTML(){return[{tag:'span[data-node-type="file-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"file-chip",class:"docs-chip docs-chip--file"}),e.attrs.name||"file"]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--file",n.setAttribute("data-node-type","file-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.name||"Untitled file";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="🗎",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="fileChip"?!1:(t=r,i(),!0)}}}}}),L5=Ae.create({name:"dropdownChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{options:{default:si,parseHTML:e=>{const t=e.getAttribute("data-options")??"",n=t?t.split("|"):[];return n.length?n:si},renderHTML:e=>({"data-options":(e.options??[]).join("|")})},selected:{default:si[0],parseHTML:e=>e.getAttribute("data-selected")??si[0],renderHTML:e=>({"data-selected":e.selected??""})}}},parseHTML(){return[{tag:'span[data-node-type="dropdown-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"dropdown-chip",class:"docs-chip docs-chip--dropdown"}),e.attrs.selected||""]},addNodeView(){return e=>{let t=e.node;const n=e.getPos,i=e.view,r=document.createElement("span");r.className="docs-chip docs-chip--dropdown",r.setAttribute("data-node-type","dropdown-chip"),r.setAttribute("contenteditable","false");const a=()=>{const o=t.attrs.options??si,l=t.attrs.selected??o[0]??"";r.innerHTML="";const c=document.createElement("select");c.className="docs-chip-select",c.addEventListener("mousedown",u=>u.stopPropagation());for(const u of o){const f=document.createElement("option");f.value=u,f.textContent=u,u===l&&(f.selected=!0),c.appendChild(f)}c.addEventListener("change",()=>{const u=n();typeof u=="number"&&i.dispatch(i.state.tr.setNodeMarkup(u,void 0,{...t.attrs,selected:c.value}))}),r.appendChild(c)};return a(),{dom:r,update(o){return o.type.name!=="dropdownChip"?!1:(t=o,a(),!0)}}}}}),B5=Ae.create({name:"locationChip",group:"inline",inline:!0,selectable:!0,draggable:!1,atom:!0,addAttributes(){return{label:{default:"",parseHTML:e=>e.getAttribute("data-label")??"",renderHTML:e=>({"data-label":e.label??""})},lat:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lat");return t===null?null:Number(t)},renderHTML:e=>e.lat!=null?{"data-lat":e.lat}:{}},lng:{default:null,parseHTML:e=>{const t=e.getAttribute("data-lng");return t===null?null:Number(t)},renderHTML:e=>e.lng!=null?{"data-lng":e.lng}:{}}}},parseHTML(){return[{tag:'span[data-node-type="location-chip"]'}]},renderHTML({node:e,HTMLAttributes:t}){return["span",Fe(t,{"data-node-type":"location-chip",class:"docs-chip docs-chip--location"}),e.attrs.label||""]},addNodeView(){return e=>{let t=e.node;const n=document.createElement("span");n.className="docs-chip docs-chip--location",n.setAttribute("data-node-type","location-chip"),n.setAttribute("contenteditable","false");const i=()=>{const r=t.attrs.label||"Add location";n.innerHTML="";const a=document.createElement("span");a.className="docs-chip-icon",a.textContent="📍",n.appendChild(a);const o=document.createElement("span");o.className="docs-chip-label",o.textContent=r,n.appendChild(o)};return i(),{dom:n,update(r){return r.type.name!=="locationChip"?!1:(t=r,i(),!0)}}}}});Ee.definePlugin({id:"smart-elements",tiptapExtensions:[z5,I5,R5,L5,B5],slashCommands:[{name:"Date",command:"insertDateChip"},{name:"People",command:"insertPeopleChip"},{name:"File",command:"insertFileChip"},{name:"Dropdown",command:"insertDropdownChip"},{name:"Location",command:"insertLocationChip"}],commands:{insertDateChip:e=>e.chain().focus().insertContent({type:"dateChip",attrs:{date:Dl()}}).run(),insertPeopleChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter user name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"peopleChip",attrs:{userId:nf(n),name:n}}).run()},insertFileChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter file/document name:","")??"":"";if(!t.trim())return!1;const n=t.trim();return e.chain().focus().insertContent({type:"fileChip",attrs:{fileId:nf(n),name:n}}).run()},insertDropdownChip:e=>e.chain().focus().insertContent({type:"dropdownChip",attrs:{options:si,selected:si[0]}}).run(),insertLocationChip:e=>{const t=typeof window<"u"&&typeof window.prompt=="function"?window.prompt("Enter location name:","")??"":"";return t.trim()?e.chain().focus().insertContent({type:"locationChip",attrs:{label:t.trim()}}).run():!1}}});var zl=new rt("docflow/table-page-split"),yh="head",kh=16;function P5(e,t){var r,a,o,l,c;const n=(r=t==null?void 0:t.storage)==null?void 0:r.PaginationPlus;if(n&&typeof n.pageHeight=="number"){const u=((o=(a=n.headerHeight)==null?void 0:a.get)==null?void 0:o.call(a,1))??0,f=((c=(l=n.footerHeight)==null?void 0:l.get)==null?void 0:c.call(l,1))??0,m=n.pageHeight-(n.marginTop??0)-(n.marginBottom??0)-(n.contentMarginTop??0)-(n.contentMarginBottom??0)-u-f;if(Number.isFinite(m)&&m>0)return m}const i=e.dom.style.getPropertyValue("--rm-max-content-child-height");if(i){const u=parseFloat(i);if(Number.isFinite(u)&&u>0)return u}return null}function F5(e){return!e||!(e instanceof HTMLElement)?0:e.getBoundingClientRect().height}function V5(e,t,n){try{const r=e.coordsAtPos(t+1).top,a=e.dom.querySelector("[data-rm-pagination]");if(!a)return n;const o=a.querySelectorAll(".rm-page-break .breaker");for(let l=0;l<o.length;l++){const c=o[l];if(!(c instanceof HTMLElement))continue;const u=c.getBoundingClientRect().top;if(u>r)return Math.max(1,Math.floor(u-r))}return n}catch{return null}}function U5(e,t){const n=e.childCount,i=t.querySelectorAll(":scope > tbody > tr");if(i.length!==n)return null;const r=[];let a=0;for(let o=0;o<i.length;o++){const l=F5(i[o]);a+=l,r.push({rowIndex:o,heightPx:l,cumulativePx:a})}return r}function wh(e,t){if(e.length<2||e[e.length-1].cumulativePx<=t)return-1;let n=0,i=e.length-2,r=-1;for(;n<=i;){const a=n+i>>1;e[a].cumulativePx<=t?(r=a,n=a+1):i=a-1}return r}function H5(e,t){if(t<0||e.childCount===0)return 0;let n=0;return e.forEach((i,r,a)=>{a<=t&&(n=r+i.nodeSize)}),n}function _h(e,t){const n=[];let i=0;for(let r=t+1;r<e.length;r++)i+=e[r].heightPx,n.push({rowIndex:r,heightPx:e[r].heightPx,cumulativePx:i});return n}function Sh(e,t,n,i,r,a,o){const c=wh(t,o===0?n:i);if(c<0)return[e];if(o>=kh)return[e];const u=H5(e,c),f=e.content,m=f.cut(0,u),p=f.cut(u),h={...e.attrs,tablePageSplit:yh},g={...e.attrs,tablePageSplit:null},b=a.create(h,m,e.marks),y=a.create(g,p,e.marks),v=e.childCount,x=b.childCount,k=y.childCount;if(x+k!==v)throw new Error(`[tablePageSplitPlugin] row-count invariant violated: expected ${v}, got ${x} + ${k} = ${x+k}`);const w=_h(t,c),S=Sh(y,w,n,i,r,a,o+1);return S.length===1?[b,y]:[b,...S]}function q5(e,t,n){var o,l;let i=e,r=t,a=0;for(let c=0;c<kh;c++){const u=wh(i,r);if(u<0)return a===0?null:((o=i[i.length-1])==null?void 0:o.cumulativePx)??0;a++,i=_h(i,u),r=n}return((l=i[i.length-1])==null?void 0:l.cumulativePx)??0}function j5(e,t){var m;if(!e||e.isDestroyed)return;const n=e,i=n.state,{schema:r}=i,a=r.nodes.table;if(!a)return;const o=P5(n,t);if(o==null)return;const l=[];if(i.doc.descendants((p,h)=>{if(p.type!==a||p.attrs.tablePageSplit===yh)return!0;const g=n.nodeDOM(h);if(!(g instanceof HTMLElement))return!0;const b=U5(p,g);return b&&l.push({pos:h,node:p,measurements:b}),!0}),l.length===0)return;const c=[];let u=null;for(let p=0;p<l.length;p++){const{pos:h,node:g,measurements:b}=l[p],y=p===0?V5(n,h,o)??o:u??o,v=Sh(g,b,y,o,r,a,0);v.length>1&&c.push({pos:h,node:g,chain:v});const x=q5(b,y,o);if(x===null){const k=((m=b[b.length-1])==null?void 0:m.cumulativePx)??0;u=Math.max(0,y-k)}else u=Math.max(0,o-x)}if(c.length===0)return;const f=i.tr;c.sort((p,h)=>h.pos-p.pos);for(const{pos:p,node:h,chain:g}of c)f.replaceWith(p,p+h.nodeSize,g);f.setMeta(zl,{splitAtRow:-1}),n.dispatch(f)}var $5=Ke.create({name:"tablePageSplit",addProseMirrorPlugins(){let e=null,t=!1;const i=this.editor??null;return[new ct({key:zl,view(r){return e=r,{destroy(){e=null}}},appendTransaction(r,a,o){return r.some(l=>l.getMeta("PAGE_COUNT_META_KEY")!==void 0)||r.some(l=>{const c=l.getMeta(zl);return c!==void 0&&c.splitAtRow!==void 0})||!e||e.isDestroyed||t||(t=!0,queueMicrotask(()=>{t=!1,!(!e||e.isDestroyed)&&j5(e,i)})),null}})]}});Ee.definePlugin({id:"tablePageSplit",tiptapExtensions:[$5]});var yt={open:!1,query:"",position:{top:0,left:0},commands:[],selectedIndex:0},W5=[];function Io(){W5.forEach(e=>e())}function Vs(){yt={...yt,open:!1,query:""},Io()}function Ma(e,t){const{selection:n}=e.state,i=n.head,r=e.coordsAtPos(i),a=K5(),o=t?a.filter(l=>l.name.toLowerCase().includes(t.toLowerCase())):a;yt={open:!0,query:t,position:{top:r.bottom+4,left:r.left},commands:o.map(l=>({...l,action:null})),selectedIndex:0},Io()}var Il=new Map;function G5(e,t){const n=Il.get(e)||[];Il.set(e,[...n,...t])}function K5(){const e=[];Il.forEach(n=>{e.push(...n)});const t=new Set;return e.filter(n=>t.has(n.name)?!1:(t.add(n.name),!0))}var X5=Ke.create({name:"slashMenu",addProseMirrorPlugins(){return[new ct({key:new rt("slashMenu"),props:{handleTextInput(e,t,n,i){if(i==="/"){const r=e.state.doc.resolve(t),a=r.parent.textContent.slice(0,r.parentOffset);if(a===""||a.endsWith(" "))return setTimeout(()=>Ma(e,""),10),!1}if(yt.open&&i.length===1&&/[a-zA-Z]/.test(i)){const r=yt.query+i;return Ma(e,r),!1}return!1},handleKeyDown(e,t){if(!yt.open)return!1;if(t.key==="ArrowDown")return t.preventDefault(),yt.selectedIndex=Math.min(yt.selectedIndex+1,yt.commands.length-1),Io(),!0;if(t.key==="ArrowUp")return t.preventDefault(),yt.selectedIndex=Math.max(yt.selectedIndex-1,0),Io(),!0;if(t.key==="Enter"){t.preventDefault();const n=yt.commands[yt.selectedIndex];if(n){const i=e.state.doc.resolve(e.state.selection.head),r=i.start(),a=r+i.parent.textContent.lastIndexOf("/");if(a>=r){const l=e.state.tr.delete(a,e.state.selection.head);e.dispatch(l)}const o=e._tiptapEditor;if(o){const l=o;typeof l[n.command]=="function"&&l[n.command]()}}return Vs(),!0}if(t.key==="Escape")return Vs(),!0;if(t.key==="Backspace")if(yt.query.length>0){const n=yt.query.slice(0,-1);return n?Ma(e,n):Ma(e,""),!1}else{const n=e.state.doc.resolve(e.state.selection.head),i=n.start(),r=n.parent.textContent.lastIndexOf("/");if(r>=0){const a=e.state.tr.delete(i+r,e.state.selection.head);e.dispatch(a)}return Vs(),!0}return!1}}})]}});Ee.definePlugin({id:"slash-menu",tiptapExtensions:[X5],hooks:{onInit(e){G5("default",[])}}});const Rl=/\[(\d{1,3})\]/g;function J5(e){return e.replace(Rl,"")}function Z5(e,t,n){const i=[];let r=0;Rl.lastIndex=0;let a;for(;(a=Rl.exec(e))!==null;){const l=Number(a[1]),c=t.get(l),u=e.slice(r,a.index);if(u&&i.push(u),!c){r=a.index+a[0].length;continue}i.push(gh(n,{sourceId:c.sourceId})),r=a.index+a[0].length}const o=e.slice(r);return o&&i.push(o),i}const Q5={class:"ai-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},Y5={class:"flex items-start justify-between border-b border-slate-200 p-4 dark:border-white/5"},e6={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},t6={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},n6=["aria-label"],i6={key:0,class:"flex flex-1 flex-col items-center justify-center p-6 text-center text-slate-400 dark:text-slate-500"},r6={class:"text-xs"},a6={class:"space-y-2 border-b border-slate-200 p-4 dark:border-white/5"},o6={class:"block font-mono text-[10px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},s6={class:"grid grid-cols-2 gap-2"},l6=["disabled","title","onClick"],c6={key:0,class:"flex h-full flex-col items-center justify-center p-4 text-center text-slate-400 dark:text-slate-500"},u6={class:"text-[10px]"},d6={class:"flex items-center gap-1 font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},f6={key:0,class:"animate-pulse text-cyan-500"},p6={key:0,class:"flex flex-wrap gap-1 pl-1"},m6={key:1,class:"flex gap-1.5"},h6=["onClick"],b6=["onClick"],g6={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},v6={key:0,class:"mb-2 space-y-1"},x6={class:"block font-mono text-[9px] font-bold uppercase tracking-widest text-slate-400 dark:text-slate-500"},y6={class:"flex flex-wrap gap-1"},k6={key:0,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},w6=["title"],_6={class:"truncate"},S6=["disabled","placeholder","onKeydown"],C6={class:"flex justify-end"},E6=["disabled"],Ch=s.defineComponent({__name:"AISidebar",props:{editor:{},aiStream:{type:Function},aiDraft:{type:Function}},emits:["close"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht();function a(){return n.editor?s.toRaw(n.editor):null}const o=s.ref([]),l=s.ref(""),c=s.ref(!1),u=s.ref(null),f=s.ref(null),m=s.ref(null);let p=null;const h=s.computed(()=>{var R,N,L;return n.aiStream?n.aiStream:(L=(N=(R=a())==null?void 0:R.storage)==null?void 0:N.editorContext)==null?void 0:L.aiStream}),g=s.computed(()=>{var R,N,L;return n.aiDraft?n.aiDraft:(L=(N=(R=a())==null?void 0:R.storage)==null?void 0:N.editorContext)==null?void 0:L.aiDraft}),b=s.ref(!1),y=s.ref(0);function v(){y.value++}s.watch(()=>n.editor,(R,N)=>{N&&s.toRaw(N).off("transaction",v),R&&s.toRaw(R).on("transaction",v)},{immediate:!0});const x=s.computed(()=>{var D;y.value;const R=(D=a())==null?void 0:D.state;if(!R||R.selection.empty)return null;const{from:N,to:L}=R.selection;return{from:N,to:L,text:R.doc.textBetween(N,L,`
15240
15240
  `," ")}}),k=s.computed(()=>{y.value;const R=a();if(!R)return{};try{return Ll(R)}catch{return{}}}),w=s.computed(()=>{const R=k.value,N=[];return R.page&&R.pageCount&&R.pageCount>1&&N.push(`${r("sidebars.ai.pageShort")} ${R.page}/${R.pageCount}`),R.paragraphIndex&&R.paragraphIndex>1&&N.push(`${r("sidebars.ai.paragraphShort")} ${R.paragraphIndex}`),R.line&&R.line>1&&N.push(`${r("sidebars.ai.lineShort")} ${R.line}`),R.section&&N.push(R.section.length>40?`${R.section.slice(0,40)}…`:R.section),N.join(" · ")}),S=s.computed(()=>{const R=x.value;if(!R||!R.text.trim())return"";const N=R.text.trim().replace(/\s+/g," ");return N.length>60?`“${N.slice(0,60)}…”`:`“${N}”`});function A(){var K;const R=(K=a())==null?void 0:K.state;if(!R)return;const{from:N,to:L}=R.selection,D=1500;return{before:R.doc.textBetween(Math.max(0,N-D),N,`
15241
15241
  `," "),after:R.doc.textBetween(L,Math.min(R.doc.content.size,L+D),`
15242
- `," ")}}function I(){const R=A();return{before:(R==null?void 0:R.before)??"",after:(R==null?void 0:R.after)??"",...k.value}}async function _(){await s.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)}async function E(R,N){const L=h.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:N}),o.value.push({role:"assistant",text:"",streaming:!0});const D=o.value.length-1;await _();try{for await(const K of L(R,p.signal))o.value[D].text+=K,_();o.value[D].text||(o.value[D].text=r("sidebars.ai.emptyResponse"),o.value[D].error=!0)}catch(K){p.signal.aborted||(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K instanceof Error?K.message:String(K)}`,o.value[D].error=!0)}finally{o.value[D].streaming=!1,c.value=!1,p=null,_()}}function z(){const R=l.value.trim();if(!R||c.value)return;if(l.value="",b.value){P({prompt:R,context:I()},R);return}const N=x.value;E({action:"chat",prompt:R,...N?{selection:N.text}:{},context:I()},R)}async function P(R,N){const L=g.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:N}),o.value.push({role:"assistant",text:"",streaming:!0});const D=o.value.length-1;await _();try{for await(const K of L(R,p.signal))K.type==="delta"?(o.value[D].text+=K.text,_()):K.type==="done"?o.value[D].citations=K.citations:K.type==="error"&&(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K.message}`,o.value[D].error=!0,o.value[D].citations=void 0);!o.value[D].text&&!o.value[D].error&&(o.value[D].text=r("sidebars.ai.emptyResponse"),o.value[D].error=!0)}catch(K){p.signal.aborted||(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K instanceof Error?K.message:String(K)}`,o.value[D].error=!0,o.value[D].citations=void 0)}finally{o.value[D].streaming=!1,c.value=!1,p=null,_()}}function U(){b.value=!b.value,s.nextTick(()=>{const R=document.querySelector(".ai-sidebar textarea");R==null||R.focus()})}function V(R){if(c.value||!R.action)return;const N=x.value;R.needsSelection&&!N||E({action:R.action,...N?{selection:N.text}:{},...R.prompt?{prompt:R.prompt}:{},context:I()},R.prompt??R.label)}function B(){var R,N,L;x.value&&((L=(N=(R=a())==null?void 0:R.commands)==null?void 0:N.aiTransform)==null||L.call(N,{action:"rewrite"}))}const j=s.computed(()=>[{label:r("sidebars.ai.summarize"),icon:yr,color:"text-cyan-500",action:"summarize",needsSelection:!0},{label:r("sidebars.ai.fixGrammar"),icon:Ab,color:"text-emerald-500",action:"grammar",needsSelection:!0},{label:r("sidebars.ai.continue"),icon:N0,color:"text-amber-500",action:"generate",prompt:"Continue writing naturally from where the text ends, matching the existing style."},{label:r("sidebars.ai.toSpanish"),icon:vf,color:"text-cyan-500",action:"translate",prompt:"translate to Spanish",needsSelection:!0},{label:r("sidebars.ai.improveSelection"),icon:f0,color:"text-violet-500",improve:!0,needsSelection:!0},{label:r("sidebars.ai.draft"),icon:Ha,color:"text-cyan-500",draft:!0,disabled:!g.value}]);function $(R,N){R.text&&(navigator.clipboard.writeText(R.text),u.value=N,setTimeout(()=>u.value=null,2e3))}function Y(R){f.value=R,setTimeout(()=>{f.value===R&&(f.value=null)},2e3)}function W(R,N){const L=a();if(!R.text||!L)return;const{state:D,view:K}=L,{from:ne,to:ee}=D.selection;if(!R.citations||R.citations.length===0){Jd(L,K,ne,ee,R.text),K.focus(),Y(N);return}const ie=Ui(L);if(!ie){Jd(L,K,ne,ee,X5(R.text)),K.focus(),Y(N);return}const G=new Map(R.citations.map(fe=>[fe.ref,fe])),H=J5(R.text,G,ie),q=D.schema,re=H.map(fe=>typeof fe=="string"?q.text(fe):q.nodeFromJSON(fe)).filter(fe=>!!fe),ce=new ae(J.from(re),0,0);K.dispatch(D.tr.replace(ne,ee,ce)),K.focus(),Y(N)}s.onMounted(()=>{s.nextTick(()=>{var R;(R=document.querySelector(".ai-sidebar textarea"))==null||R.focus()})});function oe(){p==null||p.abort(),c.value=!1,i("close")}return s.onUnmounted(()=>{var R;p==null||p.abort(),(R=a())==null||R.off("transaction",v)}),(R,N)=>{var L;return s.openBlock(),s.createElementBlock("div",Z5,[s.createElementVNode("div",Q5,[s.createElementVNode("div",null,[s.createElementVNode("h3",Y5,[s.createVNode(s.unref(Un),{class:"h-4 w-4 animate-pulse text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.ai.title")),1)]),s.createElementVNode("p",e6,s.toDisplayString(s.unref(r)("sidebars.ai.description")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-200","aria-label":s.unref(r)("sidebars.ai.close"),onClick:oe},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,t6)]),h.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",r6,[s.createElementVNode("span",a6,s.toDisplayString(s.unref(r)("sidebars.ai.quickMacros")),1),s.createElementVNode("div",o6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(j.value,D=>(s.openBlock(),s.createElementBlock("button",{key:D.label,type:"button",disabled:c.value||D.needsSelection&&!x.value||"disabled"in D&&D.disabled,title:D.needsSelection&&!x.value?s.unref(r)("sidebars.ai.selectTextFirst"):D.label,class:s.normalizeClass(["flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-left text-[11px] font-bold transition-colors disabled:opacity-40","draft"in D&&D.draft&&b.value?"border-cyan-500 bg-cyan-500/10 text-cyan-700 dark:border-cyan-400/50 dark:bg-cyan-500/15 dark:text-cyan-300":"border-slate-200 bg-slate-50 text-slate-700 hover:border-cyan-500/50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:border-cyan-500/30"]),onClick:K=>D.improve?B():"draft"in D&&D.draft?U():V(D)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{class:s.normalizeClass(["h-3 w-3",D.color])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(D.label),1)],10,s6))),128))])]),s.createElementVNode("div",{ref_key:"turnsEl",ref:m,class:"flex-1 space-y-3 overflow-y-auto p-4"},[o.value.length===0?(s.openBlock(),s.createElementBlock("div",l6,[s.createVNode(s.unref(Un),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",c6,s.toDisplayString(s.unref(r)("sidebars.ai.noDraft")),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.value,(D,K)=>(s.openBlock(),s.createElementBlock("div",{key:K,class:s.normalizeClass(["flex flex-col gap-1",D.role==="user"?"items-end":"items-start"])},[s.createElementVNode("span",u6,[D.role==="user"?(s.openBlock(),s.createBlock(s.unref(Wl),{key:0,class:"h-2.5 w-2.5"})):(s.openBlock(),s.createBlock(s.unref(Un),{key:1,class:"h-2.5 w-2.5 text-cyan-400"})),s.createTextVNode(" "+s.toDisplayString(D.role==="user"?s.unref(r)("sidebars.ai.you"):s.unref(r)("sidebars.ai.assistant")),1)]),s.createElementVNode("div",{class:s.normalizeClass(["max-w-full whitespace-pre-wrap rounded-xl px-3 py-2 text-xs leading-relaxed",[D.role==="user"?"bg-cyan-500/10 text-slate-700 dark:bg-cyan-500/15 dark:text-slate-200":D.error?"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-300":"bg-slate-100 text-slate-700 dark:bg-white/[0.04] dark:text-slate-300"]])},[s.createTextVNode(s.toDisplayString(D.text),1),D.streaming?(s.openBlock(),s.createElementBlock("span",d6,"▌")):s.createCommentVNode("",!0)],2),D.role==="assistant"&&D.citations&&D.citations.length>0?(s.openBlock(),s.createElementBlock("div",f6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.citations,ne=>(s.openBlock(),s.createElementBlock("span",{key:ne.ref,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},[s.createVNode(s.unref(Ha),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(ne.label),1)]))),128))])):s.createCommentVNode("",!0),D.role==="assistant"&&!D.streaming&&!D.error&&D.text?(s.openBlock(),s.createElementBlock("div",p6,[s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg border border-slate-200 bg-white px-2 py-1 text-[10px] font-semibold text-slate-600 transition-all hover:bg-slate-50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:ne=>$(D,K)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value===K?s.unref(Va):s.unref($s)),{class:s.normalizeClass(["h-3 w-3",u.value===K?"text-emerald-500":""])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(u.value===K?s.unref(r)("sidebars.ai.copied"):s.unref(r)("sidebars.ai.copy")),1)],8,m6),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-2 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:ne=>W(D,K)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(f.value===K?s.unref(Va):s.unref(Cb)),{class:"h-3 w-3"})),s.createElementVNode("span",null,s.toDisplayString(f.value===K?s.unref(r)("sidebars.ai.inserted"):s.unref(r)("sidebars.ai.insert")),1)],8,h6)])):s.createCommentVNode("",!0)],2))),128))],512),s.createElementVNode("div",b6,[w.value||S.value?(s.openBlock(),s.createElementBlock("div",g6,[s.createElementVNode("span",v6,s.toDisplayString(s.unref(r)("sidebars.ai.contextLabel")),1),s.createElementVNode("div",x6,[w.value?(s.openBlock(),s.createElementBlock("span",y6,[s.createVNode(s.unref(dt),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(w.value),1)])):s.createCommentVNode("",!0),S.value?(s.openBlock(),s.createElementBlock("span",{key:1,class:"inline-flex max-w-full items-center gap-1 truncate rounded-full border border-violet-500/30 bg-violet-500/5 px-2 py-0.5 text-[10px] font-semibold text-violet-700 dark:border-violet-400/30 dark:bg-violet-500/10 dark:text-violet-300",title:(L=x.value)==null?void 0:L.text},[s.createElementVNode("span",w6,s.toDisplayString(S.value),1)],8,k6)):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(z,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":N[0]||(N[0]=D=>l.value=D),rows:"2",disabled:c.value,placeholder:b.value?s.unref(r)("sidebars.ai.draftPlaceholder"):s.unref(r)("sidebars.ai.promptPlaceholder"),class:"w-full min-h-[55px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(s.withModifiers(z,["exact","prevent"]),["enter"])},null,40,_6),[[s.vModelText,l.value]]),s.createElementVNode("div",S6,[s.createElementVNode("button",{type:"submit",disabled:c.value||!l.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-40"},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(b.value?s.unref(r)("sidebars.ai.promptDraft"):s.unref(r)("sidebars.ai.promptAI")),1)],8,C6)])],32)])],64)):(s.openBlock(),s.createElementBlock("div",n6,[s.createVNode(s.unref(Un),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",i6,s.toDisplayString(s.unref(r)("sidebars.ai.notConfigured")),1)]))])}}}),E6={class:"comments-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},A6={class:"border-b border-slate-200 p-4 dark:border-white/5"},T6={class:"mb-3 flex items-center justify-between"},N6={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},O6={class:"flex rounded-xl border border-slate-200 bg-slate-50 p-1 text-[11px] font-semibold dark:border-white/10 dark:bg-white/[0.02]"},M6={key:0,class:"mb-1 rounded-xl border border-cyan-500/25 bg-cyan-500/5 p-2.5 text-xs text-cyan-700 animate-fadeIn dark:border-cyan-500/15 dark:bg-cyan-500/10 dark:text-cyan-400"},D6={class:"mb-1 font-mono text-[9px] font-bold uppercase tracking-wider"},z6={class:"line-clamp-1 border-l-2 border-cyan-400 bg-cyan-500/10 py-0.5 pl-2.5 italic dark:bg-cyan-500/5"},I6={class:"flex-1 space-y-4 overflow-y-auto p-4"},R6={class:"flex items-start justify-between"},L6={class:"flex items-center gap-2"},B6={class:"text-xs font-bold text-slate-800 dark:text-slate-200"},P6={class:"font-mono text-[9px] text-slate-400 dark:text-slate-500"},F6={class:"flex items-center gap-1.5"},V6=["title","onClick"],U6=["title","onClick"],H6={key:0,class:"inline-flex items-center gap-1 rounded-full border border-amber-400/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-amber-600 dark:border-amber-500/30 dark:text-amber-400"},q6={class:"whitespace-pre-wrap break-words text-xs leading-relaxed text-slate-700 dark:text-slate-300"},j6={key:2,class:"space-y-2.5 border-l border-slate-200 pl-4 pt-1 dark:border-white/10"},$6={class:"flex items-center gap-1.5"},W6={class:"text-[10px] font-bold text-slate-600 dark:text-slate-300"},G6={class:"font-mono text-[8px] text-slate-400 dark:text-slate-500"},K6={class:"break-words pl-1 text-xs text-slate-600 dark:text-slate-400"},X6={key:3,class:"flex items-center justify-between border-t border-slate-100 pt-2 dark:border-white/5"},J6={key:0,class:"flex w-full items-center gap-1.5"},Z6=["onUpdate:modelValue","placeholder","onKeydown"],Q6=["onClick"],Y6=["onClick"],eA={key:4,class:"rounded-lg border border-green-100/40 bg-green-50/55 p-2 text-[10px] text-green-700 dark:border-green-500/10 dark:bg-green-950/10 dark:text-green-400"},tA={key:0},nA={key:0,class:"py-12 text-center text-slate-400 dark:text-slate-500"},iA={class:"text-xs"},rA={key:0,class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},aA=["placeholder"],oA={class:"flex items-center justify-between"},sA={class:"font-mono text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},lA=["disabled"],Ch=s.defineComponent({__name:"CommentsSidebar",props:{comments:{},selectedTextSnippet:{},selectedTextIndex:{},orphanedIds:{}},emits:["add-comment","add-reply","resolve-comment","delete-comment"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=s.ref({}),l=s.ref(null),c=s.ref("active"),u=s.computed(()=>(n.comments??[]).filter(b=>c.value==="resolved"?b.resolved:!b.resolved));function f(){a.value.trim()&&i("add-comment",a.value.trim(),n.selectedTextSnippet,n.selectedTextIndex)}function m(b){const y=o.value[b]||"";y.trim()&&(i("add-reply",b,y.trim()),o.value={...o.value,[b]:""},l.value=null)}function p(b){return b.split(" ").map(y=>y[0]).join("").slice(0,2).toUpperCase()}function h(b){var y;return((y=n.orphanedIds)==null?void 0:y.includes(b.id))===!0}function g(b){typeof window<"u"&&!window.confirm(r("sidebars.comments.confirmDelete"))||i("delete-comment",b)}return(b,y)=>(s.openBlock(),s.createElementBlock("div",E6,[s.createElementVNode("div",A6,[s.createElementVNode("div",T6,[s.createElementVNode("h3",N6,[s.createVNode(s.unref(Sf),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.title")),1)]),s.createElementVNode("div",O6,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="active"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:y[0]||(y[0]=v=>c.value="active")},s.toDisplayString(s.unref(r)("sidebars.comments.active")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="resolved"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:y[1]||(y[1]=v=>c.value="resolved")},s.toDisplayString(s.unref(r)("sidebars.comments.resolved")),3)])]),e.selectedTextSnippet?(s.openBlock(),s.createElementBlock("div",M6,[s.createElementVNode("p",D6,s.toDisplayString(s.unref(r)("sidebars.comments.creatingAnchored")),1),s.createElementVNode("p",z6,' "'+s.toDisplayString(e.selectedTextSnippet)+'" ',1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",I6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.value,v=>(s.openBlock(),s.createElementBlock("div",{key:v.id,class:"relative space-y-3 rounded-2xl border border-slate-200/60 bg-slate-50/60 p-4 transition-all hover:border-cyan-500/30 hover:shadow-cyan dark:border-white/5 dark:bg-[#02040a]/40"},[s.createElementVNode("div",R6,[s.createElementVNode("div",L6,[s.createElementVNode("div",{class:"flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:v.authorColor})},s.toDisplayString(p(v.authorName)),5),s.createElementVNode("div",null,[s.createElementVNode("h4",B6,s.toDisplayString(v.authorName),1),s.createElementVNode("p",P6,s.toDisplayString(new Date(v.createdAt).toLocaleTimeString()),1)])]),s.createElementVNode("div",F6,[v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-green-500/10 hover:text-green-500",title:s.unref(r)("sidebars.comments.resolve"),onClick:x=>i("resolve-comment",v.id)},[s.createVNode(s.unref(zb),{class:"h-4 w-4"})],8,V6)),h(v)?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-red-500/10 hover:text-red-500",title:s.unref(r)("sidebars.comments.delete"),onClick:x=>g(v.id)},[s.createVNode(s.unref(kr),{class:"h-4 w-4"})],8,U6)):s.createCommentVNode("",!0)])]),h(v)?(s.openBlock(),s.createElementBlock("div",H6,s.toDisplayString(s.unref(r)("sidebars.comments.orphaned")),1)):s.createCommentVNode("",!0),v.anchorText?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["max-w-full truncate rounded-r-lg border-l-2 py-1 pl-2.5 text-[10px] italic text-slate-500 dark:text-slate-400",h(v)?"border-amber-500/50 bg-amber-50/50 line-through opacity-70 dark:border-amber-500/40 dark:bg-amber-500/5":"border-cyan-500/50 bg-slate-100 dark:border-cyan-500/40 dark:bg-white/5"])},s.toDisplayString(s.unref(r)("sidebars.comments.quote"))+' "'+s.toDisplayString(v.anchorText)+'" ',3)):s.createCommentVNode("",!0),s.createElementVNode("p",q6,s.toDisplayString(v.content),1),v.replies.length>0?(s.openBlock(),s.createElementBlock("div",j6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(v.replies,x=>(s.openBlock(),s.createElementBlock("div",{key:x.id,class:"space-y-1"},[s.createElementVNode("div",$6,[s.createElementVNode("div",{class:"flex h-4.5 w-4.5 items-center justify-center rounded-full text-[8px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:x.authorColor})},s.toDisplayString(p(x.authorName)),5),s.createElementVNode("span",W6,s.toDisplayString(x.authorName),1),s.createElementVNode("span",G6,s.toDisplayString(new Date(x.createdAt).toLocaleTimeString()),1)]),s.createElementVNode("p",K6,s.toDisplayString(x.content),1)]))),128))])):s.createCommentVNode("",!0),v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",X6,[l.value===v.id?(s.openBlock(),s.createElementBlock("div",J6,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x=>o.value[v.id]=x,type:"text",placeholder:s.unref(r)("sidebars.comments.reply"),class:"flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 focus:border-cyan-500/50 focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(x=>m(v.id),["enter"])},null,40,Z6),[[s.vModelText,o.value[v.id]]]),s.createElementVNode("button",{type:"button",class:"rounded-lg bg-cyan-500 p-1.5 font-bold text-black shadow-cyan hover:bg-cyan-400",onClick:x=>m(v.id)},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"})],8,Q6)])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-all hover:text-cyan-500",onClick:x=>l.value=v.id},[s.createVNode(s.unref(b0),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.replyInThread")),1)],8,Y6))])),v.resolved?(s.openBlock(),s.createElementBlock("div",eA,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.comments.resolvedBy").replace("{user}",v.resolvedByName||v.resolvedBy||"You"))+" ",1),v.resolvedAt?(s.openBlock(),s.createElementBlock("span",tA,"at "+s.toDisplayString(new Date(v.resolvedAt).toLocaleTimeString()),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))),128)),u.value.length===0?(s.openBlock(),s.createElementBlock("div",nA,[s.createVNode(s.unref(a0),{class:"mx-auto mb-2 h-8 w-8 text-cyan-500 opacity-50"}),s.createElementVNode("p",iA,s.toDisplayString(s.unref(r)("sidebars.comments.noComments").replace("{mode}",c.value)),1)])):s.createCommentVNode("",!0)]),c.value==="active"?(s.openBlock(),s.createElementBlock("div",rA,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(f,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":y[2]||(y[2]=v=>a.value=v),rows:"2",placeholder:e.selectedTextSnippet?s.unref(r)("sidebars.comments.commentOnSelection"):s.unref(r)("sidebars.comments.generalComment"),class:"w-full min-h-[60px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,aA),[[s.vModelText,a.value]]),s.createElementVNode("div",oA,[s.createElementVNode("span",sA,s.toDisplayString(e.selectedTextSnippet?s.unref(r)("sidebars.comments.anchoredComment"):s.unref(r)("sidebars.comments.general")),1),s.createElementVNode("button",{type:"submit",disabled:!a.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-50"},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.post")),1)],8,lA)])],32)])):s.createCommentVNode("",!0)]))}}),cA={class:"history-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},uA={class:"border-b border-slate-200 p-4 dark:border-white/5"},dA={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},fA={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},pA={class:"flex-1 space-y-3 overflow-y-auto p-4"},mA={key:0,class:"space-y-2 rounded-2xl border border-amber-500/30 bg-amber-500/10 p-3.5 text-xs animate-fadeIn dark:border-amber-500/20"},hA={class:"flex items-start gap-1.5 text-amber-700 dark:text-amber-400"},bA={class:"font-bold"},gA={class:"mt-0.5 text-[10px] leading-relaxed text-amber-600 dark:text-amber-500"},vA={class:"flex justify-end gap-2 pt-1"},xA={class:"space-y-2.5"},yA={class:"mb-1 flex items-center justify-between"},kA={class:"rounded-md bg-slate-200 px-1.5 py-0.5 font-mono text-[9px] font-bold text-slate-500 dark:bg-cyan-500/10 dark:text-cyan-400"},wA={class:"flex items-center gap-0.5 font-mono text-[9px] text-slate-400 dark:text-slate-500"},_A={class:"text-xs font-bold leading-snug text-slate-800 dark:text-slate-200"},SA={class:"flex items-center gap-1.5 text-[10px] text-slate-500"},CA={class:"font-semibold text-slate-600 dark:text-slate-300"},EA={class:"flex justify-end gap-2 border-t border-slate-200/50 pt-2 dark:border-white/5"},AA=["onClick"],TA=["onClick"],NA={key:0,class:"py-6 text-center text-xs text-slate-400 dark:text-slate-500"},OA={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/85"},MA=["placeholder"],DA={class:"flex justify-end gap-2"},zA={type:"submit",class:"rounded-lg bg-cyan-500 px-3.5 py-1.5 text-xs font-bold text-black shadow-cyan hover:bg-cyan-400"},Eh=s.defineComponent({__name:"HistorySidebar",props:{snapshots:{},activePreviewIndex:{}},emits:["save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=s.ref(!1);function l(){a.value.trim()&&(i("save-snapshot",a.value.trim()),a.value="",o.value=!1)}const c=s.computed(()=>n.snapshots??[]);return(u,f)=>(s.openBlock(),s.createElementBlock("div",cA,[s.createElementVNode("div",uA,[s.createElementVNode("h3",dA,[s.createVNode(s.unref(Ul),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.title")),1)]),s.createElementVNode("p",fA,s.toDisplayString(s.unref(r)("sidebars.history.empty")),1)]),s.createElementVNode("div",pA,[e.activePreviewIndex!==null?(s.openBlock(),s.createElementBlock("div",mA,[s.createElementVNode("div",hA,[s.createVNode(s.unref(_0),{class:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-500"}),s.createElementVNode("div",null,[s.createElementVNode("p",bA,s.toDisplayString(s.unref(r)("sidebars.history.viewingPreview")),1),s.createElementVNode("p",gA,s.toDisplayString(s.unref(r)("sidebars.history.readOnlyPreview").replace("{index}",String(e.activePreviewIndex))),1)])]),s.createElementVNode("div",vA,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] font-semibold text-slate-500 hover:bg-white/5 hover:text-slate-700 dark:text-slate-400",onClick:f[0]||(f[0]=m=>i("preview-snapshot",null))},s.toDisplayString(s.unref(r)("sidebars.history.closePreview")),1),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:f[1]||(f[1]=()=>{i("restore-snapshot",e.activePreviewIndex),i("preview-snapshot",null)})},[s.createVNode(s.unref(fu),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restoreThis")),1)])])])):s.createCommentVNode("",!0),s.createElementVNode("div",xA,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,m=>(s.openBlock(),s.createElementBlock("div",{key:m.versionIndex,class:s.normalizeClass(["space-y-2.5 rounded-2xl border p-4 transition-all",e.activePreviewIndex===m.versionIndex?"border-cyan-500/40 bg-cyan-500/5 shadow-cyan dark:border-cyan-500/30":"border-slate-200/60 bg-slate-50/60 hover:border-cyan-500/30 dark:border-white/5 dark:bg-[#02040a]/40 dark:hover:border-white/10"])},[s.createElementVNode("div",null,[s.createElementVNode("div",yA,[s.createElementVNode("span",kA,s.toDisplayString(s.unref(r)("sidebars.history.version"))+" #"+s.toDisplayString(m.versionIndex),1),s.createElementVNode("span",wA,[s.createVNode(s.unref(Vl),{class:"h-2.5 w-2.5"}),s.createTextVNode(" "+s.toDisplayString(new Date(m.timestamp).toLocaleDateString())+" "+s.toDisplayString(new Date(m.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),1)])]),s.createElementVNode("h4",_A,s.toDisplayString(m.title),1)]),s.createElementVNode("div",SA,[s.createVNode(s.unref(Wl),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.history.modifiedBy"))+" ",1),s.createElementVNode("strong",CA,s.toDisplayString(m.modifiedBy),1)])]),s.createElementVNode("div",EA,[e.activePreviewIndex!==m.versionIndex?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-slate-500 transition-colors hover:text-cyan-600 dark:text-slate-400 dark:hover:text-cyan-400",onClick:p=>i("preview-snapshot",m)},[s.createVNode(s.unref(Fb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.preview")),1)],8,AA)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-colors hover:text-cyan-500 dark:text-cyan-400 dark:hover:text-cyan-300",onClick:p=>i("restore-snapshot",m.versionIndex)},[s.createVNode(s.unref(fu),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restore")),1)],8,TA)])],2))),128)),c.value.length===0?(s.openBlock(),s.createElementBlock("p",NA,s.toDisplayString(s.unref(r)("sidebars.history.noSnapshots")),1)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",OA,[o.value?(s.openBlock(),s.createElementBlock("form",{key:0,class:"space-y-2 animate-fadeIn",onSubmit:s.withModifiers(l,["prevent"])},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[2]||(f[2]=m=>a.value=m),type:"text",required:"",placeholder:s.unref(r)("sidebars.history.snapshotPlaceholder"),class:"w-full rounded-xl border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,MA),[[s.vModelText,a.value]]),s.createElementVNode("div",DA,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] text-slate-500 hover:bg-white/5 dark:text-slate-400",onClick:f[3]||(f[3]=m=>o.value=!1)},s.toDisplayString(s.unref(r)("sidebars.history.cancel")),1),s.createElementVNode("button",zA,s.toDisplayString(s.unref(r)("sidebars.history.save")),1)])],32)):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-slate-300 py-2.5 text-xs font-bold text-slate-500 transition-all hover:border-cyan-500 hover:bg-cyan-500/5 hover:text-cyan-500 dark:border-white/10 dark:text-slate-400 dark:hover:border-cyan-400/50 dark:hover:text-cyan-400",onClick:f[4]||(f[4]=m=>o.value=!0)},[s.createVNode(s.unref(v0),{class:"h-3.5 w-3.5 animate-pulse"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.saveNamedSnapshot")),1)]))])]))}}),IA={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},RA={class:"mb-4 flex items-center justify-between"},LA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},BA={key:0,class:"space-y-4"},PA={class:"flex items-start gap-3"},FA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},VA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},UA={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},HA={class:"flex items-start gap-3"},qA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400"},jA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},$A={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},WA={class:"text-xs text-slate-500 dark:text-slate-400"},GA={class:"flex items-start gap-3"},KA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400"},XA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},JA={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},ZA={class:"grid grid-cols-2 gap-3"},QA={class:"flex items-start gap-3"},YA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"},e8={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},t8={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},n8={class:"flex items-start gap-3"},i8={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400"},r8={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},a8={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},o8={class:"rounded-lg border border-slate-200 bg-slate-50 p-4 dark:border-slate-700/50 dark:bg-white/5"},s8={class:"mb-2 flex items-center gap-2 text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},l8={class:"grid grid-cols-3 gap-3 text-center"},c8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},u8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},d8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},f8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},p8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},m8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},h8={key:1,class:"py-8 text-center text-sm text-slate-500 dark:text-slate-400"},Ah=s.defineComponent({__name:"DetailsDialog",props:{isOpen:{type:Boolean},meta:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ht(),i=t;function r(a){return a?new Date(a).toLocaleString():"-"}return(a,o)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:o[1]||(o[1]=s.withModifiers(l=>i("close"),["self"]))},[s.createElementVNode("div",IA,[s.createElementVNode("div",RA,[s.createElementVNode("h2",LA,s.toDisplayString(s.unref(n)("editor.details.title")),1),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:o[0]||(o[0]=l=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),e.meta?(s.openBlock(),s.createElementBlock("div",BA,[s.createElementVNode("div",PA,[s.createElementVNode("div",FA,[s.createVNode(s.unref(dt),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",VA,s.toDisplayString(s.unref(n)("editor.details.titleLabel")),1),s.createElementVNode("p",UA,s.toDisplayString(e.meta.title),1)])]),s.createElementVNode("div",HA,[s.createElementVNode("div",qA,[s.createVNode(s.unref(Wl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",jA,s.toDisplayString(s.unref(n)("editor.details.owner")),1),s.createElementVNode("p",$A,s.toDisplayString(e.meta.owner.name),1),s.createElementVNode("p",WA,s.toDisplayString(e.meta.owner.email),1)])]),s.createElementVNode("div",GA,[s.createElementVNode("div",KA,[s.createVNode(s.unref(qb),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",XA,s.toDisplayString(s.unref(n)("editor.details.location")),1),s.createElementVNode("p",JA,s.toDisplayString(e.meta.folderName||s.unref(n)("editor.details.noFolder")),1)])]),s.createElementVNode("div",ZA,[s.createElementVNode("div",QA,[s.createElementVNode("div",YA,[s.createVNode(s.unref(Vl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",e8,s.toDisplayString(s.unref(n)("editor.details.created")),1),s.createElementVNode("p",t8,s.toDisplayString(r(e.meta.createdAt)),1)])]),s.createElementVNode("div",n8,[s.createElementVNode("div",i8,[s.createVNode(s.unref(Rb),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",r8,s.toDisplayString(s.unref(n)("editor.details.modified")),1),s.createElementVNode("p",a8,s.toDisplayString(r(e.meta.updatedAt)),1)])])]),s.createElementVNode("div",o8,[s.createElementVNode("div",s8,[s.createVNode(s.unref(Ua),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.details.statistics")),1)]),s.createElementVNode("div",l8,[s.createElementVNode("div",null,[s.createElementVNode("p",c8,s.toDisplayString(e.meta.wordCount),1),s.createElementVNode("p",u8,s.toDisplayString(s.unref(n)("editor.details.words")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",d8,s.toDisplayString(e.meta.charCount),1),s.createElementVNode("p",f8,s.toDisplayString(s.unref(n)("editor.details.characters")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",p8,s.toDisplayString(e.meta.pageCount),1),s.createElementVNode("p",m8,s.toDisplayString(s.unref(n)("editor.details.pages")),1)])])])])):(s.openBlock(),s.createElementBlock("div",h8,s.toDisplayString(s.unref(n)("editor.details.loading")),1))])])):s.createCommentVNode("",!0)}}),b8={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},g8={class:"mb-4 flex items-center justify-between"},v8={class:"flex items-center gap-2"},x8={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},y8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},k8={class:"mb-4 rounded-md border border-slate-200 bg-slate-50 p-3 dark:border-slate-700/50 dark:bg-white/5"},w8={class:"mb-1 block text-[11px] font-bold uppercase tracking-wide text-slate-500 dark:text-slate-400"},_8={class:"flex items-center gap-2"},S8=["value"],C8=["title"],E8={class:"space-y-3"},A8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},T8=["placeholder"],N8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},O8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},M8={class:"mt-5 flex justify-end gap-2"},D8=["href"],Th=s.defineComponent({__name:"EmailDialog",props:{isOpen:{type:Boolean},documentTitle:{},shareUrl:{},defaultRecipient:{}},emits:["close","copy-link"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(i.defaultRecipient||""),o=s.ref(""),l=s.ref(""),c=s.ref(!1),u=s.ref(!1),f=s.computed(()=>n("editor.email.defaultSubject",{title:i.documentTitle})),m=s.computed(()=>n("editor.email.defaultBody",{url:i.shareUrl})),p=s.computed(()=>o.value===f.value),h=s.computed(()=>l.value===m.value);s.watch(()=>i.documentTitle,()=>{o.value=f.value},{immediate:!0}),s.watch(()=>i.shareUrl,()=>{l.value=m.value},{immediate:!0});const g=s.computed(()=>{const v=new URLSearchParams;o.value.trim()&&v.set("subject",o.value.trim()),l.value.trim()&&v.set("body",l.value.trim());const x=v.toString();let k=`mailto:${a.value.trim()}`;return x&&(k+=`?${x}`),k});function b(){r("copy-link")}function y(){a.value=i.defaultRecipient||"",o.value=f.value,l.value=m.value,c.value=!1,u.value=!1}return s.watch(()=>i.isOpen,v=>{v&&y()}),(v,x)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:x[10]||(x[10]=s.withModifiers(k=>r("close"),["self"]))},[s.createElementVNode("div",b8,[s.createElementVNode("div",g8,[s.createElementVNode("div",v8,[s.createElementVNode("div",x8,[s.createVNode(s.unref(Ws),{class:"h-4 w-4"})]),s.createElementVNode("h2",y8,s.toDisplayString(s.unref(n)("editor.email.title")),1)]),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:x[0]||(x[0]=k=>r("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),s.createElementVNode("div",k8,[s.createElementVNode("label",w8,s.toDisplayString(s.unref(n)("editor.email.shareableLink")),1),s.createElementVNode("div",_8,[s.createElementVNode("input",{type:"text",value:e.shareUrl,readonly:"",class:"flex-1 rounded-md border border-slate-300 bg-white px-2 py-1.5 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300"},null,8,S8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md border border-slate-300 text-slate-500 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-400 dark:hover:bg-slate-700",title:s.unref(n)("editor.email.copyLink"),onClick:b},[s.createVNode(s.unref(ql),{class:"h-3.5 w-3.5"})],8,C8)])]),s.createElementVNode("div",E8,[s.createElementVNode("div",null,[s.createElementVNode("label",A8,s.toDisplayString(s.unref(n)("editor.email.to")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=k=>a.value=k),type:"email",class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",placeholder:s.unref(n)("editor.email.toPlaceholder")},null,8,T8),[[s.vModelText,a.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",N8,s.toDisplayString(s.unref(n)("editor.email.subject")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[2]||(x[2]=k=>o.value=k),type:"text",class:s.normalizeClass(["w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",p.value&&!c.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:x[3]||(x[3]=k=>c.value=!0),onBlur:x[4]||(x[4]=k=>c.value=!1)},null,34),[[s.vModelText,o.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",O8,s.toDisplayString(s.unref(n)("editor.email.body")),1),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":x[5]||(x[5]=k=>l.value=k),rows:"4",class:s.normalizeClass(["w-full resize-none rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",h.value&&!u.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:x[6]||(x[6]=k=>u.value=!0),onBlur:x[7]||(x[7]=k=>u.value=!1)},null,34),[[s.vModelText,l.value]])])]),s.createElementVNode("div",M8,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold text-slate-700 transition hover:bg-slate-100 dark:text-slate-300",onClick:x[8]||(x[8]=k=>r("close"))},s.toDisplayString(s.unref(n)("common.cancel")),1),s.createElementVNode("a",{href:g.value,class:"inline-flex rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-cyan-700",onClick:x[9]||(x[9]=k=>r("close"))},s.toDisplayString(s.unref(n)("editor.email.send")),9,D8)])])])):s.createCommentVNode("",!0)}}),z8=["aria-label"],I8={class:"flex items-center gap-1.5"},R8=["placeholder"],L8={class:"w-16 flex-shrink-0 text-center text-[11px] text-slate-400 dark:text-slate-500"},B8=["disabled","title"],P8=["disabled","title"],F8=["title"],V8={class:"mt-2 flex items-center gap-1.5"},U8=["placeholder","onKeydown"],H8=["disabled"],q8=["disabled"],j8=s.defineComponent({__name:"FindReplaceDialog",props:{isOpen:{type:Boolean},editor:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(null),o=s.ref(""),l=s.ref(""),c=s.ref({query:"",matches:[],activeIndex:0}),u=s.computed(()=>{if(!o.value)return"";const{matches:x,activeIndex:k}=c.value;return x.length===0?n("editor.findReplace.noMatches"):n("editor.findReplace.matchCount",{current:k+1,total:x.length})}),f=()=>{i.editor&&(c.value=Ee.getSearchState(i.editor))};s.watch(()=>i.editor,(x,k)=>{k==null||k.off("transaction",f),x==null||x.on("transaction",f)}),s.watch(()=>i.isOpen,async x=>{var k,w;if(i.editor)if(x){const{from:S,to:A}=i.editor.state.selection;S!==A&&(o.value=i.editor.state.doc.textBetween(S,A," ")),m(),i.editor.on("transaction",f),await s.nextTick(),(k=a.value)==null||k.focus(),(w=a.value)==null||w.select()}else v()});function m(){i.editor&&(Ee.setSearchQuery(i.editor,o.value),f())}s.watch(o,m);function p(){i.editor&&Ee.searchNext(i.editor)}function h(){i.editor&&Ee.searchPrev(i.editor)}function g(){i.editor&&Ee.replaceCurrent(i.editor,l.value)}function b(){i.editor&&Ee.replaceAll(i.editor,l.value)}function y(x){x.key==="Enter"&&x.shiftKey?(x.preventDefault(),h()):x.key==="Enter"?(x.preventDefault(),p()):x.key==="Escape"&&(x.preventDefault(),v())}function v(){var x;i.editor&&Ee.clearSearch(i.editor),(x=i.editor)==null||x.off("transaction",f),o.value="",l.value="",c.value={query:"",matches:[],activeIndex:0},r("close")}return s.onUnmounted(()=>{var x;(x=i.editor)==null||x.off("transaction",f)}),(x,k)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"absolute right-4 top-16 z-40 w-[340px] rounded-xl border border-slate-200 bg-white p-3 shadow-2xl dark:border-slate-700 dark:bg-[#0e1525]",role:"dialog","aria-label":s.unref(n)("editor.findReplace.title")},[s.createElementVNode("div",I8,[s.withDirectives(s.createElementVNode("input",{ref_key:"findInput",ref:a,"onUpdate:modelValue":k[0]||(k[0]=w=>o.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.findPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:y},null,40,R8),[[s.vModelText,o.value]]),s.createElementVNode("span",L8,s.toDisplayString(u.value),1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.previous"),onClick:h},[s.createVNode(s.unref(Mb),{class:"h-4 w-4"})],8,B8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.next"),onClick:p},[s.createVNode(s.unref(en),{class:"h-4 w-4"})],8,P8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800",title:s.unref(n)("editor.findReplace.close"),onClick:v},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,F8)]),s.createElementVNode("div",V8,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[1]||(k[1]=w=>l.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.replacePlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:s.withKeys(s.withModifiers(g,["prevent"]),["enter"])},null,40,U8),[[s.vModelText,l.value]]),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:g},s.toDisplayString(s.unref(n)("editor.findReplace.replace")),9,H8),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:b},s.toDisplayString(s.unref(n)("editor.findReplace.replaceAll")),9,q8)])],8,z8)):s.createCommentVNode("",!0)}}),$8={class:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-6 shadow-xl dark:border-slate-700 dark:bg-slate-800"},W8={class:"mb-4 flex items-center justify-between"},G8={class:"flex items-center gap-2 text-base font-semibold text-slate-900 dark:text-slate-100"},K8={class:"mb-4"},X8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},J8=["placeholder"],Z8={class:"mb-2"},Q8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},Y8=["placeholder"],eT={key:0,class:"mt-1 text-[11px] text-red-600 dark:text-red-400"},tT={class:"flex items-center justify-end gap-2 pt-2"},nT=s.defineComponent({__name:"LinkDialog",props:{isOpen:{type:Boolean},initialText:{},initialUrl:{},isEditing:{type:Boolean}},emits:["apply","remove","close"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(""),o=s.ref(""),l=s.ref("");s.watch(()=>i.isOpen,g=>{g&&(a.value=i.initialText??"",o.value=i.initialUrl??"https://",l.value="")});function c(){const g=o.value.trim();if(!g)return l.value=n("editor.linkDialog.urlRequired"),!1;if(/^(\/|#|mailto:|tel:)/.test(g))return l.value="",!0;try{return new URL(g),l.value="",!0}catch{return l.value=n("editor.linkDialog.urlInvalid"),!1}}function u(g){const b=g.trim();return/^(\/|#|mailto:|tel:)/.test(b)||/^https?:\/\//i.test(b)?b:`https://${b}`}function f(){c()&&r("apply",{text:a.value.trim(),url:u(o.value)})}function m(){r("remove")}function p(){r("close")}function h(g){g.key==="Escape"&&p()}return(g,b)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:s.withModifiers(p,["self"]),onKeydown:h},[s.createElementVNode("div",$8,[s.createElementVNode("div",W8,[s.createElementVNode("h3",G8,[s.createVNode(s.unref(ql),{class:"h-5 w-5 text-slate-500 dark:text-slate-400"}),s.createTextVNode(" "+s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.editTitle"):s.unref(n)("editor.linkDialog.insertTitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-sm text-slate-400 transition-all hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-700 dark:hover:text-slate-300",onClick:p},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),s.createElementVNode("div",K8,[s.createElementVNode("label",X8,s.toDisplayString(s.unref(n)("editor.linkDialog.text")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=y=>a.value=y),type:"text",placeholder:s.unref(n)("editor.linkDialog.textPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,J8),[[s.vModelText,a.value]])]),s.createElementVNode("div",Z8,[s.createElementVNode("label",Q8,s.toDisplayString(s.unref(n)("editor.linkDialog.url")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=y=>o.value=y),type:"text",placeholder:s.unref(n)("editor.linkDialog.urlPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,Y8),[[s.vModelText,o.value]]),l.value?(s.openBlock(),s.createElementBlock("p",eT,s.toDisplayString(l.value),1)):s.createCommentVNode("",!0)]),s.createElementVNode("div",tT,[e.isEditing?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"mr-auto flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-semibold text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40",onClick:m},[s.createVNode(s.unref(kr),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.linkDialog.remove")),1)])):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:p},s.toDisplayString(s.unref(n)("editor.linkDialog.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition-all hover:bg-cyan-700",onClick:f},s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.update"):s.unref(n)("editor.linkDialog.insert")),1)])])],32)):s.createCommentVNode("",!0)}});async function rf(e,t){var n,i;if(typeof document>"u")return!1;try{if(t&&typeof ClipboardItem<"u"&&((n=navigator.clipboard)!=null&&n.write)){const r=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});return await navigator.clipboard.write([r]),!0}if((i=navigator.clipboard)!=null&&i.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");return r.remove(),a}catch{return!1}}async function iT(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.read))return null;try{const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes("text/html"))return await(await n.getType("text/html")).text();for(const n of t)if(n.types.includes("text/plain"))return await(await n.getType("text/plain")).text();return null}catch{return null}}async function Us(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return null;try{return await navigator.clipboard.readText()}catch{return null}}const rT={class:"docs-editor flex h-screen w-full flex-col overflow-hidden bg-slate-50 transition-colors dark:bg-[#02040a]"},aT=["title","aria-label"],oT={class:"docs-editor__body relative flex flex-1 overflow-hidden"},sT=["title"],lT={class:"flex flex-1 flex-col items-center gap-4 w-full relative"},cT=["aria-label"],uT={key:5,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},dT={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},fT={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},pT={class:"mb-6"},mT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},hT={class:"space-y-4"},bT={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},gT={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},vT={class:"mb-8"},xT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},yT={class:"space-y-3"},kT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},wT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},_T={class:"flex justify-end items-center gap-3"},ST={key:6,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},CT={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},ET={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},AT={class:"mb-6"},TT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},NT={class:"space-y-3"},OT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},MT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},DT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none pt-1"},zT=["checked"],IT={class:"mb-6"},RT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},LT=["aria-label"],BT=["title","onClick"],PT={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},FT=["d"],VT={class:"text-[11px] text-slate-400 dark:text-slate-500 mt-1.5"},UT={class:"mb-8"},HT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},qT={class:"space-y-3"},jT={class:"flex items-center gap-3"},$T={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},WT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},GT={class:"pt-2"},KT={class:"block text-xs font-medium text-slate-600 dark:text-slate-400 mb-1.5"},XT=["placeholder"],JT={class:"text-[11px] text-slate-400 dark:text-slate-500 mt-1"},ZT={class:"flex justify-end items-center gap-3"},QT={key:7,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},YT={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},eN={class:"text-lg font-bold mb-4"},tN={class:"mb-4"},nN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},iN=["value"],rN={class:"mb-4"},aN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},oN={class:"flex gap-2"},sN={class:"mb-6"},lN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},cN={class:"grid grid-cols-2 gap-3"},uN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},dN=["max"],fN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},pN=["max"],mN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},hN=["max"],bN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},gN=["max"],vN={class:"flex justify-end gap-2"},xN=189,rr=37.795,Hs=0,qs=5,af=.1,Oi=0,yN=s.defineComponent({__name:"DocsEditor",props:{modelValue:{default:void 0},plugins:{default:()=>[]},editable:{type:Boolean,default:!0},collaboration:{default:void 0},pageSize:{default:"a4"},pageless:{type:Boolean,default:!1},virtualPages:{type:Boolean,default:!1},title:{default:"Untitled Document"},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},connectionState:{default:"connected"},userName:{default:""},userAvatar:{default:""},locale:{default:void 0},documentMeta:{default:void 0},shareUrl:{default:""},onImageUpload:{type:Function,default:void 0},citation:{default:void 0},aiStream:{type:Function,default:void 0},aiDraft:{type:Function,default:void 0},onAiChat:{type:Function,default:void 0},debug:{type:Boolean,default:!1},comments:{default:()=>[]},selectedTextSnippet:{default:""},selectedTextIndex:{default:void 0},snapshots:{default:()=>[]},activePreviewIndex:{default:null},orientation:{default:"portrait"},margins:{default:()=>({top:94,bottom:94,left:94,right:94})},headerMarginCm:{default:.5},footerMarginCm:{default:.5}},emits:["update:modelValue","update:title","update:pageSize","update:orientation","update:margins","update:header-footer-margins","update:pageless","update:pageCount","update:locale","citation-sources-change","update:citation-style","toggle-star","back","share","menu-click","export","ready","add-comment","add-reply","resolve-comment","delete-comment","save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){var Zc,Qc,Yc,eu,tu;const n=e,i=t,{locale:r,setLocale:a,t:o}=pf(n.locale);s.watch(()=>n.locale,C=>{C&&C!==r.value&&a(C)}),s.watch(r,C=>{i("update:locale",C)});const l=s.ref({top:((Zc=n.margins)==null?void 0:Zc.top)??94,bottom:((Qc=n.margins)==null?void 0:Qc.bottom)??94,left:((Yc=n.margins)==null?void 0:Yc.left)??94,right:((eu=n.margins)==null?void 0:eu.right)??94});function c(C,T=.5){const M=typeof C=="number"?C:Number(C);if(!Number.isFinite(M))return T;const Q=Math.min(qs,Math.max(Hs,M));return Math.round(Q*10)/10}const u=s.ref(n.orientation??"portrait"),f=s.ref(n.pageSize??"a4"),m=s.ref(n.pageless??!1);s.watch(()=>n.orientation,C=>{C!==void 0&&(u.value=C)}),s.watch(()=>n.margins,C=>{C!==void 0&&(l.value={...C})}),s.watch(()=>n.headerMarginCm,C=>{typeof C=="number"&&Number.isFinite(C)&&(fn.value=c(C))}),s.watch(()=>n.footerMarginCm,C=>{typeof C=="number"&&Number.isFinite(C)&&(pn.value=c(C))});const p=s.computed(()=>{const C=ar.getPageSize(f.value)??ar.PAGE_SIZES[0];let T=C.pageWidth,M=C.pageHeight;return u.value==="landscape"&&([T,M]=[M,T]),{pageHeight:M,pageWidth:T,margins:{...l.value}}}),h=s.computed(()=>`${p.value.pageWidth}px`),{isDark:g}=Ro(),b=s.computed(()=>n.virtualPages===!0),y=s.computed(()=>({enabled:!m.value&&!b.value,pageHeight:p.value.pageHeight,pageWidth:p.value.pageWidth,marginTop:p.value.margins.top,marginBottom:p.value.margins.bottom,marginLeft:p.value.margins.left,marginRight:p.value.margins.right,contentMarginTop:0,contentMarginBottom:0,pageGap:40,pageBreakBackground:g.value?"#02040a":"#f1f5f9",headerLeft:"",headerRight:"",footerLeft:"",footerRight:"",onHeaderClick:C=>{var T;((T=C==null?void 0:C.event)==null?void 0:T.detail)===2&&ca(C==null?void 0:C.event)},onFooterClick:C=>{var T;((T=C==null?void 0:C.event)==null?void 0:T.detail)===2&&ua(C==null?void 0:C.event)}})),v=C=>{const T=C;return T&&typeof T=="object"&&T.type==="tabbed-doc"&&Array.isArray(T.tabs)?T:{type:"tabbed-doc",activeTabId:"tab-1",tabs:[{id:"tab-1",label:"Tab 1",content:C||{type:"doc",content:[{type:"paragraph"}]}}]}},x=C=>{if(!Array.isArray(C))return[];const T=new Set;for(const M of C)typeof M=="number"&&Number.isFinite(M)&&M>=1&&T.add(Math.floor(M));return[...T].sort((M,Q)=>M-Q)},k=v(n.modelValue),w=s.ref(k.headerLeft||""),S=s.ref(k.headerRight||""),A=s.ref(k.footerLeft||""),I=s.ref(k.footerRight||""),_=s.ref(k.headerAlign),E=s.ref(k.footerAlign),z=s.ref(k.tabs.map(C=>({id:C.id,label:C.label,active:C.id===k.activeTabId}))),P=s.ref({});k.tabs.forEach(C=>{P.value[C.id]=C.content});const U=s.ref(k.activeTabId),V=s.computed(()=>P.value[U.value]),B=s.ref(!1),j=s.ref(null),$=s.ref(null);let Y=null;const W=s.ref(localStorage.getItem("docflow:view:showRuler")!=="false"),oe=s.ref(!1);s.watch(W,C=>{localStorage.setItem("docflow:view:showRuler",C?"true":"false")});const R=s.ref(0),N=s.ref(0),L=s.ref("saved"),D=s.ref(Date.now()),K=s.ref(null),ne=s.ref(new Set);let ee=null;const ie=s.ref(!1);function G(){if(!O.value||!X.value)return;const C=O.value.state.doc;if(n.collaboration&&!ie.value&&C.content.size<=2)return;ie.value=!0;const T=new Set;C.descendants(M=>{for(const Q of M.marks)Q.type.name==="comment"&&Q.attrs.threadId&&T.add(Q.attrs.threadId);return!0}),ne.value=T}function H(){ee&&clearTimeout(ee),ee=setTimeout(G,200)}const q=s.computed(()=>{if(!ie.value)return[];const C=ne.value;return(n.comments??[]).filter(T=>T.anchorIndex!=null&&!C.has(T.id)).map(T=>T.id)});s.onUnmounted(()=>{ee&&clearTimeout(ee)});const re=s.computed(()=>{const C=[];for(const T of n.plugins)for(const M of T.slashCommands||[])C.push({name:M.name,command:M.command});return C}),ce=()=>{const C={type:"tabbed-doc",activeTabId:U.value,tabs:z.value.map(T=>({id:T.id,label:T.label,content:P.value[T.id]})),headerLeft:w.value,headerRight:S.value,footerLeft:A.value,footerRight:I.value,headerAlign:_.value,footerAlign:E.value,hiddenPageNumbers:Ji.value};i("update:modelValue",C),L.value="saving",K.value&&clearTimeout(K.value),K.value=setTimeout(()=>{L.value="saved",D.value=Date.now()},800)},fe=s.ref((()=>{var T;const C=(T=n.citation)==null?void 0:T.sources;return Array.isArray(C)?[...C]:typeof C=="function"?[...C()]:[]})()),Oe=s.ref(((tu=n.citation)==null?void 0:tu.style)||"chicago-notes-bibliography");let pe=null;const Se=s.ref(!1),ut=C=>{pe==null||pe(C),pe=null,Se.value=!1},Jt=()=>new Promise(C=>{ut(null),pe=C,Se.value=!0,$.value="references"}),Le=s.computed(()=>{const C=n.citation;if(C)return{...C,sources:()=>fe.value,onSourceRequest:C.onSourceRequest??Jt}}),{editorRef:Ut,editor:O,pluginActions:F,isReady:X,docsEditor:ze}=of({content:V,plugins:n.plugins,editable:n.editable,collaboration:s.computed(()=>n.collaboration),onImageUpload:n.onImageUpload,citation:Le.value,aiStream:n.aiStream,aiDraft:n.aiDraft,debug:n.debug,getPageMap:()=>new Map,paginationOptions:y.value,onUpdate:C=>{P.value[U.value]=C,ce()}}),Xe=()=>{var C,T,M;return((M=(T=(C=O.value)==null?void 0:C.storage)==null?void 0:T.citationEngine)==null?void 0:M.engine)??null},He=()=>{var C;(C=Xe())==null||C.updateSources(fe.value),i("citation-sources-change",fe.value)},un=C=>{fe.value=[...fe.value,C],He()},Nn=C=>{fe.value=fe.value.map(T=>T.id===C.id?C:T),He()},Yn=C=>{fe.value=fe.value.filter(T=>T.id!==C),He()},Ht=C=>{var T;Oe.value=C,(T=Xe())==null||T.setStyle(C),i("update:citation-style",C)},On=C=>{var T,M;pe?(ut(C),$.value=null):(M=(T=F.value).insertCitation)==null||M.call(T,{sourceId:C})};s.watch($,(C,T)=>{T==="references"&&C!=="references"&&ut(null)});const qe=s.ref(!1),Nt=s.ref(""),$i=s.computed(()=>{var C,T;return!!((C=n.citation)!=null&&C.onImportDoi||(T=n.citation)!=null&&T.onImportBibliography)}),qr=async C=>{const T=n.citation;if(!(!(T!=null&&T.onImportDoi)||qe.value)){qe.value=!0,Nt.value="";try{const M=await T.onImportDoi(C);if(!M){Nt.value=o("sidebars.references.import.doiFailed");return}const Q=fe.value.some(se=>se.id===M.id);fe.value=Q?fe.value.map(se=>se.id===M.id?M:se):[...fe.value,M],He(),Nt.value=o("sidebars.references.import.doiSuccess")}catch{Nt.value=o("sidebars.references.import.doiFailed")}finally{qe.value=!1}}},jr=async C=>{const T=n.citation;if(!(!(T!=null&&T.onImportBibliography)||qe.value)){qe.value=!0,Nt.value="";try{const{imported:M,failed:Q}=await T.onImportBibliography(C);if(M.length>0){const se=new Map(fe.value.map(de=>[de.id,de]));for(const de of M)se.set(de.id,de);fe.value=[...se.values()],He()}Nt.value=Q>0?o("sidebars.references.import.partial").replace("{ok}",String(M.length)).replace("{failed}",String(Q)):o("sidebars.references.import.batchSuccess").replace("{count}",String(M.length))}catch{Nt.value=o("sidebars.references.import.failed")}finally{qe.value=!1}}},Wi=()=>{var T;const C=((T=O.value)==null?void 0:T.getText())??"";N.value=C.length,R.value=C.trim()?C.trim().split(/\s+/).length:0},$r=()=>{if(!O.value)return null;const{from:C,to:T,head:M}=O.value.state.selection;if(C===T)return null;const Q=O.value.view.coordsAtPos(M);if(!Q)return null;const se=12,de=180,ye=Q.top-48,ve=(Q.left+Q.right)/2;if(typeof window>"u")return{top:Math.max(se,ye),left:ve};const me=Math.min(de,Math.max(0,window.innerWidth/2-se)),ue=se+me,le=window.innerWidth-se-me,he=Math.max(se,window.innerHeight-48);return{top:Math.min(he,Math.max(se,ye)),left:Math.min(le,Math.max(ue,ve))}},Wr=()=>{if(!O.value){B.value=!1,j.value=null;return}const{from:C,to:T}=O.value.state.selection;B.value=C!==T,j.value=C!==T?$r():null},wt=s.ref(null),qt=()=>{B.value&&(j.value=$r())},jt=s.ref(1),gt=s.ref(1),Gi=s.computed(()=>{const C=p.value;return{pageSize:{id:f.value,name:f.value.toUpperCase(),pageWidth:C.pageWidth,pageHeight:C.pageHeight},margins:{top:C.margins.top,bottom:C.margins.bottom,left:C.margins.left,right:C.margins.right},pageGap:40,headerLeft:w.value,headerRight:S.value,footerLeft:A.value,footerRight:I.value}}),{data:Jo,totalPages:wi,isReady:dn,refreshData:Gr}=cb({editorRef:s.computed(()=>O.value),scrollRef:wt,config:Gi.value,bufferPages:2,enabled:b});s.watch([wi,dn],()=>{b.value&&dn.value&&(jt.value=wi.value)}),s.watch(b,C=>{C&&Gr()});const ei=()=>{if(!O.value||!X.value){jt.value=1,gt.value=1;return}const C=O.value.view.dom,T=C.querySelector("[data-rm-pagination]");T?jt.value=T.children.length||1:jt.value=1;try{const{selection:M}=O.value.state,Q=O.value.view.coordsAtPos(M.head);if(Q&&T){const se=Array.from(T.querySelectorAll(".rm-page-break")),de=C.getBoundingClientRect(),ye=Q.top-de.top+C.scrollTop;let ve=1,me=!1;for(let ue=0;ue<se.length;ue++){const le=se[ue].querySelector(".breaker");if(le instanceof HTMLElement&&ye<le.offsetTop){gt.value=ve,me=!0;break}ve++}me||(gt.value=ve)}else gt.value=1}catch{gt.value=1}};s.watch(p,C=>{O.value&&(O.value.commands.updatePageHeight(C.pageHeight),O.value.commands.updatePageWidth(C.pageWidth),O.value.commands.updateMargins({top:C.margins.top,bottom:C.margins.bottom,left:C.margins.left,right:C.margins.right}),ei())});const Ot=C=>{C!==m.value&&(m.value=C,i("update:pageless",C),O.value&&(C?O.value.commands.disablePagination():O.value.commands.enablePagination(),setTimeout(()=>{ei(),da()},60)))};s.watch(()=>n.pageless,C=>Ot(C??!1));const Je=s.ref(!1),$t=s.ref(!1),ti=s.ref(""),Lc=s.ref(""),Zo=s.ref(""),Nh=s.ref(""),fn=s.ref(c(n.headerMarginCm)),pn=s.ref(c(n.footerMarginCm)),Kr=s.ref(!1),Ki=s.ref(fn.value),Xi=s.ref(pn.value),Xr=s.ref(!1),Jr=s.ref(!1),Zr=s.ref(!1),ni=s.ref("header"),Ji=s.ref(x(k.hiddenPageNumbers)),Qr=s.ref("startAt"),Yr=s.ref(1),Mn=s.ref("header"),_i=s.ref([]),Si=s.ref(""),Ci=s.ref("startAt"),ea=s.ref(1),ta=s.ref(_.value),na=s.ref(E.value),Qo=s.ref(!1),Oh=s.computed(()=>Yo.value??"right"),Yo=s.computed({get:()=>Mn.value==="footer"?na.value:ta.value,set:C=>{Mn.value==="footer"?na.value=C:ta.value=C}}),Mh=C=>{Qo.value=!0,Yo.value=Yo.value===C?void 0:C},Dh=C=>({left:"M21 5H3 M15 12H3 M17 19H3",center:"M21 5H3 M17 12H7 M19 19H5",right:"M21 5H3 M21 12H9 M21 19H7"})[C],zh=s.computed(()=>!_i.value.includes(1)),Ih=C=>{const T=C.target.checked;let M=_i.value;T?M=M.filter(Q=>Q!==1):M.includes(1)||(M=[...M,1].sort((Q,se)=>Q-se)),_i.value=M,Si.value=Pc(M)};s.watch(Si,C=>{_i.value=Bc(C)});const Bc=C=>{const T=new Set;for(const M of String(C||"").split(",")){const Q=M.trim();if(!Q)continue;const se=Q.match(/^(\d+)\s*-\s*(\d+)$/);if(se){const de=Math.max(1,Number(se[1])),ye=Math.max(de,Number(se[2]));for(let ve=de;ve<=ye;ve++)T.add(ve)}else/^\d+$/.test(Q)&&T.add(Math.max(1,Number(Q)))}return[...T].sort((M,Q)=>M-Q)},Pc=C=>{const T=[...C].filter(de=>Number.isFinite(de)&&de>=1).sort((de,ye)=>de-ye);if(T.length===0)return"";const M=[];let Q=T[0],se=T[0];for(let de=1;de<=T.length;de++){const ye=T[de];if(ye===se+1){se=ye;continue}M.push(Q===se?String(Q):`${Q}-${se}`),Q=ye,se=ye}return M.join(", ")},es=C=>{const T=C+1;if(Ji.value.includes(T))return"";let M=T;return Qr.value==="startAt"&&(M=C+Yr.value),String(M)};let ts=!1;const Bt=(C=!0)=>{if(!(!O.value||!X.value||ts)){ts=!0;try{const T=String(jt.value),M=O.value.view.dom;(()=>{const le=(he,Ce)=>{M.classList.remove(`rm-hf-${he}-align-left`,`rm-hf-${he}-align-center`,`rm-hf-${he}-align-right`),Ce&&M.classList.add(`rm-hf-${he}-align-${Ce}`)};le("header",_.value),le("footer",E.value)})();const se=w.value.replace(/{total}/g,T),de=S.value.replace(/{total}/g,T),ye=A.value.replace(/{total}/g,T),ve=I.value.replace(/{total}/g,T);O.value.commands.updateHeaderContent(se,de),O.value.commands.updateFooterContent(ye,ve);const me=`${Math.max(0,fn.value)*rr}px`,ue=`${Math.max(0,pn.value)*rr}px`;M.style.setProperty("--rm-header-margin-top",me),M.style.setProperty("--rm-footer-margin-bottom",ue),C&&O.value.view.dispatch(O.value.state.tr),setTimeout(()=>{requestAnimationFrame(()=>{if(!O.value||O.value.view.dom!==M)return;const le=(Te,Ne)=>{let Me=se,De=de;return Ne&&Je.value?(Me=ti.value.replace(/{total}/g,T),De=Lc.value.replace(/{total}/g,T)):$t.value&&Te%2===0&&(Me=Zo.value.replace(/{total}/g,T),De=Nh.value.replace(/{total}/g,T)),{left:Me.replace(/{page}/g,es(Te-1)),right:De.replace(/{page}/g,es(Te-1))}},he=(Te,Ne,Me)=>{const De=le(Ne,Me),Ie=Te.querySelector(".rm-page-header-left"),Ve=Te.querySelector(".rm-page-header-right");Ie&&(Ie.innerHTML=De.left),Ve&&(Ve.innerHTML=De.right)},Ce=M.querySelector(".rm-first-page-header");Ce&&he(Ce,1,!0),Array.from(M.querySelectorAll(".rm-page-break .rm-page-header")).forEach((Te,Ne)=>{he(Te,Ne+2,!1)}),Array.from(M.querySelectorAll(".rm-page-break .rm-page-footer")).forEach((Te,Ne)=>{const Me=Ne+1,De=es(Me-1),Ie=Te.querySelector(".rm-page-footer-left"),Ve=Te.querySelector(".rm-page-footer-right");Ie&&(Ie.innerHTML=ye.replace(/{page}/g,De)),Ve&&(Ve.innerHTML=ve.replace(/{page}/g,De))})})},50)}finally{ts=!1}}};s.watch(Je,()=>{Bt()}),s.watch([$t,fn,pn,ni,Ji,Qr,Yr],()=>{Bt()}),s.watch(jt,C=>{Bt(!1),i("update:pageCount",C)}),s.watch(g,C=>{O.value&&(O.value.commands.updatePageBreakBackground(C?"#02040a":"#f1f5f9"),O.value.view.dispatch(O.value.state.tr))}),s.watch(y,C=>{if(!O.value||!X.value)return;const T=O.value.storage.PaginationPlus;!T||!(T.pageHeight!==C.pageHeight||T.pageWidth!==C.pageWidth||T.marginTop!==C.marginTop||T.marginBottom!==C.marginBottom||T.marginLeft!==C.marginLeft||T.marginRight!==C.marginRight||T.pageGap!==C.pageGap||T.contentMarginTop!==C.contentMarginTop||T.contentMarginBottom!==C.contentMarginBottom||T.pageBreakBackground!==C.pageBreakBackground||T.enabled!==C.enabled)||(T.pageHeight=C.pageHeight,T.pageWidth=C.pageWidth,T.marginTop=C.marginTop,T.marginBottom=C.marginBottom,T.marginLeft=C.marginLeft,T.marginRight=C.marginRight,T.pageGap=C.pageGap,T.contentMarginTop=C.contentMarginTop,T.contentMarginBottom=C.contentMarginBottom,T.pageBreakBackground=C.pageBreakBackground,T.enabled=C.enabled,O.value.view.dispatch(O.value.state.tr))},{deep:!0}),s.watch(X,C=>{var T,M,Q,se,de,ye,ve,me;C&&O.value&&(!w.value&&!S.value&&!A.value&&!I.value&&(w.value=((M=(T=O.value.storage.PaginationPlus)==null?void 0:T.appliedConfig)==null?void 0:M.headerLeft)||"",S.value=((se=(Q=O.value.storage.PaginationPlus)==null?void 0:Q.appliedConfig)==null?void 0:se.headerRight)||"",A.value=((ye=(de=O.value.storage.PaginationPlus)==null?void 0:de.appliedConfig)==null?void 0:ye.footerLeft)||"",I.value=((me=(ve=O.value.storage.PaginationPlus)==null?void 0:ve.appliedConfig)==null?void 0:me.footerRight)||""),Uc(),Bt(),ze.value&&i("ready",ze.value),O.value.on("selectionUpdate",()=>{Wr(),ei()}),O.value.on("transaction",()=>{ei(),Wi(),H()}),Wr(),Wi(),ei(),H(),setTimeout(()=>{var le;return(le=O.value)==null?void 0:le.commands.focus("start")},50),[100,300,600,1200,2500].forEach(le=>{setTimeout(()=>{O.value&&O.value.view.dispatch(O.value.state.tr)},le)}),O.value.view.dom.addEventListener("keydown",le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),Fc())}),Y&&O.value.view.dom.removeEventListener("keydown",Y),Y=le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="l"&&(le.preventDefault(),ls())},O.value.view.dom.addEventListener("keydown",Y),O.value.view.dom.addEventListener("click",le=>{const he=le.target;if(!he||le.detail!==2||he.closest('.rm-google-docs-header-bar, .rm-google-docs-footer-bar, .rm-options-dropdown, [contenteditable="true"]'))return;if(he.closest(".rm-page-header, .rm-first-page-header")){ca(le);return}if(he.closest(".rm-page-footer")){ua(le);return}const Ne=he.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ne){const Me=Ne.getBoundingClientRect(),De=le.clientY-Me.top,Ie=fn.value*37.795;if(De>=0&&De<=Math.max(Ie,40)+15){let $e=null;Ne.classList.contains("rm-page-break")&&($e=Ne.querySelector(".rm-page-header")),$e||($e=document.querySelector(".rm-page-header, .rm-first-page-header")),$e&&ca(le);return}const Ve=Me.bottom-le.clientY,xt=pn.value*37.795;if(Ve>=0&&Ve<=Math.max(xt,40)+15){let $e=null;Ne.classList.contains("rm-page-break")&&($e=Ne.querySelector(".rm-page-footer")),$e||($e=document.querySelector(".rm-page-footer")),$e&&ua(le)}}}))}),s.onUnmounted(()=>{mn(!1),K.value&&clearTimeout(K.value),Ai&&clearTimeout(Ai),hn&&clearTimeout(hn),window.removeEventListener("resize",Jc)});const ia=s.ref(!1),ns=s.ref(!1),is=s.ref(!1),ra=s.ref(!1),Zi=s.ref(!1),aa=s.ref(""),rs=s.ref(""),oa=s.ref(!1);function Fc(){if(!O.value)return;const{state:C}=O.value,{from:T,to:M,empty:Q}=C.selection,se=O.value.getAttributes("link");se.href?(oa.value=!0,rs.value=se.href,Q?aa.value="":aa.value=C.doc.textBetween(T,M," ")):(oa.value=!1,rs.value="https://",aa.value=Q?"":C.doc.textBetween(T,M," ")),Zi.value=!0}function Rh(C){if(!O.value)return;const{state:T}=O.value,{from:M,to:Q,empty:se}=T.selection,de=C.text.trim(),ye=O.value.chain().focus();oa.value||O.value.isActive("link")?(ye.setLink({href:C.url,target:"_blank"}).run(),de&&!se&&ye.insertContentAt({from:M,to:Q},de).run()):de?ye.insertContentAt({from:M,to:Q},{type:"text",text:de,marks:[{type:"link",attrs:{href:C.url,target:"_blank"}}]}).run():se?ye.insertContent({type:"text",text:C.url,marks:[{type:"link",attrs:{href:C.url,target:"_blank"}}]}).run():ye.setLink({href:C.url,target:"_blank"}).run(),Zi.value=!1}function Lh(){if(!O.value)return;O.value.chain().focus().unsetLink().run(),Zi.value=!1}const sa=s.ref(f.value),ii=s.ref(u.value),et=s.ref({top:Dn(l.value.top),bottom:Dn(l.value.bottom),left:Dn(l.value.left),right:Dn(l.value.right)}),Qi=Number((xN/rr).toFixed(1));function Dn(C){return Math.round(C/rr*10)/10}function la(C){return Math.round(C*rr)}const Bh=()=>{sa.value=f.value,ii.value=u.value,et.value={top:Dn(l.value.top),bottom:Dn(l.value.bottom),left:Dn(l.value.left),right:Dn(l.value.right)},ia.value=!0},Ph=()=>{const C=T=>{const M=typeof T=="number"?T:Number(T);return Number.isFinite(M)?Math.min(Qi,Math.max(Oi,M)):Oi};f.value=sa.value,u.value=ii.value,et.value={top:C(et.value.top),bottom:C(et.value.bottom),left:C(et.value.left),right:C(et.value.right)},l.value={top:la(et.value.top),bottom:la(et.value.bottom),left:la(et.value.left),right:la(et.value.right)},i("update:pageSize",f.value),i("update:orientation",ii.value),i("update:margins",{...l.value}),ia.value=!1},as=s.ref(!1),zn={value:null},ss=s.ref(!1),In={value:null},Fh=()=>{Ki.value=fn.value,Xi.value=pn.value,Xr.value=Je.value,Jr.value=$t.value,Kr.value=!0},Vh=()=>{fn.value=c(Ki.value),pn.value=c(Xi.value),Ki.value=fn.value,Xi.value=pn.value,Je.value=Xr.value,$t.value=Jr.value,Kr.value=!1,Bt(),i("update:header-footer-margins",{headerMarginCm:fn.value,footerMarginCm:pn.value}),ce()},Vc=()=>{Uc(),Mn.value=ni.value,_i.value=[...Ji.value],Si.value=Pc(_i.value),Ci.value=Qr.value,ea.value=Yr.value,ta.value=_.value,na.value=E.value,Qo.value=!1,Zr.value=!0},Uc=()=>{const C="{page}",T=[w.value,S.value].some(Q=>Q.includes(C));[A.value,I.value].some(Q=>Q.includes(C))&&!T?ni.value="footer":ni.value="header"},Uh=()=>{ni.value=Mn.value,Ji.value=Bc(Si.value),Qr.value=Ci.value,Yr.value=ea.value,Zr.value=!1;const C="{page}";ni.value==="footer"?(S.value.includes(C)&&(S.value=S.value.replace(/{page}/g,"").trim()),I.value=C):(I.value.includes(C)&&(I.value=I.value.replace(/{page}/g,"").trim()),S.value=C),Qo.value&&(ni.value==="footer"?E.value=na.value:_.value=ta.value),Bt(),ce()},Hh=()=>{w.value="",S.value="",Bt(),ce(),as.value=!1},qh=()=>{A.value="",I.value="",Bt(),ce(),ss.value=!1},jh=()=>A.value,$h=C=>{const T=C===1,M=C%2===0;return Je.value&&T?ti.value:$t.value&&M?Zo.value:w.value},mn=(C=!0)=>{var Q;const T=zn.value;if(!T)return;const M=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(Q=wt.value)==null||Q.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetHeader.classList.remove("rm-header-active"),zn.value=null,as.value=!1,C&&(Je.value&&T.isFirstPage?ti.value=M:$t.value&&T.pageIndex%2===0?Zo.value=M:w.value=M,Bt(),ce())},Ei=(C=!0)=>{var Q;const T=In.value;if(!T)return;const M=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(Q=wt.value)==null||Q.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetFooter.classList.remove("rm-footer-active"),In.value=null,ss.value=!1,C&&(A.value=M,Bt(),ce())},Hc=C=>{if(!C.targetHeader.parentNode||!O.value)return;const T=O.value.view.dom,M=C.targetHeader.getBoundingClientRect(),Q=T.getBoundingClientRect(),se=getComputedStyle(T),de=parseFloat(se.getPropertyValue("--rm-margin-left"))||0,ye=parseFloat(se.getPropertyValue("--rm-margin-right"))||0,ve=C.targetHeader.querySelector(".rm-page-header-content"),me=(ve==null?void 0:ve.getBoundingClientRect())??M,ue=C.isFirstPage?M.left:M.left+de,le=C.isFirstPage?M.right:M.right-ye,he=Math.max(0,ue-Q.left),Ce=Math.max(0,Q.right-le);C.overlay.style.left=`${ue}px`,C.overlay.style.top=`${me.top}px`,C.overlay.style.width=`${Math.max(le-ue,1)}px`,C.overlay.style.height=`${Math.max(me.height,24)}px`,C.activeBar.style.setProperty("--rm-header-bar-left",`${-he}px`),C.activeBar.style.setProperty("--rm-header-bar-width",`${Q.width}px`),C.activeBar.style.setProperty("--rm-header-bar-padding-left",`${he}px`),C.activeBar.style.setProperty("--rm-header-bar-padding-right",`${Ce}px`)},qc=C=>{if(!C.targetFooter.parentNode||!O.value)return;const T=O.value.view.dom,M=C.targetFooter.getBoundingClientRect(),Q=T.getBoundingClientRect(),se=getComputedStyle(T),de=parseFloat(se.getPropertyValue("--rm-margin-left"))||0,ye=parseFloat(se.getPropertyValue("--rm-margin-right"))||0,ve=C.targetFooter.querySelector(".rm-page-footer-content"),me=(ve==null?void 0:ve.getBoundingClientRect())??M,ue=M.left+de,le=M.right-ye,he=Math.max(0,ue-Q.left),Ce=Math.max(0,Q.right-le);C.overlay.style.left=`${ue}px`,C.overlay.style.top=`${me.top}px`,C.overlay.style.width=`${Math.max(le-ue,1)}px`,C.overlay.style.height=`${Math.max(me.height,24)}px`,C.activeBar.style.setProperty("--rm-footer-bar-left",`${-he}px`),C.activeBar.style.setProperty("--rm-footer-bar-width",`${Q.width}px`),C.activeBar.style.setProperty("--rm-footer-bar-padding-left",`${he}px`),C.activeBar.style.setProperty("--rm-footer-bar-padding-right",`${Ce}px`)},ca=C=>{var xn,nu;const T=In.value;if(T){const xe=C==null?void 0:C.target;if(xe instanceof Node&&T.overlay.contains(xe))return;Ei(!0)}const M=zn.value;if(M){const xe=C==null?void 0:C.target;if(!xe||xe instanceof Node&&M.targetHeader.contains(xe))return;mn(!1)}let Q=null;if(C){const xe=C.target;Q=xe==null?void 0:xe.closest(".rm-page-header, .rm-first-page-header")}if(Q||(Q=(xn=O.value)==null?void 0:xn.view.dom.querySelector(".rm-first-page-header, .rm-page-header")),!Q||!O.value)return;const se=O.value.view.dom,de=Q.classList.contains("rm-first-page-header"),ye=Array.from(se.querySelectorAll(".rm-page-break .rm-page-header")),ve=de?1:ye.indexOf(Q)+2;if(!de&&ve<2)return;const me=Q.querySelector(".rm-page-header-content");me&&(me.style.visibility="hidden");const ue=document.createElement("div");ue.className="rm-header-edit-input",ue.contentEditable="true",ue.setAttribute("role","textbox"),ue.setAttribute("aria-label",o("editor.headerFooter.header")||"Header"),ue.dataset.placeholder=o("editor.headerFooter.headerPlaceholder")||"Header",ue.innerHTML=$h(ve);const le=document.createElement("div");le.className="rm-header-edit-overlay",le.appendChild(ue);const he=document.createElement("div");he.className="rm-google-docs-header-bar",he.innerHTML=`
15242
+ `," ")}}function I(){const R=A();return{before:(R==null?void 0:R.before)??"",after:(R==null?void 0:R.after)??"",...k.value}}async function _(){await s.nextTick(),m.value&&(m.value.scrollTop=m.value.scrollHeight)}async function E(R,N){const L=h.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:N}),o.value.push({role:"assistant",text:"",streaming:!0});const D=o.value.length-1;await _();try{for await(const K of L(R,p.signal))o.value[D].text+=K,_();o.value[D].text||(o.value[D].text=r("sidebars.ai.emptyResponse"),o.value[D].error=!0)}catch(K){p.signal.aborted||(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K instanceof Error?K.message:String(K)}`,o.value[D].error=!0)}finally{o.value[D].streaming=!1,c.value=!1,p=null,_()}}function z(){const R=l.value.trim();if(!R||c.value)return;if(l.value="",b.value){P({prompt:R,context:I()},R);return}const N=x.value;E({action:"chat",prompt:R,...N?{selection:N.text}:{},context:I()},R)}async function P(R,N){const L=g.value;if(!L||c.value)return;p==null||p.abort(),p=new AbortController,c.value=!0,o.value.push({role:"user",text:N}),o.value.push({role:"assistant",text:"",streaming:!0});const D=o.value.length-1;await _();try{for await(const K of L(R,p.signal))K.type==="delta"?(o.value[D].text+=K.text,_()):K.type==="done"?o.value[D].citations=K.citations:K.type==="error"&&(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K.message}`,o.value[D].error=!0,o.value[D].citations=void 0);!o.value[D].text&&!o.value[D].error&&(o.value[D].text=r("sidebars.ai.emptyResponse"),o.value[D].error=!0)}catch(K){p.signal.aborted||(o.value[D].text=`${r("sidebars.ai.aiError")}: ${K instanceof Error?K.message:String(K)}`,o.value[D].error=!0,o.value[D].citations=void 0)}finally{o.value[D].streaming=!1,c.value=!1,p=null,_()}}function U(){b.value=!b.value,s.nextTick(()=>{const R=document.querySelector(".ai-sidebar textarea");R==null||R.focus()})}function V(R){if(c.value||!R.action)return;const N=x.value;R.needsSelection&&!N||E({action:R.action,...N?{selection:N.text}:{},...R.prompt?{prompt:R.prompt}:{},context:I()},R.prompt??R.label)}function B(){var R,N,L;x.value&&((L=(N=(R=a())==null?void 0:R.commands)==null?void 0:N.aiTransform)==null||L.call(N,{action:"rewrite"}))}const j=s.computed(()=>[{label:r("sidebars.ai.summarize"),icon:yr,color:"text-cyan-500",action:"summarize",needsSelection:!0},{label:r("sidebars.ai.fixGrammar"),icon:Tb,color:"text-emerald-500",action:"grammar",needsSelection:!0},{label:r("sidebars.ai.continue"),icon:O0,color:"text-amber-500",action:"generate",prompt:"Continue writing naturally from where the text ends, matching the existing style."},{label:r("sidebars.ai.toSpanish"),icon:vf,color:"text-cyan-500",action:"translate",prompt:"translate to Spanish",needsSelection:!0},{label:r("sidebars.ai.improveSelection"),icon:p0,color:"text-violet-500",improve:!0,needsSelection:!0},{label:r("sidebars.ai.draft"),icon:Ha,color:"text-cyan-500",draft:!0,disabled:!g.value}]);function $(R,N){R.text&&(navigator.clipboard.writeText(R.text),u.value=N,setTimeout(()=>u.value=null,2e3))}function Y(R){f.value=R,setTimeout(()=>{f.value===R&&(f.value=null)},2e3)}function W(R,N){const L=a();if(!R.text||!L)return;const{state:D,view:K}=L,{from:ne,to:ee}=D.selection;if(!R.citations||R.citations.length===0){Jd(L,K,ne,ee,R.text),K.focus(),Y(N);return}const ie=Ui(L);if(!ie){Jd(L,K,ne,ee,J5(R.text)),K.focus(),Y(N);return}const G=new Map(R.citations.map(fe=>[fe.ref,fe])),H=Z5(R.text,G,ie),q=D.schema,re=H.map(fe=>typeof fe=="string"?q.text(fe):q.nodeFromJSON(fe)).filter(fe=>!!fe),ce=new ae(J.from(re),0,0);K.dispatch(D.tr.replace(ne,ee,ce)),K.focus(),Y(N)}s.onMounted(()=>{s.nextTick(()=>{var R;(R=document.querySelector(".ai-sidebar textarea"))==null||R.focus()})});function oe(){p==null||p.abort(),c.value=!1,i("close")}return s.onUnmounted(()=>{var R;p==null||p.abort(),(R=a())==null||R.off("transaction",v)}),(R,N)=>{var L;return s.openBlock(),s.createElementBlock("div",Q5,[s.createElementVNode("div",Y5,[s.createElementVNode("div",null,[s.createElementVNode("h3",e6,[s.createVNode(s.unref(Un),{class:"h-4 w-4 animate-pulse text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.ai.title")),1)]),s.createElementVNode("p",t6,s.toDisplayString(s.unref(r)("sidebars.ai.description")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-200","aria-label":s.unref(r)("sidebars.ai.close"),onClick:oe},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,n6)]),h.value?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createElementVNode("div",a6,[s.createElementVNode("span",o6,s.toDisplayString(s.unref(r)("sidebars.ai.quickMacros")),1),s.createElementVNode("div",s6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(j.value,D=>(s.openBlock(),s.createElementBlock("button",{key:D.label,type:"button",disabled:c.value||D.needsSelection&&!x.value||"disabled"in D&&D.disabled,title:D.needsSelection&&!x.value?s.unref(r)("sidebars.ai.selectTextFirst"):D.label,class:s.normalizeClass(["flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-left text-[11px] font-bold transition-colors disabled:opacity-40","draft"in D&&D.draft&&b.value?"border-cyan-500 bg-cyan-500/10 text-cyan-700 dark:border-cyan-400/50 dark:bg-cyan-500/15 dark:text-cyan-300":"border-slate-200 bg-slate-50 text-slate-700 hover:border-cyan-500/50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:border-cyan-500/30"]),onClick:K=>D.improve?B():"draft"in D&&D.draft?U():V(D)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(D.icon),{class:s.normalizeClass(["h-3 w-3",D.color])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(D.label),1)],10,l6))),128))])]),s.createElementVNode("div",{ref_key:"turnsEl",ref:m,class:"flex-1 space-y-3 overflow-y-auto p-4"},[o.value.length===0?(s.openBlock(),s.createElementBlock("div",c6,[s.createVNode(s.unref(Un),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",u6,s.toDisplayString(s.unref(r)("sidebars.ai.noDraft")),1)])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.value,(D,K)=>(s.openBlock(),s.createElementBlock("div",{key:K,class:s.normalizeClass(["flex flex-col gap-1",D.role==="user"?"items-end":"items-start"])},[s.createElementVNode("span",d6,[D.role==="user"?(s.openBlock(),s.createBlock(s.unref(Wl),{key:0,class:"h-2.5 w-2.5"})):(s.openBlock(),s.createBlock(s.unref(Un),{key:1,class:"h-2.5 w-2.5 text-cyan-400"})),s.createTextVNode(" "+s.toDisplayString(D.role==="user"?s.unref(r)("sidebars.ai.you"):s.unref(r)("sidebars.ai.assistant")),1)]),s.createElementVNode("div",{class:s.normalizeClass(["max-w-full whitespace-pre-wrap rounded-xl px-3 py-2 text-xs leading-relaxed",[D.role==="user"?"bg-cyan-500/10 text-slate-700 dark:bg-cyan-500/15 dark:text-slate-200":D.error?"bg-red-50 text-red-700 dark:bg-red-500/10 dark:text-red-300":"bg-slate-100 text-slate-700 dark:bg-white/[0.04] dark:text-slate-300"]])},[s.createTextVNode(s.toDisplayString(D.text),1),D.streaming?(s.openBlock(),s.createElementBlock("span",f6,"▌")):s.createCommentVNode("",!0)],2),D.role==="assistant"&&D.citations&&D.citations.length>0?(s.openBlock(),s.createElementBlock("div",p6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(D.citations,ne=>(s.openBlock(),s.createElementBlock("span",{key:ne.ref,class:"inline-flex items-center gap-1 rounded-full border border-cyan-500/30 bg-cyan-500/5 px-2 py-0.5 text-[10px] font-semibold text-cyan-700 dark:border-cyan-400/30 dark:bg-cyan-500/10 dark:text-cyan-300"},[s.createVNode(s.unref(Ha),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(ne.label),1)]))),128))])):s.createCommentVNode("",!0),D.role==="assistant"&&!D.streaming&&!D.error&&D.text?(s.openBlock(),s.createElementBlock("div",m6,[s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg border border-slate-200 bg-white px-2 py-1 text-[10px] font-semibold text-slate-600 transition-all hover:bg-slate-50 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-300 dark:hover:bg-white/5",onClick:ne=>$(D,K)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(u.value===K?s.unref(Va):s.unref($s)),{class:s.normalizeClass(["h-3 w-3",u.value===K?"text-emerald-500":""])},null,8,["class"])),s.createElementVNode("span",null,s.toDisplayString(u.value===K?s.unref(r)("sidebars.ai.copied"):s.unref(r)("sidebars.ai.copy")),1)],8,h6),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-2 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:ne=>W(D,K)},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(f.value===K?s.unref(Va):s.unref(Eb)),{class:"h-3 w-3"})),s.createElementVNode("span",null,s.toDisplayString(f.value===K?s.unref(r)("sidebars.ai.inserted"):s.unref(r)("sidebars.ai.insert")),1)],8,b6)])):s.createCommentVNode("",!0)],2))),128))],512),s.createElementVNode("div",g6,[w.value||S.value?(s.openBlock(),s.createElementBlock("div",v6,[s.createElementVNode("span",x6,s.toDisplayString(s.unref(r)("sidebars.ai.contextLabel")),1),s.createElementVNode("div",y6,[w.value?(s.openBlock(),s.createElementBlock("span",k6,[s.createVNode(s.unref(dt),{class:"h-2.5 w-2.5"}),s.createTextVNode(s.toDisplayString(w.value),1)])):s.createCommentVNode("",!0),S.value?(s.openBlock(),s.createElementBlock("span",{key:1,class:"inline-flex max-w-full items-center gap-1 truncate rounded-full border border-violet-500/30 bg-violet-500/5 px-2 py-0.5 text-[10px] font-semibold text-violet-700 dark:border-violet-400/30 dark:bg-violet-500/10 dark:text-violet-300",title:(L=x.value)==null?void 0:L.text},[s.createElementVNode("span",_6,s.toDisplayString(S.value),1)],8,w6)):s.createCommentVNode("",!0)])])):s.createCommentVNode("",!0),s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(z,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":N[0]||(N[0]=D=>l.value=D),rows:"2",disabled:c.value,placeholder:b.value?s.unref(r)("sidebars.ai.draftPlaceholder"):s.unref(r)("sidebars.ai.promptPlaceholder"),class:"w-full min-h-[55px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none disabled:opacity-60 dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(s.withModifiers(z,["exact","prevent"]),["enter"])},null,40,S6),[[s.vModelText,l.value]]),s.createElementVNode("div",C6,[s.createElementVNode("button",{type:"submit",disabled:c.value||!l.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-40"},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(b.value?s.unref(r)("sidebars.ai.promptDraft"):s.unref(r)("sidebars.ai.promptAI")),1)],8,E6)])],32)])],64)):(s.openBlock(),s.createElementBlock("div",i6,[s.createVNode(s.unref(Un),{class:"mb-2 h-6 w-6 text-cyan-500 opacity-30"}),s.createElementVNode("p",r6,s.toDisplayString(s.unref(r)("sidebars.ai.notConfigured")),1)]))])}}}),A6={class:"comments-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},T6={class:"border-b border-slate-200 p-4 dark:border-white/5"},N6={class:"mb-3 flex items-center justify-between"},O6={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},M6={class:"flex rounded-xl border border-slate-200 bg-slate-50 p-1 text-[11px] font-semibold dark:border-white/10 dark:bg-white/[0.02]"},D6={key:0,class:"mb-1 rounded-xl border border-cyan-500/25 bg-cyan-500/5 p-2.5 text-xs text-cyan-700 animate-fadeIn dark:border-cyan-500/15 dark:bg-cyan-500/10 dark:text-cyan-400"},z6={class:"mb-1 font-mono text-[9px] font-bold uppercase tracking-wider"},I6={class:"line-clamp-1 border-l-2 border-cyan-400 bg-cyan-500/10 py-0.5 pl-2.5 italic dark:bg-cyan-500/5"},R6={class:"flex-1 space-y-4 overflow-y-auto p-4"},L6={class:"flex items-start justify-between"},B6={class:"flex items-center gap-2"},P6={class:"text-xs font-bold text-slate-800 dark:text-slate-200"},F6={class:"font-mono text-[9px] text-slate-400 dark:text-slate-500"},V6={class:"flex items-center gap-1.5"},U6=["title","onClick"],H6=["title","onClick"],q6={key:0,class:"inline-flex items-center gap-1 rounded-full border border-amber-400/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider text-amber-600 dark:border-amber-500/30 dark:text-amber-400"},j6={class:"whitespace-pre-wrap break-words text-xs leading-relaxed text-slate-700 dark:text-slate-300"},$6={key:2,class:"space-y-2.5 border-l border-slate-200 pl-4 pt-1 dark:border-white/10"},W6={class:"flex items-center gap-1.5"},G6={class:"text-[10px] font-bold text-slate-600 dark:text-slate-300"},K6={class:"font-mono text-[8px] text-slate-400 dark:text-slate-500"},X6={class:"break-words pl-1 text-xs text-slate-600 dark:text-slate-400"},J6={key:3,class:"flex items-center justify-between border-t border-slate-100 pt-2 dark:border-white/5"},Z6={key:0,class:"flex w-full items-center gap-1.5"},Q6=["onUpdate:modelValue","placeholder","onKeydown"],Y6=["onClick"],eA=["onClick"],tA={key:4,class:"rounded-lg border border-green-100/40 bg-green-50/55 p-2 text-[10px] text-green-700 dark:border-green-500/10 dark:bg-green-950/10 dark:text-green-400"},nA={key:0},iA={key:0,class:"py-12 text-center text-slate-400 dark:text-slate-500"},rA={class:"text-xs"},aA={key:0,class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/80"},oA=["placeholder"],sA={class:"flex items-center justify-between"},lA={class:"font-mono text-[9px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},cA=["disabled"],Eh=s.defineComponent({__name:"CommentsSidebar",props:{comments:{},selectedTextSnippet:{},selectedTextIndex:{},orphanedIds:{}},emits:["add-comment","add-reply","resolve-comment","delete-comment"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=s.ref({}),l=s.ref(null),c=s.ref("active"),u=s.computed(()=>(n.comments??[]).filter(b=>c.value==="resolved"?b.resolved:!b.resolved));function f(){a.value.trim()&&i("add-comment",a.value.trim(),n.selectedTextSnippet,n.selectedTextIndex)}function m(b){const y=o.value[b]||"";y.trim()&&(i("add-reply",b,y.trim()),o.value={...o.value,[b]:""},l.value=null)}function p(b){return b.split(" ").map(y=>y[0]).join("").slice(0,2).toUpperCase()}function h(b){var y;return((y=n.orphanedIds)==null?void 0:y.includes(b.id))===!0}function g(b){typeof window<"u"&&!window.confirm(r("sidebars.comments.confirmDelete"))||i("delete-comment",b)}return(b,y)=>(s.openBlock(),s.createElementBlock("div",A6,[s.createElementVNode("div",T6,[s.createElementVNode("div",N6,[s.createElementVNode("h3",O6,[s.createVNode(s.unref(Sf),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.title")),1)]),s.createElementVNode("div",M6,[s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="active"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:y[0]||(y[0]=v=>c.value="active")},s.toDisplayString(s.unref(r)("sidebars.comments.active")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass([c.value==="resolved"?"bg-cyan-500/15 text-cyan-600 dark:text-cyan-400 font-bold":"text-slate-400 hover:text-slate-600","rounded-lg px-2.5 py-1 transition-all"]),onClick:y[1]||(y[1]=v=>c.value="resolved")},s.toDisplayString(s.unref(r)("sidebars.comments.resolved")),3)])]),e.selectedTextSnippet?(s.openBlock(),s.createElementBlock("div",D6,[s.createElementVNode("p",z6,s.toDisplayString(s.unref(r)("sidebars.comments.creatingAnchored")),1),s.createElementVNode("p",I6,' "'+s.toDisplayString(e.selectedTextSnippet)+'" ',1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",R6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(u.value,v=>(s.openBlock(),s.createElementBlock("div",{key:v.id,class:"relative space-y-3 rounded-2xl border border-slate-200/60 bg-slate-50/60 p-4 transition-all hover:border-cyan-500/30 hover:shadow-cyan dark:border-white/5 dark:bg-[#02040a]/40"},[s.createElementVNode("div",L6,[s.createElementVNode("div",B6,[s.createElementVNode("div",{class:"flex h-6 w-6 items-center justify-center rounded-full text-[10px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:v.authorColor})},s.toDisplayString(p(v.authorName)),5),s.createElementVNode("div",null,[s.createElementVNode("h4",P6,s.toDisplayString(v.authorName),1),s.createElementVNode("p",F6,s.toDisplayString(new Date(v.createdAt).toLocaleTimeString()),1)])]),s.createElementVNode("div",V6,[v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-green-500/10 hover:text-green-500",title:s.unref(r)("sidebars.comments.resolve"),onClick:x=>i("resolve-comment",v.id)},[s.createVNode(s.unref(Ib),{class:"h-4 w-4"})],8,U6)),h(v)?(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-red-500/10 hover:text-red-500",title:s.unref(r)("sidebars.comments.delete"),onClick:x=>g(v.id)},[s.createVNode(s.unref(kr),{class:"h-4 w-4"})],8,H6)):s.createCommentVNode("",!0)])]),h(v)?(s.openBlock(),s.createElementBlock("div",q6,s.toDisplayString(s.unref(r)("sidebars.comments.orphaned")),1)):s.createCommentVNode("",!0),v.anchorText?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["max-w-full truncate rounded-r-lg border-l-2 py-1 pl-2.5 text-[10px] italic text-slate-500 dark:text-slate-400",h(v)?"border-amber-500/50 bg-amber-50/50 line-through opacity-70 dark:border-amber-500/40 dark:bg-amber-500/5":"border-cyan-500/50 bg-slate-100 dark:border-cyan-500/40 dark:bg-white/5"])},s.toDisplayString(s.unref(r)("sidebars.comments.quote"))+' "'+s.toDisplayString(v.anchorText)+'" ',3)):s.createCommentVNode("",!0),s.createElementVNode("p",j6,s.toDisplayString(v.content),1),v.replies.length>0?(s.openBlock(),s.createElementBlock("div",$6,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(v.replies,x=>(s.openBlock(),s.createElementBlock("div",{key:x.id,class:"space-y-1"},[s.createElementVNode("div",W6,[s.createElementVNode("div",{class:"flex h-4.5 w-4.5 items-center justify-center rounded-full text-[8px] font-bold text-white shadow-sm",style:s.normalizeStyle({backgroundColor:x.authorColor})},s.toDisplayString(p(x.authorName)),5),s.createElementVNode("span",G6,s.toDisplayString(x.authorName),1),s.createElementVNode("span",K6,s.toDisplayString(new Date(x.createdAt).toLocaleTimeString()),1)]),s.createElementVNode("p",X6,s.toDisplayString(x.content),1)]))),128))])):s.createCommentVNode("",!0),v.resolved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",J6,[l.value===v.id?(s.openBlock(),s.createElementBlock("div",Z6,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x=>o.value[v.id]=x,type:"text",placeholder:s.unref(r)("sidebars.comments.reply"),class:"flex-1 rounded-lg border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 focus:border-cyan-500/50 focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30",onKeydown:s.withKeys(x=>m(v.id),["enter"])},null,40,Q6),[[s.vModelText,o.value[v.id]]]),s.createElementVNode("button",{type:"button",class:"rounded-lg bg-cyan-500 p-1.5 font-bold text-black shadow-cyan hover:bg-cyan-400",onClick:x=>m(v.id)},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"})],8,Y6)])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-all hover:text-cyan-500",onClick:x=>l.value=v.id},[s.createVNode(s.unref(g0),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.replyInThread")),1)],8,eA))])),v.resolved?(s.openBlock(),s.createElementBlock("div",tA,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.comments.resolvedBy").replace("{user}",v.resolvedByName||v.resolvedBy||"You"))+" ",1),v.resolvedAt?(s.openBlock(),s.createElementBlock("span",nA,"at "+s.toDisplayString(new Date(v.resolvedAt).toLocaleTimeString()),1)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))),128)),u.value.length===0?(s.openBlock(),s.createElementBlock("div",iA,[s.createVNode(s.unref(o0),{class:"mx-auto mb-2 h-8 w-8 text-cyan-500 opacity-50"}),s.createElementVNode("p",rA,s.toDisplayString(s.unref(r)("sidebars.comments.noComments").replace("{mode}",c.value)),1)])):s.createCommentVNode("",!0)]),c.value==="active"?(s.openBlock(),s.createElementBlock("div",aA,[s.createElementVNode("form",{class:"space-y-2",onSubmit:s.withModifiers(f,["prevent"])},[s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":y[2]||(y[2]=v=>a.value=v),rows:"2",placeholder:e.selectedTextSnippet?s.unref(r)("sidebars.comments.commentOnSelection"):s.unref(r)("sidebars.comments.generalComment"),class:"w-full min-h-[60px] resize-none rounded-xl border border-slate-200 bg-white p-2.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,oA),[[s.vModelText,a.value]]),s.createElementVNode("div",sA,[s.createElementVNode("span",lA,s.toDisplayString(e.selectedTextSnippet?s.unref(r)("sidebars.comments.anchoredComment"):s.unref(r)("sidebars.comments.general")),1),s.createElementVNode("button",{type:"submit",disabled:!a.value.trim(),class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3.5 py-2 text-xs font-bold text-black shadow-cyan transition-all hover:bg-cyan-400 disabled:opacity-50"},[s.createVNode(s.unref(Ks),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.comments.post")),1)],8,cA)])],32)])):s.createCommentVNode("",!0)]))}}),uA={class:"history-sidebar flex h-full w-80 flex-shrink-0 flex-col border-l border-slate-200 bg-white/80 text-slate-800 backdrop-blur-xl transition-all dark:border-white/5 dark:bg-[#0a0f1e]/85 dark:text-slate-100"},dA={class:"border-b border-slate-200 p-4 dark:border-white/5"},fA={class:"flex items-center gap-1.5 font-mono text-xs font-bold uppercase tracking-widest text-slate-500 dark:text-slate-400"},pA={class:"mt-1.5 text-[10px] leading-relaxed text-slate-400 dark:text-slate-500"},mA={class:"flex-1 space-y-3 overflow-y-auto p-4"},hA={key:0,class:"space-y-2 rounded-2xl border border-amber-500/30 bg-amber-500/10 p-3.5 text-xs animate-fadeIn dark:border-amber-500/20"},bA={class:"flex items-start gap-1.5 text-amber-700 dark:text-amber-400"},gA={class:"font-bold"},vA={class:"mt-0.5 text-[10px] leading-relaxed text-amber-600 dark:text-amber-500"},xA={class:"flex justify-end gap-2 pt-1"},yA={class:"space-y-2.5"},kA={class:"mb-1 flex items-center justify-between"},wA={class:"rounded-md bg-slate-200 px-1.5 py-0.5 font-mono text-[9px] font-bold text-slate-500 dark:bg-cyan-500/10 dark:text-cyan-400"},_A={class:"flex items-center gap-0.5 font-mono text-[9px] text-slate-400 dark:text-slate-500"},SA={class:"text-xs font-bold leading-snug text-slate-800 dark:text-slate-200"},CA={class:"flex items-center gap-1.5 text-[10px] text-slate-500"},EA={class:"font-semibold text-slate-600 dark:text-slate-300"},AA={class:"flex justify-end gap-2 border-t border-slate-200/50 pt-2 dark:border-white/5"},TA=["onClick"],NA=["onClick"],OA={key:0,class:"py-6 text-center text-xs text-slate-400 dark:text-slate-500"},MA={class:"border-t border-slate-200 bg-slate-50 p-4 dark:border-white/5 dark:bg-[#0a0f1e]/85"},DA=["placeholder"],zA={class:"flex justify-end gap-2"},IA={type:"submit",class:"rounded-lg bg-cyan-500 px-3.5 py-1.5 text-xs font-bold text-black shadow-cyan hover:bg-cyan-400"},Ah=s.defineComponent({__name:"HistorySidebar",props:{snapshots:{},activePreviewIndex:{}},emits:["save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){const n=e,i=t,{t:r}=ht(),a=s.ref(""),o=s.ref(!1);function l(){a.value.trim()&&(i("save-snapshot",a.value.trim()),a.value="",o.value=!1)}const c=s.computed(()=>n.snapshots??[]);return(u,f)=>(s.openBlock(),s.createElementBlock("div",uA,[s.createElementVNode("div",dA,[s.createElementVNode("h3",fA,[s.createVNode(s.unref(Ul),{class:"h-4 w-4 text-cyan-400"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.title")),1)]),s.createElementVNode("p",pA,s.toDisplayString(s.unref(r)("sidebars.history.empty")),1)]),s.createElementVNode("div",mA,[e.activePreviewIndex!==null?(s.openBlock(),s.createElementBlock("div",hA,[s.createElementVNode("div",bA,[s.createVNode(s.unref(S0),{class:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-500"}),s.createElementVNode("div",null,[s.createElementVNode("p",gA,s.toDisplayString(s.unref(r)("sidebars.history.viewingPreview")),1),s.createElementVNode("p",vA,s.toDisplayString(s.unref(r)("sidebars.history.readOnlyPreview").replace("{index}",String(e.activePreviewIndex))),1)])]),s.createElementVNode("div",xA,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] font-semibold text-slate-500 hover:bg-white/5 hover:text-slate-700 dark:text-slate-400",onClick:f[0]||(f[0]=m=>i("preview-snapshot",null))},s.toDisplayString(s.unref(r)("sidebars.history.closePreview")),1),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 rounded-lg bg-cyan-500 px-3 py-1 text-[10px] font-bold text-black shadow-cyan transition-all hover:bg-cyan-400",onClick:f[1]||(f[1]=()=>{i("restore-snapshot",e.activePreviewIndex),i("preview-snapshot",null)})},[s.createVNode(s.unref(fu),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restoreThis")),1)])])])):s.createCommentVNode("",!0),s.createElementVNode("div",yA,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(c.value,m=>(s.openBlock(),s.createElementBlock("div",{key:m.versionIndex,class:s.normalizeClass(["space-y-2.5 rounded-2xl border p-4 transition-all",e.activePreviewIndex===m.versionIndex?"border-cyan-500/40 bg-cyan-500/5 shadow-cyan dark:border-cyan-500/30":"border-slate-200/60 bg-slate-50/60 hover:border-cyan-500/30 dark:border-white/5 dark:bg-[#02040a]/40 dark:hover:border-white/10"])},[s.createElementVNode("div",null,[s.createElementVNode("div",kA,[s.createElementVNode("span",wA,s.toDisplayString(s.unref(r)("sidebars.history.version"))+" #"+s.toDisplayString(m.versionIndex),1),s.createElementVNode("span",_A,[s.createVNode(s.unref(Vl),{class:"h-2.5 w-2.5"}),s.createTextVNode(" "+s.toDisplayString(new Date(m.timestamp).toLocaleDateString())+" "+s.toDisplayString(new Date(m.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),1)])]),s.createElementVNode("h4",SA,s.toDisplayString(m.title),1)]),s.createElementVNode("div",CA,[s.createVNode(s.unref(Wl),{class:"h-3.5 w-3.5"}),s.createElementVNode("span",null,[s.createTextVNode(s.toDisplayString(s.unref(r)("sidebars.history.modifiedBy"))+" ",1),s.createElementVNode("strong",EA,s.toDisplayString(m.modifiedBy),1)])]),s.createElementVNode("div",AA,[e.activePreviewIndex!==m.versionIndex?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-slate-500 transition-colors hover:text-cyan-600 dark:text-slate-400 dark:hover:text-cyan-400",onClick:p=>i("preview-snapshot",m)},[s.createVNode(s.unref(Vb),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.preview")),1)],8,TA)):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"flex items-center gap-1 text-[10px] font-bold text-cyan-600 transition-colors hover:text-cyan-500 dark:text-cyan-400 dark:hover:text-cyan-300",onClick:p=>i("restore-snapshot",m.versionIndex)},[s.createVNode(s.unref(fu),{class:"h-3 w-3"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.restore")),1)],8,NA)])],2))),128)),c.value.length===0?(s.openBlock(),s.createElementBlock("p",OA,s.toDisplayString(s.unref(r)("sidebars.history.noSnapshots")),1)):s.createCommentVNode("",!0)])]),s.createElementVNode("div",MA,[o.value?(s.openBlock(),s.createElementBlock("form",{key:0,class:"space-y-2 animate-fadeIn",onSubmit:s.withModifiers(l,["prevent"])},[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":f[2]||(f[2]=m=>a.value=m),type:"text",required:"",placeholder:s.unref(r)("sidebars.history.snapshotPlaceholder"),class:"w-full rounded-xl border border-slate-200 bg-white px-2.5 py-1.5 text-xs text-slate-800 transition-all focus:border-cyan-500/50 focus:shadow-cyan focus:outline-none dark:border-white/10 dark:bg-white/[0.02] dark:text-slate-100 dark:focus:border-cyan-500/30"},null,8,DA),[[s.vModelText,a.value]]),s.createElementVNode("div",zA,[s.createElementVNode("button",{type:"button",class:"rounded-lg px-2.5 py-1 text-[10px] text-slate-500 hover:bg-white/5 dark:text-slate-400",onClick:f[3]||(f[3]=m=>o.value=!1)},s.toDisplayString(s.unref(r)("sidebars.history.cancel")),1),s.createElementVNode("button",IA,s.toDisplayString(s.unref(r)("sidebars.history.save")),1)])],32)):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"flex w-full items-center justify-center gap-1.5 rounded-xl border border-dashed border-slate-300 py-2.5 text-xs font-bold text-slate-500 transition-all hover:border-cyan-500 hover:bg-cyan-500/5 hover:text-cyan-500 dark:border-white/10 dark:text-slate-400 dark:hover:border-cyan-400/50 dark:hover:text-cyan-400",onClick:f[4]||(f[4]=m=>o.value=!0)},[s.createVNode(s.unref(x0),{class:"h-3.5 w-3.5 animate-pulse"}),s.createTextVNode(" "+s.toDisplayString(s.unref(r)("sidebars.history.saveNamedSnapshot")),1)]))])]))}}),RA={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},LA={class:"mb-4 flex items-center justify-between"},BA={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},PA={key:0,class:"space-y-4"},FA={class:"flex items-start gap-3"},VA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},UA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},HA={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},qA={class:"flex items-start gap-3"},jA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-blue-500/10 text-blue-600 dark:text-blue-400"},$A={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},WA={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},GA={class:"text-xs text-slate-500 dark:text-slate-400"},KA={class:"flex items-start gap-3"},XA={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400"},JA={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},ZA={class:"text-sm font-medium text-slate-800 dark:text-slate-200"},QA={class:"grid grid-cols-2 gap-3"},YA={class:"flex items-start gap-3"},e8={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400"},t8={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},n8={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},i8={class:"flex items-start gap-3"},r8={class:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-purple-500/10 text-purple-600 dark:text-purple-400"},a8={class:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},o8={class:"text-xs font-medium text-slate-800 dark:text-slate-200"},s8={class:"rounded-lg border border-slate-200 bg-slate-50 p-4 dark:border-slate-700/50 dark:bg-white/5"},l8={class:"mb-2 flex items-center gap-2 text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500"},c8={class:"grid grid-cols-3 gap-3 text-center"},u8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},d8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},f8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},p8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},m8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},h8={class:"text-[10px] uppercase tracking-wide text-slate-500 dark:text-slate-400"},b8={key:1,class:"py-8 text-center text-sm text-slate-500 dark:text-slate-400"},Th=s.defineComponent({__name:"DetailsDialog",props:{isOpen:{type:Boolean},meta:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ht(),i=t;function r(a){return a?new Date(a).toLocaleString():"-"}return(a,o)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:o[1]||(o[1]=s.withModifiers(l=>i("close"),["self"]))},[s.createElementVNode("div",RA,[s.createElementVNode("div",LA,[s.createElementVNode("h2",BA,s.toDisplayString(s.unref(n)("editor.details.title")),1),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:o[0]||(o[0]=l=>i("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),e.meta?(s.openBlock(),s.createElementBlock("div",PA,[s.createElementVNode("div",FA,[s.createElementVNode("div",VA,[s.createVNode(s.unref(dt),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",UA,s.toDisplayString(s.unref(n)("editor.details.titleLabel")),1),s.createElementVNode("p",HA,s.toDisplayString(e.meta.title),1)])]),s.createElementVNode("div",qA,[s.createElementVNode("div",jA,[s.createVNode(s.unref(Wl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",$A,s.toDisplayString(s.unref(n)("editor.details.owner")),1),s.createElementVNode("p",WA,s.toDisplayString(e.meta.owner.name),1),s.createElementVNode("p",GA,s.toDisplayString(e.meta.owner.email),1)])]),s.createElementVNode("div",KA,[s.createElementVNode("div",XA,[s.createVNode(s.unref(jb),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",JA,s.toDisplayString(s.unref(n)("editor.details.location")),1),s.createElementVNode("p",ZA,s.toDisplayString(e.meta.folderName||s.unref(n)("editor.details.noFolder")),1)])]),s.createElementVNode("div",QA,[s.createElementVNode("div",YA,[s.createElementVNode("div",e8,[s.createVNode(s.unref(Vl),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",t8,s.toDisplayString(s.unref(n)("editor.details.created")),1),s.createElementVNode("p",n8,s.toDisplayString(r(e.meta.createdAt)),1)])]),s.createElementVNode("div",i8,[s.createElementVNode("div",r8,[s.createVNode(s.unref(Lb),{class:"h-4 w-4"})]),s.createElementVNode("div",null,[s.createElementVNode("label",a8,s.toDisplayString(s.unref(n)("editor.details.modified")),1),s.createElementVNode("p",o8,s.toDisplayString(r(e.meta.updatedAt)),1)])])]),s.createElementVNode("div",s8,[s.createElementVNode("div",l8,[s.createVNode(s.unref(Ua),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.details.statistics")),1)]),s.createElementVNode("div",c8,[s.createElementVNode("div",null,[s.createElementVNode("p",u8,s.toDisplayString(e.meta.wordCount),1),s.createElementVNode("p",d8,s.toDisplayString(s.unref(n)("editor.details.words")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",f8,s.toDisplayString(e.meta.charCount),1),s.createElementVNode("p",p8,s.toDisplayString(s.unref(n)("editor.details.characters")),1)]),s.createElementVNode("div",null,[s.createElementVNode("p",m8,s.toDisplayString(e.meta.pageCount),1),s.createElementVNode("p",h8,s.toDisplayString(s.unref(n)("editor.details.pages")),1)])])])])):(s.openBlock(),s.createElementBlock("div",b8,s.toDisplayString(s.unref(n)("editor.details.loading")),1))])])):s.createCommentVNode("",!0)}}),g8={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525]"},v8={class:"mb-4 flex items-center justify-between"},x8={class:"flex items-center gap-2"},y8={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-cyan-500/10 text-cyan-600 dark:text-cyan-400"},k8={class:"text-lg font-bold text-slate-800 dark:text-slate-100"},w8={class:"mb-4 rounded-md border border-slate-200 bg-slate-50 p-3 dark:border-slate-700/50 dark:bg-white/5"},_8={class:"mb-1 block text-[11px] font-bold uppercase tracking-wide text-slate-500 dark:text-slate-400"},S8={class:"flex items-center gap-2"},C8=["value"],E8=["title"],A8={class:"space-y-3"},T8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},N8=["placeholder"],O8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},M8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},D8={class:"mt-5 flex justify-end gap-2"},z8=["href"],Nh=s.defineComponent({__name:"EmailDialog",props:{isOpen:{type:Boolean},documentTitle:{},shareUrl:{},defaultRecipient:{}},emits:["close","copy-link"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(i.defaultRecipient||""),o=s.ref(""),l=s.ref(""),c=s.ref(!1),u=s.ref(!1),f=s.computed(()=>n("editor.email.defaultSubject",{title:i.documentTitle})),m=s.computed(()=>n("editor.email.defaultBody",{url:i.shareUrl})),p=s.computed(()=>o.value===f.value),h=s.computed(()=>l.value===m.value);s.watch(()=>i.documentTitle,()=>{o.value=f.value},{immediate:!0}),s.watch(()=>i.shareUrl,()=>{l.value=m.value},{immediate:!0});const g=s.computed(()=>{const v=new URLSearchParams;o.value.trim()&&v.set("subject",o.value.trim()),l.value.trim()&&v.set("body",l.value.trim());const x=v.toString();let k=`mailto:${a.value.trim()}`;return x&&(k+=`?${x}`),k});function b(){r("copy-link")}function y(){a.value=i.defaultRecipient||"",o.value=f.value,l.value=m.value,c.value=!1,u.value=!1}return s.watch(()=>i.isOpen,v=>{v&&y()}),(v,x)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 p-4 backdrop-blur-sm",onClick:x[10]||(x[10]=s.withModifiers(k=>r("close"),["self"]))},[s.createElementVNode("div",g8,[s.createElementVNode("div",v8,[s.createElementVNode("div",x8,[s.createElementVNode("div",y8,[s.createVNode(s.unref(Ws),{class:"h-4 w-4"})]),s.createElementVNode("h2",k8,s.toDisplayString(s.unref(n)("editor.email.title")),1)]),s.createElementVNode("button",{type:"button",class:"rounded p-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/5 dark:hover:text-slate-300",onClick:x[0]||(x[0]=k=>r("close"))},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),s.createElementVNode("div",w8,[s.createElementVNode("label",_8,s.toDisplayString(s.unref(n)("editor.email.shareableLink")),1),s.createElementVNode("div",S8,[s.createElementVNode("input",{type:"text",value:e.shareUrl,readonly:"",class:"flex-1 rounded-md border border-slate-300 bg-white px-2 py-1.5 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300"},null,8,C8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md border border-slate-300 text-slate-500 transition hover:bg-slate-100 dark:border-slate-600 dark:text-slate-400 dark:hover:bg-slate-700",title:s.unref(n)("editor.email.copyLink"),onClick:b},[s.createVNode(s.unref(ql),{class:"h-3.5 w-3.5"})],8,E8)])]),s.createElementVNode("div",A8,[s.createElementVNode("div",null,[s.createElementVNode("label",T8,s.toDisplayString(s.unref(n)("editor.email.to")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[1]||(x[1]=k=>a.value=k),type:"email",class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",placeholder:s.unref(n)("editor.email.toPlaceholder")},null,8,N8),[[s.vModelText,a.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",O8,s.toDisplayString(s.unref(n)("editor.email.subject")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":x[2]||(x[2]=k=>o.value=k),type:"text",class:s.normalizeClass(["w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",p.value&&!c.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:x[3]||(x[3]=k=>c.value=!0),onBlur:x[4]||(x[4]=k=>c.value=!1)},null,34),[[s.vModelText,o.value]])]),s.createElementVNode("div",null,[s.createElementVNode("label",M8,s.toDisplayString(s.unref(n)("editor.email.body")),1),s.withDirectives(s.createElementVNode("textarea",{"onUpdate:modelValue":x[5]||(x[5]=k=>l.value=k),rows:"4",class:s.normalizeClass(["w-full resize-none rounded-md border border-slate-300 bg-white px-3 py-2 text-xs focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:bg-slate-900",h.value&&!u.value?"text-slate-400 dark:text-slate-500":"text-slate-700 dark:text-slate-300"]),onFocus:x[6]||(x[6]=k=>u.value=!0),onBlur:x[7]||(x[7]=k=>u.value=!1)},null,34),[[s.vModelText,l.value]])])]),s.createElementVNode("div",D8,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold text-slate-700 transition hover:bg-slate-100 dark:text-slate-300",onClick:x[8]||(x[8]=k=>r("close"))},s.toDisplayString(s.unref(n)("common.cancel")),1),s.createElementVNode("a",{href:g.value,class:"inline-flex rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition hover:bg-cyan-700",onClick:x[9]||(x[9]=k=>r("close"))},s.toDisplayString(s.unref(n)("editor.email.send")),9,z8)])])])):s.createCommentVNode("",!0)}}),I8=["aria-label"],R8={class:"flex items-center gap-1.5"},L8=["placeholder"],B8={class:"w-16 flex-shrink-0 text-center text-[11px] text-slate-400 dark:text-slate-500"},P8=["disabled","title"],F8=["disabled","title"],V8=["title"],U8={class:"mt-2 flex items-center gap-1.5"},H8=["placeholder","onKeydown"],q8=["disabled"],j8=["disabled"],$8=s.defineComponent({__name:"FindReplaceDialog",props:{isOpen:{type:Boolean},editor:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(null),o=s.ref(""),l=s.ref(""),c=s.ref({query:"",matches:[],activeIndex:0}),u=s.computed(()=>{if(!o.value)return"";const{matches:x,activeIndex:k}=c.value;return x.length===0?n("editor.findReplace.noMatches"):n("editor.findReplace.matchCount",{current:k+1,total:x.length})}),f=()=>{i.editor&&(c.value=Ee.getSearchState(i.editor))};s.watch(()=>i.editor,(x,k)=>{k==null||k.off("transaction",f),x==null||x.on("transaction",f)}),s.watch(()=>i.isOpen,async x=>{var k,w;if(i.editor)if(x){const{from:S,to:A}=i.editor.state.selection;S!==A&&(o.value=i.editor.state.doc.textBetween(S,A," ")),m(),i.editor.on("transaction",f),await s.nextTick(),(k=a.value)==null||k.focus(),(w=a.value)==null||w.select()}else v()});function m(){i.editor&&(Ee.setSearchQuery(i.editor,o.value),f())}s.watch(o,m);function p(){i.editor&&Ee.searchNext(i.editor)}function h(){i.editor&&Ee.searchPrev(i.editor)}function g(){i.editor&&Ee.replaceCurrent(i.editor,l.value)}function b(){i.editor&&Ee.replaceAll(i.editor,l.value)}function y(x){x.key==="Enter"&&x.shiftKey?(x.preventDefault(),h()):x.key==="Enter"?(x.preventDefault(),p()):x.key==="Escape"&&(x.preventDefault(),v())}function v(){var x;i.editor&&Ee.clearSearch(i.editor),(x=i.editor)==null||x.off("transaction",f),o.value="",l.value="",c.value={query:"",matches:[],activeIndex:0},r("close")}return s.onUnmounted(()=>{var x;(x=i.editor)==null||x.off("transaction",f)}),(x,k)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"absolute right-4 top-16 z-40 w-[340px] rounded-xl border border-slate-200 bg-white p-3 shadow-2xl dark:border-slate-700 dark:bg-[#0e1525]",role:"dialog","aria-label":s.unref(n)("editor.findReplace.title")},[s.createElementVNode("div",R8,[s.withDirectives(s.createElementVNode("input",{ref_key:"findInput",ref:a,"onUpdate:modelValue":k[0]||(k[0]=w=>o.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.findPlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:y},null,40,L8),[[s.vModelText,o.value]]),s.createElementVNode("span",B8,s.toDisplayString(u.value),1),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.previous"),onClick:h},[s.createVNode(s.unref(Db),{class:"h-4 w-4"})],8,P8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 disabled:opacity-30 dark:text-slate-400 dark:hover:bg-slate-800",disabled:c.value.matches.length===0,title:s.unref(n)("editor.findReplace.next"),onClick:p},[s.createVNode(s.unref(en),{class:"h-4 w-4"})],8,F8),s.createElementVNode("button",{type:"button",class:"flex h-7 w-7 items-center justify-center rounded-md text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800",title:s.unref(n)("editor.findReplace.close"),onClick:v},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})],8,V8)]),s.createElementVNode("div",U8,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[1]||(k[1]=w=>l.value=w),type:"text",placeholder:s.unref(n)("editor.findReplace.replacePlaceholder"),class:"min-w-0 flex-1 rounded-lg border border-slate-200 bg-transparent px-2.5 py-1.5 text-sm text-slate-800 focus:border-cyan-500 focus:outline-none dark:border-slate-600 dark:text-slate-100",onKeydown:s.withKeys(s.withModifiers(g,["prevent"]),["enter"])},null,40,H8),[[s.vModelText,l.value]]),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:g},s.toDisplayString(s.unref(n)("editor.findReplace.replace")),9,q8),s.createElementVNode("button",{type:"button",class:"flex-shrink-0 rounded-lg border border-slate-200 px-2.5 py-1.5 text-xs font-semibold text-slate-600 transition-colors hover:bg-slate-50 disabled:opacity-30 dark:border-slate-600 dark:text-slate-300 dark:hover:bg-white/5",disabled:c.value.matches.length===0,onClick:b},s.toDisplayString(s.unref(n)("editor.findReplace.replaceAll")),9,j8)])],8,I8)):s.createCommentVNode("",!0)}}),W8={class:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-6 shadow-xl dark:border-slate-700 dark:bg-slate-800"},G8={class:"mb-4 flex items-center justify-between"},K8={class:"flex items-center gap-2 text-base font-semibold text-slate-900 dark:text-slate-100"},X8={class:"mb-4"},J8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},Z8=["placeholder"],Q8={class:"mb-2"},Y8={class:"mb-1 block text-xs font-medium text-slate-600 dark:text-slate-400"},eT=["placeholder"],tT={key:0,class:"mt-1 text-[11px] text-red-600 dark:text-red-400"},nT={class:"flex items-center justify-end gap-2 pt-2"},iT=s.defineComponent({__name:"LinkDialog",props:{isOpen:{type:Boolean},initialText:{},initialUrl:{},isEditing:{type:Boolean}},emits:["apply","remove","close"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=t,a=s.ref(""),o=s.ref(""),l=s.ref("");s.watch(()=>i.isOpen,g=>{g&&(a.value=i.initialText??"",o.value=i.initialUrl??"https://",l.value="")});function c(){const g=o.value.trim();if(!g)return l.value=n("editor.linkDialog.urlRequired"),!1;if(/^(\/|#|mailto:|tel:)/.test(g))return l.value="",!0;try{return new URL(g),l.value="",!0}catch{return l.value=n("editor.linkDialog.urlInvalid"),!1}}function u(g){const b=g.trim();return/^(\/|#|mailto:|tel:)/.test(b)||/^https?:\/\//i.test(b)?b:`https://${b}`}function f(){c()&&r("apply",{text:a.value.trim(),url:u(o.value)})}function m(){r("remove")}function p(){r("close")}function h(g){g.key==="Escape"&&p()}return(g,b)=>e.isOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",onClick:s.withModifiers(p,["self"]),onKeydown:h},[s.createElementVNode("div",W8,[s.createElementVNode("div",G8,[s.createElementVNode("h3",K8,[s.createVNode(s.unref(ql),{class:"h-5 w-5 text-slate-500 dark:text-slate-400"}),s.createTextVNode(" "+s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.editTitle"):s.unref(n)("editor.linkDialog.insertTitle")),1)]),s.createElementVNode("button",{type:"button",class:"rounded-md p-1 text-sm text-slate-400 transition-all hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-700 dark:hover:text-slate-300",onClick:p},[s.createVNode(s.unref(Wt),{class:"h-4 w-4"})])]),s.createElementVNode("div",X8,[s.createElementVNode("label",J8,s.toDisplayString(s.unref(n)("editor.linkDialog.text")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=y=>a.value=y),type:"text",placeholder:s.unref(n)("editor.linkDialog.textPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,Z8),[[s.vModelText,a.value]])]),s.createElementVNode("div",Q8,[s.createElementVNode("label",Y8,s.toDisplayString(s.unref(n)("editor.linkDialog.url")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=y=>o.value=y),type:"text",placeholder:s.unref(n)("editor.linkDialog.urlPlaceholder"),class:"w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-xs text-slate-700 dark:border-slate-600 dark:bg-slate-900 dark:text-slate-300",onKeydown:s.withKeys(f,["enter"])},null,40,eT),[[s.vModelText,o.value]]),l.value?(s.openBlock(),s.createElementBlock("p",tT,s.toDisplayString(l.value),1)):s.createCommentVNode("",!0)]),s.createElementVNode("div",nT,[e.isEditing?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"mr-auto flex items-center gap-1 rounded-md px-3 py-1.5 text-xs font-semibold text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-950/40",onClick:m},[s.createVNode(s.unref(kr),{class:"h-3.5 w-3.5"}),s.createTextVNode(" "+s.toDisplayString(s.unref(n)("editor.linkDialog.remove")),1)])):s.createCommentVNode("",!0),s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700",onClick:p},s.toDisplayString(s.unref(n)("editor.linkDialog.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white transition-all hover:bg-cyan-700",onClick:f},s.toDisplayString(e.isEditing?s.unref(n)("editor.linkDialog.update"):s.unref(n)("editor.linkDialog.insert")),1)])])],32)):s.createCommentVNode("",!0)}});async function rf(e,t){var n,i;if(typeof document>"u")return!1;try{if(t&&typeof ClipboardItem<"u"&&((n=navigator.clipboard)!=null&&n.write)){const r=new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});return await navigator.clipboard.write([r]),!0}if((i=navigator.clipboard)!=null&&i.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{const r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select();const a=document.execCommand("copy");return r.remove(),a}catch{return!1}}async function rT(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.read))return null;try{const t=await navigator.clipboard.read();for(const n of t)if(n.types.includes("text/html"))return await(await n.getType("text/html")).text();for(const n of t)if(n.types.includes("text/plain"))return await(await n.getType("text/plain")).text();return null}catch{return null}}async function Us(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return null;try{return await navigator.clipboard.readText()}catch{return null}}const aT={class:"docs-editor flex h-screen w-full flex-col overflow-hidden bg-slate-50 transition-colors dark:bg-[#02040a]"},oT=["title","aria-label"],sT={class:"docs-editor__body relative flex flex-1 overflow-hidden"},lT=["title"],cT={class:"flex flex-1 flex-col items-center gap-4 w-full relative"},uT=["aria-label"],dT={key:5,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},fT={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},pT={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},mT={class:"mb-6"},hT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},bT={class:"space-y-4"},gT={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},vT={class:"text-xs font-medium text-slate-600 dark:text-slate-400 block mb-1.5"},xT={class:"mb-8"},yT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},kT={class:"space-y-3"},wT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},_T={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},ST={class:"flex justify-end items-center gap-3"},CT={key:6,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/40 backdrop-blur-sm px-4 select-none"},ET={class:"w-full max-w-sm rounded-3xl border border-slate-100 bg-white p-7 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},AT={class:"text-xl font-medium mb-6 text-slate-900 dark:text-white"},TT={class:"mb-6"},NT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},OT={class:"space-y-3"},MT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},DT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},zT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none pt-1"},IT=["checked"],RT={class:"mb-6"},LT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},BT=["aria-label"],PT=["title","onClick"],FT={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},VT=["d"],UT={class:"text-[11px] text-slate-400 dark:text-slate-500 mt-1.5"},HT={class:"mb-8"},qT={class:"text-xs font-semibold text-slate-700 dark:text-slate-300 mb-3"},jT={class:"space-y-3"},$T={class:"flex items-center gap-3"},WT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},GT={class:"flex items-center gap-3 cursor-pointer text-xs font-medium text-slate-700 dark:text-slate-300 select-none"},KT={class:"pt-2"},XT={class:"block text-xs font-medium text-slate-600 dark:text-slate-400 mb-1.5"},JT=["placeholder"],ZT={class:"text-[11px] text-slate-400 dark:text-slate-500 mt-1"},QT={class:"flex justify-end items-center gap-3"},YT={key:7,class:"fixed inset-0 z-50 flex items-center justify-center bg-slate-900/50 backdrop-blur-sm px-4"},eN={class:"w-full max-w-md rounded-xl border border-slate-200 bg-white p-6 shadow-2xl dark:border-slate-800 dark:bg-[#0e1525] text-slate-800 dark:text-slate-200"},tN={class:"text-lg font-bold mb-4"},nN={class:"mb-4"},iN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},rN=["value"],aN={class:"mb-4"},oN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},sN={class:"flex gap-2"},lN={class:"mb-6"},cN={class:"block text-xs font-semibold text-slate-600 dark:text-slate-400 mb-1.5"},uN={class:"grid grid-cols-2 gap-3"},dN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},fN=["max"],pN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},mN=["max"],hN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},bN=["max"],gN={class:"text-[11px] text-slate-500 dark:text-slate-400 block mb-1"},vN=["max"],xN={class:"flex justify-end gap-2"},yN=189,rr=37.795,Hs=0,qs=5,af=.1,Oi=0,kN=s.defineComponent({__name:"DocsEditor",props:{modelValue:{default:void 0},plugins:{default:()=>[]},editable:{type:Boolean,default:!0},collaboration:{default:void 0},pageSize:{default:"a4"},pageless:{type:Boolean,default:!1},virtualPages:{type:Boolean,default:!1},title:{default:"Untitled Document"},collaborators:{default:()=>[]},starred:{type:Boolean,default:!1},connectionState:{default:"connected"},userName:{default:""},userAvatar:{default:""},locale:{default:void 0},documentMeta:{default:void 0},shareUrl:{default:""},onImageUpload:{type:Function,default:void 0},citation:{default:void 0},aiStream:{type:Function,default:void 0},aiDraft:{type:Function,default:void 0},onAiChat:{type:Function,default:void 0},debug:{type:Boolean,default:!1},comments:{default:()=>[]},selectedTextSnippet:{default:""},selectedTextIndex:{default:void 0},snapshots:{default:()=>[]},activePreviewIndex:{default:null},orientation:{default:"portrait"},margins:{default:()=>({top:94,bottom:94,left:94,right:94})},headerMarginCm:{default:.5},footerMarginCm:{default:.5}},emits:["update:modelValue","update:title","update:pageSize","update:orientation","update:margins","update:header-footer-margins","update:pageless","update:pageCount","update:locale","citation-sources-change","update:citation-style","toggle-star","back","share","menu-click","export","ready","add-comment","add-reply","resolve-comment","delete-comment","save-snapshot","restore-snapshot","preview-snapshot"],setup(e,{emit:t}){var Zc,Qc,Yc,eu,tu;const n=e,i=t,{locale:r,setLocale:a,t:o}=pf(n.locale);s.watch(()=>n.locale,C=>{C&&C!==r.value&&a(C)}),s.watch(r,C=>{i("update:locale",C)});const l=s.ref({top:((Zc=n.margins)==null?void 0:Zc.top)??94,bottom:((Qc=n.margins)==null?void 0:Qc.bottom)??94,left:((Yc=n.margins)==null?void 0:Yc.left)??94,right:((eu=n.margins)==null?void 0:eu.right)??94});function c(C,T=.5){const M=typeof C=="number"?C:Number(C);if(!Number.isFinite(M))return T;const Q=Math.min(qs,Math.max(Hs,M));return Math.round(Q*10)/10}const u=s.ref(n.orientation??"portrait"),f=s.ref(n.pageSize??"a4"),m=s.ref(n.pageless??!1);s.watch(()=>n.orientation,C=>{C!==void 0&&(u.value=C)}),s.watch(()=>n.margins,C=>{C!==void 0&&(l.value={...C})}),s.watch(()=>n.headerMarginCm,C=>{typeof C=="number"&&Number.isFinite(C)&&(fn.value=c(C))}),s.watch(()=>n.footerMarginCm,C=>{typeof C=="number"&&Number.isFinite(C)&&(pn.value=c(C))});const p=s.computed(()=>{const C=ar.getPageSize(f.value)??ar.PAGE_SIZES[0];let T=C.pageWidth,M=C.pageHeight;return u.value==="landscape"&&([T,M]=[M,T]),{pageHeight:M,pageWidth:T,margins:{...l.value}}}),h=s.computed(()=>`${p.value.pageWidth}px`),{isDark:g}=Ro(),b=s.computed(()=>n.virtualPages===!0),y=s.computed(()=>({enabled:!m.value&&!b.value,pageHeight:p.value.pageHeight,pageWidth:p.value.pageWidth,marginTop:p.value.margins.top,marginBottom:p.value.margins.bottom,marginLeft:p.value.margins.left,marginRight:p.value.margins.right,contentMarginTop:0,contentMarginBottom:0,pageGap:40,pageBreakBackground:g.value?"#02040a":"#f1f5f9",headerLeft:"",headerRight:"",footerLeft:"",footerRight:"",onHeaderClick:C=>{var T;((T=C==null?void 0:C.event)==null?void 0:T.detail)===2&&ca(C==null?void 0:C.event)},onFooterClick:C=>{var T;((T=C==null?void 0:C.event)==null?void 0:T.detail)===2&&ua(C==null?void 0:C.event)}})),v=C=>{const T=C;return T&&typeof T=="object"&&T.type==="tabbed-doc"&&Array.isArray(T.tabs)?T:{type:"tabbed-doc",activeTabId:"tab-1",tabs:[{id:"tab-1",label:"Tab 1",content:C||{type:"doc",content:[{type:"paragraph"}]}}]}},x=C=>{if(!Array.isArray(C))return[];const T=new Set;for(const M of C)typeof M=="number"&&Number.isFinite(M)&&M>=1&&T.add(Math.floor(M));return[...T].sort((M,Q)=>M-Q)},k=v(n.modelValue),w=s.ref(k.headerLeft||""),S=s.ref(k.headerRight||""),A=s.ref(k.footerLeft||""),I=s.ref(k.footerRight||""),_=s.ref(k.headerAlign),E=s.ref(k.footerAlign),z=s.ref(k.tabs.map(C=>({id:C.id,label:C.label,active:C.id===k.activeTabId}))),P=s.ref({});k.tabs.forEach(C=>{P.value[C.id]=C.content});const U=s.ref(k.activeTabId),V=s.computed(()=>P.value[U.value]),B=s.ref(!1),j=s.ref(null),$=s.ref(null);let Y=null;const W=s.ref(localStorage.getItem("docflow:view:showRuler")!=="false"),oe=s.ref(!1);s.watch(W,C=>{localStorage.setItem("docflow:view:showRuler",C?"true":"false")});const R=s.ref(0),N=s.ref(0),L=s.ref("saved"),D=s.ref(Date.now()),K=s.ref(null),ne=s.ref(new Set);let ee=null;const ie=s.ref(!1);function G(){if(!O.value||!X.value)return;const C=O.value.state.doc;if(n.collaboration&&!ie.value&&C.content.size<=2)return;ie.value=!0;const T=new Set;C.descendants(M=>{for(const Q of M.marks)Q.type.name==="comment"&&Q.attrs.threadId&&T.add(Q.attrs.threadId);return!0}),ne.value=T}function H(){ee&&clearTimeout(ee),ee=setTimeout(G,200)}const q=s.computed(()=>{if(!ie.value)return[];const C=ne.value;return(n.comments??[]).filter(T=>T.anchorIndex!=null&&!C.has(T.id)).map(T=>T.id)});s.onUnmounted(()=>{ee&&clearTimeout(ee)});const re=s.computed(()=>{const C=[];for(const T of n.plugins)for(const M of T.slashCommands||[])C.push({name:M.name,command:M.command});return C}),ce=()=>{const C={type:"tabbed-doc",activeTabId:U.value,tabs:z.value.map(T=>({id:T.id,label:T.label,content:P.value[T.id]})),headerLeft:w.value,headerRight:S.value,footerLeft:A.value,footerRight:I.value,headerAlign:_.value,footerAlign:E.value,hiddenPageNumbers:Ji.value};i("update:modelValue",C),L.value="saving",K.value&&clearTimeout(K.value),K.value=setTimeout(()=>{L.value="saved",D.value=Date.now()},800)},fe=s.ref((()=>{var T;const C=(T=n.citation)==null?void 0:T.sources;return Array.isArray(C)?[...C]:typeof C=="function"?[...C()]:[]})()),Oe=s.ref(((tu=n.citation)==null?void 0:tu.style)||"chicago-notes-bibliography");let pe=null;const Se=s.ref(!1),ut=C=>{pe==null||pe(C),pe=null,Se.value=!1},Jt=()=>new Promise(C=>{ut(null),pe=C,Se.value=!0,$.value="references"}),Le=s.computed(()=>{const C=n.citation;if(C)return{...C,sources:()=>fe.value,onSourceRequest:C.onSourceRequest??Jt}}),{editorRef:Ut,editor:O,pluginActions:F,isReady:X,docsEditor:ze}=of({content:V,plugins:n.plugins,editable:n.editable,collaboration:s.computed(()=>n.collaboration),onImageUpload:n.onImageUpload,citation:Le.value,aiStream:n.aiStream,aiDraft:n.aiDraft,debug:n.debug,getPageMap:()=>new Map,paginationOptions:y.value,onUpdate:C=>{P.value[U.value]=C,ce()}}),Xe=()=>{var C,T,M;return((M=(T=(C=O.value)==null?void 0:C.storage)==null?void 0:T.citationEngine)==null?void 0:M.engine)??null},He=()=>{var C;(C=Xe())==null||C.updateSources(fe.value),i("citation-sources-change",fe.value)},un=C=>{fe.value=[...fe.value,C],He()},Nn=C=>{fe.value=fe.value.map(T=>T.id===C.id?C:T),He()},Yn=C=>{fe.value=fe.value.filter(T=>T.id!==C),He()},Ht=C=>{var T;Oe.value=C,(T=Xe())==null||T.setStyle(C),i("update:citation-style",C)},On=C=>{var T,M;pe?(ut(C),$.value=null):(M=(T=F.value).insertCitation)==null||M.call(T,{sourceId:C})};s.watch($,(C,T)=>{T==="references"&&C!=="references"&&ut(null)});const qe=s.ref(!1),Nt=s.ref(""),$i=s.computed(()=>{var C,T;return!!((C=n.citation)!=null&&C.onImportDoi||(T=n.citation)!=null&&T.onImportBibliography)}),qr=async C=>{const T=n.citation;if(!(!(T!=null&&T.onImportDoi)||qe.value)){qe.value=!0,Nt.value="";try{const M=await T.onImportDoi(C);if(!M){Nt.value=o("sidebars.references.import.doiFailed");return}const Q=fe.value.some(se=>se.id===M.id);fe.value=Q?fe.value.map(se=>se.id===M.id?M:se):[...fe.value,M],He(),Nt.value=o("sidebars.references.import.doiSuccess")}catch{Nt.value=o("sidebars.references.import.doiFailed")}finally{qe.value=!1}}},jr=async C=>{const T=n.citation;if(!(!(T!=null&&T.onImportBibliography)||qe.value)){qe.value=!0,Nt.value="";try{const{imported:M,failed:Q}=await T.onImportBibliography(C);if(M.length>0){const se=new Map(fe.value.map(de=>[de.id,de]));for(const de of M)se.set(de.id,de);fe.value=[...se.values()],He()}Nt.value=Q>0?o("sidebars.references.import.partial").replace("{ok}",String(M.length)).replace("{failed}",String(Q)):o("sidebars.references.import.batchSuccess").replace("{count}",String(M.length))}catch{Nt.value=o("sidebars.references.import.failed")}finally{qe.value=!1}}},Wi=()=>{var T;const C=((T=O.value)==null?void 0:T.getText())??"";N.value=C.length,R.value=C.trim()?C.trim().split(/\s+/).length:0},$r=()=>{if(!O.value)return null;const{from:C,to:T,head:M}=O.value.state.selection;if(C===T)return null;const Q=O.value.view.coordsAtPos(M);if(!Q)return null;const se=12,de=180,ye=Q.top-48,ve=(Q.left+Q.right)/2;if(typeof window>"u")return{top:Math.max(se,ye),left:ve};const me=Math.min(de,Math.max(0,window.innerWidth/2-se)),ue=se+me,le=window.innerWidth-se-me,he=Math.max(se,window.innerHeight-48);return{top:Math.min(he,Math.max(se,ye)),left:Math.min(le,Math.max(ue,ve))}},Wr=()=>{if(!O.value){B.value=!1,j.value=null;return}const{from:C,to:T}=O.value.state.selection;B.value=C!==T,j.value=C!==T?$r():null},wt=s.ref(null),qt=()=>{B.value&&(j.value=$r())},jt=s.ref(1),gt=s.ref(1),Gi=s.computed(()=>{const C=p.value;return{pageSize:{id:f.value,name:f.value.toUpperCase(),pageWidth:C.pageWidth,pageHeight:C.pageHeight},margins:{top:C.margins.top,bottom:C.margins.bottom,left:C.margins.left,right:C.margins.right},pageGap:40,headerLeft:w.value,headerRight:S.value,footerLeft:A.value,footerRight:I.value}}),{data:Jo,totalPages:wi,isReady:dn,refreshData:Gr}=ub({editorRef:s.computed(()=>O.value),scrollRef:wt,config:Gi.value,bufferPages:2,enabled:b});s.watch([wi,dn],()=>{b.value&&dn.value&&(jt.value=wi.value)}),s.watch(b,C=>{C&&Gr()});const ei=()=>{if(!O.value||!X.value){jt.value=1,gt.value=1;return}const C=O.value.view.dom,T=C.querySelector("[data-rm-pagination]");T?jt.value=T.children.length||1:jt.value=1;try{const{selection:M}=O.value.state,Q=O.value.view.coordsAtPos(M.head);if(Q&&T){const se=Array.from(T.querySelectorAll(".rm-page-break")),de=C.getBoundingClientRect(),ye=Q.top-de.top+C.scrollTop;let ve=1,me=!1;for(let ue=0;ue<se.length;ue++){const le=se[ue].querySelector(".breaker");if(le instanceof HTMLElement&&ye<le.offsetTop){gt.value=ve,me=!0;break}ve++}me||(gt.value=ve)}else gt.value=1}catch{gt.value=1}};s.watch(p,C=>{O.value&&(O.value.commands.updatePageHeight(C.pageHeight),O.value.commands.updatePageWidth(C.pageWidth),O.value.commands.updateMargins({top:C.margins.top,bottom:C.margins.bottom,left:C.margins.left,right:C.margins.right}),ei())});const Ot=C=>{C!==m.value&&(m.value=C,i("update:pageless",C),O.value&&(C?O.value.commands.disablePagination():O.value.commands.enablePagination(),setTimeout(()=>{ei(),da()},60)))};s.watch(()=>n.pageless,C=>Ot(C??!1));const Je=s.ref(!1),$t=s.ref(!1),ti=s.ref(""),Lc=s.ref(""),Zo=s.ref(""),Oh=s.ref(""),fn=s.ref(c(n.headerMarginCm)),pn=s.ref(c(n.footerMarginCm)),Kr=s.ref(!1),Ki=s.ref(fn.value),Xi=s.ref(pn.value),Xr=s.ref(!1),Jr=s.ref(!1),Zr=s.ref(!1),ni=s.ref("header"),Ji=s.ref(x(k.hiddenPageNumbers)),Qr=s.ref("startAt"),Yr=s.ref(1),Mn=s.ref("header"),_i=s.ref([]),Si=s.ref(""),Ci=s.ref("startAt"),ea=s.ref(1),ta=s.ref(_.value),na=s.ref(E.value),Qo=s.ref(!1),Mh=s.computed(()=>Yo.value??"right"),Yo=s.computed({get:()=>Mn.value==="footer"?na.value:ta.value,set:C=>{Mn.value==="footer"?na.value=C:ta.value=C}}),Dh=C=>{Qo.value=!0,Yo.value=Yo.value===C?void 0:C},zh=C=>({left:"M21 5H3 M15 12H3 M17 19H3",center:"M21 5H3 M17 12H7 M19 19H5",right:"M21 5H3 M21 12H9 M21 19H7"})[C],Ih=s.computed(()=>!_i.value.includes(1)),Rh=C=>{const T=C.target.checked;let M=_i.value;T?M=M.filter(Q=>Q!==1):M.includes(1)||(M=[...M,1].sort((Q,se)=>Q-se)),_i.value=M,Si.value=Pc(M)};s.watch(Si,C=>{_i.value=Bc(C)});const Bc=C=>{const T=new Set;for(const M of String(C||"").split(",")){const Q=M.trim();if(!Q)continue;const se=Q.match(/^(\d+)\s*-\s*(\d+)$/);if(se){const de=Math.max(1,Number(se[1])),ye=Math.max(de,Number(se[2]));for(let ve=de;ve<=ye;ve++)T.add(ve)}else/^\d+$/.test(Q)&&T.add(Math.max(1,Number(Q)))}return[...T].sort((M,Q)=>M-Q)},Pc=C=>{const T=[...C].filter(de=>Number.isFinite(de)&&de>=1).sort((de,ye)=>de-ye);if(T.length===0)return"";const M=[];let Q=T[0],se=T[0];for(let de=1;de<=T.length;de++){const ye=T[de];if(ye===se+1){se=ye;continue}M.push(Q===se?String(Q):`${Q}-${se}`),Q=ye,se=ye}return M.join(", ")},es=C=>{const T=C+1;if(Ji.value.includes(T))return"";let M=T;return Qr.value==="startAt"&&(M=C+Yr.value),String(M)};let ts=!1;const Bt=(C=!0)=>{if(!(!O.value||!X.value||ts)){ts=!0;try{const T=String(jt.value),M=O.value.view.dom;(()=>{const le=(he,Ce)=>{M.classList.remove(`rm-hf-${he}-align-left`,`rm-hf-${he}-align-center`,`rm-hf-${he}-align-right`),Ce&&M.classList.add(`rm-hf-${he}-align-${Ce}`)};le("header",_.value),le("footer",E.value)})();const se=w.value.replace(/{total}/g,T),de=S.value.replace(/{total}/g,T),ye=A.value.replace(/{total}/g,T),ve=I.value.replace(/{total}/g,T);O.value.commands.updateHeaderContent(se,de),O.value.commands.updateFooterContent(ye,ve);const me=`${Math.max(0,fn.value)*rr}px`,ue=`${Math.max(0,pn.value)*rr}px`;M.style.setProperty("--rm-header-margin-top",me),M.style.setProperty("--rm-footer-margin-bottom",ue),C&&O.value.view.dispatch(O.value.state.tr),setTimeout(()=>{requestAnimationFrame(()=>{if(!O.value||O.value.view.dom!==M)return;const le=(Te,Ne)=>{let Me=se,De=de;return Ne&&Je.value?(Me=ti.value.replace(/{total}/g,T),De=Lc.value.replace(/{total}/g,T)):$t.value&&Te%2===0&&(Me=Zo.value.replace(/{total}/g,T),De=Oh.value.replace(/{total}/g,T)),{left:Me.replace(/{page}/g,es(Te-1)),right:De.replace(/{page}/g,es(Te-1))}},he=(Te,Ne,Me)=>{const De=le(Ne,Me),Ie=Te.querySelector(".rm-page-header-left"),Ve=Te.querySelector(".rm-page-header-right");Ie&&(Ie.innerHTML=De.left),Ve&&(Ve.innerHTML=De.right)},Ce=M.querySelector(".rm-first-page-header");Ce&&he(Ce,1,!0),Array.from(M.querySelectorAll(".rm-page-break .rm-page-header")).forEach((Te,Ne)=>{he(Te,Ne+2,!1)}),Array.from(M.querySelectorAll(".rm-page-break .rm-page-footer")).forEach((Te,Ne)=>{const Me=Ne+1,De=es(Me-1),Ie=Te.querySelector(".rm-page-footer-left"),Ve=Te.querySelector(".rm-page-footer-right");Ie&&(Ie.innerHTML=ye.replace(/{page}/g,De)),Ve&&(Ve.innerHTML=ve.replace(/{page}/g,De))})})},50)}finally{ts=!1}}};s.watch(Je,()=>{Bt()}),s.watch([$t,fn,pn,ni,Ji,Qr,Yr],()=>{Bt()}),s.watch(jt,C=>{Bt(!1),i("update:pageCount",C)}),s.watch(g,C=>{O.value&&(O.value.commands.updatePageBreakBackground(C?"#02040a":"#f1f5f9"),O.value.view.dispatch(O.value.state.tr))}),s.watch(y,C=>{if(!O.value||!X.value)return;const T=O.value.storage.PaginationPlus;!T||!(T.pageHeight!==C.pageHeight||T.pageWidth!==C.pageWidth||T.marginTop!==C.marginTop||T.marginBottom!==C.marginBottom||T.marginLeft!==C.marginLeft||T.marginRight!==C.marginRight||T.pageGap!==C.pageGap||T.contentMarginTop!==C.contentMarginTop||T.contentMarginBottom!==C.contentMarginBottom||T.pageBreakBackground!==C.pageBreakBackground||T.enabled!==C.enabled)||(T.pageHeight=C.pageHeight,T.pageWidth=C.pageWidth,T.marginTop=C.marginTop,T.marginBottom=C.marginBottom,T.marginLeft=C.marginLeft,T.marginRight=C.marginRight,T.pageGap=C.pageGap,T.contentMarginTop=C.contentMarginTop,T.contentMarginBottom=C.contentMarginBottom,T.pageBreakBackground=C.pageBreakBackground,T.enabled=C.enabled,O.value.view.dispatch(O.value.state.tr))},{deep:!0}),s.watch(X,C=>{var T,M,Q,se,de,ye,ve,me;C&&O.value&&(!w.value&&!S.value&&!A.value&&!I.value&&(w.value=((M=(T=O.value.storage.PaginationPlus)==null?void 0:T.appliedConfig)==null?void 0:M.headerLeft)||"",S.value=((se=(Q=O.value.storage.PaginationPlus)==null?void 0:Q.appliedConfig)==null?void 0:se.headerRight)||"",A.value=((ye=(de=O.value.storage.PaginationPlus)==null?void 0:de.appliedConfig)==null?void 0:ye.footerLeft)||"",I.value=((me=(ve=O.value.storage.PaginationPlus)==null?void 0:ve.appliedConfig)==null?void 0:me.footerRight)||""),Uc(),Bt(),ze.value&&i("ready",ze.value),O.value.on("selectionUpdate",()=>{Wr(),ei()}),O.value.on("transaction",()=>{ei(),Wi(),H()}),Wr(),Wi(),ei(),H(),setTimeout(()=>{var le;return(le=O.value)==null?void 0:le.commands.focus("start")},50),[100,300,600,1200,2500].forEach(le=>{setTimeout(()=>{O.value&&O.value.view.dispatch(O.value.state.tr)},le)}),O.value.view.dom.addEventListener("keydown",le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),Fc())}),Y&&O.value.view.dom.removeEventListener("keydown",Y),Y=le=>{(le.metaKey||le.ctrlKey)&&le.key.toLowerCase()==="l"&&(le.preventDefault(),ls())},O.value.view.dom.addEventListener("keydown",Y),O.value.view.dom.addEventListener("click",le=>{const he=le.target;if(!he||le.detail!==2||he.closest('.rm-google-docs-header-bar, .rm-google-docs-footer-bar, .rm-options-dropdown, [contenteditable="true"]'))return;if(he.closest(".rm-page-header, .rm-first-page-header")){ca(le);return}if(he.closest(".rm-page-footer")){ua(le);return}const Ne=he.closest(".rm-with-pagination, .rm-page-break, .page, .docs-editor-page");if(Ne){const Me=Ne.getBoundingClientRect(),De=le.clientY-Me.top,Ie=fn.value*37.795;if(De>=0&&De<=Math.max(Ie,40)+15){let $e=null;Ne.classList.contains("rm-page-break")&&($e=Ne.querySelector(".rm-page-header")),$e||($e=document.querySelector(".rm-page-header, .rm-first-page-header")),$e&&ca(le);return}const Ve=Me.bottom-le.clientY,xt=pn.value*37.795;if(Ve>=0&&Ve<=Math.max(xt,40)+15){let $e=null;Ne.classList.contains("rm-page-break")&&($e=Ne.querySelector(".rm-page-footer")),$e||($e=document.querySelector(".rm-page-footer")),$e&&ua(le)}}}))}),s.onUnmounted(()=>{mn(!1),K.value&&clearTimeout(K.value),Ai&&clearTimeout(Ai),hn&&clearTimeout(hn),window.removeEventListener("resize",Jc)});const ia=s.ref(!1),ns=s.ref(!1),is=s.ref(!1),ra=s.ref(!1),Zi=s.ref(!1),aa=s.ref(""),rs=s.ref(""),oa=s.ref(!1);function Fc(){if(!O.value)return;const{state:C}=O.value,{from:T,to:M,empty:Q}=C.selection,se=O.value.getAttributes("link");se.href?(oa.value=!0,rs.value=se.href,Q?aa.value="":aa.value=C.doc.textBetween(T,M," ")):(oa.value=!1,rs.value="https://",aa.value=Q?"":C.doc.textBetween(T,M," ")),Zi.value=!0}function Lh(C){if(!O.value)return;const{state:T}=O.value,{from:M,to:Q,empty:se}=T.selection,de=C.text.trim(),ye=O.value.chain().focus();oa.value||O.value.isActive("link")?(ye.setLink({href:C.url,target:"_blank"}).run(),de&&!se&&ye.insertContentAt({from:M,to:Q},de).run()):de?ye.insertContentAt({from:M,to:Q},{type:"text",text:de,marks:[{type:"link",attrs:{href:C.url,target:"_blank"}}]}).run():se?ye.insertContent({type:"text",text:C.url,marks:[{type:"link",attrs:{href:C.url,target:"_blank"}}]}).run():ye.setLink({href:C.url,target:"_blank"}).run(),Zi.value=!1}function Bh(){if(!O.value)return;O.value.chain().focus().unsetLink().run(),Zi.value=!1}const sa=s.ref(f.value),ii=s.ref(u.value),et=s.ref({top:Dn(l.value.top),bottom:Dn(l.value.bottom),left:Dn(l.value.left),right:Dn(l.value.right)}),Qi=Number((yN/rr).toFixed(1));function Dn(C){return Math.round(C/rr*10)/10}function la(C){return Math.round(C*rr)}const Ph=()=>{sa.value=f.value,ii.value=u.value,et.value={top:Dn(l.value.top),bottom:Dn(l.value.bottom),left:Dn(l.value.left),right:Dn(l.value.right)},ia.value=!0},Fh=()=>{const C=T=>{const M=typeof T=="number"?T:Number(T);return Number.isFinite(M)?Math.min(Qi,Math.max(Oi,M)):Oi};f.value=sa.value,u.value=ii.value,et.value={top:C(et.value.top),bottom:C(et.value.bottom),left:C(et.value.left),right:C(et.value.right)},l.value={top:la(et.value.top),bottom:la(et.value.bottom),left:la(et.value.left),right:la(et.value.right)},i("update:pageSize",f.value),i("update:orientation",ii.value),i("update:margins",{...l.value}),ia.value=!1},as=s.ref(!1),zn={value:null},ss=s.ref(!1),In={value:null},Vh=()=>{Ki.value=fn.value,Xi.value=pn.value,Xr.value=Je.value,Jr.value=$t.value,Kr.value=!0},Uh=()=>{fn.value=c(Ki.value),pn.value=c(Xi.value),Ki.value=fn.value,Xi.value=pn.value,Je.value=Xr.value,$t.value=Jr.value,Kr.value=!1,Bt(),i("update:header-footer-margins",{headerMarginCm:fn.value,footerMarginCm:pn.value}),ce()},Vc=()=>{Uc(),Mn.value=ni.value,_i.value=[...Ji.value],Si.value=Pc(_i.value),Ci.value=Qr.value,ea.value=Yr.value,ta.value=_.value,na.value=E.value,Qo.value=!1,Zr.value=!0},Uc=()=>{const C="{page}",T=[w.value,S.value].some(Q=>Q.includes(C));[A.value,I.value].some(Q=>Q.includes(C))&&!T?ni.value="footer":ni.value="header"},Hh=()=>{ni.value=Mn.value,Ji.value=Bc(Si.value),Qr.value=Ci.value,Yr.value=ea.value,Zr.value=!1;const C="{page}";ni.value==="footer"?(S.value.includes(C)&&(S.value=S.value.replace(/{page}/g,"").trim()),I.value=C):(I.value.includes(C)&&(I.value=I.value.replace(/{page}/g,"").trim()),S.value=C),Qo.value&&(ni.value==="footer"?E.value=na.value:_.value=ta.value),Bt(),ce()},qh=()=>{w.value="",S.value="",Bt(),ce(),as.value=!1},jh=()=>{A.value="",I.value="",Bt(),ce(),ss.value=!1},$h=()=>A.value,Wh=C=>{const T=C===1,M=C%2===0;return Je.value&&T?ti.value:$t.value&&M?Zo.value:w.value},mn=(C=!0)=>{var Q;const T=zn.value;if(!T)return;const M=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(Q=wt.value)==null||Q.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetHeader.classList.remove("rm-header-active"),zn.value=null,as.value=!1,C&&(Je.value&&T.isFirstPage?ti.value=M:$t.value&&T.pageIndex%2===0?Zo.value=M:w.value=M,Bt(),ce())},Ei=(C=!0)=>{var Q;const T=In.value;if(!T)return;const M=T.input.innerHTML.trim();document.removeEventListener("mousedown",T.onOutsideMouseDown),window.removeEventListener("resize",T.onResize),window.removeEventListener("scroll",T.onWindowScroll),(Q=wt.value)==null||Q.removeEventListener("scroll",T.onScroll),T.overlay.remove(),T.generatedContent&&(T.generatedContent.style.visibility=""),T.targetFooter.classList.remove("rm-footer-active"),In.value=null,ss.value=!1,C&&(A.value=M,Bt(),ce())},Hc=C=>{if(!C.targetHeader.parentNode||!O.value)return;const T=O.value.view.dom,M=C.targetHeader.getBoundingClientRect(),Q=T.getBoundingClientRect(),se=getComputedStyle(T),de=parseFloat(se.getPropertyValue("--rm-margin-left"))||0,ye=parseFloat(se.getPropertyValue("--rm-margin-right"))||0,ve=C.targetHeader.querySelector(".rm-page-header-content"),me=(ve==null?void 0:ve.getBoundingClientRect())??M,ue=C.isFirstPage?M.left:M.left+de,le=C.isFirstPage?M.right:M.right-ye,he=Math.max(0,ue-Q.left),Ce=Math.max(0,Q.right-le);C.overlay.style.left=`${ue}px`,C.overlay.style.top=`${me.top}px`,C.overlay.style.width=`${Math.max(le-ue,1)}px`,C.overlay.style.height=`${Math.max(me.height,24)}px`,C.activeBar.style.setProperty("--rm-header-bar-left",`${-he}px`),C.activeBar.style.setProperty("--rm-header-bar-width",`${Q.width}px`),C.activeBar.style.setProperty("--rm-header-bar-padding-left",`${he}px`),C.activeBar.style.setProperty("--rm-header-bar-padding-right",`${Ce}px`)},qc=C=>{if(!C.targetFooter.parentNode||!O.value)return;const T=O.value.view.dom,M=C.targetFooter.getBoundingClientRect(),Q=T.getBoundingClientRect(),se=getComputedStyle(T),de=parseFloat(se.getPropertyValue("--rm-margin-left"))||0,ye=parseFloat(se.getPropertyValue("--rm-margin-right"))||0,ve=C.targetFooter.querySelector(".rm-page-footer-content"),me=(ve==null?void 0:ve.getBoundingClientRect())??M,ue=M.left+de,le=M.right-ye,he=Math.max(0,ue-Q.left),Ce=Math.max(0,Q.right-le);C.overlay.style.left=`${ue}px`,C.overlay.style.top=`${me.top}px`,C.overlay.style.width=`${Math.max(le-ue,1)}px`,C.overlay.style.height=`${Math.max(me.height,24)}px`,C.activeBar.style.setProperty("--rm-footer-bar-left",`${-he}px`),C.activeBar.style.setProperty("--rm-footer-bar-width",`${Q.width}px`),C.activeBar.style.setProperty("--rm-footer-bar-padding-left",`${he}px`),C.activeBar.style.setProperty("--rm-footer-bar-padding-right",`${Ce}px`)},ca=C=>{var xn,nu;const T=In.value;if(T){const xe=C==null?void 0:C.target;if(xe instanceof Node&&T.overlay.contains(xe))return;Ei(!0)}const M=zn.value;if(M){const xe=C==null?void 0:C.target;if(!xe||xe instanceof Node&&M.targetHeader.contains(xe))return;mn(!1)}let Q=null;if(C){const xe=C.target;Q=xe==null?void 0:xe.closest(".rm-page-header, .rm-first-page-header")}if(Q||(Q=(xn=O.value)==null?void 0:xn.view.dom.querySelector(".rm-first-page-header, .rm-page-header")),!Q||!O.value)return;const se=O.value.view.dom,de=Q.classList.contains("rm-first-page-header"),ye=Array.from(se.querySelectorAll(".rm-page-break .rm-page-header")),ve=de?1:ye.indexOf(Q)+2;if(!de&&ve<2)return;const me=Q.querySelector(".rm-page-header-content");me&&(me.style.visibility="hidden");const ue=document.createElement("div");ue.className="rm-header-edit-input",ue.contentEditable="true",ue.setAttribute("role","textbox"),ue.setAttribute("aria-label",o("editor.headerFooter.header")||"Header"),ue.dataset.placeholder=o("editor.headerFooter.headerPlaceholder")||"Header",ue.innerHTML=Wh(ve);const le=document.createElement("div");le.className="rm-header-edit-overlay",le.appendChild(ue);const he=document.createElement("div");he.className="rm-google-docs-header-bar",he.innerHTML=`
15243
15243
  <span class="rm-header-label">${o("editor.headerFooter.header")||"Header"}</span>
15244
15244
  <div class="rm-header-right-tools">
15245
15245
  <label class="rm-diff-label">
@@ -15258,7 +15258,7 @@ ${n.innerHTML}
15258
15258
  </div>
15259
15259
  </div>
15260
15260
  </div>
15261
- `,le.appendChild(he),document.body.appendChild(le),Q.classList.add("rm-header-active");const Ce=()=>{const xe=zn.value;xe&&Hc(xe)},Te=Ce,Ne=Ce,Me=xe=>{const yn=xe.target;yn instanceof Node&&le.contains(yn)||yn instanceof Element&&yn.closest(".fixed.z-50")||mn(!0)},De=()=>{requestAnimationFrame(()=>{const xe=zn.value;xe&&!xe.overlay.contains(document.activeElement)&&mn(!0)})},Ie={targetHeader:Q,overlay:le,input:ue,activeBar:he,generatedContent:me,isFirstPage:de,pageIndex:ve,onOutsideMouseDown:Me,onInputBlur:De,onResize:Ce,onScroll:Te,onWindowScroll:Ne};zn.value=Ie,as.value=!0;const Ve=he.querySelector(".rm-diff-cb");Ve==null||Ve.addEventListener("mousedown",xe=>{xe.stopPropagation()}),Ve==null||Ve.addEventListener("change",xe=>{xe.stopPropagation();const yn=xe.target.checked;mn(!0),yn&&(ti.value="",Lc.value=""),Je.value=yn,Bt()});const xt=he.querySelector(".rm-options-btn"),$e=he.querySelector(".rm-options-dropdown"),bn=he.querySelector(".rm-arrow-icon");xt==null||xt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),xt==null||xt.addEventListener("click",xe=>{xe.stopPropagation(),xe.preventDefault();const yn=($e==null?void 0:$e.classList.toggle("is-open"))??!1;bn&&(bn.textContent=yn?"▲":"▼")});const Mt=he.querySelector(".rm-opt-format");Mt==null||Mt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),Mt==null||Mt.addEventListener("click",xe=>{xe.stopPropagation(),mn(!0),Fh()});const Zt=he.querySelector(".rm-opt-page-num");Zt==null||Zt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),Zt==null||Zt.addEventListener("click",xe=>{xe.stopPropagation(),mn(!0),Vc()});const gn=he.querySelector(".rm-opt-remove");gn==null||gn.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),gn==null||gn.addEventListener("click",xe=>{xe.stopPropagation(),mn(!1),Hh()}),ue.addEventListener("blur",De),document.addEventListener("mousedown",Me),window.addEventListener("resize",Ce),window.addEventListener("scroll",Ne),(nu=wt.value)==null||nu.addEventListener("scroll",Te),requestAnimationFrame(()=>{zn.value===Ie&&Hc(Ie)}),ue.focus();const vn=window.getSelection(),_e=document.createRange();_e.selectNodeContents(ue),_e.collapse(!1),vn==null||vn.removeAllRanges(),vn==null||vn.addRange(_e)},ua=C=>{var gn,vn;const T=zn.value;if(T){const _e=C==null?void 0:C.target;if(_e instanceof Node&&T.overlay.contains(_e))return;mn(!0)}const M=In.value;if(M){const _e=C==null?void 0:C.target;if(!_e||_e instanceof Node&&M.targetFooter.contains(_e))return;Ei(!1)}let Q=null;if(C){const _e=C.target;Q=_e==null?void 0:_e.closest(".rm-page-footer")}if(Q||(Q=(gn=O.value)==null?void 0:gn.view.dom.querySelector(".rm-page-footer")),!Q||!O.value)return;const se=O.value.view.dom,ye=Array.from(se.querySelectorAll(".rm-page-break .rm-page-footer")).indexOf(Q)+1,ve=Q.querySelector(".rm-page-footer-content");ve&&(ve.style.visibility="hidden");const me=document.createElement("div");me.className="rm-footer-edit-input",me.contentEditable="true",me.setAttribute("role","textbox"),me.setAttribute("aria-label",o("editor.headerFooter.footer")||"Footer"),me.dataset.placeholder=o("editor.headerFooter.footerPlaceholder")||"Footer",me.innerHTML=jh();const ue=document.createElement("div");ue.className="rm-footer-edit-overlay",ue.appendChild(me);const le=document.createElement("div");le.className="rm-google-docs-footer-bar",le.innerHTML=`
15261
+ `,le.appendChild(he),document.body.appendChild(le),Q.classList.add("rm-header-active");const Ce=()=>{const xe=zn.value;xe&&Hc(xe)},Te=Ce,Ne=Ce,Me=xe=>{const yn=xe.target;yn instanceof Node&&le.contains(yn)||yn instanceof Element&&yn.closest(".fixed.z-50")||mn(!0)},De=()=>{requestAnimationFrame(()=>{const xe=zn.value;xe&&!xe.overlay.contains(document.activeElement)&&mn(!0)})},Ie={targetHeader:Q,overlay:le,input:ue,activeBar:he,generatedContent:me,isFirstPage:de,pageIndex:ve,onOutsideMouseDown:Me,onInputBlur:De,onResize:Ce,onScroll:Te,onWindowScroll:Ne};zn.value=Ie,as.value=!0;const Ve=he.querySelector(".rm-diff-cb");Ve==null||Ve.addEventListener("mousedown",xe=>{xe.stopPropagation()}),Ve==null||Ve.addEventListener("change",xe=>{xe.stopPropagation();const yn=xe.target.checked;mn(!0),yn&&(ti.value="",Lc.value=""),Je.value=yn,Bt()});const xt=he.querySelector(".rm-options-btn"),$e=he.querySelector(".rm-options-dropdown"),bn=he.querySelector(".rm-arrow-icon");xt==null||xt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),xt==null||xt.addEventListener("click",xe=>{xe.stopPropagation(),xe.preventDefault();const yn=($e==null?void 0:$e.classList.toggle("is-open"))??!1;bn&&(bn.textContent=yn?"▲":"▼")});const Mt=he.querySelector(".rm-opt-format");Mt==null||Mt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),Mt==null||Mt.addEventListener("click",xe=>{xe.stopPropagation(),mn(!0),Vh()});const Zt=he.querySelector(".rm-opt-page-num");Zt==null||Zt.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),Zt==null||Zt.addEventListener("click",xe=>{xe.stopPropagation(),mn(!0),Vc()});const gn=he.querySelector(".rm-opt-remove");gn==null||gn.addEventListener("mousedown",xe=>{xe.stopPropagation(),xe.preventDefault()}),gn==null||gn.addEventListener("click",xe=>{xe.stopPropagation(),mn(!1),qh()}),ue.addEventListener("blur",De),document.addEventListener("mousedown",Me),window.addEventListener("resize",Ce),window.addEventListener("scroll",Ne),(nu=wt.value)==null||nu.addEventListener("scroll",Te),requestAnimationFrame(()=>{zn.value===Ie&&Hc(Ie)}),ue.focus();const vn=window.getSelection(),_e=document.createRange();_e.selectNodeContents(ue),_e.collapse(!1),vn==null||vn.removeAllRanges(),vn==null||vn.addRange(_e)},ua=C=>{var gn,vn;const T=zn.value;if(T){const _e=C==null?void 0:C.target;if(_e instanceof Node&&T.overlay.contains(_e))return;mn(!0)}const M=In.value;if(M){const _e=C==null?void 0:C.target;if(!_e||_e instanceof Node&&M.targetFooter.contains(_e))return;Ei(!1)}let Q=null;if(C){const _e=C.target;Q=_e==null?void 0:_e.closest(".rm-page-footer")}if(Q||(Q=(gn=O.value)==null?void 0:gn.view.dom.querySelector(".rm-page-footer")),!Q||!O.value)return;const se=O.value.view.dom,ye=Array.from(se.querySelectorAll(".rm-page-break .rm-page-footer")).indexOf(Q)+1,ve=Q.querySelector(".rm-page-footer-content");ve&&(ve.style.visibility="hidden");const me=document.createElement("div");me.className="rm-footer-edit-input",me.contentEditable="true",me.setAttribute("role","textbox"),me.setAttribute("aria-label",o("editor.headerFooter.footer")||"Footer"),me.dataset.placeholder=o("editor.headerFooter.footerPlaceholder")||"Footer",me.innerHTML=$h();const ue=document.createElement("div");ue.className="rm-footer-edit-overlay",ue.appendChild(me);const le=document.createElement("div");le.className="rm-google-docs-footer-bar",le.innerHTML=`
15262
15262
  <span class="rm-footer-label">${o("editor.headerFooter.footer")||"Footer"}</span>
15263
15263
  <div class="rm-footer-right-tools">
15264
15264
  <div class="rm-options-wrapper">
@@ -15272,7 +15272,7 @@ ${n.innerHTML}
15272
15272
  </div>
15273
15273
  </div>
15274
15274
  </div>
15275
- `,ue.appendChild(le),document.body.appendChild(ue),Q.classList.add("rm-footer-active");const he=()=>{const _e=In.value;_e&&qc(_e)},Ce=he,Te=he,Ne=_e=>{const xn=_e.target;xn instanceof Node&&ue.contains(xn)||xn instanceof Element&&xn.closest(".fixed.z-50")||Ei(!0)},Me=()=>{requestAnimationFrame(()=>{const _e=In.value;_e&&!_e.overlay.contains(document.activeElement)&&Ei(!0)})},De={targetFooter:Q,overlay:ue,input:me,activeBar:le,generatedContent:ve,pageIndex:ye,onOutsideMouseDown:Ne,onInputBlur:Me,onResize:he,onScroll:Ce,onWindowScroll:Te};In.value=De,ss.value=!0;const Ie=le.querySelector(".rm-options-btn"),Ve=le.querySelector(".rm-options-dropdown"),xt=le.querySelector(".rm-arrow-icon");Ie==null||Ie.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),Ie==null||Ie.addEventListener("click",_e=>{_e.stopPropagation(),_e.preventDefault();const xn=(Ve==null?void 0:Ve.classList.toggle("is-open"))??!1;xt&&(xt.textContent=xn?"▲":"▼")});const $e=le.querySelector(".rm-opt-page-num");$e==null||$e.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),$e==null||$e.addEventListener("click",_e=>{_e.stopPropagation(),Ei(!0),Vc()});const bn=le.querySelector(".rm-opt-remove");bn==null||bn.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),bn==null||bn.addEventListener("click",_e=>{_e.stopPropagation(),Ei(!1),qh()}),me.addEventListener("blur",Me),document.addEventListener("mousedown",Ne),window.addEventListener("resize",he),window.addEventListener("scroll",Te),(vn=wt.value)==null||vn.addEventListener("scroll",Ce),requestAnimationFrame(()=>{In.value===De&&qc(De)}),me.focus();const Mt=window.getSelection(),Zt=document.createRange();Zt.selectNodeContents(me),Zt.collapse(!1),Mt==null||Mt.removeAllRanges(),Mt==null||Mt.addRange(Zt)},_t=(C,...T)=>{if(!O.value)return;const M=O.value.commands[C];typeof M=="function"&&M(...T),O.value.commands.focus()},vt=(C,...T)=>{if(!O.value)return;const M=F.value[C];if(typeof M=="function")M(...T);else{_t(C,...T);return}O.value.commands.focus()},jc=C=>{const T=C==="header"?S:I;T.value.includes("{page}")||(T.value=T.value?`${T.value} {page}`:"{page}"),Bt(),ce()},$c=()=>{if(!O.value)return null;const{state:C}=O.value;if(C.selection.empty)return null;const T=C.selection.content(),M=document.createElement("div");return M.appendChild(Hi.fromSchema(C.schema).serializeFragment(T.content)),{html:M.innerHTML,text:T.content.textBetween(0,T.content.size,`
15275
+ `,ue.appendChild(le),document.body.appendChild(ue),Q.classList.add("rm-footer-active");const he=()=>{const _e=In.value;_e&&qc(_e)},Ce=he,Te=he,Ne=_e=>{const xn=_e.target;xn instanceof Node&&ue.contains(xn)||xn instanceof Element&&xn.closest(".fixed.z-50")||Ei(!0)},Me=()=>{requestAnimationFrame(()=>{const _e=In.value;_e&&!_e.overlay.contains(document.activeElement)&&Ei(!0)})},De={targetFooter:Q,overlay:ue,input:me,activeBar:le,generatedContent:ve,pageIndex:ye,onOutsideMouseDown:Ne,onInputBlur:Me,onResize:he,onScroll:Ce,onWindowScroll:Te};In.value=De,ss.value=!0;const Ie=le.querySelector(".rm-options-btn"),Ve=le.querySelector(".rm-options-dropdown"),xt=le.querySelector(".rm-arrow-icon");Ie==null||Ie.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),Ie==null||Ie.addEventListener("click",_e=>{_e.stopPropagation(),_e.preventDefault();const xn=(Ve==null?void 0:Ve.classList.toggle("is-open"))??!1;xt&&(xt.textContent=xn?"▲":"▼")});const $e=le.querySelector(".rm-opt-page-num");$e==null||$e.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),$e==null||$e.addEventListener("click",_e=>{_e.stopPropagation(),Ei(!0),Vc()});const bn=le.querySelector(".rm-opt-remove");bn==null||bn.addEventListener("mousedown",_e=>{_e.stopPropagation(),_e.preventDefault()}),bn==null||bn.addEventListener("click",_e=>{_e.stopPropagation(),Ei(!1),jh()}),me.addEventListener("blur",Me),document.addEventListener("mousedown",Ne),window.addEventListener("resize",he),window.addEventListener("scroll",Te),(vn=wt.value)==null||vn.addEventListener("scroll",Ce),requestAnimationFrame(()=>{In.value===De&&qc(De)}),me.focus();const Mt=window.getSelection(),Zt=document.createRange();Zt.selectNodeContents(me),Zt.collapse(!1),Mt==null||Mt.removeAllRanges(),Mt==null||Mt.addRange(Zt)},_t=(C,...T)=>{if(!O.value)return;const M=O.value.commands[C];typeof M=="function"&&M(...T),O.value.commands.focus()},vt=(C,...T)=>{if(!O.value)return;const M=F.value[C];if(typeof M=="function")M(...T);else{_t(C,...T);return}O.value.commands.focus()},jc=C=>{const T=C==="header"?S:I;T.value.includes("{page}")||(T.value=T.value?`${T.value} {page}`:"{page}"),Bt(),ce()},$c=()=>{if(!O.value)return null;const{state:C}=O.value;if(C.selection.empty)return null;const T=C.selection.content(),M=document.createElement("div");return M.appendChild(Hi.fromSchema(C.schema).serializeFragment(T.content)),{html:M.innerHTML,text:T.content.textBetween(0,T.content.size,`
15276
15276
 
15277
- `," ")}},Wh=async()=>{const C=$c();if(!C||!O.value)return;await rf(C.text,C.html)&&O.value.chain().focus().deleteSelection().run()},Gh=async()=>{var T;const C=$c();C&&(await rf(C.text,C.html),(T=O.value)==null||T.commands.focus())},Kh=async()=>{if(!O.value)return;const C=await iT();if(C){const M=Ee.sanitizePastedHTML(C);try{O.value.chain().focus().insertContent(M).run()}catch(Q){console.error("[DocsEditor] paste HTML failed, falling back to plain text:",Q);const se=await Us();if(se)try{O.value.chain().focus().insertContent(se).run()}catch(de){console.error("[DocsEditor] paste plain text also failed:",de)}}return}const T=await Us();if(T)try{O.value.chain().focus().insertContent(T).run()}catch(M){console.error("[DocsEditor] paste plain text failed:",M)}},Wc=async()=>{if(!O.value)return;const C=await Us();C&&O.value.chain().focus().insertContent(C).run()},Xh=()=>{if(!O.value)return;const{state:C}=O.value;if(C.selection.empty){const{from:T,to:M}=C.selection;M<C.doc.content.size&&O.value.chain().focus().deleteRange({from:T,to:M+1}).run()}else O.value.chain().focus().deleteSelection().run()},Gc=C=>{var T;if(C.key==="Escape"&&oe.value){oe.value=!1;return}!(C.metaKey||C.ctrlKey)||!C.shiftKey||(T=O.value)!=null&&T.view.dom.contains(C.target)&&(C.key.toLowerCase()==="v"?(C.preventDefault(),Wc()):C.key.toLowerCase()==="h"&&(C.preventDefault(),ra.value=!0))};s.onMounted(()=>document.addEventListener("keydown",Gc)),s.onUnmounted(()=>document.removeEventListener("keydown",Gc));const Kc={undo:()=>_t("undo"),redo:()=>_t("redo"),"select-all":()=>_t("selectAll"),cut:()=>{Wh()},copy:()=>{Gh()},paste:()=>{Kh()},"paste-without-formatting":()=>{Wc()},delete:()=>Xh(),bold:()=>_t("toggleBold"),italic:()=>_t("toggleItalic"),underline:()=>_t("toggleUnderline"),heading1:()=>_t("toggleHeading",{level:1}),heading2:()=>_t("toggleHeading",{level:2}),heading3:()=>_t("toggleHeading",{level:3}),"align-left":()=>vt("alignLeft"),"align-center":()=>vt("alignCenter"),"align-right":()=>vt("alignRight"),"align-justify":()=>vt("alignJustify"),"bullet-list":()=>_t("toggleBulletList"),"numbered-list":()=>_t("toggleOrderedList"),"task-list":()=>vt("toggleTaskList"),"horizontal-line":()=>_t("setHorizontalRule"),"page-numbers-header":()=>jc("header"),"page-numbers-footer":()=>jc("footer"),"clear-formatting":()=>{O.value&&(O.value.chain().unsetAllMarks().clearNodes().run(),_t("setTextAlign","left"))},"insert-image":()=>vt("insertImage"),"insert-table":()=>vt("insertTable",{rows:3,cols:3,withHeaderRow:!0}),"insert-code":()=>vt("toggleCodeBlock"),"insert-page-break":()=>vt("insertPageBreak"),"insert-toc":()=>vt("insertToc"),"insert-date-chip":()=>vt("insertDateChip"),"insert-people-chip":()=>vt("insertPeopleChip"),"insert-file-chip":()=>vt("insertFileChip"),"insert-dropdown-chip":()=>vt("insertDropdownChip"),"insert-location-chip":()=>vt("insertLocationChip")};let Jh=C=>{if(C==="page-setup")Bh();else if(C==="print")Xc();else if(C==="version-history")Yi("history");else if(C==="details")ns.value=!0;else if(C==="email")is.value=!0;else if(C==="find-replace")ra.value=!0;else if(C==="insert-link")Fc();else if(C==="security")i("share");else if(C==="insert-header")ca();else if(C==="insert-footer")ua();else if(C==="toggle-pageless")Ot(!m.value);else if(C==="toggle-left-sidebar")Yi("toc");else if(C==="toggle-ruler")W.value=!W.value;else if(C==="toggle-focus-mode")oe.value=!oe.value,oe.value&&($.value=null);else if(C==="new-help-me-create")ls();else if(C==="insert-footnote"){if(!O.value)return;const{state:T,view:M}=O.value,Q=T.schema.nodes.footnote;if(!Q){console.error("[DocsEditor] footnote node type not registered in schema");return}const se=T.selection.head,de=Q.create({content:""}),ye=T.tr.insert(se,de);M.dispatch(ye),M.focus(),setTimeout(()=>{da();const ve=document.querySelectorAll(".docs-footnote-item-text"),me=ve[ve.length-1];me&&(me.scrollIntoView({behavior:"smooth",block:"nearest"}),me.focus())},160)}else Kc[C]?Kc[C]():i("menu-click",C)},Yi=C=>{$.value=$.value===C?null:C};function ls(){if(typeof n.onAiChat=="function"){n.onAiChat(Zh());return}Yi("ai")}function Zh(){const C=s.toRaw(O.value),T={context:{}};if(!C)return T;const{from:M,to:Q,empty:se}=C.state.selection;se||(T.selection=C.state.doc.textBetween(M,Q,`
15278
- `," "));try{const de=Ll(C);T.context=de}catch{T.context={}}return T}let Xc=()=>window.print();const Qh=(C,T)=>{if(!O.value)return;const M=O.value.view;M.state.doc.descendants((Q,se)=>{if(Q.type.name==="footnote"&&M.nodeDOM(se)===C)return M.dispatch(M.state.tr.setNodeMarkup(se,void 0,{content:T})),!1})};let hn=null,Ai=null;const da=()=>{var ve;if(!O.value||!X.value)return;const C=O.value.view.dom,T=C.querySelector("[data-rm-pagination]");if(!T)return;const M=me=>{var he,Ce,Te;const ue=document.createElement("div");if(ue.className="docs-footnote-item-text",me.hasAttribute("data-footnote-source-id")){const Ne=me.getAttribute("data-citation-id")??"",Me=(Ce=(he=O.value)==null?void 0:he.storage)==null?void 0:Ce.citationEngine,De=((Te=Me==null?void 0:Me.engine)==null?void 0:Te.renderCluster(Ne))??"";if(ue.classList.add("docs-footnote-item-text--citation"),De)ue.innerHTML=De;else{const Ie=me.getAttribute("data-footnote-content")??"";Ie?ue.innerHTML=Ie:ue.setAttribute("data-empty","true")}return ue}const le=me.getAttribute("data-footnote-content")??"";return ue.contentEditable="true",ue.textContent=le,le||ue.setAttribute("data-empty","true"),ue.addEventListener("input",()=>{ue.removeAttribute("data-empty"),ue.textContent||ue.setAttribute("data-empty","true")}),ue.addEventListener("blur",()=>{var Me;const Ne=((Me=ue.textContent)==null?void 0:Me.trim())??"";Qh(me,Ne)}),ue},Q=Array.from(T.querySelectorAll(".rm-page-break")),se=Array.from(C.querySelectorAll(".docs-footnote-ref"));if(Q.length===0){se.forEach((Ce,Te)=>{Ce.textContent=String(Te+1)});const me=Ut.value;if(!me||((ve=me.querySelector(".docs-pageless-footnotes"))==null||ve.remove(),se.length===0))return;const ue=me.querySelector(".docs-pageless-footnotes");if(ue!=null&&ue.querySelector(".docs-footnote-item-text:focus"))return;const le=document.createElement("div");le.className="docs-page-footnotes docs-pageless-footnotes";const he=document.createElement("div");he.className="docs-footnotes-sep",le.appendChild(he),se.forEach((Ce,Te)=>{const Ne=document.createElement("div");Ne.className="docs-footnote-item";const Me=document.createElement("sup");Me.className="docs-footnote-item-num",Me.textContent=String(Te+1);const De=M(Ce);Ce.dataset.footnoteItemId=`fn-pageless-${Te}`,Ne.id=`fn-pageless-${Te}`,Ne.appendChild(Me),Ne.appendChild(De),le.appendChild(Ne)}),me.appendChild(le);return}const de=new Map;Q.forEach((me,ue)=>de.set(ue,[])),se.forEach(me=>{const ue=me.getBoundingClientRect().top;let le=Q.length-1;for(let he=0;he<Q.length-1;he++){const Ce=Q[he].querySelector(".breaker");if(Ce&&ue<Ce.getBoundingClientRect().top){le=he;break}}de.get(le).push(me)});let ye=1;Q.forEach((me,ue)=>{const le=de.get(ue)??[],he=ye;ye+=le.length,le.forEach((De,Ie)=>{De.textContent=String(he+Ie)});const Ce=me.querySelector(".docs-page-footnotes");if(Ce!=null&&Ce.querySelector(".docs-footnote-item-text:focus")||(Ce==null||Ce.remove(),le.length===0))return;const Te=document.createElement("div");Te.className="docs-page-footnotes";const Ne=document.createElement("div");Ne.className="docs-footnotes-sep",Te.appendChild(Ne),le.forEach((De,Ie)=>{const Ve=document.createElement("div");Ve.className="docs-footnote-item";const xt=document.createElement("sup");xt.className="docs-footnote-item-num",xt.textContent=String(he+Ie);const $e=M(De);De.dataset.footnoteItemId=`fn-${ue}-${Ie}`,Ve.id=`fn-${ue}-${Ie}`,Ve.appendChild(xt),Ve.appendChild($e),Te.appendChild(Ve)});const Me=me.querySelector(".breaker");Me?Me.insertBefore(Te,Me.firstChild):me.appendChild(Te)})};s.watch(X,C=>{!C||!O.value||O.value.view.dom.addEventListener("click",T=>{const M=T.target.closest(".docs-footnote-ref");if(!M)return;T.preventDefault(),T.stopPropagation();const Q=M.dataset.footnoteItemId;if(!Q)return;const se=document.getElementById(Q),de=se==null?void 0:se.querySelector(".docs-footnote-item-text");if(de){de.scrollIntoView({behavior:"smooth",block:"nearest"}),de.focus();const ye=document.createRange();ye.selectNodeContents(de),ye.collapse(!1);const ve=window.getSelection();ve==null||ve.removeAllRanges(),ve==null||ve.addRange(ye)}})});function fa(C){hn&&clearTimeout(hn),hn=setTimeout(()=>{hn=null,da()},C)}const Jc=()=>{Ai&&clearTimeout(Ai),hn&&(clearTimeout(hn),hn=null),Ai=setTimeout(()=>{Ai=null,da()},150)};return s.watch(X,C=>{var M;if(!C||!O.value)return;fa(150),O.value.on("update",()=>{fa(60)}),O.value.on("selectionUpdate",()=>{fa(100)});const T=O.value.storage.citationEngine;(M=T==null?void 0:T.engine)==null||M.onChange(()=>{fa(30)}),window.addEventListener("resize",Jc)}),(C,T)=>(s.openBlock(),s.createElementBlock("div",rT,[oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Of,{key:0,title:e.title,editable:e.editable,collaborators:e.collaborators,starred:e.starred,"user-name":e.userName,"user-avatar":e.userAvatar,pageless:m.value,"outline-open":$.value==="toc","show-ruler":W.value,"focus-mode":oe.value,onMenuClick:s.unref(Jh),onBack:T[0]||(T[0]=M=>C.$emit("back")),"onUpdate:title":T[1]||(T[1]=M=>C.$emit("update:title",M)),onToggleStar:T[2]||(T[2]=M=>C.$emit("toggle-star")),onExport:T[3]||(T[3]=M=>C.$emit("export",M)),onShare:T[4]||(T[4]=M=>C.$emit("share"))},{actions:s.withCtx(()=>[s.renderSlot(C.$slots,"header-actions",{},void 0,!0)]),"overflow-actions":s.withCtx(M=>[s.renderSlot(C.$slots,"overflow-actions",s.normalizeProps(s.guardReactiveProps(M)),void 0,!0)]),"user-menu":s.withCtx(M=>[s.renderSlot(C.$slots,"user-menu",s.normalizeProps(s.guardReactiveProps(M)),void 0,!0)]),_:3},8,["title","editable","collaborators","starred","user-name","user-avatar","pageless","outline-open","show-ruler","focus-mode","onMenuClick"])),oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Mf,{key:1,actions:s.unref(F),plugins:e.plugins,editor:s.unref(O),"active-sidebar":$.value,onToggleSidebar:s.unref(Yi),onPrint:s.unref(Xc)},null,8,["actions","plugins","editor","active-sidebar","onToggleSidebar","onPrint"])),W.value&&!oe.value?(s.openBlock(),s.createBlock(l1,{key:2,"layout-options":p.value},null,8,["layout-options"])):s.createCommentVNode("",!0),oe.value?(s.openBlock(),s.createElementBlock("button",{key:3,type:"button",class:"fixed right-4 top-4 z-50 flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 shadow-md transition-colors hover:bg-slate-100 dark:border-white/10 dark:bg-[#0e1525] dark:text-slate-300 dark:hover:bg-white/5",title:s.unref(o)("header.focusMode"),"aria-label":s.unref(o)("header.focusMode"),onClick:T[5]||(T[5]=M=>oe.value=!1)},[s.createVNode(s.unref(s0),{class:"h-5 w-5"})],8,aT)):s.createCommentVNode("",!0),s.createVNode(Df,{visible:B.value,actions:s.unref(F),position:j.value,editor:s.unref(O),onChat:ls},null,8,["visible","actions","position","editor"]),s.createVNode(bf,{editor:s.unref(O),commands:re.value},null,8,["editor","commands"]),s.createElementVNode("div",oT,[s.createVNode(j8,{"is-open":ra.value,editor:s.unref(O),onClose:T[6]||(T[6]=M=>ra.value=!1)},null,8,["is-open","editor"]),$.value==="toc"?(s.openBlock(),s.createBlock(If,{key:0,editor:s.unref(O),onClose:T[7]||(T[7]=M=>$.value=null)},null,8,["editor"])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"absolute left-4 top-4 z-20 flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 shadow-md transition-colors hover:bg-slate-100 dark:border-white/10 dark:bg-[#0e1525] dark:text-slate-300 dark:hover:bg-white/5",title:s.unref(o)("editor.showOutline"),onClick:T[8]||(T[8]=M=>s.unref(Yi)("toc"))},[s.createVNode(s.unref(r0),{class:"h-5 w-5"})],8,sT)),s.createElementVNode("div",{ref_key:"scrollContainerRef",ref:wt,class:"docs-editor-scroll relative flex flex-1 overflow-auto px-4 py-6 bg-slate-100 dark:bg-[#02040a]",onScroll:qt},[W.value&&!oe.value?(s.openBlock(),s.createBlock(d1,{key:0,"layout-options":p.value},null,8,["layout-options"])):s.createCommentVNode("",!0),s.createElementVNode("div",lT,[s.createElementVNode("div",{class:"relative w-full",style:s.normalizeStyle({maxWidth:h.value})},[b.value?(s.openBlock(),s.createBlock(bb,{key:0,data:s.unref(Jo),"is-ready":s.unref(dn)},null,8,["data","is-ready"])):s.createCommentVNode("",!0),s.unref(X)?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center bg-white dark:bg-[#0e1525]/60 backdrop-blur-[2px] gap-3 rounded-lg","aria-label":s.unref(o)("editor.loadingDocument")},null,8,cT)),s.createElementVNode("div",{ref_key:"editorRef",ref:Ut,class:s.normalizeClass(["docs-editor__paper outline-none text-slate-800 dark:text-[#e2e8f0]",{"opacity-40":!s.unref(X)}])},null,2)],4)])],544),$.value==="references"?(s.openBlock(),s.createBlock(ey,{key:2,sources:fe.value,"active-style":Oe.value,"picker-mode":Se.value,"can-import":$i.value,importing:qe.value,"import-message":Nt.value,onClose:T[9]||(T[9]=M=>$.value=null),onInsert:On,onCreate:un,onUpdate:Nn,onRemove:Yn,"onUpdate:style":Ht,onImportDoi:qr,onImportBibliography:jr},null,8,["sources","active-style","picker-mode","can-import","importing","import-message"])):s.createCommentVNode("",!0),$.value==="comments"?(s.openBlock(),s.createBlock(Ch,{key:3,comments:n.comments,"selected-text-snippet":n.selectedTextSnippet,"selected-text-index":n.selectedTextIndex,"orphaned-ids":q.value,onClose:T[10]||(T[10]=M=>$.value=null),onAddComment:T[11]||(T[11]=(M,Q,se)=>C.$emit("add-comment",M,Q,se)),onAddReply:T[12]||(T[12]=(M,Q)=>C.$emit("add-reply",M,Q)),onResolveComment:T[13]||(T[13]=M=>C.$emit("resolve-comment",M)),onDeleteComment:T[14]||(T[14]=M=>C.$emit("delete-comment",M))},null,8,["comments","selected-text-snippet","selected-text-index","orphaned-ids"])):s.createCommentVNode("",!0),$.value==="history"?(s.openBlock(),s.createBlock(Eh,{key:4,snapshots:n.snapshots,"active-preview-index":n.activePreviewIndex,onSaveSnapshot:T[15]||(T[15]=M=>C.$emit("save-snapshot",M)),onRestoreSnapshot:T[16]||(T[16]=M=>C.$emit("restore-snapshot",M)),onPreviewSnapshot:T[17]||(T[17]=M=>C.$emit("preview-snapshot",M))},null,8,["snapshots","active-preview-index"])):s.createCommentVNode("",!0),$.value==="ai"?(s.openBlock(),s.createBlock(Sh,{key:5,editor:s.unref(O),"ai-stream":n.aiStream,"ai-draft":n.aiDraft,onClose:T[18]||(T[18]=M=>$.value=null)},null,8,["editor","ai-stream","ai-draft"])):s.createCommentVNode("",!0)]),oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(zf,{key:4,"connection-state":e.connectionState,"saving-status":L.value,"last-saved":D.value,"word-count":R.value,"char-count":N.value,"page-count":jt.value,"current-page":gt.value,"page-size":f.value,"page-sizes":s.unref(ar.PAGE_SIZES),pageless:m.value,"onUpdate:pageSize":T[19]||(T[19]=M=>{f.value=M,i("update:pageSize",M)})},null,8,["connection-state","saving-status","last-saved","word-count","char-count","page-count","current-page","page-size","page-sizes","pageless"])),Kr.value?(s.openBlock(),s.createElementBlock("div",uT,[s.createElementVNode("div",dT,[s.createElementVNode("h2",fT,s.toDisplayString(s.unref(o)("editor.headerFooter.headerFooterFormatTitle")),1),s.createElementVNode("div",pT,[s.createElementVNode("h3",mT,s.toDisplayString(s.unref(o)("editor.headerFooter.marginSection")),1),s.createElementVNode("div",hT,[s.createElementVNode("div",null,[s.createElementVNode("label",bT,s.toDisplayString(s.unref(o)("editor.headerFooter.headerTopMargin"))+" (cm) ",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[20]||(T[20]=M=>Ki.value=M),type:"number",min:Hs,max:qs,step:af,class:"w-full rounded-lg border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-3.5 py-2 text-sm text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:ring-2 focus:ring-blue-500/20 focus:outline-none transition-all"},null,512),[[s.vModelText,Ki.value,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",gT,s.toDisplayString(s.unref(o)("editor.headerFooter.footerBottomMargin"))+" (cm) ",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[21]||(T[21]=M=>Xi.value=M),type:"number",min:Hs,max:qs,step:af,class:"w-full rounded-lg border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-3.5 py-2 text-sm text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:ring-2 focus:ring-blue-500/20 focus:outline-none transition-all"},null,512),[[s.vModelText,Xi.value,void 0,{number:!0}]])])])]),s.createElementVNode("div",vT,[s.createElementVNode("h3",xT,s.toDisplayString(s.unref(o)("editor.headerFooter.layoutSection")),1),s.createElementVNode("div",yT,[s.createElementVNode("label",kT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[22]||(T[22]=M=>Xr.value=M),type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelCheckbox,Xr.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.differentFirstPage")),1)]),s.createElementVNode("label",wT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[23]||(T[23]=M=>Jr.value=M),type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelCheckbox,Jr.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.differentOddEven")),1)])])]),s.createElementVNode("div",_T,[s.createElementVNode("button",{type:"button",class:"rounded-full px-5 py-2 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/40 transition-colors",onClick:T[24]||(T[24]=M=>Kr.value=!1)},s.toDisplayString(s.unref(o)("editor.headerFooter.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-full bg-blue-600 hover:bg-blue-700 px-6 py-2 text-xs font-semibold text-white shadow-md transition-colors",onClick:Vh},s.toDisplayString(s.unref(o)("editor.headerFooter.apply")),1)])])])):s.createCommentVNode("",!0),Zr.value?(s.openBlock(),s.createElementBlock("div",ST,[s.createElementVNode("div",CT,[s.createElementVNode("h2",ET,s.toDisplayString(s.unref(o)("editor.headerFooter.pageNumberTitle")),1),s.createElementVNode("div",AT,[s.createElementVNode("h3",TT,s.toDisplayString(s.unref(o)("editor.headerFooter.positionSection")),1),s.createElementVNode("div",NT,[s.createElementVNode("label",OT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[25]||(T[25]=M=>Mn.value=M),type:"radio",value:"header",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Mn.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.positionHeader")),1)]),s.createElementVNode("label",MT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[26]||(T[26]=M=>Mn.value=M),type:"radio",value:"footer",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Mn.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.positionFooter")),1)]),s.createElementVNode("label",DT,[s.createElementVNode("input",{checked:zh.value,type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500",onChange:Ih},null,40,zT),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.showOnFirstPage")),1)])])]),s.createElementVNode("div",IT,[s.createElementVNode("h3",RT,s.toDisplayString(s.unref(o)("editor.headerFooter.placementSection")),1),s.createElementVNode("div",{class:"grid grid-cols-3 gap-2",role:"group","aria-label":s.unref(o)("editor.headerFooter.alignPlacement")},[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(["left","center","right"],M=>s.createElementVNode("button",{key:M,type:"button",class:s.normalizeClass(["flex items-center justify-center rounded-lg border px-3 py-2 transition-colors",Oh.value===M?"border-blue-600 bg-blue-50 text-blue-700 dark:bg-blue-950/40 dark:text-blue-300":"border-slate-300 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/5"]),title:s.unref(o)(`editor.headerFooter.align${M==="left"?"Left":M==="center"?"Center":"Right"}`),onClick:Q=>Mh(M)},[(s.openBlock(),s.createElementBlock("svg",PT,[s.createElementVNode("path",{d:Dh(M)},null,8,FT)]))],10,BT)),64))],8,LT),s.createElementVNode("p",VT,s.toDisplayString(s.unref(o)("editor.headerFooter.placementHint")),1)]),s.createElementVNode("div",UT,[s.createElementVNode("h3",HT,s.toDisplayString(s.unref(o)("editor.headerFooter.numberingSection")),1),s.createElementVNode("div",qT,[s.createElementVNode("div",jT,[s.createElementVNode("label",$T,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[27]||(T[27]=M=>Ci.value=M),type:"radio",value:"startAt",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Ci.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.startAt")),1)]),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[28]||(T[28]=M=>ea.value=M),type:"number",min:"1",class:"w-16 rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-2.5 py-1 text-xs text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:outline-none"},null,512),[[s.vModelText,ea.value]])]),s.createElementVNode("label",WT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[29]||(T[29]=M=>Ci.value=M),type:"radio",value:"continue",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Ci.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.continueFromPrevious")),1)]),s.createElementVNode("div",GT,[s.createElementVNode("label",KT,s.toDisplayString(s.unref(o)("editor.headerFooter.hideOnPages")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[30]||(T[30]=M=>Si.value=M),type:"text",placeholder:s.unref(o)("editor.headerFooter.hideOnPagesPlaceholder"),class:"w-full rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-2.5 py-1.5 text-xs text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:outline-none"},null,8,XT),[[s.vModelText,Si.value]]),s.createElementVNode("p",JT,s.toDisplayString(s.unref(o)("editor.headerFooter.hideOnPagesHint")),1)])])]),s.createElementVNode("div",ZT,[s.createElementVNode("button",{type:"button",class:"rounded-full px-5 py-2 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/40 transition-colors",onClick:T[31]||(T[31]=M=>Zr.value=!1)},s.toDisplayString(s.unref(o)("editor.headerFooter.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-full bg-blue-600 hover:bg-blue-700 px-6 py-2 text-xs font-semibold text-white shadow-md transition-colors",onClick:Uh},s.toDisplayString(s.unref(o)("editor.headerFooter.apply")),1)])])])):s.createCommentVNode("",!0),s.createVNode(Th,{"is-open":is.value,"document-title":n.title,"share-url":n.shareUrl,onClose:T[32]||(T[32]=M=>is.value=!1),onCopyLink:T[33]||(T[33]=M=>i("share"))},null,8,["is-open","document-title","share-url"]),s.createVNode(Ah,{"is-open":ns.value,meta:n.documentMeta,onClose:T[34]||(T[34]=M=>ns.value=!1)},null,8,["is-open","meta"]),s.createVNode(nT,{"is-open":Zi.value,"initial-text":aa.value,"initial-url":rs.value,"is-editing":oa.value,onApply:Rh,onRemove:Lh,onClose:T[35]||(T[35]=M=>Zi.value=!1)},null,8,["is-open","initial-text","initial-url","is-editing"]),ia.value?(s.openBlock(),s.createElementBlock("div",QT,[s.createElementVNode("div",YT,[s.createElementVNode("h2",eN,s.toDisplayString(s.unref(o)("editor.pageSetup.title")),1),s.createElementVNode("div",tN,[s.createElementVNode("label",nN,s.toDisplayString(s.unref(o)("editor.pageSetup.paperSize")),1),s.withDirectives(s.createElementVNode("select",{"onUpdate:modelValue":T[36]||(T[36]=M=>sa.value=M),class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-2 text-xs focus:outline-none dark:border-slate-700"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(ar.PAGE_SIZES),M=>(s.openBlock(),s.createElementBlock("option",{key:M.id,value:M.id},s.toDisplayString(M.name),9,iN))),128))],512),[[s.vModelSelect,sa.value]])]),s.createElementVNode("div",rN,[s.createElementVNode("label",aN,s.toDisplayString(s.unref(o)("editor.pageSetup.orientation")),1),s.createElementVNode("div",oN,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex-1 rounded-md border px-3 py-2 text-xs font-medium transition-colors",ii.value==="portrait"?"border-cyan-500 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300":"border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-white/5"]),onClick:T[37]||(T[37]=M=>ii.value="portrait")},s.toDisplayString(s.unref(o)("editor.pageSetup.portrait")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex-1 rounded-md border px-3 py-2 text-xs font-medium transition-colors",ii.value==="landscape"?"border-cyan-500 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300":"border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-white/5"]),onClick:T[38]||(T[38]=M=>ii.value="landscape")},s.toDisplayString(s.unref(o)("editor.pageSetup.landscape")),3)])]),s.createElementVNode("div",sN,[s.createElementVNode("label",lN,s.toDisplayString(s.unref(o)("editor.pageSetup.margins"))+" (cm)",1),s.createElementVNode("div",cN,[s.createElementVNode("div",null,[s.createElementVNode("label",uN,s.toDisplayString(s.unref(o)("editor.pageSetup.top")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[39]||(T[39]=M=>et.value.top=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,dN),[[s.vModelText,et.value.top,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",fN,s.toDisplayString(s.unref(o)("editor.pageSetup.bottom")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[40]||(T[40]=M=>et.value.bottom=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,pN),[[s.vModelText,et.value.bottom,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",mN,s.toDisplayString(s.unref(o)("editor.pageSetup.left")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[41]||(T[41]=M=>et.value.left=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,hN),[[s.vModelText,et.value.left,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",bN,s.toDisplayString(s.unref(o)("editor.pageSetup.right")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[42]||(T[42]=M=>et.value.right=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,gN),[[s.vModelText,et.value.right,void 0,{number:!0}]])])])]),s.createElementVNode("div",vN,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:hover:bg-white/5",onClick:T[43]||(T[43]=M=>ia.value=!1)},s.toDisplayString(s.unref(o)("editor.pageSetup.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-blue-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-700",onClick:Ph},s.toDisplayString(s.unref(o)("editor.pageSetup.apply")),1)])])])):s.createCommentVNode("",!0)]))}}),kN=Pl(yN,[["__scopeId","data-v-73349cd3"]]),wN={class:"docs-editor-pages flex flex-col items-center gap-10"},_N=["data-page-index"],SN=["data-node-type","data-from","data-to"],CN=["innerHTML"],EN={key:1,class:"docs-editor-page__block-fallback flex justify-between text-sm text-slate-700"},AN={class:"docs-editor-page__block-type font-medium"},TN={class:"docs-editor-page__block-range text-slate-500"},NN=s.defineComponent({__name:"PageView",props:{pages:{},editor:{default:null},layoutOptions:{default:()=>({pageWidth:794,pageHeight:1123,margins:{top:96,bottom:96,left:96,right:96}})},isPageless:{type:Boolean,default:!1},pageColor:{default:"#ffffff"}},setup(e){const t=e,n=s.ref(0),i=()=>{n.value++};s.watch(()=>t.editor,(p,h)=>{h&&typeof h.off=="function"&&h.off("update",i),p&&typeof p.on=="function"&&p.on("update",i)},{immediate:!0}),s.onUnmounted(()=>{t.editor&&typeof t.editor.off=="function"&&t.editor.off("update",i)});const r=s.computed(()=>{var p,h;return((h=(p=t.editor)==null?void 0:p.view)==null?void 0:h.dom)??null}),a=s.computed(()=>{var p,h,g;return{pageHeight:((p=t.layoutOptions)==null?void 0:p.pageHeight)??1123,pageWidth:((h=t.layoutOptions)==null?void 0:h.pageWidth)??794,margins:((g=t.layoutOptions)==null?void 0:g.margins)??{top:96,bottom:96,left:96,right:96},maxCharsPerPage:0}}),o=s.computed(()=>{const{pageWidth:p,pageHeight:h,margins:g}=a.value;return t.isPageless?{width:`${p}px`,minHeight:"auto",height:"auto",paddingTop:`${g.top}px`,paddingBottom:`${g.bottom}px`,paddingLeft:`${g.left}px`,paddingRight:`${g.right}px`,backgroundColor:t.pageColor,boxShadow:"none",border:"none",borderRadius:"0"}:{width:`${p}px`,height:`${h}px`,paddingTop:`${g.top}px`,paddingBottom:`${g.bottom}px`,paddingLeft:`${g.left}px`,paddingRight:`${g.right}px`}}),l=()=>r.value?Array.from(r.value.children).filter(p=>p instanceof HTMLElement):[],c=p=>l().find(g=>{const b=parseInt(g.getAttribute("data-from")??"-1",10),y=parseInt(g.getAttribute("data-to")??"-1",10);return b>=0&&y>=b&&b<=p.from&&y>=p.to})??null,u=p=>{if(!t.editor||!r.value||!c(p))return null;try{const g=t.editor.view,b=g.domAtPos(p.from),y=g.domAtPos(p.to);if(!b||!y)return null;const v=document.createRange();v.setStart(b.node,b.offset),v.setEnd(y.node,y.offset);const x=v.cloneContents(),k=document.createElement("div");return k.appendChild(x),k.innerHTML}catch{return null}},f=s.computed(()=>{n.value;const p=new Map;if(!t.editor||!r.value)return p;for(const h of t.pages)for(const g of h.blocks){const b=`${g.from}-${g.to}-${g.nodeType}`;if(p.has(b))continue;const y=u(g);y!==null&&p.set(b,y)}return p}),m=p=>f.value.get(`${p.from}-${p.to}-${p.nodeType}`)??null;return(p,h)=>(s.openBlock(),s.createElementBlock("div",wN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.pages,(g,b)=>(s.openBlock(),s.createElementBlock("div",{key:`${b}-${g.from}-${g.to}`,class:s.normalizeClass(["docs-editor-page tiptap ProseMirror relative box-border overflow-hidden text-slate-800 dark:text-[#e2e8f0]",e.isPageless?"":"editor-page-shadow rounded-lg border border-slate-200/70 bg-white dark:border-white/5 dark:bg-[#0a0f1e]"]),"data-page-index":b,style:s.normalizeStyle(o.value)},[s.createElementVNode("div",{class:"docs-editor-page__blocks flex flex-col",style:s.normalizeStyle(e.isPageless?{}:{height:"100%",overflow:"hidden"})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(g.blocks,y=>(s.openBlock(),s.createElementBlock("div",{key:`${y.from}-${y.to}`,class:"docs-editor-page__block","data-node-type":y.nodeType,"data-from":y.from,"data-to":y.to},[m(y)!==null?(s.openBlock(),s.createElementBlock("div",{key:0,class:"docs-editor-page__block-content",innerHTML:m(y)},null,8,CN)):(s.openBlock(),s.createElementBlock("div",EN,[s.createElementVNode("span",AN,s.toDisplayString(y.nodeType),1),s.createElementVNode("span",TN,s.toDisplayString(y.from)+"–"+s.toDisplayString(y.to),1)]))],8,SN))),128))],4)],14,_N))),128))]))}}),ON={class:"docs-editor-left-sidebar flex w-14 flex-shrink-0 flex-col items-center border-r border-slate-200 bg-slate-50/50 py-3 dark:border-slate-800 dark:bg-[#080d1a] md:w-64 md:items-stretch md:px-3"},MN={class:"mb-4 flex items-center justify-between px-1"},DN=["title"],zN={class:"hidden flex-col gap-4 md:flex"},IN={class:"flex items-center justify-between px-2"},RN={class:"text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wide"},LN=["title"],BN={class:"flex flex-col gap-1 pr-1"},PN=["onClick"],FN={class:"truncate"},VN={key:1,class:"flex flex-1 items-center gap-2 pr-6"},UN=["onBlur","onKeydown"],HN={class:"relative flex items-center"},qN=["onClick"],jN={key:1,class:"absolute right-0 top-6 z-50 w-28 rounded-lg border border-slate-200/80 bg-white py-1 shadow-lg dark:border-slate-700 dark:bg-slate-800 text-slate-700 dark:text-slate-200"},$N=["onClick"],WN=["disabled","onClick"],GN={class:"flex flex-col gap-1.5 px-2"},KN={class:"text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wide"},XN={key:0,class:"flex flex-col gap-1 mt-1"},JN=["onClick"],ZN={key:1,class:"text-xs leading-relaxed text-slate-400 dark:text-slate-500 italic mt-1 font-sans"},QN={class:"flex flex-col gap-2 md:hidden"},YN=["title","onClick"],eO=s.defineComponent({__name:"DocumentTabsSidebar",props:{tabs:{default:()=>[{id:"tab-1",label:"Tab 1",active:!0}]},editor:{default:null},backTitle:{default:""}},emits:["collapse","add-tab","select-tab","delete-tab","rename-tab"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=s.computed(()=>i.backTitle||n("common.cancel")),a=t,o=s.ref(null),l=s.ref(null),c=s.ref(""),u=x=>{l.value=x.id,c.value=x.label,o.value=null},f=x=>{c.value.trim()&&a("rename-tab",{id:x,label:c.value.trim()}),l.value=null},m=()=>{l.value=null},p=x=>{a("delete-tab",x),o.value=null},h=x=>{o.value=o.value===x?null:x},g=s.ref([]),b=()=>{if(!i.editor)return;const x=[];i.editor.state.doc.descendants((k,w)=>{if(k.type.name==="heading"){const S=k.attrs.level;(S===1||S===2||S===3)&&x.push({id:`heading-${w}`,text:k.textContent.trim()||n("documentTabs.untitledHeading").replace("{level}",String(S)),level:S,pos:w})}return!0}),g.value=x};let y=null;s.watch(()=>i.editor,x=>{if(y&&(y(),y=null),!x){g.value=[];return}b();const k=()=>{b()};x.on("update",k),y=()=>{x.off("update",k)}},{immediate:!0});const v=x=>{i.editor&&(i.editor.chain().focus().setTextSelection(x.pos).run(),setTimeout(()=>{var S;const k=document.querySelector(".docs-editor-scroll");if(!k)return;const w=k.querySelectorAll(".ProseMirror h1, .ProseMirror h2, .ProseMirror h3");for(const A of Array.from(w))if(((S=A.textContent)==null?void 0:S.trim())===x.text){A.scrollIntoView({behavior:"smooth",block:"center"});return}},50))};return(x,k)=>(s.openBlock(),s.createElementBlock("aside",ON,[s.createElementVNode("div",MN,[s.createElementVNode("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-200/80 dark:text-slate-400 dark:hover:bg-slate-800/80",title:r.value,onClick:k[0]||(k[0]=w=>a("collapse"))},[s.createVNode(s.unref(Eb),{class:"h-[18px] w-[18px]"})],8,DN)]),s.createElementVNode("div",zN,[s.createElementVNode("div",IN,[s.createElementVNode("span",RN,s.toDisplayString(s.unref(n)("documentTabs.documentTabs")),1),s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-600 hover:bg-slate-200 dark:text-slate-400 dark:hover:bg-slate-800 transition-colors",title:s.unref(n)("documentTabs.addTab"),onClick:k[1]||(k[1]=w=>a("add-tab"))},[s.createVNode(s.unref($n),{class:"h-4 w-4"})],8,LN)]),s.createElementVNode("div",BN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.tabs,w=>(s.openBlock(),s.createElementBlock("div",{key:w.id,class:s.normalizeClass(["group relative flex w-full items-center justify-between rounded-r-full py-1.5 pl-3 pr-2 text-left text-sm transition-all",[w.active?"bg-[#c2e7ff]/70 text-[#001d35] dark:bg-blue-950/40 dark:text-blue-200 font-medium":"text-slate-700 hover:bg-slate-200/40 dark:text-slate-300 dark:hover:bg-slate-800/30"]])},[l.value!==w.id?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex flex-1 items-center gap-2 truncate pr-6 text-left",onClick:S=>a("select-tab",w.id)},[s.createVNode(s.unref(dt),{class:"h-4 w-4 flex-shrink-0 opacity-70"}),s.createElementVNode("span",FN,s.toDisplayString(w.label),1)],8,PN)):s.createCommentVNode("",!0),l.value===w.id?(s.openBlock(),s.createElementBlock("div",VN,[s.createVNode(s.unref(dt),{class:"h-4 w-4 flex-shrink-0 opacity-70"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[2]||(k[2]=S=>c.value=S),type:"text",class:"flex-1 rounded border border-blue-400 bg-white px-1.5 py-0.5 text-xs text-slate-800 outline-none focus:ring-1 focus:ring-blue-400/50 dark:bg-slate-900 dark:text-slate-100",onBlur:S=>f(w.id),onKeydown:[s.withKeys(S=>f(w.id),["enter"]),s.withKeys(m,["esc"])],onClick:k[3]||(k[3]=s.withModifiers(()=>{},["stop"]))},null,40,UN),[[s.vModelText,c.value]])])):s.createCommentVNode("",!0),s.createElementVNode("div",HN,[l.value!==w.id?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:s.normalizeClass(["rounded-full p-1 text-slate-500 opacity-0 transition-opacity hover:bg-slate-200/70 group-hover:opacity-100 dark:hover:bg-slate-700/70",{"opacity-100":o.value===w.id}]),onClick:s.withModifiers(S=>h(w.id),["stop"])},[s.createVNode(s.unref(gf),{class:"h-3.5 w-3.5"})],10,qN)):s.createCommentVNode("",!0),o.value===w.id?(s.openBlock(),s.createElementBlock("div",jN,[s.createElementVNode("button",{type:"button",class:"flex w-full items-center px-3 py-1.5 text-xs hover:bg-slate-50 dark:hover:bg-slate-700/50",onClick:s.withModifiers(S=>u(w),["stop"])},s.toDisplayString(s.unref(n)("documentTabs.rename")),9,$N),s.createElementVNode("button",{type:"button",class:"flex w-full items-center px-3 py-1.5 text-xs text-red-600 dark:text-red-400 hover:bg-slate-50 dark:hover:bg-slate-700/50 disabled:opacity-40",disabled:e.tabs.length<=1,onClick:s.withModifiers(S=>p(w.id),["stop"])},s.toDisplayString(s.unref(n)("documentTabs.delete")),9,WN)])):s.createCommentVNode("",!0)])],2))),128))]),k[4]||(k[4]=s.createElementVNode("div",{class:"h-px bg-slate-200/80 dark:bg-slate-800 mx-2"},null,-1)),s.createElementVNode("div",GN,[s.createElementVNode("span",KN,s.toDisplayString(s.unref(n)("documentTabs.outline")),1),g.value.length>0?(s.openBlock(),s.createElementBlock("div",XN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(g.value,w=>(s.openBlock(),s.createElementBlock("button",{key:w.id,type:"button",class:s.normalizeClass(["w-full text-left text-xs text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 py-1 transition-colors truncate",[w.level===2?"pl-3":"",w.level===3?"pl-6":""]]),onClick:S=>v(w)},s.toDisplayString(w.text),11,JN))),128))])):(s.openBlock(),s.createElementBlock("p",ZN,s.toDisplayString(s.unref(n)("documentTabs.placeholder")),1))])]),s.createElementVNode("div",QN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.tabs,w=>(s.openBlock(),s.createElementBlock("button",{key:w.id,type:"button",class:s.normalizeClass(["flex h-8 w-8 items-center justify-center rounded-lg transition-colors",[w.active?"bg-blue-100 text-blue-600 dark:bg-blue-950/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-200 dark:text-slate-400 dark:hover:bg-slate-800"]]),title:w.label,onClick:S=>a("select-tab",w.id)},[s.createVNode(s.unref(dt),{class:"h-4 w-4"})],10,YN))),128))])]))}});Object.defineProperty(exports,"httpKeyStorage",{enumerable:!0,get:()=>Ee.httpKeyStorage});Object.defineProperty(exports,"localStorageKeyStorage",{enumerable:!0,get:()=>Ee.localStorageKeyStorage});Object.defineProperty(exports,"memoryKeyStorage",{enumerable:!0,get:()=>Ee.memoryKeyStorage});Object.defineProperty(exports,"openaiCompatibleProvider",{enumerable:!0,get:()=>Ee.openaiCompatibleProvider});Object.defineProperty(exports,"toAIStreamFn",{enumerable:!0,get:()=>Ee.toAIStreamFn});exports.AISidebar=Sh;exports.BubbleMenu=Df;exports.CommentsSidebar=Ch;exports.DetailsDialog=Ah;exports.DocsEditor=kN;exports.DocumentTabsSidebar=eO;exports.EditorToolbar=Mf;exports.EmailDialog=Th;exports.HeaderBar=Of;exports.HistorySidebar=Eh;exports.PageView=NN;exports.SlashMenu=bf;exports.StatusBar=zf;exports.TOCSidebar=If;exports.ThemeToggle=Qs;exports.collectSelectionContext=Ll;exports.defaultLocale=Bl;exports.getLocaleMessages=cf;exports.getLocaleName=mf;exports.getSupportedLocales=hf;exports.isLocale=Fa;exports.messages=Pa;exports.provideLocale=pf;exports.useAIProvider=tb;exports.useEditor=of;exports.useLocale=ht;exports.useTheme=Ro;
15277
+ `," ")}},Gh=async()=>{const C=$c();if(!C||!O.value)return;await rf(C.text,C.html)&&O.value.chain().focus().deleteSelection().run()},Kh=async()=>{var T;const C=$c();C&&(await rf(C.text,C.html),(T=O.value)==null||T.commands.focus())},Xh=async()=>{if(!O.value)return;const C=await rT();if(C){const M=Ee.sanitizePastedHTML(C);try{O.value.chain().focus().insertContent(M).run()}catch(Q){console.error("[DocsEditor] paste HTML failed, falling back to plain text:",Q);const se=await Us();if(se)try{O.value.chain().focus().insertContent(se).run()}catch(de){console.error("[DocsEditor] paste plain text also failed:",de)}}return}const T=await Us();if(T)try{O.value.chain().focus().insertContent(T).run()}catch(M){console.error("[DocsEditor] paste plain text failed:",M)}},Wc=async()=>{if(!O.value)return;const C=await Us();C&&O.value.chain().focus().insertContent(C).run()},Jh=()=>{if(!O.value)return;const{state:C}=O.value;if(C.selection.empty){const{from:T,to:M}=C.selection;M<C.doc.content.size&&O.value.chain().focus().deleteRange({from:T,to:M+1}).run()}else O.value.chain().focus().deleteSelection().run()},Gc=C=>{var T;if(C.key==="Escape"&&oe.value){oe.value=!1;return}!(C.metaKey||C.ctrlKey)||!C.shiftKey||(T=O.value)!=null&&T.view.dom.contains(C.target)&&(C.key.toLowerCase()==="v"?(C.preventDefault(),Wc()):C.key.toLowerCase()==="h"&&(C.preventDefault(),ra.value=!0))};s.onMounted(()=>document.addEventListener("keydown",Gc)),s.onUnmounted(()=>document.removeEventListener("keydown",Gc));const Kc={undo:()=>_t("undo"),redo:()=>_t("redo"),"select-all":()=>_t("selectAll"),cut:()=>{Gh()},copy:()=>{Kh()},paste:()=>{Xh()},"paste-without-formatting":()=>{Wc()},delete:()=>Jh(),bold:()=>_t("toggleBold"),italic:()=>_t("toggleItalic"),underline:()=>_t("toggleUnderline"),heading1:()=>_t("toggleHeading",{level:1}),heading2:()=>_t("toggleHeading",{level:2}),heading3:()=>_t("toggleHeading",{level:3}),"align-left":()=>vt("alignLeft"),"align-center":()=>vt("alignCenter"),"align-right":()=>vt("alignRight"),"align-justify":()=>vt("alignJustify"),"bullet-list":()=>_t("toggleBulletList"),"numbered-list":()=>_t("toggleOrderedList"),"task-list":()=>vt("toggleTaskList"),"horizontal-line":()=>_t("setHorizontalRule"),"page-numbers-header":()=>jc("header"),"page-numbers-footer":()=>jc("footer"),"clear-formatting":()=>{O.value&&(O.value.chain().unsetAllMarks().clearNodes().run(),_t("setTextAlign","left"))},"insert-image":()=>vt("insertImage"),"insert-table":()=>vt("insertTable",{rows:3,cols:3,withHeaderRow:!0}),"insert-code":()=>vt("toggleCodeBlock"),"insert-page-break":()=>vt("insertPageBreak"),"insert-toc":()=>vt("insertToc"),"insert-date-chip":()=>vt("insertDateChip"),"insert-people-chip":()=>vt("insertPeopleChip"),"insert-file-chip":()=>vt("insertFileChip"),"insert-dropdown-chip":()=>vt("insertDropdownChip"),"insert-location-chip":()=>vt("insertLocationChip")};let Zh=C=>{if(C==="page-setup")Ph();else if(C==="print")Xc();else if(C==="version-history")Yi("history");else if(C==="details")ns.value=!0;else if(C==="email")is.value=!0;else if(C==="find-replace")ra.value=!0;else if(C==="insert-link")Fc();else if(C==="security")i("share");else if(C==="insert-header")ca();else if(C==="insert-footer")ua();else if(C==="toggle-pageless")Ot(!m.value);else if(C==="toggle-left-sidebar")Yi("toc");else if(C==="toggle-ruler")W.value=!W.value;else if(C==="toggle-focus-mode")oe.value=!oe.value,oe.value&&($.value=null);else if(C==="new-help-me-create")ls();else if(C==="insert-footnote"){if(!O.value)return;const{state:T,view:M}=O.value,Q=T.schema.nodes.footnote;if(!Q){console.error("[DocsEditor] footnote node type not registered in schema");return}const se=T.selection.head,de=Q.create({content:""}),ye=T.tr.insert(se,de);M.dispatch(ye),M.focus(),setTimeout(()=>{da();const ve=document.querySelectorAll(".docs-footnote-item-text"),me=ve[ve.length-1];me&&(me.scrollIntoView({behavior:"smooth",block:"nearest"}),me.focus())},160)}else Kc[C]?Kc[C]():i("menu-click",C)},Yi=C=>{$.value=$.value===C?null:C};function ls(){if(typeof n.onAiChat=="function"){n.onAiChat(Qh());return}Yi("ai")}function Qh(){const C=s.toRaw(O.value),T={context:{}};if(!C)return T;const{from:M,to:Q,empty:se}=C.state.selection;se||(T.selection=C.state.doc.textBetween(M,Q,`
15278
+ `," "));try{const de=Ll(C);T.context=de}catch{T.context={}}return T}let Xc=()=>window.print();const Yh=(C,T)=>{if(!O.value)return;const M=O.value.view;M.state.doc.descendants((Q,se)=>{if(Q.type.name==="footnote"&&M.nodeDOM(se)===C)return M.dispatch(M.state.tr.setNodeMarkup(se,void 0,{content:T})),!1})};let hn=null,Ai=null;const da=()=>{var ve;if(!O.value||!X.value)return;const C=O.value.view.dom,T=C.querySelector("[data-rm-pagination]");if(!T)return;const M=me=>{var he,Ce,Te;const ue=document.createElement("div");if(ue.className="docs-footnote-item-text",me.hasAttribute("data-footnote-source-id")){const Ne=me.getAttribute("data-citation-id")??"",Me=(Ce=(he=O.value)==null?void 0:he.storage)==null?void 0:Ce.citationEngine,De=((Te=Me==null?void 0:Me.engine)==null?void 0:Te.renderCluster(Ne))??"";if(ue.classList.add("docs-footnote-item-text--citation"),De)ue.innerHTML=De;else{const Ie=me.getAttribute("data-footnote-content")??"";Ie?ue.innerHTML=Ie:ue.setAttribute("data-empty","true")}return ue}const le=me.getAttribute("data-footnote-content")??"";return ue.contentEditable="true",ue.textContent=le,le||ue.setAttribute("data-empty","true"),ue.addEventListener("input",()=>{ue.removeAttribute("data-empty"),ue.textContent||ue.setAttribute("data-empty","true")}),ue.addEventListener("blur",()=>{var Me;const Ne=((Me=ue.textContent)==null?void 0:Me.trim())??"";Yh(me,Ne)}),ue},Q=Array.from(T.querySelectorAll(".rm-page-break")),se=Array.from(C.querySelectorAll(".docs-footnote-ref"));if(Q.length===0){se.forEach((Ce,Te)=>{Ce.textContent=String(Te+1)});const me=Ut.value;if(!me||((ve=me.querySelector(".docs-pageless-footnotes"))==null||ve.remove(),se.length===0))return;const ue=me.querySelector(".docs-pageless-footnotes");if(ue!=null&&ue.querySelector(".docs-footnote-item-text:focus"))return;const le=document.createElement("div");le.className="docs-page-footnotes docs-pageless-footnotes";const he=document.createElement("div");he.className="docs-footnotes-sep",le.appendChild(he),se.forEach((Ce,Te)=>{const Ne=document.createElement("div");Ne.className="docs-footnote-item";const Me=document.createElement("sup");Me.className="docs-footnote-item-num",Me.textContent=String(Te+1);const De=M(Ce);Ce.dataset.footnoteItemId=`fn-pageless-${Te}`,Ne.id=`fn-pageless-${Te}`,Ne.appendChild(Me),Ne.appendChild(De),le.appendChild(Ne)}),me.appendChild(le);return}const de=new Map;Q.forEach((me,ue)=>de.set(ue,[])),se.forEach(me=>{const ue=me.getBoundingClientRect().top;let le=Q.length-1;for(let he=0;he<Q.length-1;he++){const Ce=Q[he].querySelector(".breaker");if(Ce&&ue<Ce.getBoundingClientRect().top){le=he;break}}de.get(le).push(me)});let ye=1;Q.forEach((me,ue)=>{const le=de.get(ue)??[],he=ye;ye+=le.length,le.forEach((De,Ie)=>{De.textContent=String(he+Ie)});const Ce=me.querySelector(".docs-page-footnotes");if(Ce!=null&&Ce.querySelector(".docs-footnote-item-text:focus")||(Ce==null||Ce.remove(),le.length===0))return;const Te=document.createElement("div");Te.className="docs-page-footnotes";const Ne=document.createElement("div");Ne.className="docs-footnotes-sep",Te.appendChild(Ne),le.forEach((De,Ie)=>{const Ve=document.createElement("div");Ve.className="docs-footnote-item";const xt=document.createElement("sup");xt.className="docs-footnote-item-num",xt.textContent=String(he+Ie);const $e=M(De);De.dataset.footnoteItemId=`fn-${ue}-${Ie}`,Ve.id=`fn-${ue}-${Ie}`,Ve.appendChild(xt),Ve.appendChild($e),Te.appendChild(Ve)});const Me=me.querySelector(".breaker");Me?Me.insertBefore(Te,Me.firstChild):me.appendChild(Te)})};s.watch(X,C=>{!C||!O.value||O.value.view.dom.addEventListener("click",T=>{const M=T.target.closest(".docs-footnote-ref");if(!M)return;T.preventDefault(),T.stopPropagation();const Q=M.dataset.footnoteItemId;if(!Q)return;const se=document.getElementById(Q),de=se==null?void 0:se.querySelector(".docs-footnote-item-text");if(de){de.scrollIntoView({behavior:"smooth",block:"nearest"}),de.focus();const ye=document.createRange();ye.selectNodeContents(de),ye.collapse(!1);const ve=window.getSelection();ve==null||ve.removeAllRanges(),ve==null||ve.addRange(ye)}})});function fa(C){hn&&clearTimeout(hn),hn=setTimeout(()=>{hn=null,da()},C)}const Jc=()=>{Ai&&clearTimeout(Ai),hn&&(clearTimeout(hn),hn=null),Ai=setTimeout(()=>{Ai=null,da()},150)};return s.watch(X,C=>{var M;if(!C||!O.value)return;fa(150),O.value.on("update",()=>{fa(60)}),O.value.on("selectionUpdate",()=>{fa(100)});const T=O.value.storage.citationEngine;(M=T==null?void 0:T.engine)==null||M.onChange(()=>{fa(30)}),window.addEventListener("resize",Jc)}),(C,T)=>(s.openBlock(),s.createElementBlock("div",aT,[oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Of,{key:0,title:e.title,editable:e.editable,collaborators:e.collaborators,starred:e.starred,"user-name":e.userName,"user-avatar":e.userAvatar,pageless:m.value,"outline-open":$.value==="toc","show-ruler":W.value,"focus-mode":oe.value,onMenuClick:s.unref(Zh),onBack:T[0]||(T[0]=M=>C.$emit("back")),"onUpdate:title":T[1]||(T[1]=M=>C.$emit("update:title",M)),onToggleStar:T[2]||(T[2]=M=>C.$emit("toggle-star")),onExport:T[3]||(T[3]=M=>C.$emit("export",M)),onShare:T[4]||(T[4]=M=>C.$emit("share"))},{actions:s.withCtx(()=>[s.renderSlot(C.$slots,"header-actions",{},void 0,!0)]),"overflow-actions":s.withCtx(M=>[s.renderSlot(C.$slots,"overflow-actions",s.normalizeProps(s.guardReactiveProps(M)),void 0,!0)]),"user-menu":s.withCtx(M=>[s.renderSlot(C.$slots,"user-menu",s.normalizeProps(s.guardReactiveProps(M)),void 0,!0)]),_:3},8,["title","editable","collaborators","starred","user-name","user-avatar","pageless","outline-open","show-ruler","focus-mode","onMenuClick"])),oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(Mf,{key:1,actions:s.unref(F),plugins:e.plugins,editor:s.unref(O),"active-sidebar":$.value,onToggleSidebar:s.unref(Yi),onPrint:s.unref(Xc)},null,8,["actions","plugins","editor","active-sidebar","onToggleSidebar","onPrint"])),W.value&&!oe.value?(s.openBlock(),s.createBlock(c1,{key:2,"layout-options":p.value},null,8,["layout-options"])):s.createCommentVNode("",!0),oe.value?(s.openBlock(),s.createElementBlock("button",{key:3,type:"button",class:"fixed right-4 top-4 z-50 flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 shadow-md transition-colors hover:bg-slate-100 dark:border-white/10 dark:bg-[#0e1525] dark:text-slate-300 dark:hover:bg-white/5",title:s.unref(o)("header.focusMode"),"aria-label":s.unref(o)("header.focusMode"),onClick:T[5]||(T[5]=M=>oe.value=!1)},[s.createVNode(s.unref(l0),{class:"h-5 w-5"})],8,oT)):s.createCommentVNode("",!0),s.createVNode(Df,{visible:B.value,actions:s.unref(F),position:j.value,editor:s.unref(O),onChat:ls},null,8,["visible","actions","position","editor"]),s.createVNode(bf,{editor:s.unref(O),commands:re.value},null,8,["editor","commands"]),s.createElementVNode("div",sT,[s.createVNode($8,{"is-open":ra.value,editor:s.unref(O),onClose:T[6]||(T[6]=M=>ra.value=!1)},null,8,["is-open","editor"]),$.value==="toc"?(s.openBlock(),s.createBlock(If,{key:0,editor:s.unref(O),onClose:T[7]||(T[7]=M=>$.value=null)},null,8,["editor"])):(s.openBlock(),s.createElementBlock("button",{key:1,type:"button",class:"absolute left-4 top-4 z-20 flex h-11 w-11 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-600 shadow-md transition-colors hover:bg-slate-100 dark:border-white/10 dark:bg-[#0e1525] dark:text-slate-300 dark:hover:bg-white/5",title:s.unref(o)("editor.showOutline"),onClick:T[8]||(T[8]=M=>s.unref(Yi)("toc"))},[s.createVNode(s.unref(a0),{class:"h-5 w-5"})],8,lT)),s.createElementVNode("div",{ref_key:"scrollContainerRef",ref:wt,class:"docs-editor-scroll relative flex flex-1 overflow-auto px-4 py-6 bg-slate-100 dark:bg-[#02040a]",onScroll:qt},[W.value&&!oe.value?(s.openBlock(),s.createBlock(f1,{key:0,"layout-options":p.value},null,8,["layout-options"])):s.createCommentVNode("",!0),s.createElementVNode("div",cT,[s.createElementVNode("div",{class:"relative w-full",style:s.normalizeStyle({maxWidth:h.value})},[b.value?(s.openBlock(),s.createBlock(gb,{key:0,data:s.unref(Jo),"is-ready":s.unref(dn)},null,8,["data","is-ready"])):s.createCommentVNode("",!0),s.unref(X)?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",{key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center bg-white dark:bg-[#0e1525]/60 backdrop-blur-[2px] gap-3 rounded-lg","aria-label":s.unref(o)("editor.loadingDocument")},null,8,uT)),s.createElementVNode("div",{ref_key:"editorRef",ref:Ut,class:s.normalizeClass(["docs-editor__paper outline-none text-slate-800 dark:text-[#e2e8f0]",{"opacity-40":!s.unref(X)}])},null,2)],4)])],544),$.value==="references"?(s.openBlock(),s.createBlock(ty,{key:2,sources:fe.value,"active-style":Oe.value,"picker-mode":Se.value,"can-import":$i.value,importing:qe.value,"import-message":Nt.value,onClose:T[9]||(T[9]=M=>$.value=null),onInsert:On,onCreate:un,onUpdate:Nn,onRemove:Yn,"onUpdate:style":Ht,onImportDoi:qr,onImportBibliography:jr},null,8,["sources","active-style","picker-mode","can-import","importing","import-message"])):s.createCommentVNode("",!0),$.value==="comments"?(s.openBlock(),s.createBlock(Eh,{key:3,comments:n.comments,"selected-text-snippet":n.selectedTextSnippet,"selected-text-index":n.selectedTextIndex,"orphaned-ids":q.value,onClose:T[10]||(T[10]=M=>$.value=null),onAddComment:T[11]||(T[11]=(M,Q,se)=>C.$emit("add-comment",M,Q,se)),onAddReply:T[12]||(T[12]=(M,Q)=>C.$emit("add-reply",M,Q)),onResolveComment:T[13]||(T[13]=M=>C.$emit("resolve-comment",M)),onDeleteComment:T[14]||(T[14]=M=>C.$emit("delete-comment",M))},null,8,["comments","selected-text-snippet","selected-text-index","orphaned-ids"])):s.createCommentVNode("",!0),$.value==="history"?(s.openBlock(),s.createBlock(Ah,{key:4,snapshots:n.snapshots,"active-preview-index":n.activePreviewIndex,onSaveSnapshot:T[15]||(T[15]=M=>C.$emit("save-snapshot",M)),onRestoreSnapshot:T[16]||(T[16]=M=>C.$emit("restore-snapshot",M)),onPreviewSnapshot:T[17]||(T[17]=M=>C.$emit("preview-snapshot",M))},null,8,["snapshots","active-preview-index"])):s.createCommentVNode("",!0),$.value==="ai"?(s.openBlock(),s.createBlock(Ch,{key:5,editor:s.unref(O),"ai-stream":n.aiStream,"ai-draft":n.aiDraft,onClose:T[18]||(T[18]=M=>$.value=null)},null,8,["editor","ai-stream","ai-draft"])):s.createCommentVNode("",!0)]),oe.value?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(zf,{key:4,"connection-state":e.connectionState,"saving-status":L.value,"last-saved":D.value,"word-count":R.value,"char-count":N.value,"page-count":jt.value,"current-page":gt.value,"page-size":f.value,"page-sizes":s.unref(ar.PAGE_SIZES),pageless:m.value,"onUpdate:pageSize":T[19]||(T[19]=M=>{f.value=M,i("update:pageSize",M)})},null,8,["connection-state","saving-status","last-saved","word-count","char-count","page-count","current-page","page-size","page-sizes","pageless"])),Kr.value?(s.openBlock(),s.createElementBlock("div",dT,[s.createElementVNode("div",fT,[s.createElementVNode("h2",pT,s.toDisplayString(s.unref(o)("editor.headerFooter.headerFooterFormatTitle")),1),s.createElementVNode("div",mT,[s.createElementVNode("h3",hT,s.toDisplayString(s.unref(o)("editor.headerFooter.marginSection")),1),s.createElementVNode("div",bT,[s.createElementVNode("div",null,[s.createElementVNode("label",gT,s.toDisplayString(s.unref(o)("editor.headerFooter.headerTopMargin"))+" (cm) ",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[20]||(T[20]=M=>Ki.value=M),type:"number",min:Hs,max:qs,step:af,class:"w-full rounded-lg border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-3.5 py-2 text-sm text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:ring-2 focus:ring-blue-500/20 focus:outline-none transition-all"},null,512),[[s.vModelText,Ki.value,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",vT,s.toDisplayString(s.unref(o)("editor.headerFooter.footerBottomMargin"))+" (cm) ",1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[21]||(T[21]=M=>Xi.value=M),type:"number",min:Hs,max:qs,step:af,class:"w-full rounded-lg border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-3.5 py-2 text-sm text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:ring-2 focus:ring-blue-500/20 focus:outline-none transition-all"},null,512),[[s.vModelText,Xi.value,void 0,{number:!0}]])])])]),s.createElementVNode("div",xT,[s.createElementVNode("h3",yT,s.toDisplayString(s.unref(o)("editor.headerFooter.layoutSection")),1),s.createElementVNode("div",kT,[s.createElementVNode("label",wT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[22]||(T[22]=M=>Xr.value=M),type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelCheckbox,Xr.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.differentFirstPage")),1)]),s.createElementVNode("label",_T,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[23]||(T[23]=M=>Jr.value=M),type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelCheckbox,Jr.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.differentOddEven")),1)])])]),s.createElementVNode("div",ST,[s.createElementVNode("button",{type:"button",class:"rounded-full px-5 py-2 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/40 transition-colors",onClick:T[24]||(T[24]=M=>Kr.value=!1)},s.toDisplayString(s.unref(o)("editor.headerFooter.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-full bg-blue-600 hover:bg-blue-700 px-6 py-2 text-xs font-semibold text-white shadow-md transition-colors",onClick:Uh},s.toDisplayString(s.unref(o)("editor.headerFooter.apply")),1)])])])):s.createCommentVNode("",!0),Zr.value?(s.openBlock(),s.createElementBlock("div",CT,[s.createElementVNode("div",ET,[s.createElementVNode("h2",AT,s.toDisplayString(s.unref(o)("editor.headerFooter.pageNumberTitle")),1),s.createElementVNode("div",TT,[s.createElementVNode("h3",NT,s.toDisplayString(s.unref(o)("editor.headerFooter.positionSection")),1),s.createElementVNode("div",OT,[s.createElementVNode("label",MT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[25]||(T[25]=M=>Mn.value=M),type:"radio",value:"header",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Mn.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.positionHeader")),1)]),s.createElementVNode("label",DT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[26]||(T[26]=M=>Mn.value=M),type:"radio",value:"footer",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Mn.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.positionFooter")),1)]),s.createElementVNode("label",zT,[s.createElementVNode("input",{checked:Ih.value,type:"checkbox",class:"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500",onChange:Rh},null,40,IT),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.showOnFirstPage")),1)])])]),s.createElementVNode("div",RT,[s.createElementVNode("h3",LT,s.toDisplayString(s.unref(o)("editor.headerFooter.placementSection")),1),s.createElementVNode("div",{class:"grid grid-cols-3 gap-2",role:"group","aria-label":s.unref(o)("editor.headerFooter.alignPlacement")},[(s.openBlock(),s.createElementBlock(s.Fragment,null,s.renderList(["left","center","right"],M=>s.createElementVNode("button",{key:M,type:"button",class:s.normalizeClass(["flex items-center justify-center rounded-lg border px-3 py-2 transition-colors",Mh.value===M?"border-blue-600 bg-blue-50 text-blue-700 dark:bg-blue-950/40 dark:text-blue-300":"border-slate-300 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-white/5"]),title:s.unref(o)(`editor.headerFooter.align${M==="left"?"Left":M==="center"?"Center":"Right"}`),onClick:Q=>Dh(M)},[(s.openBlock(),s.createElementBlock("svg",FT,[s.createElementVNode("path",{d:zh(M)},null,8,VT)]))],10,PT)),64))],8,BT),s.createElementVNode("p",UT,s.toDisplayString(s.unref(o)("editor.headerFooter.placementHint")),1)]),s.createElementVNode("div",HT,[s.createElementVNode("h3",qT,s.toDisplayString(s.unref(o)("editor.headerFooter.numberingSection")),1),s.createElementVNode("div",jT,[s.createElementVNode("div",$T,[s.createElementVNode("label",WT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[27]||(T[27]=M=>Ci.value=M),type:"radio",value:"startAt",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Ci.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.startAt")),1)]),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[28]||(T[28]=M=>ea.value=M),type:"number",min:"1",class:"w-16 rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-2.5 py-1 text-xs text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:outline-none"},null,512),[[s.vModelText,ea.value]])]),s.createElementVNode("label",GT,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[29]||(T[29]=M=>Ci.value=M),type:"radio",value:"continue",class:"w-4 h-4 text-blue-600 focus:ring-blue-500"},null,512),[[s.vModelRadio,Ci.value]]),s.createElementVNode("span",null,s.toDisplayString(s.unref(o)("editor.headerFooter.continueFromPrevious")),1)]),s.createElementVNode("div",KT,[s.createElementVNode("label",XT,s.toDisplayString(s.unref(o)("editor.headerFooter.hideOnPages")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[30]||(T[30]=M=>Si.value=M),type:"text",placeholder:s.unref(o)("editor.headerFooter.hideOnPagesPlaceholder"),class:"w-full rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-[#1a2332] px-2.5 py-1.5 text-xs text-slate-800 dark:text-slate-100 focus:border-blue-600 focus:outline-none"},null,8,JT),[[s.vModelText,Si.value]]),s.createElementVNode("p",ZT,s.toDisplayString(s.unref(o)("editor.headerFooter.hideOnPagesHint")),1)])])]),s.createElementVNode("div",QT,[s.createElementVNode("button",{type:"button",class:"rounded-full px-5 py-2 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-950/40 transition-colors",onClick:T[31]||(T[31]=M=>Zr.value=!1)},s.toDisplayString(s.unref(o)("editor.headerFooter.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-full bg-blue-600 hover:bg-blue-700 px-6 py-2 text-xs font-semibold text-white shadow-md transition-colors",onClick:Hh},s.toDisplayString(s.unref(o)("editor.headerFooter.apply")),1)])])])):s.createCommentVNode("",!0),s.createVNode(Nh,{"is-open":is.value,"document-title":n.title,"share-url":n.shareUrl,onClose:T[32]||(T[32]=M=>is.value=!1),onCopyLink:T[33]||(T[33]=M=>i("share"))},null,8,["is-open","document-title","share-url"]),s.createVNode(Th,{"is-open":ns.value,meta:n.documentMeta,onClose:T[34]||(T[34]=M=>ns.value=!1)},null,8,["is-open","meta"]),s.createVNode(iT,{"is-open":Zi.value,"initial-text":aa.value,"initial-url":rs.value,"is-editing":oa.value,onApply:Lh,onRemove:Bh,onClose:T[35]||(T[35]=M=>Zi.value=!1)},null,8,["is-open","initial-text","initial-url","is-editing"]),ia.value?(s.openBlock(),s.createElementBlock("div",YT,[s.createElementVNode("div",eN,[s.createElementVNode("h2",tN,s.toDisplayString(s.unref(o)("editor.pageSetup.title")),1),s.createElementVNode("div",nN,[s.createElementVNode("label",iN,s.toDisplayString(s.unref(o)("editor.pageSetup.paperSize")),1),s.withDirectives(s.createElementVNode("select",{"onUpdate:modelValue":T[36]||(T[36]=M=>sa.value=M),class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-2 text-xs focus:outline-none dark:border-slate-700"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(ar.PAGE_SIZES),M=>(s.openBlock(),s.createElementBlock("option",{key:M.id,value:M.id},s.toDisplayString(M.name),9,rN))),128))],512),[[s.vModelSelect,sa.value]])]),s.createElementVNode("div",aN,[s.createElementVNode("label",oN,s.toDisplayString(s.unref(o)("editor.pageSetup.orientation")),1),s.createElementVNode("div",sN,[s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex-1 rounded-md border px-3 py-2 text-xs font-medium transition-colors",ii.value==="portrait"?"border-cyan-500 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300":"border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-white/5"]),onClick:T[37]||(T[37]=M=>ii.value="portrait")},s.toDisplayString(s.unref(o)("editor.pageSetup.portrait")),3),s.createElementVNode("button",{type:"button",class:s.normalizeClass(["flex-1 rounded-md border px-3 py-2 text-xs font-medium transition-colors",ii.value==="landscape"?"border-cyan-500 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-300":"border-slate-200 hover:bg-slate-50 dark:border-slate-700 dark:hover:bg-white/5"]),onClick:T[38]||(T[38]=M=>ii.value="landscape")},s.toDisplayString(s.unref(o)("editor.pageSetup.landscape")),3)])]),s.createElementVNode("div",lN,[s.createElementVNode("label",cN,s.toDisplayString(s.unref(o)("editor.pageSetup.margins"))+" (cm)",1),s.createElementVNode("div",uN,[s.createElementVNode("div",null,[s.createElementVNode("label",dN,s.toDisplayString(s.unref(o)("editor.pageSetup.top")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[39]||(T[39]=M=>et.value.top=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,fN),[[s.vModelText,et.value.top,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",pN,s.toDisplayString(s.unref(o)("editor.pageSetup.bottom")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[40]||(T[40]=M=>et.value.bottom=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,mN),[[s.vModelText,et.value.bottom,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",hN,s.toDisplayString(s.unref(o)("editor.pageSetup.left")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[41]||(T[41]=M=>et.value.left=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,bN),[[s.vModelText,et.value.left,void 0,{number:!0}]])]),s.createElementVNode("div",null,[s.createElementVNode("label",gN,s.toDisplayString(s.unref(o)("editor.pageSetup.right")),1),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":T[42]||(T[42]=M=>et.value.right=M),type:"number",min:Oi,max:s.unref(Qi),step:"0.1",class:"w-full rounded-md border border-slate-200 bg-transparent px-3 py-1.5 text-xs focus:outline-none dark:border-slate-700"},null,8,vN),[[s.vModelText,et.value.right,void 0,{number:!0}]])])])]),s.createElementVNode("div",xN,[s.createElementVNode("button",{type:"button",class:"rounded-md px-3 py-1.5 text-xs font-semibold hover:bg-slate-100 dark:hover:bg-white/5",onClick:T[43]||(T[43]=M=>ia.value=!1)},s.toDisplayString(s.unref(o)("editor.pageSetup.cancel")),1),s.createElementVNode("button",{type:"button",class:"rounded-md bg-blue-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-700",onClick:Fh},s.toDisplayString(s.unref(o)("editor.pageSetup.apply")),1)])])])):s.createCommentVNode("",!0)]))}}),wN=Pl(kN,[["__scopeId","data-v-73349cd3"]]),_N={class:"docs-editor-pages flex flex-col items-center gap-10"},SN=["data-page-index"],CN=["data-node-type","data-from","data-to"],EN=["innerHTML"],AN={key:1,class:"docs-editor-page__block-fallback flex justify-between text-sm text-slate-700"},TN={class:"docs-editor-page__block-type font-medium"},NN={class:"docs-editor-page__block-range text-slate-500"},ON=s.defineComponent({__name:"PageView",props:{pages:{},editor:{default:null},layoutOptions:{default:()=>({pageWidth:794,pageHeight:1123,margins:{top:96,bottom:96,left:96,right:96}})},isPageless:{type:Boolean,default:!1},pageColor:{default:"#ffffff"}},setup(e){const t=e,n=s.ref(0),i=()=>{n.value++};s.watch(()=>t.editor,(p,h)=>{h&&typeof h.off=="function"&&h.off("update",i),p&&typeof p.on=="function"&&p.on("update",i)},{immediate:!0}),s.onUnmounted(()=>{t.editor&&typeof t.editor.off=="function"&&t.editor.off("update",i)});const r=s.computed(()=>{var p,h;return((h=(p=t.editor)==null?void 0:p.view)==null?void 0:h.dom)??null}),a=s.computed(()=>{var p,h,g;return{pageHeight:((p=t.layoutOptions)==null?void 0:p.pageHeight)??1123,pageWidth:((h=t.layoutOptions)==null?void 0:h.pageWidth)??794,margins:((g=t.layoutOptions)==null?void 0:g.margins)??{top:96,bottom:96,left:96,right:96},maxCharsPerPage:0}}),o=s.computed(()=>{const{pageWidth:p,pageHeight:h,margins:g}=a.value;return t.isPageless?{width:`${p}px`,minHeight:"auto",height:"auto",paddingTop:`${g.top}px`,paddingBottom:`${g.bottom}px`,paddingLeft:`${g.left}px`,paddingRight:`${g.right}px`,backgroundColor:t.pageColor,boxShadow:"none",border:"none",borderRadius:"0"}:{width:`${p}px`,height:`${h}px`,paddingTop:`${g.top}px`,paddingBottom:`${g.bottom}px`,paddingLeft:`${g.left}px`,paddingRight:`${g.right}px`}}),l=()=>r.value?Array.from(r.value.children).filter(p=>p instanceof HTMLElement):[],c=p=>l().find(g=>{const b=parseInt(g.getAttribute("data-from")??"-1",10),y=parseInt(g.getAttribute("data-to")??"-1",10);return b>=0&&y>=b&&b<=p.from&&y>=p.to})??null,u=p=>{if(!t.editor||!r.value||!c(p))return null;try{const g=t.editor.view,b=g.domAtPos(p.from),y=g.domAtPos(p.to);if(!b||!y)return null;const v=document.createRange();v.setStart(b.node,b.offset),v.setEnd(y.node,y.offset);const x=v.cloneContents(),k=document.createElement("div");return k.appendChild(x),k.innerHTML}catch{return null}},f=s.computed(()=>{n.value;const p=new Map;if(!t.editor||!r.value)return p;for(const h of t.pages)for(const g of h.blocks){const b=`${g.from}-${g.to}-${g.nodeType}`;if(p.has(b))continue;const y=u(g);y!==null&&p.set(b,y)}return p}),m=p=>f.value.get(`${p.from}-${p.to}-${p.nodeType}`)??null;return(p,h)=>(s.openBlock(),s.createElementBlock("div",_N,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.pages,(g,b)=>(s.openBlock(),s.createElementBlock("div",{key:`${b}-${g.from}-${g.to}`,class:s.normalizeClass(["docs-editor-page tiptap ProseMirror relative box-border overflow-hidden text-slate-800 dark:text-[#e2e8f0]",e.isPageless?"":"editor-page-shadow rounded-lg border border-slate-200/70 bg-white dark:border-white/5 dark:bg-[#0a0f1e]"]),"data-page-index":b,style:s.normalizeStyle(o.value)},[s.createElementVNode("div",{class:"docs-editor-page__blocks flex flex-col",style:s.normalizeStyle(e.isPageless?{}:{height:"100%",overflow:"hidden"})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(g.blocks,y=>(s.openBlock(),s.createElementBlock("div",{key:`${y.from}-${y.to}`,class:"docs-editor-page__block","data-node-type":y.nodeType,"data-from":y.from,"data-to":y.to},[m(y)!==null?(s.openBlock(),s.createElementBlock("div",{key:0,class:"docs-editor-page__block-content",innerHTML:m(y)},null,8,EN)):(s.openBlock(),s.createElementBlock("div",AN,[s.createElementVNode("span",TN,s.toDisplayString(y.nodeType),1),s.createElementVNode("span",NN,s.toDisplayString(y.from)+"–"+s.toDisplayString(y.to),1)]))],8,CN))),128))],4)],14,SN))),128))]))}}),MN={class:"docs-editor-left-sidebar flex w-14 flex-shrink-0 flex-col items-center border-r border-slate-200 bg-slate-50/50 py-3 dark:border-slate-800 dark:bg-[#080d1a] md:w-64 md:items-stretch md:px-3"},DN={class:"mb-4 flex items-center justify-between px-1"},zN=["title"],IN={class:"hidden flex-col gap-4 md:flex"},RN={class:"flex items-center justify-between px-2"},LN={class:"text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wide"},BN=["title"],PN={class:"flex flex-col gap-1 pr-1"},FN=["onClick"],VN={class:"truncate"},UN={key:1,class:"flex flex-1 items-center gap-2 pr-6"},HN=["onBlur","onKeydown"],qN={class:"relative flex items-center"},jN=["onClick"],$N={key:1,class:"absolute right-0 top-6 z-50 w-28 rounded-lg border border-slate-200/80 bg-white py-1 shadow-lg dark:border-slate-700 dark:bg-slate-800 text-slate-700 dark:text-slate-200"},WN=["onClick"],GN=["disabled","onClick"],KN={class:"flex flex-col gap-1.5 px-2"},XN={class:"text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wide"},JN={key:0,class:"flex flex-col gap-1 mt-1"},ZN=["onClick"],QN={key:1,class:"text-xs leading-relaxed text-slate-400 dark:text-slate-500 italic mt-1 font-sans"},YN={class:"flex flex-col gap-2 md:hidden"},eO=["title","onClick"],tO=s.defineComponent({__name:"DocumentTabsSidebar",props:{tabs:{default:()=>[{id:"tab-1",label:"Tab 1",active:!0}]},editor:{default:null},backTitle:{default:""}},emits:["collapse","add-tab","select-tab","delete-tab","rename-tab"],setup(e,{emit:t}){const{t:n}=ht(),i=e,r=s.computed(()=>i.backTitle||n("common.cancel")),a=t,o=s.ref(null),l=s.ref(null),c=s.ref(""),u=x=>{l.value=x.id,c.value=x.label,o.value=null},f=x=>{c.value.trim()&&a("rename-tab",{id:x,label:c.value.trim()}),l.value=null},m=()=>{l.value=null},p=x=>{a("delete-tab",x),o.value=null},h=x=>{o.value=o.value===x?null:x},g=s.ref([]),b=()=>{if(!i.editor)return;const x=[];i.editor.state.doc.descendants((k,w)=>{if(k.type.name==="heading"){const S=k.attrs.level;(S===1||S===2||S===3)&&x.push({id:`heading-${w}`,text:k.textContent.trim()||n("documentTabs.untitledHeading").replace("{level}",String(S)),level:S,pos:w})}return!0}),g.value=x};let y=null;s.watch(()=>i.editor,x=>{if(y&&(y(),y=null),!x){g.value=[];return}b();const k=()=>{b()};x.on("update",k),y=()=>{x.off("update",k)}},{immediate:!0});const v=x=>{i.editor&&(i.editor.chain().focus().setTextSelection(x.pos).run(),setTimeout(()=>{var S;const k=document.querySelector(".docs-editor-scroll");if(!k)return;const w=k.querySelectorAll(".ProseMirror h1, .ProseMirror h2, .ProseMirror h3");for(const A of Array.from(w))if(((S=A.textContent)==null?void 0:S.trim())===x.text){A.scrollIntoView({behavior:"smooth",block:"center"});return}},50))};return(x,k)=>(s.openBlock(),s.createElementBlock("aside",MN,[s.createElementVNode("div",DN,[s.createElementVNode("button",{type:"button",class:"flex h-8 w-8 items-center justify-center rounded-full text-slate-500 transition-colors hover:bg-slate-200/80 dark:text-slate-400 dark:hover:bg-slate-800/80",title:r.value,onClick:k[0]||(k[0]=w=>a("collapse"))},[s.createVNode(s.unref(Ab),{class:"h-[18px] w-[18px]"})],8,zN)]),s.createElementVNode("div",IN,[s.createElementVNode("div",RN,[s.createElementVNode("span",LN,s.toDisplayString(s.unref(n)("documentTabs.documentTabs")),1),s.createElementVNode("button",{type:"button",class:"flex h-6 w-6 items-center justify-center rounded-full text-slate-600 hover:bg-slate-200 dark:text-slate-400 dark:hover:bg-slate-800 transition-colors",title:s.unref(n)("documentTabs.addTab"),onClick:k[1]||(k[1]=w=>a("add-tab"))},[s.createVNode(s.unref($n),{class:"h-4 w-4"})],8,BN)]),s.createElementVNode("div",PN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.tabs,w=>(s.openBlock(),s.createElementBlock("div",{key:w.id,class:s.normalizeClass(["group relative flex w-full items-center justify-between rounded-r-full py-1.5 pl-3 pr-2 text-left text-sm transition-all",[w.active?"bg-[#c2e7ff]/70 text-[#001d35] dark:bg-blue-950/40 dark:text-blue-200 font-medium":"text-slate-700 hover:bg-slate-200/40 dark:text-slate-300 dark:hover:bg-slate-800/30"]])},[l.value!==w.id?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:"flex flex-1 items-center gap-2 truncate pr-6 text-left",onClick:S=>a("select-tab",w.id)},[s.createVNode(s.unref(dt),{class:"h-4 w-4 flex-shrink-0 opacity-70"}),s.createElementVNode("span",VN,s.toDisplayString(w.label),1)],8,FN)):s.createCommentVNode("",!0),l.value===w.id?(s.openBlock(),s.createElementBlock("div",UN,[s.createVNode(s.unref(dt),{class:"h-4 w-4 flex-shrink-0 opacity-70"}),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":k[2]||(k[2]=S=>c.value=S),type:"text",class:"flex-1 rounded border border-blue-400 bg-white px-1.5 py-0.5 text-xs text-slate-800 outline-none focus:ring-1 focus:ring-blue-400/50 dark:bg-slate-900 dark:text-slate-100",onBlur:S=>f(w.id),onKeydown:[s.withKeys(S=>f(w.id),["enter"]),s.withKeys(m,["esc"])],onClick:k[3]||(k[3]=s.withModifiers(()=>{},["stop"]))},null,40,HN),[[s.vModelText,c.value]])])):s.createCommentVNode("",!0),s.createElementVNode("div",qN,[l.value!==w.id?(s.openBlock(),s.createElementBlock("button",{key:0,type:"button",class:s.normalizeClass(["rounded-full p-1 text-slate-500 opacity-0 transition-opacity hover:bg-slate-200/70 group-hover:opacity-100 dark:hover:bg-slate-700/70",{"opacity-100":o.value===w.id}]),onClick:s.withModifiers(S=>h(w.id),["stop"])},[s.createVNode(s.unref(gf),{class:"h-3.5 w-3.5"})],10,jN)):s.createCommentVNode("",!0),o.value===w.id?(s.openBlock(),s.createElementBlock("div",$N,[s.createElementVNode("button",{type:"button",class:"flex w-full items-center px-3 py-1.5 text-xs hover:bg-slate-50 dark:hover:bg-slate-700/50",onClick:s.withModifiers(S=>u(w),["stop"])},s.toDisplayString(s.unref(n)("documentTabs.rename")),9,WN),s.createElementVNode("button",{type:"button",class:"flex w-full items-center px-3 py-1.5 text-xs text-red-600 dark:text-red-400 hover:bg-slate-50 dark:hover:bg-slate-700/50 disabled:opacity-40",disabled:e.tabs.length<=1,onClick:s.withModifiers(S=>p(w.id),["stop"])},s.toDisplayString(s.unref(n)("documentTabs.delete")),9,GN)])):s.createCommentVNode("",!0)])],2))),128))]),k[4]||(k[4]=s.createElementVNode("div",{class:"h-px bg-slate-200/80 dark:bg-slate-800 mx-2"},null,-1)),s.createElementVNode("div",KN,[s.createElementVNode("span",XN,s.toDisplayString(s.unref(n)("documentTabs.outline")),1),g.value.length>0?(s.openBlock(),s.createElementBlock("div",JN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(g.value,w=>(s.openBlock(),s.createElementBlock("button",{key:w.id,type:"button",class:s.normalizeClass(["w-full text-left text-xs text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 py-1 transition-colors truncate",[w.level===2?"pl-3":"",w.level===3?"pl-6":""]]),onClick:S=>v(w)},s.toDisplayString(w.text),11,ZN))),128))])):(s.openBlock(),s.createElementBlock("p",QN,s.toDisplayString(s.unref(n)("documentTabs.placeholder")),1))])]),s.createElementVNode("div",YN,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.tabs,w=>(s.openBlock(),s.createElementBlock("button",{key:w.id,type:"button",class:s.normalizeClass(["flex h-8 w-8 items-center justify-center rounded-lg transition-colors",[w.active?"bg-blue-100 text-blue-600 dark:bg-blue-950/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-200 dark:text-slate-400 dark:hover:bg-slate-800"]]),title:w.label,onClick:S=>a("select-tab",w.id)},[s.createVNode(s.unref(dt),{class:"h-4 w-4"})],10,eO))),128))])]))}});Object.defineProperty(exports,"httpKeyStorage",{enumerable:!0,get:()=>Ee.httpKeyStorage});Object.defineProperty(exports,"localStorageKeyStorage",{enumerable:!0,get:()=>Ee.localStorageKeyStorage});Object.defineProperty(exports,"memoryKeyStorage",{enumerable:!0,get:()=>Ee.memoryKeyStorage});Object.defineProperty(exports,"openaiCompatibleProvider",{enumerable:!0,get:()=>Ee.openaiCompatibleProvider});Object.defineProperty(exports,"toAIStreamFn",{enumerable:!0,get:()=>Ee.toAIStreamFn});exports.AISidebar=Ch;exports.BubbleMenu=Df;exports.CommentsSidebar=Eh;exports.DetailsDialog=Th;exports.DocsEditor=wN;exports.DocumentTabsSidebar=tO;exports.EditorToolbar=Mf;exports.EmailDialog=Nh;exports.HeaderBar=Of;exports.HistorySidebar=Ah;exports.PageView=ON;exports.SlashMenu=bf;exports.StatusBar=zf;exports.TOCSidebar=If;exports.ThemeToggle=Qs;exports.collectSelectionContext=Ll;exports.defaultLocale=Bl;exports.getLocaleMessages=cf;exports.getLocaleName=mf;exports.getSupportedLocales=hf;exports.isLocale=Fa;exports.messages=Pa;exports.provideLocale=pf;exports.useAIProvider=nb;exports.useEditor=of;exports.useLocale=ht;exports.useTheme=Ro;