PageSourceSearch

https://zelica.com/_next/static/chunks/6441.9cd94d65c911902d.js

js zelica.com collected 2026-10-10 01:11:36 UTC 59,743 bytes, 6 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6441],{31824:function(){},24318:function(e,t,n){"use strict";n.d(t,{ZP:function(){return i}});var l=n(5865),o=n(2376),r=({key:e,editor:t,onPaste:n,onDrop:l,allowedMimeTypes:r})=>new o.Sy({key:e||new o.H$("fileHandler"),props:{handleDrop(e,n){var o;if(!l||!(null==(o=n.dataTransfer)?void 0:o.files.length))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY}),a=Array.from(n.dataTransfer.files);return r&&(a=a.filter(e=>r.includes(e.type))),0!==a.length&&(n.preventDefault(),n.stopPropagation(),l(t,a,(null==i?void 0:i.pos)||0),!0)},handlePaste(e,l){var o;if(!n||!(null==(o=l.clipboardData)?void 0:o.files.length))return!1;let i=Array.from(l.clipboardData.files),a=l.clipboardData.getData("text/html");return r&&(i=i.filter(e=>r.includes(e.type))),0!==i.length&&(l.preventDefault(),l.stopPropagation(),n(t,i,a),!(a.length>0))}}}),i=l.hj.create({name:"fileHandler",addOptions:()=>({onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0}),addProseMirrorPlugins(){return[r({key:new o.H$(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste})]}})},50601:function(e,t,n){"use strict";n.d(t,{ZP:function(){return i}});var l=n(5865),o=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,r=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,i=l.vc.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",(0,l.P1)(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark("highlight",t.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,t,n){let l=/^(==)([^=]+)(==)/.exec(e);if(l){let e=l[2].trim(),t=n.inlineTokens(e);return{type:"highlight",raw:l[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}}
1,addInputRules(){return[(0,l.Cf)({find:o,type:this.type})]},addPasteRules(){return[(0,l.K9)({find:r,type:this.type})]}})},658:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var l=n(22773).pj},43626:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var l=n(22773).xD},22773:function(e,t,n){"use strict";n.d(t,{SC:function(){return s},iA:function(){return m},pj:function(){return i},xD:function(){return a}});var l=n(5865),o=n(2376),r=n(50890),i=l.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var t,n;let l=e.getAttribute("colwidth"),o=l?l.split(",").map(e=>parseInt(e,10)):null;if(!o){let l=null==(t=e.closest("table"))?void 0:t.querySelectorAll("colgroup > col"),o=Array.from((null==(n=e.parentElement)?void 0:n.children)||[]).indexOf(e);if(o&&o>-1&&l&&l[o]){let e=l[o].getAttribute("width");return e?[parseInt(e,10)]:null}}return o}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",(0,l.P1)(this.options.HTMLAttributes,e),0]}}),a=l.NB.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,l.P1)(this.options.HTMLAttributes,e),0]}}),s=l.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,l.P1)(this.options.HTMLAttributes,e),0]}});function d(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function c(e,t,n,l,o,r){var i;let a=0,s=!0,c=t.firstChild,h=e.firstChild;if(null!==h)for(let e=0,n=0;e<h.childCount;e+=1){let{colspan:i,colwidth:p}=h.child(e).attrs;for(let e=0;e<i;e+=1,n+=1){let i=o===n?r:p&&p[e],h=i?`${i}px`:"";if(a+=i||l,i||(s=!1),c){if(c.style.width!==h){let[e,t]=d(l,i);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement("col"),[n,o]=d(l,i);e.style.setProperty(n,o),t.appendChild(e)}}}for(;c;){let e=c.nextSibling;null==(i=c.parentNode)||i.removeChild(c),c=e}s?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var h=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),c(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,c(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),l=this.contentDOM.contains(t);return!!n&&!l&&("attributes"===e.type||"childList"===e.type||"characterData"===e.type)}};function p(e,t){return t?e.createChecked(null,t):e.createAndFill()}var u=({editor:e})=>{let{selection:t}=e.state;if(!(t instanceof r.Xc))return!1;let n=0,o=(0,l.qv)(t.ranges[0].$from,e=>"table"===e.type.name);return null==o||o.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)},f=function(e,t,n={}){var l;let o=null!=(l=n.cellLineSeparator)?l:"\x1f";if(!e||!e.content||0===e.content.length)return"";let r=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let l=((e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(o):e.content?t.renderChildren(e.content):"")||"").replace(/\s+/g," ").trim(),r="tableHeader"===e.type;n.push({text:l,isHeader:r})}),r.push(n)});let i=r.reduce((e,t)=>Math.max(e,t.length),0);if(0===i)return"";let a=Array(i).fill(0);r.forEach(e=>{var t;for(let n=0;n<i;n+=1){let l=((null==(t=e[n])?void 0:t.text)||"").length;l>a[n]&&(a[n]=l),a[n]<3&&(a[n]=3)}});let s=(e,t)=>e+" ".repeat(Math.max(0,t-e.length)),d=r[0],c=d.some(e=>e.isHeader),h="\n",p=Array(i).fill(0).map((e,t)=>c&&d[t]&&d[t].text||"");return h+=`| ${p.map((e,t)=>s(e,a[t])).join(" | ")} |
2| ${a.map(e=>"-".repeat(Math.max(3,e))).join(" | ")} |
3`,(c?r.slice(1):r).forEach(e=>{h+=`| ${Array(i).fill(0).map((t,n)=>s(e[n]&&e[n].text||"",a[n])).join(" | ")} |
4`}),h},m=l.NB.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:h,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:o,tableMinWidth:r}=function(e,t,n,l){let o=0,r=!0,i=[],a=e.firstChild;if(!a)return{};for(let e=0,n=0;e<a.childCount;e+=1){let{colspan:l,colwidth:s}=a.child(e).attrs;for(let e=0;e<l;e+=1,n+=1){let l=void 0===n?void 0:s&&s[e];o+=l||t,l||(r=!1);let[a,c]=d(t,l);i.push(["col",{style:`${a}: ${c}`}])}}return{colgroup:["colgroup",{},...i],tableWidth:r?`${o}px`:"",tableMinWidth:r?"":`${o}px`}}(e,this.options.cellMinWidth),i=["table",(0,l.P1)(this.options.HTMLAttributes,t,{style:o?`width: ${o}`:`min-width: ${r}`}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},i]:i},parseMarkdown:(e,t)=>{let n=[];if(e.header){let l=[];e.header.forEach(e=>{l.push(t.createNode("tableHeader",{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},l))}return e.rows&&e.rows.forEach(e=>{let l=[];e.forEach(e=>{l.push(t.createNode("tableCell",{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},l))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>f(e,t),addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:l,dispatch:r,editor:i})=>{let a=function(e,t,n,l,o){let r=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let l=e.nodes[n];l.spec.tableRole&&(t[l.spec.tableRole]=l)}),e.cached.tableNodeTypes=t,t}(e),i=[],a=[];for(let e=0;e<n;e+=1){let e=p(r.cell,void 0);if(e&&a.push(e),l){let e=p(r.header_cell,void 0);e&&i.push(e)}}let s=[];for(let e=0;e<t;e+=1)s.push(r.row.createChecked(null,l&&0===e?i:a));return r.table.createChecked(null,s)}(i.schema,e,t,n);if(r){let e=l.selection.from+1;l.replaceSelectionWith(a).scrollIntoView().setSelection(o.Bs.near(l.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>(0,r.I_)(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>(0,r.e2)(e,t),deleteColumn:()=>({state:e,dispatch:t})=>(0,r.eA)(e,t),addRowBefore:()=>({state:e,dispatch:t})=>(0,r.z2)(e,t),addRowAfter:()=>({state:e,dispatch:t})=>(0,r.dl)(e,t),deleteRow:()=>({state:e,dispatch:t})=>(0,r.qK)(e,t),deleteTable:()=>({state:e,dispatch:t})=>(0,r.WQ)(e,t),mergeCells:()=>({state:e,dispatch:t})=>(0,r.JX)(e,t),splitCell:()=>({state:e,dispatch:t})=>(0,r.Cr)(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>
4(0,r.dO)("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>(0,r.dO)("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>(0,r.II)(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!(0,r.JX)(e,t)||(0,r.Cr)(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:l})=>(0,r.wb)(e,t)(n,l),goToNextCell:()=>({state:e,dispatch:t})=>(0,r.nA)(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>(0,r.nA)(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&(0,r.tp)(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=r.Xc.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:u,"Mod-Backspace":u,Delete:u,"Mod-Delete":u}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[(0,r.VH)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],(0,r.G3)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,l.nU)((0,l.Nl)(e,"tableRole",t))}}});l.hj.create({name:"tableKit",addExtensions(){let e=[];return!1!==this.options.table&&e.push(m.configure(this.options.table)),!1!==this.options.tableCell&&e.push(i.configure(this.options.tableCell)),!1!==this.options.tableHeader&&e.push(a.configure(this.options.tableHeader)),!1!==this.options.tableRow&&e.push(s.configure(this.options.tableRow)),e}})},87605:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var l=n(37271).Uf},63354:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var l=n(37271).ax},8045:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var l=n(5865),o=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,r=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,i=e=>e.match(o),a=(e,t)=>t?"https://www.youtube-nocookie.com/embed/videoseries?list=":e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",s=e=>{let{url:t,allowFullscreen:n,autoplay:l,ccLanguage:o,ccLoadPolicy:r,controls:s,disableKBcontrols:d,enableIFrameApi:c,endTime:h,interfaceLanguage:p,ivLoadPolicy:u,loop:f,modestBranding:m,nocookie:g,origin:w,playlist:b,progressBarColor:y,startAt:v,rel:C}=e;if(!i(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){let e=t.split("/").pop();return e?`${a(g)}${e}`:null}let A=/(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);if(!A||!A[2])return null;let M=`${a(g,"list"===A[1])}${A[2]}`,$=[];return!1===n&&$.push("fs=0"),l&&$.push("autoplay=1"),o&&$.push(`cc_lang_pref=${o}`),r&&$.push("cc_load_policy=1"),s||$.push("controls=0"),d&&$.push("disablekb=1"),c&&$.push("enablejsapi=1"),h&&$.push(`end=${h}`),p&&$.push(`hl=${p}`),u&&$.push(`iv_load_policy=${u}`),f&&$.push("loop=1"),m&&$.push("modestbranding=1"),w&&$.push(`origin=${w}`),b&&$.push(`playlist=${b}`),v&&$.push(`start=${v}`),y&&$.push(`color=${y}`),void 0!==C&&$.push(`rel=${C}`),$.length&&(M+=`${"v"===A[1]?"?":"&"}${$.join("&")}`),M},d=l.NB.create({name:"youtube",addOptions:()=>({addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML:()=>[{tag:"div[data-youtube-video] iframe"}],addCommands(){return{setYoutubeVideo:e=>({commands:t})=>!!i(e.src)&&t.insertContent({type:this.name,attrs:e})}},addPasteRules(){return this.options.addPasteHandler?[(0,l.Ss)({find:r,type:this.t
4ype,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){let t=s({url:e.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:e.start||0,rel:this.options.rel});return e.src=t,["div",{"data-youtube-video":""},["iframe",(0,l.P1)(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},e)]]},...(0,l.cl)({nodeName:"youtube",allowedAttributes:["src","width","height","start"]})})},50890:function(e,t,n){"use strict";n.d(t,{Xc:function(){return C},e2:function(){return L},I_:function(){return R},dl:function(){return z},z2:function(){return T},VH:function(){return es},eA:function(){return k},qK:function(){return E},WQ:function(){return Y},tp:function(){return x},nA:function(){return I},JX:function(){return W},wb:function(){return B},Cr:function(){return D},G3:function(){return ef},dO:function(){return O},II:function(){return _}});var l,o,r=n(2376),i=n(12806),a=n(84348),s=n(82696),d=n(16560);if("undefined"!=typeof WeakMap){let e=new WeakMap;l=t=>e.get(t),o=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;l=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},o=(n,l)=>(10==t&&(t=0),e[t++]=n,e[t++]=l)}var c=class{constructor(e,t,n,l){this.width=e,this.height=t,this.map=n,this.problems=l}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let l=t%this.width,o=t/this.width|0,r=l+1,i=o+1;for(let e=1;r<this.width&&this.map[t+e]==n;e++)r++;for(let e=1;i<this.height&&this.map[t+this.width*e]==n;e++)i++;return{left:l,top:o,right:r,bottom:i}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:l,right:o,top:r,bottom:i}=this.findCell(e);return"horiz"==t?(n<0?0==l:o==this.width)?null:this.map[r*this.width+(n<0?l-1:o)]:(n<0?0==r:i==this.height)?null:this.map[l+this.width*(n<0?r-1:i)]}rectBetween(e,t){let{left:n,right:l,top:o,bottom:r}=this.findCell(e),{left:i,right:a,top:s,bottom:d}=this.findCell(t);return{left:Math.min(n,i),top:Math.min(o,s),right:Math.max(l,a),bottom:Math.max(r,d)}}cellsInRect(e){let t=[],n={};for(let l=e.top;l<e.bottom;l++)for(let o=e.left;o<e.right;o++){let r=l*this.width+o,i=this.map[r];if(!n[i]){if(n[i]=!0,o==e.left&&o&&this.map[r-1]==i||l==e.top&&l&&this.map[r-this.width]==i)continue;t.push(i)}}return t}positionAt(e,t,n){for(let l=0,o=0;;l++){let r=o+n.child(l).nodeSize;if(l==e){let n=t+e*this.width,l=(e+1)*this.width;for(;n<l&&this.map[n]<o;)n++;return n==l?r-1:this.map[n]}o=r}}static get(e){return l(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let l=0;l<e.childCount;l++){let o=e.child(l),r=0;if(n)for(let t=0;t<l;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>l&&(r+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);r+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=r:t!=r&&(t=Math.max(t,r))}return t}(e),n=e.childCount,l=[],o=0,r=null,i=[];for(let e=0,o=t*n;e<o;e++)l[e]=0;for(let a=0,s=0;a<n;a++){let d=e.child(a);s++;for(let e=0;;e++){for(;o<l.length&&0!=l[o];)o++;if(e==d.childCount)break;let c=d.child(e),{colspan:h,rowspan:p,colwidth:u}=c.attrs;for(let e=0;e<p;e++){if(e+a>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:s,n:p-e});break}let d=o+e*t;for(let e=0;e<h;e++){0==l[d+e]?l[d+e]=s:(r||(r=[])).push({type:"collision",row:a,pos:s,n:h-e});let n=u&&u[e];if(n){let l=(d+e)%t*2,o=i[l];null==o||o!=n&&1==i[l+1]?(i[l]=n,i[l+1]=1):o==n&&i[l+1]++}}}o+=h,s+=c.nodeSize}let c=(a+1)*t,h=0;for(;o<c;)0==l[o++]&&h++;h&&(r||(r=[])).push({type:"missing",row:a,n:h}),s++}(0===t||0===n)&&(r||(r=[])).push({type:"zero_sized"});let a=new c(t,n,l,r),s=!1;for(let e=0;!s&&e<i.length;e+=2)null!=i[e]&&i[e+1]<n&&(s=!0);return s&&function(e,t,n){e.problems||(e.problems=[]);let l={};for(let o=0;o<e.map.length;o++){let r=e.map[o];if(l[r])continue;l[r]=!0;let i=n.nodeAt(r);if(!i)throw RangeError(`No cell with offset ${r} found`);let a=null,s=i.attrs;for(let n=0;n<s.colspan;n++){let l=t[(o+n)%e.width*2];null==l||s.colwidth&&s.colwidth[n]==l||((a||(a=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}(s)))[n]=l)}a&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:a})}}(a,i,e),a}(e))}};function h(e){let t=e.cached.tableNodeTypes;
4if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let l=e.nodes[n],o=l.spec.tableRole;o&&(t[o]=l)}return t}var p=new r.H$("selectingCells");function u(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function f(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function m(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;let n=u(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let l=t.type.spec.tableRole;if("cell"==l||"header_cell"==l)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let l=t.type.spec.tableRole;if("cell"==l||"header_cell"==l)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function g(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function w(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function b(e,t,n){let l=e.node(-1),o=c.get(l),r=e.start(-1),i=o.nextCell(e.pos-r,t,n);return null==i?null:e.node(0).resolve(r+i)}function y(e,t,n=1){let l={...e,colspan:e.colspan-n};return l.colwidth&&(l.colwidth=l.colwidth.slice(),l.colwidth.splice(t,n),l.colwidth.some(e=>e>0)||(l.colwidth=null)),l}function v(e,t,n=1){let l={...e,colspan:e.colspan+n};if(l.colwidth){l.colwidth=l.colwidth.slice();for(let e=0;e<n;e++)l.colwidth.splice(t,0,0)}return l}var C=class e extends r.Y1{constructor(e,t=e){let n=e.node(-1),l=c.get(n),o=e.start(-1),i=l.rectBetween(e.pos-o,t.pos-o),a=e.node(0),s=l.cellsInRect(i).filter(e=>e!=t.pos-o);s.unshift(t.pos-o);let d=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let l=o+e+1;return new r.xm(a.resolve(l),a.resolve(l+t.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=t}map(t,n){let l=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(g(l)&&g(o)&&w(l,o)){let t=this.$anchorCell.node(-1)!=l.node(-1);return t&&this.isRowSelection()?e.rowSelection(l,o):t&&this.isColSelection()?e.colSelection(l,o):new e(l,o)}return r.Bs.between(l,o)}content(){let e=this.$anchorCell.node(-1),t=c.get(e),n=this.$anchorCell.start(-1),l=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},r=[];for(let n=l.top;n<l.bottom;n++){let a=[];for(let r=n*t.width+l.left,i=l.left;i<l.right;i++,r++){let n=t.map[r];if(o[n])continue;o[n]=!0;let i=t.findCell(n),s=e.nodeAt(n);if(!s)throw RangeError(`No cell with offset ${n} found`);let d=l.left-i.left,c=i.right-l.right;if(d>0||c>0){let e=s.attrs;if(d>0&&(e=y(e,0,d)),c>0&&(e=y(e,e.colspan-c,c)),i.left<l.left){if(!(s=s.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else s=s.type.create(e,s.content)}if(i.top<l.top||i.bottom>l.bottom){let e={...s.attrs,rowspan:Math.min(i.bottom,l.bottom)-Math.max(i.top,l.top)};s=i.top<l.top?s.type.createAndFill(e):s.type.create(e,s.content)}a.push(s)}r.push(e.child(n).copy(i.HY.from(a)))}let a=this.isColSelection()&&this.isRowSelection()?e:r;return new i.p2(i.HY.from(a),1,1)}replace(e,t=i.p2.empty){let n=e.steps.length,l=this.ranges;for(let o=0;o<l.length;o++){let{$from:r,$to:a}=l[o],s=e.mapping.slice(n);e.replace(s.map(r.pos),s.map(a.pos),o?i.p2.empty:t)}let o=r.Y1.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new i.p2(i.HY.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=c.get(t),l=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),l+o[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);return!(Math.min(e,t)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let l=t.node(-1),o=c.get(l),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.top<=a.top?(i.top>0&&(t=s.resolve(r+o.map[i.left])),a.bottom<o.height&&(n=s.resolve(r+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(r+o.map[a.left])),i.bottom<o.height&&(t=s.resolve(r+o.map[o.width*(o.height-1)+i.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=c.get(e),n=this.$anchorCell.start(-1),l=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);return!(Math.min(l,o)>0)&&Math.max(l+this.$anchorCell.nodeAfter.attrs.colspan,o+this.$headCell.nodeAfter.attrs.colspan)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let l=t.node(-1),o=c.get(l),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.left<=a.left?(i.left>0&&(t=s.resolve(r+o.map[i.top*o.width])),a.right<o.width&&(n=s.resolve(r+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(r+o.map[a.top*o.width])),i.right<o.width&&(t=s.resolve(r+o.map[o.width*(i.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,l=n){return new e(t.resolve(n),t.resolve(l))}getBookmark(){return new A(this.$anchorCell.pos,this.$headCell.pos)}};C.prototype.visible=!1,r.Y1.jsonID("cell",C);var A=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&w(t,n)?new C(t,n):r.Y1.near(n,1)}};function M(e){if(!(e.selection instanceof C))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(a.p.node(n,n+e.nodeSize,{class:"selectedCell"}))}),a.EH.create(e.doc,t)}var $=new r.H$("fix-tables");function x(e,t){let n;let l=(t,l)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,l){let o,r;let i=c.get(t);if(!i.problems)return l;l||(l=e.tr);let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if("collision"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;let r=e.attrs;for(let e=0;e<r.rowspan;e++)a[o.row+e]+=o.n;l.setNodeMarkup(l.mapping.map(n+1+o.pos),null,y(r,r.colspan-o.n,o.n))}else if("missing"==o.type)a[o.row]+=o.n;else if("overlong_rowspan"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;l.setNodeMarkup(l.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if("colwidth mismatch"==o.type){let e=t.nodeAt(o.pos);if(!e)continue;l.setNodeMarkup(l.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if("zero_sized"==o.type){let e=l.mapping.map(n);l.delete(e,e+t.nodeSize)}}for(let e=0;e<a.length;e++)a[e]&&(null==o&&(o=e),r=e);for(let s=0,d=n+1;s<i.height;s++){let n=t.child(s),i=d+n.nodeSize,c=a[s];if(c>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<c;n++){let n=h(e.schema)[t].createAndFill();n&&a.push(n)}let p=(0==s||o==s-1)&&r==s?d+1:i-1;l.insert(l.mapping.map(p),a)}d=i}return l.setMeta($,{fixTables:!0})}(e,t,l,n))};return t?t.doc!=e.doc&&function e(t,n,l,o){let r=t.childCount,i=n.childCount;e:for(let a=0,s=0;a<i;a++){let i=n.child(a);for(let e=s,n=Math.min(r,a+3);e<n;e++)if(t.child(e)==i){s=e+1,l+=i.nodeSize;continue e}o(i,l),s<r&&t.child(s).sameMarkup(i)?e(t.child(s),i,l+1,o):i.nodesBetween(0,i.content.size,o,l+1),l+=i.nodeSize}}(t.doc,e.doc,0,l):e.doc.descendants(l),n}function H(e){let t=e.selection,n=m(e),l=n.node(-1),o=n.start(-1),r=c.get(l);return{...t instanceof C?r.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):r.findCell(n.pos-o),tableStart:o,map:r,table:l}}function S(e,{map:t,tableStart:n,table:l},o){let r=o>0?-1:0;(function(e,t,n){let l=h(t.type.schema).header_cell;for(let o=0;
4o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=l)return!1;return!0})(t,l,o+r)&&(r=0==o||o==t.width?null:0);for(let i=0;i<t.height;i++){let a=i*t.width+o;if(o>0&&o<t.width&&t.map[a-1]==t.map[a]){let r=t.map[a],s=l.nodeAt(r);e.setNodeMarkup(e.mapping.map(n+r),null,v(s.attrs,o-t.colCount(r))),i+=s.attrs.rowspan-1}else{let s=null==r?h(l.type.schema).cell:l.nodeAt(t.map[a+r]).type,d=t.positionAt(i,o,l);e.insert(e.mapping.map(n+d),s.createAndFill())}}return e}function R(e,t){if(!f(e))return!1;if(t){let n=H(e);t(S(e.tr,n,n.left))}return!0}function L(e,t){if(!f(e))return!1;if(t){let n=H(e);t(S(e.tr,n,n.right))}return!0}function k(e,t){if(!f(e))return!1;if(t){let n=H(e),l=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;!function(e,{map:t,table:n,tableStart:l},o){let r=e.mapping.maps.length;for(let i=0;i<t.height;){let a=i*t.width+o,s=t.map[a],d=n.nodeAt(s),c=d.attrs;if(o>0&&t.map[a-1]==s||o<t.width-1&&t.map[a+1]==s)e.setNodeMarkup(e.mapping.slice(r).map(l+s),null,y(c,o-t.colCount(s)));else{let t=e.mapping.slice(r).map(l+s);e.delete(t,t+d.nodeSize)}i+=c.rowspan}}(l,n,e),e!=n.left;e--){let e=n.tableStart?l.doc.nodeAt(n.tableStart-1):l.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=c.get(e)}t(l)}return!0}function N(e,{map:t,tableStart:n,table:l},o){var r;let i=n;for(let e=0;e<o;e++)i+=l.child(e).nodeSize;let a=[],s=o>0?-1:0;(function(e,t,n){var l;let o=h(t.type.schema).header_cell;for(let r=0;r<e.width;r++)if((null==(l=t.nodeAt(e.map[r+n*e.width]))?void 0:l.type)!=o)return!1;return!0})(t,l,o+s)&&(s=0==o||o==t.height?null:0);for(let i=0,d=t.width*o;i<t.width;i++,d++)if(o>0&&o<t.height&&t.map[d]==t.map[d-t.width]){let o=t.map[d],r=l.nodeAt(o).attrs;e.setNodeMarkup(n+o,null,{...r,rowspan:r.rowspan+1}),i+=r.colspan-1}else{let e=null==s?h(l.type.schema).cell:null==(r=l.nodeAt(t.map[d+s*t.width]))?void 0:r.type,n=null==e?void 0:e.createAndFill();n&&a.push(n)}return e.insert(i,h(l.type.schema).row.create(null,a)),e}function T(e,t){if(!f(e))return!1;if(t){let n=H(e);t(N(e.tr,n,n.top))}return!0}function z(e,t){if(!f(e))return!1;if(t){let n=H(e);t(N(e.tr,n,n.bottom))}return!0}function E(e,t){if(!f(e))return!1;if(t){let n=H(e),l=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;!function(e,{map:t,table:n,tableStart:l},o){let r=0;for(let e=0;e<o;e++)r+=n.child(e).nodeSize;let i=r+n.child(o).nodeSize,a=e.mapping.maps.length;e.delete(r+l,i+l);let s=new Set;for(let r=0,i=o*t.width;r<t.width;r++,i++){let d=t.map[i];if(!s.has(d)){if(s.add(d),o>0&&d==t.map[i-t.width]){let t=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(a).map(d+l),null,{...t,rowspan:t.rowspan-1}),r+=t.colspan-1}else if(o<t.height&&d==t.map[i+t.width]){let i=n.nodeAt(d),s=i.attrs,c=i.type.create({...s,rowspan:i.attrs.rowspan-1},i.content),h=t.positionAt(o+1,r,n);e.insert(e.mapping.slice(a).map(l+h),c),r+=s.colspan-1}}}}(l,n,e),e!=n.top;e--){let e=n.tableStart?l.doc.nodeAt(n.tableStart-1):l.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=c.get(n.table)}t(l)}return!0}function P(e){let t=e.content;return 1==t.childCount&&t.child(0).isTextblock&&0==t.child(0).childCount}function W(e,t){let n=e.selection;if(!(n instanceof C)||n.$anchorCell.pos==n.$headCell.pos)return!1;let l=H(e),{map:o}=l;if(function({width:e,height:t,map:n},l){let o=l.top*e+l.left,r=o,i=(l.bottom-1)*e+l.left,a=o+(l.right-l.left-1);for(let t=l.top;t<l.bottom;t++){if(l.left>0&&n[r]==n[r-1]||l.right<e&&n[a]==n[a+1])return!0;r+=e,a+=e}for(let r=l.left;r<l.right;r++){if(l.top>0&&n[o]==n[o-e]||l.bottom<t&&n[i]==n[i+e])return!0;o++,i++}return!1}(o,l))return!1;if(t){let n,r;let a=e.tr,s={},d=i.HY.empty;for(let e=l.top;e<l.bottom;e++)for(let t=l.left;t<l.right;t++){let i=o.map[e*o.width+t],c=l.table.nodeAt(i);if(!s[i]&&c){if(s[i]=!0,null==n)n=i,r=c;else{P(c)||(d=d.append(c.content));let e=a.mapping.map(i+l.tableStart);a.delete(e,e+c.nodeSize)}}}if(null==n||null==r)return!0;if(a.setNodeMarkup(n+l.tableStart,null,{...v(r.attrs,r.attrs.colspan,l.right-l.left-r.attrs.colspan),rowspan:l.bottom-l.top}),d.size){let e=n+1+r.content.size,t=P(r)?n+1:e;a.replaceWith(t+l.tableStart,e+l.tableStart,d)}a.setSelection(new C(a.doc.resolve(n+l.tableStart))),t(a)}return!0}function D(e,t){var n;let l=h(e.schema);return(n=({node:e})=>l[e.type.spec.tableRole],(e,t)=>{var l;let o,r;let i=e.selection;if(i instanceof C){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,r=i.$anchorCell.pos}else{if(!(o=function(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;
4if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;r=null==(l=u(i.$from))?void 0:l.pos}if(null==o||null==r||1==o.attrs.colspan&&1==o.attrs.rowspan)return!1;if(t){let l,a=o.attrs,s=[],d=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let c=H(e),h=e.tr;for(let e=0;e<c.right-c.left;e++)s.push(d?{...a,colwidth:d&&d[e]?[d[e]]:null}:a);for(let e=c.top;e<c.bottom;e++){let t=c.map.positionAt(e,c.left,c.table);e==c.top&&(t+=o.nodeSize);for(let r=c.left,i=0;r<c.right;r++,i++)(r!=c.left||e!=c.top)&&h.insert(l=h.mapping.map(t+c.tableStart,1),n({node:o,row:e,col:r}).createAndFill(s[i]))}h.setNodeMarkup(r,n({node:o,row:c.top,col:c.left}),s[0]),i instanceof C&&h.setSelection(new C(h.doc.resolve(i.$anchorCell.pos),l?h.doc.resolve(l):void 0)),t(h)}return!0})(e,t)}function B(e,t){return function(n,l){if(!f(n))return!1;let o=m(n);if(o.nodeAfter.attrs[e]===t)return!1;if(l){let r=n.tr;n.selection instanceof C?n.selection.forEachCell((n,l)=>{n.attrs[e]!==t&&r.setNodeMarkup(l,null,{...n.attrs,[e]:t})}):r.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),l(r)}return!0}}function j(e,t,n){let l=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<l.length;e++){let o=t.table.nodeAt(l[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function O(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t,n){if(!f(t))return!1;if(n){let l=h(t.schema),o=H(t),r=t.tr,i=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),a=i.map(e=>o.table.nodeAt(e));for(let e=0;e<i.length;e++)a[e].type==l.header_cell&&r.setNodeMarkup(o.tableStart+i[e],l.cell,a[e].attrs);if(0==r.steps.length)for(let e=0;e<i.length;e++)r.setNodeMarkup(o.tableStart+i[e],l.header_cell,a[e].attrs);n(r)}return!0}:function(t,n){if(!f(t))return!1;if(n){let l=h(t.schema),o=H(t),r=t.tr,i=j("row",o,l),a=j("column",o,l),s=("column"===e?i:"row"===e&&a)?1:0,d="column"==e?{left:0,top:s,right:1,bottom:o.map.height}:"row"==e?{left:s,top:0,right:o.map.width,bottom:1}:o,c="column"==e?a?l.cell:l.header_cell:"row"==e?i?l.cell:l.header_cell:l.cell;o.map.cellsInRect(d).forEach(e=>{let t=e+o.tableStart,n=r.doc.nodeAt(t);n&&r.setNodeMarkup(t,c,n.attrs)}),n(r)}return!0}}O("row",{useDeprecatedLogic:!0}),O("column",{useDeprecatedLogic:!0});var _=O("cell",{useDeprecatedLogic:!0});function I(e){return function(t,n){if(!f(t))return!1;let l=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let l=e.node(-1).child(t),o=l.lastChild;if(o)return n-1-o.nodeSize;n-=l.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),l=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return l+1;l+=e.nodeSize}}return null}(m(t),e);if(null==l)return!1;if(n){let e=t.doc.resolve(l);n(t.tr.setSelection(r.Bs.between(e,e.node(0).resolve(e.pos+e.nodeAfter.nodeSize))).scrollIntoView())}return!0}}function Y(e,t){let n=e.selection.$anchor;for(let l=n.depth;l>0;l--)if("table"==n.node(l).type.spec.tableRole)return t&&t(e.tr.delete(n.before(l),n.after(l)).scrollIntoView()),!0;return!1}function F(e,t){let n=e.selection;if(!(n instanceof C))return!1;if(t){let l=e.tr,o=h(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||l.replace(l.mapping.map(t+1),l.mapping.map(t+e.nodeSize-1),new i.p2(o,0,0))}),l.docChanged&&t(l)}return!0}function X(e,t){let n=e.createAndFill();return new d.wx(n).replace(0,n.content.size,t).doc}function K(e,t,n,l,o,r,i,a){if(0==i||i==t.height)return!1;let s=!1;for(let d=o;d<r;d++){let o=i*t.width+d,r=t.map[o];if(t.map[o-t.width]==r){s=!0;let o=n.nodeAt(r),{top:c,left:h}=t.findCell(r);e.setNodeMarkup(e.mapping.slice(a).map(r+l),null,{...o.attrs,rowspan:i-c}),e.insert(e.mapping.slice(a).map(t.positionAt(i,h,n)),o.type.createAndFill({...o.attrs,rowspan:c+o.attrs.rowspan-i})),d+=o.attrs.colspan-1}}return s}function U(e,t,n,l,o,r,i,a){if(0==i||i==t.width)return!1;let s=!1;for(let d=o;d<r;d++){let o=d*t.width+i,r=t.map[o];if(t.map[o-1]==r){s=!0;let o=n.nodeAt(r),c=t.colCount(r),h=e.mapping.slice(a).map(r+l);e.setNodeMarkup(h,null,y(o.attrs,i-c,o.attrs.colspan-(i-c))),e.insert(h+o.nodeSize,o.type.createAndFill(y(o.attrs,0,i-c))),d+=o.attrs.rowspan-1}}return s}function V(e,t,n,l,o){let r=n?e.doc.nodeAt(n-1):e.doc;if(!r)throw Error("No table found");let a=c.get(r),{top:s,left:d}=l,p=d+o.width,u=s+o.height,f=e.tr,m=0;function g(){if(!(r=n?f.doc.nodeAt(n-1):f.doc))throw Error("No table found");a=c.get(r),m=f.mapping.maps.length}(function(e,t,n,l,o,r,a){let s,d;let c=h(e.doc.type.schema);if(o>t.width)for(let r=0,i=0;r<t.height;r++){let a;let h=n.child(r);i+=h.nodeSize;let p=[];a=null==h.lastChild||h.lastChild.type==c.cell?s||(s=c.cell.createAndFill()):d||(d=c.header_cell.createAndFill());for(let e=t.width;e<o;e++)p.push(a);e.insert(e.mapping.slice(0).map(i-1+l),p)}if(r>t.height){let a=[];for(let e=0,l=(t.height-1)*t.width;e<Math.max(t.width,o);e++){let o=!(e>=t.width)&&n.nodeAt(t.map[l+e]).type==c.header_cell;a.push(o?d||(d=c.header_cell.createAndFill()):s||(s=c.cell.createAndFill()))}let h=c.row.create(null,i.HY.from(a)),p=[];for(let e=t.height;e<r;e++)p.push(h);e.insert(e.mapping.slice(0).map(l+n.nodeSize-2),p)}return!!(s||d)})(f,a,r,n,p,u,0)&&g(),K(f,a,r,n,d,p,s,m)&&g(),K(f,a,r,n,d,p,u,m)&&g(),U(f,a,r,n,s,u,d,m)&&g(),U(f,a,r,n,s,u,p,m)&&g();for(let e=s;e<u;e++){let t=a.positionAt(e,d,r),l=a.positionAt(e,p,r);f.replace(f.mapping.slice(m).map(t+n),f.mapping.slice(m).map(l+n),new i.p2(o.rows[e-s],0,0))}g(),f.setSelection(new C(f.doc.resolve(n+a.positionAt(s,d,r)),f.doc.resolve(n+a.positionAt(u-1,p-1,r)))),t(f)}var q=(0,s.$)({ArrowLeft:J("horiz",-1),ArrowRight:J("horiz",1),ArrowUp:J("vert",
4-1),ArrowDown:J("vert",1),"Shift-ArrowLeft":G("horiz",-1),"Shift-ArrowRight":G("horiz",1),"Shift-ArrowUp":G("vert",-1),"Shift-ArrowDown":G("vert",1),Backspace:F,"Mod-Backspace":F,Delete:F,"Mod-Delete":F});function Z(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function J(e,t){return(n,l,o)=>{if(!o)return!1;let i=n.selection;if(i instanceof C)return Z(n,l,r.Y1.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;let a=en(o,e,t);if(null==a)return!1;if("horiz"==e)return Z(n,l,r.Y1.near(n.doc.resolve(i.head+t),t));{let o;let i=n.doc.resolve(a),s=b(i,e,t);return o=s?r.Y1.near(s,1):t<0?r.Y1.near(n.doc.resolve(i.before(-1)),-1):r.Y1.near(n.doc.resolve(i.after(-1)),1),Z(n,l,o)}}}function G(e,t){return(n,l,o)=>{let r;if(!o)return!1;let i=n.selection;if(i instanceof C)r=i;else{let l=en(o,e,t);if(null==l)return!1;r=new C(n.doc.resolve(l))}let a=b(r.$headCell,e,t);return!!a&&Z(n,l,new C(r.$anchorCell,a))}}function Q(e,t){let n=u(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new C(n))),!0)}function ee(e,t,n){if(!f(e.state))return!1;let l=function(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:l}=e;for(;1==t.childCount&&(n>0&&l>0||"table"==t.child(0).type.spec.tableRole);)n--,l--,t=t.child(0).content;let o=t.child(0),r=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==r)for(let e=0;e<t.childCount;e++){let o=t.child(e).content,r=e?0:Math.max(0,n-1),d=e<t.childCount-1?0:Math.max(0,l-1);(r||d)&&(o=X(h(a).row,new i.p2(o,r,d)).content),s.push(o)}else{if("cell"!=r&&"header_cell"!=r)return null;s.push(n||l?X(h(a).row,new i.p2(t,n,l)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let l=t[e];for(let t=l.childCount-1;t>=0;t--){let{rowspan:o,colspan:r}=l.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+r}}let l=0;for(let e=0;e<n.length;e++)l=Math.max(l,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(i.HY.empty),n[o]<l){let r=h(e).cell.createAndFill(),a=[];for(let e=n[o];e<l;e++)a.push(r);t[o]=t[o].append(i.HY.from(a))}return{height:t.length,width:l,rows:t}}(a,s)}(n),o=e.state.selection;if(o instanceof C){l||(l={width:1,height:1,rows:[i.HY.from(X(h(e.state.schema).cell,n))]});let t=o.$anchorCell.node(-1),r=o.$anchorCell.start(-1),a=c.get(t).rectBetween(o.$anchorCell.pos-r,o.$headCell.pos-r);return l=function({width:e,height:t,rows:n},l,o){if(e!=l){let t=[],o=[];for(let e=0;e<n.length;e++){let r=n[e],a=[];for(let n=t[e]||0,o=0;n<l;o++){let i=r.child(o%r.childCount);n+i.attrs.colspan>l&&(i=i.type.createChecked(y(i.attrs,i.attrs.colspan,n+i.attrs.colspan-l),i.content)),a.push(i),n+=i.attrs.colspan;for(let n=1;n<i.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+i.attrs.colspan}o.push(i.HY.from(a))}n=o,e=l}if(t!=o){let e=[];for(let l=0,r=0;l<o;l++,r++){let a=[],s=n[r%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);l+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(i.HY.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(l,a.right-a.left,a.bottom-a.top),V(e.state,e.dispatch,r,a,l),!0}if(!l)return!1;{let t=m(e.state),n=t.start(-1);return V(e.state,e.dispatch,n,c.get(t.node(-1)).findCell(t.pos-n),l),!0}}function et(e,t){var n;let l;if(t.ctrlKey||t.metaKey)return;let o=el(e,t.target);if(t.shiftKey&&e.state.selection instanceof C)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&null!=(l=u(e.state.selection.$anchor))&&(null==(n=eo(e,t))?void 0:n.pos)!=l.pos)r(l,t),t.preventDefault();else if(!o)return;function r(t,n){let l=eo(e,n),o=null==p.getState(e.state);if(!l||!w(t,l)){if(!o)return;l=t}let r=new C(t,l);if(o||!e.state.selection.eq(r)){let n=e.state.tr.setSelection(r);o&&n.setMeta(p,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=p.getState(e.state)&&e.dispatch(e.state.tr.setMeta(p,-1))}function a(n){let l;let a=p.getState(e.state);if(null!=a)l=e.state.doc.resolve(a);else if(el(e,n.target)!=o&&!(l=eo(e,t)))return i();l&&r(l,n)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}
4function en(e,t,n){if(!(e.state.selection instanceof r.Bs))return null;let{$head:l}=e.state.selection;for(let o=l.depth-1;o>=0;o--){let r=l.node(o);if((n<0?l.index(o):l.indexAfter(o))!=(n<0?0:r.childCount))break;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){let r=l.before(o),i="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(i)?r:null}}return null}function el(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function eo(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?u(e.state.doc.resolve(n.pos)):null}var er=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),ei(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,ei(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function ei(e,t,n,l,o,r){var i;let a=0,s=!0,d=t.firstChild,c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){let{colspan:i,colwidth:h}=c.child(e).attrs;for(let e=0;e<i;e++,n++){let i=o==n?r:h&&h[e],c=i?i+"px":"";if(a+=i||l,i||(s=!1),d)d.style.width!=c&&(d.style.width=c),d=d.nextSibling;else{let e=document.createElement("col");e.style.width=c,t.appendChild(e)}}}for(;d;){let e=d.nextSibling;null==(i=d.parentNode)||i.removeChild(d),d=e}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var ea=new r.H$("tableColumnResizing");function es({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:l=er,lastColumnResizable:o=!0}={}){let i=new r.Sy({key:ea,state:{init(e,t){var o,r;let a=null==(r=null==(o=i.spec)?void 0:o.props)?void 0:r.nodeViews,s=h(t.schema).table.name;return l&&a&&(a[s]=(e,t)=>new l(e,n,t)),new ed(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{let t=ea.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,l){if(!e.editable)return;let o=ea.getState(e.state);if(o&&!o.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),i=-1;if(r){let{left:l,right:o}=r.getBoundingClientRect();t.clientX-l<=n?i=ec(e,t,"left",n):o-t.clientX<=n&&(i=ec(e,t,"right",n))}if(i!=o.activeHandle){if(!l&&-1!==i){let t=e.state.doc.resolve(i),n=t.node(-1),l=c.get(n),o=t.start(-1);if(l.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==l.width-1)return}ep(e,i)}}}(t,n,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;let t=ea.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ep(e,-1)}(e)},mousedown:(e,l)=>{!function(e,t,n,l){var o;if(!e.editable)return;let r=null!=(o=e.dom.ownerDocument.defaultView)?o:window,i=ea.getState(e.state);if(!i||-1==i.activeHandle||i.dragging)return;let a=e.state.doc.nodeAt(i.activeHandle),s=function(e,t,{colspan:n,colwidth:l}){let o=l&&l[l.length-1];if(o)return o;let r=e.domAtPos(t),i=r.node.childNodes[r.offset].offsetWidth,a=n;if(l)for(let e=0;e<n;e++)l[e]&&(i-=l[e],a--);return i/a}(e,i.activeHandle,a.attrs);function d(t){r.removeEventListener("mouseup",d),r.removeEventListener("mousemove",h);let l=ea.getState(e.state);(null==l?void 0:l.dragging)&&(function(e,t,n){let l=e.state.doc.resolve(t),o=l.node(-1),r=c.get(o),i=l.start(-1),a=r.colCount(l.pos-i)+l.nodeAfter.attrs.colspan-1,s=e.state.tr;for(let e=0;e<r.height;e++){let t=e*r.width+a;if(e&&r.map[t]==r.map[t-r.width])continue;let l=r.map[t],d=o.nodeAt(l).attrs,c=1==d.colspan?0:a-r.colCount(l);if(d.colwidth&&d.colwidth[c]==n)continue;let h=d.colwidth?d.colwidth.slice():Array(d.colspan).fill(0);h[c]=n,s.setNodeMarkup(i+l,null,{...d,colwidth:h})}s.docChanged&&e.dispatch(s)}(e,l.activeHandle,eh(l.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ea,{setDragging:null})))}function h(t){if(!t.which)return d(t);
4let o=ea.getState(e.state);if(o&&o.dragging){let r=eh(o.dragging,t,n);eu(e,o.activeHandle,r,l)}}e.dispatch(e.state.tr.setMeta(ea,{setDragging:{startX:t.clientX,startWidth:s}})),eu(e,i.activeHandle,s,l),r.addEventListener("mouseup",d),r.addEventListener("mousemove",h),t.preventDefault()}(e,l,t,n)}},decorations:e=>{let t=ea.getState(e);if(t&&t.activeHandle>-1)return function(e,t){var n;let l=[],o=e.doc.resolve(t),r=o.node(-1);if(!r)return a.EH.empty;let i=c.get(r),s=o.start(-1),d=i.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let t=0;t<i.height;t++){let o=d+t*i.width;if((d==i.width-1||i.map[o]!=i.map[o+1])&&(0==t||i.map[o]!=i.map[o-i.width])){let t=i.map[o],d=s+t+r.nodeAt(t).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null==(n=ea.getState(e))?void 0:n.dragging)&&l.push(a.p.node(s+t,s+t+r.nodeAt(t).nodeSize,{class:"column-resize-dragging"})),l.push(a.p.widget(d,c))}}return a.EH.create(e.doc,l)}(e,t.activeHandle)},nodeViews:{}}});return i}var ed=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=t.getMeta(ea);if(n&&null!=n.setHandle)return new e(n.setHandle,!1);if(n&&void 0!==n.setDragging)return new e(this.activeHandle,n.setDragging);if(this.activeHandle>-1&&t.docChanged){let n=t.mapping.map(this.activeHandle,-1);return g(t.doc.resolve(n))||(n=-1),new e(n,this.dragging)}return this}};function ec(e,t,n,l){let o=e.posAtCoords({left:t.clientX+("right"==n?-l:l),top:t.clientY});if(!o)return -1;let{pos:r}=o,i=u(e.state.doc.resolve(r));if(!i)return -1;if("right"==n)return i.pos;let a=c.get(i.node(-1)),s=i.start(-1),d=a.map.indexOf(i.pos-s);return d%a.width==0?-1:s+a.map[d-1]}function eh(e,t,n){let l=t.clientX-e.startX;return Math.max(n,e.startWidth+l)}function ep(e,t){e.dispatch(e.state.tr.setMeta(ea,{setHandle:t}))}function eu(e,t,n,l){let o=e.state.doc.resolve(t),r=o.node(-1),i=o.start(-1),a=c.get(r).colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1,s=e.domAtPos(o.start(-1)).node;for(;s&&"TABLE"!=s.nodeName;)s=s.parentNode;s&&ei(r,s.firstChild,s,l,a,n)}function ef({allowTableNodeSelection:e=!1}={}){return new r.Sy({key:p,state:{init:()=>null,apply(e,t){let n=e.getMeta(p);if(null!=n)return -1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:l,pos:o}=e.mapping.mapResult(t);return l?null:o}},props:{decorations:M,handleDOMEvents:{mousedown:et},createSelectionBetween:e=>null!=p.getState(e.state)?e.state.selection:null,handleTripleClick:Q,handleKeyDown:q,handlePaste:ee},appendTransaction:(t,n,l)=>(function(e,t,n){let l,o;let i=(t||e).selection,a=(t||e).doc;if(i instanceof r.qv&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)l=C.create(a,i.from);else if("row"==o){let e=a.resolve(i.from+1);l=C.rowSelection(e,e)}else if(!n){let e=c.get(i.node),t=i.from+1,n=t+e.map[e.width*e.height-1];l=C.create(a,t+1,n)}}else i instanceof r.Bs&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,l=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,l--);return n==l&&/row|table/.test(e.node(o).type.spec.tableRole)}(i)?l=r.Bs.create(a,i.from):i instanceof r.Bs&&function({$from:e,$to:t}){let n,l;for(let t=e.depth;t>0;t--){let l=e.node(t);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){l=n;break}}return n!==l&&0===t.parentOffset}(i)&&(l=r.Bs.create(a,i.$from.start(),i.$from.end()));return l&&(t||(t=e.tr)).setSelection(l),t})(l,x(l,n),e)})}},47853:function(e,t,n){"use strict";n.d(t,{x:function(){return S}});var l=n(67294),o=n(85893),r=n(71284),i=n(5865),a=n(2376),s=Object.defineProperty,d=Object.defineProperties,c=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,f=(e,t,n)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||(t={}))p.call(t,n)&&f(e,n,t[n]);if(h)for(var n of h(t))u.call(t,n)&&f(e,n,t[n]);return e},g=(e,t)=>d(e,c(t)),w=(e,t,n)=>new Promise((l,o)=>{var r=e=>{try{a(n.next(e))}catch(e){o(e)}},i=e=>{try{a(n.throw(e))}catch(e){o(e)}},a=e=>e.done?l(e.value):Promise.resolve(e.value).then(r,i);a((n=n.apply(e,t)).next())}),b=e=>
4{let{updateAttributes:t,node:{attrs:n},editor:r,extension:i}=e,{captionProps:a}=i.options,s=(0,l.useRef)(null);return(0,o.jsx)("span",g(m({},a),{ref:s,className:`caption ${(null==a?void 0:a.className)||""}`,contentEditable:r.isEditable,onBlur:e=>{if(!s.current)return;let{innerText:n,innerHTML:l}=e.target,o=(null==n?void 0:n.replaceAll(`
5`,""))==="",r=l.replaceAll("<div>",`
6`).replaceAll("</div>","").replaceAll("<br>",""),i=o?"":r;s.current.innerHTML=i,t({caption:i})},onPaste:e=>{e.preventDefault();let t=e.clipboardData.getData("text/plain"),n=window.getSelection();if(n&&t){let e=n.getRangeAt(0);n.deleteFromDocument(),e.insertNode(document.createTextNode(t)),e.setStart(e.endContainer,e.endOffset)}},onKeyDown:e=>{if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();let t=window.getSelection();if(t){let n=t.getRangeAt(0);n.selectNodeContents(e.currentTarget),t.addRange(n)}}},dangerouslySetInnerHTML:{__html:n.caption||""}}))};function y(e,t,n){return Math.min(Math.max(e,t),n)}var v={east:1,north:8,south:2,west:4};function C({editor:e,imageRef:t,minWidth:n,maxWidth:r,minHeight:i,maxHeight:a,keepRatio:s,onResizeEnd:d,onResizeStart:c}){let h=(0,l.useRef)(null),p=(0,l.useRef)({currentHeight:0,currentWidth:0,direction:0,isResizing:!1,ratio:0,startHeight:0,startWidth:0,startX:0,startY:0}),u=e.view.dom,f=e=>{let t=e===v.east||e===v.west,n=e===v.north||e===v.south,l=e&v.north&&e&v.west||e&v.south&&e&v.east,o=t?"ew":n?"ns":l?"nwse":"nesw";null!==u&&u.style.setProperty("cursor",`${o}-resize`,"important"),null!==document.body&&(document.body.style.setProperty("cursor",`${o}-resize`,"important"),document.body.style.setProperty("-webkit-user-select","none","important"))},m=()=>{null!==u&&u.style.removeProperty("cursor"),null!==document.body&&(document.body.style.removeProperty("cursor"),document.body.style.removeProperty("-webkit-user-select"))},g=(n,l)=>{if(!e.isEditable)return;let o=t.current,r=h.current;if(null!==o&&null!==r){n.preventDefault();let{width:e,height:t}=o.getBoundingClientRect(),i=p.current;i.startWidth=e,i.startHeight=t,i.ratio=e/t,i.currentWidth=e,i.currentHeight=t,i.startX=n.clientX,i.startY=n.clientY,i.isResizing=!0,i.direction=l,f(l),null==c||c(),r.classList.add("image-control-wrapper--resizing"),o.style.height=`${t}px`,o.style.width=`${e}px`,document.addEventListener("pointermove",w),document.addEventListener("pointerup",b)}},w=e=>{let l=t.current,o=p.current,d=o.direction&(v.east|v.west),c=o.direction&(v.south|v.north);if(!(null===l||!o.isResizing)){if(s){let t=0,s=0;if(d){let l=Math.floor(o.startX-e.clientX);l=o.direction&v.east?-l:l,s=(t=y(o.startWidth+l,n,r))/o.ratio}else{let n=Math.floor(o.startY-e.clientY);n=o.direction&v.south?-n:n,t=(s=y(o.startHeight+n,i,a))*o.ratio}if(t<n||t>r||s<i||s>a)return;l.style.width=`${t}px`,l.style.height=`${s}px`,l.style.maxWidth=`${t}
6px`,o.currentHeight=s,o.currentWidth=t;return}if(d&&c){let t=Math.floor(o.startX-e.clientX);t=o.direction&v.east?-t:t;let s=Math.floor(o.startY-e.clientY);s=o.direction&v.south?-s:s;let d=y(o.startWidth+t,n,r),c=y(o.startHeight+s,i,a);l.style.width=`${d}px`,l.style.height=`${c}px`,l.style.maxWidth=`${d}px`,o.currentHeight=c,o.currentWidth=d}else if(c){let t=Math.floor(o.startY-e.clientY);t=o.direction&v.south?-t:t;let n=y(o.startHeight+t,i,a);l.style.height=`${n}px`,o.currentHeight=n}else{let t=Math.floor(o.startX-e.clientX);t=o.direction&v.east?-t:t;let i=y(o.startWidth+t,n,r);l.style.width=`${i}px`,l.style.maxWidth=`${i}px`,o.currentWidth=i}}},b=()=>{let e=t.current,n=p.current,l=h.current;if(null!==e&&null!==l&&n.isResizing){let e=n.currentWidth,t=n.currentHeight;n.startWidth=0,n.startHeight=0,n.ratio=0,n.startX=0,n.startY=0,n.currentWidth=0,n.currentHeight=0,n.isResizing=!1,l.classList.remove("image-control-wrapper--resizing"),m(),d(e,t),document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",b)}};return(0,o.jsxs)("div",{ref:h,children:[(0,o.jsx)("div",{className:"image-resizer image-resizer-n",onPointerDown:e=>{g(e,v.north)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-ne",onPointerDown:e=>{g(e,v.north|v.east)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-e",onPointerDown:e=>{g(e,v.east)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-se",onPointerDown:e=>{g(e,v.south|v.east)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-s",onPointerDown:e=>{g(e,v.south)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-sw",onPointerDown:e=>{g(e,v.south|v.west)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-w",onPointerDown:e=>{g(e,v.west)}}),(0,o.jsx)("div",{className:"image-resizer image-resizer-nw",onPointerDown:e=>{g(e,v.north|v.west)}})]})}var A=e=>{let{updateAttributes:t,node:n,extension:r,editor:i}=e,a=(0,l.useRef)(null),s=n.attrs,d=r.options,c=!i.isEditable,{width:h,height:p}=s,u=s["data-keep-ratio"],f=g(m({},s),{style:g(m({},!u&&{width:h,height:p}||{}),{maxWidth:h})});return c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",m({},f)),d.withCaption&&s.caption&&(0,o.jsx)(b,m({},e))]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",g(m({},f),{ref:a,onContextMenu:t=>{var n;null==(n=d.onContextMenu)||n.call(d,t,e)}})),d.withCaption&&(0,o.jsx)(b,m({},e)),(0,o.jsx)(C,{editor:i,imageRef:a,minWidth:d.minWidth,maxWidth:d.maxWidth,minHeight:d.minHeight,maxHeight:d.maxHeight,keepRatio:u,onResizeEnd:(e,n)=>{u&&a.current&&(a.current.style.width="",a.current.style.height=""),t({width:e,height:n})}})]})},M=e=>(0,o.jsx)(r.T5,{className:"image-component","data-drag-handle":!0,children:(0,o.jsx)(A,m({},e))}),$=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,x=e=>new Promise((t,n)=>{let l=new Image,o=URL.createObjectURL(e);l.onload=()=>{t({width:l.width,height:l.height}),URL.revokeObjectURL(o)},l.onerror=()=>{URL.revokeObjectURL(o),n(Error("Failed to load image"))},l.src=o}),H=(e,t,n)=>w(null,null,function*(){var l;if(!e["data-keep-ratio"])return Promise.resolve(e);let{width:o,height:r}=yield x(t),i=null!=(l=e.width)?l:n.defaultWidth;return g(m({},e),{width:i,height:r/o*i})}),S=i.NB.create({name:"image",group:"inline",inline:!0,draggable:!0,atom:!0,addOptions:()=>({HTMLAttributes:{},defaultHeight:500,defaultWidth:500,minWidth:100,maxWidth:16384,minHeight:100,maxHeight:1/0,allowBase64:!0}),addAttributes(){return{src:{default:""},alt:{default:""},title:{default:""},width:{default:this.options.defaultWidth},height:{default:this.options.defaultHeight},"data-keep-ratio":{parseHTML:e=>"false"!==e.getAttribute("data-keep-ratio"),renderHTML:e=>e["data-keep-ratio"]?{style:`max-width: ${e.width}px`,"data-keep-ratio":"true"}:{},default:!0},className:{parseHTML:e=>e.getAttribute("class"),renderHTML:e=>({class:e.className}),default:""},caption:{parseHTML:e=>{var t,n;return null==(n=null==(t=e.parentElement)?void 0:t.querySelector("span"))?void 0:n.textContent},renderHTML:()=>null,default:""}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'},{tag:"span > img + span",ignore:!0}]},renderHTML({HTMLAttributes:e,node:t}){var n,l;let o=document.createElement("span");o.classList.add("node-image");let r=document.createElement("span");r.classList.add("image-component");let a=document.createElement("img"),s=(0,i.P1)(this.options.HTMLAttributes,e);
6Object.keys(s).forEach(e=>{"caption"!==e&&a.setAttribute(e,s[e])}),r.appendChild(a);let d=t.attrs;if(d.caption){let e=document.createElement("span");e.classList.add("caption",...(null==(l=null==(n=this.options.captionProps)?void 0:n.className)?void 0:l.split(" "))||""),e.innerHTML=d.caption,r.appendChild(e)}return o.appendChild(r),o},addCommands(){return{setResizableImage:(e,t,n)=>({commands:l})=>l.insertContentAt(t||this.editor.state.selection.head,{type:this.name,attrs:e},n)}},addInputRules(){return[(0,i.x2)({find:$,type:this.type,getAttributes:e=>{let[,,t,n,l]=e;return{src:n,alt:t,title:l}}})]},addProseMirrorPlugins(){return[new a.Sy({key:new a.H$(this.name),props:{handlePaste:(e,t,n)=>{var l,o,r;let i=null==(l=t.clipboardData)?void 0:l.files;if((null==(o=n.content.firstChild)?void 0:o.type.name)===this.name)return this.editor.commands.setResizableImage(m({},n.content.firstChild.attrs)),!0;let a=!(null!=(r=t.clipboardData)&&r.getData("text/html"));if(!i||0===i.length||!this.options.onUpload||!a)return!1;let s=this.editor.state.selection.head;for(let e of i)this.options.onUpload(e).then(t=>H(t,e,this.options)).then(e=>{this.editor.chain().focus().setResizableImage(e,s,{updateSelection:!1}).run()});return!0},handleDrop:(e,t)=>{var n,l;t.preventDefault();let o=null==(n=t.dataTransfer)?void 0:n.files,r=!(null!=(l=t.dataTransfer)&&l.getData("text/html"));if(!o||0===o.length||!this.options.onUpload||!r)return!1;let i=e.posAtCoords({left:t.clientX,top:t.clientY});for(let e of o)this.options.onUpload(e).then(t=>H(t,e,this.options)).then(e=>{this.editor.chain().focus().setResizableImage(e,null==i?void 0:i.pos,{updateSelection:!1}).run()})}}})]},addNodeView:()=>(0,r.fW)(e=>M(e),{className:"node-image"})})}}]);

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.