reactjs-tiptap-editor 0.1.12 → 0.1.13

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.
@@ -1,4 +1,4 @@
1
- "use strict";var je=Object.defineProperty;var Fe=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);const me=require("tippy.js"),m=require("./vendor-BmwuOKTu.cjs"),A=require("react"),ge=require("react-dom");function ut(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:o}=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 o},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,o=n.storedMarks,n}}}class pt{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:r}=this,{view:s}=n,{tr:o}=r,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>{const d=c(...u)(i);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,a=[],c=!!t,l=t||o.tr,u=()=>(!c&&n&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),a.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const y=this.buildProps(l,n),v=h(...g)(y);return a.push(v),d}])),run:u};return d}createCan(t){const{rawCommands:n,state:r}=this,s=!1,o=t||r.tr,i=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(n).map(([c,l])=>[c,(...u)=>l(...u)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}buildProps(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,a={tr:t,editor:s,view:i,state:ut({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([c,l])=>[c,(...u)=>l(...u)(a)]))}};return a}}class ze{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(s=>s.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(s=>s!==n):delete this.callbacks[t]),this}once(t,n){const r=(...s)=>{this.off(t,r),n.apply(this,s)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}}function w(e,t,n){return e.config[t]===void 0&&e.parent?w(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?w(e.parent,t,n):null}):e.config[t]}function ht(e){const t=e.filter(s=>s.type==="extension"),n=e.filter(s=>s.type==="node"),r=e.filter(s=>s.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ye(e){const t=[],{nodeExtensions:n,markExtensions:r}=ht(e),s=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:s},c=w(i,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([p,h])=>{t.push({type:d,name:p,attribute:{...o,...h}})})})})}),s.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},c=w(i,"addAttributes",a);if(!c)return;const l=c();Object.entries(l).forEach(([u,d])=>{const p={...o,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:i.name,name:u,attribute:p})})}),t}function _(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 O(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([s,o])=>{if(!r[s]){r[s]=o;return}if(s==="class"){const a=o?o.split(" "):[],c=r[s]?r[s].split(" "):[],l=a.filter(u=>!c.includes(u));r[s]=[...c,...l].join(" ")}else if(s==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[s]?r[s].split(";").map(u=>u.trim()).filter(Boolean):[],l=new Map;c.forEach(u=>{const[d,p]=u.split(":").map(h=>h.trim());l.set(d,p)}),a.forEach(u=>{const[d,p]=u.split(":").map(h=>h.trim());l.set(d,p)}),r[s]=Array.from(l.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[s]=o}),r},{})}function lt(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>O(n,r),{})}function ve(e){return typeof e=="function"}function C(e,t=void 0,...n){return ve(e)?t?e.bind(t)(...n):e(...n):e}function Ve(e={}){return Object.keys(e).length===0&&e.constructor===Object}function We(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function Gt(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const s=t.reduce((o,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):We(n.getAttribute(i.name));return a==null?o:{...o,[i.name]:a}},{});return{...r,...s}}}}function Jt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Ve(n)?!1:n!=null))}function Ke(e,t){var n;const r=ye(e),{nodeExtensions:s,markExtensions:o}=ht(e),i=(n=s.find(l=>w(l,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(s.map(l=>{const u=r.filter(v=>v.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((v,S)=>{const b=w(S,"extendNodeSchema",d);return{...v,...b?b(l):{}}},{}),h=Jt({...p,content:C(w(l,"content",d)),marks:C(w(l,"marks",d)),group:C(w(l,"group",d)),inline:C(w(l,"inline",d)),atom:C(w(l,"atom",d)),selectable:C(w(l,"selectable",d)),draggable:C(w(l,"draggable",d)),code:C(w(l,"code",d)),whitespace:C(w(l,"whitespace",d)),linebreakReplacement:C(w(l,"linebreakReplacement",d)),defining:C(w(l,"defining",d)),isolating:C(w(l,"isolating",d)),attrs:Object.fromEntries(u.map(v=>{var S;return[v.name,{default:(S=v==null?void 0:v.attribute)===null||S===void 0?void 0:S.default}]}))}),f=C(w(l,"parseHTML",d));f&&(h.parseDOM=f.map(v=>Gt(v,u)));const g=w(l,"renderHTML",d);g&&(h.toDOM=v=>g({node:v,HTMLAttributes:lt(v,u)}));const y=w(l,"renderText",d);return y&&(h.toText=y),[l.name,h]})),c=Object.fromEntries(o.map(l=>{const u=r.filter(y=>y.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((y,v)=>{const S=w(v,"extendMarkSchema",d);return{...y,...S?S(l):{}}},{}),h=Jt({...p,inclusive:C(w(l,"inclusive",d)),excludes:C(w(l,"excludes",d)),group:C(w(l,"group",d)),spanning:C(w(l,"spanning",d)),code:C(w(l,"code",d)),attrs:Object.fromEntries(u.map(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),f=C(w(l,"parseHTML",d));f&&(h.parseDOM=f.map(y=>Gt(y,u)));const g=w(l,"renderHTML",d);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:lt(y,u)})),[l.name,h]}));return new m.Schema({topNode:i,nodes:a,marks:c})}function wt(e,t){return t.nodes[e]||t.marks[e]||null}function Yt(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Bt(e,t){const n=m.DOMSerializer.fromSchema(t).serializeFragment(e),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}const Ue=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(s,o,i,a)=>{var c,l;const u=((l=(c=s.type.spec).toText)===null||l===void 0?void 0:l.call(c,{node:s,pos:o,parent:i,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-o))}),n};function jt(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class ft{constructor(t){this.find=t.find,this.handler=t.handler}}const qe=(e,t)=>{if(jt(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function nt(e){var t;const{editor:n,from:r,to:s,text:o,rules:i,plugin:a}=e,{view:c}=n;if(c.composing)return!1;const l=c.state.doc.resolve(r);if(l.parent.type.spec.code||!((t=l.nodeBefore||l.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let u=!1;const d=Ue(l)+o;return i.forEach(p=>{if(u)return;const h=qe(d,p.find);if(!h)return;const f=c.state.tr,g=ut({state:c.state,transaction:f}),y={from:r-(h[0].length-o.length),to:s},{commands:v,chain:S,can:b}=new pt({editor:n,state:g});p.handler({state:g,range:y,match:h,commands:v,chain:S,can:b})===null||!f.steps.length||(f.setMeta(a,{transform:f,from:r,to:s,text:o}),c.dispatch(f),u=!0)}),u}function Ge(e){const{editor:t,rules:n}=e,r=new m.Plugin({state:{init(){return null},apply(s,o,i){const a=s.getMeta(r);if(a)return a;const c=s.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=Bt(m.Fragment.from(u),i.schema);const{from:d}=c,p=d+u.length;nt({editor:t,from:d,to:p,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,i,a){return nt({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&nt({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:i}=s.state.selection;return i?nt({editor:t,from:i.pos,to:i.pos,text:`
1
+ "use strict";var je=Object.defineProperty;var Fe=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var et=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);const me=require("tippy.js"),m=require("./vendor-Dy6OEB8l.cjs"),A=require("react"),ge=require("react-dom");function ut(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:o}=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 o},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,o=n.storedMarks,n}}}class pt{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:r}=this,{view:s}=n,{tr:o}=r,i=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>{const d=c(...u)(i);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,a=[],c=!!t,l=t||o.tr,u=()=>(!c&&n&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),a.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const y=this.buildProps(l,n),v=h(...g)(y);return a.push(v),d}])),run:u};return d}createCan(t){const{rawCommands:n,state:r}=this,s=!1,o=t||r.tr,i=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(n).map(([c,l])=>[c,(...u)=>l(...u)({...i,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}buildProps(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:i}=s,a={tr:t,editor:s,view:i,state:ut({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([c,l])=>[c,(...u)=>l(...u)(a)]))}};return a}}class ze{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(s=>s.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(s=>s!==n):delete this.callbacks[t]),this}once(t,n){const r=(...s)=>{this.off(t,r),n.apply(this,s)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}}function w(e,t,n){return e.config[t]===void 0&&e.parent?w(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?w(e.parent,t,n):null}):e.config[t]}function ht(e){const t=e.filter(s=>s.type==="extension"),n=e.filter(s=>s.type==="node"),r=e.filter(s=>s.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function ye(e){const t=[],{nodeExtensions:n,markExtensions:r}=ht(e),s=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage,extensions:s},c=w(i,"addGlobalAttributes",a);if(!c)return;c().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([p,h])=>{t.push({type:d,name:p,attribute:{...o,...h}})})})})}),s.forEach(i=>{const a={name:i.name,options:i.options,storage:i.storage},c=w(i,"addAttributes",a);if(!c)return;const l=c();Object.entries(l).forEach(([u,d])=>{const p={...o,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,t.push({type:i.name,name:u,attribute:p})})}),t}function _(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 O(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([s,o])=>{if(!r[s]){r[s]=o;return}if(s==="class"){const a=o?o.split(" "):[],c=r[s]?r[s].split(" "):[],l=a.filter(u=>!c.includes(u));r[s]=[...c,...l].join(" ")}else if(s==="style"){const a=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[s]?r[s].split(";").map(u=>u.trim()).filter(Boolean):[],l=new Map;c.forEach(u=>{const[d,p]=u.split(":").map(h=>h.trim());l.set(d,p)}),a.forEach(u=>{const[d,p]=u.split(":").map(h=>h.trim());l.set(d,p)}),r[s]=Array.from(l.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[s]=o}),r},{})}function lt(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>O(n,r),{})}function ve(e){return typeof e=="function"}function C(e,t=void 0,...n){return ve(e)?t?e.bind(t)(...n):e(...n):e}function Ve(e={}){return Object.keys(e).length===0&&e.constructor===Object}function We(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function Gt(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const s=t.reduce((o,i)=>{const a=i.attribute.parseHTML?i.attribute.parseHTML(n):We(n.getAttribute(i.name));return a==null?o:{...o,[i.name]:a}},{});return{...r,...s}}}}function Jt(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&Ve(n)?!1:n!=null))}function Ke(e,t){var n;const r=ye(e),{nodeExtensions:s,markExtensions:o}=ht(e),i=(n=s.find(l=>w(l,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(s.map(l=>{const u=r.filter(v=>v.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((v,S)=>{const b=w(S,"extendNodeSchema",d);return{...v,...b?b(l):{}}},{}),h=Jt({...p,content:C(w(l,"content",d)),marks:C(w(l,"marks",d)),group:C(w(l,"group",d)),inline:C(w(l,"inline",d)),atom:C(w(l,"atom",d)),selectable:C(w(l,"selectable",d)),draggable:C(w(l,"draggable",d)),code:C(w(l,"code",d)),whitespace:C(w(l,"whitespace",d)),linebreakReplacement:C(w(l,"linebreakReplacement",d)),defining:C(w(l,"defining",d)),isolating:C(w(l,"isolating",d)),attrs:Object.fromEntries(u.map(v=>{var S;return[v.name,{default:(S=v==null?void 0:v.attribute)===null||S===void 0?void 0:S.default}]}))}),f=C(w(l,"parseHTML",d));f&&(h.parseDOM=f.map(v=>Gt(v,u)));const g=w(l,"renderHTML",d);g&&(h.toDOM=v=>g({node:v,HTMLAttributes:lt(v,u)}));const y=w(l,"renderText",d);return y&&(h.toText=y),[l.name,h]})),c=Object.fromEntries(o.map(l=>{const u=r.filter(y=>y.type===l.name),d={name:l.name,options:l.options,storage:l.storage,editor:t},p=e.reduce((y,v)=>{const S=w(v,"extendMarkSchema",d);return{...y,...S?S(l):{}}},{}),h=Jt({...p,inclusive:C(w(l,"inclusive",d)),excludes:C(w(l,"excludes",d)),group:C(w(l,"group",d)),spanning:C(w(l,"spanning",d)),code:C(w(l,"code",d)),attrs:Object.fromEntries(u.map(y=>{var v;return[y.name,{default:(v=y==null?void 0:y.attribute)===null||v===void 0?void 0:v.default}]}))}),f=C(w(l,"parseHTML",d));f&&(h.parseDOM=f.map(y=>Gt(y,u)));const g=w(l,"renderHTML",d);return g&&(h.toDOM=y=>g({mark:y,HTMLAttributes:lt(y,u)})),[l.name,h]}));return new m.Schema({topNode:i,nodes:a,marks:c})}function wt(e,t){return t.nodes[e]||t.marks[e]||null}function Yt(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Bt(e,t){const n=m.DOMSerializer.fromSchema(t).serializeFragment(e),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(n),s.innerHTML}const Ue=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(s,o,i,a)=>{var c,l;const u=((l=(c=s.type.spec).toText)===null||l===void 0?void 0:l.call(c,{node:s,pos:o,parent:i,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-o))}),n};function jt(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class ft{constructor(t){this.find=t.find,this.handler=t.handler}}const qe=(e,t)=>{if(jt(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function nt(e){var t;const{editor:n,from:r,to:s,text:o,rules:i,plugin:a}=e,{view:c}=n;if(c.composing)return!1;const l=c.state.doc.resolve(r);if(l.parent.type.spec.code||!((t=l.nodeBefore||l.nodeAfter)===null||t===void 0)&&t.marks.find(p=>p.type.spec.code))return!1;let u=!1;const d=Ue(l)+o;return i.forEach(p=>{if(u)return;const h=qe(d,p.find);if(!h)return;const f=c.state.tr,g=ut({state:c.state,transaction:f}),y={from:r-(h[0].length-o.length),to:s},{commands:v,chain:S,can:b}=new pt({editor:n,state:g});p.handler({state:g,range:y,match:h,commands:v,chain:S,can:b})===null||!f.steps.length||(f.setMeta(a,{transform:f,from:r,to:s,text:o}),c.dispatch(f),u=!0)}),u}function Ge(e){const{editor:t,rules:n}=e,r=new m.Plugin({state:{init(){return null},apply(s,o,i){const a=s.getMeta(r);if(a)return a;const c=s.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=Bt(m.Fragment.from(u),i.schema);const{from:d}=c,p=d+u.length;nt({editor:t,from:d,to:p,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,i,a){return nt({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&nt({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:i}=s.state.selection;return i?nt({editor:t,from:i.pos,to:i.pos,text:`
2
2
  `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Je(e){return Object.prototype.toString.call(e).slice(8,-1)}function rt(e){return Je(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function mt(e,t){const n={...e};return rt(e)&&rt(t)&&Object.keys(t).forEach(r=>{rt(t[r])&&rt(e[r])?n[r]=mt(e[r],t[r]):n[r]=t[r]}),n}class D{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=C(w(this,"addOptions",{name:this.name}))),this.storage=C(w(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new D(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mt(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new D(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=C(w(n,"addOptions",{name:n.name})),n.storage=C(w(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!!!i.find(l=>(l==null?void 0:l.type.name)===n.name))return!1;const c=i.find(l=>(l==null?void 0:l.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",s.pos),t.view.dispatch(r),!0}return!1}}function be(e){return typeof e=="number"}class Me{constructor(t){this.find=t.find,this.handler=t.handler}}const Ye=(e,t,n)=>{if(jt(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(s=>{const o=[s.text];return o.index=s.index,o.input=e,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(s.replaceWith)),o}):[]};function Xe(e){const{editor:t,state:n,from:r,to:s,rule:o,pasteEvent:i,dropEvent:a}=e,{commands:c,chain:l,can:u}=new pt({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,s,(h,f)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,f),y=Math.min(s,f+h.content.size),v=h.textBetween(g-f,y-f,void 0,"");Ye(v,o.find,i).forEach(b=>{if(b.index===void 0)return;const M=g+b.index+1,T=M+b[0].length,k={from:n.tr.mapping.map(M),to:n.tr.mapping.map(T)},x=o.handler({state:n,range:k,match:b,commands:c,chain:l,can:u,pasteEvent:i,dropEvent:a});d.push(x)})}),d.every(h=>h!==null)}const Qe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function Ze(e){const{editor:t,rules:n}=e;let r=null,s=!1,o=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const c=({state:u,from:d,to:p,rule:h,pasteEvt:f})=>{const g=u.tr,y=ut({state:u,transaction:g});if(!(!Xe({editor:t,state:y,from:Math.max(d-1,0),to:p.b-1,rule:h,pasteEvent:f,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new m.Plugin({view(d){const p=h=>{var f;r=!((f=d.dom.parentElement)===null||f===void 0)&&f.contains(h.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(d,p)=>(o=r===d.dom.parentElement,a=p,!1),paste:(d,p)=>{var h;const f=(h=p.clipboardData)===null||h===void 0?void 0:h.getData("text/html");return i=p,s=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(d,p,h)=>{const f=d[0],g=f.getMeta("uiEvent")==="paste"&&!s,y=f.getMeta("uiEvent")==="drop"&&!o,v=f.getMeta("applyPasteRules"),S=!!v;if(!g&&!y&&!S)return;if(S){let{text:T}=v;typeof T=="string"?T=T:T=Bt(m.Fragment.from(T),h.schema);const{from:k}=v,x=k+T.length,L=Qe(T);return c({rule:u,state:h,from:k,to:{b:x},pasteEvt:L})}const b=p.doc.content.findDiffStart(h.doc.content),M=p.doc.content.findDiffEnd(h.doc.content);if(!(!be(b)||!M||b===M.b))return c({rule:u,state:h,from:b,to:M,pasteEvt:i})}}))}function tn(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class Y{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=Y.resolve(t),this.schema=Ke(this.extensions,n),this.setupExtensions()}static resolve(t){const n=Y.sort(Y.flatten(t)),r=tn(n.map(s=>s.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(s=>`'${s}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},s=w(n,"addExtensions",r);return s?[n,...this.flatten(s())]:n}).flat(10)}static sort(t){return t.sort((r,s)=>{const o=w(r,"priority")||100,i=w(s,"priority")||100;return o>i?-1:o<i?1:0})}get commands(){return this.extensions.reduce((t,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:wt(n.name,this.schema)},s=w(n,"addCommands",r);return s?{...t,...s()}:t},{})}get plugins(){const{editor:t}=this,n=Y.sort([...this.extensions].reverse()),r=[],s=[],o=n.map(i=>{const a={name:i.name,options:i.options,storage:i.storage,editor:t,type:wt(i.name,this.schema)},c=[],l=w(i,"addKeyboardShortcuts",a);let u={};if(i.type==="mark"&&w(i,"exitable",a)&&(u.ArrowRight=()=>D.handleExit({editor:t,mark:i})),l){const g=Object.fromEntries(Object.entries(l()).map(([y,v])=>[y,()=>v({editor:t})]));u={...u,...g}}const d=m.keymap(u);c.push(d);const p=w(i,"addInputRules",a);Yt(i,t.options.enableInputRules)&&p&&r.push(...p());const h=w(i,"addPasteRules",a);Yt(i,t.options.enablePasteRules)&&h&&s.push(...h());const f=w(i,"addProseMirrorPlugins",a);if(f){const g=f();c.push(...g)}return c}).flat();return[Ge({editor:t,rules:r}),...Ze({editor:t,rules:s}),...o]}get attributes(){return ye(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=ht(this.extensions);return Object.fromEntries(n.filter(r=>!!w(r,"addNodeView")).map(r=>{const s=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:_(r.name,this.schema)},i=w(r,"addNodeView",o);if(!i)return[];const a=(c,l,u,d,p)=>{const h=lt(c,s);return i()({node:c,view:l,getPos:u,decorations:d,innerDecorations:p,editor:t,extension:r,HTMLAttributes:h})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:wt(t.name,this.schema)};t.type==="mark"&&(!((n=C(w(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const s=w(t,"onBeforeCreate",r),o=w(t,"onCreate",r),i=w(t,"onUpdate",r),a=w(t,"onSelectionUpdate",r),c=w(t,"onTransaction",r),l=w(t,"onFocus",r),u=w(t,"onBlur",r),d=w(t,"onDestroy",r);s&&this.editor.on("beforeCreate",s),o&&this.editor.on("create",o),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),l&&this.editor.on("focus",l),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class H{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=C(w(this,"addOptions",{name:this.name}))),this.storage=C(w(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new H(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>mt(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new H({...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=C(w(n,"addOptions",{name:n.name})),n.storage=C(w(n,"addStorage",{name:n.name,options:n.options})),n}}function Se(e,t,n){const{from:r,to:s}=t,{blockSeparator:o=`
3
3
 
4
4
  `,textSerializers:i={}}=n||{};let a="";return e.nodesBetween(r,s,(c,l,u,d)=>{var p;c.isBlock&&l>r&&(a+=o);const h=i==null?void 0:i[c.type.name];if(h)return u&&(a+=h({node:c,pos:l,parent:u,index:d,range:t})),!1;c.isText&&(a+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,l)-l,s-l))}),a}function ke(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const en=H.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:s}=t,{ranges:o}=s,i=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),c=ke(n);return Se(r,{from:i,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),nn=()=>({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),rn=(e=!1)=>({commands:t})=>t.setContent("",e),sn=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:s}=r;return n&&s.forEach(({$from:o,$to:i})=>{e.doc.nodesBetween(o.pos,i.pos,(a,c)=>{if(a.type.isText)return;const{doc:l,mapping:u}=t,d=l.resolve(u.map(c)),p=l.resolve(u.map(c+a.nodeSize)),h=d.blockRange(p);if(!h)return;const f=m.liftTarget(h);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(h.start,g)}(f||f===0)&&t.lift(h,f)})}),!0},on=e=>t=>e(t),an=()=>({state:e,dispatch:t})=>m.createParagraphNear(e,t),ln=(e,t)=>({editor:n,tr:r})=>{const{state:s}=n,o=s.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const i=r.mapping.map(t);return r.insert(i,o.content),r.setSelection(new m.TextSelection(r.doc.resolve(i-1))),!0},cn=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===r.type){if(t){const a=s.before(o),c=s.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},dn=e=>({tr:t,state:n,dispatch:r})=>{const s=_(e,n.schema),o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===s){if(r){const c=o.before(i),l=o.after(i);t.delete(c,l).scrollIntoView()}return!0}return!1},un=e=>({tr:t,dispatch:n})=>{const{from:r,to:s}=e;return n&&t.delete(r,s),!0},pn=()=>({state:e,dispatch:t})=>m.deleteSelection(e,t),hn=()=>({commands:e})=>e.keyboardShortcut("Enter"),fn=()=>({state:e,dispatch:t})=>m.exitCode(e,t);function ct(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(s=>n.strict?t[s]===e[s]:jt(t[s])?t[s].test(e[s]):t[s]===e[s]):!0}function we(e,t,n={}){return e.find(r=>r.type===t&&ct(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Xt(e,t,n={}){return!!we(e,t,n)}function gt(e,t,n){var r;if(!e||!t)return;let s=e.parent.childAfter(e.parentOffset);if((!s.node||!s.node.marks.some(u=>u.type===t))&&(s=e.parent.childBefore(e.parentOffset)),!s.node||!s.node.marks.some(u=>u.type===t)||(n=n||((r=s.node.marks[0])===null||r===void 0?void 0:r.attrs),!we([...s.node.marks],t,n)))return;let i=s.index,a=e.start()+s.offset,c=i+1,l=a+s.node.nodeSize;for(;i>0&&Xt([...e.parent.child(i-1).marks],t,n);)i-=1,a-=e.parent.child(i).nodeSize;for(;c<e.parent.childCount&&Xt([...e.parent.child(c).marks],t,n);)l+=e.parent.child(c).nodeSize,c+=1;return{from:a,to:l}}function z(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 mn=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const o=z(e,r.schema),{doc:i,selection:a}=n,{$from:c,from:l,to:u}=a;if(s){const d=gt(c,o,t);if(d&&d.from<=l&&d.to>=u){const p=m.TextSelection.create(i,d.from,d.to);n.setSelection(p)}}return!0},gn=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function Ft(e){return e instanceof m.TextSelection}function $(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Te(e,t=null){if(!t)return null;const n=m.Selection.atStart(e),r=m.Selection.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const s=n.from,o=r.to;return t==="all"?m.TextSelection.create(e,$(0,s,o),$(e.content.size,s,o)):m.TextSelection.create(e,$(t,s,o),$(t,s,o))}function yt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const yn=(e=null,t={})=>({editor:n,view:r,tr:s,dispatch:o})=>{t={scrollIntoView:!0,...t};const i=()=>{yt()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!Ft(n.state.selection))return i(),!0;const a=Te(s.doc,e)||n.state.selection,c=n.state.selection.eq(a);return o&&(c||s.setSelection(a),c&&s.storedMarks&&s.setStoredMarks(s.storedMarks),i()),!0},vn=(e,t)=>n=>e.every((r,s)=>t(r,{...n,index:s})),bn=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ee=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ee(r)}return e};function st(e){const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return Ee(n)}function dt(e,t,n){if(e instanceof m.Node||e instanceof m.Fragment)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,s=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return m.Fragment.fromArray(e.map(a=>t.nodeFromJSON(a)));const i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),dt("",t,n)}if(s){if(n.errorOnInvalidContent){let i=!1,a="";const c=new m.Schema({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:l=>(i=!0,a=typeof l=="string"?l:l.outerHTML,null)}]}})});if(n.slice?m.DOMParser.fromSchema(c).parseSlice(st(e),n.parseOptions):m.DOMParser.fromSchema(c).parse(st(e),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const o=m.DOMParser.fromSchema(t);return n.slice?o.parseSlice(st(e),n.parseOptions).content:o.parse(st(e),n.parseOptions)}return dt("",t,n)}function Mn(e,t,n){const r=e.steps.length-1;if(r<t)return;const s=e.steps[r];if(!(s instanceof m.ReplaceStep||s instanceof m.ReplaceAroundStep))return;const o=e.mapping.maps[r];let i=0;o.forEach((a,c,l,u)=>{i===0&&(i=u)}),e.setSelection(m.Selection.near(e.doc.resolve(i),n))}const Sn=e=>!("type"in e),kn=(e,t,n)=>({tr:r,dispatch:s,editor:o})=>{var i;if(s){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=dt(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(i=n.errorOnInvalidContent)!==null&&i!==void 0?i:o.options.enableContentCheck})}catch(f){return o.emit("contentError",{editor:o,error:f,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:l}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Sn(a)?a:[a]).forEach(f=>{f.check(),u=u?f.isText&&f.marks.length===0:!1,d=d?f.isBlock:!1}),c===l&&d){const{parent:f}=r.doc.resolve(c);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(c-=1,l+=1)}let h;if(u){if(Array.isArray(t))h=t.map(f=>f.text||"").join("");else if(t instanceof m.Fragment){let f="";t.forEach(g=>{g.text&&(f+=g.text)}),h=f}else typeof t=="object"&&t&&t.text?h=t.text:h=t;r.insertText(h,c,l)}else h=a,r.replaceWith(c,l,h);n.updateSelection&&Mn(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:h})}return!0},wn=()=>({state:e,dispatch:t})=>m.joinUp(e,t),Tn=()=>({state:e,dispatch:t})=>m.joinDown(e,t),En=()=>({state:e,dispatch:t})=>m.joinBackward(e,t),Cn=()=>({state:e,dispatch:t})=>m.joinForward(e,t),xn=()=>({state:e,dispatch:t,tr:n})=>{try{const r=m.joinPoint(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},An=()=>({state:e,dispatch:t,tr:n})=>{try{const r=m.joinPoint(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},On=()=>({state:e,dispatch:t})=>m.joinTextblockBackward(e,t),Ln=()=>({state:e,dispatch:t})=>m.joinTextblockForward(e,t);function Ce(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Pn(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,s,o,i;for(let a=0;a<t.length-1;a+=1){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))i=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))yt()||Ce()?i=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const Rn=e=>({editor:t,view:n,tr:r,dispatch:s})=>{const o=Pn(e).split(/-(?!$)/),i=o.find(l=>!["Alt","Ctrl","Meta","Shift"].includes(l)),a=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",l=>l(n,a))});return c==null||c.steps.forEach(l=>{const u=l.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function tt(e,t,n={}){const{from:r,to:s,empty:o}=e.selection,i=t?_(t,e.schema):null,a=[];e.doc.nodesBetween(r,s,(d,p)=>{if(d.isText)return;const h=Math.max(r,p),f=Math.min(s,p+d.nodeSize);a.push({node:d,from:h,to:f})});const c=s-r,l=a.filter(d=>i?i.name===d.node.type.name:!0).filter(d=>ct(d.node.attrs,n,{strict:!1}));return o?!!l.length:l.reduce((d,p)=>d+p.to-p.from,0)>=c}const Hn=(e,t={})=>({state:n,dispatch:r})=>{const s=_(e,n.schema);return tt(n,s,t)?m.lift(n,r):!1},_n=()=>({state:e,dispatch:t})=>m.liftEmptyBlock(e,t),Dn=e=>({state:t,dispatch:n})=>{const r=_(e,t.schema);return m.liftListItem(r)(t,n)},In=()=>({state:e,dispatch:t})=>m.newlineInCode(e,t);function vt(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Qt(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,s)=>(n.includes(s)||(r[s]=e[s]),r),{})}const Nn=(e,t)=>({tr:n,state:r,dispatch:s})=>{let o=null,i=null;const a=vt(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(o=_(e,r.schema)),a==="mark"&&(i=z(e,r.schema)),s&&n.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(l,u)=>{o&&o===l.type&&n.setNodeMarkup(u,void 0,Qt(l.attrs,t)),i&&l.marks.length&&l.marks.forEach(d=>{i===d.type&&n.addMark(u,u+l.nodeSize,i.create(Qt(d.attrs,t)))})})}),!0):!1},$n=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Bn=()=>({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size}),jn=()=>({state:e,dispatch:t})=>m.selectNodeBackward(e,t),Fn=()=>({state:e,dispatch:t})=>m.selectNodeForward(e,t),zn=()=>({state:e,dispatch:t})=>m.selectParentNode(e,t),Vn=()=>({state:e,dispatch:t})=>m.selectTextblockEnd(e,t),Wn=()=>({state:e,dispatch:t})=>m.selectTextblockStart(e,t);function Pt(e,t,n={},r={}){return dt(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const Kn=(e,t=!1,n={},r={})=>({editor:s,tr:o,dispatch:i,commands:a})=>{var c,l;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const d=Pt(e,s.schema,n,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:s.options.enableContentCheck});return i&&o.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!t),!0}return i&&o.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:u.content.size},e,{parseOptions:n,errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:s.options.enableContentCheck})};function zt(e,t){const n=z(t,e.schema),{from:r,to:s,empty:o}=e.selection,i=[];o?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,s,c=>{i.push(...c.marks)});const a=i.find(c=>c.type.name===n.name);return a?{...a.attrs}:{}}function Un(e,t){const n=new m.Transform(e);return t.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function qn(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 Gn(e,t){const n=[];return e.descendants((r,s)=>{t(r)&&n.push({node:r,pos:s})}),n}function Jn(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(s,o)=>{n(s)&&r.push({node:s,pos:o})}),r}function xe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function bt(e){return t=>xe(t.$from,e)}function Yn(e,t){const n={from:0,to:e.content.size};return Se(e,n,t)}function Xn(e,t){const n=_(t,e.schema),{from:r,to:s}=e.selection,o=[];e.doc.nodesBetween(r,s,a=>{o.push(a)});const i=o.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function Ae(e,t){const n=vt(typeof t=="string"?t:t.name,e.schema);return n==="node"?Xn(e,t):n==="mark"?zt(e,t):{}}function Qn(e,t=JSON.stringify){const n={};return e.filter(r=>{const s=t(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function Zn(e){const t=Qn(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function tr(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((s,o)=>{const i=[];if(s.ranges.length)s.forEach((a,c)=>{i.push({from:a,to:c})});else{const{from:a,to:c}=n[o];if(a===void 0||c===void 0)return;i.push({from:a,to:c})}i.forEach(({from:a,to:c})=>{const l=t.slice(o).map(a,-1),u=t.slice(o).map(c),d=t.invert().map(l,-1),p=t.invert().map(u);r.push({oldRange:{from:d,to:p},newRange:{from:l,to:u}})})}),Zn(r)}function Vt(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(s=>{const o=n.resolve(e),i=gt(o,s.type);i&&r.push({mark:s,...i})}):n.nodesBetween(e,t,(s,o)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(i=>({from:o,to:o+s.nodeSize,mark:i})))}),r}function at(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=e.find(o=>o.type===t&&o.name===r);return s?s.attribute.keepOnSplit:!1}))}function Rt(e,t,n={}){const{empty:r,ranges:s}=e.selection,o=t?z(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>ct(d.attrs,n,{strict:!1}));let i=0;const a=[];if(s.forEach(({$from:d,$to:p})=>{const h=d.pos,f=p.pos;e.doc.nodesBetween(h,f,(g,y)=>{if(!g.isText&&!g.marks.length)return;const v=Math.max(h,y),S=Math.min(f,y+g.nodeSize),b=S-v;i+=b,a.push(...g.marks.map(M=>({mark:M,from:v,to:S})))})}),i===0)return!1;const c=a.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>ct(d.mark.attrs,n,{strict:!1})).reduce((d,p)=>d+p.to-p.from,0),l=a.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,p)=>d+p.to-p.from,0);return(c>0?c+l:c)>=i}function Oe(e,t,n={}){if(!t)return tt(e,null,n)||Rt(e,null,n);const r=vt(t,e.schema);return r==="node"?tt(e,t,n):r==="mark"?Rt(e,t,n):!1}function Ht(e,t){const{nodeExtensions:n}=ht(t),r=n.find(i=>i.name===e);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},o=C(w(r,"group",s));return typeof o!="string"?!1:o.split(" ").includes("list")}function Mt(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let s=!0;return e.content.forEach(o=>{s!==!1&&(Mt(o,{ignoreWhitespace:n,checkChildren:t})||(s=!1))}),s}return!1}function Le(e){return e instanceof m.NodeSelection}function er(e,t,n){const s=e.state.doc.content.size,o=$(t,0,s),i=$(n,0,s),a=e.coordsAtPos(o),c=e.coordsAtPos(i,-1),l=Math.min(a.top,c.top),u=Math.max(a.bottom,c.bottom),d=Math.min(a.left,c.left),p=Math.max(a.right,c.right),h=p-d,f=u-l,v={top:l,bottom:u,left:d,right:p,width:h,height:f,x:d,y:l};return{...v,toJSON:()=>v}}function nr(e,t,n){var r;const{selection:s}=t;let o=null;if(Ft(s)&&(o=s.$cursor),o){const a=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(c=>c.type.excludes(n))}const{ranges:i}=s;return i.some(({$from:a,$to:c})=>{let l=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,c.pos,(u,d,p)=>{if(l)return!1;if(u.isInline){const h=!p||p.type.allowsMarkType(n),f=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));l=h&&f}return!l}),l})}const rr=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{selection:o}=n,{empty:i,ranges:a}=o,c=z(e,r.schema);if(s)if(i){const l=zt(r,c);n.addStoredMark(c.create({...l,...t}))}else a.forEach(l=>{const u=l.$from.pos,d=l.$to.pos;r.doc.nodesBetween(u,d,(p,h)=>{const f=Math.max(h,u),g=Math.min(h+p.nodeSize,d);p.marks.find(v=>v.type===c)?p.marks.forEach(v=>{c===v.type&&n.addMark(f,g,c.create({...v.attrs,...t}))}):n.addMark(f,g,c.create(t))})});return nr(r,n,c)},sr=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),or=(e,t={})=>({state:n,dispatch:r,chain:s})=>{const o=_(e,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:a})=>m.setBlockType(o,{...i,...t})(n)?!0:a.clearNodes()).command(({state:a})=>m.setBlockType(o,{...i,...t})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ir=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,s=$(e,0,r.content.size),o=m.NodeSelection.create(r,s);t.setSelection(o)}return!0},ar=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:s,to:o}=typeof e=="number"?{from:e,to:e}:e,i=m.TextSelection.atStart(r).from,a=m.TextSelection.atEnd(r).to,c=$(s,i,a),l=$(o,i,a),u=m.TextSelection.create(r,c,l);t.setSelection(u)}return!0},lr=e=>({state:t,dispatch:n})=>{const r=_(e,t.schema);return m.sinkListItem(r)(t,n)};function Zt(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(s=>t==null?void 0:t.includes(s.type.name));e.tr.ensureMarks(r)}}const cr=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:s})=>{const{selection:o,doc:i}=t,{$from:a,$to:c}=o,l=s.extensionManager.attributes,u=at(l,a.node().type.name,a.node().attrs);if(o instanceof m.NodeSelection&&o.node.isBlock)return!a.parentOffset||!m.canSplit(i,a.pos)?!1:(r&&(e&&Zt(n,s.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=c.parentOffset===c.parent.content.size,p=a.depth===0?void 0:qn(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&p?[{type:p,attrs:u}]:void 0,f=m.canSplit(t.doc,t.mapping.map(a.pos),1,h);if(!h&&!f&&m.canSplit(t.doc,t.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(f=!0,h=p?[{type:p,attrs:u}]:void 0),r){if(f&&(o instanceof m.TextSelection&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),p&&!d&&!a.parentOffset&&a.parent.type!==p)){const g=t.mapping.map(a.before()),y=t.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&t.setNodeMarkup(t.mapping.map(a.before()),p)}e&&Zt(n,s.extensionManager.splittableMarks),t.scrollIntoView()}return f},dr=(e,t={})=>({tr:n,state:r,dispatch:s,editor:o})=>{var i;const a=_(e,r.schema),{$from:c,$to:l}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(l))return!1;const d=c.node(-1);if(d.type!==a)return!1;const p=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==a||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){let v=m.Fragment.empty;const S=c.index(-1)?1:c.index(-2)?2:3;for(let L=c.depth-S;L>=c.depth-3;L-=1)v=m.Fragment.from(c.node(L).copy(v));const b=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,M={...at(p,c.node().type.name,c.node().attrs),...t},T=((i=a.contentMatch.defaultType)===null||i===void 0?void 0:i.createAndFill(M))||void 0;v=v.append(m.Fragment.from(a.createAndFill(null,T)||void 0));const k=c.before(c.depth-(S-1));n.replace(k,c.after(-b),new m.Slice(v,4-S,0));let x=-1;n.doc.nodesBetween(k,n.doc.content.size,(L,E)=>{if(x>-1)return!1;L.isTextblock&&L.content.size===0&&(x=E+1)}),x>-1&&n.setSelection(m.TextSelection.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}const h=l.pos===c.end()?d.contentMatchAt(0).defaultType:null,f={...at(p,d.type.name,d.attrs),...t},g={...at(p,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,l.pos);const y=h?[{type:a,attrs:f},{type:h,attrs:g}]:[{type:a,attrs:f}];if(!m.canSplit(n.doc,c.pos,2))return!1;if(s){const{selection:v,storedMarks:S}=r,{splittableMarks:b}=o.extensionManager,M=S||v.$to.parentOffset&&v.$from.marks();if(n.split(c.pos,2,y).scrollIntoView(),!M||!s)return!0;const T=M.filter(k=>b.includes(k.type.name));n.ensureMarks(T)}return!0},Tt=(e,t)=>{const n=bt(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&m.canJoin(e.doc,n.pos)&&e.join(n.pos),!0},Et=(e,t)=>{const n=bt(i=>i.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return n.node.type===(s==null?void 0:s.type)&&m.canJoin(e.doc,r)&&e.join(r),!0},ur=(e,t,n,r={})=>({editor:s,tr:o,state:i,dispatch:a,chain:c,commands:l,can:u})=>{const{extensions:d,splittableMarks:p}=s.extensionManager,h=_(e,i.schema),f=_(t,i.schema),{selection:g,storedMarks:y}=i,{$from:v,$to:S}=g,b=v.blockRange(S),M=y||g.$to.parentOffset&&g.$from.marks();if(!b)return!1;const T=bt(k=>Ht(k.type.name,d))(g);if(b.depth>=1&&T&&b.depth-T.depth<=1){if(T.node.type===h)return l.liftListItem(f);if(Ht(T.node.type.name,d)&&h.validContent(T.node.content)&&a)return c().command(()=>(o.setNodeMarkup(T.pos,h),!0)).command(()=>Tt(o,h)).command(()=>Et(o,h)).run()}return!n||!M||!a?c().command(()=>u().wrapInList(h,r)?!0:l.clearNodes()).wrapInList(h,r).command(()=>Tt(o,h)).command(()=>Et(o,h)).run():c().command(()=>{const k=u().wrapInList(h,r),x=M.filter(L=>p.includes(L.type.name));return o.ensureMarks(x),k?!0:l.clearNodes()}).wrapInList(h,r).command(()=>Tt(o,h)).command(()=>Et(o,h)).run()},pr=(e,t={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:o=!1}=n,i=z(e,r.schema);return Rt(r,i,t)?s.unsetMark(i,{extendEmptyMarkRange:o}):s.setMark(i,t)},hr=(e,t,n={})=>({state:r,commands:s})=>{const o=_(e,r.schema),i=_(t,r.schema),a=tt(r,o,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),a?s.setNode(i,c):s.setNode(o,{...c,...n})},fr=(e,t={})=>({state:n,commands:r})=>{const s=_(e,n.schema);return tt(n,s,t)?r.lift(s):r.wrapIn(s,t)},mr=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let o;if(s.spec.isInputRules&&(o=s.getState(e))){if(t){const i=e.tr,a=o.transform;for(let c=a.steps.length-1;c>=0;c-=1)i.step(a.steps[c].invert(a.docs[c]));if(o.text){const c=i.doc.resolve(o.from).marks();i.replaceWith(o.from,o.to,e.schema.text(o.text,c))}else i.delete(o.from,o.to)}return!0}}return!1},gr=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:s}=n;return r||t&&s.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},yr=(e,t={})=>({tr:n,state:r,dispatch:s})=>{var o;const{extendEmptyMarkRange:i=!1}=t,{selection:a}=n,c=z(e,r.schema),{$from:l,empty:u,ranges:d}=a;if(!s)return!0;if(u&&i){let{from:p,to:h}=a;const f=(o=l.marks().find(y=>y.type===c))===null||o===void 0?void 0:o.attrs,g=gt(l,c,f);g&&(p=g.from,h=g.to),n.removeMark(p,h,c)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,c)});return n.removeStoredMark(c),!0},vr=(e,t={})=>({tr:n,state:r,dispatch:s})=>{let o=null,i=null;const a=vt(typeof e=="string"?e:e.name,r.schema);return a?(a==="node"&&(o=_(e,r.schema)),a==="mark"&&(i=z(e,r.schema)),s&&n.selection.ranges.forEach(c=>{const l=c.$from.pos,u=c.$to.pos;let d,p,h,f;n.selection.empty?r.doc.nodesBetween(l,u,(g,y)=>{o&&o===g.type&&(h=Math.max(y,l),f=Math.min(y+g.nodeSize,u),d=y,p=g)}):r.doc.nodesBetween(l,u,(g,y)=>{y<l&&o&&o===g.type&&(h=Math.max(y,l),f=Math.min(y+g.nodeSize,u),d=y,p=g),y>=l&&y<=u&&(o&&o===g.type&&n.setNodeMarkup(y,void 0,{...g.attrs,...t}),i&&g.marks.length&&g.marks.forEach(v=>{if(i===v.type){const S=Math.max(y,l),b=Math.min(y+g.nodeSize,u);n.addMark(S,b,i.create({...v.attrs,...t}))}}))}),p&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...p.attrs,...t}),i&&p.marks.length&&p.marks.forEach(g=>{i===g.type&&n.addMark(h,f,i.create({...g.attrs,...t}))}))}),!0):!1},br=(e,t={})=>({state:n,dispatch:r})=>{const s=_(e,n.schema);return m.wrapIn(s,t)(n,r)},Mr=(e,t={})=>({state:n,dispatch:r})=>{const s=_(e,n.schema);return m.wrapInList(s,t)(n,r)};var Sr=Object.freeze({__proto__:null,blur:nn,clearContent:rn,clearNodes:sn,command:on,createParagraphNear:an,cut:ln,deleteCurrentNode:cn,deleteNode:dn,deleteRange:un,deleteSelection:pn,enter:hn,exitCode:fn,extendMarkRange:mn,first:gn,focus:yn,forEach:vn,insertContent:bn,insertContentAt:kn,joinBackward:En,joinDown:Tn,joinForward:Cn,joinItemBackward:xn,joinItemForward:An,joinTextblockBackward:On,joinTextblockForward:Ln,joinUp:wn,keyboardShortcut:Rn,lift:Hn,liftEmptyBlock:_n,liftListItem:Dn,newlineInCode:In,resetAttributes:Nn,scrollIntoView:$n,selectAll:Bn,selectNodeBackward:jn,selectNodeForward:Fn,selectParentNode:zn,selectTextblockEnd:Vn,selectTextblockStart:Wn,setContent:Kn,setMark:rr,setMeta:sr,setNode:or,setNodeSelection:ir,setTextSelection:ar,sinkListItem:lr,splitBlock:cr,splitListItem:dr,toggleList:ur,toggleMark:pr,toggleNode:hr,toggleWrap:fr,undoInputRule:mr,unsetAllMarks:gr,unsetMark:yr,updateAttributes:vr,wrapIn:br,wrapInList:Mr});const kr=H.create({name:"commands",addCommands(){return{...Sr}}}),wr=H.create({name:"drop",addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Tr=H.create({name:"editable",addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Er=H.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new m.Plugin({key:new m.PluginKey("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Cr=H.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:c,doc:l}=a,{empty:u,$anchor:d}=c,{pos:p,parent:h}=d,f=d.parent.isTextblock&&p>0?a.doc.resolve(p-1):d,g=f.parent.type.spec.isolating,y=d.pos-d.parentOffset,v=g&&f.parent.childCount===1?y===d.pos:m.Selection.atStart(l).from===p;return!u||!h.type.isTextblock||h.textContent.length||!v||v&&d.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.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()},s={...r},o={...r,"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 yt()||Ce()?o:s},addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("clearDocument"),appendTransaction:(e,t,n)=>{const r=e.some(g=>g.docChanged)&&!t.doc.eq(n.doc),s=e.some(g=>g.getMeta("preventClearDocument"));if(!r||s)return;const{empty:o,from:i,to:a}=t.selection,c=m.Selection.atStart(t.doc).from,l=m.Selection.atEnd(t.doc).to;if(o||!(i===c&&a===l)||!Mt(n.doc))return;const p=n.tr,h=ut({state:n,transaction:p}),{commands:f}=new pt({editor:this.editor,state:h});if(f.clearNodes(),!!p.steps.length)return p}})]}}),xr=H.create({name:"paste",addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Ar=H.create({name:"tabindex",addProseMirrorPlugins(){return[new m.Plugin({key:new m.PluginKey("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class U{get name(){return this.node.type.name}constructor(t,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new U(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new U(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new U(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,i=this.pos+r+(o?0:1),a=this.resolvedPos.doc.resolve(i);if(!s&&a.depth<=this.depth)return;const c=new U(a,this.editor,s,s?n:null);s&&(c.actualDepth=this.depth+1),t.push(new U(a,this.editor,s,s?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===t)if(Object.keys(n).length>0){const o=s.node.attrs,i=Object.keys(n);for(let a=0;a<i.length;a+=1){const c=i[a];if(o[c]!==n[c])break}}else r=s;s=s.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(n);return this.children.forEach(i=>{r&&s.length>0||(i.node.type.name===t&&o.every(c=>n[c]===i.node.attrs[c])&&s.push(i),!(r&&s.length>0)&&(s=s.concat(i.querySelectorAll(t,n,r))))}),s}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const Or=`.ProseMirror {
@@ -6,16 +6,15 @@ import * as V from "react";
6
6
  import Fe, { useState as w, useRef as J, useEffect as H, useCallback as T, useMemo as P, Fragment as dt, forwardRef as Lt, useImperativeHandle as St } from "react";
7
7
  import "@radix-ui/react-toast";
8
8
  import { ChevronRight as nr, Check as ai, Circle as rr, ChevronDown as Mt, ChevronUp as tn, HelpCircle as nn, Pencil as rn, Trash2 as an, X as ar, Plus as on, Bold as or, LoaderCircle as cr, Italic as sr, Underline as lr, Quote as dr, Strikethrough as hr, Minus as ur, Eraser as mr, PaintRoller as fr, Redo2 as gr, Undo2 as xr, Subscript as br, Superscript as pr, Code as wr, CodeXml as _r, Type as vr, IndentIncrease as yr, IndentDecrease as kr, List as Cr, ListOrdered as Nr, ListTodo as Tr, Link as Ar, ImageUp as Lr, Video as Sr, Maximize as Mr, Minimize as Ir, Table as zr, Sparkles as Er, Unlink as Hr, BetweenHorizonalEnd as Rr, BetweenHorizonalStart as Or, BetweenVerticalStart as Pr, BetweenVerticalEnd as Dr, TableCellsMerge as Br, TableCellsSplit as $r, Trash as Vr, Replace as Li, ChevronsUpDown as jr, Heading1 as Fr, Heading2 as Ur, Heading3 as Wr, Heading4 as qr, Heading5 as Gr, Heading6 as Kr, Columns2 as Si, Columns3 as Xr, Columns4 as Zr, GripVertical as Yr, Copy as cn, Clipboard as Jr, PanelLeft as Qr, PanelRight as ea, Frame as ta, SmilePlus as ia, SmilePlusIcon as na, Sigma as ra, BookMarked as aa, ZoomIn as oa, ZoomOut as ca, Settings as sa, Eye as la, Paperclip as da, CropIcon as ha, FlipVertical as ua, FlipHorizontal as ma, CopyCheck as fa, Clock3 as ga, Laugh as xa, LucideAudioLines as ba, LucideVideo as pa, LucideFile as wa, LucideImage as _a, LucideSheet as va, LucideTableProperties as ya } from "lucide-react";
9
- import { B as ce, N as ae, a as ue, m as ne, R as ge, n as oi, b as ka, u as Ca, E as Na, i as Ta, D as Aa, d as La, c as Sa, e as Ma, I as Ia, U as za, S as Ea, C as Ha, f as ct, g as Ra, h as Oa, F as Pa, H as Da, T as Ba, j as Y, k as $a, l as Va, o as ja, O as Fa, p as Ua, q as Wa, r as qa, L as Ga, s as Ka, t as Xa, v as Za, w as Ya, x as Ct, P as Ja, y as Qa, z as eo, G as to, A as io, J as no, K as ro, M as ao, Q as oo, V as co, W as sn, X as ln, Y as dn, Z as ci, _ as si, $ as so, a0 as lo, a1 as ho, a2 as uo, a3 as mo, a4 as Mi } from "./tiptap-BSVYcz58.js";
10
- import { am as fo, an as ee, ao as li, ap as di, aq as go, ar as hn, as as xo, at as Se, e as It, d as Me, au as un, av as hi, aw as bo, P as we, a as _e, a2 as Ue, a3 as qe, J as po, ax as Nt, ay as mn, aj as wo, az as _o } from "./vendor-C2GXVsjz.js";
9
+ import { B as ce, N as ae, a as ue, m as ne, R as ge, n as oi, b as ka, u as Ca, E as Na, i as Ta, D as Aa, d as La, c as Sa, e as Ma, I as Ia, U as za, S as Ea, C as Ha, f as ct, g as Ra, h as Oa, F as Pa, H as Da, T as Ba, j as Y, k as $a, l as Va, o as ja, O as Fa, p as Ua, q as Wa, r as qa, L as Ga, s as Ka, t as Xa, v as Za, w as Ya, x as Ct, P as Ja, y as Qa, z as eo, G as to, A as io, J as no, K as ro, M as ao, Q as oo, V as co, W as sn, X as ln, Y as dn, Z as ci, _ as si, $ as so, a0 as lo, a1 as ho, a2 as uo, a3 as mo, a4 as Mi } from "./tiptap-8FnNtpP6.js";
10
+ import { ao as fo, ap as ee, aq as li, ar as di, as as go, g as It, at as zt, au as hn, av as xo, aw as Se, e as Et, d as Me, ax as un, ay as hi, az as bo, P as we, a as _e, a4 as Ue, a5 as qe, L as po, aA as Nt, aB as mn, al as wo, aC as _o } from "./vendor-ehTKF-_z.js";
11
11
  import { bundledThemes as fn, bundledLanguages as gn, createHighlighter as vo } from "shiki";
12
- import { u as B, C as yo, E as ko, l as F, B as Co, I as Tt, V as Gt, M as No, D as xn, a as To, b as Ao, c as Ii, d as bn, e as Lo, f as Ge, g as Ke, h as ui, T as xt, i as bt, j as pt } from "./locales-0_7hd40-.js";
12
+ import { u as B, C as yo, E as ko, l as F, B as Co, I as Tt, V as Gt, M as No, D as xn, a as To, b as Ao, c as Ii, d as bn, e as Lo, f as Ge, g as Ke, h as ui, T as xt, i as bt, j as pt } from "./locales-CjqAVVw_.js";
13
13
  import * as Z from "@radix-ui/react-select";
14
14
  import { Slot as mi } from "@radix-ui/react-slot";
15
15
  import fi, { sticky as So } from "tippy.js";
16
16
  import { flushSync as Xe } from "react-dom";
17
17
  import Mo from "react-image-crop";
18
- import { createSignal as zt, useSignalValue as Et } from "reactjs-signal";
19
18
  import * as Kt from "@radix-ui/react-checkbox";
20
19
  import gi from "scroll-into-view-if-needed";
21
20
  import * as Ie from "@radix-ui/react-tabs";
@@ -1261,9 +1260,9 @@ const Cc = "_wrap_5y04w_1", Nc = "_handlerWrap_5y04w_11", Tc = "_innerWrap_5y04w
1261
1260
  handlerWrap: Nc,
1262
1261
  innerWrap: Tc,
1263
1262
  emptyWrap: Ac
1264
- }, En = zt(!1);
1263
+ }, En = It(!1);
1265
1264
  function Dt() {
1266
- return Et(En);
1265
+ return zt(En);
1267
1266
  }
1268
1267
  const Lc = {
1269
1268
  setDisable: (e) => {
@@ -2232,9 +2231,9 @@ video {
2232
2231
  height: auto
2233
2232
  }
2234
2233
  }
2235
- `, Dn = zt("light");
2234
+ `, Dn = It("light");
2236
2235
  function Xc() {
2237
- return Et(Dn);
2236
+ return zt(Dn);
2238
2237
  }
2239
2238
  const Zc = {
2240
2239
  setTheme: (e) => {
@@ -2373,7 +2372,7 @@ function rs(e, t) {
2373
2372
  !(e != null && e.hideBubble) && /* @__PURE__ */ r(qc, { bubbleMenu: e == null ? void 0 : e.bubbleMenu, editor: s, disabled: e == null ? void 0 : e.disabled })
2374
2373
  ] }) }) }) }) : /* @__PURE__ */ r(W, {});
2375
2374
  }
2376
- const iu = Lt(rs);
2375
+ const tu = Lt(rs);
2377
2376
  function as({ editor: e, disabled: t }) {
2378
2377
  const { t: i, lang: n } = B(), a = P(() => {
2379
2378
  const c = [...e.extensionManager.extensions].sort((l, d) => {
@@ -2921,7 +2920,7 @@ function Is(e) {
2921
2920
  icon: "Trash2",
2922
2921
  action: () => {
2923
2922
  const { state: t, dispatch: i } = e.view;
2924
- It(t, i);
2923
+ Et(t, i);
2925
2924
  }
2926
2925
  }
2927
2926
  }
@@ -2940,7 +2939,7 @@ function zs(e) {
2940
2939
  icon: "Trash2",
2941
2940
  action: () => {
2942
2941
  const { state: t, dispatch: i } = e.view;
2943
- It(t, i);
2942
+ Et(t, i);
2944
2943
  }
2945
2944
  }
2946
2945
  }
@@ -2969,7 +2968,7 @@ function Es(e) {
2969
2968
  icon: "Trash2",
2970
2969
  action: () => {
2971
2970
  const { state: t, dispatch: i } = e.view;
2972
- It(t, i);
2971
+ Et(t, i);
2973
2972
  }
2974
2973
  }
2975
2974
  }
@@ -2987,7 +2986,7 @@ function Hs(e) {
2987
2986
  icon: "Trash2",
2988
2987
  action: () => {
2989
2988
  const { state: t, dispatch: i } = e.view;
2990
- It(t, i);
2989
+ Et(t, i);
2991
2990
  }
2992
2991
  }
2993
2992
  }
@@ -3872,7 +3871,7 @@ function Js({ editor: e }) {
3872
3871
  }
3873
3872
  );
3874
3873
  }
3875
- const nu = Ma.extend({
3874
+ const iu = Ma.extend({
3876
3875
  addOptions() {
3877
3876
  var e;
3878
3877
  return {
@@ -3890,7 +3889,7 @@ const nu = Ma.extend({
3890
3889
  })
3891
3890
  };
3892
3891
  }
3893
- }), ru = Ia.extend({
3892
+ }), nu = Ia.extend({
3894
3893
  addOptions() {
3895
3894
  var e;
3896
3895
  return {
@@ -3910,7 +3909,7 @@ const nu = Ma.extend({
3910
3909
  }
3911
3910
  };
3912
3911
  }
3913
- }), au = za.extend({
3912
+ }), ru = za.extend({
3914
3913
  addOptions() {
3915
3914
  var e;
3916
3915
  return {
@@ -3930,7 +3929,7 @@ const nu = Ma.extend({
3930
3929
  }
3931
3930
  };
3932
3931
  }
3933
- }), ou = Ea.extend({
3932
+ }), au = Ea.extend({
3934
3933
  addOptions() {
3935
3934
  var e;
3936
3935
  return {
@@ -3948,7 +3947,7 @@ const nu = Ma.extend({
3948
3947
  })
3949
3948
  };
3950
3949
  }
3951
- }), cu = Ha.extend({
3950
+ }), ou = Ha.extend({
3952
3951
  addOptions() {
3953
3952
  var e;
3954
3953
  return {
@@ -4284,7 +4283,7 @@ function gl(e) {
4284
4283
  }) })
4285
4284
  ] });
4286
4285
  }
4287
- const su = Pa.extend({
4286
+ const cu = Pa.extend({
4288
4287
  addOptions() {
4289
4288
  var e;
4290
4289
  return {
@@ -4366,7 +4365,7 @@ function xl(e) {
4366
4365
  }) })
4367
4366
  ] });
4368
4367
  }
4369
- const lu = Da.extend({
4368
+ const su = Da.extend({
4370
4369
  addOptions() {
4371
4370
  var e;
4372
4371
  return {
@@ -4461,7 +4460,7 @@ function bl(e) {
4461
4460
  )
4462
4461
  ] });
4463
4462
  }
4464
- const du = Ba.extend({
4463
+ const lu = Ba.extend({
4465
4464
  addOptions() {
4466
4465
  var e;
4467
4466
  return {
@@ -4540,7 +4539,7 @@ function pl(e) {
4540
4539
  )) })
4541
4540
  ] });
4542
4541
  }
4543
- const hu = Y.create({
4542
+ const du = Y.create({
4544
4543
  name: "fontSize",
4545
4544
  addOptions() {
4546
4545
  var e;
@@ -4676,7 +4675,7 @@ function _l(e) {
4676
4675
  )
4677
4676
  ] });
4678
4677
  }
4679
- const uu = $a.extend({
4678
+ const hu = $a.extend({
4680
4679
  addOptions() {
4681
4680
  var e;
4682
4681
  return {
@@ -4702,7 +4701,7 @@ const uu = $a.extend({
4702
4701
  }
4703
4702
  };
4704
4703
  }
4705
- }), mu = Va.extend({
4704
+ }), uu = Va.extend({
4706
4705
  addOptions() {
4707
4706
  var e;
4708
4707
  return {
@@ -4723,7 +4722,7 @@ const uu = $a.extend({
4723
4722
  })
4724
4723
  };
4725
4724
  }
4726
- }), fu = ja.extend({
4725
+ }), mu = ja.extend({
4727
4726
  addOptions() {
4728
4727
  var e;
4729
4728
  return {
@@ -4741,7 +4740,7 @@ const uu = $a.extend({
4741
4740
  })
4742
4741
  };
4743
4742
  }
4744
- }), gu = ue.create({
4743
+ }), fu = ue.create({
4745
4744
  name: "clear",
4746
4745
  addOptions() {
4747
4746
  var e;
@@ -4758,7 +4757,7 @@ const uu = $a.extend({
4758
4757
  })
4759
4758
  };
4760
4759
  }
4761
- }), xu = Fa.extend({
4760
+ }), gu = Fa.extend({
4762
4761
  addOptions() {
4763
4762
  var e;
4764
4763
  return {
@@ -4776,7 +4775,7 @@ const uu = $a.extend({
4776
4775
  })
4777
4776
  };
4778
4777
  }
4779
- }), bu = Ua.extend({
4778
+ }), xu = Ua.extend({
4780
4779
  addOptions() {
4781
4780
  var e;
4782
4781
  return {
@@ -4805,7 +4804,7 @@ const uu = $a.extend({
4805
4804
  addExtensions() {
4806
4805
  return [Wa.configure(this.options.taskItem)];
4807
4806
  }
4808
- }), pu = qa.extend({
4807
+ }), bu = qa.extend({
4809
4808
  addOptions() {
4810
4809
  var e;
4811
4810
  return {
@@ -4845,7 +4844,7 @@ function vl(e) {
4845
4844
  /* @__PURE__ */ r(re, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Gn, { editor: e.editor, onSetLink: n }) })
4846
4845
  ] });
4847
4846
  }
4848
- const wu = Ga.extend({
4847
+ const pu = Ga.extend({
4849
4848
  inclusive: !1,
4850
4849
  parseHTML() {
4851
4850
  return [
@@ -4912,7 +4911,7 @@ const wu = Ga.extend({
4912
4911
  })
4913
4912
  ];
4914
4913
  }
4915
- }), _u = Xa.extend({
4914
+ }), wu = Xa.extend({
4916
4915
  renderHTML() {
4917
4916
  return [
4918
4917
  "div",
@@ -4980,7 +4979,7 @@ function yl(e) {
4980
4979
  ] }) })
4981
4980
  ] });
4982
4981
  }
4983
- const kl = ["undo", "redo"], vu = Za.extend({
4982
+ const kl = ["undo", "redo"], _u = Za.extend({
4984
4983
  addOptions() {
4985
4984
  var e;
4986
4985
  return {
@@ -5167,7 +5166,7 @@ const Ll = 200, lt = ue.create({
5167
5166
  renderHTML({ HTMLAttributes: e }) {
5168
5167
  return ["div", ne(this.options.HTMLAttributes, e), 0];
5169
5168
  }
5170
- }), yu = Y.create({
5169
+ }), vu = Y.create({
5171
5170
  name: "columnActionButton",
5172
5171
  addOptions() {
5173
5172
  var e;
@@ -5353,7 +5352,7 @@ const zl = Y.create({
5353
5352
  })
5354
5353
  ];
5355
5354
  }
5356
- }), ku = Y.create({
5355
+ }), yu = Y.create({
5357
5356
  name: "base-kit",
5358
5357
  addExtensions() {
5359
5358
  const e = [];
@@ -5378,7 +5377,7 @@ const zl = Y.create({
5378
5377
  })
5379
5378
  ), this.options.characterCount !== !1 && e.push(no.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(ro.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(ao.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(oo.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(co.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(zl.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(Sl), this.options.multiColumn !== !1 && (e.push(Ni), e.push(lt)), e;
5380
5379
  }
5381
- }), Cu = Y.create({
5380
+ }), ku = Y.create({
5382
5381
  name: "subAndSuperScript",
5383
5382
  addOptions() {
5384
5383
  var e;
@@ -5454,7 +5453,7 @@ function El(e) {
5454
5453
  )) })
5455
5454
  ] });
5456
5455
  }
5457
- const Nu = Y.create({
5456
+ const Cu = Y.create({
5458
5457
  name: "moreMark",
5459
5458
  addOptions() {
5460
5459
  var e;
@@ -5492,7 +5491,7 @@ const Nu = Y.create({
5492
5491
  const e = [];
5493
5492
  return this.options.subscript !== !1 && e.push(sn.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(ln.configure(this.options.superscript)), e;
5494
5493
  }
5495
- }), Tu = Y.create({
5494
+ }), Nu = Y.create({
5496
5495
  name: "indent",
5497
5496
  addOptions() {
5498
5497
  var e;
@@ -5639,7 +5638,7 @@ function Dl(e) {
5639
5638
  return a = a.setSelection(n), a = Pl(a, e), a.docChanged ? (i && i(a), !0) : !1;
5640
5639
  };
5641
5640
  }
5642
- const Au = Y.create({
5641
+ const Tu = Y.create({
5643
5642
  name: "lineHeight",
5644
5643
  addOptions() {
5645
5644
  var e;
@@ -5679,17 +5678,17 @@ const Au = Y.create({
5679
5678
  unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
5680
5679
  };
5681
5680
  }
5682
- }), Zn = zt(!1);
5681
+ }), Zn = It(!1);
5683
5682
  function Bl() {
5684
- return Et(Zn);
5683
+ return zt(Zn);
5685
5684
  }
5686
5685
  const Ve = {
5687
5686
  setOpen: (e) => {
5688
5687
  Zn.set(e);
5689
5688
  }
5690
- }, Yn = zt(!1);
5689
+ }, Yn = It(!1);
5691
5690
  function $l() {
5692
- return Et(Yn);
5691
+ return zt(Yn);
5693
5692
  }
5694
5693
  const ot = {
5695
5694
  setOpen: (e) => {
@@ -5888,7 +5887,7 @@ function jl(e, t) {
5888
5887
  }
5889
5888
  const Fl = Lt(jl), Ae = "slashCommand";
5890
5889
  let q;
5891
- const Lu = Y.create({
5890
+ const Au = Y.create({
5892
5891
  name: Ae,
5893
5892
  priority: 200,
5894
5893
  onCreate() {
@@ -6994,7 +6993,7 @@ function ud(e) {
6994
6993
  }
6995
6994
  ) });
6996
6995
  }
6997
- const Su = so.extend({
6996
+ const Lu = so.extend({
6998
6997
  addOptions() {
6999
6998
  var e;
7000
6999
  return {
@@ -7021,7 +7020,7 @@ const Su = so.extend({
7021
7020
  cd.configure(this.options.tableCellBackground)
7022
7021
  ];
7023
7022
  }
7024
- }), Mu = Y.create({
7023
+ }), Su = Y.create({
7025
7024
  name: "painter",
7026
7025
  addOptions() {
7027
7026
  var e;
@@ -11375,7 +11374,7 @@ function jd({ editor: e, icon: t, ...i }) {
11375
11374
  }
11376
11375
  ) });
11377
11376
  }
11378
- const Fd = 200, Ud = new _e("emoji"), Iu = ue.create({
11377
+ const Fd = 200, Ud = new _e("emoji"), Mu = ue.create({
11379
11378
  name: "emoji",
11380
11379
  content: "text*",
11381
11380
  priority: Fd,
@@ -11652,7 +11651,7 @@ function Zd(e) {
11652
11651
  const t = e.getHTML();
11653
11652
  return t ? (Xd(t), !0) : !1;
11654
11653
  }
11655
- const zu = Y.create({
11654
+ const Iu = Y.create({
11656
11655
  name: "exportPdf",
11657
11656
  addOptions() {
11658
11657
  var e;
@@ -11768,7 +11767,7 @@ function Qd(e) {
11768
11767
  )
11769
11768
  ] });
11770
11769
  }
11771
- const Eu = Y.create({
11770
+ const zu = Y.create({
11772
11771
  name: "importWord",
11773
11772
  addOptions() {
11774
11773
  var e;
@@ -11812,7 +11811,7 @@ const ih = {
11812
11811
  image(e, t) {
11813
11812
  e.renderInline(t), e.closeBlock(t);
11814
11813
  }
11815
- }, nh = new Io(ih, zo), Hu = Y.create({
11814
+ }, nh = new Io(ih, zo), Eu = Y.create({
11816
11815
  name: "exportWord",
11817
11816
  addOptions() {
11818
11817
  var e;
@@ -12072,7 +12071,7 @@ function gh(e) {
12072
12071
  )
12073
12072
  ] });
12074
12073
  }
12075
- const Ru = Y.create({
12074
+ const Hu = Y.create({
12076
12075
  name: "text-direction",
12077
12076
  addOptions() {
12078
12077
  var e;
@@ -12219,7 +12218,7 @@ const Ru = Y.create({
12219
12218
  }
12220
12219
  };
12221
12220
  }
12222
- }, Ou = mo.extend({
12221
+ }, Ru = mo.extend({
12223
12222
  addAttributes() {
12224
12223
  return {
12225
12224
  id: {
@@ -12329,7 +12328,7 @@ function Th({ editor: e, node: t, updateAttributes: i, deleteNode: n, extension:
12329
12328
  )
12330
12329
  ] }) }) : g !== "null" ? /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ r("div", { className: ee(qt.wrap, "render-wrapper"), onClick: v, children: /* @__PURE__ */ r("p", { children: g }) }) }) : /* @__PURE__ */ r(W, {});
12331
12330
  }
12332
- const Pu = ue.create({
12331
+ const Ou = ue.create({
12333
12332
  name: "attachment",
12334
12333
  content: "",
12335
12334
  marks: "",
@@ -13116,54 +13115,54 @@ const en = si.extend({
13116
13115
  }
13117
13116
  });
13118
13117
  export {
13119
- Hu as A,
13120
- nu as B,
13121
- cu as C,
13118
+ Eu as A,
13119
+ iu as B,
13120
+ ou as C,
13122
13121
  fh as D,
13123
- Iu as E,
13124
- su as F,
13122
+ Mu as E,
13123
+ cu as F,
13125
13124
  Be as G,
13126
- lu as H,
13127
- ru as I,
13128
- Ru as J,
13125
+ su as H,
13126
+ nu as I,
13127
+ Hu as J,
13129
13128
  je as K,
13130
- wu as L,
13131
- Nu as M,
13132
- Ou as N,
13133
- xu as O,
13134
- Pu as P,
13129
+ pu as L,
13130
+ Cu as M,
13131
+ Ru as N,
13132
+ gu as O,
13133
+ Ou as P,
13135
13134
  er as Q,
13136
- iu as R,
13137
- ou as S,
13138
- du as T,
13139
- au as U,
13135
+ tu as R,
13136
+ au as S,
13137
+ lu as T,
13138
+ ru as U,
13140
13139
  rd as V,
13141
13140
  en as W,
13142
13141
  ti as X,
13143
13142
  fl as a,
13144
- hu as b,
13145
- uu as c,
13146
- mu as d,
13147
- fu as e,
13148
- gu as f,
13149
- bu as g,
13150
- pu as h,
13151
- _u as i,
13152
- vu as j,
13153
- ku as k,
13154
- Cu as l,
13143
+ du as b,
13144
+ hu as c,
13145
+ uu as d,
13146
+ mu as e,
13147
+ fu as f,
13148
+ xu as g,
13149
+ bu as h,
13150
+ wu as i,
13151
+ _u as j,
13152
+ yu as k,
13153
+ ku as l,
13155
13154
  Jo as m,
13156
- Tu as n,
13157
- Au as o,
13158
- Lu as p,
13155
+ Nu as n,
13156
+ Tu as o,
13157
+ Au as p,
13159
13158
  ed as q,
13160
- Su as r,
13161
- Mu as s,
13159
+ Lu as r,
13160
+ Su as s,
13162
13161
  Ni as t,
13163
13162
  lt as u,
13164
- yu as v,
13163
+ vu as v,
13165
13164
  $e as w,
13166
13165
  pd as x,
13167
- zu as y,
13168
- Eu as z
13166
+ Iu as y,
13167
+ zu as z
13169
13168
  };