1import{N as k,m as y,w as H,M as P,i as L,b as x,j as ne,S,t as W,P as B,a as K,T as C,k as re,E as D,l as se,o as z,F as G,p as Y,q as ie,r as oe,s as ae,u as le,v as ue,x as de,n as pe,H as ce}from"./index-CRvmyhiy.js";const he=/^\s*>\s$/,fe=k.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[H({find:he,type:this.type})]}}),me=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ge=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,ye=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,ve=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,be=P.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[L({find:me,type:this.type}),L({find:ye,type:this.type})]},addPasteRules(){return[x({find:ge,type:this.type}),x({find:ve,type:this.type})]}}),F=k.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",y(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),O=P.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",y(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=ne(t,this.type);return Object.entries(n).some(([,r])=>!!r)?!0:e.unsetMark(this.name)}}}}),q=/^\s*([-+*])\s$/,Me=k.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",y(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(F.name,this.editor.getAttributes(O.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=H({find:q,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=H({find:q,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(O.name),editor:this.editor})),[t]}}),ke=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,Ae=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,Te=P.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
vendor: 2,799 bytes, lines 1-4
1,addInputRules(){return[L({find:ke,type:this.type})]},addPasteRules(){return[x({find:Ae,type:this.type})]}}),we=/^```([a-z]+)?[\s\n]$/,Ce=/^~~~([a-z]+)?[\s\n]$/,Le=k.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",y(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:s,empty:r}=n;if(!r||s.parent.type!==this.type)return!1;const i=s.parentOffset===s.parent.nodeSize-2,o=s.parent.textContent.endsWith(` 2 3`);return!i||!o?!1:t.chain().command(({tr:a})=>(a.delete(s.pos-2,s.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:s}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const a=r.after();return a===void 0?!1:s.nodeAt(a)?t.commands.command(({tr:u})=>(u.setSelection(S.near(s.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[W({find:we,type:this.type,getAttributes:t=>({language:t[1]})}),W({find:Ce,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new B({key:new K("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),s=e.clipboardData.getData("vscode-editor-data"),r=s?JSON.parse(s):void 0,i=r==null?void 0:r.mode;if(!n||!i)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` 4`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(C.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}
vendor: 4,334 bytes, line 4
4),xe=k.create({name:"doc",topNode:!0,content:"block+"});function Ie(t={}){return new B({view(e){return new He(e,t)}})}class He{constructor(e,n){var s;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(s=n.width)!==null&&s!==void 0?s:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=o=>{this[r](o)};return e.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,s;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let u=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(u){let p=u.getBoundingClientRect(),d=a?p.bottom:p.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),s={left:p.left,right:p.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!s){let a=this.editorView.coordsAtPos(this.cursorPos);s={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,o;if(!r||r==document.body&&getComputedStyle(r).position=="static")i=-pageXOffset,o=-pageYOffset;else{let a=r.getBoundingClientRect();i=a.left-r.scrollLeft,o=a.top-r.scrollTop}this.element.style.left=s.left-i+"px",this.element.style.top=s.top-o+"px",this.element.style.width=s.right-s.left+"px",this.element.style.height=s.bottom-s.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),s=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=s&&s.type.spec.disableDropCursor,i=typeof r=="function"?r(this.editorView,n,e):r;if(n&&!i){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=re(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Se=D.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ie(this.options)]}});class h extends S{constructor(e){super(e,e)}map(e,n){let s=e.resolve(n.map(this.head));return h.valid(s)?new h(s):S.near(s)}content(){return Y.empty}eq(e){return e instanceof h&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new h(e.resolve(n.pos))}getBookmark(){return new j(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!Pe(e)||!Ee(e))return!1;let s=n.type.spec.allowGapCursor;if(s!=null)return s;let r=n.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,n,s=!1){e:for(;;){if(!s&&h.valid(e))return e;let r=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)<a.childCount:e.index(o)>0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;r+=n;let l=e.doc.resolve(r);if(h.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!z.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*n),s=!1;continue e}break}i=o,r+=n;let a=e.doc.resolve(r);if(h.valid(a))return a}return null}}}h.prototype.visible=!1;h.findFrom=h.findGapCursorFrom;S.jsonID("gapcursor",h);
vendor: 7,058 bytes, lines 4-5
4class j{constructor(e){this.pos=e}map(e){return new j(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return h.valid(n)?new h(n):S.near(n)}}function Pe(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),s=t.node(e);if(n==0){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function Ee(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),s=t.node(e);if(n==s.childCount){if(s.type.spec.isolating)return!0;continue}for(let r=s.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function _e(){return new B({props:{decorations:De,createSelectionBetween(t,e,n){return e.pos==n.pos&&h.valid(n)?new h(n):null},handleClick:Re,handleKeyDown:Oe,handleDOMEvents:{beforeinput:Be}}})}const Oe=se({ArrowLeft:E("horiz",-1),ArrowRight:E("horiz",1),ArrowUp:E("vert",-1),ArrowDown:E("vert",1)});function E(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(s,r,i){let o=s.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof C){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=s.doc.resolve(e>0?a.after():a.before())}let u=h.findGapCursorFrom(a,e,l);return u?(r&&r(s.tr.setSelection(new h(u))),!0):!1}}function Re(t,e,n){if(!t||!t.editable)return!1;let s=t.state.doc.resolve(e);if(!h.valid(s))return!1;let r=t.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&z.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new h(s))),!0)}function Be(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof h))return!1;let{$from:n}=t.state.selection,s=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!s)return!1;let r=G.empty;for(let o=s.length-1;o>=0;o--)r=G.from(s[o].createAndFill(null,r));let i=t.state.tr.replace(n.pos,n.pos,new Y(r,0,0));return i.setSelection(C.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function De(t){if(!(t.selection instanceof h))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ie.create(t.doc,[oe.widget(t.selection.head,e,{key:"gapcursor"})])}const Ne=D.create({name:"gapCursor",addProseMirrorPlugins(){return[_e()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ae(le(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),$e=k.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",y(this.options.HTMLAttributes,t)]},renderText(){return` 5`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:s})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:i}=n;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=s.extensionManager,l=i||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:p})=>{if(p&&l&&o){const d=l.filter(c=>a.includes(c.type.name));u.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var R=200,g=function(){};g.prototype.append=function(e){return e.length?(e=g.from(e),!this.length&&e||e.length<R&&this.leafAppend(e)||this.length<R&&e.leafPrepend(this)||this.appendInner(e)):this};g.prototype.prepend=function(e){return e.length?g.from(e).append(this):this};g.prototype.appendInner=function(e){return new Ve(this,e)};g.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?g.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};g.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};g.prototype.forEach=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length),n<=s?this.forEachInner(e,n,s,0):this.forEachInvertedInner(e,n,s,0)};g.prototype.map=function(e,n,s){n===void 0&&(n=0),s===void 0&&(s=this.length);var r=[];return this.forEach(function(i,o){return r.push(e(i,o))},n,s),r};g.from=function(e){return e instanceof g?e:e&&e.length?new Z(e):g.empty};var Z=function(t){function e(s){t.call(this),this.values=s}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,a){for(var l=i;l<o;l++)if(r(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){for(var l=i-1;l>=o;l--)if(r(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=R)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=R)return new e(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(g);g.empty=new Z([]);var Ve=function(t){function e(n,s){t.call(this),this.left=n,this.right=s,this.length=n.length+s.length,this.depth=Math.max(n.depth,s.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(s){return s<this.left.length?this.left.get(s):this.right.get(s-this.left.length)},e.prototype.forEachInner=function(s,r,i,o){var a=this.left.length;if(r<a&&this.left.forEachInner(s,r,Math.min(i,a),o)===!1||i>a&&this.right.forEachInner(s,Math.max(r-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,r,i,o){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(s,r-a,Math.max(i,a)-a,o+a)===!1||i<a&&this.left.forEachInvertedInner(s,Math.min(r,a),i,o)===!1)return!1},e.prototype.sliceInner=function(s,r){if(s==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(s,r):s>=i?this.right.slice(s-i,r-i):this.left.slice(s,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(s){var r=this.right.leafAppend(s);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(s){var r=this.left.leafPrepend(s);if(r)return new e(r,this.right)},e.prototype.appendInner=function(s){return this.left.depth>=Math.max(this.right.depth,s.depth)+1?new e(this.left,new e(this.right,s)):new e(this,s)},e}(g);const Ke=500;class b{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}let r,i;n&&(r=this.remapping(s,this.items.length),i=r.maps.length);let o=e.tr,a,l,u=[],p=[];
vendor: 4,091 bytes, line 5
5return this.items.forEach((d,c)=>{if(!d.step){r||(r=this.remapping(s,c+1),i=r.maps.length),i--,p.push(d);return}if(r){p.push(new M(d.map));let f=d.step.map(r.slice(i)),v;f&&o.maybeStep(f).doc&&(v=o.mapping.maps[o.mapping.maps.length-1],u.push(new M(v,void 0,void 0,u.length+p.length))),i--,v&&r.appendMap(v,i)}else o.maybeStep(d.step);if(d.selection)return a=r?d.selection.map(r.slice(i)):d.selection,l=new b(this.items.slice(0,s).append(p.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,s,r){let i=[],o=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let p=0;p<e.steps.length;p++){let d=e.steps[p].invert(e.docs[p]),c=new M(e.mapping.maps[p],d,n),f;(f=l&&l.merge(c))&&(c=f,p?i.pop():a=a.slice(0,a.length-1)),i.push(c),n&&(o++,n=void 0),r||(l=c)}let u=o-s.depth;return u>Fe&&(a=ze(a,u),o-=u),new b(a.append(i),o)}remapping(e,n){let s=new ue;return this.items.forEach((r,i)=>{let o=r.mirrorOffset!=null&&i-r.mirrorOffset>=e?s.maps.length-r.mirrorOffset:void 0;s.appendMap(r.map,o)},e,n),s}addMaps(e){return this.eventCount==0?this:new b(this.items.append(e.map(n=>new M(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let s=[],r=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(c=>{c.selection&&a--},r);let l=n;this.items.forEach(c=>{let f=i.getMirror(--l);if(f==null)return;o=Math.min(o,f);let v=i.maps[f];if(c.step){let I=e.steps[f].invert(e.docs[f]),w=c.selection&&c.selection.map(i.slice(l+1,f));w&&a++,s.push(new M(v,I,w))}else s.push(new M(v))},r);let u=[];for(let c=n;c<o;c++)u.push(new M(i.maps[c]));let p=this.items.slice(0,r).append(u).append(s),d=new b(p,a);return d.emptyItemCount()>Ke&&(d=d.compress(this.items.length-s.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),s=n.maps.length,r=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)r.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(s)),u=l&&l.getMap();if(s--,u&&n.appendMap(u,s),l){let p=o.selection&&o.selection.map(n.slice(s));p&&i++;let d=new M(u.invert(),l,p),c,f=r.length-1;(c=r.length&&r[f].merge(d))?r[f]=c:r.push(d)}}else o.map&&s--},this.items.length,0),new b(g.from(r.reverse()),i)}}b.empty=new b(g.empty,0);function ze(t,e){let n;return t.forEach((s,r)=>{if(s.selection&&e--==0)return n=r,!1}),t.slice(n)}class M{constructor(e,n,s,r){this.map=e,this.step=n,this.selection=s,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new M(n.getMap().invert(),n,this.selection)}}}class A{constructor(e,n,s,r,i){this.done=e,this.undone=n,this.prevRanges=s,this.prevTime=r,this.prevComposition=i}}const Fe=20;function je(t,e,n,s){let r=n.getMeta(T),i;if(r)return r.historyState;n.getMeta(qe)&&(t=new A(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(T))return o.getMeta(T).redo?new A(t.done.addTransform(n,void 0,s,_(e)),t.undone,J(n.mapping.maps),t.prevTime,t.prevComposition):new A(t.done,t.undone.addTransform(n,void 0,s,_(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-s.newGroupDelay||!We(n,t.prevRanges)),u=o?$(t.prevRanges,n.mapping):J(n.mapping.maps);return new A(t.done.addTransform(n,l?e.selection.getBookmark():void 0,s,_(e)),b.empty,u,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new A(t.done.rebased(n,i),t.undone.rebased(n,i),$(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new A(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),$(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function We(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((s,r)=>{for(let i=0;i<e.length;i+=2)s<=e[i+1]&&r>=e[i]&&(n=!0)}),n}function J(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;
vendor: 2,771 bytes, line 5
5n--)t[n].forEach((s,r,i,o)=>e.push(i,o));return e}function $(t,e){if(!t)return null;let n=[];for(let s=0;s<t.length;s+=2){let r=e.map(t[s],1),i=e.map(t[s+1],-1);r<=i&&n.push(r,i)}return n}function Ge(t,e,n){let s=_(e),r=T.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,s);if(!i)return null;let o=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),r,s),l=new A(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(o).setMeta(T,{redo:n,historyState:l})}let V=!1,U=null;function _(t){let e=t.plugins;if(U!=e){V=!1,U=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){V=!0;break}}return V}const T=new K("history"),qe=new K("closeHistory");function Je(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new B({key:T,state:{init(){return new A(b.empty,b.empty,null,0,-1)},apply(e,n,s){return je(n,s,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let s=n.inputType,r=s=="historyUndo"?ee:s=="historyRedo"?te:null;return r?(n.preventDefault(),r(e.state,e.dispatch)):!1}}}})}function Q(t,e){return(n,s)=>{let r=T.getState(n);if(!r||(t?r.undone:r.done).eventCount==0)return!1;if(s){let i=Ge(r,n,t);i&&s(e?i.scrollIntoView():i)}return!0}}const ee=Q(!1,!0),te=Q(!0,!0),Ue=D.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>ee(t,e),redo:()=>({state:t,dispatch:e})=>te(t,e)}},addProseMirrorPlugins(){return[Je(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),Xe=k.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",y(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:s,$to:r}=n,i=t();return s.parentOffset===0?i.insertContentAt({from:Math.max(s.pos-1,0),to:r.pos},{type:this.name}):de(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:o,dispatch:a})=>{var l;if(a){const{$to:u}=o.selection,p=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(C.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(z.create(o.doc,u.pos)):o.setSelection(C.create(o.doc,u.pos));else{const d=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(o.insert(p,d),o.setSelection(C.create(o.doc,p+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[pe({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 5,576 bytes, line 5
5ype})]}}),Ye=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Ze=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Qe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,et=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tt=P.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[L({find:Ye,type:this.type}),L({find:Qe,type:this.type})]},addPasteRules(){return[x({find:Ze,type:this.type}),x({find:et,type:this.type})]}}),X=/^(\d+)\.\s$/,nt=k.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",y(this.options.HTMLAttributes,n),0]:["ol",y(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(F.name,this.editor.getAttributes(O.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=H({find:X,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=H({find:X,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(O.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),rt=k.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),st=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,it=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,ot=P.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",y(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[L({find:st,type:this.type})]},addPasteRules(){return[x({find:it,type:this.type})]}}),at=k.create({name:"text",group:"inline"}),ut=D.create({name:"starterKit",addExtensions(){var t,e,n,s,r,i,o,a,l,u,p,d,c,f,v,I,w,N;const m=[];return this.options.bold!==!1&&m.push(be.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&m.push(fe.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&m.push(Me.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&m.push(Te.configure((s=this.options)===null||s===void 0?void 0:s.code)),this.options.codeBlock!==!1&&m.push(Le.configure((r=this.options)===null||r===void 0?void 0:r.codeBlock)),this.options.document!==!1&&m.push(xe.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&m.push(Se.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&m.push(Ne.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&m.push($e.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&m.push(ce.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&m.push(Ue.configure((p=this.options)===null||p===void 0?void 0:p.history)),this.options.horizontalRule!==!1&&m.push(Xe.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&m.push(tt.configure((c=this.options)===null||c===void 0?void 0:c.italic)),this.options.listItem!==!1&&m.push(F.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&m.push(nt.configure((v=this.options)===null||v===void 0?void 0:v.orderedList)),this.options.paragraph!==!1&&m.push(rt.configure((I=this.options)===null||I===void 0?void 0:I.paragraph)),this.options.strike!==!1&&m.push(ot.configure((w=this.options)===null||w===void 0?void 0:w.strike)),this.options.text!==!1&&m.push(at.configure((N=this.options)===null||N===void 0?void 0:N.text)),m}});export{ut as S};
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.