PageSourceSearch

https://www.intramed.net/_next/static/chunks/87f50a01-dcd59c8d48de3c6f.js

js intramed.net collected 2026-10-01 11:44:03 UTC 115,047 bytes, 82 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4599],{34044:(e,t,n)=>{var r=n(64763),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},d={};function c(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=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 i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}l(d,{CommandManager:()=>u,DECORATION_MANAGER_PLUGIN_KEY:()=>nj,Decoration:()=>ii,DecorationManager:()=>n8,Editor:()=>it,Extendable:()=>rA,Extension:()=>rH,Fragment:()=>ig,InlineDecoration:()=>io,InputRule:()=>rO,MappablePosition:()=>t8,Mark:()=>rN,MarkView:()=>rS,Node:()=>iw,NodeDecoration:()=>is,NodePos:()=>r7,NodeView:()=>ix,PasteRule:()=>r$,ResizableNodeView:()=>iv,ResizableNodeview:()=>ib,Tracker:()=>iT,WidgetDecoration:()=>ia,attrsEqual:()=>n5,callOrReturn:()=>tr,canInsertNode:()=>re,combineTransactionSteps:()=>e1,commands:()=>p,createAtomBlockMarkdownSpec:()=>rh,createBlockMarkdownSpec:()=>rf,createChainableState:()=>c,createDocument:()=>eG,createElement:()=>iy,createInlineMarkdownSpec:()=>ry,createMappablePosition:()=>t7,createNodeFromContent:()=>er,createStyleTag:()=>rt,createWidgetDecoration:()=>il,decodeHtmlEntities:()=>ri,defaultBlockAt:()=>ed,deleteProps:()=>ez,elementFromString:()=>et,encodeHtmlEntities:()=>ro,escapeForRegEx:()=>rn,extensions:()=>rB,findChildren:()=>e4,findChildrenInRange:()=>e3,findDuplicates:()=>tm,findParentNode:()=>e2,findParentNodeClosestToPos:()=>e6,flattenExtensions:()=>e8,fromString:()=>tc,generateHTML:()=>tb,generateJSON:()=>tk,generateText:()=>tT,getAttributes:()=>tP,getAttributesFromExtensions:()=>ts,getChangedRanges:()=>tA,getDebugJSON:()=>function e(t,n=0){let r=+(t.type!==t.type.schema.topNodeType),i=n+t.nodeSize,o=t.marks.map(e=>{let t={type:e.type.name};return Object.keys(e.attrs).length&&(t.attrs={...e.attrs}),t}),s={...t.attrs},a={type:t.type.name,from:n,to:i};return Object.keys(s).length&&(a.attrs=s),o.length&&(a.marks=o),t.content.childCount&&(a.content=[],t.forEach((t,i)=>{var o;null==(o=a.content)||o.push(e(t,n+i+r))})),t.text&&(a.text=t.text),a},getExtensionField:()=>e9,getHTMLFromFragment:()=>te,getMarkAttributes:()=>eZ,getMarkRange:()=>I,getMarkType:()=>B,getMarksBetween:()=>tN,getNodeAtPosition:()=>tR,getNodeAttributes:()=>tO,getNodeType:()=>M,getPreviousBlockSibling:()=>tD,getRenderedAttributes:()=>td,getSchema:()=>tv,getSchemaByResolvedExtensions:()=>tf,getSchemaTypeByName:()=>t$,getSchemaTypeNameByName:()=>ej,getSplittedAttributes:()=>tj,getStyleProperty:()=>rr,getText:()=>tS,getTextBetween:()=>tM,getTextContentFromNodes:()=>tz,getTextSerializersFromSchema:()=>tE,getUpdatedPosition:()=>t5,h:()=>iy,injectExtensionAttributesToParseRule:()=>tu,inputRulesPlugin:()=>rC,isActive:()=>tB,isAndroid:()=>_,isAtEndOfNode:()=>tL,isAtStartOfNode:()=>tH,isEmptyObject:()=>ti,isExtensionRulesEnabled:()=>tF,isFirefox:()=>rs,isFunction:()=>tn,isList:()=>tW,isMacOS:()=>eS,isMarkActive:()=>tI,isNodeActive:()=>eO,isNodeEmpty:()=>tV,isNodeSelection:()=>tU,isNodeViewSelected:()=>t_,isNumber:()=>ra,isPlainObject:()=>rl,isProseMirrorAddMarkStep:()=>tq,isProseMirrorAddNodeMarkStep:()=>tX,isProseMirrorAttrStep:()=>tY,isProseMirrorCellSelection:()=>tG,isProseMirrorDocAttrStep:()=>tQ,isProseMirrorFragment:()=>tZ,isProseMirrorNodeSelection:()=>t0,isProseMirrorRemoveMarkStep:()=>t1,isProseMirrorRemoveNodeMarkStep:()=>t4,isProseMirrorReplaceAroundStep:()=>t3,isProseMirrorReplaceStep:()=>t6,isProseMirrorSlice:()=>t2,isProseMirrorStep:()=>tJ,isProseMirrorStepResult:()=>t9,isRegExp:()=>D,isSafari:()=>q,isString:()=>rd,isTextSelection:()=>W,isiOS:()=>J,liveWidgetKeys:()=>n9,markInputRule:()=>id,markPasteRule:()=>iM,markdown:()=>rc,marksEqual:()=>rk,mergeAttributes:()=>tl,mergeDeep:()=>rx,minMax:()=>K,nodeInputRule:()=>ic,nodePasteRule:()=>iS,objectIncludes:()=>$,parseAttributes:()=>ru,parseIndentedBlocks:()=>rv,pasteRulesPlugin:()=>rz,posToDOMRect:()=>ne,removeDuplicates:()=>tC,renderNestedMarkdownContent:()=>rb,resolveExtensions:()=>ty,resolveFocusPosition:()=>U,rewriteUnknownContent:()=>nt,selectionToInsertionEnd:()=>
1ea,serializeAttributes:()=>rp,sortExtensions:()=>tg,splitExtensions:()=>to,textInputRule:()=>ip,textPasteRule:()=>iE,textblockTypeInputRule:()=>iu,updateMarkViewAttributes:()=>rM,wrappingInputRule:()=>im}),e.exports=((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))a.call(e,l)||l===n||i(e,l,{get:()=>t[l],enumerable:!(r=o(t,l))||r.enumerable});return e})(i({},"__esModule",{value:!0}),d);var u=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,d=()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),i=n(...e)(r);return s.push(i),c}])),run:d};return c}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if("then"!==n)return"run"===n?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if("then"!==t)return"chain"===t?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:c({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},p={};l(p,{blur:()=>h,clearContent:()=>f,clearNodes:()=>g,command:()=>y,createParagraphNear:()=>b,cut:()=>k,deleteCurrentNode:()=>x,deleteNode:()=>S,deleteRange:()=>E,deleteSelection:()=>P,enter:()=>C,exitCode:()=>N,extendMarkRange:()=>L,first:()=>H,focus:()=>X,forEach:()=>Y,insertContent:()=>G,insertContentAt:()=>el,insertDefaultBlock:()=>ec,joinBackward:()=>ef,joinDown:()=>eh,joinForward:()=>em,joinItemBackward:()=>ey,joinItemForward:()=>eb,joinTextblockBackward:()=>ek,joinTextblockForward:()=>eM,joinUp:()=>ep,keyboardShortcut:()=>eE,lift:()=>eP,liftEmptyBlock:()=>eA,liftListItem:()=>eR,newlineInCode:()=>e$,resetAttributes:()=>eI,scrollIntoView:()=>eB,selectAll:()=>eH,selectNodeBackward:()=>eW,selectNodeForward:()=>eK,selectParentNode:()=>e_,selectTextblockEnd:()=>eq,selectTextblockStart:()=>eY,setContent:()=>eQ,setMark:()=>nn,setMeta:()=>nr,setNode:()=>no,setNodeSelection:()=>na,setTextDirection:()=>nl,setTextSelection:()=>nc,sinkListItem:()=>np,splitBlock:()=>ng,splitListItem:()=>nw,toggleList:()=>nT,toggleMark:()=>nO,toggleNode:()=>nP,toggleWrap:()=>nC,undoInputRule:()=>nA,unsetAllMarks:()=>nN,unsetMark:()=>nR,unsetTextDirection:()=>nD,updateAttributes:()=>n$,updateDecorations:()=>nz,wrapIn:()=>nB,wrapInList:()=>nH});var h=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),f=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),m=n(40212),g=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),a=o.blockRange(s);if(!a)return;let l=(0,m.liftTarget)(a);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(a.start,e)}(l||0===l)&&t.lift(a,l)})}),!0)},y=e=>t=>e(t),v=n(13866),b=()=>({state:e,dispatch:t})=>(0,v.createParagraphNear)(e,t),w=n(41439),k=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new w.TextSelection(r.doc.resolve(Math.max(s-1,0)))),!0},x=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function M(e,t){if("string"==typeof e){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}var S=e=>({tr:t,state:n,dispatch:r})=>{let i=M(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},E=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},T=n(41439),O=(e,t,n)=>!e.parent.isInline||"left"===n&&e.pos>
1e.start()||"right"===n&&e.pos<e.end()||!(e=>!!e.content&&/^text(\*|\+)/.test(e.content))(t.nodes[e.parent.type.name].spec)?e.pos:"left"===n?e.start()-1:e.end()+1,P=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:o,to:s}=((e,t,n)=>({from:O(e,n,"left"),to:O(t,n,"right")}))(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(o,s)}),n.selection.empty||n.setSelection(T.TextSelection.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},C=()=>({commands:e})=>e.keyboardShortcut("Enter"),A=n(13866),N=()=>({state:e,dispatch:t})=>(0,A.exitCode)(e,t),R=n(41439);function D(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function $(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:D(t[r])?t[r].test(e[r]):t[r]===e[r])}function j(e,t,n={}){return e.find(e=>e.type===t&&$(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function z(e,t,n={}){return!!j(e,t,n)}function I(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!j([...r.node.marks],t,n))return;let i=r.index,o=e.start()+r.offset,s=i+1,a=o+r.node.nodeSize;for(;i>0&&z([...e.parent.child(i-1).marks],t,n);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&z([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:a}}function B(e,t){if("string"==typeof e){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}var L=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=B(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:d,to:c}=a;if(i){let e=I(l,o,t);if(e&&e.from<=d&&e.to>=c){let t=R.TextSelection.create(s,e.from,e.to);n.setSelection(t)}}return!0},H=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},F=n(41439);function W(e){return e instanceof F.TextSelection}var V=n(41439);function K(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function U(e,t=null){if(!t)return null;let n=V.Selection.atStart(e),r=V.Selection.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?V.TextSelection.create(e,K(0,i,o),K(e.content.size,i,o)):V.TextSelection.create(e,K(t,i,o),K(t,i,o))}function _(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function J(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function q(){return"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var X=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(J()||_())&&r.dom.focus(),!q()||J()||_()||r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!W(n.state.selection))return s(),!0;let a=U(i.doc,e)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Y=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),G=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Q=n(56631),Z=n(56631),ee=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&ee(r)}return e};function et(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return ee(new window.DOMParser().parseFromString(t,"text/html").body)}function en(e){return"function"==typeof(null==e?void 0:e.nodesBetween)}function er(e,t,n){if(en(e))return e;let r="object"==typeof e&&null!==e;n={slice:!0,parseOptions:{},...n};let i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return Z.Fragment.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),er("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new Z.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:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?Z.DOMParser.fromSchema(o).parseSlice(et(e),n.parseOptions):Z.DOMParser.fromSchema(o).parse(et(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=Z.DOMParser.fromSchema(t);return n.slice?r.parseSlice(et(e),n.parseOptions).content:r.parse(et(e),n.parseOptions)}return er("",t,n)}function ei(e){return!("type"in e)}var eo=n(41439),es=n(40212);function ea(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof es.ReplaceStep||i instanceof es.ReplaceAroundStep))return;let o=e.mapping.maps[r],s=0;o.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(eo.Selection.near(e.doc.resolve(s),n))}
1var el=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){let i,a;n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{"collaboration"in o.storage&&"object"==typeof o.storage.collaboration&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{er(t,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(e){l(e)}try{i=er(t,o.schema,{parseOptions:d,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:o.options.enableContentCheck})}catch(e){return l(e),!1}let{from:c,to:u}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},p=!0,h=!0,f=ei(i)?i.content:[i];if(f.forEach(e=>{e.check(),p=!!p&&e.isText&&0===e.marks.length,h=!!h&&e.isBlock}),c===u&&h){let{parent:e}=r.doc.resolve(c);!e.isTextblock||e.type.spec.code||e.childCount||(c-=1,u+=1)}if(p)a=Array.isArray(t)?t.map(e=>e.text||"").join(""):en(t)?f.map(e=>{var t;return null!=(t=e.text)?t:""}).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(a,c,u);else{a=Q.Fragment.from(f);let e=r.doc.resolve(c),t=e.node(),n=0===e.parentOffset,i=t.isText||t.isTextblock,o=t.content.size>0;n&&i&&o&&h&&(c=Math.max(0,c-1)),r.replaceWith(c,u,f)}n.updateSelection&&ea(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:a}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:a})}return!0};function ed(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ec=(e={})=>({tr:t,dispatch:n,editor:r})=>{let i,o,{pos:s,attrs:a,content:l,updateSelection:d=!0}=e,c=ed((i="number"==typeof s?t.doc.resolve(s):s||t.selection.$from).parent.contentMatchAt(i.index()));if(!c)return!1;let u=Object.keys(c.spec.attrs||{}),p=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{};if(l){let e=er(l,r.schema);o=c.createAndFill(p,e)}else o=c.createAndFill(p);return!!o&&(n&&(t.insert(i.pos,o),d&&ea(t,t.steps.length-1,-1)),!0)},eu=n(13866),ep=()=>({state:e,dispatch:t})=>(0,eu.joinUp)(e,t),eh=()=>({state:e,dispatch:t})=>(0,eu.joinDown)(e,t),ef=()=>({state:e,dispatch:t})=>(0,eu.joinBackward)(e,t),em=()=>({state:e,dispatch:t})=>(0,eu.joinForward)(e,t),eg=n(40212),ey=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,eg.joinPoint)(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},ev=n(40212),eb=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,ev.joinPoint)(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},ew=n(13866),ek=()=>({state:e,dispatch:t})=>(0,ew.joinTextblockBackward)(e,t),ex=n(13866),eM=()=>({state:e,dispatch:t})=>(0,ex.joinTextblockForward)(e,t);function eS(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var eE=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))J()||eS()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,a))});return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},eT=n(13866);function eO(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?M(t,e.schema):null,a=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);a.push({node:e,from:n,to:o})});let l=i-r,d=a.filter(e=>
1!s||s.name===e.node.type.name).filter(e=>$(e.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=l}var eP=(e,t={})=>({state:n,dispatch:r})=>{let i=M(e,n.schema);return!!eO(n,i,t)&&(0,eT.lift)(n,r)},eC=n(13866),eA=()=>({state:e,dispatch:t})=>(0,eC.liftEmptyBlock)(e,t),eN=n(98274),eR=e=>({state:t,dispatch:n})=>{let r=M(e,t.schema);return(0,eN.liftListItem)(r)(t,n)},eD=n(13866),e$=()=>({state:e,dispatch:t})=>(0,eD.newlineInCode)(e,t);function ej(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ez(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var eI=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=ej("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(o=M(e,r.schema)),"mark"===a&&(s=B(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,ez(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(l=!0,i&&n.addMark(r,r+e.nodeSize,s.create(ez(o.attrs,t))))})})}),l},eB=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),eL=n(41439),eH=()=>({tr:e,dispatch:t})=>{if(t){let t=new eL.AllSelection(e.doc);e.setSelection(t)}return!0},eF=n(13866),eW=()=>({state:e,dispatch:t})=>(0,eF.selectNodeBackward)(e,t),eV=n(13866),eK=()=>({state:e,dispatch:t})=>(0,eV.selectNodeForward)(e,t),eU=n(13866),e_=()=>({state:e,dispatch:t})=>(0,eU.selectParentNode)(e,t),eJ=n(13866),eq=()=>({state:e,dispatch:t})=>(0,eJ.selectTextblockEnd)(e,t),eX=n(13866),eY=()=>({state:e,dispatch:t})=>(0,eX.selectTextblockStart)(e,t);function eG(e,t,n={},r={}){return er(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var eQ=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:a})=>{let{doc:l}=o;if("full"!==r.preserveWhitespace){let a=eG(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});if(s){let e=ei(a)?a.content:[a];o.replaceWith(0,l.content.size,e).setMeta("preventUpdate",!n)}return!0}return s&&o.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function eZ(e,t){let n=B(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let a=s.find(e=>e.type.name===n.name);return a?{...a.attrs}:{}}var e0=n(40212);function e1(e,t){let n=new e0.Transform(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function e4(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function e3(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function e6(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function e2(e){return t=>e6(t.$from,e)}function e9(e,t,n){return void 0===e.config[t]&&e.parent?e9(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?e9(e.parent,t,n):null}):e.config[t]}function e8(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=e9(e,"addExtensions",t);return n?[e,...e8(n())]:e}).flat(10)}var e5=n(56631),e7=n(56631);function te(e,t){let n=e7.DOMSerializer.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}var tt=n(56631);function tn(e){return"function"==typeof e}function tr(e,t,...n){return tn(e)?t?e.bind(t)(...n):e(...n):e}function ti(e={}){return 0===Object.keys(e).length&&e.constructor===Object}function to(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function ts(e){let t=[],{nodeExtensions:n,markExtensions:r}=to(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),a=r.map(e=>e.name),l=[...s,...a];
1return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=e9(e,"addGlobalAttributes",n);r&&r().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[]).forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=e9(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function ta(e){let t=[],n=function(e){let t=[],n="",r=!1,i=!1,o=0,s=e.length;for(let a=0;a<s;a+=1){let s=e[a];if("'"===s&&!i){r=!r,n+=s;continue}if('"'===s&&!r){i=!i,n+=s;continue}if(!r&&!i){if("("===s){o+=1,n+=s;continue}if(")"===s&&o>0){o-=1,n+=s;continue}if(";"===s&&0===o){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(":");if(-1===i)continue;let o=r.slice(0,i).trim(),s=r.slice(i+1).trim();o&&s&&t.push([o,s])}return t}function tl(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=new Map([...ta(n[e]),...ta(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function td(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>tl(e,t),{})}function tc(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}function tu(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):tc(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function tp(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&ti(t))&&null!=t))}function th(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function tf(e,t){var n;let r=ts(e),{nodeExtensions:i,markExtensions:o}=to(e),s=null==(n=i.find(e=>e9(e,"topNode")))?void 0:n.name,a=Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=tp({...e.reduce((e,t)=>{let r=e9(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:tr(e9(n,"content",o)),marks:tr(e9(n,"marks",o)),group:tr(e9(n,"group",o)),inline:tr(e9(n,"inline",o)),atom:tr(e9(n,"atom",o)),selectable:tr(e9(n,"selectable",o)),draggable:tr(e9(n,"draggable",o)),code:tr(e9(n,"code",o)),whitespace:tr(e9(n,"whitespace",o)),linebreakReplacement:tr(e9(n,"linebreakReplacement",o)),defining:tr(e9(n,"defining",o)),isolating:tr(e9(n,"isolating",o)),attrs:Object.fromEntries(i.map(th))}),a=tr(e9(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>tu(e,i)));let l=e9(n,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:td(e,i)}));let d=e9(n,"renderText",o);return d&&(s.toText=d),[n.name,s]})),l=Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=tp({...e.reduce((e,t)=>{let r=e9(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:tr(e9(n,"inclusive",o)),excludes:tr(e9(n,"excludes",o)),group:tr(e9(n,"group",o)),spanning:tr(e9(n,"spanning",o)),code:tr(e9(n,"code",o)),attrs:Object.fromEntries(i.map(th))}),a=tr(e9(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>tu(e,i)));let l=e9(n,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:td(e,i)})),[n.name,s]}));return new tt.Schema({topNode:s,nodes:a,marks:l})}
1function tm(e){return Array.from(new Set(e.filter((t,n)=>e.indexOf(t)!==n)))}function tg(e){return e.sort((e,t)=>{let n=e9(e,"priority")||100,r=e9(t,"priority")||100;return n>r?-1:+(n<r)})}function ty(e){let t=tg(e8(e)),n=tm(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}function tv(e,t){return tf(ty(e),t)}function tb(e,t){let n=tv(t);return te(e5.Node.fromJSON(n,e).content,n)}var tw=n(56631);function tk(e,t){let n=tv(t),r=et(e);return tw.DOMParser.fromSchema(n).parse(r).toJSON()}var tx=n(56631);function tM(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,i,(e,n,l,d)=>{var c;e.isBlock&&n>r&&(a+=o);let u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:d,range:t})),!1;e.isText&&(a+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,i-n))}),a}function tS(e,t){let n={from:0,to:e.content.size};return tM(e,n,t)}function tE(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function tT(e,t,n){let{blockSeparator:r="\n\n",textSerializers:i={}}=n||{},o=tv(t);return tS(tx.Node.fromJSON(o,e),{blockSeparator:r,textSerializers:{...tE(o),...i}})}function tO(e,t){let n=M(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function tP(e,t){let n=ej("string"==typeof t?t:t.name,e.schema);return"node"===n?tO(e,t):"mark"===n?eZ(e,t):{}}function tC(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}function tA(e){let{mapping:t,steps:n}=e,r=[];t.maps.forEach((e,i)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(void 0===e||void 0===t)return;o.push({from:e,to:t})}o.forEach(({from:e,to:n})=>{let o=t.slice(i).map(e,-1),s=t.slice(i).map(n),a=t.invert().map(o,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:o,to:s}})})});let i=tC(r);return 1===i.length?i:i.filter((e,t)=>!i.filter((e,n)=>n!==t).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function tN(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=I(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var tR=(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]},tD=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return 0===n?null:e.node(t).child(n-1)};function t$(e,t){return t.nodes[e]||t.marks[e]||null}function tj(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}var tz=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,a;let l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))}),n};function tI(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?B(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>$(e.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(o&&e.inlineContent&&!e.type.allowsMarkType(o))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),l=Math.min(i,t+e.nodeSize);s+=l-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:l})))})}),0===s)return!1;let l=a.filter(e=>!o||o.name===e.mark.type.name).filter(e=>$(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=a.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+d:l)>=s}function tB(e,t,n={}){if(!t)return eO(e,null,n)||tI(e,null,n);let r=ej(t,e.schema);return"node"===r?eO(e,t,n):"mark"===r&&tI(e,t,n)}var tL=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=e2(e=>
1e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},tH=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function tF(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function tW(e,t){let{nodeExtensions:n}=to(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=tr(e9(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function tV(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(tV(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}var tK=n(41439);function tU(e){return e instanceof tK.NodeSelection}function t_({selection:e,pos:t,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:i,to:o}=e;return!!(i<=t&&o>=t+n||r&&W(e)&&i>t&&o<t+n)}function tJ(e){return null!==e&&"object"==typeof e&&"function"==typeof e.apply&&"function"==typeof e.getMap&&"function"==typeof e.invert&&"function"==typeof e.map&&"function"==typeof e.merge&&"function"==typeof e.toJSON}function tq(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"addMark"===t.stepType}function tX(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"addNodeMark"===t.stepType}function tY(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"attr"===t.stepType}function tG(e){return null!==e&&"object"==typeof e&&"forEachCell"in e&&"function"==typeof e.forEachCell}function tQ(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"docAttr"===t.stepType}function tZ(e){return null!==e&&"object"==typeof e&&!!Array.isArray(e.content)&&"number"==typeof e.size&&"function"==typeof e.nodesBetween&&"function"==typeof e.descendants&&"function"==typeof e.textBetween&&"function"==typeof e.append&&"function"==typeof e.cut&&"function"==typeof e.eq&&"function"==typeof e.child&&"function"==typeof e.forEach&&!0}function t0(e){return null!==e&&"object"==typeof e&&"node"in e&&null!=e.node}function t1(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"removeMark"===t.stepType}function t4(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"removeNodeMark"===t.stepType}function t3(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"replaceAround"===t.stepType}function t6(e){if(null===e||"object"!=typeof e||!tJ(e))return!1;let t=e.toJSON();return null!==t&&"object"==typeof t&&"replace"===t.stepType}function t2(e){if(null===e||"object"!=typeof e)return!1;let t=Number.isInteger(e.openStart)&&e.openStart>=0,n=Number.isInteger(e.openEnd)&&e.openEnd>=0,r="number"==typeof e.size&&"function"==typeof e.eq&&"function"==typeof e.toJSON;if(!t||!n||!r)return!1;let i=e.content;return null!==i&&"object"==typeof i&&!!tZ(i)}function t9(e){if(null===e||"object"!=typeof e)return!1;let t=null!==e.doc&&"object"==typeof e.doc&&null===e.failed,n="string"==typeof e.failed&&null===e.doc;return!!t||!!n}var t8=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function t5(e,t){let n=t.mapping.mapResult(e.position);return{position:new t8(n.pos),mapResult:n}}function t7(e){return new t8(e)}function ne(e,t,n){let r=e.state.doc.content.size,i=K(t,0,r),o=K(n,0,r),s=e.coordsAtPos(i),a=e.coordsAtPos(o,-1),l=Math.min(s.top,a.top),d=Math.max(s.bottom,a.bottom),c=Math.min(s.left,a.left),u=Math.max(s.right,a.right),p={top:l,bottom:d,left:c,right:u,width:u-c,height:d-l,x:c,y:l};return{...p,toJSON:()=>p}}function nt(e,t,n){return function e({json:t,validMarks:n,validNodes:r,options:i,rewrittenContent:o=[]}){return(t.marks&&Array.isArray(t.marks)&&(t.marks=t.marks.filter(e=>{if(null==e)return!1;let t="string"==typeof e?e:e.type;return!!n.has(t)||(o.push({original:JSON.parse(JSON.stringify(e)),unsupported:t}),!1)})),t.content&&Array.isArray(t.content)&&(t.content=t.content.map(t=>null==t?null:e({json:t,validMarks:n,validNodes:r,options:i,rewrittenContent:o}).json).filter(e=>null!=e)),t.type&&!r.has(t.type))?(o.push({original:JSON.parse(JSON.stringify(t)),unsupported:t.type}),t.content&&Array.isArray(t.content)&&(null==i?void 0:i.fallbackToParagraph)!==!1)?(t.type="paragraph",{json:t,rewrittenContent:o}):{json:null,rewrittenContent:o}:{json:t,rewrittenContent:o}}
1({json:e,validNodes:new Set(Object.keys(t.nodes)),validMarks:new Set(Object.keys(t.marks)),options:n})}var nn=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:a}=o,l=B(e,r.schema);if(i)if(s){let e=eZ(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),a=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;if(W(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,l)},nr=(e,t)=>
1({tr:n})=>(n.setMeta(e,t),!0),ni=n(13866),no=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=M(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!(0,ni.setBlockType)(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>(0,ni.setBlockType)(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ns=n(41439),na=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=K(e,0,n.content.size),i=ns.NodeSelection.create(n,r);t.setSelection(i)}return!0},nl=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:a}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},nd=n(41439),nc=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=nd.TextSelection.atStart(n).from,s=nd.TextSelection.atEnd(n).to,a=K(r,o,s),l=K(i,o,s),d=nd.TextSelection.create(n,a,l);t.setSelection(d)}return!0},nu=n(98274),np=e=>({state:t,dispatch:n})=>{let r=M(e,t.schema);return(0,nu.sinkListItem)(r)(t,n)},nh=n(41439),nf=n(40212);function nm(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var ng=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:a,$to:l}=o,d=tj(i.extensionManager.attributes,a.node().type.name,a.node().attrs);if(o instanceof nh.NodeSelection&&o.node.isBlock)return!!a.parentOffset&&!!(0,nf.canSplit)(s,a.pos)&&(r&&(e&&nm(n,i.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let c=l.parentOffset===l.parent.content.size,u=0===a.depth?void 0:ed(a.node(-1).contentMatchAt(a.indexAfter(-1))),p=c&&u?[{type:u,attrs:d}]:void 0,h=(0,nf.canSplit)(t.doc,t.mapping.map(a.pos),1,p);if(!p&&!h&&(0,nf.canSplit)(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)&&(h=!0,p=u?[{type:u,attrs:d}]:void 0),r){if(h&&(o instanceof nh.TextSelection&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,p),u&&!c&&!a.parentOffset&&a.parent.type!==u)){let e=t.mapping.map(a.before()),n=t.doc.resolve(e);a.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}e&&nm(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},ny=n(56631),nv=n(41439),nb=n(40212),nw=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;let a=M(e,r.schema),{$from:l,$to:d}=r.selection,c=r.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(d))return!1;let u=l.node(-1);if(u.type!==a)return!1;let p=o.extensionManager.attributes;if(0===l.parent.content.size&&l.node(-1).childCount===l.indexAfter(-1)){if(2===l.depth||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let e=ny.Fragment.empty,r=l.index(-1)?1:l.index(-2)?2:3;for(let t=l.depth-r;t>=l.depth-3;t-=1)e=ny.Fragment.from(l.node(t).copy(e));let i=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,o={...tj(p,l.node().type.name,l.node().attrs),...t},d=(null==(s=a.contentMatch.defaultType)?void 0:s.createAndFill(o))||void 0;e=e.append(ny.Fragment.from(a.createAndFill(null,d)||void 0));let c=l.before(l.depth-(r-1));n.replace(c,l.after(-i),new ny.Slice(e,4-r,0));let u=-1;n.doc.nodesBetween(c,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(nv.TextSelection.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let h=d.pos===l.end()?u.contentMatchAt(0).defaultType:null,f={...tj(p,u.type.name,u.attrs),...t},m={...tj(p,l.node().type.name,l.node().attrs),...t};n.delete(l.pos,d.pos);let g=h?[{type:a,attrs:f},{type:h,attrs:m}]:[{type:a,attrs:f}];if(!(0,nb.canSplit)(n.doc,l.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,a=t||e.$to.parentOffset&&e.$from.marks();if(n.split(l.pos,2,g).scrollIntoView(),!a||!i)return!0;let d=a.filter(e=>
1s.includes(e.type.name));n.ensureMarks(d)}return!0},nk=n(41439),nx=n(40212);function nM(e){return e&&"1"!==e?e:null}var nS=(e,t)=>{var n,r;let i=e2(e=>e.type===t)(e.selection);if(!i)return!0;let o=e.doc.resolve(Math.max(0,i.pos-1)).before(i.depth);if(void 0===o)return!0;let s=e.doc.nodeAt(o);return!(i.node.type===(null==s?void 0:s.type)&&(0,nx.canJoin)(e.doc,i.pos))||(n=i.node.attrs.type,r=null==s?void 0:s.attrs.type,nM(n)!==nM(r)||(e.join(i.pos),!0))},nE=(e,t)=>{var n,r;let i=e2(e=>e.type===t)(e.selection);if(!i)return!0;let o=e.doc.resolve(i.start).after(i.depth);if(void 0===o)return!0;let s=e.doc.nodeAt(o);return!(i.node.type===(null==s?void 0:s.type)&&(0,nx.canJoin)(e.doc,o))||(n=i.node.attrs.type,r=null==s?void 0:s.attrs.type,nM(n)!==nM(r)||(e.join(o),!0))},nT=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:d,can:c})=>{let{extensions:u,splittableMarks:p}=i.extensionManager,h=M(e,s.schema),f=M(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:v}=m,b=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;let k=e2(e=>tW(e.type.name,u))(m),x=0===m.from&&m.to===s.doc.content.size,S=s.doc.content.content,E=1===S.length?S[0]:null,T=x&&E&&tW(E.type.name,u)?{node:E,pos:0,depth:0}:null,O=null!=k?k:T,P=!!k&&b.depth>=1&&b.depth-k.depth<=1,C=!!T;if((P||C)&&O){if(O.node.type===h)return x&&C?l().command(({tr:e,dispatch:t})=>{let n=function(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return nk.TextSelection.between(r,i)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(f).run():d.liftListItem(f);if(tW(O.node.type.name,u)&&h.validContent(O.node.content))return l().command(()=>(o.setNodeMarkup(O.pos,h),!0)).command(()=>nS(o,h)).command(()=>nE(o,h)).run()}return n&&w&&a?l().command(()=>{let e=c().wrapInList(h,r),t=w.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(h,r).command(()=>nS(o,h)).command(()=>nE(o,h)).run():l().command(()=>!!c().wrapInList(h,r)||d.clearNodes()).wrapInList(h,r).command(()=>nS(o,h)).command(()=>nE(o,h)).run()},nO=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=B(e,r.schema);return tI(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},nP=(e,t,n={})=>({state:r,commands:i})=>{let o,s=M(e,r.schema),a=M(t,r.schema),l=eO(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),l)?i.setNode(a,o):i.setNode(s,{...o,...n})},nC=(e,t={})=>({state:n,commands:r})=>{let i=M(e,n.schema);return eO(n,i,t)?r.lift(i):r.wrapIn(i,t)},nA=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},nN=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:o}=t,{empty:s,ranges:a}=o;if(s)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!l.includes(e.name));a.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},nR=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=B(e,r.schema),{$from:d,empty:c,ranges:u}=a;if(!i)return!0;if(c&&s){let{from:e,to:t}=a,r=null==(o=d.marks().find(e=>e.type===l))?void 0:o.attrs,i=I(d,l,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,l)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},nD=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},n$=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,a=ej("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(o=M(e,r.schema)),"mark"===a&&(s=B(e,r.schema));let l=!1;
1return n.selection.ranges.forEach(e=>{let a,d,c,u,p=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,h,(e,t)=>{o&&o===e.type&&(l=!0,c=Math.max(t,p),u=Math.min(t+e.nodeSize,h),a=t,d=e)}):r.doc.nodesBetween(p,h,(e,r)=>{r<p&&o&&o===e.type&&(l=!0,c=Math.max(r,p),u=Math.min(r+e.nodeSize,h),a=r,d=e),r>=p&&r<=h&&(o&&o===e.type&&(l=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(l=!0,i)){let i=Math.max(r,p),a=Math.min(r+e.nodeSize,h);n.addMark(i,a,s.create({...o.attrs,...t}))}}))}),d&&(void 0!==a&&i&&n.setNodeMarkup(a,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&i&&n.addMark(c,u,s.create({...e.attrs,...t}))}))}),l},nj=new(n(41439)).PluginKey("__tiptap_decorations__"),nz=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(nj,{type:"force",name:e}),!0),nI=n(13866),nB=(e,t={})=>({state:n,dispatch:r})=>{let i=M(e,n.schema);return(0,nI.wrapIn)(i,t)(n,r)},nL=n(98274),nH=(e,t={})=>({state:n,dispatch:r})=>{let i=M(e,n.schema);return(0,nL.wrapInList)(i,t)(n,r)},nF=n(41439),nW=n(96803),nV=new WeakMap,nK=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},nU=n(20461),n_=n(41439),nJ=n(96803),nq=void 0!==r&&!1,nX=n(96803);function nY(e,t){let n=[],r=new Set;for(let i of e)"widget"===i.kind&&"widget"===i.kind&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function nG({position:e,from:t,to:n,docSize:r}){return!(e<t)&&(e<n||e===n&&n===r)}function nQ(e){var t;let n=null==(t=e.spec)?void 0:t.key;return"string"==typeof n?n:void 0}function nZ(e){return"attr"===e.jsonID}var n0=n(96803);function n1(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=null==e?void 0:e.key;"string"==typeof t&&r.delete(t)}})}var n4=n(96803);function n3(e,t){let n=Object.values(t).flatMap(e=>e.find());return n4.DecorationSet.create(e,n)}function n6(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}var n2=new Set;function n9(e){var t,n,r;return null!=(r=null==(n=null==(t=e.extensionManager)?void 0:t.decorationManager)?void 0:n.liveWidgetKeys())?r:n2}var n8=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=nj.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>(function(e,t){var n;switch(null!=(n=t.update)?n:"document"){case"document":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}})(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return null!=(t=null==(e=nj.getState(this.editor.state))?void 0:e.widgetKeys)?t:n2}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;
1return new n_.Plugin({key:nj,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:o}of t){let{set:t,widgetKeys:s}=this.buildFullSet(e,o,n);r[e]=t,i[e]=s}let o={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:n6(i)};return this.warnDuplicateWidgetKeys(o),o},apply:(n,r,i,o)=>{let s=n.getMeta(nj),a=(null==s?void 0:s.type)==="force"&&!s.name,l=(null==s?void 0:s.type)==="force"?s.name:void 0,d={},c={},u=new Set;if(!function(e,t){var n,r;nV.set(e,(null!=(n=nV.get(e))?n:0)+1);try{return t()}finally{let t=(null!=(r=nV.get(e))?r:1)-1;t>0?nV.set(e,t):nV.delete(e)}}(e,()=>{for(let{name:p,spec:h}of t){var s;let t=a||l===p;if(s={editor:e,tr:n,oldState:i,newState:o},t||"manual"!==h.update&&(h.shouldUpdate?h.shouldUpdate(s):s.tr.docChanged))if("changedRanges"===h.update&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(p,h,r,n,o);d[p]=e.set,c[p]=e.widgetKeys,u.add(p)}else{let{set:e,widgetKeys:t}=this.buildFullSet(p,h,o);d[p]=e,c[p]=t,u.add(p)}else{let e=function(e,t,n){var r,i;let o=null!=(r=t.decorationSetsByExtension[e])?r:n0.DecorationSet.empty,s=new Set(null!=(i=t.widgetKeysByExtension[e])?i:[]);return{set:n1(o,n.mapping,n.doc,s),widgetKeys:s}}(p,r,n);d[p]=e.set,c[p]=e.widgetKeys}}}),0===u.size&&!n.docChanged)return r;let p=this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:d,recomputedNames:u});return{decorationSetsByExtension:d,widgetKeysByExtension:c,mergedDecorationSet:p,widgetKeys:n6(c)}}},props:{decorations(e){var t,n;return null!=(n=null==(t=nj.getState(e))?void 0:t.mergedDecorationSet)?n:nJ.DecorationSet.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let o=function(e,t){if(e.steps.some(e=>{let t;
1return t=!1,e.getMap().forEach(()=>{t=!0}),!(t||nZ(e))&&("number"!=typeof e.from||"number"!=typeof e.to)}))return{type:"full"};let n=tA(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!nZ(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=function(e,t){let n=null,r=0,i=0;for(let o=0;o<e.childCount&&!(i>t.to);o+=1){let s=i+e.child(o).nodeSize;s>=t.from&&(null===n&&(n=i),r=s),i=s}return null===n?null:{from:n,to:r}}(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:"ranges",ranges:i}}(r,i.doc);return"full"===o.type?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,o.ranges)}rebuildRanges(e,t,n,r,i,o){var s,a;let l=null!=(s=n.decorationSetsByExtension[e])?s:nJ.DecorationSet.empty,d=new Set(null!=(a=n.widgetKeysByExtension[e])?a:[]),c=n1(l,r.mapping,r.doc,d),u=i.doc.content.size;for(let{from:n,to:r}of o){let o=c.find(n,r).filter(e=>nG({position:e.from,from:n,to:r,docSize:u}));for(let e of o){let t=nQ(e);t&&d.delete(t)}c=c.remove(o);let{decorations:s,widgetKeys:a}=nY(function({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:o}){return e.filter(e=>!!nG({position:e.anchor,from:t,to:n,docSize:r})||e.anchor!==n&&(o.has(i)||(o.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:u,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);for(let e of(c=c.add(i.doc,s),a))d.add(e)}return{set:c,widgetKeys:d}}buildFullSet(e,t,n){let r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));var i=n.doc;let{decorations:o,widgetKeys:s}=nY(r,e);return{set:nX.DecorationSet.create(i,o),widgetKeys:s}}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!nq)return;if(0===e.widgetKeys.size)return void this.warnedWidgetKeys.clear();let t=function(e){var t,n,r;let i=new Map,o=new Map;for(let s of e.find()){let e=nQ(s);if(!e)continue;let a=null!=(t=s.spec.extensionName)?t:"unknown",l=null!=(n=i.get(e))?n:new Set;l.add(a),i.set(e,l),o.set(e,(null!=(r=o.get(e))?r:0)+1)}return Array.from(i,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>{var t;return(null!=(t=o.get(e))?t:0)>1})}(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${1===n.size?"":"s"} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return 1===n.length?t[n[0]]:n3(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return 1===e.length?r[e[0].name]:0===i.size?t.mergedDecorationSet.map(n.mapping,n.doc):n3(n.doc,r)}};function n5(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}var n7=n(41439);function re(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof n7.NodeSelection){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}function rt(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==r)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}function rn(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function rr(e,t){let n=e.getAttribute("style");if(!n)return null;let r=n.split(";").map(e=>
1e.trim()).filter(Boolean),i=t.toLowerCase();for(let e=r.length-1;e>=0;e-=1){let t=r[e],n=t.indexOf(":");if(-1!==n&&t.slice(0,n).trim().toLowerCase()===i)return t.slice(n+1).trim()}return null}function ri(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function ro(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rs(){return"undefined"!=typeof navigator&&/Firefox/.test(navigator.userAgent)}function ra(e){return"number"==typeof e}function rl(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function rd(e){return"string"==typeof e}var rc={};function ru(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([\w-]+)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([\w-]+)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var i;let o=n[parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10)];o&&(t[e]=o.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>
1{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function rp(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function rh(e){let{nodeName:t,name:n,parseAttributes:r=ru,serializeAttributes:i=rp,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t;return{parseMarkdown:(e,n)=>{let r={...o,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){let o=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(o);if(!a)return;let d=r(a[1]||"");if(!s.find(e=>!(e in d)))return{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{let t=i((e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${l}${n} :::`}}}function rf(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=ru,serializeAttributes:o=rp,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,d=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let o={...s,...e.attributes};return n.createNode(t,o,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${d}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var o;let s=RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;let[c,u=""]=l,p=i(u),h=1,f=c.length,m="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)h+=1;else if(0==(h-=1)){let o=y.slice(0,i);m=o.trim();let s=e.slice(0,f+i+n[0].length),l=[];if(m)if("block"===a)for((l=r.blockTokens(o)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});l.length>0;){let e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(m);return{type:t,raw:s,attributes:p,content:m,tokens:l}}}}}},renderMarkdown:(e,t)=>{let n=o((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${d}${r}
2
3${i}
4
5:::`}}}function rm(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function rg(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function ry(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=rm,serializeAttributes:o=rg,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,d=n||t,c=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let i={...s,...e.attributes};if(a)return n.createNode(t,i);let o=r?r(e):e.content||"";return o?n.createNode(t,i,[n.createTextNode(o)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=a?RegExp(`\\[${c}\\s*[^\\]]*\\]`):RegExp(`\\[${c}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${c}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=a?RegExp(`^\\[${c}\\s*([^\\]]*)\\]`):RegExp(`^\\[${c}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${c}\\]`),s=e.match(o);if(!s)return;let l="",d="";if(a){let[,e]=s;d=e}else{let[,e,t]=s;d=e,l=t||""}let u=i(d.trim());return{type:t,raw:s[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=o((e=>{if(!l)return e;let t={};return l.forEach(n=>{let r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==i&&n===i)return;t[r]=n}}),t})(e.attrs||{})),i=n?` ${n}`:"";return a?`[${d}${i}]`:`[${d}${i}]${t}[/${d}]`}}}function rv(e,t,n){var r,i,o,s;let a=e.split("\n"),l=[],d="",c=0,u=t.baseIndentSize||2;for(;c<a.length;){let e,p=a[c],h=p.match(t.itemPattern);if(!h)if(l.length>0)break;else{if(""!==p.trim())return;c+=1,d=`${d}${p}
6`;continue}let f=t.extractItemData(h),{indentLevel:m,mainContent:g}=f;d=`${d}${p}
7`;let y=[g];for(c+=1;c<a.length;){let e=a[c];if(""===e.trim()){let t=a.slice(c+1).findIndex(e=>""!==e.trim());if(-1===t)break;
7if(((null==(i=null==(r=a[c+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m){y.push(e),d=`${d}${e}
8`,c+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>m)y.push(e),d=`${d}${e}
9`,c+=1;else break}let v=y.slice(1);if(v.length>0){let r=v.map(e=>e.slice(m+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let b=t.createToken(f,e);l.push(b)}if(0!==l.length)return{items:l,raw:d}}function rb(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,a=t.renderChildren([o]),l=`${i}${a}`;return s&&s.length>0&&s.forEach((e,n)=>{var r,i;let o=null!=(i=null==(r=t.renderChild)?void 0:r.call(t,e,n+1))?i:t.renderChildren([e]);if(null!=o){let n=o.split("\n").map(e=>e?t.indent(e):t.indent("")).join("\n");l+="paragraph"===e.type?`
10
11${n}`:`
12${n}`}}),l}function rw(e){return"string"==typeof e.type?e.type:e.type.name}function rk(e,t){if(e.length!==t.length)return!1;let n=Array.from({length:t.length},()=>!1);return e.every(e=>{let r=rw(e),i=t.findIndex((t,i)=>!n[i]&&r===rw(t)&&n5(e.attrs,t.attrs));return -1!==i&&(n[i]=!0,!0)})}function rx(e,t){let n={...e};return rl(e)&&rl(t)&&Object.keys(t).forEach(r=>{rl(t[r])&&rl(e[r])?n[r]=rx(e[r],t[r]):n[r]=t[r]}),n}function rM(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}l(rc,{createAtomBlockMarkdownSpec:()=>rh,createBlockMarkdownSpec:()=>rf,createInlineMarkdownSpec:()=>ry,parseAttributes:()=>ru,parseIndentedBlocks:()=>rv,renderNestedMarkdownContent:()=>rb,serializeAttributes:()=>rp});var rS=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){rM(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(J()||_())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},rE=n(56631),rT=n(41439),rO=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function rP(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;let d=l.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let p=!1,h=tz(d)+o;return s.forEach(e=>{if(p)return;let t=((e,t)=>{if(D(t))return t.exec(e);let n=t(e);if(!n)return null;let 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})(h,e.find);if(!t)return;let s=t[0].length-o.length;if(s>0){let e=d.parentOffset-s;if(e<0||d.parent.textBetween(e,d.parentOffset)!==t[0].slice(0,s))return}let f=l.state.tr,m=c({state:l.state,transaction:f}),g={from:r-(t[0].length-o.length),to:i}
12,{commands:y,chain:v,can:b}=new u({editor:n,state:m});null!==e.handler({state:m,range:g,match:t,commands:y,chain:v,can:b})&&f.steps.length&&(e.undoable&&f.setMeta(a,{transform:f,from:r,to:i,text:o}),l.dispatch(f),p=!0)}),p}function rC(e){let{editor:t,rules:n}=e,r=new rT.Plugin({state:{init:()=>null,apply(e,i,o){let s=e.getMeta(r);if(s)return s;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=te(rE.Fragment.from(e),o.schema));let{from:i}=a,s=i+e.length;rP({editor:t,from:i,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>rP({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&rP({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&rP({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var rA=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...tr(e9(this,"addOptions",{name:this.name}))}}get storage(){return{...tr(e9(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>rx(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},rN=class e extends rA{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},rR=n(56631),rD=n(41439),r$=class{constructor(e){this.find=e.find,this.handler=e.handler}},rj=null;function rz(e){let t,{editor:n,rules:r}=e,i=null,o=!1,s=!1,a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let l=({state:e,from:r,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:d,can:c}=new u({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,i,(e,t)=>{var u,h,f,m,g;if((null==(h=null==(u=e.type)?void 0:u.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(i,t+y);v>=b||((e,t,n)=>{if(D(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=v+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},u=o.handler({state:n,range:i,match:e,commands:l,chain:d,can:c,pasteEvent:s,dropEvent:a});p.push(u)})}),p.every(e=>null!==e)}({editor:n,state:c({state:e,transaction:l}),from:Math.max(r-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return r.map(e=>new rD.Plugin({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(rj=n)},r=()=>{rj&&(rj=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(s=i===e.dom.parentElement,t=n,!s){let e=rj;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>
12{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],d="paste"===i.getMeta("uiEvent")&&!o,c="drop"===i.getMeta("uiEvent")&&!s,u=i.getMeta("applyPasteRules"),p=!!u;if(!d&&!c&&!p)return;if(p){let{text:t}=u;"string"==typeof t||(t=te(rR.Fragment.from(t),r.schema));let{from:n}=u,i=n+t.length;return l({rule:e,state:r,from:n,to:{b:i},pasteEvt:(e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t)})}let h=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);if(ra(h)&&f&&h!==f.b)return l({rule:e,state:r,from:h,to:f,pasteEvt:a})}}))}var rI=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=ty(e),this.schema=tf(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:t$(t.name,this.schema)},r=e9(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=tg([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:t$(t.name,this.schema)},r=[],i=e9(t,"addKeyboardShortcuts",n),o={};if("mark"===t.type&&e9(t,"exitable",n)&&(o.ArrowRight=()=>rN.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));o={...o,...t}}let s=(0,nU.keymap)(o);r.push(s);let a=e9(t,"addInputRules",n);if(tF(t,e.options.enableInputRules)&&a){let t=a();if(t&&t.length){let n=rC({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let l=e9(t,"addPasteRules",n);if(tF(t,e.options.enablePasteRules)&&l){let t=l();if(t&&t.length){let n=rz({editor:e,rules:t});r.push(...n)}}let d=e9(t,"addProseMirrorPlugins",n);if(d){let e=d();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;null==(e=this.decorationManager)||e.destroy();let n=[];return this.extensions.forEach(e=>{let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:t$(e.name,this.schema)},i=e9(e,"addDecorations",r);i&&n.push({name:e.name,addDecorations:i})}),this.decorationManager=new n8({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return ts(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=to(this.extensions);return Object.fromEntries(t.filter(e=>!!e9(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:M(t.name,this.schema)},i=e9(t,"addNodeView",r);if(!i)return[];let o=i();return o?[t.name,(r,i,s,a,l)=>{let d=td(r,n);return o({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return tg([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:t$(n.name,this.schema)},i=e9(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return tg([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:t$(n.name,this.schema)},i=e9(n,"transformPastedHTML",r);return i?(t,n)=>{let o=e(t,n);return i.call(r,o)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=to(this.extensions);return Object.fromEntries(t.filter(e=>!!e9(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:B(t.name,this.schema)},i=e9(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let a=td(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{rM(r,e,t)}})}]:[]}))}destroy(){var e;null==(e=this.decorationManager)||e.destroy(),this.extensions.forEach(e
12=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t,n;let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:t$(e.name,this.schema)};"mark"===e.type&&((null==(t=tr(e9(e,"keepOnSplit",r)))||t)&&this.splittableMarks.push(e.name),null==(n=tr(e9(e,"clearable",r)))||n||this.nonClearableMarks.push(e.name));let i=e9(e,"onBeforeCreate",r),o=e9(e,"onCreate",r),s=e9(e,"onUpdate",r),a=e9(e,"onSelectionUpdate",r),l=e9(e,"onTransaction",r),d=e9(e,"onFocus",r),c=e9(e,"onBlur",r),u=e9(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),d&&this.editor.on("focus",d),c&&this.editor.on("blur",c),u&&this.editor.on("destroy",u)})}};rI.resolve=ty,rI.sort=tg,rI.flatten=e8;var rB={};l(rB,{ClipboardTextSerializer:()=>rF,Commands:()=>rW,Delete:()=>rK,Drop:()=>r_,Editable:()=>rq,FocusEvents:()=>rG,Keymap:()=>rZ,Paste:()=>r1,Tabindex:()=>r3,TextDirection:()=>r2,focusEventsPluginKey:()=>rY});var rL=n(41439),rH=class e extends rA{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},rF=rH.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new rL.Plugin({key:new rL.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,o=tE(n),{blockSeparator:s}=this.options,a={...void 0!==s?{blockSeparator:s}:{},textSerializers:o};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>tM(r,{from:e.pos,to:t.pos},a)).join(null!=s?s:"\n\n")}}})]}}),rW=rH.create({name:"commands",addCommands:()=>({...p})}),rV=n(40212),rK=rH.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var n,r,i,o;if(null!=(o=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?o:e.getMeta("y-sync$"))return;let s=e1(e.before,[e,...t]);tA(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let a=s.mapping;s.steps.forEach((t,n)=>{var r,i;if(t instanceof rV.RemoveMarkStep){let o=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),d=a.invert().map(o,-1),c=a.invert().map(l),u=o>0&&(null==(r=s.doc.nodeAt(o-1))?void 0:r.marks.some(e=>e.eq(t.mark))),p=null==(i=s.doc.nodeAt(l))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:c},newRange:{from:o,to:l},partial:!!(p||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(o,0):o()}}),rU=n(41439),r_=rH.create({name:"drop",addProseMirrorPlugins(){return[new rU.Plugin({key:new rU.PluginKey("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),rJ=n(41439),rq=rH.create({name:"editable",addProseMirrorPlugins(){return[new rJ.Plugin({key:new rJ.PluginKey("editable"),props:{editable:()=>this.editor.options.editable}})]}}),rX=n(41439),rY=new rX.PluginKey("focusEvents"),rG=rH.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;
12return[new rX.Plugin({key:rY,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),rQ=n(41439),rZ=rH.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:a}=o,l=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,d=l.parent.type.spec.isolating,c=o.pos-o.parentOffset,u=d&&1===l.parent.childCount?c===o.pos:rQ.Selection.atStart(r).from===s;return!!i&&!!a.type.isTextblock&&!a.textContent.length&&!!u&&(!u||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.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={...n},i={...n,"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 J()||eS()?i:r},addProseMirrorPlugins(){return[new rQ.Plugin({key:new rQ.PluginKey("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:a}=t.selection,l=rQ.Selection.atStart(t.doc).from,d=rQ.Selection.atEnd(t.doc).to;if(o||s!==l||a!==d||!tV(n.doc))return;let p=n.tr,h=c({state:n,transaction:p}),{commands:f}=new u({editor:this.editor,state:h});if(f.clearNodes(),p.steps.length)return p}})]}}),r0=n(41439),r1=rH.create({name:"paste",addProseMirrorPlugins(){return[new r0.Plugin({key:new r0.PluginKey("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),r4=n(41439),r3=rH.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new r4.Plugin({key:new r4.PluginKey("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!=(e=this.options.value)?e:"0"}:{}}}})]}}),r6=n(41439),r2=rH.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=to(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new r6.Plugin({key:new r6.PluginKey("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),r9=n(56631),r8=n(40212),r5=!1,r7=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}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}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),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 e(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 e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+ +!o;if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!i&&!s&&l.depth<=this.depth)return;let d=new e(l,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;
12){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{(!n||!(r.length>0))&&(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},ie=`.ProseMirror {
13  position: relative;
14}
15
16.ProseMirror {
17  word-wrap: break-word;
18  white-space: pre-wrap;
19  white-space: break-spaces;
20  -webkit-font-variant-ligatures: none;
21  font-variant-ligatures: none;
22  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
23}
24
25.ProseMirror [contenteditable="false"] {
26  white-space: normal;
27}
28
29.ProseMirror [contenteditable="false"] [contenteditable="true"] {
30  white-space: pre-wrap;
31}
32
33.ProseMirror pre {
34  white-space: pre-wrap;
35}
36
37img.ProseMirror-separator {
38  display: inline !important;
39  border: none !important;
40  margin: 0 !important;
41  width: 0 !important;
42  height: 0 !important;
43}
44
45.ProseMirror-gapcursor {
46  display: none;
47  pointer-events: none;
48  position: absolute;
49  margin: 0;
50}
51
52.ProseMirror-gapcursor:after {
53  content: "";
54  display: block;
55  position: absolute;
56  top: -2px;
57  width: 20px;
58  border-top: 1px solid black;
59  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
60}
61
62@keyframes ProseMirror-cursor-blink {
63  to {
64    visibility: hidden;
65  }
66}
67
68.ProseMirror-hideselection *::selection {
69  background: transparent;
70}
71
72.ProseMirror-hideselection *::-moz-selection {
73  background: transparent;
74}
75
76.ProseMirror-hideselection * {
77  caret-color: transparent;
78}
79
80.ProseMirror-focused .ProseMirror-gapcursor {
81  display: block;
82}`,it=class extends nK{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:t5,createMappablePosition:t7},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=U(t,this.options.autofocus);this.editorState=nF.EditorState.create({doc:t,schema:this.schema,selection:e||void 0})}!function(e){let t;if(!r5){r5=!0;try{t=r8.ReplaceStep.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof r9.Fragment||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}}(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");
82this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():u.createFakeChain()}can(){return this.commandManager?this.commandManager.can():u.createFallbackCan()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=rt(ie,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return nq&&!this.hasWarnedStaleDecorationRead&&nV.has(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=tn(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t,n,r;let i=[...this.options.enableCoreExtensions?[rq,rF.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),rW,rG,rZ,r3.configure({value:null==(r=null==(n=this.options.coreExtensionOptions)?void 0:n.tabindex)?void 0:r.value}),r_,r1,rK,r2.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new rI(i,this)}createCommandManager(){this.commandManager=new u({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=eG(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;let e=eG(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=nF.EditorState.create({doc:e,schema:this.schema,selection:U(e,this.options.autofocus)||void 0}
82),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(o);this.editorView=new nW.EditorView(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return tP(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return tB(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return te(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return tS(this.state.doc,{blockSeparator:t,textSerializers:{...tE(this.schema),...n}})}get isEmpty(){return tV(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new r7(t,this,!1,n)}get $doc(){return this.$pos(0)}},ir=n(96803),ii=class{static Inline(e,t,n={},r){return new io(e,t,n,r)}static Node(e,t,n={},r){return new is(e,t,n,r)}static Widget(e,t,n){let{key:r,...i}=n;return new ia(e,t,r,i)}},io=class extends ii{constructor(e,t,n={},r){super(),this.kind="inline",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return ir.Decoration.inline(this.from,this.to,this.attrs,t)}},is=class extends ii{constructor(e,t,n={},r){super(),this.kind="node",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return ir.Decoration.node(this.from,this.to,this.attrs,t)}},ia=class extends ii{constructor(e,t,n,r){super(),this.kind="widget",this.pos=e,this.render=t,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(e){let t=e?{...this.spec,key:this.key,extensionName:e}:{...this.spec,key:this.key};return ir.Decoration.widget(this.pos,this.render,t)}};function il(e){var t;let{editor:n,pos:r,key:i,props:o,cacheKey:s,context:a,create:l,materialize:d,side:c,relaxedSide:u,marks:p,stopEvent:h,ignoreSelection:f,de
82stroy:m}=e,g=function(e,t){let n=e[t];if(!n){n={renderers:new Map,props:new Map,pendingProps:new Map,flushScheduled:!1},e[t]=n;let r=n;e.on("destroy",()=>{r.pendingProps.clear(),r.renderers.forEach(e=>e.destroy()),r.renderers.clear(),r.props.clear()})}return n}(n,s);if(g.renderers.has(i)){let e=null!=(t=g.pendingProps.get(i))?t:g.props.get(i);e&&n5(e,o)||(g.pendingProps.set(i,o),g.flushScheduled||(g.flushScheduled=!0,queueMicrotask(()=>(function(e){for(let[t,n]of(e.flushScheduled=!1,e.pendingProps)){let r=e.renderers.get(t);r&&(r.updateProps(n),e.props.set(t,{...n}))}e.pendingProps.clear()})(g))))}return ii.Widget(r,(e,t)=>{let n={...o,...a(t)},r=g.renderers.get(i);return r?r.updateProps(n):(r=l(n),g.renderers.set(i,r),g.props.set(i,{...o})),d(r)},{key:i,side:c,relaxedSide:u,marks:p,stopEvent:h,ignoreSelection:f,destroy:e=>{var t;if(!n9(n).has(i))try{null==(t=g.renderers.get(i))||t.destroy(),g.renderers.delete(i),g.props.delete(i),g.pendingProps.delete(i)}finally{null==m||m(e)}}})}function id(e){return new rO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=tr(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),d=l+s.length;if(tN(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;
82d<n.to&&o.delete(d,n.to),l>n.from&&o.delete(n.from+r,l);let c=n.from+r+s.length;o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function ic(e){return new rO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=tr(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,a=n.to,l=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a))}o.scrollIntoView()},undoable:e.undoable})}function iu(e){return new rO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=tr(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function ip(e){return new rO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from,s=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length);let t=(o+=e)-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)},undoable:e.undoable})}var ih=n(40212);function im(e){return new rO({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=tr(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&(0,ih.findWrapping)(a,e.type,o);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&(0,ih.canJoin)(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)},undoable:e.undoable})}function ig(e){return e.children}var iy=(e,t)=>(function(e,t,n){if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:r,...i}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return n&&Array.isArray(r)?[e,i,...r]:[e,i,r]})(e,t,!1),iv=class{constructor(e){var t,n,r,i,o,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{"Shift"===e.key&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(null==(t=e.options)?void 0:t.min)&&(this.minSize={...this.minSize,...e.options.min}),(null==(n=e.options)?void 0:n.max)&&(this.maxSize=e.options.max),(null==(r=null==e?void 0:e.options)?void 0:r.directions)&&(this.directions=e.options.directions),(null==(i=e.options)?void 0:i.preserveAspectRatio)&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(null==(o=e.options)?void 0:o.className)&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(null==(s=e.options)?void 0:s.createCustomHandle)&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return null!=(e=this.contentElement)?e:null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&0===this.handleMap.size&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.n
82ame,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),o=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),o&&(e.style.right="0"),("top"===t||"bottom"===t)&&(e.style.left="0",e.style.right="0"),("left"===t||"right"===t)&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;(t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e))instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",t=>this.handleResizeStart(t,e)),t.addEventListener("touchstart",t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,"touches"in e?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),o=this.applyConstraints(r,i,n);this.element.style.width=`${o.width}px`,this.element.style.height=`${o.height}px`,this.onResize&&this.onResize(o.width,o.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,o=e.includes("right"),s=e.includes("left"),a=e.includes("bottom"),l=e.includes("top");return(o?r=this.startWidth+t:s&&(r=this.startWidth-t),a?i=this.startHeight+n:l&&(i=this.startHeight-n),("right"===e||"left"===e)&&(r=this.startWidth+(o?t:-t)),("top"===e||"bottom"===e)&&(i=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed)?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,o,s;if(!n){let n=Math.max(this.minSize.width,e),o=Math.max(this.minSize.height,t);return(null==(r=this.maxSize)?void 0:r.width)&&(n=Math.min(this.maxSize.width,n)),(null==(i=this.maxSize)?void 0:i.height)&&(o=Math.min(this.maxSize.height,o)),{width:n,height:o}}let a=e,l=t;return a<this.minSize.width&&(l=(a=this.minSize.width)/this.aspectRatio),l<this.minSize.height&&(a=(l=this.minSize.height)*this.aspectRatio),(null==(o=this.maxSize)?void 0:o.width)&&a>this.maxSize.width&&(l=(a=this.maxSize.width)/this.aspectRatio),(null==(s=this.maxSize)?void 0:s.height)&&l>this.maxSize.height&&(a=(l=this.maxSize.height)*this.aspectRatio),{width:a,height:l}}applyAspectRatio(e,t,n){return"left"===n||"right"===n?{width:e,height:e/this.aspectRatio}:"top"===n||"bottom"===n?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},ib=iv,iw=class e extends rA{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},ik=n(41439),ix=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,a;let{view:l}=this.editor,d=e.target,c=3===d.nodeType?null==(t=d.parentElement)?void 0:t.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(d))||!c)return;let u=0,p=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),a=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;u=n.x-t.x+a,p=n.y-t.y+l}let h=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();h.style.width=`${Math.round(e.width)}px`,h.style.height=`${Math.round(e.height)}px`,h.style.boxSizing="border-box",h.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(h),document.body.appendChild(f),null==(a=e.dataTransfer)||a.setDragImage(h,u,p)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=ik.NodeSelection.create(l.state.doc,m),y=l.state.tr.setSelection(g);l.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="dragover"===e.type||"dragenter"===e.type,o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,d=ik.NodeSelection.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,p="cut"
82===e.type,h="mousedown"===e.type;if(!l&&d&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(l&&s&&!a&&h){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!a&&!i&&!o&&!c&&!u&&!p&&(!h||!d)&&!0}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(J()||_())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function iM(e){return new r$({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=tr(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,a=r[r.length-1],l=r[0],d=n.to;if(a){let i=l.search(/\S/),c=n.from+l.indexOf(a),u=c+a.length;if(tN(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+i,c),d=n.from+i+a.length,s.addMark(n.from+i,d,e.type.create(o||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||s.removeStoredMark(e.type)}}})}function iS(e){return new r$({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){let o=tr(e.getAttributes,void 0,t,i),s=tr(e.getContent,void 0,o);if(!1===o||null===o)return null;let a={type:e.type.name,attrs:o};s&&(a.content=s),t.input&&n().deleteRange(r).insertContentAt(r.from,a)}})}function iE(e){return new r$({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,o=n.from,s=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length);let t=(o+=e)-s;t>0&&(i=r[0].slice(e-t,e)+i,o=s)}t.tr.insertText(i,o,s)}})}var iT=class{constructor(e){this.transaction=e,this.currentStep=this.transaction.steps.length}map(e){let t=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((e,n)=>{let r=n.getMap().mapResult(e);return r.deleted&&(t=!0),r.pos},e),deleted:t}}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.