PageSourceSearch

https://www.xalia.ai/_next/static/chunks/1b3e6c92.ca1b189e85c55a8f.js

js xalia.ai collected 2026-10-05 15:26:43 UTC 58,658 bytes, 9 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[630],{71649:(e,t,n)=>{n.d(t,{Db:()=>tM,Yv:()=>tw,zU:()=>eS});var r=n(43421),o=n(34597),i=n(92710),a=n(52108),s=n(13655);n(37632);var l=n(40027),d=Object.defineProperty,c=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})};function u(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:o}=n,{storedMarks:i}=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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var p=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a=[],s=!!e,l=e||o.tr,d=()=>(s||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),a.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),o=n(...e)(r);return a.push(o),c}])),run:d};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,a={tr:e,editor:r,view:i,state:u({state:o,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(a)]))}};return a}},m={};c(m,{blur:()=>f,clearContent:()=>h,clearNodes:()=>g,command:()=>y,createParagraphNear:()=>v,cut:()=>b,deleteCurrentNode:()=>k,deleteNode:()=>M,deleteRange:()=>w,deleteSelection:()=>E,enter:()=>S,exitCode:()=>O,extendMarkRange:()=>N,first:()=>R,focus:()=>L,forEach:()=>_,insertContent:()=>F,insertContentAt:()=>V,joinBackward:()=>Z,joinDown:()=>q,joinForward:()=>J,joinItemBackward:()=>Q,joinItemForward:()=>Y,joinTextblockBackward:()=>G,joinTextblockForward:()=>X,joinUp:()=>W,keyboardShortcut:()=>et,lift:()=>er,liftEmptyBlock:()=>eo,liftListItem:()=>ei,newlineInCode:()=>ea,resetAttributes:()=>ed,scrollIntoView:()=>ec,selectAll:()=>eu,selectNodeBackward:()=>ep,selectNodeForward:()=>em,selectParentNode:()=>ef,selectTextblockEnd:()=>eh,selectTextblockStart:()=>eg,setContent:()=>ey,setMark:()=>eI,setMeta:()=>eP,setNode:()=>ez,setNodeSelection:()=>eB,setTextDirection:()=>eL,setTextSelection:()=>e_,sinkListItem:()=>eF,splitBlock:()=>eH,splitListItem:()=>eK,toggleList:()=>eq,toggleMark:()=>eZ,toggleNode:()=>eJ,toggleWrap:()=>eQ,undoInputRule:()=>eY,unsetAllMarks:()=>eG,unsetMark:()=>eX,unsetTextDirection:()=>e0,updateAttributes:()=>e1,wrapIn:()=>e2,wrapInList:()=>e3});var f=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),h=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),g=()=>({state:e,tr:t,dispatch:n})=>{let{selection:o}=t,{ranges:i}=o;return!n||(i.forEach(({$from:n,$to:o})=>{e.doc.nodesBetween(n.pos,o.pos,(e,n)=>{if(e.type.isText)return;let{doc:o,mapping:i}=t,a=o.resolve(i.map(n)),s=o.resolve(i.map(n+e.nodeSize)),l=a.blockRange(s);if(!l)return;let d=(0,r.jP)(l);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(l.start,e)}(d||0===d)&&t.lift(l,d)})}),!0)},y=e=>t=>e(t),v=()=>({state:e,dispatch:t})=>(0,o.Z1)(e,t),b=(e,t)=>({editor:n,tr:r})=>{let{state:o}=n,a=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,a.content),r.setSelection(new i.U3(r.doc.resolve(Math.max(s-1,0)))),!0},k=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){let t=o.before(n),r=o.after(n);e.delete(t,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 '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var M=e=>({tr:t,state:n,dispatch:r})=>{let o=x(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},w=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},E=()=>({state:e,dispatch:t})=>(0,o.ic)(e,t),S=()=>({commands:e})=>e.keyboardShortcut("Enter"),O=()=>({state:e,dispatch:t})=>(0,o.I$)(e,t);function T(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function $(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:T(t[r])?t[r].test(e[r]):t[r]===e[r])}function C(e,t,n={}){return e.find(e=>e.type===t&&$(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function A(e,t,n={}){return!!C(e,t,n)}function j(e,t,n){var r;if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if(o.node&&o.node.marks.some(e=>e.type===t)||(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(e=>e.type===t)||(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),!C([...o.node.marks],t,n)))return;let i=o.index,a=e.start()+o.offset,s=i+1,l=a+o.node.nodeSize;
1for(;i>0&&A([...e.parent.child(i-1).marks],t,n);)i-=1,a-=e.parent.child(i).nodeSize;for(;s<e.parent.childCount&&A([...e.parent.child(s).marks],t,n);)l+=e.parent.child(s).nodeSize,s+=1;return{from:a,to:l}}function D(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var N=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let a=D(e,r.schema),{doc:s,selection:l}=n,{$from:d,from:c,to:u}=l;if(o){let e=j(d,a,t);if(e&&e.from<=c&&e.to>=u){let t=i.U3.create(s,e.from,e.to);n.setSelection(t)}}return!0},R=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 I(e){return e instanceof i.U3}function P(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function z(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function B(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var L=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:a})=>{t={scrollIntoView:!0,...t};let s=()=>{(B()||z())&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;if(a&&null===e&&!I(n.state.selection))return s(),!0;let l=function(e,t=null){if(!t)return null;let n=i.LN.atStart(e),r=i.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let o=n.from,a=r.to;return"all"===t?i.U3.create(e,P(0,o,a),P(e.content.size,o,a)):i.U3.create(e,P(t,o,a),P(t,o,a))}(o.doc,e)||n.state.selection,d=n.state.selection.eq(l);return a&&(d||o.setSelection(l),d&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},_=(e,t)=>
1n=>e.every((e,r)=>t(e,{...n,index:r})),F=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.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 H(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return U(new window.DOMParser().parseFromString(t,"text/html").body)}function K(e,t,n){if(e instanceof a.bP||e instanceof a.FK)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,o="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return a.FK.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),K("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new a.Sj({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,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?a.S4.fromSchema(i).parseSlice(H(e),n.parseOptions):a.S4.fromSchema(i).parse(H(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${o}`)})}let r=a.S4.fromSchema(t);return n.slice?r.parseSlice(H(e),n.parseOptions).content:r.parse(H(e),n.parseOptions)}return K("",t,n)}var V=(e,t,n)=>({tr:o,dispatch:s,editor:l})=>{var d;if(s){let s,c;n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u=e=>{l.emit("contentError",{editor:l,error:e,disableCollaboration:()=>{"collaboration"in l.storage&&"object"==typeof l.storage.collaboration&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},p={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{K(t,l.schema,{parseOptions:p,errorOnInvalidContent:!0})}catch(e){u(e)}try{s=K(t,l.schema,{parseOptions:p,errorOnInvalidContent:null!=(d=n.errorOnInvalidContent)?d:l.options.enableContentCheck})}catch(e){return u(e),!1}let{from:m,to:f}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,g=!0;if((!("type"in s)?s:[s]).forEach(e=>{e.check(),h=!!h&&e.isText&&0===e.marks.length,g=!!g&&e.isBlock}),m===f&&g){let{parent:e}=o.doc.resolve(m);!e.isTextblock||e.type.spec.code||e.childCount||(m-=1,f+=1)}if(h){if(Array.isArray(t))c=t.map(e=>e.text||"").join("");else if(t instanceof a.FK){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),c=e}else c="object"==typeof t&&t&&t.text?t.text:t;o.insertText(c,m,f)}else{c=s;let e=o.doc.resolve(m),t=e.node(),n=0===e.parentOffset,r=t.isText||t.isTextblock,i=t.content.size>0;n&&r&&i&&(m=Math.max(0,m-1)),o.replaceWith(m,f,c)}n.updateSelection&&function(e,t,n){let o=e.steps.length-1;if(o<t)return;let a=e.steps[o];if(!(a instanceof r.Ln||a instanceof r.Wg))return;let s=e.mapping.maps[o],l=0;s.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(i.LN.near(e.doc.resolve(l),-1))}(o,o.steps.length-1,0),n.applyInputRules&&o.setMeta("applyInputRules",{from:m,text:c}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:m,text:c})}return!0},W=()=>({state:e,dispatch:t})=>(0,o.G2)(e,t),q=()=>({state:e,dispatch:t})=>(0,o.bh)(e,t),Z=()=>({state:e,dispatch:t})=>(0,o.Qv)(e,t),J=()=>({state:e,dispatch:t})=>(0,o.eT)(e,t),Q=()=>({state:e,dispatch:t,tr:n})=>{try{let o=(0,r.N0)(e.doc,e.selection.$from.pos,-1);if(null==o)return!1;return n.join(o,2),t&&t(n),!0}catch{return!1}},Y=()=>({state:e,dispatch:t,tr:n})=>{try{let o=(0,r.N0)(e.doc,e.selection.$from.pos,1);if(null==o)return!1;return n.join(o,2),t&&t(n),!0}catch{return!1}},G=()=>({state:e,dispatch:t})=>(0,o.eB)(e,t),X=()=>({state:e,dispatch:t})=>(0,o._G)(e,t);function ee(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var et=e=>({editor:t,view:n,tr:r,dispatch:o})=>{let i=(function(e){let t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"===a&&(a=" ");for(let e=0;e<i.length-1;e+=1){let a=i[e];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else if(/^s(hift)?$/i.test(a))r=!0;else if(/^mod$/i.test(a))B()||ee()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${a}`)}return t&&(a=`Alt-${a}`),n&&(a=`Ctrl-${a}`),o&&(a=`Meta-${a}`),r&&(a=`Shift-${a}`),a})(e).split(/-(?!$)/),a=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),s=new KeyboardEvent("keydown",{key:"Space"
1===a?" ":a,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,s))});return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function en(e,t,n={}){let{from:r,to:o,empty:i}=e.selection,a=t?x(t,e.schema):null,s=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s.push({node:e,from:n,to:i})});let l=o-r,d=s.filter(e=>!a||a.name===e.node.type.name).filter(e=>$(e.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=l}var er=(e,t={})=>({state:n,dispatch:r})=>{let i=x(e,n.schema);return!!en(n,i,t)&&(0,o.yY)(n,r)},eo=()=>({state:e,dispatch:t})=>(0,o.iz)(e,t),ei=e=>({state:t,dispatch:n})=>{let r=x(e,t.schema);return(0,s.T2)(r)(t,n)},ea=()=>({state:e,dispatch:t})=>(0,o.pC)(e,t);function es(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function el(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 ed=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null,s=es("string"==typeof e?e:e.name,r.schema);if(!s)return!1;"node"===s&&(i=x(e,r.schema)),"mark"===s&&(a=D(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,el(e.attrs,t))),a&&e.marks.length&&e.marks.forEach(i=>{a===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,a.create(el(i.attrs,t))))})})}),l},ec=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),eu=()=>({tr:e,dispatch:t})=>{if(t){let t=new i.i5(e.doc);e.setSelection(t)}return!0},ep=()=>({state:e,dispatch:t})=>(0,o._e)(e,t),em=()=>({state:e,dispatch:t})=>(0,o.Sd)(e,t),ef=()=>({state:e,dispatch:t})=>(0,o.hy)(e,t),eh=()=>({state:e,dispatch:t})=>(0,o.ec)(e,t),eg=()=>({state:e,dispatch:t})=>(0,o.$f)(e,t),ey=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:a,commands:s})=>{let{doc:l}=i;if("full"!==r.preserveWhitespace){let s=function(e,t,n={},r={}){return K(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return a&&i.replaceWith(0,l.content.size,s).setMeta("preventUpdate",!n),!0}return a&&i.setMeta("preventUpdate",!n),s.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function ev(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 eb(e,t,n){return void 0===e.config[t]&&e.parent?eb(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?eb(e.parent,t,n):null}):e.config[t]}function ek(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=eb(e,"addExtensions",t);return n?[e,...ek(n())]:e}).flat(10)}function ex(e,t){let n=a.ZF.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function eM(e,t,...n){return"function"==typeof e?t?e.bind(t)(...n):e(...n):e}function ew(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function eE(e){let t=[],{nodeExtensions:n,markExtensions:r}=ew(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:o},r=eb(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=eb(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&(null==o?void 0:o.default)===void 0&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function eS(e,t){return t.filter(t=>
1t.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)=>(function(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],i=new Map;o.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[e]=Array.from(i.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})})(e,t),{})}function eO(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 o=t.reduce((e,t)=>{var r;let o=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==o?e:{...e,[t.name]:o}},{});return{...r,...o}}}}function eT(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function e$(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 eC(e){return e.sort((e,t)=>{let n=eb(e,"priority")||100,r=eb(t,"priority")||100;return n>r?-1:+(n<r)})}function eA(e){var t;let n=eC(ek(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function ej(e,t){return t.nodes[e]||t.marks[e]||null}function eD(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function eN(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function eR(e,t){let{nodeExtensions:n}=ew(t),r=n.find(t=>t.name===e);if(!r)return!1;let o={name:r.name,options:r.options,storage:r.storage},i=eM(eb(r,"group",o));return"string"==typeof i&&i.split(" ").includes("list")}var eI=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:a,ranges:s}=i,l=D(e,r.schema);if(o)if(a){let e=function(e,t){let n=D(t,e.schema),{from:r,to:o,empty:i}=e.selection,a=[];i?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{a.push(...e.marks)});let s=a.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(r,l);n.addStoredMark(l.create({...e,...t}))}else s.forEach(e=>{let o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{let a=Math.max(r,o),s=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(a,s,l.create({...e.attrs,...t}))}):n.addMark(a,s,l.create(t))})});return function(e,t,n){var r;let{selection:o}=t,i=null;if(I(o)&&(i=o.$cursor),i){let t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=o;return a.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.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})}(r,n,l)},eP=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),ez=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a,s=x(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!(0,o.y_)(s,{...a,...t})(n)||e.clearNodes()).command(({state:e})=>(0,o.y_)(s,{...a,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},eB=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=P(e,0,n.content.size),o=i.nh.create(n,r);t.setSelection(o)}return!0},eL=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i,a,{selection:s}=r;return"number"==typeof t?(i=t,a=t):t&&"from"in t&&"to"in t?(i=t.from,a=t.to):(i=s.from,a=s.to),o&&n.doc.nodesBetween(i,a,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},e_=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,a=i.U3.atStart(n).from,s=i.U3.atEnd(n).to,l=P(r,a,s),d=P(o,a,s),c=i.U3.create(n,l,d);t.setSelection(c)}return!0},eF=e=>({state:t,dispatch:n})=>{let r=x(e,t.schema);return(0,s.$B)(r)(t,n)};function eU(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>
1null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var eH=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:o,editor:a})=>{let{selection:s,doc:l}=t,{$from:d,$to:c}=s,u=eD(a.extensionManager.attributes,d.node().type.name,d.node().attrs);if(s instanceof i.nh&&s.node.isBlock)return!!d.parentOffset&&!!(0,r.zy)(l,d.pos)&&(o&&(e&&eU(n,a.extensionManager.splittableMarks),t.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let p=c.parentOffset===c.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:u}]:void 0,h=(0,r.zy)(t.doc,t.mapping.map(d.pos),1,f);if(!f&&!h&&(0,r.zy)(t.doc,t.mapping.map(d.pos),1,m?[{type:m}]:void 0)&&(h=!0,f=m?[{type:m,attrs:u}]:void 0),o){if(h&&(s instanceof i.U3&&t.deleteSelection(),t.split(t.mapping.map(d.pos),1,f),m&&!p&&!d.parentOffset&&d.parent.type!==m)){let e=t.mapping.map(d.before()),n=t.doc.resolve(e);d.node(-1).canReplaceWith(n.index(),n.index()+1,m)&&t.setNodeMarkup(t.mapping.map(d.before()),m)}e&&eU(n,a.extensionManager.splittableMarks),t.scrollIntoView()}return h},eK=(e,t={})=>({tr:n,state:o,dispatch:s,editor:l})=>{var d;let c=x(e,o.schema),{$from:u,$to:p}=o.selection,m=o.selection.node;if(m&&m.isBlock||u.depth<2||!u.sameParent(p))return!1;let f=u.node(-1);if(f.type!==c)return!1;let h=l.extensionManager.attributes;if(0===u.parent.content.size&&u.node(-1).childCount===u.indexAfter(-1)){if(2===u.depth||u.node(-3).type!==c||u.index(-2)!==u.node(-2).childCount-1)return!1;if(s){let e=a.FK.empty,r=u.index(-1)?1:u.index(-2)?2:3;for(let t=u.depth-r;t>=u.depth-3;t-=1)e=a.FK.from(u.node(t).copy(e));let o=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,s={...eD(h,u.node().type.name,u.node().attrs),...t},l=(null==(d=c.contentMatch.defaultType)?void 0:d.createAndFill(s))||void 0;e=e.append(a.FK.from(c.createAndFill(null,l)||void 0));let p=u.before(u.depth-(r-1));n.replace(p,u.after(-o),new a.Ji(e,4-r,0));let m=-1;n.doc.nodesBetween(p,n.doc.content.size,(e,t)=>{if(m>-1)return!1;e.isTextblock&&0===e.content.size&&(m=t+1)}),m>-1&&n.setSelection(i.U3.near(n.doc.resolve(m))),n.scrollIntoView()}return!0}let g=p.pos===u.end()?f.contentMatchAt(0).defaultType:null,y={...eD(h,f.type.name,f.attrs),...t},v={...eD(h,u.node().type.name,u.node().attrs),...t};n.delete(u.pos,p.pos);let b=g?[{type:c,attrs:y},{type:g,attrs:v}]:[{type:c,attrs:y}];if(!(0,r.zy)(n.doc,u.pos,2))return!1;if(s){let{selection:e,storedMarks:t}=o,{splittableMarks:r}=l.extensionManager,i=t||e.$to.parentOffset&&e.$from.marks();if(n.split(u.pos,2,b).scrollIntoView(),!i||!s)return!0;let a=i.filter(e=>r.includes(e.type.name));n.ensureMarks(a)}return!0},eV=(e,t)=>{let n=ev(e=>e.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;let i=e.doc.nodeAt(o);return!(n.node.type===(null==i?void 0:i.type)&&(0,r.n9)(e.doc,n.pos))||(e.join(n.pos),!0)},eW=(e,t)=>{let n=ev(e=>e.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;let i=e.doc.nodeAt(o);return!(n.node.type===(null==i?void 0:i.type)&&(0,r.n9)(e.doc,o))||(e.join(o),!0)},eq=(e,t,n,r={})=>({editor:o,tr:i,state:a,dispatch:s,chain:l,commands:d,can:c})=>{let{extensions:u,splittableMarks:p}=o.extensionManager,m=x(e,a.schema),f=x(t,a.schema),{selection:h,storedMarks:g}=a,{$from:y,$to:v}=h,b=y.blockRange(v),k=g||h.$to.parentOffset&&h.$from.marks();if(!b)return!1;let M=ev(e=>eR(e.type.name,u))(h);if(b.depth>=1&&M&&b.depth-M.depth<=1){if(M.node.type===m)return d.liftListItem(f);if(eR(M.node.type.name,u)&&m.validContent(M.node.content)&&s)return l().command(()=>(i.setNodeMarkup(M.pos,m),!0)).command(()=>eV(i,m)).command(()=>eW(i,m)).run()}return n&&k&&s?l().command(()=>{let e=c().wrapInList(m,r),t=k.filter(e=>p.includes(e.type.name));return i.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(m,r).command(()=>eV(i,m)).command(()=>eW(i,m)).run():l().command(()=>!!c().wrapInList(m,r)||d.clearNodes()).wrapInList(m,r).command(()=>eV(i,m)).command(()=>eW(i,m)).run()},eZ=(e,t={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:i=!1}=n,a=D(e,r.schema);return!function(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?D(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>
1!i||i.name===e.type.name).find(e=>$(e.attrs,n,{strict:!1}));let a=0,s=[];if(o.forEach(({$from:t,$to:n})=>{let r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a+=i-n,s.push(...e.marks.map(e=>({mark:e,from:n,to:i})))})}),0===a)return!1;let l=s.filter(e=>!i||i.name===e.mark.type.name).filter(e=>$(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=s.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+d:l)>=a}(r,a,t)?o.setMark(a,t):o.unsetMark(a,{extendEmptyMarkRange:i})},eJ=(e,t,n={})=>({state:r,commands:o})=>{let i,a=x(e,r.schema),s=x(t,r.schema),l=en(r,a,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(i=r.selection.$anchor.parent.attrs),l)?o.setNode(s,i):o.setNode(a,{...i,...n})},eQ=(e,t={})=>({state:n,commands:r})=>{let o=x(e,n.schema);return en(n,o,t)?r.lift(o):r.wrapIn(o,t)},eY=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let o,i=n[r];if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){let n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},eG=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:o}=n;return!!r||(t&&o.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},eX=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;let{extendEmptyMarkRange:a=!1}=t,{selection:s}=n,l=D(e,r.schema),{$from:d,empty:c,ranges:u}=s;if(!o)return!0;if(c&&a){let{from:e,to:t}=s,r=null==(i=d.marks().find(e=>e.type===l))?void 0:i.attrs,o=j(d,l,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,l)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},e0=e=>({tr:t,state:n,dispatch:r})=>{let o,i,{selection:a}=n;return"number"==typeof e?(o=e,i=e):e&&"from"in e&&"to"in e?(o=e.from,i=e.to):(o=a.from,i=a.to),r&&t.doc.nodesBetween(o,i,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},e1=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,a=null,s=es("string"==typeof e?e:e.name,r.schema);if(!s)return!1;"node"===s&&(i=x(e,r.schema)),"mark"===s&&(a=D(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{let s,d,c,u,p=e.$from.pos,m=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,m,(e,t)=>{i&&i===e.type&&(l=!0,c=Math.max(t,p),u=Math.min(t+e.nodeSize,m),s=t,d=e)}):r.doc.nodesBetween(p,m,(e,r)=>{r<p&&i&&i===e.type&&(l=!0,c=Math.max(r,p),u=Math.min(r+e.nodeSize,m),s=r,d=e),r>=p&&r<=m&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),a&&e.marks.length&&e.marks.forEach(i=>{if(a===i.type&&(l=!0,o)){let o=Math.max(r,p),s=Math.min(r+e.nodeSize,m);n.addMark(o,s,a.create({...i.attrs,...t}))}}))}),d&&(void 0!==s&&o&&n.setNodeMarkup(s,void 0,{...d.attrs,...t}),a&&d.marks.length&&d.marks.forEach(e=>{a===e.type&&o&&n.addMark(c,u,a.create({...e.attrs,...t}))}))}),l},e2=(e,t={})=>({state:n,dispatch:r})=>{let i=x(e,n.schema);return(0,o.Im)(i,t)(n,r)},e3=(e,t={})=>({state:n,dispatch:r})=>{let o=x(e,n.schema);return(0,s.Sd)(o,t)(n,r)};function e9(e){var t;let{editor:n,from:r,to:o,text:i,rules:a,plugin:s}=e,{view:l}=n;if(l.composing)return!1;let d=l.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let c=!1,m=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var a,s;let l=(null==(s=(a=e.type.spec).toText)?void 0:s.call(a,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))}),n})(d)+i;return a.forEach(e=>{if(c)return;let t=((e,t)=>{if(T(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})(m,e.find);if(!t)return;let a=l.state.tr,d=u({state:l.state,transaction:a}),f={from:r-(t[0].length-i.length),to:o},{commands:h,chain:g,can:y}=new p({editor:n,state:d});null!==e.handler({state:d,range:f,match:t,commands:h,chain:g,can:y})&&a.steps.length&&(e.undoable&&a.setMeta(s,{transform:a,from:r,to:o,text:i}),l.dispatch(a),c=!0)}),c}function e4(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var e5=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...eM(eb(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...eM(eb(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};
1return e4(t)&&e4(n)&&Object.keys(n).forEach(o=>{e4(n[o])&&e4(t[o])?r[o]=e(t[o],n[o]):r[o]=n[o]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},e7=class e extends e5{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},e6=null,e8=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=eA(e),this.schema=function(e,t){var n;let r=eE(e),{nodeExtensions:o,markExtensions:i}=ew(e),s=null==(n=o.find(e=>eb(e,"topNode")))?void 0:n.name,l=Object.fromEntries(o.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=eT({...e.reduce((e,t)=>{let r=eb(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:eM(eb(n,"content",i)),marks:eM(eb(n,"marks",i)),group:eM(eb(n,"group",i)),inline:eM(eb(n,"inline",i)),atom:eM(eb(n,"atom",i)),selectable:eM(eb(n,"selectable",i)),draggable:eM(eb(n,"draggable",i)),code:eM(eb(n,"code",i)),whitespace:eM(eb(n,"whitespace",i)),linebreakReplacement:eM(eb(n,"linebreakReplacement",i)),defining:eM(eb(n,"defining",i)),isolating:eM(eb(n,"isolating",i)),attrs:Object.fromEntries(o.map(e$))}),s=eM(eb(n,"parseHTML",i));s&&(a.parseDOM=s.map(e=>eO(e,o)));let l=eb(n,"renderHTML",i);l&&(a.toDOM=e=>l({node:e,HTMLAttributes:eS(e,o)}));let d=eb(n,"renderText",i);return d&&(a.toText=d),[n.name,a]})),d=Object.fromEntries(i.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},a=eT({...e.reduce((e,t)=>{let r=eb(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:eM(eb(n,"inclusive",i)),excludes:eM(eb(n,"excludes",i)),group:eM(eb(n,"group",i)),spanning:eM(eb(n,"spanning",i)),code:eM(eb(n,"code",i)),attrs:Object.fromEntries(o.map(e$))}),s=eM(eb(n,"parseHTML",i));s&&(a.parseDOM=s.map(e=>eO(e,o)));let l=eb(n,"renderHTML",i);return l&&(a.toDOM=e=>l({mark:e,HTMLAttributes:eS(e,o)})),[n.name,a]}));return new a.Sj({topNode:s,nodes:l,marks:d})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:ej(t.name,this.schema)},r=eb(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return eC([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ej(t.name,this.schema)},r=[],o=eb(t,"addKeyboardShortcuts",n),s={};if("mark"===t.type&&eb(t,"exitable",n)&&(s.ArrowRight=()=>e7.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));s={...s,...t}}let d=(0,l.w)(s);r.push(d);let c=eb(t,"addInputRules",n);if(eN(t,e.options.enableInputRules)&&c){let t=c();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new i.k_({state:{init:()=>null,apply(e,o,i){let s=e.getMeta(r);if(s)return s;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=ex(a.FK.from(e),i.schema));let{from:o}=l,s=o+e.length;e9({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,a)=>e9({editor:t,from:o,to:i,text:a,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:o}=e.state.selection;o&&e9({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&e9({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}let m=eb(t,"addPasteRules",n);if(eN(t,e.options.enablePasteRules)&&m){let t=m();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,o=null,s=!1,l=!1,d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let c=({state:e,from:r,to:o,rule:i,pasteEvt:a})=>{let s=e.tr;if(function(e){let{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:a,dropEvent:s}=e,{commands:l,chain:d,can:c}=new p({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(e,t)=>{var p,m,f,h,g;if((null==(m=null==(p=e.type)?void 0:p.spec)?void 0:m.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(h=null==(f=e.content)?void 0:f.size)?h:e.nodeSize)?g:0,v=Math.max(r,t),b=Math.min(o,t+y);v>=b||((e,t,n)=>{if(T(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(v-t,b-t,void 0,""),i.find,a).forEac
1h(e=>{if(void 0===e.index)return;let t=v+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:l,chain:d,can:c,pasteEvent:a,dropEvent:s});u.push(p)})}),u.every(e=>null!==e)}({editor:n,state:u({state:e,transaction:s}),from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:a,dropEvent:t})&&s.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,s}};return r.map(e=>new i.k_({view(e){let t=t=>{var r;(o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(e6=n)},r=()=>{e6&&(e6=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=o===e.dom.parentElement,t=n,!l){let e=e6;(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)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return d=t,s=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let o=t[0],i="paste"===o.getMeta("uiEvent")&&!s,u="drop"===o.getMeta("uiEvent")&&!l,p=o.getMeta("applyPasteRules"),m=!!p;if(!i&&!u&&!m)return;if(m){let{text:t}=p;"string"==typeof t||(t=ex(a.FK.from(t),r.schema));let{from:n}=p,o=n+t.length;return c({rule:e,state:r,from:n,to:{b:o},pasteEvt:(e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t)})}let f=n.doc.content.findDiffStart(r.doc.content),h=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof f&&h&&f!==h.b)return c({rule:e,state:r,from:f,to:h,pasteEvt:d})}}))}({editor:e,rules:t});r.push(...n)}}let f=eb(t,"addProseMirrorPlugins",n);if(f){let e=f();r.push(...e)}return r})}get attributes(){return eE(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=ew(this.extensions);return Object.fromEntries(t.filter(e=>!!eb(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)},o=eb(t,"addNodeView",r);if(!o)return[];let i=o();return i?[t.name,(r,o,a,s,l)=>{let d=eS(r,n);return i({node:r,view:o,getPos:a,decorations:s,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}get markViews(){let{editor:e}=this,{markExtensions:t}=ew(this.extensions);return Object.fromEntries(t.filter(e=>!!eb(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:D(t.name,this.schema)},o=eb(t,"addMarkView",r);return o?[t.name,(r,i,a)=>{let s=eS(r,n);return o()({mark:r,view:i,inline:a,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{tx(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:ej(e.name,this.schema)};"mark"===e.type&&(null==(t=eM(eb(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=eb(e,"onBeforeCreate",n),o=eb(e,"onCreate",n),i=eb(e,"onUpdate",n),a=eb(e,"onSelectionUpdate",n),s=eb(e,"onTransaction",n),l=eb(e,"onFocus",n),d=eb(e,"onBlur",n),c=eb(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),a&&this.editor.on("selectionUpdate",a),s&&this.editor.on("transaction",s),l&&this.editor.on("focus",l),d&&this.editor.on("blur",d),c&&this.editor.on("destroy",c)})}};e8.resolve=eA,e8.sort=eC,e8.flatten=ek,c({},{ClipboardTextSerializer:()=>tt,Commands:()=>tn,Delete:()=>tr,Drop:()=>to,Editable:()=>ti,FocusEvents:()=>ts,Keymap:()=>tl,Paste:()=>td,Tabindex:()=>tc,TextDirection:()=>tu,focusEventsPluginKey:()=>ta});var te=class e extends e5{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}}
1,tt=te.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new i.k_({key:new i.hs("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,a=Math.min(...i.map(e=>e.$from.pos)),s=Math.max(...i.map(e=>e.$to.pos)),l=Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]));return function(e,t,n){let{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:a={}}=n||{},s="";return e.nodesBetween(r,o,(e,n,l,d)=>{var c;e.isBlock&&n>r&&(s+=i);let u=null==a?void 0:a[e.type.name];if(u)return l&&(s+=u({node:e,pos:n,parent:l,index:d,range:t})),!1;e.isText&&(s+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,o-n))}),s}(r,{from:a,to:s},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),tn=te.create({name:"commands",addCommands:()=>({...m})}),tr=te.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,o,i;let a=()=>{var n,o,i,a;if(null!=(a=null==(i=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.filterTransaction)?void 0:i.call(o,e))?a:e.getMeta("y-sync$"))return;let s=function(e,t){let n=new r.dL(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}(e.before,[e,...t]);(function(e){let{mapping:t,steps:n}=e,r=[];t.maps.forEach((e,o)=>{let i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{let{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{let i=t.slice(o).map(e,-1),a=t.slice(o).map(n),s=t.invert().map(i,-1),l=t.invert().map(a);r.push({oldRange:{from:s,to:l},newRange:{from:i,to:a}})})});let o=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(r);return 1===o.length?o:o.filter((e,t)=>!o.filter((e,n)=>n!==t).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))})(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{var o,i;if(t instanceof r.Ys){let r=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),d=l.invert().map(r,-1),c=l.invert().map(a),u=null==(o=s.doc.nodeAt(r-1))?void 0:o.marks.some(e=>e.eq(t.mark)),p=null==(i=s.doc.nodeAt(a))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:c},newRange:{from:r,to:a},partial:!!(p||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.async)||i?setTimeout(a,0):a()}}),to=te.create({name:"drop",addProseMirrorPlugins(){return[new i.k_({key:new i.hs("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),ti=te.create({name:"editable",addProseMirrorPlugins(){return[new i.k_({key:new i.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ta=new i.hs("focusEvents"),ts=te.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new i.k_({key:ta,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=te.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:o,$anchor:a}=n,{pos:s,parent:l}=a,d=a.parent.isTextblock&&s>0?t.doc.resolve(s-1):a,c=d.parent.type.spec.isolating,u=a.pos-a.parentOffset,p=c&&1===d.parent.childCount?u===a.pos:i.LN.atStart(r).from===s;return!!o&&!!l.type.isTextblock&&!l.textContent.length&&!!p&&(!p||"paragraph"!==a.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...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 B()||ee()?o:r},addProseMirrorPlugins(){return[new i.k_({key:new i.hs("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),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;let{empty:a,from:s,to:l}=t.selection,d=i.LN.atStart(t.doc).from,c=i.LN.atEnd(t.doc).to;
1if(a||s!==d||l!==c||!function e(t,{checkChildren:n=!0,ignoreWhitespace:r=!1}={}){var o;if(r){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!=(o=t.text)?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(n){let o=!0;return t.content.forEach(t=>{!1!==o&&(e(t,{ignoreWhitespace:r,checkChildren:n})||(o=!1))}),o}return!1}(n.doc))return;let m=n.tr,f=u({state:n,transaction:m}),{commands:h}=new p({editor:this.editor,state:f});if(h.clearNodes(),m.steps.length)return m}})]}}),td=te.create({name:"paste",addProseMirrorPlugins(){return[new i.k_({key:new i.hs("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),tc=te.create({name:"tabindex",addProseMirrorPlugins(){return[new i.k_({key:new i.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),tu=te.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=ew(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 i.k_({key:new i.hs("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}});function tp(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);o&&(t.class=o.map(e=>e.trim().slice(1)).join(" "));let i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;let i=n[parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10)];i&&(t[e]=i.slice(1,-1))});let a=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 a&&a.split(/\s+/).filter(Boolean).forEach(e=>
1{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function tm(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function tf(e){let{nodeName:t,name:n,parseAttributes:r=tp,serializeAttributes:o=tm,defaultAttributes:i={},requiredAttributes:a=[],allowedAttributes:s}=e,l=n||t;return{parseMarkdown:(e,n)=>{let r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){let i=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(i);if(!s)return;let d=r(s[1]||"");if(!a.find(e=>!(e in d)))return{type:t,raw:s[0],attributes:d}}},renderMarkdown:e=>{let t=o((e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${l}${n} :::`}}}function th(e){let{nodeName:t,name:n,getContent:r,parseAttributes:o=tp,serializeAttributes:i=tm,defaultAttributes:a={},content:s="block",allowedAttributes:l}=e,d=n||t;return{parseMarkdown:(e,n)=>{let o;if(r){let t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===s?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let i={...a,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${d}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;let a=RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(a);if(!l)return;let[c,u=""]=l,p=o(u),m=1,f=c.length,h="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let o=n.index,a=n[1];if(null==(i=n[2])||!i.endsWith(":::")){if(a)m+=1;else if(0==(m-=1)){let i=y.slice(0,o);h=i.trim();let a=e.slice(0,f+o+n[0].length),l=[];if(h)if("block"===s)for((l=r.blockTokens(i)).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(h);return{type:t,raw:a,attributes:p,content:h,tokens:l}}}}}},renderMarkdown:(e,t)=>{let n=i((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${d}${r}
2
3${o}
4
5:::`}}}function tg(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,o,i,a]=r;t[o]=i||a,r=n.exec(e)}return t}function ty(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function tv(e){let{nodeName:t,name:n,getContent:r,parseAttributes:o=tg,serializeAttributes:i=ty,defaultAttributes:a={},selfClosing:s=!1,allowedAttributes:l}=e,d=n||t,c=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let o={...a,...e.attributes};if(s)return n.createNode(t,o);let i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=s?RegExp(`\\[${c}\\s*[^\\]]*\\]`):RegExp(`\\[${c}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${c}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let i=s?RegExp(`^\\[${c}\\s*([^\\]]*)\\]`):RegExp(`^\\[${c}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${c}\\]`),a=e.match(i);if(!a)return;let l="",d="";if(s){let[,e]=a;d=e}else{let[,e,t]=a;d=e,l=t||""}let u=o(d.trim());return{type:t,raw:a[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=i((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),o=n?` ${n}`:"";return s?`[${d}${o}]`:`[${d}${o}]${t}[/${d}]`}}}function tb(e,t,n){var r,o,i,a;let s=e.split("\n"),l=[],d="",c=0,u=t.baseIndentSize||2;for(;c<s.length;){let e,p=s[c],m=p.match(t.itemPattern);if(!m)if(l.length>0)break;else{if(""!==p.trim())return;c+=1,d=`${d}${p}
6`;continue}let f=t.extractItemData(m),{indentLevel:h,mainContent:g}=f;d=`${d}${p}
7`;let y=[g];for(c+=1;c<s.length;){let e=s[c];if(""===e.trim()){let t=s.slice(c+1).findIndex(e=>""!==e.trim());if(-1===t)break;
7if(((null==(o=null==(r=s[c+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>h){y.push(e),d=`${d}${e}
8`,c+=1;continue}break}if(((null==(a=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:a.length)||0)>h)y.push(e),d=`${d}${e}
9`,c+=1;else break}let v=y.slice(1);if(v.length>0){let r=v.map(e=>e.slice(h+u)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let b=t.createToken(f,e);l.push(b)}if(0!==l.length)return{items:l,raw:d}}function tk(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let o="function"==typeof n?n(r):n,[i,...a]=e.content,s=t.renderChildren([i]),l=[`${o}${s}`];return a&&a.length>0&&a.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");l.push(e)}}),l.join("\n")}function tx(e,t,n={}){let{state:r}=t,{doc:o,tr:i}=r;o.descendants((t,r)=>{let o=i.mapping.map(r),a=i.mapping.map(r)+t.nodeSize,s=null;if(t.marks.forEach(t=>{if(t!==e)return!1;s=t}),!s)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==s.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});i.removeMark(o,a,e.type),i.addMark(o,a,t)}}),i.docChanged&&t.view.dispatch(i)}c({},{createAtomBlockMarkdownSpec:()=>tf,createBlockMarkdownSpec:()=>th,createInlineMarkdownSpec:()=>tv,parseAttributes:()=>tp,parseIndentedBlocks:()=>tb,renderNestedMarkdownContent:()=>tk,serializeAttributes:()=>tm});var tM=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){tx(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(B()||z())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},tw=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,a,s,l;let{view:d}=this.editor,c=e.target,u=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!u)return;let p=0,m=0;if(this.dom!==u){let t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),i=null!=(o=e.offsetX)?o:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(s=e.offsetY)?s:null==(a=e.nativeEvent)?void 0:a.offsetY;p=n.x-t.x+i,m=n.y-t.y+l}let f=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();f.style.width=`${Math.round(e.width)}px`,f.style.height=`${Math.round(e.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let h=null;try{(h=document.createElement("div")).style.position="absolute",h.style.top="-9999px",h.style.left="-9999px",h.style.pointerEvents="none",h.appendChild(f),document.body.appendChild(h),null==(l=e.dataTransfer)||l.setDragImage(f,p,m)}finally{h&&setTimeout(()=>{try{null==h||h.remove()}catch{}},0)}let g=this.getPos();if("number"!=typeof g)return;let y=i.nh.create(d.state.doc,g),v=d.state.tr.setSelection(y);d.dispatch(v)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:a}=this.editor,{isDragging:s}=this,l=!!this.node.type.spec.draggable,d=i.nh.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,p="cut"
9===e.type,m="mousedown"===e.type;if(!l&&d&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!s&&e.target===this.dom)return e.preventDefault(),!1;if(l&&a&&!s&&m){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!s&&!o&&!c&&!u&&!p&&(!m||!d)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(B()||z())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}}}]);

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.