PageSourceSearch

https://www.lighthouseacademy.ai/_next/static/chunks/54a60aa6.1b9ab94647203ec0.js

js lighthouseacademy.ai collected 2026-10-04 23:38:20 UTC 89,101 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7902],{40318:function(e,t,n){n.d(t,{Cf:function(){return tK},EG:function(){return e2},Editor:function(){return tU},FZ:function(){return tZ},Ig:function(){return eo},K9:function(){return t7},NB:function(){return t6},NI:function(){return t4},NY:function(){return eF},Nl:function(){return eC},P1:function(){return eI},QC:function(){return eU},S0:function(){return tq},Sz:function(){return eQ},XP:function(){return eM},b5:function(){return eS},bR:function(){return e1},fy:function(){return tX},hj:function(){return tP},jo:function(){return x},m7:function(){return ej},nU:function(){return ez},rI:function(){return eZ},tI:function(){return eK},u9:function(){return e_},vc:function(){return tE},wm:function(){return t5},x2:function(){return tF},zK:function(){return tY}});var r=n(49430),i=n(98615),o=n(19672),s=n(49975),a=n(54736),l=n(3654),c=n(54933),d=Object.defineProperty,u=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})};function h(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}}}var p=class{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=>{let[t,n]=e;var s=this;return[t,function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let l=n(...t)(o);return i.getMeta("preventDispatch")||s.hasCustomState||r.dispatch(i),l}]}))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],a=!!e,l=e||i.tr,c={...Object.fromEntries(Object.entries(n).map(e=>{let[n,r]=e;var i=this;return[n,function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];let a=i.buildProps(l,t),d=r(...n)(a);return s.push(d),c}]})),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(l),s.every(e=>!0===e))};return c}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=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(...t)({...i,dispatch:void 0})}]})),chain:()=>this.createChain(r,!1)}}buildProps(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:h({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=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(...t)(s)}]}))}};return s}constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}},m={};u(m,{blur:()=>f,clearContent:()=>g,clearNodes:()=>v,command:()=>y,createParagraphNear:()=>b,cut:()=>k,deleteCurrentNode:()=>w,deleteNode:()=>M,deleteRange:()=>S,deleteSelection:()=>E,enter:()=>C,exitCode:()=>T,extendMarkRange:()=>I,first:()=>j,focus:()=>V,forEach:()=>W,insertContent:()=>_,insertContentAt:()=>q,joinBackward:()=>Z,joinDown:()=>X,joinForward:()=>Q,joinItemBackward:()=>G,joinItemForward:()=>ee,joinTextblockBackward:()=>et,joinTextblockForward:()=>en,joinUp:()=>J,keyboardShortcut:()=>ei,lift:()=>es,liftEmptyBlock:()=>ea,liftListItem:()=>el,newlineInCode:()=>ec,resetAttributes:()=>eh,scrollIntoView:()=>ep,selectAll:()=>em,selectNodeBackward:()=>ef,selectNodeForward:()=>eg,selectParentNode:()=>ev,selectTextblockEnd:()=>ey,selectTextblockStart:()=>eb,setContent:()=>ew,setMark:()=>e5,setMeta:()=>e6,setNode:()=>e7,setNodeSelection:()=>e8,setTextDirection:()=>te,setTextSelection:()=>tt,sinkListItem:()=>tn,splitBlock:()=>ti,splitListItem:()=>to,toggleList:()=>tl,toggleMark:()=>tc,toggleNode:()=>td,toggleWrap:()=>tu,undoInputRule:()=>th,unsetAllMarks:()=>tp,unsetMark:()=>tm,unsetTextDirection:()=>tf,updateAttributes:()=>tg,wrapIn:()=>tv,wrapInList:()=>ty});var f=()=>e=>{let{editor:t,view:n}=e;return requestAnimationFrame(()=>{var e;t.isDestroyed||(n.dom.blur(),null==(e=null==window?void 0:window.getSelection())||e.removeAllRanges())}),!0},g=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return t=>{let{commands:n}=t;return n.setContent("",{emitUpdate:e})}},v=()=>e=>{let{state:t,tr:n,dispatch:i}=e,{selection:o}=n,{ranges:s}=o;
1return!i||(s.forEach(e=>{let{$from:i,$to:o}=e;t.doc.nodesBetween(i.pos,o.pos,(e,t)=>{if(e.type.isText)return;let{doc:i,mapping:o}=n,s=i.resolve(o.map(t)),a=i.resolve(o.map(t+e.nodeSize)),l=s.blockRange(a);if(!l)return;let c=(0,r.k9)(l);if(e.type.isTextblock){let{defaultType:e}=s.parent.contentMatchAt(s.index());n.setNodeMarkup(l.start,e)}(c||0===c)&&n.lift(l,c)})}),!0)},y=e=>t=>e(t),b=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.mD)(t,n)},k=(e,t)=>n=>{let{editor:r,tr:i}=n,{state:s}=r,a=s.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);let l=i.mapping.map(t);return i.insert(l,a.content),i.setSelection(new o.Bs(i.doc.resolve(Math.max(l-1,0)))),!0},w=()=>e=>{let{tr:t,dispatch:n}=e,{selection:r}=t,i=r.$anchor.node();if(i.content.size>0)return!1;let o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i.type){if(n){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1};function x(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}var M=e=>t=>{let{tr:n,state:r,dispatch:i}=t,o=x(e,r.schema),s=n.selection.$anchor;for(let e=s.depth;e>0;e-=1)if(s.node(e).type===o){if(i){let t=s.before(e),r=s.after(e);n.delete(t,r).scrollIntoView()}return!0}return!1},S=e=>t=>{let{tr:n,dispatch:r}=t,{from:i,to:o}=e;return r&&n.delete(i,o),!0},E=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.NE)(t,n)},C=()=>e=>{let{commands:t}=e;return t.keyboardShortcut("Enter")},T=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.uo)(t,n)};function O(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function A(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:O(t[r])?t[r].test(e[r]):t[r]===e[r])}function z(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find(e=>e.type===t&&A(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function P(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!z(e,t,n)}function R(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(!z([...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&&P([...e.parent.child(i-1).marks],t,n);)i-=1,o-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&P([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:o,to:a}}function N(e,t){if("string"==typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}var I=(e,t)=>n=>{let{tr:r,state:i,dispatch:s}=n,a=N(e,i.schema),{doc:l,selection:c}=r,{$from:d,from:u,to:h}=c;if(s){let e=R(d,a,t);if(e&&e.from<=u&&e.to>=h){let t=o.Bs.create(l,e.from,e.to);r.setSelection(t)}}return!0},j=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};function H(e){return e instanceof o.Bs}function D(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;let n=o.Y1.atStart(e),r=o.Y1.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,s=r.to;return"all"===t?o.Bs.create(e,D(0,i,s),D(e.content.size,i,s)):o.Bs.create(e,D(t,i,s),D(t,i,s))}function L(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function $(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{editor:r,view:i,tr:o,dispatch:s}=n;t={scrollIntoView:!0,...t};let a=()=>{($()||L())&&i.dom.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!$()&&!L()&&i.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!r.isDestroyed&&(i.focus(),(null==t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())})};try{if(i.hasFocus()&&null===e||!1===e)return!0}catch(e){return!1}if(s&&null===e&&!H(r.state.selection))return a(),!0;let l=B(o.doc,e)||r.state.selection,c=r.state.selection.eq(l);return s&&(c||o.setSelection(l),c&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0}},W=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),_=(e,t)=>
1n=>{let{tr:r,commands:i}=n;return i.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)},U=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&&U(r)}return e};function K(e){return U(new window.DOMParser().parseFromString("<body>".concat(e,"</body>"),"text/html").body)}function F(e,t,n){if(e instanceof s.NB||e instanceof s.HY)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return s.HY.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),F("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new s.V_({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?s.aw.fromSchema(o).parseSlice(K(e),n.parseOptions):s.aw.fromSchema(o).parse(K(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error("Invalid element found: ".concat(i))})}let r=s.aw.fromSchema(t);return n.slice?r.parseSlice(K(e),n.parseOptions).content:r.parse(K(e),n.parseOptions)}return F("",t,n)}var Y=e=>!("type"in e),q=(e,t,n)=>i=>{var a;let{tr:l,dispatch:c,editor:d}=i;if(c){let i,c;n={parseOptions:d.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u=e=>{d.emit("contentError",{editor:d,error:e,disableCollaboration:()=>{"collaboration"in d.storage&&"object"==typeof d.storage.collaboration&&d.storage.collaboration&&(d.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!d.options.enableContentCheck&&d.options.emitContentError)try{F(t,d.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(e){u(e)}try{i=F(t,d.schema,{parseOptions:h,errorOnInvalidContent:null!=(a=n.errorOnInvalidContent)?a:d.options.enableContentCheck})}catch(e){return u(e),!1}let{from:p,to:m}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},f=!0,g=!0;if((Y(i)?i:[i]).forEach(e=>{e.check(),f=!!f&&e.isText&&0===e.marks.length,g=!!g&&e.isBlock}),p===m&&g){let{parent:e}=l.doc.resolve(p);!e.isTextblock||e.type.spec.code||e.childCount||(p-=1,m+=1)}if(f){if(Array.isArray(t))c=t.map(e=>e.text||"").join("");else if(t instanceof s.HY){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),c=e}else c="object"==typeof t&&t&&t.text?t.text:t;l.insertText(c,p,m)}else{c=i;let e=l.doc.resolve(p),t=e.node(),n=0===e.parentOffset,r=t.isText||t.isTextblock,o=t.content.size>0;n&&r&&o&&g&&(p=Math.max(0,p-1)),l.replaceWith(p,m,c)}n.updateSelection&&function(e,t,n){let i=e.steps.length-1;if(i<t)return;let s=e.steps[i];if(!(s instanceof r.Pu||s instanceof r.FC))return;let a=e.mapping.maps[i],l=0;a.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(o.Y1.near(e.doc.resolve(l),-1))}(l,l.steps.length-1,0),n.applyInputRules&&l.setMeta("applyInputRules",{from:p,text:c}),n.applyPasteRules&&l.setMeta("applyPasteRules",{from:p,text:c})}return!0},J=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.MI)(t,n)},X=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.Ig)(t,n)},Z=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.al)(t,n)},Q=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.Y_)(t,n)},G=()=>e=>{let{state:t,dispatch:n,tr:i}=e;try{let e=(0,r.GJ)(t.doc,t.selection.$from.pos,-1);if(null==e)return!1;return i.join(e,2),n&&n(i),!0}catch(e){return!1}},ee=()=>e=>{let{state:t,dispatch:n,tr:i}=e;try{let e=(0,r.GJ)(t.doc,t.selection.$from.pos,1);if(null==e)return!1;return i.join(e,2),n&&n(i),!0}catch(e){return!1}},et=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.rr)(t,n)},en=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.cR)(t,n)};function er(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var ei=e=>t=>{let{editor:n,view:r,tr:i,dispatch:o}=t,s=(function(e){let t,n,r,i;let 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))$()||er()?i=!0:n=!0;else throw Error("Unrecognized modifier name: ".concat(s))}return t&&(s="Alt-".concat(s)),n&&(s="Ctrl-".concat(s)),i&&(s="Meta-".concat(s)),r&&(s="Shift-".concat(s)),s})(e).split(/-(?!$)/),a=s.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
1===a?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=n.captureTransaction(()=>{r.someProp("handleKeyDown",e=>e(r,l))});return null==c||c.steps.forEach(e=>{let t=e.map(i.mapping);t&&o&&i.maybeStep(t)}),!0};function eo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{from:r,to:i,empty:o}=e.selection,s=t?x(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,c=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>A(e.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=l}var es=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n,s=x(e,r.schema);return!!eo(r,s,t)&&(0,i.xb)(r,o)}},ea=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.X0)(t,n)},el=e=>t=>{let{state:n,dispatch:r}=t,i=x(e,n.schema);return(0,a.IB)(i)(n,r)},ec=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.QK)(t,n)};function ed(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function eu(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 eh=(e,t)=>n=>{let{tr:r,state:i,dispatch:o}=n,s=null,a=null,l=ed("string"==typeof e?e:e.name,i.schema);if(!l)return!1;"node"===l&&(s=x(e,i.schema)),"mark"===l&&(a=N(e,i.schema));let c=!1;return r.selection.ranges.forEach(e=>{i.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,n)=>{s&&s===e.type&&(c=!0,o&&r.setNodeMarkup(n,void 0,eu(e.attrs,t))),a&&e.marks.length&&e.marks.forEach(i=>{a===i.type&&(c=!0,o&&r.addMark(n,n+e.nodeSize,a.create(eu(i.attrs,t))))})})}),c},ep=()=>e=>{let{tr:t,dispatch:n}=e;return n&&t.scrollIntoView(),!0},em=()=>e=>{let{tr:t,dispatch:n}=e;if(n){let e=new o.C1(t.doc);t.setSelection(e)}return!0},ef=()=>e=>{let{state:t,dispatch:n}=e;return(0,i._M)(t,n)},eg=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.o)(t,n)},ev=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.N0)(t,n)},ey=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.nw)(t,n)},eb=()=>e=>{let{state:t,dispatch:n}=e;return(0,i.U9)(t,n)};function ek(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return F(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var ew=function(e){let{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i=>{let{editor:o,tr:s,dispatch:a,commands:l}=i,{doc:c}=s;if("full"!==r.preserveWhitespace){let i=ek(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,i).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})}};function ex(e,t){let n=N(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}:{}}function eM(e,t){let n=new r.wx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function eS(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function eE(e){return t=>(function(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}}})(t.$from,e)}function eC(e,t,n){return void 0===e.config[t]&&e.parent?eC(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?eC(e.parent,t,n):null}):e.config[t]}function eT(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=eC(e,"addExtensions",t);return n?[e,...eT(n())]:e}).flat(10)}function eO(e,t){let n=s.PW.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function eA(e){return"function"==typeof e}function ez(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return eA(e)?t?e.bind(t)(...r):e(...r):e}function eP(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function eR(e){let t=[],{nodeExtensions:n,markExtensions:r}=eP(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=eC(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=>{let[r,i]=e;t.push({type:n,name:r,attribute:{...o,...i}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=eC(e,"addAttributes",n);r&&Object.entries(r()).forEach(n=>{let[r,i]=n,s={...o,...i};"function"==typeof(null==s?void 0:s.default)&&(s.default=s.default()),(null==s?void 0:s.isRequired)&&(null==s?void 0:s.default)===void 0&&delete s.default,t.push({type:e.name,name:r,attribute:s})})}),t}function eN(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 eI(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(e=>{let[t,r]=e;if(!n[t]){n[t]=r;return}if("class"===t){let e=r?String(r).split(" "):[],i=n[t]?n[t].split(" "):[],o=e.filter(e=>!i.includes(e));n[t]=[...i,...o].join(" ")}else if("style"===t){let e=new Map([...eN(n[t]),...eN(r)]);n[t]=Array.from(e.entries()).map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n)}).join("; ")}else n[t]=r}),n},{})}function ej(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)=>eI(e,t),{})}function eH(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)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function eD(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return!("attrs"===t&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(n))&&null!=n}))}function eB(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 eL(e){return e.sort((e,t)=>{let n=eC(e,"priority")||100,r=eC(t,"priority")||100;return n>r?-1:n<r?1:0})}function e$(e){let t=eL(eT(e)),n=function(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name));return n.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(n.map(e=>"'".concat(e,"'")).join(", "),"]. This can lead to issues.")),t}function eV(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,c)=>{var d;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:c,range:t})),!1;e.isText&&(a+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,i-n))}),a}function eW(e){return Object.fromEntries(Object.entries(e.nodes).filter(e=>{let[,t]=e;return t.spec.toText}).map(e=>{let[t,n]=e;return[t,n.spec.toText]}))}function e_(e,t){let n=ed("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=x(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}:{}}(e,t):"mark"===n?ex(e,t):{}}function eU(e){let{mapping:t,steps:n}=e,r=[];return 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})}
1o.forEach(e=>{let{from:n,to:o}=e,s=t.slice(i).map(n,-1),a=t.slice(i).map(o),l=t.invert().map(s,-1),c=t.invert().map(a);r.push({oldRange:{from:l,to:c},newRange:{from:s,to:a}})})}),function(e){let t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).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))}(r)}function eK(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=R(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 eF=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,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]};function eY(e,t){return t.nodes[e]||t.marks[e]||null}function eq(e,t,n){return Object.fromEntries(Object.entries(n).filter(n=>{let[r]=n,i=e.find(e=>e.type===t&&e.name===r);return!!i&&i.attribute.keepOnSplit}))}var eJ=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,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 eX(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{empty:r,ranges:i}=e.selection,o=t?N(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>A(e.attrs,n,{strict:!1}));let s=0,a=[];if(i.forEach(t=>{let{$from:n,$to:r}=t,i=n.pos,l=r.pos;e.doc.nodesBetween(i,l,(e,t)=>{if(o&&e.inlineContent&&!e.type.allowsMarkType(o))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(i,t),r=Math.min(l,t+e.nodeSize);s+=r-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:r})))})}),0===s)return!1;let l=a.filter(e=>!o||o.name===e.mark.type.name).filter(e=>A(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=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+c:l)>=s}var eZ=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=eE(e=>e.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},eQ=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function eG(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function e0(e,t){let{nodeExtensions:n}=eP(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=ez(eC(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function e1(e){var t;let{checkChildren:n=!0,ignoreWhitespace:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r){if("hardBreak"===e.type.name)return!0;if(e.isText)return!/\S/.test(null!=(t=e.text)?t:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(n){let t=!0;return e.content.forEach(e=>{!1!==t&&(e1(e,{ignoreWhitespace:r,checkChildren:n})||(t=!1))}),t}return!1}function e2(e){return e instanceof o.qv}var e3=class e{static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}constructor(e){this.position=e}};function e9(e,t){let n=t.mapping.mapResult(e.position);return{position:new e3(n.pos),mapResult:n}}function e4(e){return new e3(e)}var e5=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:i,dispatch:o}=n,{selection:s}=r,{empty:a,ranges:l}=s,c=N(e,i.schema);if(o){if(a){let e=ex(i,c);r.addStoredMark(c.create({...e,...t}))}else l.forEach(e=>{let n=e.$from.pos,o=e.$to.pos;i.doc.nodesBetween(n,o,(e,i)=>{let s=Math.max(i,n),a=Math.min(i+e.nodeSize,o);e.marks.find(e=>
1e.type===c)?e.marks.forEach(e=>{c===e.type&&r.addMark(s,a,c.create({...e.attrs,...t}))}):r.addMark(s,a,c.create(t))})})}return function(e,t,n){var r;let{selection:i}=t,o=null;if(H(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(t=>{let{$from:r,$to:i}=t,o=0===r.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(r.pos,i.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(i,r,c)}},e6=(e,t)=>n=>{let{tr:r}=n;return r.setMeta(e,t),!0},e7=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r,{state:o,dispatch:s,chain:a}=n,l=x(e,o.schema);return(o.selection.$anchor.sameParent(o.selection.$head)&&(r=o.selection.$anchor.parent.attrs),l.isTextblock)?a().command(e=>{let{commands:n}=e;return!!(0,i.uJ)(l,{...r,...t})(o)||n.clearNodes()}).command(e=>{let{state:n}=e;return(0,i.uJ)(l,{...r,...t})(n,s)}).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},e8=e=>t=>{let{tr:n,dispatch:r}=t;if(r){let{doc:t}=n,r=D(e,0,t.content.size),i=o.qv.create(t,r);n.setSelection(i)}return!0},te=(e,t)=>n=>{let r,i,{tr:o,state:s,dispatch:a}=n,{selection:l}=s;return"number"==typeof t?(r=t,i=t):t&&"from"in t&&"to"in t?(r=t.from,i=t.to):(r=l.from,i=l.to),a&&o.doc.nodesBetween(r,i,(t,n)=>{t.isText||o.setNodeMarkup(n,void 0,{...t.attrs,dir:e})}),!0},tt=e=>t=>{let{tr:n,dispatch:r}=t;if(r){let{doc:t}=n,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,s=o.Bs.atStart(t).from,a=o.Bs.atEnd(t).to,l=D(r,s,a),c=D(i,s,a),d=o.Bs.create(t,l,c);n.setSelection(d)}return!0},tn=e=>t=>{let{state:n,dispatch:r}=t,i=x(e,n.schema);return(0,a.bw)(i)(n,r)};function tr(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 ti=function(){let{keepMarks:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let{tr:n,state:i,dispatch:s,editor:a}=t,{selection:l,doc:c}=n,{$from:d,$to:u}=l,h=eq(a.extensionManager.attributes,d.node().type.name,d.node().attrs);if(l instanceof o.qv&&l.node.isBlock)return!!(d.parentOffset&&(0,r.Ax)(c,d.pos))&&(s&&(e&&tr(i,a.extensionManager.splittableMarks),n.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let p=u.parentOffset===u.parent.content.size,m=0===d.depth?void 0:function(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}(d.node(-1).contentMatchAt(d.indexAfter(-1))),f=p&&m?[{type:m,attrs:h}]:void 0,g=(0,r.Ax)(n.doc,n.mapping.map(d.pos),1,f);if(!f&&!g&&(0,r.Ax)(n.doc,n.mapping.map(d.pos),1,m?[{type:m}]:void 0)&&(g=!0,f=m?[{type:m,attrs:h}]:void 0),s){if(g&&(l instanceof o.Bs&&n.deleteSelection(),n.split(n.mapping.map(d.pos),1,f),m&&!p&&!d.parentOffset&&d.parent.type!==m)){let e=n.mapping.map(d.before()),t=n.doc.resolve(e);d.node(-1).canReplaceWith(t.index(),t.index()+1,m)&&n.setNodeMarkup(n.mapping.map(d.before()),m)}e&&tr(i,a.extensionManager.splittableMarks),n.scrollIntoView()}return g}},to=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var i;let{tr:a,state:l,dispatch:c,editor:d}=n,u=x(e,l.schema),{$from:h,$to:p}=l.selection,m=l.selection.node;if(m&&m.isBlock||h.depth<2||!h.sameParent(p))return!1;let f=h.node(-1);if(f.type!==u)return!1;let g=d.extensionManager.attributes;if(0===h.parent.content.size&&h.node(-1).childCount===h.indexAfter(-1)){if(2===h.depth||h.node(-3).type!==u||h.index(-2)!==h.node(-2).childCount-1)return!1;if(c){let e=s.HY.empty,n=h.index(-1)?1:h.index(-2)?2:3;for(let t=h.depth-n;t>=h.depth-3;t-=1)e=s.HY.from(h.node(t).copy(e));let r=h.indexAfter(-1)<h.node(-2).childCount?1:h.indexAfter(-2)<h.node(-3).childCount?2:3,l={...eq(g,h.node().type.name,h.node().attrs),...t},c=(null==(i=u.contentMatch.defaultType)?void 0:i.createAndFill(l))||void 0;e=e.append(s.HY.from(u.createAndFill(null,c)||void 0));let d=h.before(h.depth-(n-1));a.replace(d,h.after(-r),new s.p2(e,4-n,0));let p=-1;a.doc.nodesBetween(d,a.doc.content.size,(e,t)=>{if(p>-1)return!1;e.isTextblock&&0===e.content.size&&(p=t+1)}),p>-1&&a.setSelection(o.Bs.near(a.doc.resolve(p))),a.scrollIntoView()}return!0}let v=p.pos===h.end()?f.contentMatchAt(0).defaultType:null,y={...eq(g,f.type.n
1ame,f.attrs),...t},b={...eq(g,h.node().type.name,h.node().attrs),...t};if(a.delete(h.pos,p.pos),!(0,r.Ax)(a.doc,h.pos,2))return!1;if(c){let{selection:e,storedMarks:t}=l,{splittableMarks:n}=d.extensionManager,r=t||e.$to.parentOffset&&e.$from.marks();if(a.split(h.pos,2,v?[{type:u,attrs:y},{type:v,attrs:b}]:[{type:u,attrs:y}]).scrollIntoView(),!r||!c)return!0;let i=r.filter(e=>n.includes(e.type.name));a.ensureMarks(i)}return!0}},ts=(e,t)=>{let n=eE(e=>e.type===t)(e.selection);if(!n)return!0;let i=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===i)return!0;let o=e.doc.nodeAt(i);return!(n.node.type===(null==o?void 0:o.type)&&(0,r.Mn)(e.doc,n.pos))||(e.join(n.pos),!0)},ta=(e,t)=>{let n=eE(e=>e.type===t)(e.selection);if(!n)return!0;let i=e.doc.resolve(n.start).after(n.depth);if(void 0===i)return!0;let o=e.doc.nodeAt(i);return!(n.node.type===(null==o?void 0:o.type)&&(0,r.Mn)(e.doc,i))||(e.join(i),!0)},tl=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return i=>{let{editor:s,tr:a,state:l,dispatch:c,chain:d,commands:u,can:h}=i,{extensions:p,splittableMarks:m}=s.extensionManager,f=x(e,l.schema),g=x(t,l.schema),{selection:v,storedMarks:y}=l,{$from:b,$to:k}=v,w=b.blockRange(k),M=y||v.$to.parentOffset&&v.$from.marks();if(!w)return!1;let S=eE(e=>e0(e.type.name,p))(v),E=0===v.from&&v.to===l.doc.content.size,C=l.doc.content.content,T=1===C.length?C[0]:null,O=E&&T&&e0(T.type.name,p)?{node:T,pos:0,depth:0}:null,A=null!=S?S:O,z=!!S&&w.depth>=1&&w.depth-S.depth<=1,P=!!O;if((z||P)&&A){if(A.node.type===f)return E&&P?d().command(e=>{let{tr:t,dispatch:n}=e,r=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 o.Bs.between(r,i)}(t);return!!r&&(t.setSelection(r),n&&n(t),!0)}).liftListItem(g).run():u.liftListItem(g);if(e0(A.node.type.name,p)&&f.validContent(A.node.content))return d().command(()=>(a.setNodeMarkup(A.pos,f),!0)).command(()=>ts(a,f)).command(()=>ta(a,f)).run()}return n&&M&&c?d().command(()=>{let e=h().wrapInList(f,r),t=M.filter(e=>m.includes(e.type.name));return a.ensureMarks(t),!!e||u.clearNodes()}).wrapInList(f,r).command(()=>ts(a,f)).command(()=>ta(a,f)).run():d().command(()=>!!h().wrapInList(f,r)||u.clearNodes()).wrapInList(f,r).command(()=>ts(a,f)).command(()=>ta(a,f)).run()}},tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let{state:i,commands:o}=r,{extendEmptyMarkRange:s=!1}=n,a=N(e,i.schema);return eX(i,a,t)?o.unsetMark(a,{extendEmptyMarkRange:s}):o.setMark(a,t)}},td=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let i,{state:o,commands:s}=r,a=x(e,o.schema),l=x(t,o.schema),c=eo(o,a,n);return(o.selection.$anchor.sameParent(o.selection.$head)&&(i=o.selection.$anchor.parent.attrs),c)?s.setNode(l,i):s.setNode(a,{...i,...n})}},tu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,commands:i}=n,o=x(e,r.schema);return eo(r,o,t)?i.lift(o):i.wrapIn(o,t)}},th=()=>e=>{let{state:t,dispatch:n}=e,r=t.plugins;for(let e=0;e<r.length;e+=1){let i;let o=r[e];if(o.spec.isInputRules&&(i=o.getState(t))){if(n){let e=t.tr,n=i.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(i.text){let n=e.doc.resolve(i.from).marks();e.replaceWith(i.from,i.to,t.schema.text(i.text,n))}else e.delete(i.from,i.to)}return!0}}return!1},tp=()=>e=>{let{tr:t,dispatch:n}=e,{selection:r}=t,{empty:i,ranges:o}=r;return!!i||(n&&o.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0)},tm=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var r;let{tr:i,state:o,dispatch:s}=n,{extendEmptyMarkRange:a=!1}=t,{selection:l}=i,c=N(e,o.schema),{$from:d,empty:u,ranges:h}=l;if(!s)return!0;if(u&&a){let{from:e,to:t}=l,n=null==(r=d.marks().find(e=>e.type===c))?void 0:r.attrs,o=R(d,c,n);o&&(e=o.from,t=o.to),i.removeMark(e,t,c)}else h.forEach(e=>{i.removeMark(e.$from.pos,e.$to.pos,c)});return i.removeStoredMark(c),!0}},tf=e=>t=>{let n,r,{tr:i,state:o,dispatch:s}=t,{selection:a}=o;return"number"==typeof e?(n=e,r=e):e&&"from"in e&&"to"in e?(n=e.from,r=e.to):(n=a.from,r=a.to),s&&i.doc.nodesBetween(n,r,(e,t)=>{if(e.isText)return;let n={...e.attrs};delete n.dir,i.setNodeMarkup(t,void 0,n)}),!0},tg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:i,dispatch:o}=n,s=null,a=null,l=ed("string"==typeof e?e:e.name,i.schema);if(!l)return!1;"node"===l&&(s=x(e,i.schema)),"mark"===l&&(a=N(e,i.schema));let c=!1;
1return r.selection.ranges.forEach(e=>{let n,l,d,u;let h=e.$from.pos,p=e.$to.pos;r.selection.empty?i.doc.nodesBetween(h,p,(e,t)=>{s&&s===e.type&&(c=!0,d=Math.max(t,h),u=Math.min(t+e.nodeSize,p),n=t,l=e)}):i.doc.nodesBetween(h,p,(e,i)=>{i<h&&s&&s===e.type&&(c=!0,d=Math.max(i,h),u=Math.min(i+e.nodeSize,p),n=i,l=e),i>=h&&i<=p&&(s&&s===e.type&&(c=!0,o&&r.setNodeMarkup(i,void 0,{...e.attrs,...t})),a&&e.marks.length&&e.marks.forEach(n=>{if(a===n.type&&(c=!0,o)){let o=Math.max(i,h),s=Math.min(i+e.nodeSize,p);r.addMark(o,s,a.create({...n.attrs,...t}))}}))}),l&&(void 0!==n&&o&&r.setNodeMarkup(n,void 0,{...l.attrs,...t}),a&&l.marks.length&&l.marks.forEach(e=>{a===e.type&&o&&r.addMark(d,u,a.create({...e.attrs,...t}))}))}),c}},tv=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n,s=x(e,r.schema);return(0,i.ym)(s,t)(r,o)}},ty=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:i}=n,o=x(e,r.schema);return(0,a.KI)(o,t)(r,i)}},tb=class{on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let i=this.callbacks[e];return i&&i.forEach(e=>e.apply(this,n)),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){var n=this;let r=function(){for(var i=arguments.length,o=Array(i),s=0;s<i;s++)o[s]=arguments[s];n.off(e,r),t.apply(n,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}constructor(){this.callbacks={}}},tk=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}},tw=(e,t)=>{if(O(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};function tx(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 c=l.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1,u=eJ(c)+o;return s.forEach(e=>{if(d)return;let t=tw(u,e.find);if(!t)return;let s=l.state.tr,c=h({state:l.state,transaction:s}),m={from:r-(t[0].length-o.length),to:i}
1,{commands:f,chain:g,can:v}=new p({editor:n,state:c});null!==e.handler({state:c,range:m,match:t,commands:f,chain:g,can:v})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:i,text:o}),l.dispatch(s),d=!0)}),d}function tM(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var tS=class{get options(){return{...ez(eC(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ez(eC(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return tM(t)&&tM(n)&&Object.keys(n).forEach(i=>{tM(n[i])&&tM(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},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}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}},tE=class e extends tS{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e("function"==typeof t?t():t)}static handleExit(e){let{editor:t,mark:n}=e,{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){let e=i.marks();if(!e.find(e=>(null==e?void 0:e.type.name)===n.name))return!1;let o=e.find(e=>(null==e?void 0:e.type.name)===n.name);return o&&r.removeStoredMark(o),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}constructor(){super(...arguments),this.type="mark"}},tC=class{constructor(e){this.find=e.find,this.handler=e.handler}}
1,tT=(e,t,n)=>{if(O(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}):[]},tO=null,tA=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n},tz=class{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:eY(t.name,this.schema)},r=eC(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return eL([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:eY(t.name,this.schema)},r=[],i=eC(t,"addKeyboardShortcuts",n),a={};if("mark"===t.type&&eC(t,"exitable",n)&&(a.ArrowRight=()=>tE.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(t=>{let[n,r]=t;return[n,()=>r({editor:e})]}));a={...a,...t}}let l=(0,c.h)(a);r.push(l);let d=eC(t,"addInputRules",n);if(eG(t,e.options.enableInputRules)&&d){let t=d();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new o.Sy({state:{init:()=>null,apply(e,i,o){let a=e.getMeta(r);if(a)return a;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=eO(s.HY.from(e),o.schema));let{from:i}=l,a=i+e.length;tx({editor:t,from:i,to:a,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>tx({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&tx({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&&tx({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let u=eC(t,"addPasteRules",n);if(eG(t,e.options.enablePasteRules)&&u){let t=u();if(t&&t.length){let n=function(e){let t;let{editor:n,rules:r}=e,i=null,a=!1,l=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(e){t=null}let d=e=>{let{state:r,from:i,to:o,rule:s,pasteEvt:a}=e,l=r.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:c,can:d}=new p({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,i,(e,t)=>{var h,p,m,f,g;if((null==(p=null==(h=e.type)?void 0:h.spec)?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;let v=null!=(g=null!=(f=null==(m=e.content)?void 0:m.size)?f:e.nodeSize)?g:0,y=Math.max(r,t),b=Math.min(i,t+v);y>=b||tT(e.isText?e.text||"":e.textBetween(y-t,b-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=y+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=o.handler({state:n,range:i,match:e,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});u.push(h)})}),u.every(e=>null!==e)}({editor:n,state:h({state:r,transaction:l}),from:Math.max(i-1,0),to:o.b-1,rule:s,pasteEvent:a,dropEvent:t})&&l.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(e){t=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return r.map(e=>new o.Sy({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(tO=n)},r=()=>{tO&&(tO=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(l=i===e.dom.parentElement,t=n,!l){let e=tO;(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)=>
1{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return c=t,a=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],o="paste"===i.getMeta("uiEvent")&&!a,u="drop"===i.getMeta("uiEvent")&&!l,h=i.getMeta("applyPasteRules"),p=!!h;if(!o&&!u&&!p)return;if(p){let{text:t}=h;"string"==typeof t||(t=eO(s.HY.from(t),r.schema));let{from:n}=h,i=n+t.length;return d({rule:e,state:r,from:n,to:{b:i},pasteEvt:tA(t)})}let m=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof m&&f&&m!==f.b)return d({rule:e,state:r,from:m,to:f,pasteEvt:c})}}))}({editor:e,rules:t});r.push(...n)}}let m=eC(t,"addProseMirrorPlugins",n);if(m){let e=m();r.push(...e)}return r})}get attributes(){return eR(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=eP(this.extensions);return Object.fromEntries(t.filter(e=>!!eC(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:x(t.name,this.schema)},i=eC(t,"addNodeView",r);if(!i)return[];let o=i();return o?[t.name,(r,i,s,a,l)=>{let c=ej(r,n);return o({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return eL([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:eY(n.name,this.schema)},i=eC(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return eL([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:eY(n.name,this.schema)},i=eC(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}=eP(this.extensions);return Object.fromEntries(t.filter(e=>!!eC(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:N(t.name,this.schema)},i=eC(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let a=ej(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{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)}(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:eY(e.name,this.schema)};"mark"===e.type&&(null==(t=ez(eC(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=eC(e,"onBeforeCreate",n),i=eC(e,"onCreate",n),o=eC(e,"onUpdate",n),s=eC(e,"onSelectionUpdate",n),a=eC(e,"onTransaction",n),l=eC(e,"onFocus",n),c=eC(e,"onBlur",n),d=eC(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=e$(e),this.schema=function(e,t){var n;let r=eR(e),{nodeExtensions:i,markExtensions:o}=eP(e),a=null==(n=i.find(e=>eC(e,"topNode")))?void 0:n.name,l=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=eD({...e.reduce((e,t)=>{let r=eC(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}
1},{}),content:ez(eC(n,"content",o)),marks:ez(eC(n,"marks",o)),group:ez(eC(n,"group",o)),inline:ez(eC(n,"inline",o)),atom:ez(eC(n,"atom",o)),selectable:ez(eC(n,"selectable",o)),draggable:ez(eC(n,"draggable",o)),code:ez(eC(n,"code",o)),whitespace:ez(eC(n,"whitespace",o)),linebreakReplacement:ez(eC(n,"linebreakReplacement",o)),defining:ez(eC(n,"defining",o)),isolating:ez(eC(n,"isolating",o)),attrs:Object.fromEntries(i.map(eB))}),a=ez(eC(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>eH(e,i)));let l=eC(n,"renderHTML",o);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:ej(e,i)}));let c=eC(n,"renderText",o);return c&&(s.toText=c),[n.name,s]})),c=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=eD({...e.reduce((e,t)=>{let r=eC(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:ez(eC(n,"inclusive",o)),excludes:ez(eC(n,"excludes",o)),group:ez(eC(n,"group",o)),spanning:ez(eC(n,"spanning",o)),code:ez(eC(n,"code",o)),attrs:Object.fromEntries(i.map(eB))}),a=ez(eC(n,"parseHTML",o));a&&(s.parseDOM=a.map(e=>eH(e,i)));let l=eC(n,"renderHTML",o);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:ej(e,i)})),[n.name,s]}));return new s.V_({topNode:a,nodes:l,marks:c})}(this.extensions,t),this.setupExtensions()}};tz.resolve=e$,tz.sort=eL,tz.flatten=eT,u({},{ClipboardTextSerializer:()=>tR,Commands:()=>tN,Delete:()=>tI,Drop:()=>tj,Editable:()=>tH,FocusEvents:()=>tB,Keymap:()=>tL,Paste:()=>t$,Tabindex:()=>tV,TextDirection:()=>tW,focusEventsPluginKey:()=>tD});var tP=class e extends tS{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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)}constructor(){super(...arguments),this.type="extension"}},tR=tP.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),a=Math.max(...o.map(e=>e.$to.pos)),l=eW(n);return eV(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),tN=tP.create({name:"commands",addCommands:()=>({...m})}),tI=tP.create({name:"delete",onUpdate(e){var t,n,i;let{transaction:o,appendedTransactions:s}=e,a=()=>{var e,t,n,i;if(null!=(i=null==(n=null==(t=null==(e=this.editor.options.coreExtensionOptions)?void 0:e.delete)?void 0:t.filterTransaction)?void 0:n.call(t,o))?i:o.getMeta("y-sync$"))return;let a=eM(o.before,[o,...s]);eU(a).forEach(e=>{a.mapping.mapResult(e.oldRange.from).deletedAfter&&a.mapping.mapResult(e.oldRange.to).deletedBefore&&a.before.nodesBetween(e.oldRange.from,e.oldRange.to,(t,n)=>{let r=n+t.nodeSize-2,i=e.oldRange.from<=n&&r<=e.oldRange.to;this.editor.emit("delete",{type:"node",node:t,from:n,to:r,newFrom:a.mapping.map(n),newTo:a.mapping.map(r),deletedRange:e.oldRange,newRange:e.newRange,partial:!i,editor:this.editor,transaction:o,combinedTransform:a})})});let l=a.mapping;a.steps.forEach((e,t)=>{var n,i;if(e instanceof r.xu){let r=l.slice(t).map(e.from,-1),s=l.slice(t).map(e.to),c=l.invert().map(r,-1),d=l.invert().map(s),u=r>0&&(null==(n=a.doc.nodeAt(r-1))?void 0:n.marks.some(t=>t.eq(e.mark))),h=null==(i=a.doc.nodeAt(s))?void 0:i.marks.some(t=>t.eq(e.mark));this.editor.emit("delete",{type:"mark",mark:e.mark,from:e.from,to:e.to,deletedRange:{from:c,to:d},newRange:{from:r,to:s},partial:!!(h||u),editor:this.editor,transaction:o,combinedTransform:a})}})};null==(i=null==(n=null==(t=this.editor.options.coreExtensionOptions)?void 0:t.delete)?void 0:n.async)||i?setTimeout(a,0):a()}}),tj=tP.create({name:"drop",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tH=tP.create({name:"editable",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tD=new o.H$("focusEvents"),tB=tP.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;
1return[new o.Sy({key:tD,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}}}})]}}),tL=tP.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.undoInputRule(),()=>t.command(e=>{let{tr:n}=e,{selection:r,doc:i}=n,{empty:s,$anchor:a}=r,{pos:l,parent:c}=a,d=a.parent.isTextblock&&l>0?n.doc.resolve(l-1):a,u=d.parent.type.spec.isolating,h=a.pos-a.parentOffset,p=u&&1===d.parent.childCount?h===a.pos:o.Y1.atStart(i).from===l;return!!s&&!!c.type.isTextblock&&!c.textContent.length&&!!p&&(!p||"paragraph"!==a.parent.type.name)&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]}),t=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]}),n={Enter:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.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 $()||er()?i:r},addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("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:s,from:a,to:l}=t.selection,c=o.Y1.atStart(t.doc).from,d=o.Y1.atEnd(t.doc).to;if(s||!(a===c&&l===d)||!e1(n.doc))return;let u=n.tr,m=h({state:n,transaction:u}),{commands:f}=new p({editor:this.editor,state:m});if(f.clearNodes(),u.steps.length)return u}})]}}),t$=tP.create({name:"paste",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),tV=tP.create({name:"tabindex",addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),tW=tP.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=eP(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 o.Sy({key:new o.H$("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),t_=class e{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){console.error("You can’t set content on a block node. Tried to set content on ".concat(this.name," at ").concat(this.pos));return}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?0:1)}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?0:1);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 c=new e(l,this.editor,i,i||s?n:null);i&&(c.actualDepth=this.depth+1),t.push(c)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=this.parent;for(;r&&!n;
1){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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],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)}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}},tU=class extends tb{mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.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){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(".".concat(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.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style".concat(n?"-".concat(n):"","]"));if(null!==r)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style".concat(n?"-".concat(n):""),""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}('.ProseMirror {\n  position: relative;\n}\n\n.ProseMirror {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  white-space: break-spaces;\n  -webkit-font-variant-ligatures: none;\n  font-variant-ligatures: none;\n  font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n  white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n  white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n  white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n  display: inline !important;\n  border: none !important;\n  margin: 0 !important;\n  width: 0 !important;\n  height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n  display: none;\n  pointer-events: none;\n  position: absolute;\n  margin: 0;\n}
1\n\n.ProseMirror-gapcursor:after {\n  content: "";\n  display: block;\n  position: absolute;\n  top: -2px;\n  width: 20px;\n  border-top: 1px solid black;\n  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n  to {\n    visibility: hidden;\n  }\n}\n\n.ProseMirror-hideselection *::selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n  background: transparent;\n}\n\n.ProseMirror-hideselection * {\n  caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n  display: block;\n}',this.options.injectNonce))}setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];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['".concat(t,"']. The editor may not be mounted yet."))}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=eA(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=>
1{let t="string"==typeof e?"".concat(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;let n=[...this.options.enableCoreExtensions?[tH,tR.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),tN,tB,tL,tV,tj,t$,tI,tW.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 tz(n,this)}createCommandManager(){this.commandManager=new p({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=ek(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;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()}}),e=ek(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}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 l.tk(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="".concat(this.className," ").concat(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 e_(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return eo(e,null,n)||eX(e,null,n);let r=ed(t,e.schema);return"node"===r?eo(e,t,n):"mark"===r&&eX(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return eO(this.state.doc.content,this.schema)}
1getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){let n={from:0,to:e.content.size};return eV(e,n,t)}(this.state.doc,{blockSeparator:t,textSerializers:{...eW(this.schema),...n}})}get isEmpty(){return e1(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}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){return new t_(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),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:e=>{let{error:t}=e;throw t},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:e9,createMappablePosition:e4},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",e=>{let{event:t,slice:n,moved:r}=e;return this.options.onDrop(t,n,r)}),this.on("paste",e=>{let{event:t,slice:n}=e;return this.options.onPaste(t,n)}),this.on("delete",this.options.onDelete);let t=this.createDoc(),n=B(t,this.options.autofocus);this.editorState=o.yy.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}};function tK(e){return new tk({find:e.find,handler:t=>{let{state:n,range:r,match:i}=t,o=ez(e.getAttributes,void 0,i);if(!1===o||null===o)return null;let{tr:s}=n,a=i[i.length-1],l=i[0];if(a){let t=l.search(/\S/),i=r.from+l.indexOf(a),c=i+a.length;if(eK(r.from,r.to,n.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;c<r.to&&s.delete(c,r.to),i>r.from&&s.delete(r.from+t,i);let d=r.from+t+a.length;s.addMark(r.from+t,d,e.type.create(o||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function tF(e){return new tk({find:e.find,handler:t=>{let{state:n,range:r,match:i}=t,o=ez(e.getAttributes,void 0,i)||{},{tr:s}=n,a=r.from,l=r.to,c=e.type.create(o);if(i[1]){let e=a+i[0].lastIndexOf(i[1]);e>l?e=l:l=e+i[1].length;let t=i[0][i[0].length-1];s.insertText(t,a+i[0].length-1),s.replaceWith(e,l,c)}else if(i[0]){let t=e.type.isInline?a:a-1;s.insert(t,e.type.create(o)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:e.undoable})}function tY(e){return new tk({find:e.find,handler:t=>{let{state:n,range:r,match:i}=t,o=n.doc.resolve(r.from),s=ez(e.getAttributes,void 0,i)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,s)},undoable:e.undoable})}function tq(e){return new tk({find:e.find,handler:t=>{let{state:n,range:i,match:o,chain:s}=t,a=ez(e.getAttributes,void 0,o)||{},l=n.tr.delete(i.from,i.to),c=l.doc.resolve(i.from).blockRange(),d=c&&(0,r.nd)(c,e.type,a);if(!d)return null;if(l.wrap(c,d),e.keepMarks&&e.editor){let{selection:t,storedMarks:r}=n,{splittableMarks:i}=e.editor.extensionManager,o=r||t.$to.parentOffset&&t.$from.marks();if(o){let e=o.filter(e=>
1i.includes(e.type.name));l.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";s().updateAttributes(t,a).run()}let u=l.doc.resolve(i.from-1).nodeBefore;u&&u.type===e.type&&(0,r.Mn)(l.doc,i.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&l.join(i.from-1)},undoable:e.undoable})}var tJ=e=>"touches"in e,tX=class{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.name,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("'.concat(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="".concat(e,"px"),this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height="".concat(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,tJ(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="".concat(o.width,"px"),this.element.style.height="".concat(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}}
1applyConstraints(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}}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.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))}};function tZ(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof o.qv){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 tQ(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),"__QUOTED_".concat(n.length-1,"__"))),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){let e=i.map(e=>e.trim().slice(1));t.class=e.join(" ")}let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(e=>{var r;let[,i,o]=e,s=n[parseInt((null==(r=o.match(/__QUOTED_(\d+)__/))?void 0:r[1])||"0",10)];s&&(t[i]=s.slice(1,-1))});
1let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function tG(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(".".concat(e))),e.id&&t.push("#".concat(e.id)),Object.entries(e).forEach(e=>{let[n,r]=e;"class"!==n&&"id"!==n&&(!0===r?t.push(n):!1!==r&&null!=r&&t.push("".concat(n,'="').concat(String(r),'"')))}),t.join(" ")}function t0(e){let{nodeName:t,name:n,parseAttributes:r=tQ,serializeAttributes:i=tG,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t,c=e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[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("^:::".concat(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=new RegExp("^:::".concat(l,"(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)")),a=e.match(o);if(!a)return;let c=r(a[1]||"");if(!s.find(e=>!(e in c)))return{type:t,raw:a[0],attributes:c}}},renderMarkdown:e=>{let t=i(c(e.attrs||{}));return":::".concat(l).concat(t?" {".concat(t,"}"):""," :::")}}}function t1(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=tQ,serializeAttributes:o=tG,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,c=n||t,d=e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[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("^:::".concat(c),"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=new RegExp("^:::".concat(c,"(?:\\s+\\{([^}]*)\\})?\\s*\\n")),l=e.match(s);if(!l)return;let[d,u=""]=l,h=i(u),p=1,m=d.length,f="",g=/^:::([\w-]*)(\s.*)?/gm,v=e.slice(m);for(g.lastIndex=0;;){let n=g.exec(v);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)p+=1;else if(0==(p-=1)){let o=v.slice(0,i);f=o.trim();let s=e.slice(0,m+i+n[0].length),l=[];if(f){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(f)}return{type:t,raw:s,attributes:h,content:f,tokens:l}}}}}},renderMarkdown:(e,t)=>{let n=o(d(e.attrs||{})),r=t.renderChildren(e.content||[],"\n\n");return":::".concat(c).concat(n?" {".concat(n,"}"):"","\n\n").concat(r,"\n\n:::")}}}function t2(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 t3(e){return Object.entries(e).filter(e=>{let[,t]=e;return null!=t}).map(e=>{let[t,n]=e;return"".concat(t,'="').concat(n,'"')}).join(" ")}function t9(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=t2,serializeAttributes:o=t3,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,c=n||t,d=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},u=c.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=new RegExp(a?"\\[".concat(u,"\\s*[^\\]]*\\]"):"\\[".concat(u,"\\s*[^\\]]*\\][\\s\\S]*?\\[\\/").concat(u,"\\]")),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=new RegExp(a?"^\\[".concat(u,"\\s*([^\\]]*)\\]"):"^\\[".concat(u,"\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/").concat(u,"\\]")),s=e.match(o);if(!s)return;let l="",c="";if(a){let[,e]=s;c=e}else{let[,e,t]=s;c=e,l=t||""}let d=i(c.trim());return{type:t,raw:s[0],content:l.trim(),attributes:d}}},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(d(e.attrs||{})),i=n?" ".concat(n):"";return a?"[".concat(c).concat(i,"]"):"[".concat(c).concat(i,"]").concat(t,"[/").concat(c,"]")}}}function t4(e,t,n){var r,i,o,s;let a=e.split("\n"),l=[],c="",d=0,u=t.baseIndentSize||2;for(;d<a.length;){let e;let h=a[d],p=h.match(t.itemPattern);if(!p){if(l.length>0)break;if(""!==h.trim())return;d+=1,c="".concat(c).concat(h,"\n");continue}let m=t.extractItemData(p),{indentLevel:f,mainContent:g}=m;c="".concat(c).concat(h,"\n");let v=[g];for(d+=1;d<a.length;){let e=a[d];if(""===e.trim()){let t=a.slice(d+1).findIndex(e=>""!==e.trim());if(-1===t)break;
1if(((null==(i=null==(r=a[d+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>f){v.push(e),c="".concat(c).concat(e,"\n"),d+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>f)v.push(e),c="".concat(c).concat(e,"\n"),d+=1;else break}let y=v.slice(1);if(y.length>0){let r=y.map(e=>e.slice(f+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let b=t.createToken(m,e);l.push(b)}if(0!==l.length)return{items:l,raw:c}}function t5(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="".concat(i).concat(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?"\n\n".concat(n):"\n".concat(n)}}),l}u({},{createAtomBlockMarkdownSpec:()=>t0,createBlockMarkdownSpec:()=>t1,createInlineMarkdownSpec:()=>t9,parseAttributes:()=>tQ,parseIndentedBlocks:()=>t4,renderNestedMarkdownContent:()=>t5,serializeAttributes:()=>tG});var t6=class e extends tS{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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)}constructor(){super(...arguments),this.type="node"}};function t7(e){return new tC({find:e.find,handler:t=>{let{state:n,range:r,match:i,pasteEvent:o}=t,s=ez(e.getAttributes,void 0,i,o);if(!1===s||null===s)return null;let{tr:a}=n,l=i[i.length-1],c=i[0],d=r.to;if(l){let t=c.search(/\S/),o=r.from+c.indexOf(l),u=o+l.length;if(eK(r.from,r.to,n.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;u<r.to&&a.delete(u,r.to),o>r.from&&a.delete(r.from+t,o),d=r.from+t+l.length,a.addMark(r.from+t,d,e.type.create(s||{})),void 0!==i.index&&void 0!==i.input&&i.index+i[0].length>=i.input.length||a.removeStoredMark(e.type)}}})}}}]);

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.